/* Ask To Coco — « Coco.IA, ligne A » : un faux assistant d'IA et un plan de ligne de RER.
   Blanc cassé, encre marine, rouge de ligne ; vert pour le trafic normal, ambre pour les perturbations.
   Polices : Overpass (titres et texte) et Overpass Mono (étiquettes, numéros, fiche du modèle). */
/* Le point médian d'Overpass colle au mot qui suit : il est pris dans la police du système (unicode-range). */
@font-face { font-family: 'Overpass'; src: url(/polices/overpass.woff2) format('woff2-variations'), url(/polices/overpass.woff2) format('woff2');
  font-weight: 100 900; font-display: swap; unicode-range: U+0000-00B6, U+00B8-FFFF; }
@font-face { font-family: 'Overpass Mono'; src: url(/polices/overpass-mono-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Overpass Mono'; src: url(/polices/overpass-mono-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --fond: #f6f5f0; --fond-2: #eeece4; --carte: #ffffff; --carte-2: #faf9f5;
  --encre: #0e1a2b; --encre-2: #4a5568; --encre-3: #5f6b7a; --ligne: #e3e1d8; --ligne-forte: #c9c6ba;
  /* le rouge de la ligne, et ses déclinaisons */
  --rouge: #d3242c; --rouge-vif: #e0353d; --rouge-fonce: #9e1b21; --rouge-texte: #b21e25; --rouge-pale: #fce9ea; --rail-pale: #f2b9bc;
  /* les couleurs qui disent quelque chose : trafic normal (arrivé), perturbé (attente), au garage */
  --vert: #1e7b4e; --vert-texte: #14532f; --vert-doux: #2c4a38; --vert-pale: #e6f2ea;
  --orange: #b45309; --orange-texte: #7a3a06; --orange-doux: #5c3410; --orange-pale: #fdf0e1;
  --gris: #4f5b6b; --gris-pale: #eeece4;
  /* les surfaces sombres (tableau des départs, score, cabine de Coco) et la lumière des panneaux */
  --nuit: #0e1a2b; --nuit-2: #1c2a40; --sur-nuit: #f6f5f0; --sur-nuit-2: #c3cad6; --trait-nuit: rgba(246, 245, 240, .2); --ambre: #ffc83d;
  --ombre: 0 1px 0 rgba(14, 26, 43, .04), 0 10px 26px -14px rgba(14, 26, 43, .22);
  --rayon: 16px; --mono: 'Overpass Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --texte: 'Overpass', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0b1220; --fond-2: #162033; --carte: #131d2e; --carte-2: #1a2638;
    --encre: #eef1f6; --encre-2: #c3cad6; --encre-3: #9aa6b8; --ligne: rgba(238, 241, 246, .1); --ligne-forte: rgba(238, 241, 246, .24);
    --rouge: #d3242c; --rouge-vif: #e0353d; --rouge-fonce: #8a161c; --rouge-texte: #ff9a9f; --rouge-pale: #3a1a1d; --rail-pale: #5a2f35;
    --vert: #4cc38a; --vert-texte: #8fe0b0; --vert-doux: #b9e8cd; --vert-pale: #12301f;
    --orange: #f0a44b; --orange-texte: #ffc98a; --orange-doux: #f3d6b3; --orange-pale: #3a2714;
    --gris: #aeb8c8; --gris-pale: #222d3f;
    --nuit: #1a2638; --nuit-2: #22314a; --sur-nuit: #eef1f6; --sur-nuit-2: #aeb8c8; --trait-nuit: rgba(238, 241, 246, .18); --ambre: #ffc83d;
    --ombre: 0 1px 0 rgba(0, 0, 0, .25), 0 12px 28px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #0b1220; --fond-2: #162033; --carte: #131d2e; --carte-2: #1a2638;
  --encre: #eef1f6; --encre-2: #c3cad6; --encre-3: #9aa6b8; --ligne: rgba(238, 241, 246, .1); --ligne-forte: rgba(238, 241, 246, .24);
  --rouge: #d3242c; --rouge-vif: #e0353d; --rouge-fonce: #8a161c; --rouge-texte: #ff9a9f; --rouge-pale: #3a1a1d; --rail-pale: #5a2f35;
  --vert: #4cc38a; --vert-texte: #8fe0b0; --vert-doux: #b9e8cd; --vert-pale: #12301f;
  --orange: #f0a44b; --orange-texte: #ffc98a; --orange-doux: #f3d6b3; --orange-pale: #3a2714;
  --gris: #aeb8c8; --gris-pale: #222d3f;
  --nuit: #1a2638; --nuit-2: #22314a; --sur-nuit: #eef1f6; --sur-nuit-2: #aeb8c8; --trait-nuit: rgba(238, 241, 246, .18); --ambre: #ffc83d;
  --ombre: 0 1px 0 rgba(0, 0, 0, .25), 0 12px 28px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre); font-family: var(--texte); font-size: 17px; line-height: 1.5; font-weight: 400;
  -webkit-font-smoothing: antialiased; min-height: 100vh; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.1; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 8vw, 3.9rem); line-height: 1.02; letter-spacing: -.025em; }
h2 { font-size: clamp(1.6rem, 4.6vw, 2.15rem); }
h3 { font-size: 1.15rem; letter-spacing: -.01em; }
p { margin: 0; }
.mono { font-family: var(--mono); font-weight: 400; }
.etiquette { display: inline-block; font-family: var(--mono); font-weight: 600; font-size: .74rem; line-height: 1.5; letter-spacing: .06em; text-transform: uppercase; color: var(--encre-2); }
.discret { color: var(--encre-3); }
.petit { font-size: .88rem; }
.cache { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--rouge-vif); outline-offset: 2px; border-radius: 6px; }

/* ---------- cadre ---------- */
.page { max-width: 1080px; margin: 0 auto; padding: 0 18px 64px; }
.barre { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.logo { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 800; letter-spacing: -.01em; font-size: 1.5rem; line-height: 1; }
.logo svg { width: 40px; height: 40px; flex: none; }
.logo small { white-space: nowrap; display: block; font-weight: 400; font-size: .78rem; letter-spacing: 0; color: var(--encre-2); margin-top: 3px; }
.barre nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.lien-barre { white-space: nowrap; text-decoration: none; padding: 9px 12px; min-height: 44px; border-radius: 999px; font-weight: 600; font-size: .95rem; display: inline-flex; gap: 7px; align-items: center; }
.lien-barre:hover { background: var(--fond-2); }
.lien-barre svg { width: 20px; height: 20px; }
.pastille { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--rouge); color: #fff; font-size: .75rem;
  font-family: var(--mono); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.pied { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--ligne); display: flex; flex-wrap: wrap; gap: 10px 22px;
  justify-content: space-between; color: var(--encre-3); font-size: .88rem; }
.pied a { color: var(--encre-2); }

/* ---------- boutons et champs ---------- */
.bouton { appearance: none; border: 0; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border-radius: 12px; padding: 13px 22px; min-height: 48px; font-weight: 800; font-size: 1.02rem; line-height: 1.2;
  background: var(--rouge); color: #fff; box-shadow: 0 3px 0 var(--rouge-fonce); transition: transform .08s, box-shadow .08s, background .15s; touch-action: manipulation; }
.bouton svg { width: 19px; height: 19px; flex: none; }
.bouton:hover { background: var(--rouge-vif); }
.bouton:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--rouge-fonce); }
.bouton[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.bouton.grand { padding: 16px 26px; min-height: 56px; font-size: 1.12rem; }
.bouton.second { background: var(--carte); color: var(--encre); box-shadow: 0 0 0 1.5px var(--ligne-forte) inset; }
.bouton.second:hover { background: var(--carte-2); }
.bouton.second:active { transform: translateY(1px); }
.bouton.nuit { background: var(--encre); color: var(--fond); box-shadow: none; }
.bouton.nuit:hover { background: var(--encre-2); }
.bouton.petit { padding: 9px 15px; min-height: 44px; font-size: .92rem; box-shadow: 0 2px 0 var(--rouge-fonce); }
.bouton.second.petit, .bouton.nuit.petit { box-shadow: 0 0 0 1.5px var(--ligne-forte) inset; }
.bouton.nuit.petit { box-shadow: none; }
.bouton.fantome { background: transparent; color: var(--encre-2); box-shadow: none; padding: 9px 12px; }
.bouton.fantome:hover { background: var(--fond-2); }
.bouton.danger { background: transparent; color: var(--rouge-texte); box-shadow: 0 0 0 1.5px currentColor inset; }
.rangee { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.champ { display: grid; gap: 6px; }
.champ > span, .legende { font-weight: 700; font-size: .95rem; }
.champ em, .aide { font-style: normal; color: var(--encre-3); font-size: .86rem; font-weight: 400; }
input[type=text], input[type=password], input[type=date], input[type=search], textarea, select {
  width: 100%; background: var(--carte); border: 1.5px solid var(--ligne-forte); border-radius: 12px; padding: 12px 14px; font-size: 1rem;
  transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 4px var(--fond-2); }
input::placeholder, textarea::placeholder { color: var(--encre-3); opacity: 1; }
.case { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--ligne); background: var(--carte-2); }
.case input { width: 22px; height: 22px; accent-color: var(--rouge); margin: 1px 0 0; flex: none; }
.case small { display: block; color: var(--encre-3); font-size: .85rem; }

/* ---------- cartes ---------- */
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 20px; }
.carte + .carte { margin-top: 16px; }
.carte h2 + p, .carte h3 + p { margin-top: 6px; }
.grille { display: grid; gap: 16px; }
.badge { flex: none; width: 26px; height: 26px; border: 2.5px solid var(--rouge); border-radius: 8px; display: inline-grid; place-items: center; color: var(--rouge); }
.badge svg { width: 14px; height: 14px; }

/* ---------- accueil ---------- */
.heros { display: grid; gap: 26px; padding: 18px 0 6px; }
@media (min-width: 880px) { .heros { grid-template-columns: 1.1fr .9fr; align-items: start; padding-top: 34px; } }
.heros h1 em { font-style: normal; color: var(--rouge); }
.heros .accroche { margin-top: 14px; font-size: 1.12rem; color: var(--encre-2); max-width: 32em; }
.colonne { display: grid; gap: 14px; align-content: start; }
.heros .rangee { margin-top: 24px; }
/* L'info trafic : l'état de Coco. */
.trafic { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 14px; background: var(--vert-pale); color: var(--vert-doux); }
.trafic b { display: block; color: var(--vert-texte); font-weight: 700; font-size: 1.02rem; line-height: 1.3; }
.trafic .rond { flex: none; margin-top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--vert); color: #fff; display: grid; place-items: center; }
.trafic .rond svg { width: 12px; height: 12px; }
.trafic.orange { background: var(--orange-pale); color: var(--orange-doux); } .trafic.orange b { color: var(--orange-texte); } .trafic.orange .rond { background: var(--orange); }
.trafic.gris { background: var(--gris-pale); color: var(--encre-2); } .trafic.gris b { color: var(--encre); } .trafic.gris .rond { background: var(--gris); }
.trafic .petit { margin-top: 3px; }
/* Le tableau des départs. */
.departs { background: var(--nuit); color: var(--sur-nuit); border-radius: var(--rayon); padding: 15px 17px; display: grid; gap: 10px; }
.departs .etiquette { color: var(--ambre); }
.departs dl { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.departs dt { font-size: .8rem; color: var(--sur-nuit-2); }
.departs dd { margin: 2px 0 0; font-family: var(--mono); font-weight: 600; font-size: 1.4rem; line-height: 1.15; color: var(--ambre); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.departs dd.court { font-size: 1.05rem; padding-top: 4px; }
/* La fiche du modèle. */
.fiche dl { margin: 10px 0 0; display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 8px 12px; font-size: .95rem; line-height: 1.35; }
.fiche dt { color: var(--encre-3); }
.fiche dd { margin: 0; }
.fiche dd:first-of-type { font-weight: 700; }
.chiffres { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 14px; border-radius: var(--rayon); overflow: hidden;
  border: 1px solid var(--ligne); background: var(--carte); box-shadow: var(--ombre); }
@media (min-width: 760px) { .chiffres { grid-template-columns: repeat(4, 1fr); } }
.chiffre { padding: 16px 18px 15px; border-right: 1px solid var(--ligne); border-bottom: 1px solid var(--ligne); }
.chiffre b { display: block; font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; font-size: 2rem; line-height: 1; margin: 8px 0 6px; }
.chiffre b.long { font-size: 1.35rem; line-height: 1.1; padding: 5px 0 4px; }
.chiffre span { font-size: .85rem; color: var(--encre-3); }
.chiffre .etiquette { display: block; }
.etapes { display: grid; gap: 12px; counter-reset: e; margin-top: 14px; }
@media (min-width: 760px) { .etapes { grid-template-columns: repeat(3, 1fr); } }
.etape { counter-increment: e; padding: 16px 18px; border-radius: var(--rayon); background: var(--carte); border: 1px solid var(--ligne); }
.etape::before { content: 'Station ' counter(e); font-family: var(--mono); font-weight: 600; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--rouge-texte); display: block; margin-bottom: 8px; }
.etape p { color: var(--encre-2); margin-top: 6px; font-size: .95rem; }
.section { margin-top: 40px; }
.section > .etiquette { display: block; margin-bottom: 8px; }
.faq details { border-top: 1px solid var(--ligne); padding: 13px 2px; }
.faq details:last-child { border-bottom: 1px solid var(--ligne); }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--mono); color: var(--rouge-texte); font-weight: 600; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin-top: 8px; color: var(--encre-2); max-width: 46em; }

/* ---------- formulaire ---------- */
.formulaire { display: grid; gap: 20px; margin-top: 8px; }
@media (min-width: 900px) { .formulaire { grid-template-columns: 1fr 340px; align-items: start; } .formulaire .cote { position: sticky; top: 16px; } }
.bloc { display: grid; gap: 14px; }
.bloc-titre { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.bloc-titre .mono { color: var(--rouge-texte); font-weight: 600; font-size: .9rem; }
.bloc-titre .aide { margin-left: auto; }
.groupe { font-family: var(--mono); font-weight: 600; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--encre-2); margin: 2px 0 -6px; }
.tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .tuiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tuile { cursor: pointer; border: 1.5px solid var(--ligne-forte); border-radius: 12px; padding: 9px 12px; background: var(--carte); min-height: 58px;
  display: grid; gap: 1px; align-content: center; text-align: left; transition: border-color .12s, background .12s; }
.tuile:hover { border-color: var(--encre-3); }
.tuile b { font-weight: 700; font-size: .95rem; line-height: 1.25; }
.tuile small { color: var(--encre-2); font-size: .8rem; line-height: 1.25; }
.tuile[aria-pressed=true] { border-color: var(--encre); background: var(--encre); color: var(--fond); }
.tuile[aria-pressed=true] small { color: var(--sur-nuit-2); }
:root[data-theme="dark"] .tuile[aria-pressed=true] small { color: #4a5568; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tuile[aria-pressed=true] small { color: #4a5568; } }
/* Les types de train : des pastilles, sur plusieurs lignes au besoin. */
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { cursor: pointer; border: 1.5px solid var(--ligne-forte); background: var(--carte); border-radius: 999px; padding: 0 15px; min-height: 44px; font-weight: 700; font-size: .93rem;
  display: inline-flex; gap: 6px; align-items: center; }
.puce small { font-weight: 400; color: var(--encre-3); font-size: .86rem; }
.puce[aria-pressed=true] { border-color: var(--encre); background: var(--encre); color: var(--fond); }
.puce[aria-pressed=true] small { color: inherit; opacity: .8; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.erreur { background: var(--rouge-pale); color: var(--rouge-texte); border-radius: 12px; padding: 12px 14px; font-weight: 600; }

/* ---------- le score de confiance ---------- */
.score { background: var(--nuit); color: var(--sur-nuit); border-radius: var(--rayon); padding: 18px 18px 20px; display: grid; gap: 10px; }
.score .etiquette { color: var(--ambre); }
.score .tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.score .tete p { color: var(--sur-nuit-2); font-size: .92rem; margin-top: 2px; }
.score .valeur { flex: none; white-space: nowrap; font-family: var(--mono); font-weight: 600; font-size: 2.3rem; line-height: 1; font-variant-numeric: tabular-nums; color: #fff; }
.voie { position: relative; height: 18px; }
.voie::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 6px; border-radius: 3px; background: var(--nuit-2); }
.voie .rempli { position: absolute; left: 0; top: 6px; height: 6px; border-radius: 3px; background: #e2474e; transition: width .5s cubic-bezier(.3, 1.3, .5, 1); }
.voie .train { position: absolute; top: 0; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: #fff; border: 4px solid #e2474e; transition: left .5s cubic-bezier(.3, 1.3, .5, 1); }
.score .verdict { font-weight: 800; font-size: 1.05rem; }
.raisons { list-style: none; padding: 0; margin: 2px 0 0; display: grid; gap: 5px; font-size: .86rem; color: var(--sur-nuit-2); }
.raisons li { display: flex; gap: 10px; align-items: baseline; }
.raisons .pts { font-family: var(--mono); font-weight: 600; min-width: 34px; text-align: right; }
.raisons .plus { color: #8fe0b0; } .raisons .moins { color: #ff9a9f; }
.score .rien { color: var(--sur-nuit-2); }
.score .aiguillage-titre { display: flex; gap: 12px; align-items: center; font-weight: 800; font-size: 1.15rem; line-height: 1.25; }
.score .aiguillage-titre svg { width: 28px; height: 28px; flex: none; }
.score .statut-envoi { justify-self: start; padding: 5px 10px; border-radius: 6px; background: var(--nuit-2); font-family: var(--mono); font-size: .8rem; color: #8fe0b0; }
/* Sur la fiche d'un ticket côté Coco, le score se lit sur une carte claire. */
.carte .voie::before { background: var(--fond-2); }
.carte .raisons { color: var(--encre-2); }
.carte .raisons .plus { color: var(--vert); } .carte .raisons .moins { color: var(--rouge-texte); }
.carte .valeur-score { font-family: var(--mono); font-weight: 600; font-size: 2rem; line-height: 1; margin-top: 8px; }

/* ---------- le ticket ---------- */
.ticket { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 18px 20px 20px; overflow: hidden; }
.ticket .ligne-tete { display: flex; align-items: center; gap: 9px; }
.ticket .ligne-tete b { font-weight: 700; font-size: .95rem; }
.ticket .tete { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-top: 12px; }
.ticket .numero { font-family: var(--mono); font-weight: 600; font-size: 1.9rem; letter-spacing: -.02em; line-height: 1; }
.ticket .objet { font-size: 1.35rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; margin-top: 8px; }
.ticket .details { margin-top: 8px; color: var(--encre-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.meta span { background: var(--fond-2); border-radius: 999px; padding: 4px 11px; font-size: .84rem; font-weight: 600; }
.tampon { display: inline-block; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; font-size: 1.05rem; line-height: 1; white-space: nowrap;
  padding: 7px 11px 5px; border: 2.5px solid currentColor; border-radius: 8px; transform: rotate(-6deg); color: var(--encre); opacity: .92; }
.tampon.vert { color: var(--vert); } .tampon.rouge { color: var(--rouge-texte); } .tampon.orange { color: var(--orange); } .tampon.gris { color: var(--gris); }
.tampon.frais { animation: tampon .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes tampon { from { transform: rotate(-6deg) scale(2.2); opacity: 0; } 60% { opacity: .95; } to { transform: rotate(-6deg) scale(1); opacity: .92; } }
.sortie { animation: sortie .6s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes sortie { from { transform: translateY(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sortie, .tampon.frais { animation: none; } }
.ticket .phrase { margin-top: 14px; }
.ticket .pied-ticket { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--ligne-forte); }

.puce-statut { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .8rem; padding: 4px 10px; border-radius: 999px;
  background: var(--fond-2); color: var(--encre); white-space: nowrap; }
.puce-statut.vert { background: var(--vert-pale); color: var(--vert-texte); } .puce-statut.rouge { background: var(--rouge-pale); color: var(--rouge-texte); }
.puce-statut.orange { background: var(--orange-pale); color: var(--orange-texte); } .puce-statut.gris { background: var(--gris-pale); color: var(--gris); }

/* Le plan de ligne : une station par étape, la rame là où en est la demande. */
.plan { display: grid; margin-top: 16px; }
.station { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; min-height: 48px; }
.station .voie-v { position: relative; }
.station .voie-v::before { content: ''; position: absolute; left: 13px; top: 0; bottom: 0; width: 4px; background: var(--rail-pale); }
.station.fait .voie-v::before, .station.ici .voie-v::before { background: var(--rouge); }
.station.ici .voie-v::before { bottom: auto; height: 14px; }
.station.ici .voie-v::after { content: ''; position: absolute; left: 13px; top: 14px; bottom: 0; width: 4px; background: var(--rail-pale); }
.station:first-child .voie-v::before { top: 12px; }
.station:last-child .voie-v::before { bottom: auto; height: 10px; }
.station.fait:last-child .voie-v::before { height: 10px; }
.station .arret { position: absolute; left: 7px; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--carte); border: 3px solid var(--rail-pale); z-index: 1; }
.station.fait .arret { border: 4px solid var(--rouge); }
.station.ici .arret { left: 0; top: 0; width: 30px; height: 30px; border: 0; background: var(--rouge); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 4px var(--carte); }
.station.ici .arret svg { width: 16px; height: 16px; }
.station.terminus .arret { left: 2px; top: 3px; width: 26px; height: 20px; border-radius: 5px; border: 3px solid var(--encre); }
.station.terminus.fait .arret { background: var(--encre); color: var(--carte); display: grid; place-items: center; border: 0; }
.station.terminus.fait .arret svg { width: 13px; height: 13px; }
.station .nom { padding-top: 2px; font-size: .97rem; color: var(--encre-2); line-height: 1.3; }
.station.ici .nom { color: var(--encre); font-weight: 800; padding-top: 4px; }
.station.terminus .nom { color: var(--encre); font-weight: 800; }
.station .nom small { display: block; font-weight: 600; font-size: .85rem; color: var(--orange); }
.station.terminus .nom small { color: var(--vert); }
.station .heure { padding-top: 3px; font-family: var(--mono); font-size: .8rem; color: var(--encre-3); white-space: nowrap; }

.colonnes { display: grid; gap: 18px; margin-top: 6px; }
@media (min-width: 900px) { .colonnes { grid-template-columns: 1fr 340px; align-items: start; } }
.garde { border: 2px dashed var(--rouge); background: var(--rouge-pale); border-radius: var(--rayon); padding: 18px; }
.garde .etiquette { color: var(--rouge-texte); }
.garde .code { white-space: nowrap; font-family: var(--mono); font-weight: 600; font-size: 1.4rem; letter-spacing: .06em; }
.copie { display: flex; gap: 8px; margin-top: 10px; }
.copie input { font-family: var(--mono); font-size: .82rem; }
.josephine { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--vert-pale); color: var(--vert-doux); }
.josephine b { color: var(--vert-texte); }

/* ---------- fil de discussion ---------- */
.fil { display: grid; gap: 12px; margin-top: 8px; }
.evt { display: grid; grid-template-columns: 16px 1fr auto; gap: 10px; align-items: baseline; font-size: .88rem; color: var(--encre-2); padding: 1px 4px; }
.evt .ic { width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid var(--rouge); background: var(--carte); align-self: center; justify-self: center; }
.evt time { padding-left: 10px; color: var(--encre-3); font-size: .76rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bulle { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; }
.bulle .av { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--fond-2); font-size: 1rem; }
.bulle .av svg { width: 18px; height: 18px; }
.bulle .corps { background: var(--carte); border: 1px solid var(--ligne); border-radius: 4px 16px 16px 16px; padding: 10px 14px; min-width: 0; }
.bulle .qui { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-family: var(--mono); font-size: .76rem; font-weight: 600; color: var(--encre-2); margin-bottom: 3px; }
.bulle .qui time { font-weight: 400; color: var(--encre-3); font-variant-numeric: tabular-nums; }
.bulle .texte { white-space: pre-wrap; overflow-wrap: anywhere; }
.bulle.coco .av { background: var(--carte); border: 2.5px solid var(--rouge); color: var(--rouge); }
.bulle.auto .av { background: var(--carte); border: 2.5px dashed var(--rouge); color: var(--rouge); }
.bulle.auto .corps { background: transparent; border-style: dashed; border-color: var(--ligne-forte); }
.bulle.demandeur .av { background: var(--encre); color: var(--fond); }
.bulle.demandeur .corps { background: var(--encre); color: var(--fond); border-color: transparent; }
.bulle.demandeur .qui, .bulle.demandeur .qui time { color: var(--sur-nuit-2); }
:root[data-theme="dark"] .bulle.demandeur .qui, :root[data-theme="dark"] .bulle.demandeur .qui time { color: #4a5568; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bulle.demandeur .qui, :root:not([data-theme="light"]) .bulle.demandeur .qui time { color: #4a5568; } }
.bulle.demandeur .texte a { color: inherit; }
.citation { margin-top: 6px; padding: 8px 12px; border-radius: 8px; background: var(--fond-2); color: var(--encre-2); font-style: italic; white-space: pre-wrap; }
.composer { display: grid; gap: 10px; margin-top: 14px; }
.composer textarea { min-height: 90px; }
.relance { display: grid; gap: 8px; }
.compteur { font-family: var(--mono); font-size: .8rem; color: var(--encre-3); }
.notes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.notes button { cursor: pointer; border: 1.5px solid var(--ligne-forte); background: var(--carte); border-radius: 12px; padding: 9px 3px; display: grid; gap: 3px;
  justify-items: center; font-size: .74rem; font-weight: 600; line-height: 1.15; text-align: center; min-height: 64px; }
.notes button b { font-family: var(--mono); font-size: 1.25rem; font-weight: 600; }
.notes button[aria-pressed=true] { border-color: var(--encre); background: var(--encre); color: var(--fond); }

/* ---------- la cabine de Coco ---------- */
.bandeau-coco { background: var(--nuit); color: var(--sur-nuit); border-radius: var(--rayon); padding: 20px; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.bandeau-coco .discret, .bandeau-coco .etiquette { color: var(--sur-nuit-2); }
.humeurs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.humeurs button { flex: none; cursor: pointer; border: 1.5px solid var(--trait-nuit); background: transparent; color: inherit; border-radius: 999px;
  padding: 0 13px; min-height: 40px; font-weight: 600; font-size: .88rem; display: inline-flex; gap: 8px; align-items: center; }
.humeurs .point { width: 9px; height: 9px; border-radius: 50%; background: #4cc38a; }
.humeurs .point.orange { background: #f0a44b; } .humeurs .point.gris { background: #aeb8c8; }
.humeurs button[aria-pressed=true] { background: var(--sur-nuit); color: #0e1a2b; border-color: var(--sur-nuit); }
.bandeau-coco input { background: rgba(255, 255, 255, .08); border-color: var(--trait-nuit); color: inherit; }
.bandeau-coco input::placeholder { color: var(--sur-nuit-2); }
.bandeau-coco form input { flex: 1; min-width: 0; }
.bandeau-coco .bouton.petit { box-shadow: none; }
.onglets { display: flex; gap: 6px; overflow-x: auto; margin: 20px 0 12px; padding-bottom: 4px; scrollbar-width: none; }
.onglets button { flex: none; cursor: pointer; border: 0; background: transparent; padding: 0 13px; min-height: 40px; border-radius: 999px; font-weight: 700; font-size: .93rem; color: var(--encre-2);
  display: inline-flex; gap: 7px; align-items: center; }
.onglets button[aria-pressed=true] { background: var(--encre); color: var(--fond); }
.onglets .n { font-family: var(--mono); font-size: .76rem; opacity: .75; }
.liste { display: grid; gap: 8px; }
.ligne { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center; text-decoration: none; padding: 13px 16px;
  background: var(--carte); border: 1px solid var(--ligne); border-radius: 14px; transition: border-color .12s, transform .12s; }
.ligne:hover { border-color: var(--ligne-forte); transform: translateY(-1px); }
.ligne .num { font-family: var(--mono); font-weight: 600; color: var(--rouge-texte); font-size: .9rem; position: relative; }
.ligne.nonlu .num::after { content: ''; position: absolute; left: -10px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--rouge); }
.ligne .titre { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ligne.nonlu .titre { font-weight: 900; }
.ligne .sous { grid-column: 2 / 4; font-size: .85rem; color: var(--encre-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 560px) {
  .ligne { grid-template-columns: auto 1fr; }
  .ligne .titre { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.25; }
  .ligne .puce-statut { grid-column: 2; justify-self: start; }
  .ligne .sous { grid-column: 2; }
}
.vide { text-align: center; padding: 36px 18px; color: var(--encre-3); border: 1.5px dashed var(--ligne-forte); border-radius: var(--rayon); }
.vide svg { width: 44px; height: 44px; display: block; margin: 0 auto 8px; }
.vide h2 { color: var(--encre); }
.reponses { display: flex; gap: 6px; flex-wrap: wrap; }
.reponses button { cursor: pointer; border: 1.5px dashed var(--ligne-forte); background: transparent; border-radius: 999px; padding: 0 12px; min-height: 36px; font-size: .86rem; font-weight: 600; }
.reponses button:hover { border-style: solid; border-color: var(--encre); }
.boutons-statut { display: flex; flex-wrap: wrap; gap: 6px; }
.boutons-statut button { cursor: pointer; border: 1.5px solid var(--ligne-forte); background: var(--carte); border-radius: 10px; padding: 0 11px; min-height: 38px; font-size: .86rem; font-weight: 700; }
.boutons-statut button[aria-pressed=true] { background: var(--encre); color: var(--fond); border-color: var(--encre); }
.connexion { max-width: 420px; margin: 36px auto 0; }
form[data-envoi=motdepasse], form[data-envoi=reglages] { max-width: 460px; }
.journal { font-family: var(--mono); font-size: .76rem; color: var(--encre-3); display: grid; gap: 3px; margin-top: 10px; overflow-wrap: anywhere; }
pre.commande { font-family: var(--mono); font-size: .82rem; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--fond-2); padding: 12px; border-radius: 10px; margin: 10px 0 0; }

/* ---------- divers ---------- */
#toasts { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 50;
  width: min(460px, calc(100vw - 24px)); pointer-events: none; }
.toast { background: var(--nuit); color: var(--sur-nuit); border: 1px solid var(--trait-nuit); padding: 12px 16px; border-radius: 14px; box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .45); font-weight: 600;
  font-size: .94rem; animation: toast .3s cubic-bezier(.2, 1.4, .4, 1) both; pointer-events: auto; }
.toast small { display: block; opacity: .75; font-weight: 600; margin-bottom: 2px; font-family: var(--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.toast.erreur { background: var(--rouge-fonce); color: #fff; border-color: transparent; }
@keyframes toast { from { transform: translateY(16px); opacity: 0; } }
/* L'attente : une rame qui file le long de la ligne. */
.chargement { padding: 60px 0; text-align: center; color: var(--encre-3); }
.chargement::before { content: ''; display: block; width: 120px; height: 14px; margin: 0 auto 14px; border-radius: 7px;
  background: radial-gradient(circle 7px at 7px 7px, var(--rouge) 98%, transparent) no-repeat, linear-gradient(var(--rail-pale), var(--rail-pale)) 0 5px / 100% 4px no-repeat;
  animation: rame 1.1s ease-in-out infinite alternate; }
@keyframes rame { from { background-position: 0 0, 0 5px; } to { background-position: 106px 0, 0 5px; } }
@media (prefers-reduced-motion: reduce) { .chargement::before, .toast { animation: none; } }
.retour { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; color: var(--encre-2); font-weight: 600; font-size: .93rem; margin: 4px 0 12px; min-height: 44px; }
.tete-page { margin: 6px 0 18px; }
.tete-page p { color: var(--encre-2); margin-top: 8px; font-size: 1.04rem; }
.separateur { border: 0; border-top: 1px dashed var(--ligne-forte); margin: 16px 0; }
.lien { color: var(--rouge-texte); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; background: none; border: 0; padding: 0; }
.lien.sourdine { color: var(--encre-3); font-weight: 600; }
.avis { background: var(--orange-pale); color: var(--orange-doux); border-radius: 12px; padding: 12px 14px; font-size: .92rem; }
.avis b { color: var(--orange-texte); }

/* ---------- maquette ---------- */
.demo { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: space-between;
  padding: 8px 18px; background: #0e1a2b; color: #f6f5f0; font-size: .84rem; }
.demo a, .demo button { color: #ffc83d; font-weight: 700; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: .84rem; }
.demo .rangee { gap: 14px; }

@media (max-width: 460px) { .logo small { display: none; } .barre { gap: 6px; } .lien-barre { padding: 9px 10px; } }
/* Le score en miniature, en bas de l'écran pendant qu'on remplit (téléphone). */
.mini-jauge { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); display: inline-flex; gap: 10px; align-items: center;
  background: var(--nuit); color: var(--sur-nuit); border: 1px solid var(--trait-nuit); border-radius: 999px; padding: 10px 16px; min-height: 44px; font-weight: 600; font-size: .9rem; cursor: pointer;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, .5); white-space: nowrap; transition: opacity .2s; max-width: calc(100vw - 24px); overflow: hidden; text-overflow: ellipsis; }
.mini-jauge b { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.02rem; color: var(--ambre); }
.mini-jauge.loin { opacity: 0; pointer-events: none; }
@media (min-width: 900px) { .mini-jauge { display: none; } }
.grille > *, .colonnes > *, .formulaire > *, .heros > * { min-width: 0; }
