/* Page de suivi d'une journée rejouée (copil du 28/10/2026). Aucune ressource externe (CLAUDE.md règle 3) :
   polices système, palette validée (outil dataviz, clair et sombre). */
:root {
  color-scheme: light;
  --fond: #f5f6f4;
  --surface: #fcfcfb;
  --texte: #0b0b0b;
  --texte-2: #52514e;
  --texte-3: #75746f;
  --trait: #e3e2dd;
  --accent: #2a78d6;
  --s1: #2a78d6; /* terminée */
  --s2: #eb6834; /* en cours */
  --s3: #1baf7a; /* affectée */
  --s4: #eda100; /* à affecter */
  --s5: #e87ba4; /* annulée */
  --s6: #008300; /* transférée */
  --mieux: #2a78d6;      /* banc : meilleur de la colonne */
  --moins-bien: #eb6834; /* banc : moins bon de la colonne */
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --fond: #121211;
    --surface: #1a1a19;
    --texte: #f0efec;
    --texte-2: #c3c2b7;
    --texte-3: #9a998f;
    --trait: #33332f;
    --accent: #3987e5;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300;
    --mieux: #3987e5; --moins-bien: #d95926;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fond: #121211; --surface: #1a1a19; --texte: #f0efec; --texte-2: #c3c2b7; --texte-3: #9a998f; --trait: #33332f;
  --accent: #3987e5;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300;
  --mieux: #3987e5; --moins-bien: #d95926;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.page { max-width: 1200px; margin: 0 auto; padding-inline: clamp(16px, 3vw, 40px); padding-block: 28px 48px;
  display: grid; gap: 20px; }
h1, h2 { text-wrap: balance; margin: 0; }
h1 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; }
p { margin: 0; }
[hidden] { display: none !important; }

.entete { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.entete > div { display: grid; gap: 6px; max-width: 72ch; }
.surtitre, .etiquette { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-2); }
.chapeau { color: var(--texte-2); }
.deconnexion button, .bouton {
  font: inherit; font-size: 14px; color: var(--texte); background: var(--surface); border: 1px solid var(--trait);
  border-radius: 6px; padding: 6px 12px; cursor: pointer; text-decoration: none; display: inline-block;
}
.bouton { background: var(--accent); color: #fff; border-color: var(--accent); }

.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; padding: 18px 20px;
  display: grid; gap: 12px; min-width: 0; }
.connexion { max-width: 520px; }
#contenu { display: grid; gap: 20px; }

.bandeau { display: grid; grid-template-columns: minmax(240px, 1fr) 3fr; gap: 20px; }
/* L'heure suit la largeur de sa carte (unités de conteneur) : elle n'en dépasse jamais. */
.horloge { background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; padding: 18px 20px;
  display: grid; align-content: center; gap: 2px; min-width: 0; container-type: inline-size; }
.heure { font-size: clamp(40px, 30cqi, 76px); font-weight: 650; line-height: 1.05; font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em; }
.jour { color: var(--texte-2); overflow-wrap: anywhere; }
.tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tuile { background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; padding: 14px 16px;
  display: grid; gap: 4px; align-content: start; min-width: 0; }
.valeur { font-size: 32px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.15; }
.note { font-size: 13px; color: var(--texte-2); }

.filtres { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.segments { display: inline-flex; border: 1px solid var(--trait); border-radius: 8px; overflow: hidden;
  background: var(--surface); }
.segments button { font: inherit; font-size: 14px; border: 0; background: transparent; color: var(--texte-2);
  padding: 7px 14px; cursor: pointer; }
.segments button[aria-checked="true"] { background: var(--accent); color: #fff; }
.champ { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--texte-2); }
.champ input { font: inherit; font-size: 14px; color: var(--texte); background: var(--surface);
  border: 1px solid var(--trait); border-radius: 8px; padding: 5px 8px; }
.societes { position: relative; }
.societes summary { list-style: none; cursor: pointer; font-size: 14px; border: 1px solid var(--trait);
  border-radius: 8px; padding: 7px 12px; background: var(--surface); }
.societes summary::-webkit-details-marker { display: none; }
.societes summary::after { content: " ▾"; color: var(--texte-3); }
.panneau-societes { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; width: min(380px, 90vw);
  max-height: 420px; overflow-y: auto; background: var(--surface); border: 1px solid var(--trait); border-radius: 10px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.14); padding: 10px 12px; display: grid; gap: 8px; }
.panneau-societes .actions { display: flex; gap: 8px; }
.panneau-societes .actions button { font: inherit; font-size: 13px; border: 1px solid var(--trait); border-radius: 6px;
  background: transparent; color: var(--texte); padding: 3px 10px; cursor: pointer; }
.panneau-societes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.panneau-societes label { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 3px 2px; cursor: pointer; }
.panneau-societes label span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.panneau-societes .compte { color: var(--texte-3); font-variant-numeric: tabular-nums; font-size: 13px; }

.lecteur { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; background: var(--surface);
  border: 1px solid var(--trait); border-radius: 10px; padding: 10px 16px; }
.lecture { font: inherit; font-size: 15px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; flex: none; }
.lecteur input[type="range"] { flex: 1 1 240px; min-width: 0; accent-color: var(--accent); }
.lecteur output { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 4ch; }
.commandes { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; flex: 1 1 auto; min-width: 0; }
.etat-rejeu { font-size: 14px; color: var(--texte-2); }
.etat-rejeu b { color: var(--texte); font-weight: 600; }
.lecture:disabled { opacity: 0.5; cursor: default; }
.champ select { font: inherit; font-size: 14px; color: var(--texte); background: var(--surface);
  border: 1px solid var(--trait); border-radius: 8px; padding: 5px 8px; }

.entete-banc { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; align-items: flex-start; }
.entete-banc > div { display: grid; gap: 4px; max-width: 70ch; }
.defile-table { overflow-x: auto; }
#banc-resume { font-size: 15px; }
#banc-resume b { font-variant-numeric: tabular-nums; }
/* Attente du calcul du banc (une quinzaine de secondes). */
.attente { display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 50%;
  border: 2px solid var(--trait); border-top-color: var(--accent); animation: tourne 0.8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .attente { animation-duration: 2.4s; } }
/* « ! » d'une ligne qui regroupe plusieurs réglages : l'explication au survol (et au focus clavier). */
.marque-info { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; vertical-align: 1px;
  border-radius: 50%; background: var(--accent); color: var(--surface); font-size: 11px; font-weight: 700; cursor: help; }
.ecart { color: var(--texte-2); font-size: 13px; }
/* Teinte du meilleur (bleu) au moins bon (orange) de chaque colonne, neutre au milieu ; le texte garde sa couleur. */
.table td.teinte { background: color-mix(in oklab, var(--teinte) var(--force), transparent); }
.legende-banc { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--texte-2); align-items: center; }
.legende-banc i { width: 28px; height: 12px; border-radius: 3px; display: inline-block; vertical-align: -1px; }
/* En classes, pas en attribut style : la CSP de la page (style-src 'self') refuse les styles en ligne. */
.legende-banc .pastille-mieux { background: color-mix(in oklab, var(--mieux) 38%, transparent); }
.legende-banc .pastille-moins-bien { background: color-mix(in oklab, var(--moins-bien) 38%, transparent); }

.figure { margin: 0; }
.figure figcaption { display: grid; gap: 4px; }
.figure figcaption p { color: var(--texte-2); max-width: 80ch; }
.legende { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px;
  color: var(--texte-2); }
.legende li { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.graphique { position: relative; overflow-x: auto; }
#svg { display: block; width: 100%; min-width: 640px; height: auto; }
.axe text { fill: var(--texte-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.axe line { stroke: var(--trait); stroke-width: 1; }
.libelle { fill: var(--texte-2); font-size: 12px; }
.maintenant line { stroke: var(--texte-2); stroke-width: 1; }
.maintenant text { fill: var(--texte-2); font-size: 12px; }
.infobulle { position: absolute; pointer-events: none; background: var(--surface); color: var(--texte);
  border: 1px solid var(--trait); border-radius: 8px; padding: 8px 10px; font-size: 13px; min-width: 190px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.12); }
.infobulle b { display: block; margin-bottom: 4px; }
.infobulle div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.infobulle span { display: inline-flex; align-items: center; gap: 6px; }
.infobulle i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--trait); vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--texte-2); font-weight: 500; }
.table td:first-child { white-space: nowrap; }
.table td:first-child i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 8px; }
.table td:nth-child(2) { color: var(--texte-2); }
.nombre { text-align: right !important; font-variant-numeric: tabular-nums; }
.pied { font-size: 13px; color: var(--texte-3); }

@media (max-width: 900px) {
  .bandeau { grid-template-columns: 1fr; }
  .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
