/* Around My Station – light, natural theme. Colour is never the only carrier of meaning:
   every coloured mark also has a text label, pattern or tooltip. */
:root {
  color-scheme: light;
  --bg: #F6F4EE; --bg-2: #EFECE4; --panel: #FFFFFF; --panel-2: #FAF8F3; --line: #DCD6CA; --line-soft: #E9E4DA;
  --text: #1E2A2B; --text-2: #46524F; --muted: #6A746F;
  --accent: #2F6B4F; --accent-strong: #24553E; --on-accent: #FFFFFF; --accent-soft: rgba(47,107,79,0.10);
  /* series colours validated with the dataviz validator (light mode, surfaces #FFFFFF and #F6F4EE) */
  --terr: #1374A8; --btp: #C9592C; --btp-stripe: #EDB79F; --total: #7B8681;
  --terr-soft: rgba(19,116,168,0.10);
  --data: #C9592C; --danger: #B4462F; --danger-ink: #8E3524; --danger-soft: rgba(180,70,47,0.07);
  --ok: #3E8A5E; --ok-soft: rgba(62,138,94,0.10); --warn: #9A6410; --warn-soft: rgba(154,100,16,0.08);
  --header-bg: rgba(246,244,238,0.94); --map-bg: #E9E6DF; --stripe: #E4DED2;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(30,42,43,0.05), 0 4px 14px rgba(30,42,43,0.05);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'IBM Plex Sans', system-ui, sans-serif; font-size: 15px; line-height: 1.55; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 6px; z-index: 2000; }
.skip-link:focus { left: 8px; }
a { color: var(--accent-strong); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); font-weight: 400; }
.placeholder { color: var(--muted); margin: 0; }

/* ---- header / footer ---- */
.site-header { border-bottom: 1px solid var(--line-soft); background: var(--header-bg); backdrop-filter: blur(6px); }
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 60px; flex-wrap: wrap; }
.brand { color: var(--text); text-decoration: none; font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.brand-icon { width: 28px; height: 28px; display: block; flex: none; }
.topnav { display: flex; gap: 4px; }
.topnav a { color: var(--text-2); text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 14px; }
.topnav a:hover { background: var(--panel); color: var(--text); }
.topnav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.header-meta { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: right; line-height: 1.5; }
.site-footer { border-top: 1px solid var(--line-soft); margin-top: 40px; padding: 20px 0 32px; color: var(--muted); font-size: 12.5px; }

/* ---- hero & search ---- */
.hero { padding: 40px 0 8px; }
.hero h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; font-weight: 600; letter-spacing: -0.01em; }
.lede { color: var(--text-2); font-size: 16.5px; margin: 0 0 22px; max-width: 760px; }
.hero.compact { padding-top: 20px; }
.hero.compact h1, .hero.compact .lede { display: none; }
.search-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.combo { position: relative; flex: 1; min-width: 280px; }
.search-icon { position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -9px; border: 2px solid var(--muted); border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; width: 7px; height: 2px; background: var(--muted); right: -6px; bottom: -3px; transform: rotate(45deg); }
input[type="text"], input[type="number"], select {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text); padding: 11px 12px; border-radius: 8px; font-size: 15px; font-family: inherit; }
#stationInput { width: 100%; padding-left: 40px; font-size: 16px; }
#customRadius { width: 140px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.combo-list { position: absolute; z-index: 1000; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px 0; list-style: none;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; max-height: 420px; overflow-y: auto; box-shadow: var(--shadow); }
.combo-list li { padding: 10px 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--accent-soft); }
.combo-list .crs { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 8px; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.combo-list .where { display: block; color: var(--muted); font-size: 12.5px; }
.combo-list .meta { font-size: 12px; color: var(--muted); text-align: right; line-height: 1.5; }
.combo-list .empty { color: var(--muted); cursor: default; }
.start-guide { margin-top: 22px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps li { counter-increment: step; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px 14px 52px; position: relative; color: var(--text-2); }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 14px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--accent-strong); font-weight: 600; font-size: 13px; text-align: center; line-height: 22px; }
.steps strong { color: var(--text); }
.try { color: var(--muted); margin: 0; }
.chip { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13.5px;
  cursor: pointer; font-family: inherit; margin: 2px 4px 2px 0; }
.chip:hover { border-color: var(--accent); }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } .hero h1 { font-size: 24px; } }

/* ---- buttons & segmented controls ---- */
button, a.button { background: var(--accent); color: var(--on-accent); border: none; padding: 9px 16px; border-radius: 8px; font-weight: 600;
  font-size: 14px; cursor: pointer; font-family: inherit; white-space: nowrap; text-decoration: none; display: inline-block; }
button.secondary, a.button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.small, a.button.small { padding: 5px 10px; font-size: 12.5px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg-2); }
.seg-btn { background: transparent; color: var(--text-2); border-radius: 0; padding: 6px 12px; font-size: 13px; font-weight: 500; }
.seg-btn.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

/* ---- station header & section nav ---- */
.station-head { margin: 22px 0 14px; }
.station-title h2 { font-size: 28px; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.crs-tag { font-family: var(--mono); font-size: 14px; color: var(--text-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; vertical-align: middle; }
.station-sub { color: var(--text-2); margin: 4px 0 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.fact { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; }
.fact-num { display: block; font-family: var(--mono); font-size: 22px; color: var(--text); font-weight: 500; }
.fact-num.small { font-family: inherit; font-size: 15.5px; font-weight: 600; }
.fact-label { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.section-nav { position: sticky; top: 0; z-index: 900; display: flex; gap: 2px; overflow-x: auto; background: var(--header-bg);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line-soft); margin: 0 -24px 16px; padding: 8px 24px; }
.section-nav a { color: var(--text-2); text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 13.5px; white-space: nowrap; }
.section-nav a:hover { background: var(--panel); color: var(--text); }

/* ---- panels ---- */
section.panel, details.panel { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; background: var(--panel); box-shadow: var(--shadow); }
.panel h2 { font-size: 18px; margin: 0 0 6px; font-weight: 600; }
.panel h3 { font-size: 15px; margin: 0 0 8px; font-weight: 600; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.panel-head h2 { margin: 0; }
.explain { color: var(--text-2); margin: 0 0 14px; max-width: 80ch; }
.note { font-size: 13px; color: var(--muted); margin: 10px 0 0; line-height: 1.55; }
.source-line { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin: 12px 0 0; line-height: 1.6; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.two-col > * { min-width: 0; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } }

.key-panel { border-left: 3px solid var(--accent); }
.key-points { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 15.5px; color: var(--text); }
.key-points li::marker { color: var(--accent); }
.key-points strong { color: var(--text); font-weight: 600; }

/* ---- crime summary cards ---- */
.src-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 820px) { .src-grid { grid-template-columns: 1fr; } }
.src-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--panel-2); border-top: 3px solid var(--total); }
.src-card.territorial { border-top-color: var(--terr); }
.src-card.btp { border-top-color: var(--btp); }
.src-label { font-weight: 600; }
.src-sub { color: var(--muted); font-size: 13px; }
.src-num { font-family: var(--mono); font-size: 34px; font-weight: 500; margin-top: 6px; line-height: 1.1; }
.src-num.na { font-family: inherit; font-size: 18px; color: var(--warn); margin-top: 10px; }
.src-foot { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.src-card .reason { color: var(--text-2); font-size: 13px; margin-top: 6px; }
.src-card.unavail { background: repeating-linear-gradient(135deg, var(--panel-2) 0 10px, var(--bg-2) 10px 20px); }
.rate-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.rate-box .stat-grid { margin-top: 6px; }
details.how { margin-top: 14px; }
details summary { cursor: pointer; color: var(--accent-strong); font-size: 14px; }
details.panel > summary { color: var(--text); font-weight: 600; font-size: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .stat-grid.three { grid-template-columns: 1fr; } }
.stat .num { font-family: var(--mono); font-size: 26px; color: var(--text); font-weight: 500; }
.stat .num.text { font-family: inherit; font-size: 16px; }
.stat .label { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat.src-card .num { font-size: 26px; }
.stat.src-card.unavail .num.text { color: var(--warn); }
.info { display: inline-block; width: 16px; height: 16px; line-height: 15px; text-align: center; border-radius: 50%; border: 1px solid var(--muted);
  color: var(--muted); font-size: 10.5px; cursor: help; margin-left: 4px; font-family: var(--mono); font-weight: 400; vertical-align: 1px; }
.info:hover, .info:focus { color: var(--text); border-color: var(--text); }

/* ---- map ---- */
#map { height: 520px; border-radius: 8px; border: 1px solid var(--line); background: var(--map-bg); }
.map-note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--muted); align-items: center; }
.legend .swatch, .trend-legend .swatch { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 2px; }
.legend .ramp { display: inline-block; width: 90px; height: 10px; vertical-align: middle; margin: 0 6px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(19,116,168,0.15), rgba(19,116,168,0.75)); }
.leaflet-container { font-family: 'IBM Plex Sans', sans-serif; }
.leaflet-control-layers { background: var(--panel) !important; color: var(--text) !important; border: 1px solid var(--line) !important; }

/* ---- tables ---- */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
td.n, th.n { text-align: right; font-family: var(--mono); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }
.bar-cell { min-width: 150px; }
.cat-track { background: var(--bg); border-radius: 3px; height: 6px; overflow: hidden; margin-top: 6px; }
.cat-fill { background: var(--terr); height: 100%; }
.cat-fill.btp { background: var(--btp); }
.change-note { color: var(--muted); font-size: 11.5px; white-space: normal; max-width: 170px; margin-left: auto; line-height: 1.35; font-family: 'IBM Plex Sans', sans-serif; }

/* ---- trend chart (grouped, never stacked) ---- */
.trend-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.swatch.territorial { background: var(--terr); }
.swatch.btp { background: repeating-linear-gradient(45deg, var(--btp) 0 3px, var(--btp-stripe) 3px 5px); }
.swatch.missing { border: 1px dashed var(--muted); }
.swatch.partial { background: repeating-linear-gradient(45deg, var(--terr) 0 2px, transparent 2px 5px); border: 1px solid var(--terr); }
.trend-chart.grouped { display: flex; align-items: stretch; gap: 3px; height: 180px; margin-bottom: 4px; overflow-x: auto; }
.tgroup { flex: 1; min-width: 18px; display: flex; flex-direction: column; }
.tbars { flex: 1; display: flex; align-items: flex-end; gap: 1px; }
.tbar { flex: 1; border-radius: 2px 2px 0 0; min-height: 2px; }
.tbar.territorial { background: var(--terr); }
.tbar.btp { background: repeating-linear-gradient(45deg, var(--btp) 0 3px, var(--btp-stripe) 3px 5px); }
.tbar.partial { opacity: 0.55; }
.tbar.missing { background: transparent !important; border: 1px dashed var(--line); }
.trend-label { font-size: 10.5px; color: var(--muted); margin-top: 4px; font-family: var(--mono); white-space: nowrap; text-align: center; line-height: 1.3; }

/* ---- passengers ---- */
.pchart { display: flex; align-items: flex-end; gap: 2px; height: 110px; margin-top: 16px; }
.pbar-wrap { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.pbar { width: 100%; background: var(--total); border-radius: 2px 2px 0 0; min-height: 2px; opacity: 0.8; }
.pbar.missing { background: transparent; border: 1px dashed var(--line); opacity: 1; }
.pchart-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---- demographics ---- */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
@media (max-width: 700px) { .demo-grid { grid-template-columns: 1fr; } }
.demo-block h3 { font-size: 14px; }
.demo-row { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr 48px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; }
.demo-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-track { background: var(--bg); height: 8px; border-radius: 4px; overflow: hidden; }
.demo-fill { display: block; height: 100%; background: var(--total); }
.demo-val { text-align: right; font-family: var(--mono); color: var(--text); }

/* ---- states ---- */
.unavailable { border: 1px dashed var(--line); border-radius: 8px; padding: 12px 14px; font-size: 14px; color: var(--text-2); background: var(--bg-2); }
.unavailable strong { color: var(--warn); display: block; margin-bottom: 4px; }
.admin-hint { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.admin-hint code { font-size: 11px; }
.error-box { border: 1px solid var(--danger); border-radius: 8px; padding: 12px 14px; color: var(--danger-ink); background: var(--danger-soft); }
.badge { display: inline-block; font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.err { color: var(--danger-ink); border-color: var(--danger); }

/* ---- data section ---- */
.data-section { margin-top: 28px; }
.data-section > h2 { font-size: 20px; margin: 0 0 12px; }
ul.limits { margin: 12px 0 0; padding-left: 20px; color: var(--text-2); font-size: 14px; }
ul.limits li { margin-bottom: 6px; }
.feed-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; margin: 14px 0; }
.check { display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); }
.feed-status { font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: 10px; }
.feed-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .feed-grid { grid-template-columns: 1fr; } }
.feed-log { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); font-family: var(--mono); font-size: 11.5px; }
.feed-log li { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); line-height: 1.5; }
.feed-log li.fresh { animation: fresh 2s ease-out; }
@keyframes fresh { from { background: var(--accent-soft); } to { background: transparent; } }
.feed-log .when { color: var(--muted); }
.feed-log .lvl { font-weight: 600; margin: 0 6px; }
.feed-log .lvl.INFO { color: var(--muted); }
.feed-log .lvl.WARNING { color: var(--warn); }
.feed-log .lvl.ERROR { color: var(--danger-ink); }
.feed-log .who { color: var(--accent-strong); }
.feed-log .step { color: var(--text); margin-right: 6px; }
.feed-log .msg { color: var(--text); display: block; word-break: break-word; }
.feed-log .counts { color: var(--muted); display: block; }
.notice { border: 1px solid var(--accent); border-radius: 6px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sources-table td { font-size: 13px; }
.sources-table .ds-name { font-weight: 500; }
.sources-table .ds-org { color: var(--muted); font-size: 12px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .feed-log li.fresh { animation: none; } }

/* ---- background loading banner ---- */
.load-banner { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 16px; }
.load-banner.ok { border-color: var(--ok); background: var(--ok-soft); }
.load-banner.err { border-color: var(--danger); background: var(--danger-soft); }
.load-banner strong { display: block; margin-bottom: 4px; }
.load-banner .step { color: var(--text-2); font-size: 13.5px; }
.progress { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin: 10px 0 4px; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width 0.4s; }
.progress.indeterminate span { width: 30% !important; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { margin-left: -30%; } to { margin-left: 100%; } }

/* ---- trains ---- */
.boards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .boards { grid-template-columns: 1fr; } }
.board td.time { font-family: var(--mono); white-space: nowrap; }
.board td.plat { font-family: var(--mono); text-align: center; white-space: nowrap; }
.board .status-late { color: var(--warn); }
.board .status-cancel { color: var(--danger-ink); font-weight: 600; }
.board .op { color: var(--muted); font-size: 12px; display: block; }
.board .why { color: var(--muted); font-size: 12px; display: block; }
.board-msg { border-left: 3px solid var(--warn); padding: 6px 10px; margin: 0 0 12px; color: var(--text-2); font-size: 13.5px; background: var(--bg-2); }

/* ---- forecast ---- */
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline select { padding: 6px 10px; font-size: 13.5px; }
.fc-statement { font-size: 16px; margin: 4px 0 6px; }
.fc-statement .verdict { font-weight: 600; }
.fc-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .fc-grid { grid-template-columns: 1fr; } }
.fc-chart { position: relative; }
.fc-chart svg { width: 100%; height: auto; display: block; }
.fc-chart .grid line { stroke: var(--line-soft); }
.fc-chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
.fc-chart .band { fill: var(--terr); opacity: 0.14; }
.fc-chart .band.future { opacity: 0.1; }
.fc-chart .actual { fill: none; stroke: var(--terr); stroke-width: 2; }
.fc-chart .point { fill: var(--terr); stroke: var(--panel); stroke-width: 2; }
.fc-chart .point.outside { fill: var(--panel); stroke: var(--terr); stroke-width: 2.5; }
.fc-chart .estimate { fill: none; stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 4 3; }
.fc-chart .sel-line { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 3; }
.fc-chart .label { fill: var(--text); font-size: 12px; }
.fc-chart .hit { fill: transparent; cursor: crosshair; }
.fc-chart .cross { stroke: var(--muted); stroke-width: 1; }
.fc-tip { position: absolute; pointer-events: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; color: var(--text); min-width: 170px; box-shadow: var(--shadow); z-index: 5; }
.fc-tip .muted { font-size: 12px; }
.fc-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.fc-legend i { display: inline-block; width: 18px; height: 10px; margin-right: 6px; vertical-align: 0; }
.fc-legend .l-actual { border-top: 2px solid var(--terr); height: 0; vertical-align: 3px; }
.fc-legend .l-est { border-top: 1.5px dashed var(--text-2); height: 0; vertical-align: 3px; }
.fc-legend .l-band { background: var(--terr); opacity: 0.25; border-radius: 2px; }
.fc-legend .l-out { width: 10px; height: 10px; border: 2.5px solid var(--terr); border-radius: 50%; box-sizing: border-box; }
.fc-side .acc-num { font-family: var(--mono); font-size: 26px; }
.fc-side .next { display: grid; gap: 8px; margin-top: 8px; }
.fc-side .next div { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.fc-side .next span { font-family: var(--mono); }

/* ---- comparison ---- */
.cmp-period { color: var(--text-2); font-size: 13.5px; margin: 0 0 12px; }
.cmp-rows { display: grid; gap: 4px; }
.cmp-row { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(220px, 1.3fr) minmax(220px, 1.2fr); gap: 16px;
  align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.cmp-row:last-child { border-bottom: none; }
@media (max-width: 900px) { .cmp-row { grid-template-columns: 1fr; gap: 6px; } }
.cmp-name { font-weight: 600; }
.cmp-name .sub { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.band-tag { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.band-tag .sym { font-family: var(--mono); width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1.5px solid var(--line); font-size: 12px; }
/* Neutral ink on purpose: a band compares recorded crime; it is not a good/bad (status) judgement. */
.band-tag.much_higher .sym, .band-tag.much_lower .sym { border-color: var(--text); color: var(--text); }
.band-tag.na { color: var(--muted); font-weight: 400; }
.cmp-detail { color: var(--text-2); font-size: 13px; }
.strip svg { width: 100%; height: 34px; display: block; }
.strip .peer { fill: var(--muted); opacity: 0.35; }
.strip .ref { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 2; }
.strip .ci { stroke: var(--terr); stroke-width: 3; stroke-linecap: round; }
.strip .me { fill: var(--terr); stroke: var(--panel); stroke-width: 2; }
.strip-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

/* ---- time of year ---- */
.season-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.season { border-collapse: separate; border-spacing: 3px; width: 100%; table-layout: fixed; }
.season th { font-family: var(--mono); font-weight: 400; color: var(--muted); font-size: 11.5px; text-align: center; padding: 2px; border: none; }
.season th.yr { text-align: right; padding-right: 8px; width: 64px; }
.season td { height: 38px; text-align: center; font-family: var(--mono); font-size: 12.5px; border-radius: 4px; border: none; padding: 0; }
.season td.none { background: repeating-linear-gradient(135deg, transparent 0 5px, var(--stripe) 5px 7px); color: var(--muted); }
.season tr.avg td { outline: 1px dashed var(--line); }
.season-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.season-legend .ramp-s { display: inline-flex; }
.season-legend .ramp-s span { width: 22px; height: 12px; display: inline-block; }

/* ---- footer ---- */
.footer-inner p { margin: 0 0 8px; line-height: 1.6; }
.footer-disclaimer { color: var(--text-2); }
.footer-disclaimer strong { color: var(--text); }

/* ---- light theme refinements ---- */
body { background: var(--bg); }
section.panel, details.panel { border-color: var(--line-soft); }
.search-bar { background: var(--panel); }
input[type="text"], input[type="number"], select { background: var(--panel); }
.seg { background: var(--panel-2); }
.seg-btn.active { background: var(--panel); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.chip { background: var(--panel); }
.unavailable { background: var(--panel-2); }
.feed-log { background: var(--panel-2); }
.leaflet-control-layers { background: var(--panel) !important; }
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); }

/* ---- landing (home) page: a single centred search, Google-style ---- */
.landing .hero { min-height: calc(100vh - 61px); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 0 56px; }
.hero-brand { display: none; }
.landing .hero-brand { display: block; margin-bottom: 14px; }
.brand-icon.big { width: 72px; height: 72px; display: inline-block; }
.landing .hero h1 { font-size: 40px; margin-bottom: 10px; }
.landing .lede { margin: 0 auto 28px; max-width: 640px; font-size: 17px; }
.landing .search-bar { width: min(720px, 100%); padding: 0; border: none; background: transparent; box-shadow: none; justify-content: center; }
.landing .search-bar .field { display: none; }
.landing #stationInput { border-radius: 999px; padding: 16px 22px 16px 50px; font-size: 17px; border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(30,42,43,0.08); }
.landing #stationInput:focus { outline: none; border-color: var(--accent); box-shadow: 0 2px 14px rgba(47,107,79,0.20); }
.landing .search-icon { left: 20px; }
.landing .combo-list { text-align: left; }
.landing .start-guide { width: min(1000px, 100%); margin-top: 18px; }
.landing .try { margin-bottom: 34px; }
.intro-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; text-align: left; }
@media (max-width: 900px) { .intro-cards { grid-template-columns: 1fr 1fr; } .landing .hero h1 { font-size: 30px; } }
@media (max-width: 560px) { .intro-cards { grid-template-columns: 1fr; } }
.intro-card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.intro-card h2 { font-size: 15px; margin: 8px 0 4px; }
.intro-card p { margin: 0; color: var(--text-2); font-size: 14px; }
.intro-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font-size: 17px; }
.landing #dataSection { display: none; }

.landing .header-meta { display: none; }

/* ---- passenger projection ---- */
.pbar-wrap.proj { position: relative; }
.pbar.projected { position: relative; background: repeating-linear-gradient(45deg, var(--total) 0 3px, transparent 3px 6px);
  border: 1px solid var(--total); opacity: 1; }
.pbar.projected .whisker { position: absolute; left: 50%; width: 0; border-left: 2px solid var(--text-2); }
.proj-box { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }

/* ---- businesses ---- */
.biz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.biz-card { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; }
.biz-card .n { font-family: var(--mono); font-size: 24px; display: block; }
.biz-card .l { color: var(--text-2); font-size: 13px; }
.ind-row { display: grid; grid-template-columns: minmax(0, 2fr) 3fr 56px; gap: 10px; align-items: center; font-size: 13.5px; padding: 3px 0; }
.ind-row .bar { background: var(--bg-2); height: 9px; border-radius: 5px; overflow: hidden; }
.ind-row .bar span { display: block; height: 100%; background: var(--accent); opacity: 0.75; }
.ind-row .v { text-align: right; font-family: var(--mono); }

/* ---- planned stations: same profile, without anything that needs an open station ---- */
.planned-banner { margin-top: 14px; background: var(--warn-soft); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.55; }
.planned-banner .muted { display: block; margin-top: 6px; font-size: 13px; }
/* planned-site: not open (no passengers). no-nr: not National Rail (no ORR rate/comparison, no departures). no-btp: no BTP figures. */
.no-btp .src-card.btp, .no-btp .src-card.total, .no-btp .tbar.btp,
.no-btp .trend-legend span:has(> .swatch.btp),
.no-btp .seg-btn[data-source="btp"], .no-btp .seg-btn[data-fc-source="btp"], .no-btp .seg-btn[data-season-source="btp"] { display: none !important; }
.planned-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.planned-card { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.planned-card h3 { margin: 0; font-size: 17px; }
.planned-card .where { color: var(--text-2); font-size: 13.5px; }
.planned-card .meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.planned-card .go { margin-top: 8px; font-weight: 500; }
.state-tag { align-self: flex-start; font-size: 12px; border-radius: 999px; padding: 2px 10px; border: 1px solid var(--line); color: var(--text-2); }
.state-tag.building { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
#plannedMap { height: 380px; border-radius: 12px; border: 1px solid var(--line-soft); }

.first-box { border-left: 3px solid var(--warn); }
.no-btp .btp-only { display: none !important; }

/* ---- London Underground usage (TfL), beside the ORR figures ---- */
.tube-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.tube-box h3 { margin: 0 0 8px; }
.pbar.tube { background: var(--accent); }

/* ---- page groups ---- */
.section-group { margin-top: 28px; }
.group-title { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-strong);
  margin: 0 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); }
.section-nav .nav-group { align-self: center; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); white-space: nowrap; }

/* ---- station-style train board ---- */
.boards { grid-template-columns: repeat(2, minmax(0, 480px)); justify-content: center; gap: 20px; }
.boards.single { grid-template-columns: minmax(0, 480px); }
@media (max-width: 1000px) { .boards { grid-template-columns: minmax(0, 520px); } }
.station-board { position: relative; overflow: hidden; border-radius: 12px; padding: 14px 16px 12px; color: #FFB000; font-family: 'VT323', var(--mono);
  background: radial-gradient(rgba(255, 176, 0, 0.05) 1px, transparent 1px) 0 0 / 3px 3px, linear-gradient(180deg, #17140D, #0B0A07);
  border: 5px solid #26262A; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28), inset 0 0 24px rgba(0, 0, 0, 0.75); text-shadow: 0 0 6px rgba(255, 176, 0, 0.35); }
.sb-title { display: flex; justify-content: space-between; align-items: center; font-size: 26px; line-height: 1; text-transform: uppercase; letter-spacing: 0.08em;
  color: #FFC940; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 2px solid rgba(255, 176, 0, 0.35); }
.sb-clock { font-size: 24px; letter-spacing: 0.04em; color: #FFE08A; }
.station-board table { width: 100%; table-layout: fixed; border-collapse: collapse; background: transparent; margin: 0; font-family: inherit; }
.station-board th { color: #B98A1C; font-weight: 400; font-size: 16px; text-align: left; text-transform: uppercase; letter-spacing: 0.05em; padding: 5px 6px 3px 0; border: 0; background: transparent; }
.station-board th:nth-child(1) { width: 58px; }
.station-board th:nth-child(3) { width: 46px; text-align: center; }
.station-board th:nth-child(4) { width: 84px; text-align: right; padding-right: 0; }
.station-board td { color: #FFB000; font-size: 22px; line-height: 1.05; padding: 6px 6px 6px 0; border: 0; border-top: 1px dotted rgba(255, 176, 0, 0.2); vertical-align: top; background: transparent; }
.station-board td.sb-place { overflow: hidden; }
.station-board td.sb-plat { text-align: center; color: #FFE08A; }
.station-board td.sb-status { text-align: right; padding-right: 0; font-size: 20px; white-space: nowrap; }
.sb-op { display: block; font-size: 15px; line-height: 1.15; color: #B98A1C; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-board .status-late { color: #FF8A50; }
.station-board .status-cancel { color: #FF5A5A; }
.station-board .muted { color: #B98A1C; }
.sb-empty { color: #B98A1C !important; text-align: center; padding: 18px 0 !important; }
.sb-more { color: #B98A1C; font-size: 16px; text-align: right; padding-top: 6px; border-top: 1px dotted rgba(255, 176, 0, 0.2); }

/* ---- key points ---- */
.kp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px 28px; margin-top: 8px; }
.kp-group h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent-strong); }
.kp-group .key-points { margin: 0; font-size: 14.5px; }
.map-link { display: inline-block; margin-top: 10px; }

/* ---- events and disruption ---- */
.ev-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 6px 0 18px; }
.ev-tile { background: var(--panel-2); border: 1px solid var(--line-soft); border-top: 3px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ev-tile.warn { border-top-color: var(--warn); }
.ev-tile.ok { border-top-color: var(--ok); }
.ev-num { display: block; font-family: var(--mono); font-size: 24px; line-height: 1.2; }
.ev-num small { font-size: 13px; color: var(--text-2); }
.ev-label { display: block; font-size: 12.5px; color: var(--text-2); line-height: 1.3; margin-top: 2px; }
.ev-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 900px) { .ev-cols { grid-template-columns: minmax(0, 1fr); } }
.ev-col h3 { margin: 0 0 8px; font-size: 16px; }
.ev-col h4 { margin: 14px 0 6px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); }
.ev-col h3 + h4 { margin-top: 0; }
.ev-none { color: var(--text-2); font-size: 14px; background: var(--panel-2); border-radius: 8px; padding: 10px 12px; margin: 6px 0; }
.ev-small { font-size: 12.5px; margin: 4px 0 0; }
.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ev-item { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 10px; }
.ev-date { display: grid; justify-items: center; background: var(--accent); color: var(--on-accent); border-radius: 8px; padding: 3px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; line-height: 1.1; }
.ev-date b { font-size: 18px; font-weight: 600; }
.ev-text { font-size: 14px; min-width: 0; }
.ev-text .muted { display: block; font-size: 12.5px; }
.ev-more summary { cursor: pointer; font-size: 13px; color: var(--accent-strong); padding: 2px 0; }
.ev-more .ev-list { margin-top: 8px; }
.dis-item { background: var(--panel-2); border: 1px solid var(--line-soft); border-left: 4px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px; }
.dis-item.now { border-left-color: var(--warn); background: var(--warn-soft); }
.dis-item .muted { display: block; font-size: 12.5px; margin-top: 3px; }
.dis-tags { display: flex; gap: 4px; margin-bottom: 5px; }
.event-tag { display: inline-block; font-size: 11.5px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--text-2); white-space: nowrap; background: var(--panel); }
.event-tag.strong { font-weight: 600; color: var(--text); }
.line-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.line-status li { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; align-items: start; font-size: 14px; }
.line-status .muted { display: block; font-size: 12.5px; margin-top: 2px; }
.line-state { font-size: 11.5px; text-align: center; border-radius: 999px; padding: 2px 0; border: 1px solid var(--ok); color: var(--ok); }
.line-status li.bad .line-state { border-color: var(--warn); color: var(--warn); font-weight: 600; }
.venue-chips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.venue-chips li { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 7px 10px; font-size: 13px; line-height: 1.3; }
.venue-chips .muted { display: block; font-size: 12px; }

/* Events and disruption beside How busy is the station: stacked inside its half-width panel */
.travel-pair { align-items: start; }
.travel-pair .ev-cols { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.travel-pair .ev-tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.section-nav { flex-wrap: wrap; overflow-x: visible; row-gap: 2px; }
.map-link { margin-bottom: 14px; }
.travel-pair .ev-tiles { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }

/* ---- key points as a short brief ---- */
.kp-bottom { font-size: 17px; line-height: 1.45; margin: 4px 0 14px; color: var(--text); }
.kp-grid { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 12px 32px; margin-top: 0; }
.kp-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line-soft); font-size: 14.5px; line-height: 1.45; }
.kp-label { font-size: 12.5px; font-weight: 600; color: var(--accent-strong); text-decoration: none; padding-top: 2px; }
.kp-label:hover { text-decoration: underline; }
.kp-text strong { font-weight: 600; }
@media (max-width: 480px) { .kp-grid { grid-template-columns: minmax(0, 1fr); } .kp-row { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* Similar stations: shown on hover, keyboard focus or tap */
.peer-tip { position: relative; cursor: help; border-bottom: 1px dotted var(--text-2); color: var(--text-2); }
.peer-tip:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.peer-pop { display: none; position: absolute; z-index: 40; left: 0; top: 100%; width: 340px; max-width: 78vw; padding: 10px 12px; margin-top: 0;
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.16); font-size: 12.5px; line-height: 1.35; cursor: default; }
.peer-tip:hover .peer-pop, .peer-tip:focus .peer-pop, .peer-tip:focus-within .peer-pop { display: block; }
.peer-pop .peer-group { display: block; color: var(--muted); margin: 2px 0 6px; }
.peer-pop a { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; color: var(--text); text-decoration: none; border-top: 1px solid var(--line-soft); }
.peer-pop a:hover { text-decoration: underline; }
.peer-pop .n { font-family: var(--mono); white-space: nowrap; }
.peer-pop .peer-more { display: block; margin-top: 5px; color: var(--muted); }
.strip .peer { cursor: help; }
.strip .peer:hover { opacity: 1; }

/* ---- station page: one view at a time ---- */
.tab-off { display: none !important; }
.section-group { margin-top: 0; }
.data-section { margin-top: 0; }
.section-nav.tabs { display: block; padding: 8px 24px 0; overflow: visible; }
.tab-main { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.tab-btn { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; padding: 8px 14px; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.tab-btn:hover { background: var(--panel); color: var(--text); }
.tab-btn.on { color: var(--accent-strong); border-bottom-color: var(--accent); background: none; }
.tab-step { margin-left: auto; display: inline-flex; gap: 6px; padding-bottom: 3px; }
.tab-arrow { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 5px 11px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer; }
.tab-arrow:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-strong); }
.tab-arrow:disabled { opacity: 0.4; cursor: default; }
.tab-sub { display: flex; flex-wrap: wrap; gap: 4px; padding: 7px 0 8px; border-top: 1px solid var(--line-soft); }
.sub-btn { background: none; border: 0; border-radius: 999px; padding: 5px 13px; font: inherit; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.sub-btn:hover { background: var(--panel); color: var(--text); }
.sub-btn.on { background: var(--accent); color: var(--on-accent); }
.tab-btn:focus-visible, .sub-btn:focus-visible, .tab-arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 640px) { .tab-btn { padding: 7px 9px; font-size: 13.5px; } .tab-step { margin-left: 0; width: 100%; justify-content: space-between; } }

/* Fit the station page to the screen: a compact header, then views that scroll inside themselves */
.panel .sr-only { position: fixed; top: 0; left: 0; }  /* a hidden table must not stretch the page */
.hero.compact { padding: 8px 0 0; }
.hero.compact .search-bar { padding: 8px 12px; align-items: center; }
.hero.compact .field { display: flex; flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.hero.compact #stationInput { padding-top: 7px; padding-bottom: 7px; }
.hero.compact .field select, .hero.compact .field input { padding-top: 6px; padding-bottom: 6px; }
.station-head { margin: 10px 0 8px; }
.station-title { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-bottom: 6px; }
.station-title h2 { font-size: 22px; }
.station-title .station-sub { margin: 0; }
.station-title .map-link { margin: 0 0 0 auto; padding: 5px 12px; font-size: 13.5px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.fact { display: flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 8px; }
.fact-num { font-size: 14px; }
.fact-num.small { font-size: 13.5px; }
.fact-label { margin: 0; font-size: 12.5px; }
.section-nav.tabs { margin-bottom: 10px; }
#stationSource { margin: 0 0 12px; }
#mapSection #map { height: clamp(400px, calc(100vh - 450px), 780px); }
@media (min-width: 900px) {
  #summary, #trainsPanel, #comparePanel, #seasonPanel, #trendPanel, #schoolPanel, #ratePanel, #mapSection,
  #summaryPanel, #eventsPanel, #passengerPanel, #categoriesPanel, #outcomesPanel, #demographicsPanel, #businessPanel, #forecastPanel {
    box-sizing: border-box; max-height: 1000px; overflow-y: auto; }
  #mapSection #map { height: 730px; }
  .limits-panel { max-height: 300px; overflow-y: auto; }
}
.cmp-row:nth-child(n+3) .peer-pop { top: auto; bottom: 100%; }  /* lower rows open upwards, staying inside the panel */
@media (max-width: 640px) {
  .topnav { flex-wrap: wrap; row-gap: 2px; }
  .topnav a { white-space: nowrap; padding: 4px 8px; }
  .header-inner { flex-wrap: wrap; }
  .landing .header-meta, .header-meta { display: none; }
}
