/*
  Départs — design system "Fiche horaire" (see DESIGN.md)
  Idea: the printed timetable of the network. Real tables with hairline rules, a 2px ink rule opening
  each part, colour only as information (official line colours + 3 status colours), the horizontal
  line plan as signature, times in a monospace face. Text: Atkinson Hyperlegible Next; times: Mono.
  Type scale: 12 · 13 · 15 · 17 · 22 · 30 · 44. No radius except official badges and floating panels.
*/
:root {
  color-scheme: light dark;
  --paper: light-dark(#ffffff, #111214);
  --paper-2: light-dark(#f3f3f0, #1b1c1f);
  --ink: light-dark(#111111, #ededea);
  --ink-2: light-dark(#55585f, #a3a6ad);
  --ink-3: light-dark(#666970, #8f929a);
  --rule: light-dark(#e3e3df, #2c2d32);
  --stop: light-dark(#c8102e, #ff6b6e);
  --warn: light-dark(#a85600, #f0a43a);
  --ok: light-dark(#12743b, #3fcf7c);
  --float: 0 18px 40px -16px rgba(0,0,0,.28), 0 2px 6px rgba(0,0,0,.08);
  --font: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --mono: 'Atkinson Hyperlegible Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }

* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html { scroll-padding-top: 80px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
h1[tabindex="-1"]:focus { outline: none; } /* focus moved by script after navigation, not by the user */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--ink); color: var(--paper); text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(40px, env(safe-area-inset-left)); padding-right: max(40px, env(safe-area-inset-right)); }
.mono, .t, .clock { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.word { font-family: var(--font); font-weight: 800; }
.t small, .d-wait small, .fav-then small, .step-time small, .j-dur small { font-family: var(--font); } /* "À quai", "Proche": words stay in the text face */
.cap { font: 700 13px/1.4 var(--font); color: var(--ink-2); } /* sentence case: no mono capitals (template cue) */

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: var(--paper); padding: env(safe-area-inset-top) max(40px, env(safe-area-inset-right)) 0 max(40px, env(safe-area-inset-left)); }
.bar-in { max-width: 1120px; margin: 0 auto; min-height: 64px; padding: 0; display: flex; align-items: center; gap: 40px; border-bottom: 2px solid var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.mark { display: grid; place-items: center; width: 30px; height: 30px; background: var(--ink); color: var(--paper); font: 800 12px/1 var(--font); }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.brand-region { font-size: 13px; color: var(--ink-2); }
.nav { display: flex; align-items: center; gap: 28px; height: 100%; font-size: 17px; }
.nav a { display: flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--ink-2); white-space: nowrap; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav a[aria-current="page"] span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.nav svg { display: none; }
.bar-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.clock { font-size: 15px; color: var(--ink-2); margin-right: 8px; white-space: nowrap; }
.clock b { color: var(--ink); font-weight: 700; }
.clock-day { font-family: var(--font); }
.icon-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--ink); background: var(--paper-2); }
.icon-btn svg { width: 20px; height: 20px; }
.count { position: absolute; top: 6px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; background: var(--ink-2); color: var(--paper); font: 700 12px/17px var(--mono); text-align: center; }
.count.blocking { background: var(--stop); color: light-dark(#fff, var(--paper)); }
.count.disturbed { background: var(--warn); color: light-dark(#fff, var(--paper)); }
.offline { margin: 0; padding: 8px 24px; background: var(--ink); color: var(--paper); font-size: 13px; text-align: center; }

/* ---------- shared ---------- */
.block { margin-top: 40px; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 12px; }
.block-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.block-head .cap { margin: 0; }
.part { margin-top: 48px; padding-top: 20px; border-top: 2px solid var(--ink); }
.more-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 700; }
.hint { margin: 12px 0; color: var(--ink-2); }
.fine { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); }
.page-head { padding-top: 36px; margin-bottom: 24px; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; }
.page-head h1 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.page-head .sub { margin: 0; color: var(--ink-2); }
.foot { margin-top: 64px; padding-top: 20px; padding-bottom: 32px; font-size: 13px; color: var(--ink-2); }
.foot::before { content: ''; display: block; height: 1px; margin-bottom: 20px; background: var(--rule); }
.skeleton { display: block; height: 13px; margin: 12px 0; background: var(--paper-2); }
.side-title { margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.msg { padding: 16px 0; color: var(--ink-2); font-size: 15px; list-style: none; }

/* one filter component everywhere: words separated by slashes, aria-pressed */
.seg { display: flex; flex-wrap: wrap; align-items: center; font-size: 17px; }
.seg button { flex: none; display: inline-flex; align-items: baseline; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg button + button::before { content: '/'; margin: 0 10px; color: var(--ink-3); font-weight: 400; }
.seg button:hover span, .seg button:hover .w { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.seg button[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.seg button[aria-pressed="true"] .w { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.seg small { font-size: 13px; font-weight: 400; color: var(--ink-2); }
.seg-label { margin-right: 10px; color: var(--ink-2); }
.when-seg { align-items: baseline; }
.when-seg button { align-items: baseline; }
.field-label { margin: 0; font-weight: 700; }
.dir-tabs { display: flex; gap: 36px; border-bottom: 1px solid var(--rule); max-width: 100%; overflow-x: auto; }
.dir-tabs button { flex: none; display: inline-flex; align-items: baseline; gap: 8px; min-height: 48px; padding: 10px 0; margin-bottom: -1px; border: 0; border-bottom: 4px solid transparent; background: none; color: var(--ink-2); font-size: 17px; cursor: pointer; white-space: nowrap; }
.dir-tabs button:hover { color: var(--ink); }
.dir-tabs button[aria-pressed="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--c, var(--ink)); }

/* state words */
.state { font-weight: 700; white-space: nowrap; }
.state.ok { color: var(--ok); }
.state.disturbed { color: var(--warn); }
.state.blocking { color: var(--stop); }
.state.information, .state.na { color: var(--ink-2); font-weight: 500; }

/* ---------- home ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "lookup" "favs" "side" "all"; column-gap: 56px; }
.lookup { grid-area: lookup; }
.favs-block { grid-area: favs; }
.home-side { grid-area: side; }
.all-block { grid-area: all; }
@media (min-width: 1000px) {
  .home { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); grid-template-areas: "lookup lookup" "favs side" "all side"; grid-template-rows: auto auto 1fr; align-items: start; }
  .home-side { position: sticky; top: 88px; }
}
.lookup { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; padding: 36px 0 28px; border-bottom: 1px solid var(--rule); }
.lookup-title { margin: 0; font-size: 17px; font-weight: 700; flex: none; }
.combo { position: relative; flex: 1 1 320px; }
.combo > svg { display: none; }
.combo input { width: 100%; height: 56px; padding: 4px 0 8px; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent; font-size: 30px; font-weight: 500; -webkit-appearance: none; appearance: none; }
.combo input::placeholder { color: var(--ink-3); }
.combo input:focus { outline: none; border-bottom-width: 4px; padding-bottom: 6px; }
.lookup-alt { flex-basis: 100%; margin: 0; font-size: 15px; color: var(--ink-2); }

.suggest { position: absolute; left: 0; right: 0; max-width: 560px; top: 100%; z-index: 30; list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--ink); border-top: 0; box-shadow: 0 12px 24px -16px rgba(0,0,0,.3); max-height: min(420px, 60vh); overflow: auto; font-size: 15px; }
.suggest li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.suggest li:last-child { border-bottom: 0; }
.sug-name { flex: 1; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--paper-2); }
.suggest .group { min-height: 0; padding: 12px 12px 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); border-bottom: 0; cursor: default; background: none !important; }
.suggest b { display: block; font-weight: 700; }
.suggest small { color: var(--ink-2); font-size: 13px; }
.suggest .empty { color: var(--ink-2); cursor: default; background: none !important; }
.kind { flex: none; width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink-2); }
.kind svg { width: 18px; height: 18px; }

/* "Mes lignes": a real table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font: 700 13px/1.4 var(--font); color: var(--ink-2); text-align: left; padding: 8px 0; border-bottom: 1px solid var(--ink); }
.tbl td { padding: 14px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl .r { text-align: right; }
.tbl th + th, .tbl td + td { padding-left: 16px; }
.fav-where a { display: block; text-decoration: none; }
.fav-where a > b { display: block; font-size: 17px; font-weight: 700; }
.fav-where a:hover b { text-decoration: underline; }
.fav-where .why { display: block; margin-top: 4px; font-size: 13px; }
.fav-where .why .state { margin-right: 4px; }
/* the station on its piece of line: previous stop — station — next stop */
.mini { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; }
.mini b { font-size: 17px; font-weight: 700; white-space: nowrap; }
.mini-end { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12ch; }
.mini-rail { position: relative; flex: none; width: 28px; height: 6px; background: var(--c); }
.mini-dot { flex: none; width: 14px; height: 14px; margin-left: -14px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--paper); }
.mini-dir { display: block; margin-top: 2px; font-size: 15px; color: var(--ink-2); }
.fav-next .t { font-size: 30px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.t.now { color: var(--ok); }
.t sup { font-size: 13px; color: var(--warn); margin-left: 2px; }
.fav-then { font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.fav-then .t { font-size: 17px; font-weight: 700; color: var(--ink); }
.fav-then small { font-size: 13px; }
.tbl .badge { vertical-align: middle; }
.empty-line { margin: 4px 0 0; color: var(--ink-2); max-width: 60ch; }
.recent-title { margin: 18px 0 10px; }

/* network state: every rail line, touched ones underlined in their status colour */
.net { padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.net-mode { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.net-mode { gap: 10px; }
.net-mode a { position: relative; display: inline-flex; text-decoration: none; }
/* status tag on a touched line: shape + colour, never colour alone */
.tag-st { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font: 800 13px/1 var(--font); color: light-dark(#fff, var(--paper)); background: var(--warn); }
.tag-st.blocking { background: var(--stop); border-radius: 3px; }
.net-mode .tag-st { position: absolute; right: -11px; top: -11px; width: 16px; height: 16px; font-size: 12px; box-shadow: 0 0 0 2px var(--paper); }
.net-mode { gap: 14px; }
.now-list { list-style: none; margin: 0; padding: 0; }
.now-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 12px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.now-row .state { margin-right: 4px; }
.now-row .badge { grid-row: span 2; }
.now-row p { margin: 0; font-size: 15px; }
a.now-row:hover p { text-decoration: underline; }
.now-rest { margin: 14px 0 0; font-size: 15px; color: var(--ink-2); }

.mode-group { padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.mode-group h3 { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.mode-group h3 span { margin-left: 8px; }
.all-block .block-head { margin-bottom: 4px; }
.grid { display: flex; flex-wrap: wrap; gap: 8px; }
.more { min-height: 44px; margin-top: 10px; padding: 0; border: 0; background: none; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- line badges (official shapes) ---------- */
.badge {
  --c: #8a8d93; --t: #fff;
  min-width: 36px; height: 36px; padding: 0 8px; border: 0; cursor: pointer;
  display: inline-grid; place-items: center; background: var(--c); color: var(--t);
  font: 800 15px/1 var(--font); white-space: nowrap; text-decoration: none;
}
.b-metro { width: 36px; padding: 0; border-radius: 50%; }
.b-rer, .b-train { border-radius: 8px; font-size: 17px; }
.b-tram { background: transparent; color: var(--ink); border-top: 4px solid var(--c); border-bottom: 4px solid var(--c); }
.b-bus { border-radius: 4px; min-width: 46px; font-size: 13px; }
.b-cable { border-radius: 12px; }
button.badge:hover, a.badge:hover { outline: 2px solid var(--ink); outline-offset: 2px; }
button.badge { min-width: 44px; height: 44px; }
button.badge.b-metro { width: 44px; }
button.badge.b-bus { min-width: 56px; height: 40px; }
.badge.sm { min-width: 28px; height: 28px; font-size: 13px; cursor: default; }
.badge.sm.b-metro { width: 28px; }
.badge.sm.b-rer, .badge.sm.b-train { border-radius: 6px; }
.badge.sm.b-bus { min-width: 36px; }
.badge.lg { min-width: 64px; height: 64px; font-size: 30px; cursor: default; }
.badge.lg.b-metro { width: 64px; }
.badge.lg.b-rer, .badge.lg.b-train { border-radius: 13px; }
.badge.lg.b-bus { min-width: 76px; font-size: 22px; border-radius: 6px; }
.badge.lg.b-tram { border-width: 6px; }
.badge.xs { min-width: 22px; height: 22px; padding: 0 4px; font-size: 12px; cursor: default; }
.badge.xs.b-metro { width: 22px; padding: 0; }
.badge.xs.b-rer, .badge.xs.b-train { border-radius: 5px; }
.badge.xs.b-tram { border-width: 3px; }

/* ---------- line page ---------- */
.crumbs { display: flex; gap: 8px; padding-top: 20px; font-size: 13px; color: var(--ink-2); }
.crumbs a { display: inline-block; padding: 4px 0; }
/* the line opens on a band in its own colour, text in its official text colour (contrast by design) */
.line-head { --c: #8a8d93; --t: #fff; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin: 12px 0 24px; padding: 24px 28px; background: var(--c); color: var(--t); }
.line-id { display: flex; align-items: center; gap: 20px; }
.line-id .badge.lg { box-shadow: 0 0 0 2px var(--t); } /* the official picto, ringed to stand off the band */
.line-id .badge.lg.b-tram { color: var(--t); border-color: var(--t); box-shadow: none; }
.line-id h1 { margin: 0; font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.line-id p { margin: 6px 0 0; font-size: 15px; }
.line-id .line-live { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.line-live .tag-st { background: var(--t); color: var(--c); } /* status colours lack contrast on a line colour */
.band-link { font-weight: 700; color: inherit; }
/* small reminder of the line once its band has scrolled away */
.sticky-line { position: sticky; top: 64px; z-index: 15; display: none; align-items: center; gap: 10px; margin: 0 -40px; padding: 8px 40px; background: var(--paper); border-bottom: 1px solid var(--rule); font-size: 15px; }
.sticky-line.on { display: flex; }
@media (min-width: 1000px) { .sticky-line.on { display: none; } .main-alerts { display: none; } }
.main-alerts { margin-top: 32px; padding-top: 16px; border-top: 2px solid var(--ink); }
.link-btn { padding: 0; min-height: 44px; border: 0; background: none; font-size: 15px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.line-head :focus-visible { outline-color: var(--t); }
.fav-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font-size: 17px; font-weight: 700; cursor: pointer; }
.fav-btn:hover span { text-decoration: underline; }
.fav-btn svg { width: 20px; height: 20px; fill: none; }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 0 0 8px; }
.filter { display: flex; align-items: baseline; gap: 12px; }
.filter-label { font-weight: 700; }
.filter-count { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.filter input { height: 44px; width: 200px; padding: 0; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent; font-size: 15px; }
.filter input::placeholder { color: var(--ink-3); }
.filter input:focus { outline: none; border-bottom-width: 4px; }
.note { margin: 12px 0; font-size: 13px; color: var(--ink-2); }
.line-layout { display: grid; gap: 40px; }
@media (min-width: 1000px) {
  /* plan and departures side by side: the answer is always in the first screen */
  .line-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .line-side { position: sticky; top: 88px; max-height: calc(100vh - 100px); overflow: auto; padding-right: 2px; }
}
.side-alerts { margin-top: 32px; padding-top: 16px; border-top: 2px solid var(--ink); }
.strip-box { margin-top: 8px; }

/* horizontal plan (>= 1000px, mouse): one row per segment, stations named at -45° */
.strip-box { overflow-x: auto; scrollbar-width: thin; padding-bottom: 8px; }
.strip-box.fade { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.strip { --c: #8a8d93; position: relative; list-style: none; margin: 0; padding: 0; }
.strip li { list-style: none; }
.strip .rail { position: absolute; height: 8px; background: var(--c); box-shadow: inset 0 1px 0 light-dark(rgba(0,0,0,.18), transparent), inset 0 -1px 0 light-dark(rgba(0,0,0,.18), transparent); }
.strip .rail.v { width: 8px; height: auto; box-shadow: inset 1px 0 0 light-dark(rgba(0,0,0,.18), transparent), inset -1px 0 0 light-dark(rgba(0,0,0,.18), transparent); }
.strip .dot { position: absolute; z-index: 3; cursor: pointer; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); }
.strip .dot::after { content: ''; position: absolute; inset: -8px; } /* 28px target around the dot */
.strip .end .dot { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.strip .sel .dot { width: 22px; height: 22px; margin: -11px 0 0 -11px; background: var(--ink); }
.strip .hit-disturbed .dot { border-color: var(--warn); }
.strip .hit-blocking .dot { border-color: var(--stop); }
.strip-btn { position: absolute; z-index: 2; display: block; max-width: 220px; padding: 4px 2px; border: 0; background: none; cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transform: rotate(-45deg); transform-origin: 0 50%; font-size: 13px; line-height: 1.25; }
.strip-btn:hover { text-decoration: underline; }
.strip .end .strip-btn, .strip .sel .strip-btn { max-width: 250px; font-size: 15px; font-weight: 700; }
.strip .hit-disturbed .strip-btn { color: var(--warn); font-weight: 700; }
.strip .hit-blocking .strip-btn { color: var(--stop); font-weight: 700; }
.strip .far .strip-btn { visibility: hidden; } /* filter: only matching names stay */
.strip .sel .strip-btn { color: var(--ink); text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.strip .match .strip-btn { font-weight: 700; text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.strip .row-cap { position: absolute; z-index: 1; padding: 0 8px; background: var(--paper); font-size: 13px; line-height: 1.3; color: var(--ink-2); white-space: nowrap; }

/* vertical plan (< 720px, or unordered lines) */
.plan { --c: #8a8d93; list-style: none; margin: 0; padding: 4px 0; border-bottom: 1px solid var(--rule); }
.stop { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); }
.stop::before { content: ''; position: absolute; left: 19px; width: 6px; top: 0; bottom: 0; background: var(--c); box-shadow: inset 1px 0 0 light-dark(rgba(0,0,0,.18), transparent), inset -1px 0 0 light-dark(rgba(0,0,0,.18), transparent); }
.stop.seg-start::before { top: 24px; }
.stop.seg-end::before { bottom: calc(100% - 24px); }
.stop .dot { position: relative; z-index: 1; justify-self: center; margin-top: 17px; width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); }
.stop.end .dot { width: 18px; height: 18px; margin-top: 15px; }
.stop.sel .dot { background: var(--ink); width: 22px; height: 22px; margin-top: 13px; }
.stop-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 8px 0; border: 0; background: none; cursor: pointer; text-align: left; }
.stop-name { flex: 1; font-size: 15px; }
.conn { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 3px; }
.conn small { font: 12px var(--mono); color: var(--ink-2); margin-left: 2px; }
.plan.unordered .stop::before { display: none; }
.stop.end .stop-name { font-weight: 700; }
.stop-btn:hover .stop-name { text-decoration: underline; }
.stop.sel .stop-name { font-size: 22px; font-weight: 800; }
.stop-name .hit { display: block; margin-top: 2px; font-size: 13px; font-weight: 700; color: var(--warn); }
.stop-name .hit.blocking { color: var(--stop); }
.stop.hit-disturbed .dot { border-color: var(--warn); }
.stop.hit-blocking .dot { border-color: var(--stop); }
.stop.dim { display: none; }
.branch-label { padding: 16px 0 6px 44px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.branch-label:not(:first-child) { border-top: 1px solid var(--rule); margin-top: 6px; }
.stop .station { grid-column: 2; margin: 4px 0 20px; }

/* the chosen station: real-time departures as a table */
.station-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.station-head h2 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.station-head .conn { justify-content: flex-start; }
.station-empty { margin: 0; padding: 20px 0; color: var(--ink-2); font-size: 17px; max-width: 46ch; }
.deps td { padding: 10px 0; }
.deps .d-group th { padding: 14px 0 4px; border-bottom: 0; font: 700 17px/1.3 var(--font); color: var(--ink); }
.deps tbody + tbody .d-group th { border-top: 1px solid var(--ink); }
.deps .d-time { font: 700 17px var(--mono); }
.deps .d-time s { margin-left: 6px; font-size: 13px; font-weight: 400; color: var(--ink-2); }
.deps .d-time sup { font-size: 12px; color: var(--warn); margin-left: 1px; }
.deps.loading td { color: var(--ink-3); }
/* real-time timetable: hour, then its minutes, like a printed sheet */
.d-sheet td { padding: 8px 0 12px; }
.d-sheet .cap { margin: 0 0 4px; }
.d-sheet dl { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 4px 12px; margin: 0; }
.d-sheet dt { font: 700 15px var(--mono); }
.d-sheet dd { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font: 15px var(--mono); }
.d-sheet .gm.late { color: var(--warn); font-weight: 700; }
.d-sheet .gm sup { font-size: 11px; }
.d-sheet .gm.ko { text-decoration: line-through; color: var(--ink-2); }
.deps .d-time p { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 0 12px; font: 13px var(--font); color: var(--ink-2); }
.deps .d-wait { width: 1%; white-space: nowrap; text-align: right; font: 700 22px var(--mono); }
.deps .d-wait small { font-size: 13px; font-weight: 500; margin-left: 3px; }
.deps .d-wait.now { color: var(--ok); }
.deps tbody:first-of-type tr:nth-child(2) .d-wait { font-size: 30px; }
.deps tr.ko .d-time { color: var(--ink-2); }
.deps tr.ko .d-time > s, .deps tr.ko .d-time { text-decoration: line-through; }
.deps tr.ko .d-time p { text-decoration: none; }
.deps .ko-word { color: var(--stop); font-weight: 700; }
.deps .late { color: var(--warn); font-weight: 700; }
.voie { font-weight: 700; color: var(--ink); }
.station-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }

/* ---------- disruptions (line page, traffic page, alerts panel) ---------- */
.alerts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.alert { position: relative; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.alert-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 15px; color: var(--ink-2); }
.alert-title { margin: 6px 0 4px; font-size: 17px; font-weight: 700; line-height: 1.35; }
.alert-when { margin: 0; font-size: 13px; color: var(--ink-2); }
.alert details { margin-top: 6px; }
.alert summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; font-size: 15px; font-weight: 700; list-style: none; text-decoration: underline; text-underline-offset: 3px; }
.alert summary::-webkit-details-marker { display: none; }
.alert-body { margin: 4px 0 0; white-space: pre-line; color: var(--ink-2); font-size: 15px; max-width: 68ch; }
.alert-stops { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.alert-lines { display: flex; flex-wrap: wrap; gap: 4px; }
.alert-lines .badge.sm { min-width: 32px; height: 32px; }
.alert-lines .badge.sm.b-metro { width: 32px; }
.line-ok { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 15px; color: var(--ink-2); }
.line-ok .state { margin-right: 8px; }
.side-block + .side-block { margin-top: 32px; }

/* ---------- alerts panel ---------- */
.notif { position: fixed; z-index: 40; top: 66px; right: max(16px, calc((100vw - 1120px) / 2)); width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 80px); display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--ink); border-top: 0; box-shadow: var(--float); }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 6px 4px 18px; }
.notif-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.notif-list { list-style: none; margin: 0; padding: 0 18px; overflow: auto; }
.notif-list .alert { padding-top: 12px; padding-bottom: 12px; }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.notif-list .msg { padding: 8px 0 16px; }
.notif-settings { padding: 14px 18px 16px; border-top: 2px solid var(--ink); display: grid; gap: 6px; }
.notif-settings .seg { flex-direction: column; align-items: flex-start; font-size: 15px; }
.notif-settings .seg button { min-height: 36px; }
.notif-settings .seg button + button::before { content: none; }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; }
.switch { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--ink); }

/* ---------- journey planner ---------- */
.trip-layout, .traffic-layout { display: grid; gap: 48px; }
@media (min-width: 1000px) {
  .trip-layout { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }
  .traffic-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .trip-side, .traffic-side { position: sticky; top: 88px; }
}
.trip-form { border-top: 2px solid var(--ink); }
.places { position: relative; }
.place { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; padding-right: 56px; border-bottom: 1px solid var(--rule); }
.place label { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.pin { width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid var(--ink); }
.pin.to { background: var(--ink); }
.place input { height: 60px; border: 0; background: none; font-size: 22px; font-weight: 500; outline: none; -webkit-appearance: none; appearance: none; }
.place input::placeholder { color: var(--ink-3); }
.place:focus-within { box-shadow: inset 0 -2px 0 var(--ink); }
.place .suggest { left: 96px; }
.swap { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--ink-2); cursor: pointer; z-index: 2; }
.swap:hover { color: var(--ink); background: var(--paper-2); }
.swap svg { width: 20px; height: 20px; }
.when { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 0 0; }
.when input { height: 44px; padding: 0; border: 0; border-bottom: 1px solid var(--ink-2); background: transparent; font: 15px var(--mono); }
.primary { margin-left: auto; height: 48px; padding: 0 28px; border: 0; background: var(--ink); color: var(--paper); font-size: 17px; font-weight: 700; cursor: pointer; }
.primary:hover { text-decoration: underline; }
.form-error { margin: 12px 0 0; color: var(--stop); font-weight: 700; font-size: 15px; }

.journeys { list-style: none; margin: 32px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.journey { border-bottom: 1px solid var(--rule); }
.journey > button { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; width: 100%; padding: 18px 12px; border: 0; background: none; cursor: pointer; text-align: left; }
.journey > button[aria-pressed="true"] { background: var(--paper-2); }
.journey > button:hover .j-times { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.j-times { font: 700 22px/1 var(--mono); }
.j-times span { color: var(--ink-3); font-weight: 400; margin: 0 8px; }
.j-dur { font: 700 22px/1 var(--mono); text-align: right; }
.j-dur small { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }
.j-chain { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.j-chain .sep { color: var(--ink-3); font-size: 12px; }
.j-walk { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--ink-2); }
.j-walk svg { width: 15px; height: 15px; }
.j-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; color: var(--ink-2); }
.tag { font-weight: 700; color: var(--ink); }
.j-warn { color: var(--ink-2); font-weight: 700; }
.j-warn.disturbed { color: var(--warn); }
.j-warn.blocking { color: var(--stop); }
.journey.blocked .j-times, .journey.blocked .j-dur { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.journey.blocked .j-dur small { text-decoration: inherit; }
.j-blocked { margin: 14px 0 -8px 12px; font-size: 15px; font-weight: 700; color: var(--stop); }
.detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 12px; border-top: 2px solid var(--ink); }
.detail-head b { font: 700 22px/1.1 var(--mono); }
.detail-head span { font-size: 15px; color: var(--ink-2); }
.steps { list-style: none; margin: 0 0 18px; padding: 12px 0 0; }
.step { position: relative; display: grid; grid-template-columns: 56px 28px minmax(0, 1fr); gap: 0 10px; padding: 10px 0; }
.step-time { font: 700 15px/1.4 var(--mono); text-align: right; }
.step-time small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-2); }
.step-rail { position: relative; }
.step-rail::before { content: ''; position: absolute; left: 50%; top: 6px; bottom: -14px; width: 6px; margin-left: -3px; background: var(--c, var(--rule)); }
.step.on-foot .step-rail::before, .step.wait .step-rail::before { width: 0; margin-left: -1px; background: none; border-left: 2px dotted var(--ink-3); }
.step:last-child .step-rail::before { display: none; }
.step-rail i { position: absolute; left: 50%; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--paper); border: 3px solid var(--ink); }
.step-body b { font-weight: 700; }
.step-body p { margin: 2px 0 0; font-size: 15px; color: var(--ink-2); }
.step-body .badge { vertical-align: middle; margin-right: 8px; }
.step.end b { font-size: 17px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 720px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .bar { padding-left: 16px; padding-right: 8px; }
  .bar-in { gap: 16px; min-height: 56px; }
  .line-head { padding: 18px 16px; margin-left: -16px; margin-right: -16px; }
  .sticky-line { top: 56px; margin: 0 -16px; padding: 8px 16px; }
  .line-id h1 { font-size: 30px; }
  .mini-end { display: none; }
  .brand-region, .clock { display: none; }
  .page-head h1, .line-id h1 { font-size: 30px; }
  .lookup { padding: 24px 0 20px; }
  .combo input { font-size: 22px; height: 48px; }
  .combo kbd { display: none; }
  .seg.scroll { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; padding-right: 32px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .field-row { flex-direction: column; align-items: stretch; }
  .filter, .filter input { width: 100%; }
  .fav-then { display: none; }
  .tbl .hide-s { display: none; }
  .place { grid-template-columns: 1fr; padding-top: 10px; }
  .place input { height: 48px; font-size: 17px; }
  .place .suggest { left: 0; }
  .primary { width: 100%; }
  .notif { top: 64px; }
  .station-head h2 { font-size: 22px; }
  .deps .d-wait, .deps tbody:first-of-type tr:nth-child(2) .d-wait { font-size: 22px; }
}
/* mobile: sections in a bottom tab bar, thumb reach */
@media (max-width: 600px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; height: calc(60px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--paper); border-top: 2px solid var(--ink); font-size: 15px; }
  .nav a { flex: 1; justify-content: center; height: 60px; }
}

/* traffic page: modes on one row, period on its own row */
.traffic .toolbar { flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 16px; }

/* phone: the network state as one row of pictos, the written list right after */
@media (max-width: 600px) {
  .net { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 12px; }
  .net .cap { display: none; }
  .net-mode { display: contents; }
}

/* ---------- plan B: the next journey if the first vehicle is missed ---------- */
.here-line { padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.here-line p { margin: 0; }
.here-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 0; border: 0; background: none; text-align: left; cursor: pointer; }
.here-btn svg, .here-now svg { flex: none; width: 22px; height: 22px; color: var(--ink); }
.here-btn b { display: block; font-size: 17px; }
.here-btn small { display: block; font-size: 13px; color: var(--ink-2); }
.here-btn:hover b { text-decoration: underline; }
.here-now { display: flex; align-items: flex-start; gap: 12px; }
.here-now small { display: block; font-size: 13px; color: var(--ink-2); }
.here-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; margin-top: 4px !important; padding-left: 34px; color: var(--ink-2); }
.j-detail { padding: 0 12px 8px; }
.plan-note { margin: 10px 0 0; padding: 10px 12px; background: var(--paper-2); font-size: 15px; }
.planb { margin: 12px 0 4px; padding: 14px 16px 16px; background: var(--paper-2); }
.planb-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 17px; font-weight: 800; }
.planb-title .t { font-size: 17px; font-weight: 700; }
.planb-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0 0 8px; }
.planb-late { font-size: 15px; font-weight: 700; color: var(--warn); }
.planb .j-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.plan-btn { width: 100%; min-height: 48px; margin-top: 12px; padding: 0 16px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font-size: 15px; font-weight: 800; cursor: pointer; text-align: left; }
.plan-btn:hover { background: var(--ink); color: var(--paper); }
