/* ═══════════════════════════════════════════════════════════════════════════
   Écran « Prochains passages » — refonte Tracéo (É1), responsive mobile/desktop.
   Point de rupture : 900px. Mobile = pile + liste unifiée + barre flottante.
   Desktop = héro + fiabilité pleine largeur + 2 colonnes (passages | contexte).
   Tokens uniquement (frontend/tokens/), deux thèmes gérés par les variables.
   ═══════════════════════════════════════════════════════════════════════════ */

#step-passages { display: flex; flex-direction: column; gap: var(--sp-5); }
@media (max-width: 899.98px) { #step-passages { padding-bottom: 88px; } }  /* barre flottante */
@media (min-width: 900px) { #app.passages-wide { max-width: 1080px; } }

/* Pastille « en direct » (identité, mise à jour, puces) */
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  flex-shrink: 0; display: inline-block;
  animation: tr-pulse-ring 2s var(--ease-out) infinite;
}
@keyframes tr-pulse-ring {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 6px transparent; }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ── Héro / identité de l'arrêt ─────────────────────────────────────────── */
.stopid { display: flex; align-items: center; gap: var(--sp-3); }
.stopid:empty { display: none; }
.stopid__badge { min-width: 40px; height: 40px; font-size: 16px; }
.stopid__id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.stopid__name {
  font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink);
  line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stopid__sub { font-size: var(--fs-2xs); font-weight: 600; color: var(--ink-3); }
.stopid__chips { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-top: 4px; }
.htag {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap;
}
/* Puce sans variante = état inconnu : pastille éteinte, rien n'est affirmé */
.htag .live-dot { background: var(--ink-faint); animation: none; }
.htag--live { background: var(--ok-wash); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 26%, transparent); }
.htag--a11y { background: var(--info-wash); color: var(--info); border-color: color-mix(in srgb, var(--info) 26%, transparent); }
/* Trafic dégradé / interrompu (héro de l'écran ligne, É3) */
.htag--warn { background: var(--warn-wash); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.htag--crit { background: var(--crit-wash); color: var(--crit); border-color: color-mix(in srgb, var(--crit) 30%, transparent); }
.htag--live .live-dot { background: var(--ok); animation: tr-pulse-ring 2s var(--ease-out) infinite; }
.htag--warn .live-dot { background: var(--warn); }
.htag--crit .live-dot { background: var(--crit); }
@media (prefers-reduced-motion: reduce) { .htag--live .live-dot { animation: none; } }
.stopid__trafic {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: var(--r-pill);
  background: var(--ok-wash); color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 26%, transparent);
  font-size: var(--fs-2xs); font-weight: 700; white-space: nowrap;
}
.stopid__trafic.is-perturbe { background: var(--warn-wash); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.stopid__trafic.is-perturbe .live-dot { background: var(--warn); }

/* Mobile : compact, puces masquées, actions flottantes (au-dessus de la tabbar) */
@media (max-width: 899.98px) {
  .stopid__chips { display: none; }
  .stopid__actions {
    position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
    z-index: 55; display: flex; align-items: center; gap: 6px; padding: 6px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px);
    border: 1px solid var(--border); border-radius: var(--r-pill); box-shadow: var(--sh-3);
  }
  .stopid__actions:empty { display: none; }
  .stopid__actions .tr-btn { border-radius: var(--r-pill); height: 46px; padding: 0 18px; }
}
/* Desktop : carte héro teintée (couleur de ligne), puces visibles, actions inline */
@media (min-width: 900px) {
  .stopid {
    padding: var(--sp-5) var(--sp-6);
    background: color-mix(in srgb, var(--htint, var(--surface-2)) 12%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--htint, var(--border)) 26%, var(--border));
    border-radius: var(--r-lg); box-shadow: var(--sh-2);
  }
  .stopid__badge { min-width: 56px; height: 56px; font-size: 22px; border-radius: 12px; }
  .stopid__name { font-size: var(--fs-h1); }
  .stopid__trafic { display: none; }
  .stopid__actions { margin-left: auto; display: flex; gap: var(--sp-2); }
}

/* ── Ligne « mis à jour à … » + badge de canal SIRI ────────────────────── */
.update-status {
  font-size: var(--fs-xs); color: var(--ink-3);
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-top: -8px;
}
.update-status:empty { display: none; }
.maj__at { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); }
.maj__at b { color: var(--ink-2); font-weight: 700; }
.update-status.stale {
  color: var(--warn); font-weight: 600; margin-top: 0;
  background: var(--warn-wash); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: var(--r-sm); padding: .4rem .7rem;
}
.src-channel { margin-left: 2px; cursor: help; vertical-align: middle; }

/* ── Libellés de section ───────────────────────────────────────────────── */
.t-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--ls-label); color: var(--ink-3); white-space: nowrap;
}
.sec-hd { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-height: 26px; }
.fiab-hint { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--ink-faint); }

/* ── Fiabilité & Confort (hybride : cartes mobile / détail desktop) ──────── */
.fiab-sec { display: flex; flex-direction: column; gap: var(--sp-3); }
.fiab-detail { display: flex; flex-direction: column; gap: var(--sp-3); }
.scores { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.score {
  display: flex; align-items: center; gap: var(--sp-3); min-height: 72px;
  padding: var(--sp-3) var(--sp-4); text-align: left; cursor: pointer; font-family: var(--font-ui);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-1);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.score:hover { border-color: var(--border-strong); }
.score .tr-note { flex-shrink: 0; }
.score__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.score__k { font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--ink-3); }
.score__v { font-size: var(--fs-sm); font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score__chev { flex-shrink: 0; color: var(--ink-faint); transition: transform var(--dur-base) var(--ease-out); }
#reliability-block.is-open #score-fiab .score__chev { transform: rotate(180deg); }
/* Mobile : détail replié par défaut ; Desktop : cartes cachées, détail inline */
@media (max-width: 899.98px) {
  .fiab-detail { display: none; }
  #reliability-block.is-open .fiab-detail { display: flex; }
}
@media (min-width: 900px) { .scores { display: none; } }

.reliability {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--sh-1); padding: var(--sp-3) var(--sp-4);
}
.reliability.rel-block-link { cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out); }
.reliability.rel-block-link:hover, .reliability.rel-block-link:focus { border-color: var(--border-strong); outline: none; }
.rel-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; min-width: 0; }
.rel-text strong { color: var(--ink); font-weight: 800; }
.rel-note { font-size: var(--fs-2xs); color: var(--ink-3); }
.rel-breakdown { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--ink-3); }
.rel-breakdown span { padding: .05rem .4rem; border: 1px solid var(--border); border-radius: var(--r-xs); white-space: nowrap; }
.rel-breakdown .rel-eq { color: var(--ink); font-weight: 700; border-color: var(--border-strong); }
.rel-divergence { font-size: var(--fs-sm); border-radius: var(--r-sm); padding: .45rem .65rem; }
.rel-div-bad  { background: var(--crit-wash); color: var(--ink); }
.rel-div-good { background: var(--ok-wash); color: var(--ink); }
.rel-trend { font-size: var(--fs-xs); font-weight: 700; border-radius: var(--r-sm); padding: .35rem .6rem; display: inline-block; }
.rel-trend-down { background: var(--crit-wash); color: var(--crit); }
.rel-trend-up   { background: var(--ok-wash); color: var(--ok); }
.rel-frise { display: flex; gap: 2px; height: 22px; }
.rel-seg {
  flex: 1; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-xs); font-family: var(--font-mono); font-size: var(--fs-2xs);
  font-weight: 800; color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}
.rel-seg-empty { background: var(--surface-3); color: var(--ink-3); text-shadow: none; }
.rel-seg-now { outline: 2px solid var(--ink); outline-offset: 1px; }
.rel-frise-cap { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--ink-faint); margin-top: .3rem; }
.rel-frise-hours { display: flex; gap: 2px; margin-top: 2px; }
.rel-hr { text-align: center; font-family: var(--font-mono); font-size: 9px; color: var(--ink-faint); white-space: nowrap; }

/* ── Info trafic / perturbations / accessibilité ───────────────────────── */
#traffic-block:empty { display: none; }
.traffic-ok {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: var(--fs-sm); font-weight: 700; color: var(--ok);
  background: var(--ok-wash); border: 1px solid color-mix(in srgb, var(--ok) 26%, transparent);
  padding: .35rem .8rem; border-radius: var(--r-pill);
}
.access-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: var(--fs-sm); font-weight: 600;
  padding: .35rem .8rem; border-radius: var(--r-pill); border: 1px solid var(--border);
}
.access-badge.access-ok { color: var(--ok); background: var(--ok-wash); border-color: color-mix(in srgb, var(--ok) 26%, transparent); }
.access-badge.access-warn { color: var(--warn); background: var(--warn-wash); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.access-badge.access-no { color: var(--ink-3); background: var(--surface-2); }

.disruption {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--dc, var(--warn)); border-radius: var(--r-md); overflow: hidden;
}
.disruption.future { opacity: .85; }
.disruption summary { display: flex; align-items: center; gap: .6rem; padding: .65rem .9rem; cursor: pointer; list-style: none; user-select: none; }
.disruption summary::-webkit-details-marker { display: none; }
.disruption summary::after { content: '▾'; color: var(--ink-3); font-size: .8rem; transition: transform var(--dur-base) var(--ease-out); }
.disruption[open] summary::after { transform: rotate(180deg); }
.disruption summary:hover { background: var(--surface-2); }
.dis-icon { flex-shrink: 0; font-size: .95rem; }
.dis-title { flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; color: var(--ink); }
.dis-tags { flex-shrink: 0; }
.dis-chip { font-size: var(--fs-2xs); font-weight: 700; padding: .12rem .5rem; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-3); white-space: nowrap; }
.dis-chip.dis-future { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.dis-body { padding: .2rem .9rem .8rem 2.4rem; font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-2); }
.dis-body ul { margin-left: 1rem; }
.dis-body li { margin-bottom: .25rem; }
.future-group { border: 1px dashed var(--border); border-radius: var(--r-md); }
.future-group > summary { display: flex; align-items: center; gap: .5rem; padding: .5rem .9rem; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); cursor: pointer; list-style: none; user-select: none; }
.future-group > summary::-webkit-details-marker { display: none; }
.future-group > summary::after { content: '▾'; margin-left: auto; font-size: .8rem; transition: transform var(--dur-base) var(--ease-out); }
.future-group[open] > summary::after { transform: rotate(180deg); }
.future-group > summary:hover { color: var(--ink); }
.future-items { padding: .2rem .6rem .6rem; }
.future-items .disruption { margin-bottom: .4rem; }
.future-items .disruption:last-child { margin-bottom: 0; }

/* ── Disposition passages : 2 colonnes desktop / pile mobile ────────────── */
.passages-layout { display: flex; flex-direction: column; gap: var(--sp-5); }
.passages-main, .passages-aside { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
@media (min-width: 900px) {
  .passages-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-5) var(--sp-6); align-items: start; }
}

.passages-sec { display: flex; flex-direction: column; gap: var(--sp-3); }
.source-toggle { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; }
.source-toggle:empty { display: none; }

/* Colonnes par direction (desktop) */
.board-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-4) var(--sp-5); align-items: start; }
.dirgroup { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.dirgroup__hd { display: flex; flex-direction: column; gap: 2px; padding: 0 2px 2px; min-width: 0; }
.dirgroup__hd-top { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.dirgroup__arrow { color: var(--ink-3); flex-shrink: 0; }
.dirgroup__dest { font-size: var(--fs-h3); font-weight: 800; color: var(--ink); letter-spacing: -.01em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Ligne cadence toujours réservée (même vide) : les boards des 2 colonnes démarrent à la même hauteur */
.dirgroup__freq { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; min-height: 1.2em; }

/* Liste (mobile unifiée / colonne desktop) */
.board { display: flex; flex-direction: column; gap: var(--sp-2); }

/* Cartes de passage : tr-passage (tokens) + variantes d'écran */
.tr-passage { background: var(--tint, var(--surface)); }
.tr-passage__big { display: flex; align-items: baseline; gap: 5px; }
.tr-passage__state { font-size: var(--fs-2xs); font-weight: 800; color: var(--traceo-red); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; margin-top: 3px; }
.tr-src--retard   { background: var(--warn-wash); color: var(--warn); }
.tr-src--supprime { background: var(--crit-wash); color: var(--crit); }
.tr-passage--off { background: var(--surface-2); box-shadow: none; }
.tr-passage--off .tr-passage__dest, .tr-passage--off .tr-passage__min { color: var(--ink-faint); }
.tr-passage--off .tr-passage__next { color: var(--ink-faint); text-decoration: line-through; }
.tr-passage__next s { opacity: .6; margin-left: .3rem; }
.mission-code {
  font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .04em;
  color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: var(--r-xs);
}

/* ── Correspondances (carte) ───────────────────────────────────────────── */
#stop-corr:empty { display: none; }
.stop-corr-label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--ink-3); margin-bottom: var(--sp-2); }
.stop-corr-badges {
  display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--sh-1); padding: var(--sp-3) var(--sp-4);
}

/* ── Affluence prévue (Phase 4) — dépliable mobile / carte ouverte desktop ── */
.affluence {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--ac); border-radius: var(--r-md); box-shadow: var(--sh-1); overflow: hidden;
}
.affluence > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); min-height: 44px; }
.affluence > summary::-webkit-details-marker { display: none; }
.aff-label { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink); white-space: nowrap; }
.aff-label strong { color: var(--ac); font-weight: 800; }
.aff-spark { display: flex; align-items: flex-end; gap: 2px; height: 18px; flex: 1; min-width: 0; margin-left: var(--sp-2); }
.aff-spark i { flex: 1; border-radius: 1px; background: var(--surface-3); min-height: 2px; }
.aff-spark i.now { background: var(--ac); }
.aff-chev { flex-shrink: 0; color: var(--ink-3); transition: transform var(--dur-base) var(--ease-out); }
.affluence[open] .aff-chev { transform: rotate(180deg); }
.aff-body { padding: 0 var(--sp-4) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.aff-gauge { height: 8px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; }
.aff-fill { height: 100%; background: var(--ac); border-radius: var(--r-pill); transition: width var(--dur-slow) var(--ease-out); }
.aff-profile { display: flex; align-items: flex-end; gap: 2px; height: 40px; }
.aff-bar { flex: 1; background: var(--surface-3); border-radius: 2px 2px 0 0; min-height: 3px; }
.aff-bar.now { background: var(--ac); }
.aff-note { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--ink-faint); }
@media (min-width: 900px) {
  .affluence > summary { pointer-events: none; }   /* toujours ouvert sur desktop */
  .aff-chev { display: none; }
}

/* ── Confort & matériel roulant (Phase 3) ──────────────────────────────── */
.comfort { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-1); }
.comfort > summary { padding: .7rem .9rem; cursor: pointer; font-size: var(--fs-sm); list-style: none; display: flex; align-items: center; gap: .1rem; color: var(--ink); }
.comfort > summary::-webkit-details-marker { display: none; }
.comfort > summary::before { content: '▸'; display: inline-block; margin-right: .45rem; color: var(--ink-3); transition: transform var(--dur-base) var(--ease-out); }
.comfort[open] > summary::before { transform: rotate(90deg); }
.comfort-body { padding: .1rem .9rem .8rem; }
.comfort-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.comfort-table th { text-align: left; color: var(--ink-3); font-weight: 600; padding: .32rem .7rem .32rem 0; white-space: nowrap; vertical-align: top; }
.comfort-table td { padding: .32rem 0; color: var(--ink); }
.cf-sub { color: var(--ink-3); font-weight: 400; font-size: .92em; }
.comfort-notes { font-size: var(--fs-sm); color: var(--ink-2); margin: .55rem 0 .2rem; }
.comfort-disclaimer { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--ink-faint); margin: .3rem 0 0; }

/* ── Pied de page source ───────────────────────────────────────────────── */
.pagefoot {
  font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--ink-faint);
  text-align: center; line-height: 1.5; margin: 0; padding: var(--sp-3) var(--sp-2) 0;
  border-top: 1px solid var(--border);
}

/* ── Actions En partir / Y aller : barre flottante (mobile) via .stopid ─── */
.stop-ja-btn { white-space: nowrap; }
