/* UK Activity Radar — flat light interface (v1.6).
   One stylesheet for the application chrome. Map markers and route lines
   live in map-markers.css. Breakpoint: phones at 760px and below. */

:root {
  color-scheme: light;
  --col: 400px;
  --nav-h: 64px;
  --surface: #ffffff;
  --subtle: #f2f4f6;
  --land: #eef0f2;
  --line: #dde1e6;
  --line-strong: #c3c9d0;
  --text: #12161a;
  --muted: #5a636d;
  --accent: #0b6bcb;
  --accent-hover: #0958a8;
  --accent-ink: #ffffff;
  --accent-soft: #e7f0fa;
  --good: #127a4d;
  --good-soft: #e3f4ec;
  --warn: #8a5a00;
  --warn-soft: #fff3d6;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  /* Names used by marker styles and inline styles generated in app.js. */
  --bg: var(--surface);
  --panel: var(--surface);
  --panel-2: var(--subtle);
  --border: var(--line);
  --danger: var(--bad);
  --warning: #b7791f;
  --rail: #6e2c6b;
  --bus: #0e7a5a;
  --sar: #0b7f8c;
  --vessel: #1f5fa8;
  --rescue: #c2410c;
  --incident: #b42318;
  --road: #b7791f;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--land);
  color: var(--text);
  font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
small { font-size: 13px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.noscript-note { padding: 20px; }

/* ---------- Shared controls ---------- */
.primary-button, .ghost-button, .mini-button, .tool-button, .plus-button, .track-button,
.discovery-save, .discovery-share, .useful-tool, .location-quick-action, .live-context-card {
  border-radius: var(--radius);
}
.primary-button {
  min-height: 44px; padding: 0 18px; border: 0;
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
}
.primary-button:hover { background: var(--accent-hover); }
.ghost-button, .mini-button, .tool-button, .track-button, .discovery-save, .discovery-share {
  min-height: 40px; padding: 0 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
}
.mini-button { min-height: 34px; padding: 0 12px; font-size: 14px; }
.ghost-button:hover, .mini-button:hover, .tool-button:hover, .track-button:hover,
.discovery-save:hover, .discovery-share:hover { background: var(--subtle); }
.plus-button {
  min-height: 40px; padding: 0 14px; border: 1px solid var(--text);
  background: var(--text); color: #fff; font-weight: 600;
}
.track-button.active, .discovery-save.saved { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
select, .tool-select, input[type="search"], input[type="text"], input[type="password"] {
  min-height: 44px; width: 100%; padding: 0 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--text);
}
select, .tool-select { appearance: none; padding-right: 36px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a636d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
select:disabled { opacity: .55; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.count-badge, .live-dot {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 11px;
  background: var(--subtle); color: var(--muted); font-size: 12px; font-weight: 600;
}
.live-dot { background: var(--good-soft); color: var(--good); }
.left-empty, .my-radar-empty, .watch-empty, .search-empty, .nearby-summary-empty, .board-empty, .cool-empty {
  color: var(--muted); font-size: 14px; padding: 8px 0;
}

/* ---------- Top bar and search ---------- */
.topbar {
  position: fixed; z-index: 1100; top: 0; left: 0; width: var(--col); height: 64px;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px;
}
.brand-copy strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
#mode-pill {
  position: fixed; z-index: 900; left: calc(var(--col) + 12px); bottom: 12px;
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0;
}
#mode-pill::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: #9aa3ad; }
body[data-live-state="live"] #mode-pill::before { background: #1e9e6a; }
body[data-live-state="down"] #mode-pill::before { background: var(--bad); }
.top-actions { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.search-shell { position: relative; flex: 1; min-width: 0; display: flex; gap: 6px; }
.search-wrap {
  flex: 1; min-width: 0; height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--subtle);
}
.search-wrap:focus-within { border-color: var(--accent); background: var(--surface); }
.search-wrap > span {
  width: 18px; height: 18px; flex: none; font-size: 0; background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.search-wrap input { border: 0; min-height: 0; height: 100%; padding: 0; background: transparent; outline: 0; font-size: 15px; }
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-go { min-height: 44px; padding: 0 12px; }
.search-results {
  position: absolute; z-index: 1300; top: 50px; left: 0; right: 0; max-height: min(60vh, 460px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 0;
  box-shadow: 0 8px 24px rgba(18, 22, 26, .12);
}
.search-result {
  width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left;
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--subtle); }
.search-result strong { display: block; font-weight: 600; }
.search-result small, .search-result span:not(.search-result-icon) { color: var(--muted); }
.search-result-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--subtle); }
#install-app, #radar-plus, #recenter { flex: none; }

/* Floating map buttons: Radar+, My location, map options, focus. */
#radar-plus {
  position: fixed; z-index: 900; top: 12px; right: 12px; min-height: 40px;
}
#recenter, .map-control, .focus-map-button {
  width: 44px; height: 44px; min-height: 44px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text);
}
#recenter {
  position: fixed; z-index: 900; right: 12px; bottom: 104px; font-size: 0;
}
#recenter::before {
  content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.map-controls { position: absolute; z-index: 800; right: 12px; bottom: 156px; display: flex; flex-direction: column; gap: 8px; }
.map-control:hover, #recenter:hover, .focus-map-button:hover { background: var(--subtle); }
.focus-map-button { position: absolute; z-index: 800; top: 60px; right: 12px; font-size: 0; }
.focus-map-button::before {
  content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.focus-map-button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* ---------- Layout ---------- */
.layout { position: static; }
.map-panel { position: fixed; top: 0; right: 0; bottom: 0; left: var(--col); background: var(--land); }
#map, #live-object-map { position: absolute; inset: 0; }
#map { background: var(--land); }
#live-object-map { pointer-events: none; z-index: 410; }
.leftbar {
  position: fixed; z-index: 1000; top: 64px; left: 0; bottom: 0; width: var(--col);
  display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line);
}
.workspace-rail {
  flex: none; height: 52px; display: flex; align-items: stretch; gap: 2px; padding: 0 8px;
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.workspace-tab {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--muted); font-size: 14px; font-weight: 500; padding: 0 4px;
}
.workspace-tab:hover { color: var(--text); }
.workspace-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.rail-symbol { display: inline-flex; }
.rail-symbol svg { width: 18px; height: 18px; }
.workspace-collapse { flex: 0 0 40px; font-size: 20px; }
.workspace-collapse span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.workspace-drawer { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.workspace-panel { display: none; padding: 20px 20px 32px; flex-direction: column; gap: 22px; }
.workspace-panel.active { display: flex; }

/* Desktop: collapsed panel floats as a compact card over a full-width map. */
.layout:has(#workspace-shell.collapsed) .map-panel { left: 0; }
.layout:has(#workspace-shell.collapsed) .layer-chips, .layout.focus-mode .layer-chips { left: var(--col); }
.layout:has(#workspace-shell.collapsed) .leftbar { top: 76px; left: 12px; bottom: auto; width: calc(var(--col) - 24px); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.layout:has(#workspace-shell.collapsed) .workspace-rail { border-bottom: 0; }
#workspace-shell.collapsed .workspace-drawer { display: none; }
#workspace-shell.collapsed .workspace-tab.active { border-bottom-color: transparent; }
body:has(#workspace-shell.collapsed) .topbar { top: 12px; left: 12px; width: calc(var(--col) - 24px); height: 56px; border: 1px solid var(--line); border-radius: 12px; }
body:has(#workspace-shell.collapsed) #mode-pill { left: 12px; }

/* Focus map hides every panel. */
.layout.focus-mode .leftbar, .layout.focus-mode .detail-sidebar, .layout.focus-mode .layer-chips,
.layout.focus-mode .live-ticker, .layout.focus-mode .map-legend { display: none !important; }
.layout.focus-mode .map-panel { left: 0; }
body:has(.layout.focus-mode) .topbar { top: 12px; left: 12px; width: calc(var(--col) - 24px); height: 56px; border: 1px solid var(--line); border-radius: 12px; }
body:has(.layout.focus-mode) #mode-pill { left: 12px; }

.v12-footer { display: none; }

/* ---------- Map overlays ---------- */
.layer-chips {
  position: absolute; z-index: 800; top: 12px; left: 12px; right: 140px;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.layer-chips::-webkit-scrollbar { display: none; }
.layer-chip {
  flex: none; height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.layer-chip:hover { border-color: var(--line-strong); }
.layer-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nearby-bar { display: none; }
.live-ticker {
  position: absolute; z-index: 800; left: 140px; right: 68px; bottom: 12px; height: 40px;
  display: flex; align-items: center; gap: 10px; padding: 0 12px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.ticker-label { flex: none; font-size: 12px; font-weight: 700; color: var(--good); }
.ticker-items { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; color: var(--muted); font-size: 14px; white-space: nowrap; }
.ticker-item { flex: none; border: 0; background: transparent; padding: 4px 8px; border-radius: 6px; font-size: 14px; color: var(--text); white-space: nowrap; }
.ticker-item:hover { background: var(--subtle); }
.ticker-sep { color: var(--line-strong); }
.ticker-item .cool-badge { margin-right: 4px; }
.map-legend { display: none; }
.bus-zoom-note, .nearby-note, .watch-toast {
  position: absolute; z-index: 850; top: 60px; left: 50%; transform: translateX(-50%);
  max-width: min(440px, calc(100% - 24px)); padding: 10px 14px; border-radius: var(--radius);
  background: var(--text); color: #fff; font-size: 14px; line-height: 1.35; text-align: center;
}
.nearby-note { top: 108px; background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.journey-route-clear { position: absolute; z-index: 850; top: 60px; left: 12px; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.traffic-legend {
  position: absolute; z-index: 800; left: 12px; bottom: 60px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px;
}
.traffic-legend strong { font-size: 12px; color: var(--muted); }
.traffic-legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Leaflet chrome */
.leaflet-container { font-family: var(--font); background: var(--land); }
.leaflet-bar { border: 1px solid var(--line) !important; border-radius: var(--radius) !important; box-shadow: none !important; overflow: hidden; }
.leaflet-bar a { width: 40px !important; height: 40px !important; line-height: 40px !important; color: var(--text) !important; border-bottom-color: var(--line) !important; }
.leaflet-control-attribution { font-size: 11px; background: rgba(255, 255, 255, .85) !important; }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: 0 6px 20px rgba(18, 22, 26, .14); }
.traffic-popup { display: grid; gap: 4px; font-size: 14px; }
.traffic-popup small { color: var(--muted); }
.activity-tooltip.leaflet-tooltip {
  padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text);
  box-shadow: 0 6px 20px rgba(18, 22, 26, .14); white-space: normal;
}
.activity-tooltip.leaflet-tooltip::before { display: none; }
.activity-tooltip-card { width: 260px; padding: 12px 14px; display: grid; gap: 6px; font-size: 13px; }
.tooltip-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.tooltip-top strong { font-size: 15px; }
.tooltip-live { font-size: 11px; font-weight: 700; color: var(--good); }
.tooltip-live.stale { color: var(--warn); }
.tooltip-sub { color: var(--muted); }
.tooltip-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.tooltip-pill { padding: 2px 8px; border-radius: 10px; background: var(--subtle); font-size: 12px; }
.tooltip-pill.good { background: var(--good-soft); color: var(--good); }
.tooltip-pill.warn { background: var(--warn-soft); color: var(--warn); }
.tooltip-hint { color: var(--muted); font-size: 12px; }

/* Flat map markers: a small coloured square with a white icon. */
.marker-bubble {
  width: 26px !important; height: 26px !important; left: 8px !important; top: 8px !important;
  border: 2px solid #fff !important; border-radius: 7px !important;
  box-shadow: 0 1px 2px rgba(18, 22, 26, .35) !important; color: #fff !important;
}
.marker-bubble .ico { width: 14px !important; height: 14px !important; }
/* Shared reporting points: no badges or stalks, the markers just sit apart. */
.train-coincident-index, .train-coincident-stem, .train-coincident-origin { display: none !important; }
.motion-pointer, .motion-speed { display: none !important; }
.marker-bubble > span { filter: none !important; }
.marker-gps, .marker-network_report, .marker-estimated { outline: 0 !important; }
/* Rail stations: a small square with the name beside it when zoomed in. */
.station-marker-wrap { overflow: visible; }
.place-marker.station-marker {
  width: 12px; height: 12px; border: 2px solid #fff; border-radius: 3px; background: #1f3a52;
  box-shadow: 0 0 0 1px rgba(31, 58, 82, .25); display: grid; place-items: center;
}
.station-marker i { display: none; }
.station-label {
  display: none; position: absolute; left: 50%; top: 14px; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font: 500 12px/1.2 var(--font); color: #1f3a52;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff;
}
.show-station-labels .station-label { display: block; }

/* ---------- Panel typography ---------- */
.experience-hero, .workspace-head { display: grid; gap: 4px; }
.experience-kicker, .workspace-head small { font-size: 13px; font-weight: 600; color: var(--muted); }
.experience-hero h1, .experience-hero h2, .workspace-head h2 { font-size: 22px; line-height: 1.25; font-weight: 700; }
.experience-hero p, .workspace-head p { color: var(--muted); font-size: 14px; }
.section-heading, .today-radar-head, .passing-next-head, .commute-alert-head, .cool-control-head, .watch-heading, .cool-find-head, .layer-switch-heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 6px;
}
.section-heading small, .today-radar-head small, .passing-next-head small, .commute-alert-head small, .cool-control-head small, .watch-heading small, .discovery-section-head small {
  display: none;
}
.section-heading h2, .today-radar-head strong, .passing-next-head strong, .commute-alert-head strong, .cool-control-head strong, .watch-heading strong, .discovery-section-head h3 {
  display: block; font-size: 17px; font-weight: 600;
}
.layer-switch-heading span, .cool-find-head strong { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: none; }
.cool-find-head span { font-size: 13px; color: var(--muted); }
#clear-map { border: 0; background: transparent; color: var(--accent); font-weight: 600; font-size: 14px; padding: 4px 0; }
#clear-map:disabled { color: var(--muted); opacity: .6; }

/* Generic list rows */
.today-row, .rank-item, .cool-find-row, .cool-hero-hit, .nearby-summary-row, .useful-tool, .location-quick-action,
.live-context-card, .layer-toggle, .saved-place-row > button:first-child, .my-radar-row, .watch-row, .reading-row, .feed-row {
  width: 100%; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; text-align: left; color: var(--text);
}
.today-row:hover, .rank-item:hover, .cool-find-row:hover, .cool-hero-hit:hover, .useful-tool:hover, .location-quick-action:hover,
.live-context-card:hover, .layer-toggle:hover, .saved-place-row > button:first-child:hover { background: var(--subtle); }
.today-row > span:first-child, .useful-tool > b, .location-quick-action > span, .live-context-card > b, .ns-icon, .rank-icon {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 9px;
  background: var(--subtle); font-size: 17px; font-weight: 400;
}
.today-row > div, .useful-tool > span, .location-quick-action > div, .live-context-card > span, .layer-toggle > span,
.rank-copy, .cool-find-row > span:nth-child(2), .nearby-summary-row > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 1px; }
.today-row strong, .useful-tool strong, .location-quick-action strong, .live-context-card strong, .layer-toggle strong, .rank-copy strong, .cool-find-row strong, .nearby-summary-row strong {
  font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
}
.today-row small, .today-row p, .useful-tool small, .location-quick-action small, .live-context-card small, .layer-toggle small,
.rank-copy > span, .rank-proof, .cool-find-row small, .nearby-summary-row span span { font-size: 13px; color: var(--muted); }
.today-row small { font-weight: 600; color: var(--accent); }
.today-row > b, .location-quick-action > b, .cool-find-row > b { color: var(--line-strong); font-size: 20px; font-weight: 400; flex: none; }
.today-radar, .ranking, .cool-find-list, .nearby-summary, .my-radar-list, .watch-zones, .feed-status-compact { display: grid; }
.today-radar-head .mini-button, .passing-next-head .mini-button { min-height: 32px; }

/* Map tab */
.location-quick-actions { display: grid; }
.location-quick-action { min-height: 56px; }
.left-details > summary, .alert-options > summary, .my-radar-more > summary, .feed-diagnostics > summary {
  min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px;
}
.left-details > summary::after, .alert-options > summary::after, .my-radar-more > summary::after, .feed-diagnostics > summary::after {
  content: ""; width: 16px; height: 16px; flex: none; background: var(--muted); margin-left: auto;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
details[open] > summary::after { transform: rotate(180deg); }
.left-details[open] > summary, .alert-options[open] > summary, .my-radar-more[open] > summary { margin-bottom: 12px; }
.near-controls { display: grid; grid-template-columns: 1fr 96px; gap: 8px; }
.near-controls #near-clear { grid-column: 1 / -1; }
.useful-layer-switches .layer-switch-grid { display: grid; }
.layer-toggle > b, .live-context-card[data-layer-toggle] > b { display: none; }
.layer-toggle > em, .live-context-card > em {
  flex: none; position: relative; width: 46px; height: 28px; border-radius: 14px; background: var(--line-strong);
  font-size: 0; transition: background .15s;
}
.layer-toggle > em::after, .live-context-card > em::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff;
  transition: transform .15s;
}
.layer-toggle[aria-pressed="true"] > em, .live-context-card[aria-pressed="true"] > em { background: var(--accent); }
.layer-toggle[aria-pressed="true"] > em::after, .live-context-card[aria-pressed="true"] > em::after { transform: translateX(18px); }
.useful-tool-grid { display: grid; }
.useful-tool[aria-pressed="true"] > b, .useful-tool.active > b { background: var(--accent-soft); color: var(--accent); }
.control-grid { display: grid; gap: 6px; margin-bottom: 14px; }
.control-grid label { font-size: 13px; font-weight: 600; color: var(--muted); }
.nearby-summary-row b { font-size: 17px; font-weight: 600; }

/* Discover tab */
.cool-inner-nav, .board-tabs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px;
  background: var(--subtle); border-radius: var(--radius);
}
.cool-inner-tab, .board-tabs button {
  min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: 500;
}
.cool-inner-tab > span, .cool-inner-tab > small { display: none; }
.cool-inner-tab.active, .board-tabs button.active, .board-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(18, 22, 26, .08); }
.cool-view { display: none; flex-direction: column; gap: 20px; }
.cool-view.active { display: flex; }
.discovery-now-status { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.discovery-status-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 15px; border: 0; background: var(--subtle); color: var(--text); font-size: 13px; }
.discovery-status-chip b { font-weight: 700; }
.discovery-status-chip.collection { border: 1px solid var(--line); background: var(--surface); }
.cool-scoreboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.cool-scoreboard > div { padding: 10px 12px; display: grid; gap: 2px; }
.cool-scoreboard > div + div { border-left: 1px solid var(--line); }
.cool-scoreboard strong { font-size: 20px; font-weight: 700; }
.cool-scoreboard small { font-size: 12px; color: var(--muted); }
.cool-mini-icon { display: none; }
.cool-hero-hit { min-height: 64px; }
.cool-hero-hit > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cool-hero-hit small { font-size: 12px; font-weight: 600; color: var(--accent); }
.cool-hero-hit strong { font-size: 16px; font-weight: 600; }
.cool-hero-hit p, .cool-hero-hit span:not(.cool-badge):not(.cool-badge *) { font-size: 13px; color: var(--muted); }
.cool-preview-note, .resource-note { font-size: 13px; color: var(--muted); padding: 8px 0; }
.cool-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px;
  background: var(--subtle); color: var(--text); font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; vertical-align: middle;
}
.cool-badge b { font-weight: 400; font-size: 12px; }
.cool-badge em { font-style: normal; }
.cool-badge.cool-rail, .cool-badge.cool-steam { background: #f4e6f3; color: #6e2c6b; }
.cool-badge.cool-air { background: #e3eefa; color: #1f5fa8; }
.cool-badge.cool-rescue, .cool-badge.cool-sea, .cool-badge.cool-naval { background: #fbebdd; color: #8f4310; }
.discovery-new-tag, .interest-match { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.cool-map-controls { display: grid; gap: 10px; }
.cool-map-switch { min-height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.cool-map-switch span { color: var(--line-strong); }
.cool-map-switch:not(.active) span { color: #1e9e6a; }
.cool-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cool-filter {
  min-width: 0; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden;
}
.cool-filter > span:last-child { min-width: 0; display: grid; }
.cool-filter strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.cool-filter small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.cool-filter.active { border-color: var(--accent); background: var(--accent-soft); }
.cool-filter-icon { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--subtle); font-size: 13px; }
.cool-subfilter-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.cool-subfilter { min-height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.cool-subfilter.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); }
.stats-grid article { padding: 10px; display: grid; gap: 2px; }
.stats-grid article + article { border-left: 1px solid var(--line); }
.stats-grid span { font-size: 12px; color: var(--muted); }
.stats-grid strong { font-size: 18px; font-weight: 700; }
.rank-item { gap: 10px; }
.rank-number { display: none; }
.rank-item.selected { background: var(--accent-soft); }
.rank-count { flex: none; font-size: 12px; color: var(--muted); }
.cool-rank-item .rank-count { color: var(--good); font-weight: 700; }
.field-guide-progress { display: grid; gap: 8px; }
.field-guide-meter, .mission-meter { height: 6px; border-radius: 3px; background: var(--subtle); overflow: hidden; }
.field-guide-meter i, .mission-meter i { display: block; height: 100%; background: var(--accent); }
.interest-picker { display: grid; gap: 8px; }
.interest-picker small { display: block; color: var(--muted); }
.interest-chips, .my-radar-interests { display: flex; flex-wrap: wrap; gap: 6px; }
.interest-chips button, .my-radar-interests button, .my-radar-interests label {
  min-height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line); background: var(--surface); font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.interest-chips button[aria-pressed="true"], .interest-chips button.active, .my-radar-interests button[aria-pressed="true"], .my-radar-interests .active { background: var(--accent); border-color: var(--accent); color: #fff; }
.field-guide-grid { display: grid; gap: 10px; }
.field-guide-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 6px; }
.field-guide-card.discovered { border-color: var(--accent); }
.field-guide-card-head { display: flex; align-items: center; gap: 10px; }
.field-guide-card-head > div { flex: 1; min-width: 0; display: grid; }
.field-guide-card-head small { font-size: 11px; font-weight: 600; color: var(--muted); }
.field-guide-card-head strong { font-size: 15px; }
.field-guide-card-head > b { font-size: 11px; font-weight: 700; color: var(--muted); }
.field-guide-card.discovered .field-guide-card-head > b { color: var(--accent); }
.field-guide-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--subtle); }
.field-guide-card p, .field-guide-hint, .field-guide-safety, .field-guide-truth, .mission-safety { font-size: 13px; color: var(--muted); }
.field-guide-proof { display: flex; flex-wrap: wrap; gap: 4px; }
.field-guide-proof span { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--subtle); }

/* Saved tab */
.my-radar-step, .passing-next-card, .commute-alert-card { display: grid; gap: 8px; }
.saved-place-row { display: flex; align-items: center; gap: 4px; }
.saved-place-row > button:first-child { flex: 1; }
.saved-place-row > button:first-child b { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--subtle); flex: none; font-weight: 400; }
.saved-place-row > button:first-child span { display: grid; min-width: 0; }
.saved-place-row > button:first-child small { color: var(--muted); }
.saved-place-row > button[data-remove-place], .watch-delete { width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); font-size: 20px; border-radius: 8px; flex: none; }
.saved-place-row > button[data-remove-place]:hover, .watch-delete:hover { background: var(--subtle); color: var(--bad); }
.my-radar-add-place { margin-top: 10px; width: 100%; }
.passing-next { display: grid; }
.passing-next-loading { color: var(--muted); font-size: 14px; }
.commute-alert-card > p { font-size: 14px; color: var(--muted); }
#commute-alert-state { font-size: 12px; font-weight: 700; color: var(--muted); }
.commute-alert-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.commute-alert-form label { display: grid; gap: 4px; }
.commute-alert-form label span { font-size: 13px; font-weight: 600; color: var(--muted); }
.alert-interest-head { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.commute-alert-actions { display: flex; gap: 8px; }
.commute-alert-actions .primary-button { flex: 1; }
#commute-alert-note { color: var(--muted); }
.my-area-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* More tab */
.live-context-actions { display: grid; }
.health-badge { margin-left: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--subtle); color: var(--muted); }
.health-badge.good, .health-badge.live { background: var(--good-soft); color: var(--good); }
.health-badge.warn, .health-badge.degraded, .health-badge.starting { background: var(--warn-soft); color: var(--warn); }
.health-badge.bad, .health-badge.down { background: var(--bad-soft); color: var(--bad); }
.health-summary { display: grid; gap: 6px; font-size: 14px; margin-bottom: 12px; }
.health-row, .health-mini { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.health-chip { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--subtle); }
.feed-group { display: grid; margin-bottom: 12px; }
.feed-group-title { font-size: 12px; font-weight: 600; color: var(--muted); margin: 8px 0 2px; }
.feed-row { align-items: flex-start; min-height: 0; }
.feed-icon { width: 24px; flex: none; text-align: center; }
.feed-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.feed-copy strong { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.feed-copy p, .feed-freshness { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.feed-mode { font-size: 11px; color: var(--muted); margin-left: auto; }
.status-led { width: 8px; height: 8px; border-radius: 4px; background: #9aa3ad; flex: none; }
.status-led.on, .status-led.live, .status-led.ready { background: #1e9e6a; }
.status-led.error, .status-led.offline { background: var(--bad); }
.status-led.stale, .status-led.sync, .status-led.warn { background: #d4a017; }
.product-panel, .feedback-panel, .analytics-preferences { display: grid; gap: 8px; }
.product-summary, .feedback-panel p, .analytics-preferences p { font-size: 14px; color: var(--muted); }
.product-panel .plus-button, .feedback-link { justify-self: start; }
.more-links { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.more-links a { color: var(--muted); text-decoration: none; }
.more-links a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Detail panel ---------- */
.detail-sidebar {
  position: fixed; z-index: 1050; top: 0; right: 0; bottom: 0; width: var(--col);
  background: var(--surface); border-left: 1px solid var(--line); overflow: auto; overscroll-behavior: contain;
}
.detail-sidebar.is-empty { display: none; }
/* Desktop: the map makes room for the detail column on the right. */
.layout:has(.detail-sidebar:not(.is-empty):not(.route-view)) .map-panel { right: var(--col); }
body:has(.detail-sidebar:not(.is-empty):not(.route-view)) #radar-plus,
body:has(.detail-sidebar:not(.is-empty):not(.route-view)) #recenter { right: calc(var(--col) + 12px); }
.detail-sidebar.route-view { top: 12px; right: 12px; width: calc(var(--col) - 24px); border: 1px solid var(--line); border-radius: 12px; }
.detail-panel { padding: 16px 20px 28px; display: grid; gap: 14px; }
.detail-head { display: flex; align-items: flex-start; gap: 10px; }
.detail-head > div:first-child { flex: 1; min-width: 0; }
.detail-head small { display: block; font-size: 12px; font-weight: 600; color: var(--good); margin-bottom: 2px; }
.detail-head small:empty { display: none; }
.detail-head small { color: var(--warn); }
.detail-head h2 { font-size: 21px; line-height: 1.25; font-weight: 700; overflow-wrap: anywhere; }
.detail-head h2 .cool-badge { margin-right: 4px; vertical-align: 3px; }
.detail-head-actions { display: flex; gap: 6px; flex: none; }
.detail-close, .detail-back, .dialog-close {
  width: 36px; height: 36px; border-radius: 18px; border: 0; background: var(--subtle); color: var(--text);
  display: grid; place-items: center; font-size: 22px; line-height: 1;
}
.detail-close:hover, .detail-back:hover, .dialog-close:hover { background: var(--line); }
.detail-route-view { height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.detail-route-view svg { width: 16px; height: 16px; }
#detail-subtitle { color: var(--muted); font-size: 15px; margin-top: -8px; }
.detail-operator { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.detail-operator > i { width: 12px; height: 12px; border-radius: 3px; background: var(--operator-primary, var(--muted)); flex: none; }
.detail-operator > span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.detail-operator small { display: none; }
.detail-operator strong { font-weight: 600; }
.detail-operator b { font-weight: 400; color: var(--muted); }
.detail-photo img { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius); display: block; }
.detail-photo figure { margin: 0; }
.detail-photo figcaption, .detail-photo small, .image-truth { font-size: 12px; color: var(--muted); }
.detail-photo-copy { display: grid; gap: 4px; padding: 12px 14px; background: var(--subtle); border-radius: var(--radius); font-size: 14px; }
.photo-loading { font-size: 13px; color: var(--muted); }
.detail-insight, .detail-discovery, .detail-trail {
  padding: 12px 14px; background: var(--subtle); border-radius: var(--radius); display: grid; gap: 4px; font-size: 14px;
}
.detail-insight strong, .detail-discovery strong, .detail-trail strong { font-size: 14px; font-weight: 600; }
.detail-insight span, .detail-trail span, .detail-trail small { color: var(--muted); font-size: 13px; }
.detail-insight.aircraft-live-card { padding: 14px; gap: 12px; background: var(--surface); border: 1px solid var(--line); }
.aircraft-live-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.aircraft-live-head small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.aircraft-live-head span { padding: 3px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.aircraft-live-now { display: grid; grid-template-columns: 52px minmax(0,1fr); align-items: center; gap: 12px; }
.aircraft-live-now > div:last-child { display: grid; gap: 3px; }
.aircraft-live-now small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.aircraft-live-now strong { font-size: 15px; line-height: 1.42; }
.aircraft-direction { width: 52px; height: 52px; position: relative; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--subtle); }
.aircraft-direction span { position: absolute; top: 3px; color: var(--muted); font-size: 9px; font-weight: 700; }
.aircraft-direction svg { width: 27px; height: 27px; color: var(--accent); transform-origin: center; }
.aircraft-direction path { fill: currentColor; }
.aircraft-live-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.aircraft-live-tags b { padding: 4px 8px; border-radius: 999px; background: var(--subtle); color: var(--text); font-size: 12px; font-weight: 650; }
.aircraft-live-tags b[data-alert="true"] { background: var(--bad-soft); color: var(--bad); }
.aircraft-story-list { display: grid; border-top: 1px solid var(--line); }
.aircraft-story-list > div { padding: 9px 0; display: grid; gap: 2px; border-bottom: 1px solid var(--line); }
.aircraft-story-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
.aircraft-story-list strong { font-size: 12px; }
.aircraft-story-list span { color: var(--muted); font-size: 13px; line-height: 1.42; }
.aircraft-why { padding-top: 10px; display: grid; gap: 3px; border-top: 1px solid var(--line); }
.aircraft-why strong { font-size: 13px; }
.aircraft-why span { color: var(--muted); font-size: 13px; }
.detail-insight.train-live-card { padding: 14px; gap: 12px; background: var(--surface); border: 1px solid var(--line); }
.train-live-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.train-live-head small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.train-live-head span { overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.train-live-now { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 12px; }
.train-live-now > div:last-child { display: grid; gap: 3px; }
.train-live-now small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.train-live-now strong { font-size: 15px; line-height: 1.42; }
.train-story-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--rail); color: #fff; }
.train-story-icon svg { width: 25px; height: 25px; }
.train-live-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.train-live-tags b { padding: 4px 8px; border-radius: 999px; background: var(--subtle); color: var(--text); font-size: 12px; font-weight: 650; }
.train-live-tags b[data-tone="good"] { background: var(--good-soft); color: var(--good); }
.train-live-tags b[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); }
.train-live-tags b[data-tone="bad"] { background: var(--bad-soft); color: var(--bad); }
.train-story-list { display: grid; border-top: 1px solid var(--line); }
.train-story-list > div { padding: 9px 0; display: grid; gap: 2px; border-bottom: 1px solid var(--line); }
.train-story-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.train-story-list strong { font-size: 12px; }
.train-story-list span { color: var(--muted); font-size: 13px; line-height: 1.42; }
.detail-discovery button { margin-top: 6px; }
.detail-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.detail-field { padding: 10px 12px; display: grid; gap: 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.detail-field:nth-child(odd) { border-right: 1px solid var(--line); }
.detail-field span { font-size: 12px; color: var(--muted); }
.detail-field strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.detail-field.is-technical { display: none; }
.detail-panel.show-technical .detail-field.is-technical { display: grid; }
.detail-fields:empty { display: none; }
.detail-tech-toggle { justify-self: start; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-actions > * { flex: 1 1 auto; }
.detail-actions .primary-button { flex: 1 1 auto; }
/* Train panel follows the agreed design: who and where, three facts, the
   actions, then the stops. */
.detail-panel.is-train > * { order: 6; }
.detail-panel.is-train > .detail-head { order: 0; }
.detail-panel.is-train > #detail-subtitle { order: 1; }
.detail-panel.is-train > .detail-operator { order: 2; }
.detail-panel.is-train > .detail-fields { order: 3; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-panel.is-train > .detail-actions { order: 4; }
.detail-panel.is-train > .detail-intelligence { order: 5; }
.detail-panel.is-train .detail-field { border-right: 1px solid var(--line); }
.detail-panel.is-train .detail-field:nth-child(3n) { border-right: 0; }
.detail-related, .detail-coverage { display: grid; gap: 8px; font-size: 14px; }
.related-list { display: grid; }
.related-summary { color: var(--muted); font-size: 13px; }
.detail-related button, .related-list button { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; padding: 6px 0; }
.coverage-loading { color: var(--muted); font-size: 13px; }
.coverage-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.coverage-link, .coverage-article { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.detail-route-peek { display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 8px; overflow: hidden; }
.detail-route-restore { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; padding: 0 6px; }
.detail-route-restore span { display: grid; min-width: 0; }
.detail-route-restore strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.25; }
.detail-route-restore small { color: var(--muted); font-size: 12px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-route-fit { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.detail-route-peek-close { width: 36px; height: 36px; border-radius: 18px; border: 0; background: var(--subtle); font-size: 20px; }
.detail-sidebar.route-view { bottom: auto; }
.detail-sidebar.route-view .detail-panel { display: none; }

/* Station and stop boards */
.detail-placeboard { display: grid; gap: 10px; }
.board-heading, .board-mast { display: grid; gap: 2px; }
.board-heading small, .board-mast small { color: var(--muted); font-size: 13px; }
.station-live-snapshot { display: grid; gap: 8px; padding: 12px 0 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.station-stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.station-stat-grid > div { display: grid; align-content: start; gap: 1px; min-width: 0; }
.station-stat-grid strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.station-stat-grid span { color: var(--muted); font-size: 10px; line-height: 1.25; }
.station-status-chart { height: 8px; display: flex; overflow: hidden; border-radius: 999px; background: var(--line); }
.station-status-chart i { min-width: 3px; height: 100%; }
.station-status-chart .good { background: var(--good); }.station-status-chart .late { background: var(--warn); }.station-status-chart .bad { background: var(--bad); }
.station-status-legend { margin: -4px 0 0; color: var(--muted); font-size: 11px; }
.station-destinations { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.station-destinations b { width: 100%; font-size: 11px; }
.station-destinations span,.station-destinations em { padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 10px; font-style: normal; }
.station-live-snapshot > small { color: var(--muted); font-size: 10px; }
.board-waiting { color: var(--muted); font-size: 14px; }
.board-row {
  width: 100%; min-height: 56px; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left;
}
.board-clickable:hover { background: var(--subtle); }
.board-time { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.board-main { display: grid; min-width: 0; }
.board-main strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-main > span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.board-live-link { font-style: normal; color: var(--accent); font-weight: 600; margin-left: 6px; }
.board-status { font-size: 13px; color: var(--muted); text-align: right; }
.board-secondary { font-size: 13px; color: var(--muted); }

/* Journey intelligence inside the detail panel */
.detail-intelligence { display: grid; gap: 10px; }
.detail-intelligence > small, .rail-intelligence-shell > small { font-size: 13px; font-weight: 600; color: var(--muted); }
.rail-intelligence-shell { display: grid; gap: 10px; }
.transport-run-card { display: grid; gap: 8px; min-width: 0; }
.transport-run-card h4, .transport-route-head strong { font-size: 16px; font-weight: 600; }
.transport-route-head { display: grid; gap: 2px; }
.transport-route-head span, .transport-facts, .transport-service-label { font-size: 13px; color: var(--muted); }
.transport-facts { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.transport-stops { list-style: none; margin: 0; padding: 0; display: grid; }
.transport-stops li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 42px; position: relative; }
.transport-stops li > i { width: 10px; height: 10px; border-radius: 5px; border: 2px solid var(--accent); background: var(--surface); justify-self: center; position: relative; z-index: 1; }
.transport-stops li::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.transport-stops li:first-child::before { top: 50%; }
.transport-stops li:last-child::before { bottom: 50%; }
.transport-stops li.passed > i { border-color: var(--line-strong); background: var(--line-strong); }
.transport-stops li.next > i { background: var(--accent); }
.transport-stops li.passed { color: var(--muted); }
.transport-stops li.next strong { font-weight: 700; }
.transport-stops li > span { display: grid; min-width: 0; }
.transport-stops li strong { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.transport-stops li small { font-size: 12px; color: var(--muted); }
.transport-stops li > b { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
/* Live train timeline: where the train is, and its expected times. */
.train-punctuality { justify-self: start; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.train-punctuality.is-late { background: var(--bad-soft); color: var(--bad); }
.train-punctuality.is-early, .train-punctuality.is-on-time { background: var(--good-soft); color: var(--good); }
.transport-stops b { display: grid; justify-items: end; line-height: 1.25; }
.stop-late { font-style: normal; font-weight: 700; color: var(--bad); }
.train-full-route.has-progress { --line: #1f3a52; }
.train-full-route.has-progress li { grid-template-columns: 24px minmax(0, 1fr) auto; min-height: 50px; }
.train-full-route.has-progress li::before { left: 10px; width: 4px; background: #1f3a52; }
.train-full-route.has-progress li.passed::before, .train-full-route.has-progress li.passed + li.train-here::before { background: #9aa8b5; }
.train-full-route.has-progress li > i { width: 12px; height: 4px; border: 0; border-radius: 0; background: #1f3a52; justify-self: start; margin-left: 12px; }
.train-full-route.has-progress li.passed > i { background: #9aa8b5; }
.train-full-route.has-progress li.passed strong, .train-full-route.has-progress li.passed b { color: var(--muted); }
.train-full-route.has-progress li:last-child > i { width: 18px; height: 18px; margin-left: 3px; border-radius: 2px; background: #1f3a52; box-shadow: inset 0 0 0 4px #1f3a52, inset 0 0 0 10px #fff6c8; }
.train-full-route.has-progress li.current > i, .train-full-route.has-progress li.train-here > i {
  width: 22px; height: 22px; margin-left: 1px; border-radius: 50%; background: #3f9b83; border: 3px solid #1f3a52;
}
.train-full-route.has-progress li.train-here { min-height: 32px; }
.train-full-route.has-progress li.train-here small { font-size: 12px; font-weight: 600; color: #2f7d69; }
.train-full-route.has-progress li.current strong { font-weight: 700; }
.train-full-route.has-progress li.next strong { font-weight: 600; }
.transport-unavailable, .transport-empty { padding: 12px 14px; border-radius: var(--radius); background: var(--subtle); display: grid; gap: 2px; font-size: 14px; }
.transport-unavailable span, .transport-empty span { color: var(--muted); font-size: 13px; }
.radar-plus-locked strong { color: var(--text); }
.transport-note, .transport-source, .resource-note { font-size: 12px; color: var(--muted); }
.train-service-identity { font-size: 13px; color: var(--muted); }
.train-full-route { font-size: 13px; }
.rolling-stock-card { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); position: relative; overflow: hidden; }
.rolling-stock-stripe { display: flex; height: 4px; margin: -12px -14px 6px; }
.rolling-stock-stripe i { flex: 1; background: var(--livery-primary, var(--rail)); }
.rolling-stock-stripe i:nth-child(2) { background: var(--livery-accent, var(--line)); }
.rolling-stock-stripe i:nth-child(3) { background: var(--livery-ink, var(--line-strong)); }
.rolling-stock-card > small { font-size: 12px; font-weight: 600; color: var(--muted); }
.rolling-stock-card > strong { font-size: 16px; }
.rolling-stock-livery { font-size: 13px; font-weight: 500; color: var(--muted); }
.rolling-stock-card dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
.rolling-stock-card dt { font-size: 12px; color: var(--muted); }
.rolling-stock-card dd { margin: 0; font-size: 14px; font-weight: 500; }
.rolling-stock-card p, .rolling-stock-card a { font-size: 12px; color: var(--muted); }
.motorway-sign-card { display: grid; gap: 8px; }
.camera-live-media img, .camera-live-media video { width: 100%; border-radius: var(--radius); display: block; }
.camera-unavailable { font-size: 13px; color: var(--muted); }
.show-nearest-camera { justify-self: start; }

/* ---------- Dialogs and consent ---------- */
dialog { border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--text); max-width: min(560px, calc(100vw - 24px)); width: 100%; max-height: calc(100vh - 48px); overflow: auto; box-shadow: 0 20px 50px rgba(18, 22, 26, .2); }
dialog::backdrop { background: rgba(18, 22, 26, .4); }
.plus-shell, .journey-shell { padding: 20px; display: grid; gap: 16px; }
.plus-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.plus-head small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.plus-head h2 { font-size: 21px; font-weight: 700; }
.plus-intro, .plus-note { color: var(--muted); font-size: 14px; }
.plan-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; min-width: 0; }
.plan-card.highlight { border-color: var(--accent); }
.plan-card h3 { font-size: 17px; }
.plan-card p, .plan-card li { font-size: 14px; color: var(--muted); }
.plan-card ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.preview-access { display: grid; gap: 6px; }
.preview-access label { font-size: 13px; font-weight: 600; color: var(--muted); }
.preview-access div { display: flex; gap: 6px; min-width: 0; }
.preview-access input { flex: 1 1 auto; min-width: 0; width: 100%; }
.preview-access button { min-height: 44px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.journey-dialog { max-width: min(680px, calc(100vw - 24px)); }
.journey-shell { gap: 20px; }
.journey-head small { letter-spacing: .12em; }
.journey-head h2 { margin-top: 3px; font-size: 24px; line-height: 1.2; }
.journey-form { display: grid; gap: 14px; }
.journey-places { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 0 10px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.journey-places label { grid-column: 2 / -1; display: grid; gap: 3px; min-width: 0; }
.journey-places label:first-of-type { grid-column: 2; }
.journey-form label span { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.journey-places input { min-height: 42px; padding: 0; border: 0; border-radius: 0; font-size: 16px; background: transparent; }
.journey-places input:focus { outline: 0; }
.journey-place-line { grid-column: 1; grid-row: 1 / span 3; align-self: stretch; position: relative; }
.journey-place-line::before, .journey-place-line::after { content: ""; position: absolute; left: 6px; width: 8px; height: 8px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface); }
.journey-place-line::before { top: 24px; }
.journey-place-line::after { bottom: 18px; background: var(--accent); }
.journey-place-line { background: linear-gradient(var(--line-strong),var(--line-strong)) 9px 34px / 2px calc(100% - 60px) no-repeat; }
.journey-use-location { grid-column: 3; grid-row: 1; min-height: 40px; padding: 0 8px; border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; }
.journey-swap { position: absolute; right: 12px; top: calc(50% - 22px); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 2px 8px rgba(18,22,26,.08); }
.journey-swap svg { width: 18px; height: 18px; }
.journey-places label:last-of-type { padding-top: 8px; padding-right: 50px; border-top: 1px solid var(--line); }
.journey-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.journey-mode { display: grid; gap: 4px; min-width: 0; }
.journey-mode-fixed { align-content: center; padding: 7px 12px; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--subtle); }
.journey-mode-fixed span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.journey-mode-fixed strong { font-size: 14px; }
.journey-submit { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.journey-submit svg { width: 18px; height: 18px; }
.journey-results { display: grid; gap: 12px; min-width: 0; }
.journey-empty, .journey-loading, .journey-unavailable { min-height: 86px; padding: 18px; border-radius: 14px; background: var(--subtle); display: grid; align-content: center; gap: 4px; font-size: 15px; }
.journey-empty span, .journey-unavailable span { color: var(--muted); font-size: 14px; }
.journey-options { display: grid; gap: 10px; }
.journey-option { padding: 16px; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 12px; background: var(--surface); }
.journey-option:first-child { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 3px 14px rgba(18,22,26,.06); }
.journey-option-head, .journey-result-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.journey-option-head > div { display: grid; gap: 3px; }
.journey-option-head small { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.journey-option-head strong { font-size: 17px; }
.journey-option-head > b { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.journey-summary-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.journey-summary-facts span { padding: 5px 8px; border-radius: 999px; background: var(--subtle); color: var(--muted); font-size: 12px; font-weight: 600; }
.journey-steps { border-top: 1px solid var(--line); }
.journey-steps summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.journey-steps summary::after { content: "+"; font-size: 20px; font-weight: 400; }
.journey-steps[open] summary::after { content: "−"; }
.journey-legs { display: grid; gap: 0; padding: 0 0 4px; }
.journey-leg { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.journey-leg > div { display: grid; gap: 2px; min-width: 0; }
.journey-leg > div span, .journey-leg > div small { color: var(--muted); overflow-wrap: anywhere; }
.journey-leg > b { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.journey-leg-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--subtle); color: var(--accent); }
.journey-truth, .journey-issues, .journey-resolution, .journey-directions, .journey-traffic, .journey-walk { font-size: 13px; color: var(--muted); }
.journey-option-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.journey-show-map { min-height: 40px; }
.aircraft-photo-loading { min-height: 220px; width: 100%; display: grid; place-items: center; align-content: center; gap: 10px; background: var(--subtle); border-radius: var(--radius); }
.aircraft-photo-loading i { width: 26px; height: 26px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .aircraft-photo-loading i { animation: none; } }
.analytics-consent {
  position: fixed; z-index: 1400; left: 12px; right: 12px; bottom: 12px; max-width: 560px; margin: 0 auto;
  display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(18, 22, 26, .15);
}
.analytics-consent p { font-size: 14px; color: var(--muted); }
.analytics-consent > div:last-child { display: flex; gap: 8px; justify-content: flex-end; }
.inline-link { color: var(--accent); }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .topbar {
    width: auto; right: 0; height: auto; padding: 12px; border: 0; background: transparent; pointer-events: none;
  }
  .topbar > * { pointer-events: auto; }
  .brand { display: contents; }
  .brand-mark { display: none; }
  body:has(#workspace-shell:not(.collapsed)) #recenter, body:has(.detail-sidebar:not(.is-empty)) #recenter,
  body:has(#workspace-shell:not(.collapsed)) .map-controls, body:has(.detail-sidebar:not(.is-empty)) .map-controls,
  body:has(#workspace-shell:not(.collapsed)) .nearby-bar, body:has(.detail-sidebar:not(.is-empty)) .nearby-bar { display: none; }
  .search-wrap { background: var(--surface); height: 48px; border-radius: 12px; }
  .search-go { display: none; }
  .search-results { top: 54px; }
  #mode-pill, body:has(#workspace-shell.collapsed) #mode-pill {
    left: auto; right: 28px; top: 32px; bottom: auto; width: 8px; height: 8px; padding: 0; gap: 0;
    border: 0; background: transparent; font-size: 0; z-index: 1150;
  }
  .search-wrap input { padding-right: 24px; }
  #radar-plus { display: none; }
  #install-app { position: fixed; top: 76px; right: 12px; }

  .map-panel { left: 0 !important; }
  .layer-chips, .layout:has(#workspace-shell.collapsed) .layer-chips, .layout.focus-mode .layer-chips { top: 72px; left: 0; right: 0; padding: 0 12px 2px; }
  .focus-map-button, .live-ticker, .map-legend, .leaflet-control-zoom { display: none !important; }
  .map-controls { right: 12px; bottom: calc(var(--nav-h) + 12px + 56px + 12px + 52px); }
  #recenter { bottom: calc(var(--nav-h) + 12px + 56px + 12px); }
  .traffic-legend { bottom: calc(var(--nav-h) + 84px); right: 68px; }
  .leaflet-control-attribution { margin-bottom: calc(var(--nav-h) + 80px) !important; }
  .bus-zoom-note, .watch-toast { top: 124px; max-width: calc(100% - 24px); padding: 8px 12px; font-size: 13px; line-height: 1.3; }
  .nearby-note { top: 172px; }
  .journey-route-clear { top: 124px; }

  .nearby-bar {
    position: absolute; z-index: 820; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 12px);
    min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 8px 14px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-align: left;
  }
  .nearby-bar > span { flex: 1; min-width: 0; display: grid; }
  .nearby-bar small { color: var(--muted); }
  .nearby-bar strong { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nearby-bar svg { color: var(--muted); }

  /* Bottom tab bar; panels open above it. */
  .leftbar {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; height: auto; max-height: 100%;
    flex-direction: column-reverse; border: 0; background: transparent; z-index: 1000; pointer-events: none;
  }
  .leftbar > * { pointer-events: auto; }
  .workspace-rail {
    height: var(--nav-h); padding: 0 0 env(safe-area-inset-bottom); gap: 0;
    border-top: 1px solid var(--line); border-bottom: 0;
  }
  .workspace-tab { flex-direction: column; gap: 3px; font-size: 12px; border-bottom: 0; padding: 6px 0 0; }
  .workspace-tab.active { border-bottom: 0; }
  .rail-symbol svg { width: 22px; height: 22px; }
  .workspace-collapse { display: none; }
  .workspace-drawer { flex: 1 1 auto; background: var(--surface); }
  /* Map tab: a sheet over the map. Other tabs: full screen pages. */
  body[data-experience="useful"] .workspace-drawer, body:not([data-experience]) .workspace-drawer {
    max-height: 55dvh; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0;
  }
  body[data-experience="cool"] .leftbar:not(.collapsed), body[data-experience="live"] .leftbar:not(.collapsed), body[data-experience="settings"] .leftbar:not(.collapsed) {
    top: 0; z-index: 1200;
  }
  .workspace-panel { padding: 16px 16px 24px; gap: 18px; }
  .useful-hero { display: none; }
  .layout:has(#workspace-shell.collapsed) .leftbar { top: auto; left: 0; bottom: 0; width: auto; border: 0; border-radius: 0; }
  body:has(#workspace-shell.collapsed) .topbar { top: 0; left: 0; width: auto; height: auto; border: 0; border-radius: 0; }

  /* Detail: full-width sheet above the tab bar. */
  .detail-sidebar {
    top: auto; left: 0; right: 0; bottom: var(--nav-h); width: auto; max-height: 55dvh; z-index: 1250;
    border: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0;
  }
  .layout:has(.detail-sidebar:not(.is-empty):not(.route-view)) .map-panel { right: 0; }
  body:has(.detail-sidebar:not(.is-empty):not(.route-view)) #recenter { right: 12px; }
  .detail-sidebar::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; }
  .detail-panel { padding: 8px 16px 24px; }
  .detail-sidebar.route-view { top: auto; bottom: calc(var(--nav-h) + 8px); left: 8px; right: 8px; width: auto; border: 1px solid var(--line); border-radius: 12px; max-height: none; }
  .detail-sidebar.route-view::before { display: none; }
  .detail-route-peek { padding: 0 6px; }
  .plan-cards { grid-template-columns: 1fr; }
  dialog { max-height: calc(100dvh - 24px); }
  .journey-dialog { width: 100%; max-width: none; max-height: calc(100dvh - 12px); margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .journey-shell { padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
  .journey-head h2 { font-size: 21px; }
  .journey-actions { grid-template-columns: 1fr; }
  .journey-submit { width: 100%; }
  .journey-result-head { align-items: baseline; }
  .journey-result-head > span { white-space: nowrap; }
  .journey-option-head { display: grid; }
  .journey-option-head > b { grid-row: 1; grid-column: 2; justify-self: end; }
}

/* ---------- Icons ---------- */
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.marker-bubble { color: #fff; }
.marker-bubble > span { display: grid; place-items: center; }
.marker-bubble .ico { width: 16px; height: 16px; }
.cool-map-marker > span { display: grid; place-items: center; }
.cool-map-marker .ico { width: 15px; height: 15px; }
.camera-map-marker { display: grid; place-items: center; color: #fff; }
.camera-map-marker .ico { width: 14px; height: 14px; }
.journey-issue-icon span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--road); color: #fff; }
.journey-issue-icon .ico { width: 16px; height: 16px; }
.cool-badge b { display: inline-grid; place-items: center; }
.cool-badge .ico { width: 13px; height: 13px; }
.tooltip-top strong .ico { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
.feed-icon { display: grid; place-items: center; color: var(--muted); }
.feed-icon .ico, .interest-chips .ico, .my-radar-interests .ico { width: 15px; height: 15px; }
.search-result-icon .ico, .field-guide-icon .ico, .cool-filter-icon .ico { width: 17px; height: 17px; }
.journey-leg-icon .ico { width: 16px; height: 16px; }
.ticker-item .ico { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; color: var(--muted); }
.cool-filter-icon.air, .field-guide-icon.air { color: #1f5fa8; }
.cool-filter-icon.rail, .field-guide-icon.rail { color: #6e2c6b; }
.cool-filter-icon.rescue, .field-guide-icon.rescue, .field-guide-icon.sea { color: #8f4310; }

/* ---------- Station and stop boards (v2) ---------- */
.board-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--subtle); }
.board-switch button { min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.board-switch button[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(18, 22, 26, .08); }
.board-list { display: grid; }
.board-list[hidden] { display: none; }
.board-heading { font-size: 13px; font-weight: 600; color: var(--muted); }
.board-row { grid-template-columns: 52px minmax(0, 1fr) auto; min-height: 58px; padding: 10px 0; }
.board-time { font-size: 16px; font-weight: 700; }
.board-main strong { font-size: 15px; font-weight: 600; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.25; }
.board-main strong small { font-size: 13px; font-weight: 400; color: var(--muted); }
.board-main > span { white-space: nowrap; }
.board-status { font-size: 14px; font-weight: 600; color: var(--muted); min-width: 0; }
.board-status.is-good { color: var(--good); }
.board-status.is-late, .board-status.is-bad { color: var(--bad); }
.board-row.is-live .board-main strong::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 4px; background: #1e9e6a; vertical-align: 2px; }

/* ---------- Discover, simplified ---------- */
/* One category switch and one list. Status chips, the category scoreboard,
   the totals box and the duplicate ranking list are not shown. */
.cool-view[data-cool-view-panel="now"] .discovery-now-status,
.cool-view[data-cool-view-panel="now"] .cool-scoreboard,
.cool-view[data-cool-view-panel="now"] .cool-stats,
.cool-view[data-cool-view-panel="now"] .cool-ranking,
.cool-preview-note { display: none !important; }
.cool-view[data-cool-view-panel="now"].active { gap: 14px; }
.cool-view[data-cool-view-panel="now"] .cool-map-controls { order: 1; gap: 8px; }
.cool-view[data-cool-view-panel="now"] .cool-subfilter-bar { order: 2; }
.cool-view[data-cool-view-panel="now"] .cool-summary { order: 3; }
.cool-control-head { justify-content: flex-end; margin: 0; }
.cool-control-head > div { display: none; }
.cool-map-controls .cool-filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 4px;
  border-radius: var(--radius); background: var(--subtle);
}
.cool-map-controls .cool-filter {
  min-height: 36px; padding: 0 4px; justify-content: center; border: 0; border-radius: 8px; background: transparent;
}
.cool-map-controls .cool-filter .cool-filter-icon, .cool-map-controls .cool-filter small { display: none; }
.cool-map-controls .cool-filter strong { font-size: 14px; font-weight: 500; color: var(--muted); }
.cool-map-controls .cool-filter.active { background: var(--surface); box-shadow: 0 1px 2px rgba(18, 22, 26, .08); }
.cool-map-controls .cool-filter.active strong { color: var(--text); font-weight: 600; }
.cool-find-head strong { text-transform: none; }

/* The desktop ticker repeated names already in the lists. */
.live-ticker { display: none !important; }
.cool-map-controls .cool-filter .layer-count { display: none; }
.cool-view[data-cool-view-panel="now"] .cool-map-controls { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.cool-map-controls .cool-control-head { grid-column: 2; grid-row: 1; }
.cool-map-controls .cool-filter-grid { grid-column: 1; grid-row: 1; }
.cool-map-switch { min-height: 36px; white-space: nowrap; }

/* Train punctuality: a small dot on the marker's corner. */
.train-punctuality { position: absolute; top: -5px; right: -5px; width: 11px; height: 11px; border-radius: 6px; border: 2px solid #fff; }
.train-punctuality.is-on-time { background: #1e9e6a; }
.train-punctuality.is-late { background: #d4a017; }
.train-punctuality.is-very-late { background: #d64545; }

/* ---- Cancellations and platform changes ---- */
.marker-bubble.is-cancelled { background: #8a919c !important; opacity: .85; }
.marker-bubble.is-cancelled::after { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 2px; background: #fff; transform: rotate(-35deg); border-radius: 1px; }
.board-row.is-cancelled .board-time, .board-row.is-cancelled .board-main strong { text-decoration: line-through; color: var(--muted, #6b7280); }
.platform-changed { font-weight: 700; color: #9a5b00; background: #fff4dc; border-radius: 4px; padding: 0 4px; }
.train-full-route li.is-cancelled strong, .train-full-route li.is-cancelled b { text-decoration: line-through; color: var(--muted, #6b7280); }
.stop-cancelled { font-style: normal; font-weight: 700; color: var(--bad); }
.train-cancelled-banner { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 700; }
.train-cancelled-banner .ico { width: 18px; height: 18px; flex: none; }

/* ---- Line view and delays ---- */
.layer-chip.hidden { display: none !important; }
.layer-chip-delays[aria-pressed="true"] { background: #d64545 !important; border-color: #d64545 !important; color: #fff !important; }
.line-view { display: grid; gap: 10px; }
.line-ends { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 600; color: var(--muted, #6b7280); }
.line-ends i { flex: 1; height: 3px; border-radius: 2px; background: #0b63ce; }
.line-trains { display: grid; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; overflow: hidden; }
.line-train { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-top: 1px solid var(--line, #e5e7eb); background: transparent; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.line-train:first-child { border-top: 0; }
.line-train:hover { background: var(--subtle, #f5f6f8); }
.line-train span { display: grid; min-width: 0; }
.line-train strong { font-size: 15px; }
.line-train small { color: var(--muted, #6b7280); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-train > b { font-size: 13px; font-weight: 700; color: var(--muted, #6b7280); }
.line-train > b.is-on-time { color: #1e7a54; }
.line-train > b.is-late { color: #9a6b00; }
.line-train > b.is-very-late, .line-train > b.is-bad { color: var(--bad); }
.line-dot { width: 10px; height: 10px; border-radius: 50%; background: #9aa3ad; }
.line-dot.is-on-time { background: #1e9e6a; }
.line-dot.is-late { background: #d4a017; }
.line-dot.is-very-late, .line-dot.is-bad { background: #d64545; }
.detail-insight:has(> .line-view), .detail-insight:has(> .line-trains), .detail-insight:has(> .transport-empty) { background: transparent; border: 0; padding: 0; box-shadow: none; }
.line-train strong { color: var(--ink, #111827); }

/* ---- Alignment pass ---- */
/* The title block always takes the free width, so the close button sits at
   the right edge whatever the title length (a hidden back button comes first
   in the header, which defeated :first-child). */
.detail-head > div:not(.detail-head-actions) { flex: 1 1 auto; min-width: 0; }
.detail-head-actions { margin-left: auto; align-self: flex-start; }
.detail-back { flex: none; }

/* Train facts: one row of equal cells with no empty cell, whether two or
   three facts are known. Hairlines come from the gap, not per-cell borders. */
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field { flex: 1 1 28%; border: 0 !important; background: var(--surface); }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field.is-technical { display: none; }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic).show-technical > .detail-fields > .detail-field.is-technical { display: grid; }

/* Map chips: fade the last chip when the row scrolls, so a cut-off chip
   reads as "more this way" rather than broken. */
.layer-chips { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); padding-right: 28px; }

/* One rhythm for every list in the panel: boards, stops, line view. */
.board-row, .line-train { min-height: 56px; padding-left: 12px; padding-right: 12px; }
.line-train strong, .board-main strong { font-size: 15px; line-height: 1.3; }
.line-train small, .board-main > span { font-size: 13px; line-height: 1.35; }
/* The Map tab already says "Map": keep its page heading for screen readers
   and search engines, but do not spend the top of the panel repeating it. */
.useful-hero { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Nearby limit: a pill with its own close button, not a box over the map. */
.nearby-note { display: inline-flex; align-items: center; gap: 6px; padding: 4px 4px 4px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; box-shadow: 0 1px 4px rgba(16,24,40,.16); }
.nearby-note.hidden { display: none; }
.nearby-note-close { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--subtle, #f2f4f7); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
@media (max-width: 760px) {
  /* Below the layer chips and the options row, not on top of it. */
  .nearby-note { top: 166px; font-size: 13px; }
  .bus-zoom-note, .watch-toast { top: 168px; }
}

/* ---- Compact train facts: one line of small chips, not big boxes ---- */
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields { display: flex; flex-wrap: wrap; gap: 6px; background: none; border: 0; border-radius: 0; overflow: visible; }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field { flex: none; display: inline-flex; align-items: baseline; gap: 5px; padding: 5px 10px; border: 0 !important; border-radius: 999px; background: var(--subtle, #f2f4f7); }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field.is-technical { display: none; }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic).show-technical > .detail-fields > .detail-field.is-technical { display: inline-flex; }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field span { font-size: 12px; }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field strong { font-size: 13px; font-weight: 700; }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field[data-field="Status"] span { display: none; }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field[data-tone="good"] { background: var(--good-soft, #e7f6ee); }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field[data-tone="good"] strong { color: var(--good, #1e7a54); }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field[data-tone="warn"] { background: #fff4dc; }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field[data-tone="warn"] strong { color: #9a5b00; }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field[data-tone="bad"] { background: var(--bad-soft); }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field[data-tone="bad"] strong { color: var(--bad); }

/* ---- Shared stop list: earlier stops and bus lateness ---- */
.transport-stops li.is-earlier { display: none; }
.transport-stops.earlier-open li.is-earlier { display: grid; }
.transport-stops li.earlier-toggle { display: block; list-style: none; padding: 0 0 6px; }
.transport-stops li.earlier-toggle::before, .transport-stops li.earlier-toggle::after { display: none !important; }
.earlier-toggle button { border: 0; background: none; padding: 4px 0; color: var(--accent, #0b63ce); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.transport-route-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; }
.transport-route-head strong { font-size: 15px; }
.transport-route-head span { color: var(--muted); font-size: 13px; }
.bus-lateness { font-style: normal; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.bus-lateness.is-good { background: var(--good-soft, #e7f6ee); color: var(--good, #1e7a54); }
.bus-lateness.is-warn { background: #fff4dc; color: #9a5b00; }
.bus-lateness.is-bad { background: var(--bad-soft); color: var(--bad); }

/* ---- Wording and feature clean-up ---- */
[hidden] { display: none !important; }
.count-badge.hidden { display: none; }
/* The Saved tab: until a place is saved, only the way to add one. */
[data-workspace-panel="live"]:not(.has-saved-places) .passing-next-card,
[data-workspace-panel="live"]:not(.has-saved-places):not(.has-saved-trains) .commute-alert-card,
[data-workspace-panel="live"]:not(.has-saved-places) .my-radar-step:has(#my-radar-area) { display: none; }
#detail-subtitle:empty { display: none; }

/* ---- Discover: one plain row per find ---- */
.discover-list { display: grid; }
.discover-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 12px; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.discover-row:hover { background: var(--subtle, #f5f6f8); }
.discover-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #e8f0fb; color: #0b63ce; }
.discover-icon .ico { width: 20px; height: 20px; }
.discover-icon.cool-rail, .discover-icon.cool-steam { background: #f4e9f3; color: #7b2d70; }
.discover-icon.cool-rescue, .discover-icon.cool-sea, .discover-icon.cool-naval { background: #fdeee6; color: #b4471b; }
.discover-text { display: grid; gap: 2px; min-width: 0; }
.discover-text strong { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discover-text small { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discover-text i { font-style: normal; font-size: 12px; color: var(--muted); }
.discover-text .find-new { font-style: normal; font-weight: 700; color: #1e7a54; }
.discover-row > b { color: var(--muted); font-weight: 400; }
.cool-find-list { display: contents; }
/* The first find uses the same row as the rest. */
.discover-row.cool-hero-hit, .discover-row.cool-find-row { display: grid; min-height: 0; padding: 12px 0; }
.discover-row.cool-hero-hit .discover-text strong { font-size: 15px; font-weight: 700; color: var(--text); }
.discover-row.cool-hero-hit .discover-text small { font-size: 13px; font-weight: 400; color: var(--text); }
.discover-row.cool-hero-hit .discover-icon { font-size: inherit; }
.discover-row .discover-icon { color: #0b63ce; }
.discover-row .discover-icon.cool-rail, .discover-row .discover-icon.cool-steam { color: #7b2d70; }
.discover-row .discover-icon.cool-rescue, .discover-row .discover-icon.cool-sea, .discover-row .discover-icon.cool-naval { color: #b4471b; }
.discover-row.cool-hero-hit span.discover-icon { color: #0b63ce !important; font-size: inherit; }
.discover-row.cool-hero-hit span.discover-icon.cool-rail, .discover-row.cool-hero-hit span.discover-icon.cool-steam { color: #7b2d70 !important; }
.discover-row.cool-hero-hit span.discover-icon.cool-rescue, .discover-row.cool-hero-hit span.discover-icon.cool-sea, .discover-row.cool-hero-hit span.discover-icon.cool-naval { color: #b4471b !important; }
.discover-row.cool-hero-hit span.discover-text { font-size: inherit; color: inherit; }

/* ---- Quick answers bar: four everyday jobs, one tap each ---- */
.jobs-bar { position: absolute; z-index: 820; left: 50%; bottom: 16px; transform: translateX(-50%); display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(16, 24, 40, .14); width: min(460px, calc(100% - 24px)); }
.jobs-bar button { display: grid; justify-items: center; gap: 3px; padding: 7px 2px; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.jobs-bar button:hover, .jobs-bar button:focus-visible { background: var(--subtle, #f2f4f7); }
.jobs-bar .ico { width: 22px; height: 22px; color: var(--accent, #0b63ce); }
.live-ticker { display: none !important; }
@media (max-width: 760px) {
  .nearby-bar { display: none !important; }
  .jobs-bar { left: 12px; right: 12px; width: auto; transform: none; bottom: calc(var(--nav-h) + 12px); }
  body:has(#workspace-shell:not(.collapsed)) .jobs-bar, body:has(.detail-sidebar:not(.is-empty)) .jobs-bar { display: none; }
}
.job-station { margin-top: 4px; justify-self: start; }

/* Why is my train late? */
.delay-why { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: #fff4dc; color: #5c3b00; font-size: 14px; line-height: 1.4; }
.delay-why strong { display: block; margin-bottom: 2px; color: #3d2800; }

/* Journey: is anything in the way? */
.journey-issue-summary { display: flex; gap: 10px; align-items: flex-start; padding: 12px; margin-bottom: 12px; border-radius: 12px; }
.journey-issue-summary .ico { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.journey-issue-summary span { display: grid; gap: 2px; }
.journey-issue-summary small { color: inherit; opacity: .85; }
.journey-issue-summary.has-issues { background: var(--bad-soft); color: var(--bad); }
.journey-issue-summary.is-clear { background: var(--good-soft, #e7f6ee); color: var(--good, #1e7a54); }

.traffic-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--subtle, #f2f4f7); font-size: 14px; line-height: 1.45; }
/* Incidents and roadworks: what it means first, the road camera after. */
.detail-panel.is-traffic > * { order: 6; }
.detail-panel.is-traffic > .detail-head { order: 0; }
.detail-panel.is-traffic > #detail-subtitle { order: 1; }
.detail-panel.is-traffic > .detail-fields { order: 2; }
.detail-panel.is-traffic > .detail-insight { order: 3; }
.detail-panel.is-traffic > .detail-photo { order: 4; }
.detail-panel.is-traffic > .detail-photo img, .detail-panel.is-traffic > .detail-photo video { max-height: 180px; object-fit: cover; }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field { max-width: 100%; flex-wrap: wrap; border-radius: 14px; }
.detail-panel:is(.is-train,.is-bus,.is-aircraft,.is-traffic) > .detail-fields > .detail-field strong { white-space: normal; overflow-wrap: anywhere; }

/* ---- One control row: quick answers first, then layer switches ---- */
.jobs-bar { display: none !important; }
.layer-chip.job-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.layer-chip.job-chip .ico { width: 18px; height: 18px; color: var(--accent, #0b63ce); }
.chip-divider { flex: none; width: 1px; height: 24px; align-self: center; margin: 0 2px; background: var(--line-strong, #c9cfd6); }
@media (max-width: 760px) {
  /* No answer bar above the tabs any more: the locate button and credits sit lower. */
  #recenter { bottom: calc(var(--nav-h) + 16px); }
  .map-controls { bottom: calc(var(--nav-h) + 16px + 56px); }
  .leaflet-control-attribution { margin-bottom: calc(var(--nav-h) + 4px) !important; }
}
@media (max-width: 760px) { .layer-chip { height: 40px; } }
@media (max-width: 760px) {
  .layer-chips { gap: 6px; }
  .layer-chip.job-chip { padding: 0 11px; font-size: 13.5px; gap: 5px; }
}
@media (max-width: 760px) {
  .layer-chip.job-chip { padding: 0 9px; font-size: 13px; gap: 4px; }
  .layer-chip.job-chip .ico { width: 16px; height: 16px; }
}

/* Near you: the four everyday answers at the top of the Map panel. */
.near-you { display: grid; }
.near-you-head { padding: 0 0 6px; font-size: 16px; }
.near-you .job-row { width: 100%; }

/* Second chip row: options for the layer switched on last. */
.sub-chips {
  position: absolute; z-index: 799; top: 56px; left: 12px; right: 140px;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 0 28px 2px 0;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
}
.sub-chips::-webkit-scrollbar { display: none; }
.sub-chips .layer-chip.sub-chip { height: 32px; padding: 0 12px; font-size: 13px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.sub-chips .layer-chip.sub-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sub-chips .layer-chip-delays[aria-pressed="true"] { background: #d64545 !important; border-color: #d64545 !important; color: #fff !important; }
.layout:has(#workspace-shell.collapsed) .sub-chips { left: var(--col); }
.layout.focus-mode .sub-chips { display: none !important; }
@media (max-width: 760px) {
  .sub-chips { top: 120px; left: 0; right: 0; padding: 0 40px 2px 12px; }
  .layout:has(#workspace-shell.collapsed) .sub-chips { left: 0; }
  .sub-chips .layer-chip.sub-chip { height: 34px; }
}

/* Alerts for saved trains alone: no place to choose, so no place form. */
[data-workspace-panel="live"]:not(.has-saved-places) .commute-alert-card :is(.commute-alert-main, .alert-options) { display: none; }
.my-radar-row > span { display: grid; gap: 2px; min-width: 0; text-align: left; }

.delay-why.special-why { background: #eef3ff; color: #1d3470; }
.delay-why.special-why strong { color: #12265a; }

/* Yours: saved stations, stops and trains, answered above "Near you". */
.yours { display: grid; margin-bottom: 14px; }
.yours.hidden { display: none; }
.yours .job-row { width: 100%; }
.yours-list { display: grid; }
.yours-row small.is-late { color: #a15c00; font-weight: 600; }
.yours-row small.is-bad { color: var(--bad); font-weight: 600; }

/* Line status: one row per operator, late trains underneath when opened. */
.line-status-row + .line-status-row { border-top: 1px solid var(--line); }
.line-status-row > .line-train { width: 100%; }
.line-status-worst { padding: 0 0 8px 22px; }
.line-status-worst .line-train { min-height: 44px; width: 100%; }

/* Spotter alerts card at the top of Discover. */
.spotter-card { display: grid; gap: 8px; padding: 14px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; }
.spotter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.spotter-head span { font-size: 12px; font-weight: 700; color: var(--muted); }
.spotter-head span.active { color: #1e9e6a; }
.spotter-card p { margin: 0; font-size: 14px; color: var(--muted); }
.spotter-actions { display: flex; gap: 8px; }
.spotter-actions select { flex: 1; min-width: 0; }

/* Journey watch: under the "anything in the way?" banner. */
.journey-watch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; }
.journey-watch > span { display: grid; gap: 2px; flex: 1 1 200px; min-width: 0; }
.journey-watch small { color: var(--muted); font-size: 13px; }
.journey-watch label { font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.journey-watch input[type="time"] { height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

/* Leave now: in the train panel, above the stops. */
.leave-plan { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.leave-plan > summary { cursor: pointer; font-weight: 600; }
.leave-plan-form { display: grid; gap: 10px; padding-top: 10px; }
.leave-plan-form label { display: grid; gap: 4px; }
.leave-plan-form label > span { font-size: 13px; color: var(--muted); }
.leave-plan-form input { height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
p.leave-plan.is-set { display: flex; align-items: center; gap: 10px; background: #eaf7f0; border-color: #bfe5d2; }
p.leave-plan.is-set > span { display: grid; gap: 2px; flex: 1; }
p.leave-plan.is-set small { color: #2f5e49; }

.usual-platform { color: var(--muted); font-style: italic; }
.usual-platform small { font-style: normal; }

/* Point at the sky. */
.sky-pointer { display: grid; gap: 8px; }
.sky-direction { margin: 0; font-size: 22px; font-weight: 700; }
.sky-found { margin: 0; color: #1e7a54; font-weight: 600; }
.sky-match { width: 100%; border: 1px solid var(--line); border-radius: 12px; }

/* Camera view: live labels over the camera picture. */
.ar-view { position: fixed; inset: 0; z-index: 5000; background: #000; overflow: hidden; }
.ar-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ar-labels { position: absolute; inset: 0; }
.ar-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 12px; color: #fff; font-weight: 700; font-size: 17px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
#ar-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 26px; line-height: 1; }
.ar-hint { position: absolute; left: 14px; right: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; text-align: center; }
.ar-label { position: absolute; transform: translate(-50%, -50%); display: grid; grid-template-columns: 30px minmax(0,1fr) auto; align-items: center; gap: 8px; width: min(270px, calc(100vw - 28px)); min-height: 50px; padding: 7px 10px 7px 7px; border: 2px solid rgba(255,255,255,.94); border-radius: 18px; background: rgba(15,20,28,.88); box-shadow: 0 6px 20px rgba(0,0,0,.32); color: #fff; text-align: left; font: inherit; backdrop-filter: blur(8px); }
.ar-label i { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: #0b63ce; }
.ar-label.ar-train i { background: #7b2d70; } .ar-label.ar-bus i { background: #0f7a55; }
.ar-label i svg { width: 18px; height: 18px; stroke: #fff; }
.ar-label span { display: grid; min-width: 0; }
.ar-label strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-label small { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-label span em { color: rgba(255,255,255,.72); font-size: 11px; font-style: normal; white-space: normal; line-height: 1.25; }
.ar-label > b { padding: 5px 7px; border-radius: 9px; background: rgba(255,255,255,.14); font-size: 12px; line-height: 1; white-space: nowrap; }
body.ar-open { overflow: hidden; }

.ar-kinds { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); display: flex; justify-content: center; gap: 8px; }
.ar-kinds button { height: 38px; padding: 0 14px; border: 1px solid rgba(255,255,255,.7); border-radius: 19px; background: rgba(0,0,0,.55); color: #fff; font: inherit; font-size: 14px; font-weight: 600; }
.ar-kinds button[aria-pressed="true"] { background: #fff; color: #10151c; border-color: #fff; }

/* The page never pinch-zooms; the map handles its own pinch. */
html, body { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; }

/* Alerts: an unmissable on/off statement. */
.commute-alert-summary { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: #eaf7f0; border: 1px solid #bfe5d2; font-size: 14px; }
.commute-alert-summary.is-off { background: var(--subtle, #f2f4f7); border-color: var(--line); }
.commute-alert-summary strong { font-size: 16px; }
.commute-alert-summary ul { margin: 2px 0 0; padding-left: 18px; display: grid; gap: 2px; }
#commute-alert-note.is-problem { padding: 10px 12px; border-radius: 10px; background: #fdecec; color: #8a1f1f; font-weight: 600; }
#commute-alert-state.active { color: #1e9e6a; }

/* Saved places: the chosen one drives the departures and alerts below. */
.saved-place-row.is-chosen > button:first-child { background: #eef4ff; border-radius: 10px; }
.saved-place-map { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; height: 36px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); font: inherit; font-size: 13px; color: var(--text); }
.saved-place-map svg { width: 16px; height: 16px; }
.passing-next-label { padding: 4px 0 6px; font-size: 14px; color: var(--muted); }
.passing-next-label b { color: var(--text); }
.my-radar-saved.is-away strong { color: var(--muted); }
.my-radar-saved > .my-radar-row { flex: 1; min-width: 0; }

/* Camera view: a close button that is easy to hit. */
.ar-top { z-index: 3; }
#ar-close { width: auto; min-width: 96px; height: 48px; padding: 0 16px; border-radius: 24px; font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; touch-action: manipulation; }
#ar-close span { font-size: 24px; line-height: 1; }
.ar-labels { z-index: 1; } .ar-kinds, .ar-hint { z-index: 2; }
.saved-place-row > button[data-unsave] { width: 40px; height: 40px; border: 0; background: transparent; color: var(--muted); font-size: 20px; border-radius: 8px; flex: none; }
.commute-alert-actions { flex-wrap: wrap; }
.commute-alert-actions .primary-button { flex: 1 1 100%; }
.commute-alert-actions .mini-button { flex: 1; height: 44px; }

/* Phone: the locate button sits above the map credits, not on top of them. */
@media (max-width: 760px) {
  #recenter { bottom: calc(var(--nav-h) + 34px); }
  .map-controls { bottom: calc(var(--nav-h) + 34px + 56px); }
}

/* iPhone home bar: the tab bar grows by the height of the home bar, so the
   icons and labels sit above it, and everything placed above the tab bar
   (locate button, credits, sheets) moves up with it. */
@media (max-width: 760px) {
  :root { --nav-h: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .workspace-rail { box-sizing: border-box; height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); }
}

/* Rain radar key: time, colour scale and credit, above the map's bottom edge. */
.radar-key { position: absolute; z-index: 790; left: 12px; bottom: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; max-width: calc(100% - 96px); padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.94); box-shadow: 0 1px 4px rgba(16,24,40,.16); font-size: 12px; color: var(--text); }
.radar-key #radar-time { font-weight: 700; font-size: 13px; }
.radar-scale { display: inline-flex; height: 10px; border-radius: 3px; overflow: hidden; }
.radar-scale i { width: 14px; height: 10px; }
.radar-key small { color: var(--muted); }
.radar-key a { color: var(--muted); font-size: 11px; }
@media (max-width: 760px) { .radar-key { bottom: calc(var(--nav-h) + 34px); left: 12px; max-width: calc(100% - 92px); } }

/* Radar+: monthly and yearly side by side, and the trial said up front. */
.plus-buttons { display: grid; gap: 8px; }
.plus-trial { margin: 4px 0 8px; font-size: 14px; color: #1e7a54; font-weight: 600; }

/* "Alerts need Radar on your Home Screen" (iPhone and iPad in Safari). */
.install-hint { display: grid; gap: 4px; margin: 8px 0; padding: 12px 14px; border-radius: 12px; background: #eef3ff; border: 1px solid #c9d6f5; color: #1d3470; font-size: 14px; line-height: 1.4; }
.install-hint[hidden] { display: none; }
.install-hint strong { font-size: 15px; color: #12265a; }
.plus-install-note { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.journey-watch .install-hint { flex: 1 1 100%; margin: 0; }
.leave-plan .install-hint { margin: 10px 0 0; }

.cool-preview-note { display: block; width: 100%; margin: 12px 0 4px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: none; color: var(--accent, #0b63ce); font: inherit; font-weight: 600; text-align: center; cursor: pointer; }

.spotter-kinds { display: grid; gap: 6px; margin: 2px 0 4px; padding: 0; border: 0; }
.spotter-kinds legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.spotter-kinds label { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 15px; }
.spotter-kinds input { width: 20px; height: 20px; accent-color: var(--accent, #0b63ce); flex: none; }

/* Radar+ labels on paid features, shown only to visitors without Radar+
   once it can be bought. */
[data-plus].needs-plus strong::after,
strong[data-plus].needs-plus::after,
.layer-chip[data-plus].needs-plus::after,
.track-button[data-plus].needs-plus::after {
  content: "Radar+"; display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .02em; line-height: 16px; vertical-align: middle;
  color: #fff; background: linear-gradient(135deg, #1a73e8, #7b3fe4);
}
.plus-code-box { display: grid; gap: 4px; margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2, #f3f5f8); text-align: center; }
.plus-code-box strong { font-size: 28px; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.plus-code-box small, .plus-have small, .plus-have p { color: var(--muted, #5f6b7a); font-size: 13px; line-height: 1.4; }
.plus-have { margin-top: 12px; }
.plus-have summary { cursor: pointer; font-weight: 600; }
.plus-have p { margin: 8px 0; }
#radar-plus-link button { white-space: nowrap; }

.detail-usually{margin:6px 0 0;font-size:13px;color:var(--muted,#5f6b7a)}

.place-page-link{display:block;margin:8px 0;font-weight:600;color:var(--accent,#0b6bcb);text-decoration:none;}
.airport-page-link{display:inline-block;text-decoration:none;padding:10px 14px;}

.browse-links{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.browse-links li{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:10px 0;border-bottom:1px solid var(--line,#e5e7eb)}
.browse-links a{font-weight:600;color:var(--text,#111);text-decoration:none}
.browse-links small{color:var(--muted,#5f6b7a);text-align:right}

.airport-group{display:flex;justify-content:space-between;margin:12px 0 4px;font-size:13px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#5f6b7a)}
.airport-group span{font-weight:700;color:var(--text,#111)}
.airport-panel-note{margin-top:10px;font-size:12px;color:var(--muted,#5f6b7a)}
.airport-runways{margin:4px 0 12px;padding:10px 12px;border-radius:10px;background:var(--surface-2,#eef3f8);font-size:14px;line-height:1.4}.airport-runways strong{display:block;font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted,#5f6b7a);margin-bottom:2px}

/* Station board footer: one sentence, destinations, then Save + Station page. */
.station-headline { margin: 0; font-weight: 700; font-size: 15px; }
.station-headline.is-good { color: var(--good); }
.station-headline.is-late { color: #a15c00; }
.station-headline.is-bad { color: var(--bad); }
.station-destinations b { font-size: 12px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.station-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.station-actions .station-save, .station-actions .station-page-button { display: grid; place-items: center; min-height: 44px; border-radius: 12px; font-weight: 700; font-size: 15px; text-decoration: none; }
.station-actions .station-save { border: 1px solid var(--line); background: var(--surface, #fff); color: var(--text); }
.station-actions .station-save.is-saved { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.station-actions .station-page-button { background: var(--accent, #0b6bcb); color: #fff; }
/* Freight: what it carries and how heavy, from the working timetable. */
.freight-card { display: grid; gap: 10px; margin: 0 0 12px; }
.freight-cargo { justify-self: start; padding: 5px 12px; border-radius: 999px; background: var(--text); color: var(--surface, #fff); font-size: 14px; }
.freight-card dl { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; }
.freight-card dl div { display: grid; }
.freight-card dd { order: 1; margin: 0; font-weight: 700; font-size: 17px; }
.freight-card dt { order: 2; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* Coach booking: one clear button, with who sells the ticket underneath. */
.coach-book { display: grid; gap: 6px; margin: 4px 0 14px; }
.coach-book .primary-button { display: grid; place-items: center; min-height: 44px; text-decoration: none; }
.coach-book small { color: var(--muted); font-size: 12px; }
/* Freight tab: a third board, rows marked with the freight rust. */
.board-switch.has-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.board-switch button small { margin-left: 3px; padding: 0 6px; border-radius: 999px; background: #b4531a; color: #fff; font-size: 11px; font-weight: 700; }
.board-note { margin: 8px 2px 4px; color: var(--muted); font-size: 12px; }
.board-row.board-freight { box-shadow: inset 3px 0 0 #b4531a; }
/* Delay Repay: a plain notice when a passenger train is 15+ min late. */
.delay-repay { display: grid; gap: 6px; margin: 0 0 12px; padding: 12px; border-radius: 12px; background: #fff4e5; border: 1px solid #f3c98b; }
.delay-repay strong { font-size: 15px; }
.delay-repay span { font-size: 13px; color: var(--muted); }
.delay-repay a { justify-self: start; padding: 8px 14px; border-radius: 10px; border: 1px solid #c98a2e; color: #8a4b00; font-weight: 700; text-decoration: none; background: #fff; }

/* Engineering works: replacement buses at this station this week. */
.engineering-notice { display: grid; gap: 4px; margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: #fff8e1; border: 1px solid #f1d27a; }
.engineering-notice strong { font-size: 14px; }
.engineering-notice ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 13px; }
.engineering-notice small { color: var(--muted); font-size: 11px; }

.fleet-link { margin: 10px 0 0; font-size: 14px; }
.fleet-link a { font-weight: 600; }

/* Camera view: freight in rust, trains heading your way ringed in yellow,
   and arrows at the screen edge for anything out of shot. */
.ar-label.ar-freight i { background: #b4531a; }
.ar-label.is-approaching { border-color: #ffd34e; box-shadow: 0 0 0 3px rgba(255,211,78,.35), 0 6px 20px rgba(0,0,0,.32); }
.ar-label em { color: #ffe28a; }
.ar-edge { position: absolute; display: flex; align-items: center; gap: 6px; max-width: 44vw; padding: 6px 10px; border-radius: 999px; background: rgba(15,20,28,.82); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.ar-edge span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ar-edge b { flex: none; font-size: 14px; }
.ar-edge-left { left: 8px; } .ar-edge-right { right: 8px; }
.ar-edge.is-approaching { background: rgba(122,84,0,.9); }

.brand-mark { background: none; overflow: hidden; }
.brand-mark img { width: 34px; height: 34px; display: block; }

.aircraft-drawer{position:absolute;right:0;top:170px;z-index:1100;display:flex;align-items:flex-start}
.aircraft-drawer[hidden]{display:none}
.aircraft-drawer-tab{writing-mode:vertical-rl;display:flex;align-items:center;gap:6px;padding:14px 8px;border:1px solid var(--line,#d6dde6);border-right:0;border-radius:12px 0 0 12px;background:var(--surface,#fff);color:inherit;font:inherit;font-size:13px;font-weight:600;box-shadow:0 2px 8px rgba(0,0,0,.12);cursor:pointer}
.aircraft-drawer-tab .ico{width:16px;height:16px;transform:rotate(90deg)}
.aircraft-drawer.is-filtering .aircraft-drawer-tab{background:var(--accent);border-color:var(--accent);color:var(--accent-ink,#fff)}
.aircraft-drawer-body{width:0;overflow:hidden;transition:width .2s ease;background:var(--surface,#fff);box-shadow:0 2px 12px rgba(0,0,0,.16);border-radius:12px 0 0 12px}
.aircraft-drawer.open .aircraft-drawer-body{width:210px}
.aircraft-drawer-inner{width:210px;box-sizing:border-box;padding:12px;display:flex;flex-direction:column;gap:14px;max-height:min(calc(100dvh - 380px),560px);overflow-y:auto;overscroll-behavior:contain}
.aircraft-drawer-inner section{display:flex;flex-direction:column;gap:6px}.aircraft-drawer-inner section[hidden]{display:none}
.aircraft-drawer-inner select{min-height:40px;border-radius:10px;border:1px solid var(--line,#d6dde6);background:var(--surface,#fff);color:inherit;font:inherit;font-size:14px;padding:0 8px}
.aircraft-drawer-inner strong{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted,#5f6b7a)}
.aircraft-drawer-inner button{min-height:40px;padding:0 12px;text-align:left;border-radius:10px;border:1px solid var(--line,#d6dde6);background:var(--surface,#fff);color:inherit;font:inherit;font-size:14px;cursor:pointer}
.aircraft-drawer-inner button[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:var(--accent-ink,#fff)}
@media (prefers-reduced-motion:reduce){.aircraft-drawer-body{transition:none}}
.engineering-stops{margin:6px 0 4px}.engineering-stops b{display:block;font-size:12px}.engineering-stops p{margin:2px 0;font-size:13px;line-height:1.4}.engineering-stops .link-button{border:0;background:none;padding:0;color:var(--accent,#1463d8);font:inherit;text-decoration:underline;cursor:pointer}

/* Drawn train: coaches in the operator's colours (trainFormationHtml). */
.train-formation { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface, #fff); }
.train-formation header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.train-formation header strong { font-size: 15px; }
.train-formation header span { font-size: 13px; color: var(--muted); }
.formation-row { display: grid; grid-template-columns: repeat(var(--coaches), minmax(0, 1fr)); gap: 2px; align-items: start; }
.formation-row .coach { display: grid; grid-template-rows: 15px 30px 18px; gap: 3px; justify-items: center; align-items: center; min-width: 0; }
.formation-row .coach > small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-height: 14px; }
.formation-row .coach-svg { width: 100%; height: 30px; display: block; }
.coach-marks { display: flex; gap: 3px; height: 18px; align-items: center; }
.coach-marks b { font-size: 10px; line-height: 1; padding: 2px 3px; border-radius: 3px; border: 1px solid var(--line); color: var(--ink, inherit); }
.coach-marks .coach-first { background: #f3d36b; border-color: #d6b23d; color: #3a2d00; }
.coach-marks .ico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.train-formation > p { margin: 0; font-size: 12px; color: var(--muted); }
.train-formation.is-typical .coach-svg { opacity: .85; }
.train-formation.is-freight .formation-row .coach, .train-formation.is-plain .formation-row .coach { grid-template-rows: 32px; }
.train-formation.is-freight .formation-row .coach > small, .train-formation.is-freight .coach-marks,
.train-formation.is-plain .formation-row .coach > small, .train-formation.is-plain .coach-marks { display: none; }
.train-formation.is-freight .coach-svg { height: 32px; }
.train-formation.is-freight .freight-profile-asset { display: block; width: 100%; height: 42px; object-fit: contain; object-position: center bottom; }
.train-formation.is-freight:has(.freight-profile-asset) .formation-row .coach { grid-template-rows: 42px; }
.train-formation.profile-class-390 .formation-row { gap: 0; }
.train-formation.profile-class-390 .coach-svg { height: 36px; }
.train-formation.profile-class-390 .formation-row .coach { grid-template-rows: 36px; }
.train-profile-stage { min-height: 58px; display: flex; align-items: center; overflow: hidden; }
.train-profile-stage img { display: block; width: 100%; height: auto; max-height: 92px; object-fit: contain; object-position: center; }

/* Generated profiles, one image per coach, with that coach's data under it. */
.profile-scroll { overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.profile-train { display: flex; align-items: flex-end; gap: 0; }
.profile-coach { margin: 0; display: grid; justify-items: center; min-width: 0; }
.profile-coach img { display: block; width: 100%; height: auto; }
.profile-train.is-labelled .profile-coach > small { font-size: 11px; font-weight: 600; color: var(--muted); line-height: 14px; min-height: 14px; }
.profile-train.is-labelled .profile-coach .coach-marks { display: flex; gap: 2px; height: 18px; align-items: center; justify-content: center; }
.profile-coach .coach-marks b { font-size: 9px; line-height: 1; padding: 2px 3px; border-radius: 3px; border: 1px solid var(--line); }
.profile-coach .coach-first { background: #f3d36b; border-color: #d6b23d; color: #3a2d00; }
.profile-coach .ico { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.formation-units { display: flex; gap: 6px; justify-content: center; margin: 0; }
.formation-units b { font-size: 13px; padding: 3px 14px; border: 1px solid var(--accent, #2a7f9e); border-radius: 6px; font-variant-numeric: tabular-nums; }

/* Official disruption messages on the station board. */
.station-notices { display: grid; gap: 6px; margin: 0 0 10px; }
.station-notices > strong { font-size: 13px; }
.station-notices ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.station-notices li { border-left: 4px solid #9aa5ae; background: var(--subtle, #f6f8f9); border-radius: 6px; padding: 7px 9px; font-size: 13px; display: grid; gap: 2px; }
.station-notices li.notice-minor, .station-notices li.notice-major { border-left-color: #d9822b; }
.station-notices li.notice-severe { border-left-color: #c0392b; }
.station-notices li b { font-size: 11px; color: var(--muted); font-weight: 600; }

/* National Rail's own status line under an operator on the line status board. */
.line-official { margin: -2px 0 6px 26px; font-size: 12px; color: var(--ink, inherit); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.line-official span { flex: 1 1 100%; border-left: 3px solid #d9822b; padding-left: 7px; }
.line-official a { font-weight: 600; }
/* Freight pictures at a readable height; a long train scrolls sideways. */
.train-formation.is-freight .formation-row { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; align-items: flex-end; }
.train-formation.is-freight .formation-row .coach { flex: 0 0 auto; grid-template-rows: auto; }
.train-formation.is-freight .freight-profile-asset { height: 36px; width: auto; max-width: none; }
.train-formation.is-freight .coach-svg { width: 96px; height: 36px; }
