/* Thème clair seul (décision de Syn0, 05/11/2026) : pas de mode sombre automatique. */
:root {
  --fond: #f4f6f9;
  --carte: #ffffff;
  --texte: #1b2430;
  --discret: #58657a;
  --trait: #dbe1ea;
  --accent: #0a7d5a;
  --violet: #6b3fb0;
  --bleu: #1f4e9e;
  --focus: #c4560a;
  --bandeau-fond: #fff4d6;
  --bandeau-texte: #5a4300;
  --ok: #0a7d5a;
  --alerte: #a32d2d;
  --retard: #c4560a;
  --exemple: #c4560a;
  --gris: #e8ecf2;
  color-scheme: light;
}

* { box-sizing: border-box; }
html {
  font-size: 18px;
  scroll-padding: 140px 0 120px;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 0.5rem 0.75rem 1rem; min-width: 0; }
main:focus { outline: none; }
h1 { font-size: 1.3rem; margin: 0; color: var(--accent); }
h2 { font-size: 1.15rem; margin: 0.75rem 0 0.4rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.4rem; }
p { margin: 0.3rem 0; }

.entete { padding: 0.6rem 0.75rem; background: var(--carte); border-top: 5px solid var(--accent); border-bottom: 1px solid var(--trait); }
.entete-haut { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.etat-donnees { color: var(--discret); font-size: 0.9rem; }
.message { padding: 0.5rem 0.75rem; border: 2px solid var(--alerte); border-radius: 8px; color: var(--alerte); font-weight: 600; }
.exemple {
  padding: 0.1rem 0.6rem; border: 2px solid var(--exemple); color: var(--exemple);
  border-radius: 6px; font-weight: 800; letter-spacing: 0.08em;
}

/* Bandeau permanent (barre courte fixe + texte complet en pied) : ne pas le raccourcir. */
.bandeau-court {
  position: sticky; bottom: 0; z-index: 10; text-align: center;
  padding: 0.3rem 0.6rem; background: var(--bandeau-fond); color: var(--bandeau-texte);
  border-top: 2px solid var(--bandeau-texte); font-size: 0.85rem; font-weight: 600;
}
.bandeau {
  padding: 0.5rem 0.75rem; background: var(--bandeau-fond); color: var(--bandeau-texte);
  border-top: 2px solid var(--bandeau-texte); font-size: 0.85rem;
}

/* Boutons et liens-boutons */
.bouton, .lig, .ligne-course {
  min-height: 48px; min-width: 48px; color: inherit; text-decoration: none;
}
.bouton {
  display: inline-flex; align-items: center; justify-content: center; padding: 0.4rem 0.9rem;
  background: var(--carte); border: 2px solid var(--accent); border-radius: 10px;
  color: var(--accent); font: inherit; font-weight: 700; cursor: pointer;
}
.barre { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.5rem 0; }

:focus-visible, body.tv :focus { outline: 4px solid var(--focus); outline-offset: 2px; }

/* Pastilles de numéros (repère sombre) et repère « R1 C1 » */
.num {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.8em; height: 1.8em;
  padding: 0 0.2em; border-radius: 6px; background: var(--texte); color: #fff; font-weight: 700; font-size: 0.85em;
  font-variant-numeric: tabular-nums;
}
.tri { display: inline-flex; gap: 3px; }
.tri.matin .num { background: #fff; color: var(--texte); border: 2px dashed var(--texte); }
.rc {
  background: var(--texte); color: #fff; border-radius: 4px; padding: 0 0.4rem;
  font-weight: 700; font-size: 0.85em; white-space: nowrap;
}

/* Statistiques */
.stats { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 0.5rem 0.75rem; margin: 0.75rem 0; }
.stats ul { margin: 0.2rem 0; padding-left: 1.1rem; }
.stats .petit { color: var(--discret); font-size: 0.85rem; }

/* Liste téléphone (proposition A) : sections par réunion */
.reunion { margin: 0.9rem 0 0.35rem; font-size: 1.05rem; font-weight: 700; color: var(--accent); }
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.lig {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 0.5rem; align-items: center;
  padding: 0.5rem 0.6rem; background: var(--carte); border: 1px solid var(--trait); border-radius: 8px;
}
.lig .heure { font-weight: 800; font-variant-numeric: tabular-nums; }
.lig .corps { min-width: 0; }
.lig .titre { font-weight: 600; }
.pastilles { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.note-liste { color: var(--discret); font-size: 0.85rem; }

.pastille { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; border: 1px solid currentColor; font-size: 0.8rem; white-space: nowrap; }
.pastille.retard { color: var(--retard); }
.pastille.arrivee { color: var(--ok); }
.pastille.annulee { color: var(--alerte); }
.pastille.en_cours { color: var(--accent); }
.pastille.a_venir { color: var(--bleu); }
.pastille.inconnu, .pastille.prochain { color: var(--discret); }

/* Détail */
.meta { color: var(--discret); }
.colonnes { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .colonnes { grid-template-columns: 1fr 1fr; } }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: 10px; padding: 0.6rem 0.75rem; margin: 0.5rem 0; min-width: 0; }
.colonnes .carte { margin: 0; }
.arrivee-pastilles { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.2rem 0; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
th, td { padding: 0.3rem 0.25rem; text-align: right; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { font-size: 0.8rem; color: var(--discret); font-weight: 600; }
th:nth-child(1), td:nth-child(1) { width: 3.2rem; text-align: center; overflow-wrap: normal; word-break: keep-all; }
th:nth-child(2), td:nth-child(2) { text-align: left; width: auto; }
th:nth-child(3), td:nth-child(3) { width: 3.2rem; }
th:nth-child(4), td:nth-child(4) { width: 3.6rem; }
td.raisons { text-align: left; color: var(--discret); font-size: 0.85rem; padding-top: 0; }
td.raisons ul { margin: 0 0 0.2rem; padding-left: 1.1rem; }
.ligne-nums { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.3rem 0; }
.note { color: var(--discret); font-size: 0.85rem; }
.nonpartant { text-decoration: line-through; }

/* Pastilles G / P / x (déjà courues, mode TV) */
.gpx {
  display: inline-flex; align-items: center; justify-content: center; width: 1.7em; height: 1.7em;
  border-radius: 50%; font-weight: 800; flex: none;
}
.gpx.G { background: var(--ok); color: #fff; }
.gpx.P { background: #f2b84b; color: #4a3300; }
.gpx.x { background: var(--gris); color: var(--discret); }

/* Mode écran TV 1920x1080 (proposition D, accent violet) : texte >= 24 px, lisible de loin */
body.tv { --accent: var(--violet); font-size: 28px; }
body.tv main { max-width: none; padding: 0.5rem 2rem 1rem; }
body.tv h1 { font-size: 2rem; }
body.tv h2 { font-size: 1.5rem; }
body.tv h3 { font-size: 26px; }
body.tv .etat-donnees, body.tv .note, body.tv .note-liste, body.tv th, body.tv td.raisons, body.tv .stats .petit,
body.tv .pastille, body.tv .bandeau, body.tv .bandeau-court, body.tv .rc, body.tv .num, body.tv .legende { font-size: 24px; }
body.tv .bouton { min-height: 64px; padding: 0.5rem 1.6rem; }
body.tv .colonnes { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
body.tv th:nth-child(1), body.tv td:nth-child(1) { width: 3rem; }
body.tv th:nth-child(3), body.tv td:nth-child(3) { width: 4.5rem; }
body.tv th:nth-child(4), body.tv td:nth-child(4) { width: 5rem; }
html:has(body.tv) { scroll-padding: 200px 0 140px; }

.tv-grille { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; align-items: start; margin-top: 0.5rem; }
.heros { background: var(--carte); border: 1px solid var(--trait); border-radius: 24px; padding: 1.5rem 2rem; min-width: 0; }
.heros .compte { font-size: 96px; font-weight: 800; color: var(--violet); line-height: 1.1; margin: 0.2rem 0; }
.heros .tete-tv { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 0.5rem; }
.heros .tete-tv .num { font-size: 64px; background: var(--violet); border-radius: 14px; }
body.tv .heros .tete-tv .num { font-size: 64px; }
.heros .tete-tv .nom { font-size: 52px; font-weight: 800; line-height: 1.1; }
.heros .puis { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 0.5rem; }
body.tv .heros .puis { font-size: 30px; }
.colonne-droite h2 { margin-top: 0; }
.colonne-droite .liste + h2 { margin-top: 1.2rem; }
body.tv .ligne-course {
  display: flex; align-items: center; gap: 1rem; min-height: 72px; padding: 0.5rem 1.2rem;
  background: var(--carte); border: 1px solid var(--trait); border-radius: 10px;
}
body.tv .ligne-course .heure { font-weight: 800; font-variant-numeric: tabular-nums; }
body.tv .ligne-course .corps { flex: 1; min-width: 0; }
body.tv .ligne-course .titre { font-weight: 600; }
.pastilles { margin-top: 0.15rem; }
.legende { color: var(--discret); margin-top: 0.5rem; }
