/* Commun aux trois pages : couleurs, polices, navigation, et l'interface des deux cartes.
   Barlow vient de la signalétique routière et ferroviaire (famille DIN) ; sa version semi-condensée sert aux
   titres, au menu, aux numéros de ligne et aux étiquettes de la carte, où la place compte.
   Principe de l'interface : une seule façon de faire chaque chose, et le détail seulement quand on le demande. */
:root {
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-cond: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --bg: #0e1116;           /* fond de la carte et des pages */
  --surface: #151a23;      /* panneaux */
  --surface-2: #1c2330;    /* éléments posés sur un panneau */
  --surface-3: #252d3b;    /* survol, appui */
  --line: #2a3140;         /* filets */
  --text: #eef1f6;
  --muted: #a3acbd;        /* texte secondaire : 7:1 sur --surface */
  --faint: #7d879a;        /* indications discrètes : 4.6:1 sur --surface */
  --accent: #6ea8ff;
  --ok: #3ccf7a; --warn: #f2b33d; --bad: #f05a5a;
  --tgv: #c8366b; --tgv-hover: #db4a7f;   /* framboise des TGV INOUI */
  --radius: 14px;
  --header-h: 52px;        /* en-tête (ordinateur) ; 0 sur téléphone, où la barre d'onglets le remplace */
  --tab-h: 0px;            /* barre d'onglets (téléphone) */
  --header-bg: rgba(12, 15, 21, .95);
  --rail: #343c4d;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); -webkit-tap-highlight-color: transparent; }
/* cartes : pas de « tirer pour recharger » quand on fait glisser le volet ou la carte (appli installée) */
html:has(#map), html:has(#map) body { height: 100%; overflow: hidden; overscroll-behavior: none; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3, h4, .badge, .ln-b { font-family: var(--font-cond); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; }

/* =============================================================== en-tête (ordinateur) : le menu est un plan de ligne */
.site { position: fixed; z-index: 1100; top: 0; left: 0; right: 0; height: var(--header-h); display: flex; align-items: stretch; gap: 4px;
  padding: 0 16px; background: var(--header-bg); border-bottom: 1px solid #222937; backdrop-filter: blur(8px);
  color: #e6e9ef; font: 500 15px/1 var(--font-cond); letter-spacing: .15px; }
.site a { color: inherit; text-decoration: none; }
.site .site-name { display: flex; align-items: center; gap: 9px; margin-right: 26px; font-weight: 700; font-size: 17px; white-space: nowrap; }
.site .site-name em { font-style: normal; font-weight: 500; color: var(--muted); }
.beacon { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.beacon::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: beacon 2.4s ease-out infinite; }
@keyframes beacon { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
.site .line { position: relative; display: flex; align-items: stretch; }
.site .line::before { content: ""; position: absolute; left: -14px; right: -14px; bottom: 11px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--rail) 14px, var(--rail) calc(100% - 14px), transparent); }
.site .stop { position: relative; display: flex; align-items: flex-start; padding: 9px 16px 0; color: var(--muted); white-space: nowrap; }
.site .stop .lbl { display: flex; align-items: center; gap: 6px; height: 22px; }
.site .stop::after { content: ""; position: absolute; left: 50%; bottom: 7.5px; width: 10px; height: 10px; margin-left: -5px;
  border-radius: 50%; background: var(--bg); border: 2.5px solid #5b6578; transition: transform .15s, border-color .15s; }
.site .stop:hover { color: var(--text); }
.site .stop:hover::after { border-color: #c3c9d6; transform: scale(1.15); }
.site .stop[aria-current="page"] { color: #fff; font-weight: 700; }
.site .stop[aria-current="page"]::after { background: #fff; border-color: var(--accent); width: 14px; height: 14px; margin-left: -7px; bottom: 5.5px;
  box-shadow: 0 0 0 3px rgba(110, 168, 255, .25); }
.site .stop.tgv .lbl { padding: 0 10px 0 7px; border-radius: 6px; background: var(--tgv); color: #fff; font-weight: 700; box-shadow: 0 2px 12px rgba(200, 54, 107, .35); }
.site .stop.tgv:hover .lbl { background: var(--tgv-hover); }
.site .stop.tgv .lbl svg { width: 16px; height: 16px; }
.site .stop.tgv::after { width: 22px; margin-left: -11px; border-radius: 6px; border-color: var(--tgv); }
.site .stop.tgv[aria-current="page"]::after { width: 26px; margin-left: -13px; background: #fff; box-shadow: 0 0 0 3px rgba(200, 54, 107, .3); }
.site .spacer { flex: 1; }
.site .etat { align-self: center; color: var(--muted); font-size: 13px; padding: 0 12px; }
.site .etat:hover { color: var(--text); }
.site a[hidden], .tabbar a[hidden] { display: none !important; }
.site .clock { align-self: center; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: #0b0e13;
  font: 600 16px/1 var(--font-cond); font-variant-numeric: tabular-nums; letter-spacing: .5px; color: #f2f4f8; }
.site .clock i { font-style: normal; color: var(--warn); padding: 0 1px; }
.site .clock small { margin-left: 3px; font-size: 11.5px; color: var(--muted); }
@media (max-width: 980px) { .site .etat { display: none; } .site .stop { padding: 9px 11px 0; } .site .site-name { margin-right: 14px; } }
/* entrées du menu : pictogramme devant le nom ; sa ville, avec l’épingle */
.site .stop .lbl svg { width: 16px; height: 16px; }
.site .stop.mine .lbl svg { color: var(--accent); }

/* =============================================================== barre d'onglets (téléphone) : remplace l'en-tête */
.tabbar { display: none; }
@media (max-width: 760px) {
  :root { --header-h: 0px; --tab-h: calc(60px + env(safe-area-inset-bottom)); }
  .site { display: none; }
  .tabbar { position: fixed; z-index: 1100; left: 0; right: 0; bottom: 0; height: var(--tab-h); display: flex;
    padding-bottom: env(safe-area-inset-bottom); background: var(--header-bg); border-top: 1px solid #222937; backdrop-filter: blur(8px); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted);
    text-decoration: none; font: 600 12.5px/1 var(--font-cond); letter-spacing: .2px; position: relative; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: #fff; }
  .tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .tabbar a.tgv[aria-current="page"]::before { background: var(--tgv); }
  .tabbar a:active { background: var(--surface-2); }
  .tabbar a.mine svg { color: var(--accent); }
  .tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
}
@media (max-width: 760px) and (max-height: 500px) {   /* téléphone à l'horizontale : onglets plus bas, icône à côté du nom */
  :root { --tab-h: calc(46px + env(safe-area-inset-bottom)); }
  .tabbar a { flex-direction: row; gap: 8px; font-size: 14px; }
  .tabbar a svg { width: 20px; height: 20px; }
}
@media (min-width: 761px) and (max-height: 500px) { :root { --header-h: 46px; } .site .stop { padding-top: 6px; } }
@media (prefers-reduced-motion: reduce) { .beacon::after, .rec { animation: none !important; } * { transition-duration: 0s !important; } }

/* =============================================================== cartes : emplacement */
#map { position: absolute; top: var(--header-h); left: 0; right: 0; bottom: var(--tab-h); background: var(--bg); }
#fx { pointer-events: none; }
.leaflet-control-attribution { background: rgba(14,17,22,.75) !important; color: var(--faint) !important; font-size: 10.5px; }
.leaflet-control-attribution a { color: var(--faint) !important; }
.leaflet-container { font-family: var(--font); }

/* =============================================================== barre d'outils : recherche + modes */
.toolbar { position: absolute; z-index: 1020; top: calc(var(--header-h) + 12px); left: 12px; width: 360px; display: flex; flex-direction: column; gap: 8px; }
.search { position: relative; display: flex; align-items: center; height: 48px; padding: 0 4px 0 14px; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.search:focus-within { border-color: var(--accent); }
/* carte d'un réseau : « ‹ France » à gauche de la recherche, pour revenir à la vue d'ensemble */
.tb-row { display: flex; gap: 8px; }
.tb-row .search { flex: 1; min-width: 0; }
.to-france { flex: none; display: flex; align-items: center; gap: 2px; height: 48px; padding: 0 14px 0 8px; border-radius: 24px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.4); color: var(--text); font: 600 16px var(--font-cond); text-decoration: none; }
.to-france svg { width: 20px; height: 20px; color: var(--muted); }
.to-france:hover { border-color: #46516a; }
.search .ico { color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 16px; color: var(--text); }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }
.icon-btn { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.icon-btn:hover, .icon-btn:active { background: var(--surface-3); color: var(--text); }
.icon-btn .ico { color: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 9px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font: 600 15px var(--font-cond); white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.3);
  transition: background .15s, color .15s, border-color .15s; }
.chip .ico { width: 18px; height: 18px; }
.chip .n { font: 500 12.5px var(--font); color: var(--faint); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: #23324d; border-color: var(--accent); color: #fff; }
.chip[aria-pressed="true"] .n { color: #c9d8f2; }
.chip[aria-pressed="false"] .ico { opacity: .55; }
.chip:hover { border-color: #46516a; }
.chip .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
/* résultats de recherche */
.search .results { position: absolute; top: 56px; left: 0; right: 0; z-index: 5; }
.results { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 34px rgba(0,0,0,.5);
  max-height: min(60vh, 440px); overflow-y: auto; scrollbar-width: none; padding: 6px; }
.results[hidden] { display: none; }
.results button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 10px;
  background: none; text-align: left; }
.results button:hover, .results button.on { background: var(--surface-3); }
.results .what { flex: 1; min-width: 0; }
.results .what b { display: block; font: 600 16px var(--font-cond); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .what small { color: var(--muted); font-size: 13px; }
.results .pin { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--muted); flex: none; }
.results .empty { padding: 14px 10px; }

/* =============================================================== panneau (ordinateur) / volet (téléphone) */
.panel { position: absolute; z-index: 1000; left: 12px; width: 360px; top: calc(var(--header-h) + var(--tool-h, 104px) + 22px);
  max-height: calc(100% - var(--header-h) - var(--tool-h, 104px) - 34px - var(--tab-h)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 34px rgba(0,0,0,.45); padding: 14px 16px 0; }
.panel h1 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 20px; line-height: 1.2; min-height: 32px; }
.panel h1 .back { margin-left: -8px; }
.panel h1 .ttl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel .sub { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13.5px; margin: 4px 0 10px; min-height: 18px; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; animation: pulse 2s infinite; }
.live.stale { background: var(--warn); animation: none; } .live.off { background: var(--bad); animation: none; } .live.replaying { background: var(--accent); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(60,207,122,.6); } 70% { box-shadow: 0 0 0 8px rgba(60,207,122,0); } 100% { box-shadow: 0 0 0 0 rgba(60,207,122,0); } }
.panel .body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 16px; }
.panel .body::-webkit-scrollbar { display: none; }
.err { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: rgba(240,90,90,.12); border: 1px solid rgba(240,90,90,.4); font-size: 14px; }
.err[hidden] { display: none; }

/* volet du téléphone (voir window.sheet dans site.js) */
.sheet-grip, .sheet-btn { display: none; }
@media (max-width: 760px), (max-height: 500px) {
  .toolbar { top: calc(var(--header-h) + env(safe-area-inset-top) + 10px); left: 10px; right: 10px; width: auto; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px 4px; }
  .chips::-webkit-scrollbar { display: none; }
  /* boutons plus serrés : les modes et « Vélos » tiennent sur la largeur d'un téléphone */
  .chips { gap: 5px; }
  .chip { gap: 4px; padding: 0 9px 0 7px; font-size: 14px; }
  .chip .ico { width: 16px; height: 16px; }
  .chip .lg, .chip-sep { display: none; }
  .panel.sheet { top: auto; left: 0; right: 0; bottom: var(--tab-h); width: auto; max-height: none; border-radius: 18px 18px 0 0; border-width: 1px 0 0;
    padding: 0 16px; box-shadow: 0 -10px 34px rgba(0,0,0,.45); transition: height .28s var(--ease); }
  .panel.sheet.dragging { transition: none; }
  .panel.sheet .sheet-grip { display: block; height: 20px; margin: 0 -16px; touch-action: none; cursor: grab; }
  .panel.sheet .sheet-grip::before { content: ""; display: block; width: 40px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: #4b5568; }
  .panel.sheet h1 { touch-action: none; cursor: pointer; user-select: none; -webkit-user-select: none; }
  .panel.sheet .sheet-btn { display: grid; place-items: center; width: 40px; height: 40px; margin: -4px -8px -4px 0; padding: 0; background: none; border: 0;
    border-radius: 50%; color: var(--muted); }
  .panel.sheet .sheet-btn svg { width: 22px; height: 22px; transition: transform .26s; }
  .panel.sheet:not([data-state="peek"]) .sheet-btn svg { transform: rotate(180deg); }
  .panel.sheet[data-state="peek"] .body { display: none; }
  .has-sheet .leaflet-bottom { bottom: var(--sheet-peek, 0); }
  .has-sheet .leaflet-control-attribution { font-size: 9.5px; line-height: 1.3; max-width: 100vw; white-space: normal; }
}
@media (min-width: 761px) and (max-height: 500px) {   /* grand téléphone à l'horizontale : le volet est une carte à gauche */
  .toolbar { right: auto; width: 360px; }
  .panel.sheet { right: auto; left: 12px; width: 360px; border-width: 1px 1px 0; }
  .has-sheet .leaflet-bottom { bottom: 0; }
}
@media (pointer: coarse) { .leaflet-control-zoom { display: none; } }

/* =============================================================== contenu des vues */
.sec { margin-top: 18px; }
.sec:first-child { margin-top: 2px; }
.sec > h2 { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 0 0 10px; }
.empty { color: var(--muted); font-size: 14px; }
/* une ligne de liste qu'on touche : 52 px de haut au moins */
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 10px; margin: 0 -10px; width: calc(100% + 20px);
  border: 0; border-radius: 12px; background: none; text-align: left; color: var(--text); font-size: 15px; }
.row:hover, .row:active { background: var(--surface-2); }
.row .what { flex: 1; min-width: 0; }
.row .what b { display: block; font: 600 16px/1.25 var(--font-cond); }
.row .what small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.35; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .go { color: var(--faint); flex: none; }
.row + .row { border-top: 1px solid var(--line); border-radius: 0; }
.row + .row:hover { border-radius: 12px; }
/* accueil France (ordinateur) : les marques de trains resserrées, toutes visibles sur deux lignes (une ligne qui défile
   cachait les dernières sans qu'on le devine) ; sur téléphone, la rangée défile comme celle des modes */
@media (min-width: 761px) and (min-height: 501px) {
  #brandChips { gap: 5px; }
  #brandChips .chip { height: 36px; gap: 5px; padding: 0 10px 0 8px; font-size: 14.5px; }
  #brandChips .chip .n { font-size: 12px; }
}
/* accueil France : les réseaux en direct (la balise bleue de la carte devant chaque nom) */
a.row { text-decoration: none; }
.net-dot { flex: none; width: 14px; height: 14px; margin: 0 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(110,168,255,.22); }
.net-dot.mine { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5.5px var(--text); }
.net-row .what b em { font: 600 12.5px var(--font); font-style: normal; color: var(--accent); margin-left: 6px; }
.net-row .what small.warn { color: var(--warn); }
.net-bzh { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.net-bzh > b { display: block; font: 600 16px var(--font-cond); margin-bottom: 8px; }
.net-bzh div { display: flex; flex-wrap: wrap; gap: 6px; }
.net-bzh a { display: inline-flex; align-items: baseline; gap: 6px; min-height: 36px; padding: 8px 12px; border-radius: 18px; border: 1px solid var(--line);
  color: var(--text); font: 600 15px var(--font-cond); text-decoration: none; }
.net-bzh a small { color: var(--muted); font: 500 12.5px var(--font); }
.net-bzh a:hover { background: var(--surface-2); }
.net-bzh a.mine { border-color: var(--accent); }
.nets .row:last-child { border-top: 1px solid var(--line); border-radius: 0; }
/* pastille de ligne : ronde pour le métro, carrée pour le RER et le train, en gélule pour le tram */
.badge, .ln-b { display: inline-grid; place-items: center; flex: none; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 9px; border: 0;
  background: var(--c, #8a94a6); color: var(--t, #fff); font: 700 17px/1 var(--font-cond); }
.badge.metro, .ln-b.metro { border-radius: 50%; width: 34px; padding: 0; }
.badge.tram, .ln-b.tram { border-radius: 17px; }
.badge.sm { min-width: 26px; height: 26px; font-size: 14px; border-radius: 7px; padding: 0 6px; }
.badge.sm.metro { width: 26px; border-radius: 50%; padding: 0; }
.badge.lg { min-width: 48px; height: 48px; font-size: 24px; border-radius: 12px; padding: 0 10px; }
.badge.lg.metro { width: 48px; border-radius: 50%; padding: 0; }
.badge.lg.tram { border-radius: 24px; }
.ln-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.ln-b { min-width: 44px; height: 44px; font-size: 19px; border-radius: 11px; transition: transform .12s; }
.ln-b.metro { width: 44px; }
.ln-b.tram { border-radius: 22px; padding: 0 12px; }
.ln-b:hover { transform: translateY(-1px); }
.ln-b:active { transform: scale(.95); }
/* état en mots, jamais seulement en couleur */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; font: 600 13.5px var(--font-cond); white-space: nowrap; flex: none; }
.pill .ico { width: 15px; height: 15px; }
.pill.ok { background: rgba(60,207,122,.14); color: #6fe3a0; }
.pill.warn { background: rgba(242,179,61,.15); color: #f6c86a; }
.pill.bad { background: rgba(240,90,90,.16); color: #ff8a8a; }
.pill.info { background: rgba(110,168,255,.14); color: #a9cbff; }
.pill.mute { background: var(--surface-2); color: var(--muted); }
.okline { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(60,207,122,.08); color: #bff0d3; font-size: 15px; }
.okline .ico { color: var(--ok); }
/* boutons */
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: 600 15.5px var(--font-cond); }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0b1220; }
.btn.primary:hover { background: #8bb9ff; }
.btn.stop { background: rgba(240,90,90,.15); border-color: rgba(240,90,90,.5); color: #ffb0b0; }
.btn.wide { flex: 1; }
.btn .ico { width: 18px; height: 18px; }
/* onglets segmentés (familles de lignes) */
.seg { display: flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: 600 15px var(--font-cond); }
.seg button[aria-selected="true"] { background: var(--surface-3); color: #fff; }
/* en-tête d'une fiche (véhicule, ligne, gare) */
.card-h { display: flex; align-items: center; gap: 12px; }
.card-h .what { flex: 1; min-width: 0; }
.card-h .what b { display: block; font: 700 21px/1.15 var(--font-cond); }
.card-h .what small { display: block; color: var(--muted); font-size: 14px; margin-top: 3px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.where { margin-top: 12px; font-size: 16px; line-height: 1.4; }
.where b { font-weight: 600; }
/* frise des arrêts : un trait aux couleurs de la ligne, un rond par arrêt */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; display: flex; align-items: baseline; gap: 12px; min-height: 40px; padding: 9px 0 9px 26px; font-size: 15.5px; }
.tl li::before { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 4px; background: var(--lc, var(--accent)); }
.tl li:first-child::before { top: 50%; } .tl li:last-child::before { bottom: 50%; }
.tl li::after { content: ""; position: absolute; left: 2px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: #fff; border: 3px solid var(--lc, var(--accent)); box-sizing: border-box; }
.tl li.past { color: var(--faint); }
.tl li.past::before, .tl li.past::after { opacity: .45; }
.tl li.here { font-weight: 700; }
.tl li.here::after { width: 18px; height: 18px; margin-top: -9px; left: 0; background: var(--lc, var(--accent)); border-color: #fff; }
.tl li.cx { color: var(--bad); text-decoration: line-through; }
.tl .t { width: 46px; flex: none; font: 600 15.5px var(--font-cond); font-variant-numeric: tabular-nums; }
.tl .n { flex: 1; min-width: 0; }
.tl .d { font: 600 13.5px var(--font-cond); }
.tl .pf { color: var(--muted); font-size: 13px; white-space: nowrap; }
.late { color: var(--warn); } .vlate { color: var(--bad); }
/* messages d'info trafic */
.msg { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--accent); margin-bottom: 8px; }
.msg.s2 { border-left-color: var(--warn); } .msg.s3 { border-left-color: var(--bad); }
.msg h4 { margin: 0 0 4px; font-size: 16px; line-height: 1.3; }
.msg p { margin: 0; color: #cdd3de; font-size: 14.5px; line-height: 1.5; white-space: pre-line; }
.msg small { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
/* réglages d'affichage : un interrupteur et une phrase qui dit ce qu'il fait */
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; }
.opt + .opt { border-top: 1px solid var(--line); }
.opt .what { flex: 1; }
.opt .what b { display: block; font: 600 16px var(--font-cond); }
.opt .what small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.4; margin-top: 2px; }
.switch { position: relative; flex: none; width: 46px; height: 28px; margin-top: 2px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 14px; background: #3a4354; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
details.more { margin-top: 18px; border-top: 1px solid var(--line); }
details.more > summary { display: flex; align-items: center; gap: 10px; min-height: 52px; list-style: none; cursor: pointer; font: 600 16px var(--font-cond); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .ico { color: var(--muted); }
details.more > summary::after { content: ""; margin-left: auto; width: 9px; height: 9px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s; }
details.more[open] > summary::after { transform: rotate(-135deg); }
/* aide : comment lire la carte */
.legend-row { display: flex; align-items: center; gap: 14px; padding: 9px 0; font-size: 15px; line-height: 1.4; }
.legend-row + .legend-row { border-top: 1px solid var(--line); }
.legend-row .sym { flex: none; width: 44px; display: flex; justify-content: center; }
.mode-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--c, #6ea8ff); color: #fff; }
.mode-ico.round { border-radius: 50%; }
.mode-ico svg { width: 20px; height: 20px; }
.delay-dots { display: flex; gap: 4px; } .delay-dots i { width: 12px; height: 12px; border-radius: 50%; }
/* légende flottante des retards, quand la carte est colorée selon le retard */
.map-legend { position: absolute; z-index: 1010; right: 12px; top: calc(var(--header-h) + 12px); display: flex; gap: 12px; align-items: center;
  padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.map-legend[hidden] { display: none; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
@media (max-width: 760px), (max-height: 500px) { .map-legend { top: auto; right: 10px; bottom: calc(var(--tab-h) + var(--sheet-peek, 90px) + 10px); } }

/* =============================================================== pastilles d'état en haut de la carte (train suivi) */
#map-chips { position: fixed; z-index: 1050; top: calc(var(--header-h) + 12px); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; max-width: calc(100vw - 24px); }
@media (min-width: 761px) { #map-chips { left: calc(50% + 186px); } }
@media (max-width: 760px), (max-height: 500px) { #map-chips { top: calc(env(safe-area-inset-top) + var(--tool-h, 96px) + 22px); } }
.map-chip { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 999px; min-height: 44px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.45);
  font: 600 15px/1.2 var(--font-cond); color: var(--text); animation: chip-in .22s ease-out; max-width: 100%; }
.map-chip .mc-body { display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-chip .rec { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); flex: none; animation: rec 1.2s ease-in-out infinite; }
.map-chip .mc-x { flex: none; height: 34px; padding: 0 12px; border-radius: 17px; border: 0; background: var(--surface-3); color: var(--text); font: 600 14px var(--font-cond); }
.map-chip .mc-x:hover { background: #333c4d; }
@keyframes chip-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes rec { 50% { opacity: .35; } }

/* =============================================================== pouls du réseau */
.pulse-h { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.pulse-h > span { display: none; }
.pulse-h small { flex-basis: 100%; color: var(--muted); font-weight: 400; font-size: 14px; }
.pulse-h small b { color: var(--text); font-weight: 600; }
.pulse-svg { display: block; width: 100%; height: 56px; cursor: crosshair; touch-action: pan-y; }
.pulse-area { fill: rgba(110, 168, 255, .22); stroke: rgba(110, 168, 255, .7); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pulse-line { fill: none; stroke: var(--warn); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.pulse-ticks line { stroke: #222937; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pulse-ticks text { fill: var(--faint); font: 500 8px var(--font-cond); }
.pulse-cursor { stroke: var(--text); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 2 2; }
.pulse-leg { display: flex; gap: 14px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.pulse-leg i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }
.pulse-leg i.a { background: rgba(110, 168, 255, .8); } .pulse-leg i.l { background: var(--warn); }

/* =============================================================== tableau des départs façon panneau de gare (palettes) */
.board-rows { background: #07090d; border: 1px solid #1d232e; border-radius: 12px; padding: 2px 12px; }
.dep { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; min-height: 52px; padding: 8px 0; border-top: 1px solid #161b25; }
.dep:first-child { border-top: 0; }
.dep .dest { font: 500 16px/1.25 var(--font-cond); min-width: 0; }
.dep .dest small { display: block; color: var(--muted); font: 400 13px var(--font); margin-top: 2px; }
.dep .times { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font: 600 16px var(--font-cond); color: #f6c453;
  font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.dep .times span + span { font-size: 13.5px; color: #c9a548; }
.dep .times .cx { color: var(--bad); text-decoration: line-through; }
.dep .times .late { color: var(--warn); } .dep .times .vlate { color: var(--bad); }
.dep.cx .dest, .dep.cx .t { text-decoration: line-through; color: var(--bad); }
.dep .t { font: 600 16px var(--font-cond); color: #f6c453; font-variant-numeric: tabular-nums; }
.dep .t small { display: block; font-size: 13px; }
.dep .pf { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }
.tabs2 { display: flex; gap: 4px; padding: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.tabs2 button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: 600 15px var(--font-cond); }
.tabs2 button[aria-selected="true"] { background: var(--surface-3); color: #fff; }

/* =============================================================== thème clair (option « Thème » ; automatique : comme le téléphone) */
:root[data-theme="light"] {
  --bg: #e9edf2; --surface: #ffffff; --surface-2: #f1f4f8; --surface-3: #e2e7ee; --line: #d3dae4;
  --text: #121722; --muted: #485264; --faint: #646e80; --accent: #1f5fd6;
  --ok: #138a4a; --warn: #b36b00; --bad: #c62828;
  --header-bg: rgba(255, 255, 255, .96); --rail: #c3cbd8;
  color-scheme: light;
}
:root[data-theme="light"] .site { color: var(--text); border-bottom-color: var(--line); }
:root[data-theme="light"] .site .stop[aria-current="page"] { color: var(--text); }
:root[data-theme="light"] .site .stop::after { border-color: #8d97a8; }
:root[data-theme="light"] .site .stop[aria-current="page"]::after { background: var(--accent); border-color: #fff; box-shadow: 0 0 0 3px rgba(31, 95, 214, .3); }
:root[data-theme="light"] .site .clock { background: var(--surface-2); color: var(--text); }
:root[data-theme="light"] .tabbar { border-top-color: var(--line); }
:root[data-theme="light"] .tabbar a[aria-current="page"] { color: var(--accent); }
:root[data-theme="light"] .leaflet-control-attribution { background: rgba(255,255,255,.8) !important; }
:root[data-theme="light"] .search, :root[data-theme="light"] .chip, :root[data-theme="light"] .panel,
:root[data-theme="light"] .results, :root[data-theme="light"] .map-chip, :root[data-theme="light"] .map-legend { box-shadow: 0 4px 18px rgba(20, 30, 50, .16); }
:root[data-theme="light"] .chip[aria-pressed="true"] { background: #dce8ff; color: #0f2f6e; }
:root[data-theme="light"] .chip[aria-pressed="true"] .n { color: #3a5795; }
:root[data-theme="light"] .pill.ok { background: rgba(19,138,74,.12); color: #0d6b39; }
:root[data-theme="light"] .pill.warn { background: rgba(179,107,0,.13); color: #8a5200; }
:root[data-theme="light"] .pill.bad { background: rgba(198,40,40,.12); color: #a11c1c; }
:root[data-theme="light"] .pill.info { background: rgba(31,95,214,.12); color: #1b4fb3; }
:root[data-theme="light"] .okline { background: rgba(19,138,74,.09); color: #0d5c32; }
:root[data-theme="light"] .btn.primary { color: #fff; }
:root[data-theme="light"] .btn.primary:hover { background: #3a74e0; }
:root[data-theme="light"] .btn.stop { color: #a11c1c; }
:root[data-theme="light"] .seg button[aria-selected="true"], :root[data-theme="light"] .tabs2 button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(20,30,50,.15); }
:root[data-theme="light"] .msg p { color: #2c3443; }
:root[data-theme="light"] .switch span { background: #c3cbd8; }
:root[data-theme="light"] .err { background: rgba(198,40,40,.08); }
:root[data-theme="light"] .pulse-ticks line { stroke: var(--line); }
:root[data-theme="light"] .panel.sheet .sheet-grip::before { background: #b8c1ce; }
:root[data-theme="light"] .map-chip .mc-x:hover { background: #d5dce6; }
/* le panneau des départs reste un panneau de gare : noir, lettres jaunes et blanches, quel que soit le thème */
.board-rows { color: #eef1f6; --muted: #a3acbd; --faint: #7d879a; --warn: #f2b33d; --bad: #f05a5a; }
.board-rows .empty { color: #a3acbd; }

/* =============================================================== petit message de confirmation (« Lien copié ») */
.toast { position: fixed; z-index: 1200; left: 50%; bottom: calc(var(--tab-h) + 24px); transform: translateX(-50%); max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 24px; background: #121722; color: #fff; font: 600 15px var(--font-cond); box-shadow: 0 8px 28px rgba(0,0,0,.4);
  animation: chip-in .2s ease-out; pointer-events: none; }
.icon-btn.on { color: var(--warn); }
.fav-star.on svg { fill: currentColor; }

/* =============================================================== trajet direct, ponctualité sur 7 jours, favoris */
.trip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.trip label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.trip select, .field { width: 100%; height: 44px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 15px; }
.pbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; }
.pbar { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.pbar .v { font: 600 12.5px var(--font-cond); color: var(--muted); font-variant-numeric: tabular-nums; }
.pbar .b { display: flex; align-items: flex-end; width: 100%; height: 64px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.pbar .b i { display: block; width: 100%; border-radius: 6px 6px 0 0; }
.pbar .d { font-size: 12px; color: var(--faint); text-transform: capitalize; }
.btn.fav-star.on { color: var(--warn); border-color: var(--warn); }
.card-h .fav-star { margin-right: -8px; }
a.btn { text-decoration: none; }

/* =============================================================== bouton « Autour de moi » sur la carte (en bas à droite, comme dans les applis de cartes) */
.locate-fab { position: absolute; z-index: 990; right: 12px; bottom: calc(var(--tab-h) + 30px); display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 16px 0 13px; border-radius: 23px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 600 15.5px var(--font-cond); box-shadow: 0 6px 22px rgba(0,0,0,.4); }
.locate-fab .ico { color: var(--accent); }
.locate-fab:hover { background: var(--surface-2); }
.near-row { margin-top: 2px; }
.near-row > .ico:first-child { color: var(--accent); }
@media (max-width: 760px), (max-height: 500px) {
  .locate-fab { bottom: calc(var(--tab-h) + var(--sheet-peek, 90px) + 12px); }
  .map-legend { bottom: calc(var(--tab-h) + var(--sheet-peek, 90px) + 68px); }
}
:root[data-theme="light"] .locate-fab { box-shadow: 0 4px 18px rgba(20, 30, 50, .16); }

/* ------------------------------------------------ itinéraires */
.rt-entry { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; margin-bottom: 12px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); color: var(--text); text-align: left; cursor: pointer; }
.rt-entry:hover { background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); }
.rt-entry > svg:first-child { width: 26px; height: 26px; color: var(--accent); flex: none; }
.rt-entry span { flex: 1; min-width: 0; }
.rt-entry b { display: block; font: 700 18px/1.2 var(--font-cond); }
.rt-entry small { display: block; color: var(--muted); font-size: 14px; }
.rt-form { position: relative; display: grid; grid-template-columns: 1fr 44px; gap: 8px; align-items: center; }
.rt-form .rt-field { grid-column: 1; }
.rt-form .rt-swap { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.rt-form .rt-when, .rt-form > .btn { grid-column: 1 / -1; }
.rt-field { position: relative; }
.rt-field input { width: 100%; height: 48px; padding: 0 12px 0 34px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 16px; }
.rt-field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.rt-dot { position: absolute; left: 13px; top: 50%; width: 11px; height: 11px; margin-top: -5.5px; border-radius: 50%; border: 3px solid #3ccf7a; pointer-events: none; }
.rt-dot.b { border-color: #f05a5a; border-radius: 2px; }
.rt-when { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.rt-when select:only-child, .rt-when select:has(+ [hidden]) { grid-column: 1 / -1; }
.ac { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow: auto; padding: 4px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.ac button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 15px; text-align: left; cursor: pointer; }
.ac button:hover, .ac button:focus-visible { background: var(--surface-2); }
.ac button svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.ac button[data-me] svg { color: var(--accent); }
.ac .empty { padding: 10px; }
.jr { align-items: center; }
.jr-top { display: flex; align-items: baseline; gap: 10px; }
.jr-top b { display: inline !important; font: 700 18px/1.2 var(--font-cond) !important; }
.jr-dur { margin-left: auto; font: 700 16px/1 var(--font-cond); color: var(--text); }
.jr-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0 4px; }
.jr-sep { color: var(--faint); font-size: 14px; }
.jr-walk { display: inline-flex; align-items: center; gap: 1px; color: var(--muted); font: 600 13px/1 var(--font-cond); }
.jr-walk svg { width: 16px; height: 16px; }
.steps { list-style: none; margin: 16px 0 0; padding: 0; }
.steps li { position: relative; display: flex; gap: 12px; padding: 0 0 16px; }
.steps li::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 2px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--surface-3); }
.steps li.st-pt::before { background: var(--lc); }
.steps li.st-walk::before { background: none; border-left: 4px dotted var(--faint); }
.steps li.st-end::before { display: none; }
.st-ico { flex: none; align-self: flex-start; display: grid; place-items: center; width: 32px; height: 32px; color: var(--muted); position: relative; z-index: 1; }
.st-ico svg { width: 20px; height: 20px; }
.st-end .st-ico { color: #f05a5a; }
.st-txt { flex: 1; min-width: 0; padding-top: 4px; }
.st-txt > b { display: block; font: 600 16px/1.25 var(--font-cond); }
.st-dir { font-weight: 500; color: var(--muted); }
.st-txt small { display: block; color: var(--muted); font-size: 13px; margin: 3px 0; }
.st-stop { display: flex; gap: 8px; margin-top: 6px; font-size: 15px; }
.st-stop .t { font: 700 15px/1.3 var(--font-cond); min-width: 42px; }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.ac button small { display: block; color: var(--muted); font-size: 12px; }

/* ------------------------------------------------ fond de carte et réseau ferré */
.rails.soft { filter: saturate(.55) brightness(.9); }
.layers-ctl { position: relative; clear: both; }
.layers-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); box-shadow: 0 4px 14px rgba(0,0,0,.3); cursor: pointer; }
.layers-btn:hover, .layers-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--accent); }
.layers-btn svg { width: 22px; height: 22px; }
.layers-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 300px; max-width: calc(100vw - 20px); max-height: calc(100vh - 200px); overflow-y: auto;
  padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.layers-pop h3 { margin: 4px 2px 8px; font: 700 12px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.layers-pop h3 + .lp-grid { margin-bottom: 14px; }
.lp-grid { display: grid; gap: 4px; }
.lp-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 4px; border-radius: 10px; border: 1px solid transparent;
  background: none; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.lp-opt:hover { background: var(--surface-2); }
.lp-opt[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); border-color: var(--accent); }
.lp-thumb { flex: none; width: 44px; height: 44px; border-radius: 8px; background-color: var(--surface-3); background-size: 160px; background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.lp-txt { min-width: 0; }
.lp-txt b { display: block; font: 600 15px/1.2 var(--font-cond); }
.lp-txt small { display: block; color: var(--muted); font-size: 12.5px; }
.lp-src { margin: 2px; color: var(--faint); font-size: 11.5px; }
@media (max-width: 760px) {
  /* téléphone : le bouton passe sous la barre de recherche */
  .leaflet-top.leaflet-right { top: calc(var(--tool-h, 96px) + 18px); }
  /* le choix s'arrête au-dessus du volet (qui passe devant la carte) */
  .layers-pop { max-height: calc(100dvh - var(--header-h) - var(--tool-h, 96px) - 92px - var(--tab-h) - var(--sheet-peek, 90px)); }
}
:root[data-theme="light"] .layers-btn, :root[data-theme="light"] .layers-pop { box-shadow: 0 6px 22px rgba(20,30,50,.16); }

/* ------------------------------------------------ compteur des trains (grandes lignes) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 4px 14px rgba(0,0,0,.3); overflow: hidden; }
.kpi { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; min-height: 52px; padding: 6px 10px; border: 0;
  background: none; color: var(--text); text-align: left; font: inherit; }
.kpi + .kpi { border-left: 1px solid var(--line); }
button.kpi { cursor: pointer; }
button.kpi:hover { background: var(--surface-2); }
.kpi b { font: 700 19px/1 var(--font-cond); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi b i { font: 600 12px var(--font); font-style: normal; color: var(--muted); margin-left: 4px; }
.kpi b.late { color: var(--warn); }
.kpi b.vlate { color: var(--bad); }
.kpi small { color: var(--muted); font-size: 11.5px; line-height: 1.15; }
@media (max-width: 760px) {
  /* téléphone : quatre colonnes serrées, sous les marques */
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: 12px; }
  .kpi { min-height: 40px; padding: 4px 8px; gap: 1px; }
  .kpi b { font-size: 15px; }
  .kpi b i { display: none; }
  .kpi small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
:root[data-theme="light"] .kpis { box-shadow: 0 4px 14px rgba(20,30,50,.12); }

/* ------------------------------------------------ voie habituelle, destinations directes */
.dep .pf.est, .tl .pf.est { color: var(--faint); }
.pf.est small { display: block; font-size: 10.5px; line-height: 1.1; }
.dst-n { flex: none; display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 17px;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); color: var(--accent); font: 700 15px/1 var(--font-cond); }
.dst-b { flex: none; display: flex; gap: 3px; }
.dst-b i { width: 8px; height: 8px; border-radius: 2px; }

/* ------------------------------------------------ carte de chaleur des retards */
.heat-chip { display: inline-flex; align-items: center; gap: 8px; }
.heat-chip i { display: inline-block; width: 64px; height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, rgba(242,179,61,.35), #f2b33d 30%, #f07a3a 55%, #f05a5a 78%, #a0123a); }
.heat-chip small { color: var(--muted); font: 500 12px var(--font); }

/* ------------------------------------------------ vélos en libre-service : pastille (vélos / places) et fiche d'une station */
:root { --bike: #2ad4bf; }
.chip-sep { flex: none; width: 1px; align-self: center; height: 24px; margin: 0 2px; background: var(--line); }
.chip.bike[aria-pressed="true"] { background: color-mix(in srgb, var(--bike) 18%, var(--surface)); border-color: var(--bike); }
.chip.bike .ico { color: var(--bike); }
.bk-chip { display: inline-flex; align-items: center; gap: 8px; }
.bk-chip > .ico { color: var(--bike); }
.bk-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-3); }
.bk-seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 14px var(--font-cond); }
.bk-zoom { color: var(--muted); font: 500 12px var(--font); }
.bk-seg button[aria-pressed="true"] { background: var(--bike); color: #0e1116; }
.bk-card { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 10px; }
.bk-n { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.bk-n b { font: 700 40px/1 var(--font-cond); font-variant-numeric: tabular-nums; }
.bk-n span { font: 600 15px var(--font-cond); margin-top: 2px; }
.bk-n small { color: var(--muted); font-size: 13px; margin-top: 2px; }
.bk-n.on { border-color: var(--bike); box-shadow: inset 0 0 0 1px var(--bike); }
.bk-n.on b { color: var(--bike); }
.bk-card.closed .bk-n b { color: var(--faint); }
.bk-mini { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bike); color: #0e1116;
  font: 700 13px var(--font-cond); }
.bk-mini.docks { background: transparent; color: var(--bike); box-shadow: inset 0 0 0 2.5px var(--bike); }
:root[data-theme="light"] { --bike: #0f9e8e; }
:root[data-theme="light"] .chip.bike[aria-pressed="true"] { background: #d3f5f0; border-color: var(--bike); color: #0b4f47; }
:root[data-theme="light"] .bk-n.on b, :root[data-theme="light"] .bk-mini.docks { color: #0b7d70; }

/* ------------------------------------------------ tableau de la gare par-dessus la carte, bulle de survol */
.board-ov { position: fixed; z-index: 1200; top: calc(var(--header-h) + 10px); left: 10px; right: 10px; bottom: calc(var(--tab-h) + 10px);
  border-radius: 14px; overflow: hidden; background: #12418d; box-shadow: 0 20px 60px rgba(0,0,0,.55); animation: chip-in .2s ease-out; }
.board-ov iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 760px), (max-height: 500px) { .board-ov { top: 0; left: 0; right: 0; bottom: var(--tab-h); border-radius: 0; } }
.board-btn { display: flex; width: 100%; margin-bottom: 12px; }
.board-rows .late { color: #ffd200; } .board-rows .vlate { color: #ffb4b4; }
.map-tip { position: fixed; z-index: 1300; pointer-events: none; max-width: 280px; padding: 7px 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.map-tip b { display: block; font: 700 15px/1.2 var(--font-cond); }
.map-tip small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
/* tableaux dans les fiches : couleurs des panneaux de gare (bleu, heures en jaune) */
.board-rows { background: #12418d; border: 0; padding: 0; overflow: hidden; color: #fff; --muted: rgba(255,255,255,.75); --faint: rgba(255,255,255,.55); }
.board-rows[data-act] { cursor: pointer; }
.board-rows .dep { padding: 8px 12px; border-top: 0; }
.board-rows .dep:nth-child(odd) { background: #2a64b9; }
.board-rows .dep .t, .board-rows .dep .times { color: #ffd200; }
.board-rows .dep .times span + span { color: rgba(255,210,0,.8); }
.board-rows .dep .pf { color: rgba(255,255,255,.85); }
.board-rows .empty { color: rgba(255,255,255,.8); padding: 14px 12px !important; }

/* arrêts d'un trajet : chacun ouvre sa gare */
.tl li:has(.tl-go) { padding-top: 0; padding-bottom: 0; }
.tl-go { display: flex; align-items: baseline; gap: 12px; width: 100%; min-height: 40px; padding: 9px 6px 9px 0; border: 0; border-radius: 8px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.tl-go:hover { background: var(--surface-2); }
.tl-go:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tl-go .ico.go { width: 16px; height: 16px; flex: none; align-self: center; color: var(--faint); }
/* arrivées en vert, comme les panneaux des gares */
.board-rows.arr { background: #0b6838; }
.board-rows.arr .dep:nth-child(odd) { background: #16884b; }


/* ------------------------------------------------ quel ticket ? (Île-de-France) */
.fare { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface-2); }
.fare p { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--text); }
.fare-main { display: flex; align-items: baseline; gap: 10px; }
.fare-main b { flex: 1; font: 700 17px/1.2 var(--font-cond); }
.fare-price { font: 700 20px/1 var(--font-cond); color: var(--accent); white-space: nowrap; }
.fare-warn { display: flex; gap: 8px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 14%, transparent); }
.fare-warn svg { flex: none; width: 18px; height: 18px; color: var(--warn); margin-top: 1px; }
.fare-sub { color: var(--muted) !important; font-size: 13px !important; }
.fare-h { margin: 12px 0 4px; font: 700 12px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fare-buy { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.45; }
.fare-buy li + li { margin-top: 4px; }
.fare-src { color: var(--faint) !important; font-size: 12px !important; margin-top: 10px !important; }
.fare-src a { color: var(--muted); }
