/* bevauge — collection dashboard (SPEC.md §16.3). Mobile first; light and dark follow the system. */
@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/figtree-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(fonts/figtree-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Layout: one column on the phone; map full width, then a two-column grid of cards from 820 px. */
:root {
  --bg: #F3F4F1; --card: #FFFFFF; --text: #1B1F1D; --muted: #626A66; --line: #E1E4DF; --accent: #1D6B57; --on-accent: #FFFFFF;
  --map-bg: #EBEBE8; --map-grid: #FFFFFF; --map-halo: #FFFFFF; --map-label: #3A403D; --map-label-minor: #5E6662; --map-stop-label: #80877F; --me: #1A73E8; --map-stop: rgb(95 104 99 / 0.55);
  --chart-grid: #E7E9E5; --chart-axis: #B9BEB9;
  /* delay classes — distinguishable for common colour-vision deficiencies */
  --c-early: #2F6FC2; --c-ontime: #1F9E6E; --c-late: #E0A01A; --c-verylate: #C9364B; --c-unknown: #A3A8AE;
  --t-early: #22589E; --t-ontime: #157A54; --t-late: #9A6A00; --t-verylate: #A82638;
  /* modes (fallback when the timetable has no line colour) */
  --mode-sbahn: #138A4A; --mode-subway: #1660A0; --mode-tram: #C4161C; --mode-bus: #8E2A80; --mode-ferry: #0F7FB5;
  --mode-regional: #4A4F55; --map-edge: rgba(0, 0, 0, 0.6);
  /* the rides of a chosen connection (§44.1) */
  --ride-1: #0072B2; --ride-2: #C25E00; --ride-3: #C2338A; --ride-4: #00875F; --ride-5: #7B4FD0; --ride-text: #FFFFFF;
  --warn-bg: #FFF2D6; --warn-text: #6B4A00; --info-bg: #E6EFEB; --info-text: #1D4A3D;
  --access: #1565C0; /* the wheelchair sign (§81.2) */
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
/* dark: the system's choice unless the page is set to light, or set to dark in the menu (§89.5) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1211; --card: #171C1A; --text: #E7ECE9; --muted: #9AA49F; --line: #2A322E; --accent: #5FC3A5; --on-accent: #0E1211;
    --map-bg: #1C2220; --map-grid: #283030; --map-halo: #111614; --map-label: #C9D1CD; --map-label-minor: #A4ADA8; --map-stop-label: #8A938E; --me: #5B9BF8; --map-stop: rgb(150 162 156 / 0.45);
    --chart-grid: #29312D; --chart-axis: #4A544F;
    --c-early: #5A94DE; --c-ontime: #2DAA78; --c-late: #BA8618; --c-verylate: #C93F5A; --c-unknown: #6C737A;
    --t-early: #8DBBF4; --t-ontime: #5BD3A1; --t-late: #F4C35A; --t-verylate: #F4889A;
    --mode-sbahn: #3DB771; --mode-subway: #4C94D6; --mode-tram: #EA5257; --mode-bus: #C066B2; --mode-ferry: #46ADDF;
    --mode-regional: #B9C0C6; --map-edge: rgba(255, 255, 255, 0.7);
    --ride-1: #56B4E9; --ride-2: #F0A030; --ride-3: #E879B8; --ride-4: #3DCB9C; --ride-5: #A98BF0; --ride-text: #111614;
    --warn-bg: #3A2D0C; --warn-text: #F6D88E; --info-bg: #1C2B26; --info-text: #BFE3D6;
    --access: #3F83D0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1211; --card: #171C1A; --text: #E7ECE9; --muted: #9AA49F; --line: #2A322E; --accent: #5FC3A5; --on-accent: #0E1211;
  --map-bg: #1C2220; --map-grid: #283030; --map-halo: #111614; --map-label: #C9D1CD; --map-label-minor: #A4ADA8; --map-stop-label: #8A938E; --me: #5B9BF8; --map-stop: rgb(150 162 156 / 0.45);
  --chart-grid: #29312D; --chart-axis: #4A544F;
  --c-early: #5A94DE; --c-ontime: #2DAA78; --c-late: #BA8618; --c-verylate: #C93F5A; --c-unknown: #6C737A;
  --t-early: #8DBBF4; --t-ontime: #5BD3A1; --t-late: #F4C35A; --t-verylate: #F4889A;
  --mode-sbahn: #3DB771; --mode-subway: #4C94D6; --mode-tram: #EA5257; --mode-bus: #C066B2; --mode-ferry: #46ADDF;
  --mode-regional: #B9C0C6; --map-edge: rgba(255, 255, 255, 0.7);
  --ride-1: #56B4E9; --ride-2: #F0A030; --ride-3: #E879B8; --ride-4: #3DCB9C; --ride-5: #A98BF0; --ride-text: #111614;
  --warn-bg: #3A2D0C; --warn-text: #F6D88E; --info-bg: #1C2B26; --info-text: #BFE3D6;
  --access: #3F83D0;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font);
  padding-inline: max(16px, env(safe-area-inset-left)); padding-block: 0 max(24px, env(safe-area-inset-bottom));
}
.top, main, footer { max-width: 1120px; margin-inline: auto; }
h1, h2 { margin: 0; text-wrap: balance; }
p { margin: 0; }

/* header */
.top { display: grid; gap: 6px; padding-block: max(20px, env(safe-area-inset-top)) 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: url(icons/icon-192.png) center / cover no-repeat, var(--text); } /* the app icon (§57.4) */
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; }
.tagline { color: var(--muted); max-width: 62ch; }
.status { display: none; } /* "Sammelt seit …" removed (§50.4); the element stays for its data-updated */
.banner { padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.banner.warn { background: var(--warn-bg); color: var(--warn-text); }
.banner.info { background: var(--info-bg); color: var(--info-text); }

/* cards */
main { display: grid; gap: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wide { grid-column: 1 / -1; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 12px; min-width: 0; align-content: start; }
.card h2 { font-size: 17px; font-weight: 700; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.note, .sub { font-size: 13px; color: var(--muted); }

/* map */
.map-wrap { position: relative; border-radius: 10px; overflow: hidden; }
#map { display: block; width: 100%; height: clamp(340px, 62vh, 640px); background: var(--map-bg); touch-action: none; cursor: grab; }
#map:active { cursor: grabbing; }
.reset { position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; box-shadow: 0 1px 6px rgb(0 0 0 / 0.1); }
.view-icon path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.view-icon text { fill: currentColor; font: 700 8px var(--font); }
/* the views behind the pill (§74.1) */
.reset { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.views-menu { position: absolute; right: 10px; bottom: 54px; z-index: 5; min-width: 200px; max-width: calc(100% - 20px); padding: 8px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); box-shadow: 0 2px 10px rgb(0 0 0 / 0.15); font: 500 14px var(--font); }
.views-menu[hidden] { display: none; }
.views-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.views-title { font-weight: 700; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.views-gear, .views-done, .view-star, .view-del { font: 600 14px var(--font); min-width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
.views-done { padding: 0 8px; }
.view-row { display: flex; align-items: center; gap: 4px; }
.view-go, .view-name { flex: 1; text-align: left; font: 500 15px var(--font); padding: 8px 6px; border: 0; background: transparent; color: var(--text); border-radius: 8px; }
.view-go { cursor: pointer; }
.view-go:hover, .views-gear:hover, .view-star:hover, .view-del:hover { background: var(--line); }
#views-name { width: 100%; box-sizing: border-box; margin-top: 6px; padding: 8px; font: 500 16px var(--font); border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); }
.views-save { width: 100%; margin-top: 6px; padding: 8px; font: 600 14px var(--font); border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); cursor: pointer; }
.views-save:disabled { opacity: 0.5; cursor: default; }
.views-hint { margin: 6px 2px 0; font-size: 12px; color: var(--muted); }
/* the lines of a station on its card (§74.3) */
.station-lines { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 10px; }
.station-lines .lines-title { font-size: 11px; color: var(--muted); margin-right: 2px; }
.station-lines .badge { min-width: 0; font-size: 10px; padding: 1px 5px; opacity: 0.85; }
.station-lines .lines-more { font: 600 11px var(--font); border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px 4px; }
/* my position (§38.2): a round button above "Ganz Berlin" */
.locate { position: absolute; right: 10px; bottom: 54px; width: 44px; height: 44px; border-radius: 50%; display: grid;
  place-items: center; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; padding: 0;
  box-shadow: 0 1px 6px rgb(0 0 0 / 0.1); }
.locate[aria-pressed='true'] { color: var(--me); }
.locate svg { width: 22px; height: 22px; }
.locate-msg { position: absolute; right: 62px; bottom: 58px; max-width: 240px; margin: 0; padding: 6px 10px; font: 500 13px/1.3 var(--font);
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 10px rgb(0 0 0 / 0.12); }
/* sharing (§84): the button on the cards, the small one on an arrival row, the message */
.share-msg { right: auto; left: 16px; bottom: auto; top: 64px; max-width: min(320px, calc(100% - 32px)); z-index: 4;
  pointer-events: none; } /* text only: a tap reaches the shared vehicle under it (§101.1) */
.share-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-height: 34px; padding: 0 12px; font-size: 13px; }
.card-actions .share-btn { margin-left: 0; min-height: 40px; }
.share-icon { flex: none; }
.share-icon .share-line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pop-list li .share-row { flex: none; width: 44px; height: 34px; display: grid; place-items: center; padding: 0; color: var(--muted);
  background: none; border: 0; border-radius: 10px; cursor: pointer; }
.pop-list li .share-row:hover { background: var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px 0 8px; font: 600 14px var(--font);
  color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed='false'] { color: var(--muted); background: transparent; }
.chip[aria-pressed='false'] .chip-label { text-decoration: line-through; }
.chip[aria-pressed='false'] .icon { --ic: var(--muted); }
.chip[aria-pressed='false'] .icon { opacity: 0.55; }
/* transit signs (§36.7) */
.icon { flex: none; width: 20px; height: 20px; display: block; }
.icon { --ic: var(--mode-sbahn); }
.icon-subway { --ic: var(--mode-subway); } .icon-tram { --ic: var(--mode-tram); } .icon-bus { --ic: var(--mode-bus); }
.icon-ferry { --ic: var(--mode-ferry); } .icon-regional { --ic: var(--mode-regional); }
.icon .bg { fill: var(--ic); }
.icon .fg { fill: #fff; }
.icon .fg.cut { fill: var(--ic); }
.icon .fg.line { fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; }
.icon .letter { font: 800 14px var(--font); }
.icon .ring { fill: var(--card); stroke: var(--ic); stroke-width: 2.6; } /* S-Bahn: a ring, not the filled DB logo (§46.3) */
.icon-sbahn .fg { fill: var(--ic); }
button:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 5px; }
.legend .count { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
/* the legend in three parts (§36.6) */
.legend-part { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.legend-part:first-of-type { border-top: 0; padding-top: 0; }
.legend-total { font-size: 14px; color: var(--muted); }
.legend-total strong { font-size: 22px; font-weight: 800; color: var(--text); margin-right: 4px; font-variant-numeric: tabular-nums; }
.legend-modes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.legend-modes li { display: flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend-modes li.off { opacity: 0.4; }
.legend-hint { font-size: 12px; color: var(--muted); }
.legend-hollow-line { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; }
.hollow-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--muted); box-sizing: border-box; }
#accuracy-card p { margin: 8px 0 0; font-size: 14px; line-height: 1.5; }
#accuracy-card h2 { margin: 0; }
#accuracy-card h3 { margin: 18px 0 0; font-size: 14px; }
.acc-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 0; border: 0;
  background: none; color: var(--text); font: inherit; font-weight: 700; text-align: left; cursor: pointer; } /* title row that opens the text (§43.1) */
.acc-toggle .chev { flex: none; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform 0.15s; }
.acc-toggle[aria-expanded="true"] .chev { transform: rotate(-135deg); }
#accuracy-body[hidden] { display: none; }
.pop-age { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
/* the Delays block (§36.2) */
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs button { flex: none; font: 600 14px var(--font); color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 10px; min-height: 40px; cursor: pointer; }
.tabs button[aria-selected='true'] { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: grid; gap: 12px; min-width: 0; }
.delays-now { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.delays-now .row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'badge to delay' 'badge next delay';
  align-items: center; gap: 0 10px; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0;
  border-bottom: 1px solid var(--line); padding: 6px 2px; cursor: pointer; }
.delays-now .row:hover { background: var(--line); }
.delays-now .badge { grid-area: badge; }
.delays-now .to { grid-area: to; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delays-now .next { grid-area: next; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delays-now .num { grid-area: delay; font-weight: 800; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot.c-early { background: var(--c-early); } .dot.c-ontime { background: var(--c-ontime); }
.dot.c-late { background: var(--c-late); } .dot.c-verylate { background: var(--c-verylate); } .dot.c-unknown { background: var(--c-unknown); }

.close { border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.badge { display: inline-block; min-width: 38px; text-align: center; padding: 2px 7px; border-radius: 6px; color: #fff; font-weight: 700; font-size: 14px; }
.badge.mode-sbahn { background: var(--mode-sbahn); border-radius: 999px; } .badge.mode-subway { background: var(--mode-subway); border-radius: 3px; }
.badge.mode-tram { background: var(--mode-tram); } .badge.mode-bus { background: var(--mode-bus); } .badge.mode-ferry { background: var(--mode-ferry); }
.badge.mode-regional { background: var(--mode-regional); color: var(--card); }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody th { font-weight: 600; white-space: nowrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.swatch.mode-sbahn { background: var(--mode-sbahn); } .swatch.mode-subway { background: var(--mode-subway); }
.swatch.mode-tram { background: var(--mode-tram); } .swatch.mode-bus { background: var(--mode-bus); } .swatch.mode-ferry { background: var(--mode-ferry); }
.swatch.mode-regional { background: var(--mode-regional); }
.meter { display: inline-block; width: 52px; height: 6px; border-radius: 3px; background: var(--line); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.meter .fill { display: block; height: 100%; background: var(--accent); }
.num { font-weight: 600; white-space: nowrap; }
@media (max-width: 480px) {
  .table { font-size: 14px; }
  .table th, .table td { padding: 8px 4px; }
  .table thead th { font-size: 11px; letter-spacing: 0.02em; hyphens: auto; }
  .meter { display: none; }
}
.c-text-early { color: var(--t-early); } .c-text-ontime { color: var(--t-ontime); }
.c-text-late { color: var(--t-late); } .c-text-verylate { color: var(--t-verylate); } .c-text-unknown { color: var(--muted); }

/* charts */
.chart-box { min-width: 0; }
.chart { width: 100%; height: auto; display: block; font-family: var(--font); }
/* seaborn "whitegrid" / ggplot2 theme_minimal (§52.6): no panel, hairline grid, a baseline, thin marks */
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--chart-axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .zero { stroke: var(--muted); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart .axis { fill: var(--muted); font-size: 11px; font-weight: 500; }
.chart .value { fill: var(--text); font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .c-early { fill: var(--c-early); } .chart .c-ontime { fill: var(--c-ontime); }
.chart .c-late { fill: var(--c-late); } .chart .c-verylate { fill: var(--c-verylate); } .chart .c-unknown { fill: var(--c-unknown); }
/* light bars: an opaque blend (no darker seam where the square foot meets the rounded bar) */
.chart .plain { fill: color-mix(in srgb, var(--accent) 35%, var(--card)); } .chart .peak { fill: var(--accent); }
.chart .bar.hover { opacity: 0.8; } .chart .plain.hover { fill: color-mix(in srgb, var(--accent) 55%, var(--card)); opacity: 1; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.chart .area-top { stop-color: var(--accent); stop-opacity: 0.22; }
.chart .area-bottom { stop-color: var(--accent); stop-opacity: 0; }
.chart .end { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart .lone { fill: var(--accent); }
.chart .end-label { fill: var(--text); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; touch-action: pan-y; } /* a finger drags the readout sideways; up/down still scrolls (§57.7) */
.chart:focus { outline: none; } .chart:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.chart-box.has-tip { position: relative; }
.chart-tip { position: absolute; transform: translate(-50%, calc(-100% - 10px)); pointer-events: none; z-index: 2;
  display: grid; gap: 1px; padding: 5px 8px; border-radius: 8px; background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.12); font-size: 11px; white-space: nowrap; color: var(--muted); }
.chart-tip[hidden] { display: none; }
.chart-tip strong { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-tip.flip { transform: translate(-100%, calc(-100% - 10px)); }
.pair { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
figure { margin: 0; display: grid; gap: 4px; min-width: 0; }
figcaption { font-size: 14px; font-weight: 600; color: var(--muted); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

footer { padding-block: 24px 8px; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* vehicle symbols (§27.2): swatches in chips, legend and card */
.form { display: inline-grid; place-items: center; flex: none; background: currentColor; margin-right: 6px; vertical-align: middle;
  font: 800 9px/1 var(--font); }
.chip .form { color: inherit; }
span.form-circle { width: 13px; height: 13px; border-radius: 50%; }
span.form-square { width: 12px; height: 12px; border-radius: 3px; }
span.form-regional { width: 16px; height: 11px; border-radius: 3px; }
span.form-tram { width: 9px; height: 13px; border-radius: 2px; }
span.form-bus { width: 15px; height: 10px; border-radius: 2px; }
span.form-hexagon { width: 11px; height: 11px; clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%); }
.form { color: var(--card); }
.chip .form { background: var(--card); color: var(--text); }
.chip[aria-pressed='true'] .form { background: #fff; color: #1a1a1a; }
.forms-legend .form { background: var(--muted); color: var(--card); }
.forms-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; }
.forms-legend li { display: flex; align-items: center; }
.legend-block { display: grid; gap: 6px; }
.legend-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ring { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; border: 2.5px solid transparent; background: var(--muted); }
.ring.c-ontime { border-color: transparent; }
.ring.c-early { border-color: var(--c-early); background: var(--card); border-width: 2px; }
.ring.c-late { border-color: var(--c-late); background: var(--card); }
.ring.c-verylate { border-color: var(--c-verylate); background: var(--card); border-width: 3px; }
.ring.c-unknown { background: transparent; border: 1.5px solid var(--muted); }
.map-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.segmented { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.seg-label { color: var(--muted); }
.seg-buttons { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg-buttons button { font: inherit; font-size: 14px; border: 0; background: transparent; color: var(--text); padding: 5px 12px; border-radius: 999px; cursor: pointer; min-height: 32px; }
.seg-buttons button[aria-pressed='true'] { background: var(--text); color: var(--card); font-weight: 600; }

/* press-and-hold card on the map (§24.1, §24.2) */
#map { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.popover { position: absolute; z-index: 2; width: min(300px, calc(100% - 16px)); max-height: calc(100% - 16px); overflow: auto;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); display: grid; gap: 6px; font-size: 14px; }
.popover .close { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; font-size: 22px; }
.popover .grabber { justify-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: -2px 0 2px; }
.popover.is-docked .pop-head, .popover .grabber { touch-action: none; }
.popover .note { font-size: 12px; }
.pop-list li .row { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; padding: 4px 0; text-align: left;
  font: inherit; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.pop-list li .row:hover { background: var(--line); }
/* the station card (§62.1): line 1 = badge and destination over the whole width, line 2 = countdown, time, timetable time */
.pop-list li .row { display: grid; grid-template-columns: 4.6em 2.8em 2.8em minmax(0, 1fr); column-gap: 8px; row-gap: 0; }
.pop-list li .row .badge { grid-row: 1; grid-column: 1; justify-self: start; }
.pop-list li .row .name { grid-row: 1; grid-column: 2 / -1; font-weight: 600; }
.pop-list li .row .in { grid-row: 2; grid-column: 1; font-size: 13px; }
.pop-list li .row .time { grid-row: 2; grid-column: 2; font-size: 13px; }
.pop-list li .row .planned { grid-row: 2; grid-column: 3; font-size: 12px; }
.pop-head { display: flex; align-items: center; gap: 8px; padding-right: 40px; min-height: 30px; }
.pop-head .to, .pop-head .station { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.pop-sub { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pop-delay { font-size: 13px; font-weight: 600; }
.pop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; grid-template-columns: minmax(0, 1fr); }
.popover { grid-template-columns: minmax(0, 1fr); }
.pop-list li { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.pop-list .time { font-weight: 600; min-width: 2.8em; }
.pop-list .in { font-weight: 700; min-width: 4.6em; }
.pop-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-list .planned { min-width: 2.8em; font-size: 12px; color: var(--muted); }
.pop-list del.planned.is-late { color: var(--t-late); }
.pop-list del.planned.is-early { color: var(--t-early); }
.pop-list .badge { min-width: 30px; font-size: 12px; padding: 1px 5px; }
/* the card: a small panel in the bottom-left corner of the map; on phones docked across the bottom (§34.4) */
.popover.is-docked { left: 8px; right: auto; top: auto; bottom: 8px; width: min(320px, calc(100% - 16px)); max-height: 40%; gap: 4px; padding: 8px 12px; overscroll-behavior: contain; }
@media (max-width: 699px) {
  .popover.is-docked { right: 8px; width: auto; max-height: 30%; gap: 2px; padding: 4px 12px 6px; line-height: 1.3; }
  .popover.is-docked .grabber { margin: 0; }
  .popover.is-docked .pop-head { min-height: 26px; }
  .popover.is-docked .close { top: 0; }
  .popover.is-docked .more { min-height: 24px; padding: 2px 0; }
}
.popover .more { justify-self: start; font: 600 14px/1.2 var(--font); color: var(--accent); background: none;
  border: 0; padding: 6px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }

/* live indicator (§28) */
.map-top { position: absolute; top: 62px; left: 10px; right: 10px; z-index: 3; display: flex; flex-wrap: wrap; justify-content: flex-end;
  align-items: flex-start; gap: 6px; pointer-events: none; }
.map-top > * { pointer-events: auto; }
.live-box { display: grid; gap: 6px; justify-items: end; flex: 0 1 auto; min-width: 0; margin-left: auto; }
/* the followed trip (§32.2) */
.follow { flex: 1 1 100%; min-width: 0; max-width: 420px; margin-right: auto; display: flex; align-items: center; background: var(--card);
  border: 2px solid var(--accent); border-radius: 14px; box-shadow: 0 2px 10px rgb(0 0 0 / 0.12); }
.follow .follow-text { flex: 1; min-width: 0; text-align: left; font: 600 13px/1.3 var(--font); color: var(--text);
  background: none; border: 0; padding: 6px 4px 6px 11px; cursor: pointer; min-height: 44px; }
.follow .close { flex: none; width: 44px; height: 44px; }
/* small (§37.5): about 22 px high; an invisible margin keeps the tap area 44 px high */
.live-pill { position: relative; display: inline-flex; align-items: center; gap: 5px; font: 600 10px/1.2 var(--font); color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 2px 7px; cursor: pointer;
  box-shadow: 0 1px 6px rgb(0 0 0 / 0.1); text-align: left; min-height: 20px; white-space: nowrap; } /* one short line (§50.3) */
.live-pill::before { content: ''; position: absolute; inset: -11px -4px; }
.live-text { display: block; }
.live-words { font-weight: 600; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--c-unknown); }
.live-pill[data-state='live'] .live-dot { background: var(--c-ontime); box-shadow: 0 0 0 2px rgb(31 158 110 / 0.2); animation: livepulse 2s ease-in-out infinite; }
.live-pill[data-state='delayed'] .live-dot { background: var(--c-late); }
.live-pill[data-state='stale'] .live-dot, .live-pill[data-state='none'] .live-dot { background: var(--c-verylate); }
@keyframes livepulse { 50% { box-shadow: 0 0 0 4px rgb(31 158 110 / 0); } }
.live-details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px;
  display: grid; gap: 4px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.16); max-width: 300px; }
.live-details ul { margin: 0; padding-left: 16px; }

/* --- reload button, legend button, dock (§33.2, §33.6) --- */
.brand h1 { flex: 0 1 auto; }
.reload { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: 600 14px var(--font); color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; min-height: 36px; cursor: pointer; }
.reload span[aria-hidden] { font-size: 17px; line-height: 1; }
.reload:disabled { opacity: 0.5; }
.reload + .menu-btn { margin-left: 0; }
.key-toggle, .dock, .map-key > .grabber, .key-close { display: none; }

/* --- connection search: a bar on the map, results in a sheet (§35.6) --- */
.plan { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.plan-sheet, .plan-bar, .plan-end, .plan-fields, .line-pill { pointer-events: auto; } /* the rest of the map stays tappable */
.plan-box { position: absolute; top: 10px; left: 10px; right: 10px; max-width: 360px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; pointer-events: none; }
.plan-bar-row { pointer-events: none; display: flex; align-items: center; gap: 6px; }
.plan-bar { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px;
  font: 600 15px var(--font); color: var(--muted); text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: 0 2px 10px rgb(0 0 0 / 0.12); cursor: pointer; }
.plan-bar.has-plan { color: var(--text); border-color: var(--accent); }
.plan-bar[aria-expanded="true"] { color: var(--accent); }
.plan-bar-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-end { flex: none; width: 44px; height: 44px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 20px; cursor: pointer; }
.magnifier { flex: none; width: 11px; height: 11px; border: 2px solid currentColor; border-radius: 50%; position: relative; margin-right: 3px; }
.magnifier::after { content: ""; position: absolute; width: 2px; height: 6px; background: currentColor; right: -4px; bottom: -5px; transform: rotate(-45deg); border-radius: 1px; }
.plan-fields { display: grid; gap: 6px; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 10px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); font-size: 14px; max-height: calc(100vh - 220px); overflow: auto; }
.plan-fields[hidden], .plan-sheet[hidden] { display: none; }
.plan-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; align-items: center; }
.plan-field { grid-column: 1; display: grid; gap: 2px; min-width: 0; }
.plan-field label { font-size: 12px; font-weight: 700; color: var(--muted); }
.plan-field input { font: 16px var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; min-height: 40px; width: 100%; user-select: text; -webkit-user-select: text; }
.plan-field input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.plan .swap { grid-column: 2; grid-row: 1 / span 2; width: 44px; height: 44px; font-size: 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.plan-inputs .plan-field:last-child { grid-row: 2; }
.suggest { list-style: none; margin: 0; padding: 0; display: grid; }
.suggest button { width: 100%; text-align: left; font: 15px var(--font); color: var(--text); background: none; border: 0;
  border-bottom: 1px solid var(--line); padding: 8px 4px; min-height: 40px; cursor: pointer; }
.suggest button:hover { background: var(--line); }
.suggest button.active { background: var(--line); box-shadow: inset 3px 0 0 var(--accent); } /* marked with ↑/↓ (§42.1) */
.input-wrap { position: relative; }
.input-wrap input { padding-right: 40px; }
.field-clear { position: absolute; top: 50%; right: 0; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: none;
  color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; } /* empties the field (§42.2) */
.field-clear[hidden] { display: none; }
.plan-fields { position: relative; }
.plan-fields-close { position: static; width: 44px; height: 44px; font-size: 22px; background: none; border: 0; color: var(--muted); cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.plan-when-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.plan-when-row .go { order: 2; margin-left: auto; }
.plan-when-row .plan-at { order: 3; flex-basis: 100%; }
.plan-when button { min-height: 36px; }
.plan-at { display: flex; gap: 6px; }
.plan-at[hidden] { display: none; }
.plan-at input, .plan-at select { font: 16px var(--font); color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; min-height: 38px; user-select: text; -webkit-user-select: text; }
.plan-now { font-size: 13px; color: var(--muted); }
.plan .go { font: 700 15px var(--font); color: var(--on-accent); background: var(--accent); border: 0; border-radius: 999px; padding: 8px 18px; min-height: 40px; cursor: pointer; }
.plan-msg:empty { display: none; }
.plan-msg { font-size: 13px; color: var(--muted); }
.plan-sheet { position: absolute; left: 8px; bottom: 8px; width: min(360px, calc(100% - 16px)); max-height: 50%; overflow: auto;
  overscroll-behavior: contain; display: grid; gap: 6px; align-content: start; grid-template-columns: minmax(0, 1fr);
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px 10px;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); font-size: 14px; }
.plan-sheet h3 { font-size: 15px; font-weight: 700; padding-right: 40px; min-height: 26px; display: flex; align-items: center; }
.plan-sheet .grabber { justify-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--line); touch-action: none; }
.plan-sheet .close { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; font-size: 22px; }
.plan-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.plan-results .conn { display: grid; gap: 3px; width: 100%; text-align: left; font: inherit; color: inherit; background: none;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; font-variant-numeric: tabular-nums; }
.plan-results .conn[aria-expanded="true"] { border-color: var(--accent); }
.conn-times { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-weight: 700; font-size: 15px; }
.conn-times del.planned { font-size: 12px; font-weight: 400; }
.conn-times del.is-late { color: var(--t-late); }
.conn-times del.is-early { color: var(--t-early); }
.conn-times .tags { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border: 1px solid currentColor;
  border-radius: 999px; padding: 1px 7px; }
.tag.fastest { color: var(--accent); }
.tag.earliest { color: var(--muted); }
.conn-sub { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; }
.conn-lines { display: flex; flex-wrap: wrap; gap: 4px; }
.conn-lines .badge, .legs .badge { min-width: 30px; font-size: 12px; padding: 1px 5px; }
.legs { list-style: none; margin: 4px 0 2px; padding: 0 0 0 4px; display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.legs li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.legs .time { font-weight: 600; min-width: 2.8em; }
.legs del.planned { font-size: 12px; color: var(--muted); }
.legs .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legs .ride-no { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--ride-text); }
.legs .ride-no.r1 { background: var(--ride-1); } .legs .ride-no.r2 { background: var(--ride-2); } .legs .ride-no.r3 { background: var(--ride-3); } .legs .ride-no.r4 { background: var(--ride-4); } .legs .ride-no.r5 { background: var(--ride-5); }
.legs .walk { color: var(--muted); font-size: 13px; padding-left: 2px; }
.plan-sheet .note { font-size: 12px; }
/* --- the compact search box: top row, start panel, stop choice, places (§66, §67) --- */
.plan-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 6px; align-items: center; }
.plan-start, .plan-near, .places-box { display: grid; gap: 8px; }
.plan-start[hidden], .plan-near[hidden], .places-box[hidden], .plan-start [hidden], .plan-near [hidden], .places-box [hidden], .plan-card [hidden] { display: none; }
.start-part { display: grid; gap: 2px; }
.plan-start h4, .plan-near h4, .places-box h4 { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.plan-start h4 .link-btn, .plan-near h4 .link-btn, .places-box h4 .link-btn { text-transform: none; letter-spacing: 0; }
.plan-start h4 .link-btn, .plan-near h4 .link-btn, .places-box h4 .link-btn { min-height: 32px; padding: 0 4px; font-size: 13px; }
.quick { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); font: 600 14px var(--font); cursor: pointer; }
.quick:hover, .quick[aria-expanded='true'] { border-color: var(--accent); }
.quick-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.places-menu { position: fixed; z-index: 30; padding: 6px;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 32px rgb(0 0 0 / 0.22); }
.places-menu::before { content: ""; position: absolute; top: -7px; left: calc(var(--arrow-x, 24px) - 7px); width: 12px; height: 12px;
  background: var(--card); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); } /* points at the button (§69.1) */
.places-menu[hidden] { display: none; }
.places-scroll { position: relative; display: grid; overflow: auto; overscroll-behavior: contain; }
.place-opt { min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--text); text-align: left;
  font: 600 15px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.place-opt:hover, .place-opt:focus-visible { background: var(--line); }
.conn-walk { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.chip { min-height: 40px; max-width: 100%; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text);
  font: 600 14px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.place-sub { margin-left: 6px; font-size: 12px; color: var(--muted); }
.places-note { margin: 0; font-size: 13px; color: var(--muted); }
.places-note:empty { display: none; }
.place-form { display: grid; gap: 6px; }
.trip-list { list-style: none; margin: 0; padding: 0; display: grid; }
.trip-list li { display: flex; align-items: center; gap: 2px; min-height: 44px; border-bottom: 1px solid var(--line); }
.trip-list li:last-child { border-bottom: 0; }
.trip-go, .near-pick { flex: 1; min-width: 0; min-height: 44px; padding: 0 6px; border: 0; border-radius: 8px; background: none; color: var(--text);
  font: 15px var(--font); text-align: left; cursor: pointer; }
.trip-go { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-pick { display: flex; align-items: center; gap: 8px; }
.trip-go:hover, .near-pick:hover { background: var(--line); }
.trip-back, .trip-del, .trip-star { flex: none; width: 44px; height: 44px; border: 0; border-radius: 8px; background: none; color: var(--muted);
  font: 700 18px var(--font); cursor: pointer; }
.trip-back:hover, .trip-del:hover, .trip-star:hover { color: var(--text); background: var(--line); }
.near-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-modes { display: inline-flex; gap: 3px; }
.near-modes .icon { width: 16px; height: 16px; }
.near-dist { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.link-btn { justify-self: start; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--accent); font: 600 14px var(--font); cursor: pointer; }
.home-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.go-save { min-height: 44px; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.go-save:disabled { background: var(--card); border-color: var(--line); color: var(--muted); }
.pill-btn { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text);
  font: 600 14px var(--font); cursor: pointer; }
.pill-btn[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); }
.pill-btn:disabled { opacity: 0.5; cursor: default; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding-right: 40px; min-width: 0; }
.sheet-head h3 { flex: 1; min-width: 0; padding-right: 0; }
.sheet-head .pill-btn { min-height: 36px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.sheet-head [hidden] { display: none; }
.save-msg { margin: 0; font-size: 13px; color: var(--muted); }
.save-msg:empty { display: none; }
.card-sub { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; font-weight: 700; font-size: 15px; }
.card-sub del.planned { font-size: 12px; font-weight: 400; }
.card-sub del.is-late { color: var(--t-late); }
.card-sub del.is-early { color: var(--t-early); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-sheet .note a { color: var(--accent); }

/* --- the phone app: fills the screen, two tabs in a dock (§33.6) --- */
@media (max-width: 699px) {
  html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
  body { padding: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh;
    -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
  .top { flex: none; width: 100%; max-width: none; margin: 0; gap: 2px;
    padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 6px max(14px, env(safe-area-inset-left)); }
  .top .tagline { display: none; }
  .logo { width: 22px; height: 22px; border-radius: 6px; }
  h1 { font-size: 21px; }
  .status { font-size: 12px; line-height: 1.35; }
  .banner { font-size: 14px; padding: 8px 12px; }
  .reload { padding: 4px 10px; min-height: 34px; font-size: 13px; }
  .top { position: sticky; top: 0; z-index: 6; background: var(--bg); } /* Safari tints the status bar with it (§35.4) */
  .plan-box { max-width: none; }
  .plan-sheet { left: 8px; right: 8px; width: auto; }

  main { flex: 1; min-height: 0; width: 100%; max-width: none; margin: 0; display: flex; flex-direction: column; gap: 0; }
  main[hidden] { display: none; }
  body[data-tab="map"] .grid, body[data-tab="map"] footer #preliminary { display: none; } /* (the language switch moved into the menu, §76.2) */
  /* one slim line under the map: short attribution + legal links (§48.5) */
  body[data-tab="map"] footer { padding-block: 2px; font-size: 9px; line-height: 12px; gap: 0; }
  body[data-tab="map"] footer #attribution { display: none; }
  body[data-tab="data"] .map-card { display: none; }
  body[data-tab="data"] main { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
    padding: 4px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left)); user-select: text; -webkit-user-select: text; }
  body[data-tab="data"] main .grid { gap: 12px; }

  .map-card { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px;
    padding: 0; border: 0; border-radius: 0; background: transparent; }
  .map-card .card-head { flex: none; padding: 0 max(12px, env(safe-area-inset-left)); }
  .map-card .card-head h2 { display: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .map-wrap { flex: 1; min-height: 0; border-radius: 0; background: transparent; }
  /* the canvas always fills the whole screen; the bars lie above it with their own background, so the full-screen
     map only fades the bars — the map is never resized or drawn anew (§52.4) */
  #map { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: 0; }
  .map-card .card-head { position: relative; z-index: 2; background: var(--bg); padding-bottom: 4px; }
  .marks-strip { position: relative; z-index: 2; background: var(--bg); padding: 0 max(12px, env(safe-area-inset-left)) 6px; }
  footer, .dock { position: relative; z-index: 2; background: var(--bg); }
  body[data-tab="data"] #map { visibility: hidden; }
  /* the on-screen keyboard is open over the search box: the bars above the map make room for it (§67.1) */
  body.kb .top, body.kb .map-card .card-head, body.kb .marks-strip { display: none; }

  .key-toggle { display: inline-flex; position: absolute; left: 10px; bottom: 10px; font: 600 14px var(--font); padding: 8px 12px;
    border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
  .map-key { display: none; }
  body.key-open .map-key { display: grid; gap: 10px; position: absolute; z-index: 4; left: 8px; right: 8px; bottom: 8px; max-height: 60%;
    overflow: auto; overscroll-behavior: contain; background: var(--card); color: var(--text); border: 1px solid var(--line);
    border-radius: 12px; padding: 8px 12px 12px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.18); }
  body.key-open .map-key > .grabber { display: block; justify-self: center; width: 36px; height: 4px; border-radius: 2px; background: var(--line); touch-action: none; }
  body.key-open .key-close { display: block; position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; }

  footer { flex: none; order: 2; width: 100%; max-width: none; margin: 0; padding: 6px 14px; font-size: 11px; }
  .dock { order: 3; display: flex; flex: none; justify-content: space-around; gap: 8px; background: var(--card);
    border-top: 1px solid var(--line); padding: 1px max(12px, env(safe-area-inset-right)) max(2px, calc(env(safe-area-inset-bottom) - 22px)) max(12px, env(safe-area-inset-left)); } /* smaller and lower (§57.5) */
  .dock button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; font: 600 11px var(--font); color: var(--muted);
    background: none; border: 0; padding: 0; min-height: 30px; cursor: pointer; } /* icon and label in one row (§50.2) */
  .dock button[aria-pressed="true"] { color: var(--accent); }
  .dock-icon { display: block; width: 18px; height: 18px; }
  .dock-icon svg { display: block; width: 18px; height: 18px; }
  .dock .dock-fill { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
}
}

/* map size on computers (§63.2): a switch in the head of the map card; the phone app has none (the map is the screen) */
.map-size button { min-height: 36px; }
@media (max-width: 699px) { .map-size { display: none; } }
@media (min-width: 700px) {
  body[data-map-size='s'] #map { height: clamp(260px, 36vh, 400px); }
  body[data-map-size='l'] .top, body[data-map-size='l'] main, body[data-map-size='l'] footer { max-width: 2200px; }
  body[data-map-size='l'] .grid { width: 100%; max-width: 1120px; margin-inline: auto; } /* the cards keep their width */
  body[data-map-size='l'] #map { height: clamp(520px, calc(100vh - 230px), 1400px); height: clamp(520px, calc(100dvh - 230px), 1400px); }
}

/* legal notice and privacy page (§46.2) */
.legal-links a { color: inherit; }
body.legal { overflow: auto; }
.legal-main { max-width: 760px; margin-inline: auto; display: grid; gap: 16px; padding: 0 16px 32px; }
.legal-main h3 { font-size: 15px; margin: 6px 0 -6px; }
.legal-main p { line-height: 1.5; }

/* a selected line (§46.4) */
.line-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.line-choice { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; font: inherit; }
.dir-row { display: flex; align-items: center; gap: 8px; }
.dir-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.dir-row .name { flex: 1; }
.dir-row .count { font-variant-numeric: tabular-nums; color: var(--muted); }

/* language switch (§47.4): small, on the legal page (in the main page it moved into the menu, §76.2) */
.lang { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.lang button { font: inherit; color: inherit; background: none; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; cursor: pointer; }
.lang button[aria-pressed="true"] { border-color: var(--line); color: var(--text); font-weight: 700; }
/* the menu next to the reload pill (§76.2) */
.menu-btn { flex: none; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; font: 700 20px/1 var(--font); color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.menu-backdrop { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 0.45); display: flex; align-items: flex-end; justify-content: center; }
.menu-backdrop[hidden] { display: none; }
.menu-sheet { width: 100%; max-width: 480px; max-height: 85vh; max-height: 85dvh; overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box;
  background: var(--bg); color: var(--text); border-radius: 20px 20px 0 0; padding: 8px 14px calc(env(safe-area-inset-bottom) + 16px); -webkit-user-select: none; user-select: none; }
.menu-sheet .grabber { display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 6px; }
.menu-head { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.menu-title { flex: 1; font: 700 18px var(--font); }
.menu-back { font: 600 15px var(--font); color: var(--accent); background: none; border: 0; padding: 8px 4px; cursor: pointer; }
.menu-head .menu-back + .menu-title { text-align: center; }
.menu-sheet.install-view .menu-head { position: sticky; top: -8px; z-index: 1; padding: 6px 0; background: var(--bg); }
.menu-sheet.install-view .menu-title { min-width: 0; font-size: 16px; }
.menu-sheet.install-view .menu-back,
.menu-sheet.install-view .menu-close { flex: none; }
.menu-install { padding: 0 2px; }
.menu-close { width: 36px; height: 36px; font-size: 22px; line-height: 1; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.menu-group { background: var(--card); border: 1px solid var(--line); border-radius: 16px; margin: 10px 0; padding: 0; overflow: hidden; }
.menu-row, .menu-choice, .menu-switch { display: flex; align-items: center; gap: 12px; width: 100%; box-sizing: border-box; min-height: 52px; padding: 8px 14px; font: 600 16px var(--font);
  color: var(--text); background: none; border: 0; text-align: left; cursor: pointer; }
.menu-row + .menu-row, .menu-choice + .menu-choice { border-top: 1px solid var(--line); }
.row-icon { flex: none; width: 34px; height: 34px; display: grid; place-items: center; font-size: 17px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.row-label { flex: 1; }
.row-value, .row-chev { color: var(--muted); font-weight: 500; }
.row-chev { font-size: 22px; line-height: 1; }
.row-check { color: var(--accent); font-weight: 700; }
.menu-note { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.menu-note a { color: inherit; }
.menu-attr { font-size: 10px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.howto { margin: 0; padding: 10px 16px 10px 32px; font-size: 15px; line-height: 1.4; }
.howto li { margin: 6px 0; }
/* What's new as in the Claude app (§112.1): a plain list, a date with a version pill, small grey group labels */
.news-release { padding: 18px 4px 10px; border-top: 1px solid var(--line); }
.news-release:first-child { border-top: 0; padding-top: 8px; }
.news-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.news-date { margin: 0; font: 600 18px/1.3 var(--font); }
.news-ver { flex: none; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--muted); font: 500 13px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
.news-group { margin: 14px 0 4px; font: 600 12px/1.3 var(--font); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.news-release ul { margin: 0; padding: 0 0 0 22px; font-size: 15px; line-height: 1.45; }
.news-release li { margin: 6px 0; }

/* the short attribution only in the slim phone footer (§48.5) */
.short-attr { display: none; }
@media (max-width: 699px) {
  body[data-tab="map"] .short-attr { display: inline; }
  body[data-tab="map"] .legal-links { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* "Was meinst du?" (§48.2) */
.choices { display: grid; gap: 6px; }
.choice { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 10px; border-radius: 10px; text-align: left;
  border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; font: inherit; }
.choice .name { flex: 1; }
.station-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--card); border: 2px solid var(--map-label, var(--text)); margin-inline: 4px; }

/* street map (§49.3): a small switch above "My position", the OpenStreetMap credit bottom right */
.street-map { position: absolute; right: 16px; bottom: 106px; width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; } /* an icon (§51.5) */
.map-icon path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.map-icon .map-off { display: none; }
.street-map[aria-pressed='true'] .map-off { display: inline; }
.map-icon .map-off-back { stroke: var(--card); stroke-width: 4.5; }
.street-map[aria-pressed='true'] { color: var(--accent); border-color: var(--accent); }
/* step-free mode (§81): the switch above the street-map button; the sign; the notes */
.access { position: absolute; right: 16px; bottom: 146px; width: 32px; height: 32px; padding: 0; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; }
.access[aria-pressed='true'] { color: var(--accent); border-color: var(--accent); }
.access-icon .sign-fill { fill: currentColor; }
.access-icon .sign-stroke { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.access-sign { flex: none; vertical-align: -3px; }
.access-sign .sign-ground { fill: var(--access); }
.access-sign.is-no .sign-ground { fill: var(--c-unknown); }
.access-sign .sign-fill { fill: #fff; }
.access-sign .sign-stroke { fill: none; stroke: #fff; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.access-sign .sign-off { fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
.access-msg { right: 58px; bottom: 146px; max-width: 260px; }
.access-note { margin: 0; font-size: 12px; color: var(--muted); }
.access-note:empty { display: none; }
.access-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--access); }
.osm-credit a { color: inherit; } /* in the footer line beside the VBB credit (§86.5) */

/* full-screen map on phones (§49.4): the bars fade out (150 ms), then they leave the layout and the map grows once */
@media (max-width: 699px) {
  .top, .map-card .card-head, .marks-strip, .dock, .plan, .locate, .reset, .key-toggle, .street-map, .access { transition: opacity 150ms ease; }
  body.immersive-fade .top, body.immersive-fade .map-card .card-head, body.immersive-fade .marks-strip, body.immersive-fade .dock, body.immersive-fade .plan,
  body.immersive-fade .locate, body.immersive-fade .reset, body.immersive-fade .key-toggle, body.immersive-fade .street-map, body.immersive-fade .access { opacity: 0; pointer-events: none; }
  body.immersive .top, body.immersive .map-card .card-head, body.immersive .marks-strip, body.immersive .dock { display: none; }
  body.immersive .plan, body.immersive .locate, body.immersive .reset, body.immersive .key-toggle, body.immersive .street-map, body.immersive .access { visibility: hidden; }
  body.immersive .map-top { padding-top: env(safe-area-inset-top); }
  /* the footer line floats over the map, bottom left, like a map credit (§57.3) */
  body.immersive footer { position: fixed; left: 8px; right: auto; bottom: 2px; /* as low as the OpenStreetMap credit (§76.1) */ width: auto; padding: 1px 6px; border-radius: 6px; z-index: 3;
    background: color-mix(in srgb, var(--card) 80%, transparent); }
  .street-map { bottom: 110px; }
  .access { bottom: 150px; }
  .access-msg { bottom: 150px; }
  /* a docked card stays above the footer line (§75.2) */
  body.immersive .popover.is-docked { bottom: 26px; }
}


/* line search, highlighted lines, bookmarks, settings (§56): one pill next to the connection search, one sheet like its fields */
.line-pill { flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--card); color: var(--text); border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.12); font: 600 15px var(--font); cursor: pointer; pointer-events: auto; white-space: nowrap; }
.line-pill[aria-expanded='true'] { color: var(--accent); border-color: var(--accent); }
.tool-sheet { display: grid; gap: 8px; }
.tool-sheet[hidden], .marks-strip[hidden] { display: none; }
.tool-tabs { display: flex; gap: 6px; margin-right: 36px; }
.tool-sheet .tab { min-height: 40px; padding: 0 12px; border-radius: 999px; background: var(--card); color: var(--muted); border: 1px solid var(--line); font: 600 14px var(--font); cursor: pointer; white-space: nowrap; }
.tool-sheet .tab[aria-pressed='true'] { color: var(--accent); border-color: var(--accent); }
.tool-sheet .row-line { display: flex; align-items: center; gap: 6px; min-height: 44px; border-bottom: 1px solid var(--line); }
.tool-sheet .pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px; background: transparent; border: 0; border-radius: 8px;
  color: inherit; font: 500 14px var(--font); text-align: left; cursor: pointer; }
.tool-sheet .pick.active, .tool-sheet .pick:hover { background: var(--line); }
.tool-sheet .pick .meta { color: var(--muted); font-size: 13px; }
.tool-sheet .star, .tool-sheet .small { min-width: 44px; height: 44px; background: transparent; border: 0; color: var(--muted); font: 700 20px var(--font); cursor: pointer; }
.tool-sheet .star[aria-pressed='true'] { color: var(--c-late); }
.tool-sheet .small { font-size: 14px; min-width: 52px; }
.tool-sheet .small[aria-pressed='true'] { color: var(--accent); }
.tool-sheet .wide, .tool-sheet .seg { min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--card); color: var(--text); border: 1px solid var(--line); font: 600 14px var(--font); cursor: pointer; text-align: left; }
.tool-sheet .seg[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); }
.tool-sheet .note { margin: 0; color: var(--muted); font-size: 13px; }
.marks-strip { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 8px; }
.marks-strip::-webkit-scrollbar { display: none; }
.mark-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 4px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); font: 600 14px var(--font); }
.mark-chip .x { min-width: 40px; height: 40px; background: transparent; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
.mark-clear { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--accent); color: var(--accent); font: 700 14px var(--font); cursor: pointer; }
.mark-dir { flex: none; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font: 500 13px var(--font); }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.pop-actions button { min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); color: var(--text); border: 1px solid var(--line); font: 600 14px var(--font); cursor: pointer; }
.pop-actions .star { min-width: 40px; padding: 0; font-size: 20px; color: var(--muted); }
.pop-actions .star[aria-pressed='true'] { color: var(--c-late); }
.pop-actions button[aria-pressed='true']:not(.star) { border-color: var(--accent); color: var(--accent); }
@media (max-width: 699px) { .marks-strip { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); } }
footer a { color: inherit; }
.place-row { display: flex; align-items: center; }

/* --- v0.57 (§68): one route block with signs, rows with signs, the stop choice with the fastest first --- */
.route { row-gap: 0; }
.route .plan-field { background: var(--bg); border: 1px solid var(--line); }
.route .plan-field:first-child { border-radius: 12px 12px 0 0; }
.route .plan-field:last-child { border-radius: 0 0 12px 12px; margin-top: -1px; }
.route .plan-field:focus-within, .route .plan-field.target { outline: 2px solid var(--accent); outline-offset: -1px; position: relative; z-index: 1; }
.route .plan-field input { background: transparent; border: 0; border-radius: 0; min-height: 44px; padding-left: 34px; }
.route .plan-field input:focus { outline: none; }
.route .plan-field { gap: 0; }
.route .suggest:not(:empty) { padding: 0 6px 4px 30px; }
.route-sign { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 10px; height: 10px; border-radius: 50%; pointer-events: none; }
.route-sign.start { border: 2.5px solid var(--text); box-sizing: border-box; }
.route-sign.end { background: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.row-sign { flex: none; width: 22px; text-align: center; color: var(--muted); font-size: 14px; }
.trip-open { display: flex; align-items: center; gap: 2px; width: 100%; min-height: 44px; padding: 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--text); font: 600 15px var(--font); text-align: left; cursor: pointer; }
.trip-open .open-name { flex: 1; min-width: 0; padding-left: 6px; }
.trip-open .open-count { color: var(--muted); font-weight: 400; padding-right: 8px; }
.trip-open:hover { background: var(--line); }

/* average delay by mode (§71.1) and the 5 most / least delayed lines (§71.2) */
.avg-table { font-size: 14px; }
.avg-table th, .avg-table td { padding: 8px 3px; }
.avg-table thead th { text-align: right; }
.avg-table thead th:first-child { text-align: left; }
.avg-table tbody th { white-space: normal; }
.avg-table td { text-align: right; font-weight: 700; line-height: 1.2; }
.avg-table .avg-v, .avg-table .avg-n { display: block; }
.avg-table .avg-n { font-size: 11px; font-weight: 400; color: var(--muted); }
.extremes h3 { margin: 14px 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.extremes ol { list-style: none; margin: 0; padding: 0; }
.extremes li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.extremes li:last-child { border-bottom: 0; }
.extremes .num { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.extremes .sample { font-size: 12px; color: var(--muted); min-width: 4.5em; text-align: right; }

/* --- M1aq (§86) ------------------------------------------------------------------------------------------------- */
/* small mode pills: at most 28 px high (§86.5) */
#filters .chip { min-height: 0; height: 28px; gap: 5px; padding: 0 9px 0 5px; font: 600 12px var(--font); }
#filters .chip .icon { width: 16px; height: 16px; }
/* an operator without real-time data (§86.2): the amber pill and the banner with its × */
.live-pill[data-state='partial'] .live-dot { background: var(--c-late); }
.live-out { font-weight: 600; color: var(--warn-text); }
.rt-banner { display: flex; align-items: center; gap: 8px; padding-block: 4px; padding-right: 4px; font-size: 13px; line-height: 1.3; }
.rt-banner > span { flex: 1; min-width: 0; }
.rt-close { flex: none; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 20px; cursor: pointer; }
/* step-free mode in the menu, and its small sign on the map while it is on (§86.5) */
.menu-switch .switch { margin-left: auto; flex: none; width: 42px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background 0.15s; }
.menu-switch .switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3); transition: transform 0.15s; }
.menu-switch[aria-pressed='true'] .switch { background: var(--accent); }
.menu-switch[aria-pressed='true'] .switch::after { transform: translateX(16px); }
.menu-switch .row-icon { display: grid; place-items: center; color: var(--accent); }
.menu-msg { margin: 0; padding: 4px 14px 10px; font-size: 13px; color: var(--muted); }
.access-on { flex: none; width: 26px; height: 22px; padding: 0; display: grid; place-items: center; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--card); color: var(--accent); box-shadow: 0 1px 6px rgb(0 0 0 / 0.1); position: relative; }
.access-on::before { content: ''; position: absolute; inset: -11px -9px; }
/* departures nearby (§86.4): a labelled button above "Mein Standort", and its sheet */
.nearby { position: absolute; right: 10px; bottom: 106px; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 11px;
  border-radius: 22px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font: 700 14px var(--font); cursor: pointer;
  box-shadow: 0 2px 10px rgb(0 0 0 / 0.18); }
.departures-icon rect, .departures-icon path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.street-map { bottom: 160px; }
.nearby-sheet { z-index: 4; }
.nearby-msg { margin: 0; font-size: 14px; color: var(--muted); }
.nearby-list { display: grid; gap: 10px; }
.nearby-station h4 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 2px; font: 700 15px var(--font); }
.nearby-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nearby-walk { flex: none; margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.nearby-rows { margin: 0; }
/* one line per departure, the countdown first: "in 6 Min. · M10 → Hauptbahnhof · 08:11" */
.nearby-rows li .row { grid-template-columns: 4.6em auto minmax(0, 1fr) auto; column-gap: 8px; min-height: 40px; }
.nearby-rows li .row .in { grid-row: 1; grid-column: 1; font-size: 14px; }
.nearby-rows li .row .badge { grid-row: 1; grid-column: 2; }
.nearby-rows li .row .name { grid-row: 1; grid-column: 3; }
.nearby-rows li .row .time { grid-row: 1; grid-column: 4; font-size: 13px; font-weight: 500; color: var(--muted); min-width: 0; }
.nearby-rows li .row .planned { display: none; }
.nearby-rows li.tight .row > :not(.tight-tag) { opacity: 0.4; }
.nearby-rows li .row .tight-tag { grid-row: 2; grid-column: 1 / -1; font-size: 11px; font-weight: 700; color: var(--c-late); }
/* the quicker search (§86.6): one chip for the time, compact result rows, the legs as a timeline */
.plan-when-row { gap: 6px; }
.when-chip { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text);
  font: 600 14px var(--font); cursor: pointer; }
.when-chip::after { content: ' ▾'; color: var(--muted); }
.when-chip[aria-expanded='true'] { border-color: var(--accent); }
.plan-when-box { flex-basis: 100%; display: grid; gap: 6px; }
.conn-in { font-size: 13px; font-weight: 700; color: var(--accent); margin-right: 2px; }
.plan-results .conn { gap: 2px; padding: 6px 10px; }
.conn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.conn-meta .conn-lines { margin-left: auto; }
.conn-meta .tags { display: inline-flex; flex-wrap: wrap; gap: 0 8px; margin-left: 0; }
.conn-meta .tag { border: 0; padding: 0; font-size: 11px; letter-spacing: 0; text-transform: none; }
.plan-card .legs { position: relative; gap: 0; padding-left: 0; }
.plan-card .legs li { padding: 5px 0 5px 4px; }
.plan-card .legs li:not(.walk) { font-weight: 500; }
.plan-card .legs li.walk { padding-left: 34px; position: relative; }
.plan-card .legs li.walk::before { content: ''; position: absolute; left: 13px; top: 0; bottom: 0; border-left: 2px dotted var(--line); }
@media (max-width: 699px) {
  #filters .chip { height: 28px; }
  body.immersive-fade .nearby { opacity: 0; pointer-events: none; } /* the full screen hides it like "Mein Standort" (§49.4) */
  body.immersive .nearby { visibility: hidden; }
}

/* --- M1ar (§87) ------------------------------------------------------------------------------------------------- */
/* the departures button: a round icon above "Mein Standort" (§87.3) */
.nearby { width: 44px; height: 44px; min-height: 0; padding: 0; justify-content: center; border-radius: 50%; gap: 0; }
.departures-icon .stop-disc { fill: none; stroke: currentColor; stroke-width: 1.7; }
.departures-icon .stop-h, .departures-icon .stop-pole { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
/* the departures sheet: higher, compact (two stations × 4 rows without scrolling) */
.nearby-sheet { max-height: 60%; gap: 4px; padding-bottom: 8px; }
.nearby-sheet h3 { min-height: 22px; font-size: 14px; }
.nearby-list { gap: 6px; }
.nearby-station h4 { margin: 0; min-height: 24px; align-items: center; font-size: 14px; }
.nearby-rows { gap: 0; }
.nearby-rows li .row { min-height: 30px; padding: 2px 0; }
.nearby-rows li .row .tight-tag { grid-row: 1; grid-column: 4; justify-self: end; }
.nearby-rows li.tight .row .time { display: none; }
.nearby-sheet .note { margin: 0; font-size: 11px; }
@media (max-width: 699px) { .nearby-sheet[data-sheet='half'] { height: 58%; } }
/* cards with three heights (§87.4); the card follows the finger, then glides 200 ms */
.sheet { transition: max-height 200ms ease, height 200ms ease, transform 200ms ease; touch-action: none; }
.sheet.can-scroll { touch-action: pan-y; }
.sheet .grabber, .sheet h3, .sheet .pop-head, .sheet .sheet-head { touch-action: none; }
.sheet.dragging { transition: none; user-select: none; -webkit-user-select: none; }
.sheet .grabber { cursor: grab; padding-block: 6px; box-sizing: content-box; background-clip: content-box; }
.sheet[data-sheet='peek'] { max-height: 64px !important; height: auto !important; overflow: hidden !important; cursor: pointer; }
.sheet[data-sheet='full'] { height: 85% !important; max-height: 85% !important; }
/* icon buttons on the left (§87.5): the legend, the street map above it */
@media (max-width: 699px) {
  .key-toggle { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; }
  .street-map { left: 14px; right: auto; bottom: 58px; }
  /* the warning banners: their sentence is in the pill's details (§87.1) */
  #banner.warn, #rt-banner { display: none !important; }
}
@media (min-width: 700px) { .street-map { left: 16px; right: auto; bottom: 16px; } }
.legend-icon circle, .legend-icon rect, .legend-icon path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.menu-icon line { stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.live-status { font-weight: 600; color: var(--warn-text); }

/* --- M1as (§88) ------------------------------------------------------------------------------------------------- */
/* the departures button looks like "Mein Standort"; the three right-hand buttons stand 8 px apart (§88.1, §88.2) */
.nearby { border-color: var(--line); background: var(--card); color: var(--text); box-shadow: 0 1px 6px rgb(0 0 0 / 0.1); bottom: 114px; }
.locate { bottom: 62px; }
.locate-msg { bottom: 66px; }
/* the views menu: a line cogwheel, the default's star after its name, one column for the stars (§88.3) */
.gear-icon circle, .gear-icon path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.views-gear { display: inline-grid; place-items: center; padding: 0; }
.view-def { margin-left: 6px; font-size: 13px; color: var(--accent); }
.view-star, .view-del, .view-del-slot { flex: none; width: 32px; padding: 0; }
/* the search: the start panel below a line, quieter than the fields (§88.6); "Suchen" always there (§88.5) */
.plan-start { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; overflow-y: auto; overscroll-behavior: contain; }
.plan-start .trip-go { font-size: 14px; color: var(--muted); }
.plan-when-row .go { min-height: 40px; }
/* own icons for "Hier", the places and "Zuhause" (§88.7) */
.quick-icon { flex: none; }
.quick-icon path, .quick-icon circle { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.place-opt, .place-row { display: flex; align-items: center; gap: 8px; }
.trip-open .row-sign { display: inline-grid; place-items: center; }

/* --- M1at (§89) ------------------------------------------------------------------------------------------------- */
/* computers: the search box may reach below the map (§89.1); the canvas keeps the rounded corners */
@media (min-width: 700px) {
  .map-wrap { overflow: visible; }
  #map { border-radius: 10px; }
}
.plan-when-box { order: 3; } /* the time buttons under the row; "Suchen" stays beside the chip */
/* the "Orte" button with its cogwheel (§89.2) */
.quick-split { padding: 0; gap: 0; overflow: hidden; }
.quick-split .quick-part { flex: 1; min-width: 0; height: 100%; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 10px 0 14px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; border-radius: 999px 0 0 999px; }
.quick-split .quick-part:only-child, .quick-split .quick-part:has(+ [hidden]) { border-radius: 999px; padding-right: 14px; }
.quick-cog { flex: none; width: 40px; min-height: 42px; display: grid; place-items: center; padding: 0 4px 0 0; border: 0; border-left: 1px solid var(--line);
  background: none; color: var(--muted); cursor: pointer; border-radius: 0 999px 999px 0; }
.quick-cog:hover, .quick-part:hover { background: var(--line); }
.quick-split:hover { border-color: var(--line); }
.quick-split:has([aria-expanded='true']) { border-color: var(--accent); }
/* my location in a field: the "Hier" icon instead of the start / destination dot (§89.3) */
.here-sign, .street-sign { display: none; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--accent); pointer-events: none; }
.plan-field.here .here-sign { display: block; }
.plan-field.here .route-sign { display: none; }
.plan-field.street .street-sign { display: block; }
.plan-field.street .route-sign { display: none; }
.street-sign { color: var(--muted); }
.suggest button.street { display: flex; align-items: center; gap: 6px; }
.suggest button.street .quick-icon { flex: none; color: var(--muted); }
.suggest button.street .area { color: var(--muted); font-weight: 400; }
.trip-go .quick-icon { width: 15px; height: 15px; vertical-align: -2px; margin-right: 3px; color: var(--accent); }
/* menu rows with drawn icons (§89.6); the map buttons explained (§89.7) */
.row-svg path, .row-svg circle, .row-svg rect { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.row-svg .fill { fill: currentColor; stroke: none; }
.row-icon { color: var(--accent); }
.menu-sub { margin: 4px 4px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.howto-keys { list-style: none; padding: 4px 12px; display: grid; gap: 2px; }
.howto-keys li { display: flex; align-items: center; gap: 12px; min-height: 40px; font-size: 15px; }
.key-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); color: var(--text); }
.key-icon svg { width: 20px; height: 20px; }
/* departures nearby: 3 stations × 3 rows; the station's name opens its card (§89.9) */
.nearby-head { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 24px; padding: 0; border: 0; background: none; color: var(--text);
  font: inherit; text-align: left; cursor: pointer; }
.nearby-head .nearby-name { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.nearby-sheet .nearby-list { gap: 4px; }
.nearby-rows li .row { min-height: 28px; padding: 1px 0; }
@media (max-width: 699px) { .nearby-sheet[data-sheet='half'] { height: auto; max-height: 70%; } }
/* the station card's star: save it as a place (§89.10) */
.place-star { flex: none; margin-left: auto; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--muted);
  font: 700 20px var(--font); cursor: pointer; }
.place-star[aria-pressed='true'] { color: var(--c-late); }
/* three stations × 3 rows fit without scrolling (§89.9): tighter rows, the grabber over the title row */
.nearby-sheet { gap: 2px; padding-top: 14px; position: absolute; }
.nearby-sheet > .grabber { position: absolute; top: 4px; left: 50%; margin-left: -18px; }
.nearby-sheet .nearby-list { gap: 2px; }
.nearby-sheet .nearby-station h4, .nearby-head { min-height: 22px; }
.nearby-sheet .nearby-rows li .row { min-height: 26px; padding: 0; }
.nearby-sheet .note { font-size: 11px; line-height: 1.3; }
.nearby-sheet { padding-bottom: 3px; }
.nearby-sheet h3 { min-height: 20px; line-height: 20px; }
/* a station's departures: the next hour and the last half hour in a list that scrolls by itself (§90.2) */
.popover.station-card { display: flex; flex-direction: column; }
.popover.station-card > * { flex: none; }
.popover.station-card > .grabber { align-self: center; }
.popover.station-card > .board { flex: 0 1 auto; min-height: 0; max-height: 142px; overflow-y: auto; overscroll-behavior: contain; position: relative;
  touch-action: pan-y; }
.popover.station-card[data-sheet='full'] > .board { flex: 1 1 auto; max-height: none; }
.popover.station-card[data-sheet='peek'] > .board { visibility: hidden; }
.board .pop-list { gap: 0; }
.board .pop-list li { min-height: 26px; gap: 0; }
.board .pop-list li .row { font-size: 13px; grid-template-columns: 5em 2.8em 2.6em auto minmax(0, 1fr); column-gap: 3px; padding: 2px 0; min-height: 26px; align-items: center; }
.board .pop-list li .row > * { grid-row: 1; grid-column: auto; font-size: 13px; white-space: nowrap; }
.board .pop-list li .row .name { font-weight: 500; }
.board .pop-list li .share-row { height: 26px; }
.board .pop-list li.past { opacity: 0.55; }
.board .pop-list li.past .in { font-weight: 500; }
.board .pop-list li.past.picked { opacity: 1; box-shadow: inset 3px 0 0 var(--accent); } /* its vehicle shown on the map (§96.1) */
.board .pop-list li.past.picked .row { padding-left: 6px; }
.board .pop-list li.board-now { min-height: 0; display: flex; align-items: center; gap: 6px; margin: 2px 0; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.board .pop-list li.board-now::after { content: ''; flex: 1; height: 1px; background: var(--accent); opacity: 0.5; }
.board-foot { display: grid; gap: 4px; padding-top: 6px; }
@media (max-width: 699px) { .popover.is-docked.station-card { max-height: 38%; } }
/* the map follows my position (§90.5) */
.locate[data-follow='1'] { color: var(--accent); box-shadow: 0 0 0 3px var(--accent), 0 2px 8px rgb(0 0 0 / 0.18); }
/* Samsung Internet: install from Chrome (§90.9) */
.samsung-note { display: grid; gap: 8px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--c-late); border-radius: 10px; background: var(--card); }
.samsung-note p { margin: 0; }
.chrome-link { justify-self: start; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--accent); color: var(--card); font-weight: 700; text-decoration: none; }
.samsung-hint { position: absolute; left: 10px; right: 62px; top: auto; bottom: 120px; z-index: 3; display: grid; gap: 6px; padding: 8px 40px 8px 12px; margin: 0;
  background: var(--card); color: var(--text); border: 1px solid var(--c-late); border-radius: 10px; box-shadow: 0 4px 16px rgb(0 0 0 / 0.18); font-size: 13px; }
.samsung-hint[hidden] { display: none; }
.samsung-hint p { margin: 0; }
.samsung-hint .close { position: absolute; top: 0; right: 0; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); font-size: 20px; }
/* the search box fits small phones (§90.7): never wider than the screen */
#plan-fields { grid-template-columns: minmax(0, 1fr); }
.plan-top { grid-template-columns: auto minmax(0, 1fr) 44px; }
#plan-here { padding: 0 12px; }
.plan-when-row > * { min-width: 0; }
.plan-when-row .go { flex: none; }
.plan-when-box, .plan-when-box > * { min-width: 0; }
.plan-when { display: flex; width: 100%; box-sizing: border-box; }
.plan-when button { flex: 1 1 0; min-width: 0; padding-inline: 6px; }
.plan-at input, .plan-at select { flex: 1 1 0; min-width: 0; }
/* a vehicle's next stops: the same list that scrolls by itself, without a line badge (§91.2) */
.board.stops-board .pop-list li .row { grid-template-columns: 5em 2.8em 2.6em minmax(0, 1fr); }
.popover.vehicle-card:not([data-sheet='full']) > .note { display: none; } /* the note with the whole list only (§34.4) */
/* the opened vehicle card: 5 stops at once, the info squeezed into two small lines beside the buttons (§92.1) */
.popover.station-card.vehicle-card > .board { max-height: 134px; }
.popover.station-card.vehicle-card[data-sheet='full'] > .board { max-height: none; }
.popover.is-docked.station-card.vehicle-card { max-height: calc(100% - 16px); } /* as high as 5 stops need, on every screen */
.vehicle-card .pop-head .share-btn { flex: none; justify-content: center; width: 32px; min-height: 32px; height: 32px; padding: 0; }
.pop-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pop-info-text { flex: 1 1 auto; min-width: 0; display: grid; }
.pop-info .pop-delay, .pop-info .pop-age { margin: 0; font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-info .pop-actions { flex: none; flex-wrap: nowrap; margin-top: 0; gap: 4px; }
.pop-info .pop-actions button { min-height: 32px; padding: 0 10px; font-size: 13px; }
.pop-info .pop-actions .star { min-width: 32px; padding: 0; font-size: 17px; }
.vehicle-card .pop-sub { margin: 0; font-size: 11px; line-height: 14px; }

/* "Werte als Tabelle" under the time charts (§99.3) */
.chart-data { margin-top: 12px; }
.chart-data summary { cursor: pointer; color: var(--accent); font-size: 15px; min-height: 44px; display: flex; align-items: center; }
.chart-data-scroll { max-height: 320px; overflow: auto; }
.chart-data-scroll th { position: sticky; top: 0; background: var(--card); }
/* each found connection's colour, as on the map (§106.1) */
.plan-results .conn.lc1 { border-left: 4px solid var(--ride-1); } .plan-results .conn.lc2 { border-left: 4px solid var(--ride-2); }
.plan-results .conn.lc3 { border-left: 4px solid var(--ride-3); } .plan-results .conn.lc4 { border-left: 4px solid var(--ride-4); }
.plan-results .conn.lc5 { border-left: 4px solid var(--ride-5); }
/* the next 90 minutes and the "+" (§108.2) */
.plan-results .more-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 2px 0; }
.plan-results .more-msg { font-size: 13px; color: var(--muted); padding: 4px 2px; }
.plan-results .more-plus { display: flex; justify-content: center; padding: 2px 0 4px; }
.plus-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--accent);
  font: inherit; font-size: 24px; line-height: 1; cursor: pointer; }
.plus-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* phones: while a connection's card is open the follow pill steps aside, so the route has room above the card (§107.1) */
@media (max-width: 699px) { body.plan-card-open .follow { display: none; } }
