/* bdBridge — Orwell Bridge & Suffolk traffic dashboard
   Palette: dataviz reference instance (light + dark selected, validated). */

:root {
  --surface-1: #fcfcfb;
  --page: #f4f4f1;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #6f6e69;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --hover: rgba(11, 11, 11, 0.04);

  --series-1: #2a78d6;  /* gusts / informational / accent */
  /* Text and white-text fills in the accent colours, at 4.5:1 or better */
  --accent-text: #1f6bc9;
  --accent-fill: #1f6bc9;
  --good-fill: #087d08;
  --series-2: #1baf7a;  /* mean wind */
  --series-5: #4a3aa7;  /* speed managed areas */

  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --good-text: #006300;
  --critical-text: #b42f2f;

  --shadow: 0 1px 2px rgba(11, 11, 11, 0.06), 0 2px 10px rgba(11, 11, 11, 0.05);
  --shadow-raised: 0 2px 6px rgba(11, 11, 11, 0.10), 0 8px 24px rgba(11, 11, 11, 0.08);
  --map-casing: #1a1a19;
  --radius: 12px;
  --topbar-h: 58px;
  --sidebar-w: 440px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface-1: #1a1a19;
    --page: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #9a9890;
    --grid: #2c2c2a;
    --baseline: #45453f;
    --border: rgba(255, 255, 255, 0.10);
    --hover: rgba(255, 255, 255, 0.05);

    --series-1: #3987e5;
    --accent-text: #6aa8f5;
    --series-2: #199e70;
    --series-5: #9085e9;

    --good-text: #2fc42f;
    --critical-text: #f07070;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-raised: 0 4px 18px rgba(0, 0, 0, 0.6);
    --map-casing: #f4f4f1;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; height: 100%; }

body {
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text-primary);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-text); }

:focus-visible {
  outline: 2px solid var(--series-1);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -48px;
  z-index: 2000;
  background: var(--surface-1);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
}
.skip-link:focus { top: 10px; box-shadow: var(--shadow-raised); }

button { font: inherit; color: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 16px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1100;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-icon { width: 44px; height: 22px; color: var(--series-1); flex: none; }
a.brand:hover .brand-name { color: var(--accent-text); }
.topbar { transition: box-shadow 0.2s ease; }
.scrolled .topbar { box-shadow: 0 1px 0 var(--border), 0 6px 18px rgba(11, 11, 11, 0.07); }

/* The status pill takes the bridge's status colour */
.bridge-pill { transition: background 0.2s ease, border-color 0.2s ease; }
.bridge-pill[data-status="critical"] {
  background: color-mix(in srgb, var(--status-critical) 12%, var(--surface-1));
  border-color: color-mix(in srgb, var(--status-critical) 45%, transparent);
  color: var(--critical-text);
}
.bridge-pill[data-status="critical"] .pill-prefix,
.bridge-pill[data-status="critical"] .pill-prefix-short { color: inherit; opacity: 0.8; }
.bridge-pill[data-status="warning"] {
  background: color-mix(in srgb, var(--status-warning) 16%, var(--surface-1));
  border-color: color-mix(in srgb, var(--status-warning) 55%, transparent);
}
/* Restrictions, incidents, possible closures and high winds: orange, not the take-care amber */
.bridge-pill[data-status="serious"] {
  background: color-mix(in srgb, var(--status-serious) 18%, var(--surface-1));
  border-color: color-mix(in srgb, var(--status-serious) 65%, transparent);
}
.bridge-pill[data-status="serious"] .pill-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-serious) 30%, transparent); }
.bridge-pill[data-status="good"] {
  background: color-mix(in srgb, var(--status-good) 10%, var(--surface-1));
  border-color: color-mix(in srgb, var(--status-good) 40%, transparent);
}
.bridge-pill[data-status="critical"] .pill-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-critical) 25%, transparent); }

.bridge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: 999px;
  padding: 6px 13px 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
}
.bridge-pill:hover { background: var(--hover); }
.pill-dot {
  width: 10px; height: 10px; flex: none;
  border-radius: 50%;
  background: var(--baseline);
}
.pill-text { overflow: hidden; text-overflow: ellipsis; }
.pill-prefix, .pill-prefix-short { color: var(--text-secondary); font-weight: 500; }
.pill-prefix-short { display: none; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

/* ---------- Main menu ---------- */
a.brand { color: inherit; text-decoration: none; border-radius: 8px; }
.brand-name { display: block; font-size: 17px; font-weight: 800; letter-spacing: 0.1px; line-height: 1.1; white-space: nowrap; }
.brand-name-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.brand-name-sub .brand-tag { text-transform: uppercase; }
a.brand { padding: 4px 0; }

.topnav { position: relative; display: flex; align-items: center; margin-left: 8px; }
.topnav-links { display: flex; align-items: center; gap: 2px; }
.topnav-links a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 11px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.topnav-links a:hover { background: var(--hover); color: var(--text-primary); }
.topnav-links a[aria-current="page"] {
  color: var(--accent-text);
  background: color-mix(in srgb, var(--series-1) 11%, transparent);
}
.topnav-icon { display: none; width: 19px; height: 19px; flex: none; }
.topnav .topnav-toggle { display: none; }
.topnav.open .topnav-toggle { background: var(--hover); color: var(--text-primary); }
a.bridge-pill { color: inherit; text-decoration: none; }
.brand { flex: none; }
.bridge-pill { min-width: 0; } /* truncate the status rather than overlap the brand */

.refresh-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-secondary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--baseline); flex: none; }
.dot.live { background: var(--status-good); }
.dot.warn { background: var(--status-warning); }
.dot.error { background: var(--status-critical); }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  color: var(--text-secondary);
}
.btn-icon:hover { background: var(--hover); color: var(--text-primary); }
.btn-icon.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* status colour plumbing: one custom property per status class */
.st-good     { --st: var(--status-good); }
.st-warning  { --st: var(--status-warning); }
.st-serious  { --st: var(--status-serious); }
.st-critical { --st: var(--status-critical); }
.st-unknown  { --st: var(--baseline); }
.pill-dot.st-good, .pill-dot.st-warning, .pill-dot.st-serious, .pill-dot.st-critical, .pill-dot.st-unknown { background: var(--st); }

/* ---------- Layout ---------- */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(340px, var(--sidebar-w)) 1fr;
  min-height: 0;
}

.sidebar {
  overflow-y: auto;
  padding: 14px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  scroll-padding-top: 52px;
}
.sidebar:focus { outline: none; }

.map-wrap { position: relative; min-height: 320px; }
#map { position: absolute; inset: 0; background: var(--page); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.bridge-card { padding: 14px 16px 12px; scroll-margin-top: 14px; }

.bridge-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
/* Heading on its own row: the line below fills in when data arrives without reflowing it */
.bridge-head h1 { margin: 0; font-size: 16px; flex-basis: 100%; }
.bridge-sub {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-secondary);
}
.road-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 999px;
}

.bridge-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--st, var(--baseline)) 11%, var(--surface-1));
  border: 1px solid color-mix(in srgb, var(--st, var(--baseline)) 30%, transparent);
}

.status-icon {
  width: 36px; height: 36px; flex: none;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 700; color: #fff;
  background: var(--st, var(--baseline));
}
.st-warning .status-icon, .st-serious .status-icon { color: #0b0b0b; }

.status-label { font-size: 18px; font-weight: 700; line-height: 1.25; }
.status-detail { font-size: 12.5px; color: var(--text-secondary); min-height: 2.9em; } /* two lines kept: no jump when the detail arrives */

.bridge-reasons { list-style: none; margin: 6px 0 0; padding: 0; }
.bridge-reasons li {
  font-size: 12.5px;
  color: var(--text-secondary);
  padding: 3px 0 3px 18px;
  position: relative;
}
.bridge-reasons li::before {
  content: "";
  position: absolute; left: 5px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--baseline);
}
.bridge-reasons li.sev-critical::before { background: var(--status-critical); }
.bridge-reasons li.sev-warning::before { background: var(--status-warning); }
.bridge-reasons li.sev-serious::before { background: var(--status-serious); }

/* Per-direction verdict under the status */
.bridge-directions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 8px 0 0;
  font-size: 12.5px;
}
.bridge-directions:empty { display: none; }
.dir {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: 13px; /* a pill on one line, a rounded box when it wraps */
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
}
.dir strong { color: var(--text-primary); }
.dir::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--status-good); }
.dir-advisory::before, .dir-delays::before { background: var(--status-warning); }
.dir-incident::before { background: var(--status-serious); }
.dir-restricted::before { background: var(--status-serious); }
.dir-restricted, .dir-incident, .dir-possible { border-color: color-mix(in srgb, var(--status-serious) 55%, transparent); }
.dir-possible { font-weight: 600; }
.dir-possible::before { background: var(--status-serious); box-shadow: 0 0 0 2px color-mix(in srgb, var(--status-critical) 45%, transparent); }
.dir-delays { border-color: color-mix(in srgb, var(--status-warning) 65%, transparent); }
.dir-closed { border-color: color-mix(in srgb, var(--status-critical) 45%, transparent); color: var(--critical-text); font-weight: 600; }
.dir-closed::before { background: var(--status-critical); }
.dir-unknown::before { background: var(--baseline); }

/* ---------- Stat tiles ---------- */
.wind-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.stat-tile {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 0;
}
.stat-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-value { font-size: 25px; font-weight: 700; line-height: 1.15; white-space: nowrap; }
.stat-unit { font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-left: 3px; }
.stat-sub {
  font-size: 12px; color: var(--text-secondary); min-height: 17px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-sub.good { color: var(--good-text); }
.stat-sub.critical { color: var(--critical-text); font-weight: 600; }
.stat-sub.warning { color: var(--text-primary); font-weight: 600; }

.crosswind-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.compass { width: 32px; height: 32px; flex: none; }

/* ---------- Chart block ---------- */
.chart-block { margin-top: 12px; }
.chart-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; flex-wrap: wrap;
  margin-bottom: 6px;
}

.segmented {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: var(--grid);
}
.seg {
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 11px;
  border-radius: 7px;
  cursor: pointer;
}
.seg[aria-pressed="true"] {
  background: var(--surface-1);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.legend { display: flex; gap: 12px; font-size: 11.5px; color: var(--text-secondary); }
.chart-head .legend:empty { display: none; } /* an empty legend mustn't wrap to a line of its own */
.legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-swatch { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.legend-swatch.strip { height: 8px; width: 14px; border-radius: 2px; }
/* The history strip's colour key, under the chart */
.strip-key { flex-wrap: wrap; gap: 3px 10px; margin-top: 2px; font-size: 11px; }
.strip-key-title { color: var(--text-muted); }

.wind-chart { position: relative; display: flow-root; width: 100%; height: 150px; touch-action: pan-y; } /* flow-root: a note's margin can't move the chart */
.wind-chart svg { display: block; }
.wind-chart .empty-note { padding: 50px 6px 0; }

.chart-tooltip {
  position: absolute;
  top: 2px;
  pointer-events: none;
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-raised);
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 12px;
  color: var(--text-primary);
  z-index: 10;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chart-tooltip .tt-time { color: var(--text-muted); font-size: 11px; }
.tt-sw { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.chart-tooltip .tt-dirs { color: var(--text-secondary); font-size: 11px; padding-left: 12px; }

.chart-summary {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  min-height: 18px;
}
.chart-summary strong { color: var(--text-primary); }

.chart-note { margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.chart-note summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 24px;
  font-size: 12px;
}
.chart-note summary::-webkit-details-marker { display: none; }
.chart-note summary::before {
  content: "i";
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 9.5px; font-weight: 700; font-style: italic;
}
.chart-note p { margin: 6px 0 2px; line-height: 1.5; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 2px;
  position: sticky;
  top: -14px;           /* cancel the sidebar's top padding so tabs pin flush */
  z-index: 20;
  margin: 0 -14px;
  padding: 0 14px;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}
.tab {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: none; background: none;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-muted);
  padding: 11px 4px 9px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--text-primary); border-bottom-color: var(--accent-text); }

.tab-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--grid);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-badge { background: var(--accent-fill); color: #fff; }

.tab-panel { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 54px; }
.panel-intro { font-size: 12.5px; color: var(--text-secondary); margin: 2px 0 0; }

/* Plain-language description at the foot of the sidebar */
.intro-card { padding: 14px 16px; font-size: 13px; line-height: 1.55; color: var(--text-secondary); }
.intro-card h2 { margin: 0 0 6px; font-size: 14px; color: var(--text-primary); }
.intro-card p { margin: 0 0 8px; }
.intro-card strong { color: var(--text-primary); font-weight: 600; }
.intro-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 !important; font-weight: 600; }

/* ---------- Filters ---------- */
.filter-row { display: flex; flex-direction: column; gap: 6px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  min-height: 30px;
}
.chip-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.chip-count:empty { display: none; }
.chip.active .chip-count { color: inherit; opacity: 0.75; }
.chip:hover { border-color: var(--baseline); color: var(--text-primary); }
.chip.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--page);
  font-weight: 600;
}
.chip-swatch { width: 10px; height: 4px; border-radius: 2px; display: inline-block; }


/* ---------- Event sections & cards ---------- */
.event-sections { display: flex; flex-direction: column; gap: 6px; }

.section-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted);
  margin: 10px 0 2px;
}
.section-title .count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text-secondary);
  background: var(--grid);
  border-radius: 999px;
  padding: 0 6px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}
.event-sections > .section-title:first-child { margin-top: 2px; }
.section-empty {
  margin: 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--hover);
  font-size: 12.5px;
  color: var(--text-secondary);
}

.event-list, .sign-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}

.event-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-left: 4px solid var(--baseline);
  border-radius: 10px;
  padding: 9px 12px 10px;
  cursor: pointer;
  transition: box-shadow 0.12s, border-color 0.12s;
}
.event-item:hover { box-shadow: var(--shadow-raised); }
.event-item.selected {
  box-shadow: 0 0 0 2px var(--series-1), var(--shadow-raised);
}
.event-item.sev-critical { border-left-color: var(--status-critical); }
.event-item.sev-serious { border-left-color: var(--status-serious); }
.event-item.sev-warning { border-left-color: var(--status-warning); }
.event-item.sev-info { border-left-color: var(--series-5); }

.event-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.event-road {
  font-weight: 700; font-size: 12px;
  background: var(--text-primary); color: var(--page);
  border-radius: 4px; padding: 0 6px;
  line-height: 19px;
}
.event-type { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }

.pill-now {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  color: var(--text-primary);
  background: var(--hover);
  border: 1px solid var(--border);
  padding: 0 7px;
  border-radius: 999px;
  line-height: 17px;
}
.pill-now::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sev, var(--status-good));
}
.sev-critical { --sev: var(--status-critical); }
.sev-serious { --sev: var(--status-serious); }
.sev-warning { --sev: var(--status-warning); }
.sev-info { --sev: var(--series-5); }
.sev-good { --sev: var(--status-good); }
.sev-unknown { --sev: var(--baseline); }

/* The Orwell Bridge card pinned to the top of the Traffic list */
.event-list.pinned { margin-bottom: 4px; }
.bridge-now { background: color-mix(in srgb, var(--sev, var(--baseline)) 7%, var(--surface-1)); }
.bridge-now .event-title { font-size: 14.5px; font-weight: 700; }
.bn-dirs { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 4px; font-size: 12px; }
.bn-line {
  display: block; position: relative;
  padding: 2px 0 2px 14px;
  font-size: 12.5px; color: var(--text-secondary);
}
.bn-line::before {
  content: ""; position: absolute; left: 2px; top: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sev, var(--baseline));
}
.bn-line strong { color: var(--text-primary); }
.bn-when { display: block; font-size: 11.5px; color: var(--text-muted); }
.bn-sub {
  display: block; margin-top: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted);
}

.event-bridge-tag {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  color: var(--accent-text);
  border: 1px solid currentColor;
  padding: 0 7px; border-radius: 999px;
  line-height: 17px;
}
.event-title { display: block; font-size: 13.5px; font-weight: 500; margin: 5px 0 2px; }
.event-meta {
  display: block;
  font-size: 12px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.event-when { color: var(--text-primary); font-weight: 600; }
.event-repeat { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.event-desc { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.empty-note {
  font-size: 13px; color: var(--text-muted);
  text-align: center; padding: 18px 6px;
  list-style: none;
}
.empty-state {
  text-align: center;
  padding: 22px 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
}
.empty-state strong { display: block; color: var(--text-primary); font-size: 14px; margin-bottom: 2px; }
.empty-state button {
  margin-top: 10px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12.5px;
  cursor: pointer;
}

/* Loading skeletons */
.skeleton {
  height: 76px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--grid) 25%, color-mix(in srgb, var(--grid) 45%, var(--surface-1)) 50%, var(--grid) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Road checker ---------- */
.checker-q { font-size: 14px; font-weight: 700; }
.checker-controls { display: flex; gap: 8px; margin-top: 8px; }
.checker-controls select {
  flex: 1;
  min-width: 0;
  font: inherit; font-size: 13.5px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
}

.checker-verdict {
  display: flex; align-items: flex-start; gap: 11px;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14.5px;
  font-weight: 700;
  background: color-mix(in srgb, var(--st, var(--baseline)) 12%, var(--surface-1));
  border: 1px solid color-mix(in srgb, var(--st, var(--baseline)) 32%, transparent);
}
.checker-verdict:empty { display: none; }
.checker-verdict .status-icon { width: 28px; height: 28px; font-size: 15px; }
.checker-verdict .v-sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--text-secondary); margin-top: 2px; }

/* ---------- VMS signs ---------- */
.sign-item {
  display: block; width: 100%; text-align: left;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.sign-item:hover { box-shadow: var(--shadow-raised); }
/* Signs whose message affects the bridge: a status-coloured edge and tag */
.sign-item.flagged {
  border-left: 4px solid var(--sev, var(--baseline));
  background: color-mix(in srgb, var(--sev, var(--baseline)) 7%, var(--surface-1));
}
.sign-flag {
  display: inline-flex; align-items: center; gap: 5px;
  margin-bottom: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--text-primary);
}
.sign-flag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sev, var(--baseline)); }
#signs-bridge .sign-list { margin-bottom: 4px; }
.signs-note {
  margin: 0 0 4px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--status-warning) 55%, transparent);
  background: color-mix(in srgb, var(--status-warning) 14%, var(--surface-1));
  font-size: 12.5px;
  color: var(--text-primary);
}
.sign-meta {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--text-secondary);
  margin-bottom: 7px;
}
.sign-meta .sign-time { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.sign-display {
  display: block;
  background: #101418;
  border: 2px solid #2a3038;
  border-radius: 6px;
  padding: 8px 10px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #ffb400;
  text-transform: uppercase;
  white-space: pre-line;
  min-height: 20px;
}
.sign-display.blank { color: #5c646c; font-style: italic; text-transform: none; letter-spacing: 0; }

.blank-signs summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 0;
}
.blank-signs .sign-list { margin-top: 6px; }

/* ---------- Journey times ---------- */
.jt-row { display: flex; flex-wrap: wrap; gap: 7px; }
.jt-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: 9px;
  padding: 6px 10px;
  cursor: pointer;
  text-align: left;
}
.jt-chip:hover { box-shadow: var(--shadow-raised); }
.jt-msg { font-size: 13px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.jt-loc { font-size: 11px; color: var(--text-muted); }

/* How current the bridge verdict is */
.bridge-checked { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bridge-checked:empty { display: none; }
.bridge-checked.stale { color: var(--critical-text); font-weight: 600; }
.bridge-card.is-stale .bridge-status { opacity: 0.55; filter: grayscale(0.6); }

/* ---------- Traffic flow card (live journey times) ---------- */
.flow-card { padding: 14px 16px 12px; }
.flow-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; margin-bottom: 6px; }
.flow-head h2 { margin: 0; font-size: 16px; }
.flow-when { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.flow-sub { margin: 12px 0 6px; font-size: 13px; font-weight: 700; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.live-tag { padding: 0 6px; border-radius: 999px; background: var(--good-fill); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; line-height: 17px; }
.jt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.jt-item { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--page); border: 1px solid var(--border); }
.jt-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--baseline); }
.lvl-free .jt-dot { background: var(--status-good); }
.lvl-slow .jt-dot { background: var(--status-warning); }
.lvl-delay .jt-dot { background: var(--status-critical); }
.lvl-delay { border-color: color-mix(in srgb, var(--status-critical) 40%, transparent); }
.jt-main { display: grid; min-width: 0; }
.jt-dest { font-size: 13.5px; font-weight: 600; }
.jt-from { font-size: 11.5px; color: var(--text-muted); }
.jt-time { display: grid; justify-items: end; text-align: right; font-variant-numeric: tabular-nums; }
.jt-time strong { font-size: 15px; }
.jt-time span { font-size: 11.5px; color: var(--text-muted); }
.jt-more { margin-top: 6px; font-size: 13px; }
.jt-more summary { cursor: pointer; color: var(--text-secondary); margin-bottom: 6px; padding: 3px 0; min-height: 24px; }
.flow-note { margin: 8px 0 0; font-size: 11.5px; color: var(--text-muted); }
@media (max-width: 480px) {
  .jt-item { grid-template-columns: auto 1fr; }
  .jt-time { grid-column: 2; justify-items: start; text-align: left; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
}

/* ---------- Brand tag (e.g. "Health" on the status page) ---------- */
.brand-tag {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 4px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 15px;
}

.unofficial-note {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
}
.unofficial-note a { color: inherit; }
.unofficial-top { margin: 6px 0 4px; }

/* ---------- Degraded banner ---------- */
.degraded-banner {
  background: color-mix(in srgb, var(--status-warning) 18%, var(--surface-1));
  color: var(--text-primary);
  font-size: 12.5px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--border);
}

/* ---------- Map controls ---------- */
.map-controls {
  position: absolute;
  top: 12px; right: 12px;
  /* Above Leaflet's corner controls (1000), so on a phone the open key isn't
     hidden under the time control */
  z-index: 1001;
  font-size: 13px;
  overflow: hidden;
  max-width: calc(100% - 70px);
}
.layers-toggle {
  display: flex; align-items: center; gap: 7px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
}
.layers-toggle::after {
  content: "";
  margin-left: auto;
  width: 7px; height: 7px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s;
}
.layers-toggle[aria-expanded="false"]::after { transform: rotate(-45deg); }
@media (max-width: 900px) {
  .map-controls:not(.ready) .layers-body { display: none; }
  .map-controls:not(.ready) .layers-toggle::after { transform: rotate(-45deg); }
}
.layers-body {
  display: flex; flex-direction: column; gap: 7px;
  padding: 2px 12px 10px;
}
.layer-toggle { display: flex; align-items: center; gap: 8px; min-height: 28px; cursor: pointer; color: var(--text-secondary); white-space: nowrap; }
/* 18 px boxes, rows 28 px apart: each keeps a clear 24 px target (WCAG 2.5.8) */
.layer-toggle input { accent-color: var(--series-1); width: 18px; height: 18px; margin: 0; flex: none; }

.swatch { width: 14px; height: 4px; border-radius: 2px; display: inline-block; flex: none; }
.swatch-critical { background: var(--status-critical); }
.swatch-warning { background: var(--status-warning); }
.swatch-sma { background: var(--series-5); }
.swatch-vms { background: var(--series-1); height: 10px; width: 10px; border-radius: 3px; }


.swatch-vms-blank { height: 10px; width: 10px; border-radius: 3px; border: 2px solid var(--series-1); opacity: 0.6; }


.wind-arrow { display: flex; justify-content: center; transform-origin: 50% 50%; }
.wind-arrow-label {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 0 3px var(--surface-1), 0 0 3px var(--surface-1), 0 0 3px var(--surface-1);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Map legend ---------- */
.layers-legend {
  display: flex; flex-direction: column; gap: 5px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
}
.layers-legend > span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.key-line { display: inline-block; width: 22px; border-radius: 3px; flex: none; }
.key-closed { height: 6px; background: var(--status-warning); box-shadow: 0 0 0 2px color-mix(in srgb, var(--map-casing) 60%, transparent); }
.key-restricted { height: 3px; background: var(--status-warning); }
/* Signs about the bridge are drawn in its status colour: red, orange, amber, green */
.swatch-sign-bridge { height: 10px; width: 10px; border-radius: 3px; background: var(--sev, var(--status-serious)); }
.layers-legend > .key-sign-bridge { gap: 2px; white-space: normal; }
.key-sign-bridge .swatch-sign-bridge:last-of-type { margin-right: 4px; }
/* The bridge key wraps between entries, never inside one */
.layers-legend > .key-bridge { gap: 2px 6px; flex-wrap: wrap; white-space: normal; max-width: 230px; }
.key-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
/* Orange covers several things: that entry may wrap, its dot by the first line */
.key-item.key-wrap { white-space: normal; align-items: flex-start; }
.key-wrap .key-dot { margin-top: 3px; }
.key-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.key-open { background: var(--status-good); }
.key-warning { background: var(--status-warning); }
.key-serious { background: var(--status-serious); }
.key-critical { background: var(--status-critical); }
.key-unknown { background: var(--baseline); }

/* ---------- Map tools (top left, under zoom) ---------- */
.map-tools a {
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: var(--text-primary) !important;
}
.map-tools a[aria-pressed="true"] { color: var(--accent-text) !important; }

/* ---------- Map time control (bottom left) ---------- */
.map-time {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-raised);
  padding: 9px 12px 10px;
  width: 440px;
  max-width: calc(100vw - 24px);
  font-size: 12.5px;
  color: var(--text-secondary);
}
.map-time-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.map-time-label strong { color: var(--text-primary); font-size: 13.5px; }
.map-time-count { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* The bridge leads the map summary while it isn't simply open */
.mt-bridge { display: inline-flex; align-items: center; gap: 5px; color: var(--text-primary); font-weight: 700; }
.mt-bridge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--st, var(--baseline)); }
.mt-bridge.st-critical { color: var(--critical-text); }
.map-time-row { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.map-time-presets { display: flex; gap: 5px; flex: none; }
.mt-chip {
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.mt-chip:hover { border-color: var(--baseline); color: var(--text-primary); }
.mt-chip.active { background: var(--text-primary); border-color: var(--text-primary); color: var(--page); font-weight: 600; }
#map-time-range { flex: 1; min-width: 80px; height: 24px; margin: 0; accent-color: var(--accent-text); }
.map-time-next {
  display: block;
  margin-top: 4px;
  padding: 4px 0;
  min-height: 24px;
  border: 0;
  background: none;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.map-time-next:hover { text-decoration: underline; }
.map-time-next.pending { visibility: hidden; }

/* ---------- Map toast & tooltips ---------- */
.map-toast {
  position: absolute;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: min(420px, calc(100% - 140px));
  background: var(--text-primary);
  color: var(--page);
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 12.5px;
  box-shadow: var(--shadow-raised);
}
.leaflet-tooltip.map-tip {
  background: var(--surface-1);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-raised);
  font-size: 12px;
  line-height: 1.4;
  padding: 5px 8px;
}
.leaflet-tooltip.map-tip::before { display: none; }
.tip-sign {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Full-screen map ---------- */
.map-wrap.is-full {
  position: fixed;
  inset: 0;
  z-index: 1500;
  height: auto !important;
  min-height: 0;
}
body.map-full { overflow: hidden; }

/* ---------- Dark map (overlays keep their real colours) ---------- */
@media (prefers-color-scheme: dark) {
  /* The vector base map has its own dark style; only the no-WebGL raster
     fallback needs darkening */
  .basemap-raster { filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.85) saturate(0.55); }
  .leaflet-container { background: #1b1b1a; }
  .leaflet-bar a, .leaflet-control-scale-line { background: var(--surface-1); color: var(--text-primary); border-color: var(--border); }
  .leaflet-control-attribution { background: rgba(26, 26, 25, 0.8) !important; color: var(--text-muted); }
  .leaflet-control-attribution a { color: var(--text-secondary); }
}

/* The bridge's status, on its deck: a pill in the status colour, centred on
   the deck however long its label */
.bridge-badge {
  position: absolute;
  left: 0; top: 0;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 3px;
  border: 2px solid var(--st);
  border-radius: 999px;
  background: color-mix(in srgb, var(--st) 16%, var(--surface-1));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-size: 12.5px; font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.bridge-badge.st-none { --st: var(--baseline); }
.bridge-badge-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex: none;
  background: var(--st);
  color: #fff;
  font-size: 12px;
}
.bridge-badge.st-warning .bridge-badge-icon, .bridge-badge.st-serious .bridge-badge-icon { color: #0b0b0b; }
.bridge-badge.st-unknown .bridge-badge-icon, .bridge-badge.st-none .bridge-badge-icon { color: var(--text-primary); }
.bridge-badge.st-critical .bridge-badge-text { color: var(--critical-text); }
/* The other direction, or one that can't be confirmed, under the status */
.bridge-badge-note {
  display: block;
  font-size: 10.5px; font-weight: 700;
  color: var(--text-secondary);
}
/* Out of date: the last status known (the note says so). Only the icon
   fades, so the text stays as readable as ever */
.bridge-badge.is-stale { border-style: dashed; }
.bridge-badge.is-stale .bridge-badge-icon { opacity: 0.6; }
/* Leaflet's marker element is a point under the badge: the badge shows its focus */
.bridge-badge-anchor:focus-visible { outline: none; }
.bridge-badge-anchor:focus-visible .bridge-badge { outline: 2px solid var(--series-1); outline-offset: 2px; }

/* ---------- Map popups ---------- */
.leaflet-container { font-family: inherit; }
.leaflet-popup-content-wrapper {
  background: var(--surface-1);
  color: var(--text-primary);
  border-radius: 10px;
  box-shadow: var(--shadow-raised);
}
.leaflet-popup-tip { background: var(--surface-1); }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-muted); }
.popup-body { font-size: 12.5px; max-width: 260px; }
.popup-body h4 { margin: 0 0 4px; font-size: 13px; }
.popup-body .popup-times { color: var(--text-secondary); font-size: 12px; margin-top: 3px; }
.popup-body .popup-bridge { color: var(--accent-text); font-weight: 700; margin-top: 3px; }
.popup-body .sign-display { margin-top: 6px; }
.popup-body .popup-dirs { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 6px; font-size: 12px; }

/* ---------- Footer ---------- */
.footer {
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13.5px;
}
.footer a { color: inherit; }
.footer a:hover { color: var(--text-primary); }
.footer-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 16px 20px;
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(150px, 1fr));
  gap: 24px 32px;
}
.footer-about p { margin: 8px 0 14px; max-width: 46ch; line-height: 1.5; }
.footer-brand { display: inline-block; padding: 3px 0; font-size: 17px; font-weight: 800; color: var(--text-primary) !important; text-decoration: none; }
.footer-title {
  margin: 2px 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-col a { text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }
.footer-credits {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 16px 18px;
  border-top: 1px solid var(--grid);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 11.5px;
  color: var(--text-muted);
}
/* The live map page keeps one slim line on desktop, so the map keeps its height */
.footer-compact { display: none; }
@media (min-width: 901px) {
  .page-map .footer-main { display: none; }
  .page-map .footer-compact {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px;
    padding: 7px 16px 0;
    font-size: 11.5px;
    color: var(--text-muted);
  }
  .page-map .footer-credits { max-width: none; border-top: 0; padding: 4px 16px 7px; font-size: 11px; }
}
/* Bottom bar: the data credits */
.credits-list { display: flex; flex-wrap: wrap; gap: 4px 18px; min-width: 0; }
@media (max-width: 900px) {
  .footer-main { grid-template-columns: 1fr 1fr; gap: 22px; padding: 24px 16px 16px; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-main { grid-template-columns: 1fr; }
  .footer-col ul { gap: 10px; }
}

/* ---------- About page ---------- */
body.page-about { display: block; height: auto; min-height: 100%; }
html:has(body.page-about) { height: auto; }
.page-about .topbar { position: sticky; top: 0; }

.about {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 16px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.about:focus { outline: none; }
.about-hero h1 { font-size: 30px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.2px; }
.about-lede { font-size: 16.5px; color: var(--text-secondary); margin: 0; max-width: 64ch; }
.about-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.about-toc a {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.about-toc a:hover { background: var(--hover); }

.about-card { overflow-wrap: break-word; padding: 22px 24px; scroll-margin-top: calc(var(--topbar-h) + 12px); font-size: 15px; line-height: 1.6; }
.about-card h2 { font-size: 21px; margin: 0 0 10px; }
.about-card h3 { font-size: 15.5px; margin: 22px 0 6px; }
.about-card p { margin: 0 0 10px; }
.about-list { margin: 0 0 10px; padding-left: 22px; }
.about-list li { margin: 4px 0; }
.about-small { font-size: 12.5px; color: var(--text-muted); margin-top: 14px !important; }
.about-small a { color: inherit; }

.about-sources { margin: 0 0 6px; display: grid; gap: 0; border-top: 1px solid var(--grid); }
.about-sources > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.about-sources dt { font-weight: 600; }
.about-sources dd { margin: 0; color: var(--text-secondary); text-align: right; }

.about-callout {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--status-warning) 55%, transparent);
  background: color-mix(in srgb, var(--status-warning) 13%, var(--surface-1));
  font-size: 14px;
}
.about-callout a { color: inherit; font-weight: 600; }

.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}
.fact-grid > div {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--page);
  border: 1px solid var(--border);
}
.fact-grid dt { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.fact-grid dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

.creator-card { border-top: 3px solid var(--series-1); }
.creator-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.btn-primary { background: var(--accent-fill); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { border: 1px solid var(--border); color: var(--text-primary); background: var(--surface-1); }
.btn-secondary:hover { background: var(--hover); }

/* ---------- Gallery (3D model) ---------- */
.gallery {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.gallery:focus { outline: none; }
.gallery-head h1 { font-size: 30px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.2px; }
.gallery-h2 { font-size: 19px; margin: 6px 0 10px; }

.viewer-card { padding: 0; overflow: hidden; }
.viewer {
  position: relative;
  height: min(72vh, 760px);
  min-height: 380px;
  background: linear-gradient(#a9c8e6, #dfe9f1);
  touch-action: none;
}
.viewer canvas { display: block; width: 100%; height: 100%; }
.viewer:focus-visible { outline: 3px solid var(--series-1); outline-offset: -3px; }
.viewer-loading {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-weight: 600; color: #22303c;
}
.viewer-toolbar {
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; flex-wrap: wrap; gap: 6px;
  pointer-events: none;
  z-index: 2;
}
.vt-btn {
  pointer-events: auto;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(11, 11, 11, 0.14);
  background: rgba(252, 252, 251, 0.92);
  color: #0b0b0b;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.vt-btn[aria-pressed="true"] { background: #0b0b0b; color: #fff; border-color: #0b0b0b; }
.vt-btn:hover { filter: brightness(0.97); }
.viewer-status {
  position: absolute; left: 12px; bottom: 40px;
  max-width: calc(100% - 24px);
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(252, 252, 251, 0.94);
  color: #0b0b0b;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  z-index: 2;
}
.viewer-status .vs-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--st, #888); }
.viewer-hint {
  position: absolute; left: 0; right: 0; bottom: 0;
  margin: 0; padding: 6px 12px;
  font-size: 11.5px; color: #22303c;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.55));
  pointer-events: none;
  z-index: 2;
}

/* 3D labels (CSS2DRenderer) */
.m-label {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(11, 11, 11, 0.72);
  color: #fff;
  font: 600 11.5px/1.35 system-ui, -apple-system, "Segoe UI", sans-serif;
  white-space: nowrap;
  pointer-events: none;
}
.m-label.m-span { background: rgba(42, 120, 214, 0.9); }
.m-label.m-place { background: rgba(252, 252, 251, 0.95); color: #0b0b0b; font-size: 12.5px; }
.m-label.m-closed { background: #d03b3b; font-size: 12.5px; }
.m-label.m-restricted { background: #ec835a; }
.m-label.m-dim { background: rgba(250, 178, 25, 0.95); color: #0b0b0b; }
.labels-off .m-label { display: none; }

.shot-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.shot {
  display: block; width: 100%;
  padding: 0; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-1);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
}
.shot:hover { box-shadow: var(--shadow-raised); }
.shot[aria-pressed="true"] { outline: 2px solid var(--series-1); outline-offset: 1px; }
.shot img, .shot .shot-ph { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #c9d9e8; }
.shot-text { display: block; padding: 9px 12px 11px; }
.shot-title { display: block; font-weight: 700; font-size: 14px; }
.shot-sub { display: block; font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }
.model-notes { font-size: 13.5px; color: var(--text-secondary); }

/* ---------- Closure records ---------- */
/* Logged event types, most serious first. Validated as a categorical set
   across all pairs, not just neighbours (dataviz validate_palette.js --pairs
   all), because the daily stack skips absent types and the timeline puts any
   two side by side: at least 3:1 on the card and the timeline lanes in both
   themes, OKLab ΔE 15+ for normal vision and 8+ under protan and deutan
   simulation. */
:root {
  --type-closure: #962337;
  --type-possible: #9c4db5;
  --type-restriction: #cd733a;
  --type-incident: #e850a1;
  --type-delay: #7f6703;
  --type-queue: #088f82;
  --type-speed: #4a3aa5;
  --type-wind: #1d77e4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --type-closure: #cd4356;
    --type-possible: #a871c8;
    --type-restriction: #d07d1e;
    --type-incident: #fc00a3;
    --type-delay: #736901;
    --type-queue: #008d86;
    --type-speed: #6451eb;
    --type-wind: #3e95fc;
  }
}
.records { max-width: 1280px; margin: 0 auto; padding: 28px 16px 36px; display: flex; flex-direction: column; gap: 16px; }
.records:focus { outline: none; }
.records .about-hero { max-width: 900px; }
.records-ongoing {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  margin: 10px 0 0;
  padding: 7px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c, var(--type-closure)) 14%, var(--surface-1));
  border: 1px solid color-mix(in srgb, var(--c, var(--type-closure)) 50%, transparent);
  color: var(--text-primary);
  font-weight: 600;
}
.ro-item { display: flex; align-items: baseline; gap: 7px; }
.ro-item::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.ro-item:first-child { font-weight: 700; }
.records-filters { padding: 14px 16px; display: grid; gap: 10px; }
.rf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rf-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); min-width: 52px; }
.rchips { display: flex; flex-wrap: wrap; gap: 6px; }
.rchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.rchip:hover { background: var(--hover); }
.rchip[aria-pressed="true"] { background: var(--text-primary); color: var(--surface-1); border-color: var(--text-primary); }
.rchip-type[aria-pressed="false"] { opacity: 0.6; }
.rchip-type[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 16%, var(--surface-1)); color: var(--text-primary); border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.rdot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.rf-fields label { display: grid; gap: 3px; font-size: 12px; font-weight: 600; color: var(--text-muted); flex: 1 1 170px; min-width: 0; }
/* Widths don't follow the options, so filling the causes list doesn't move the page */
.rf-fields select { width: 100%; }
.rf-fields select, .rf-fields input {
  font: inherit; font-size: 14px; color: var(--text-primary);
  padding: 7px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-1);
}
.rf-search { flex: 1 1 200px; }
.rf-fields .btn-secondary { align-self: end; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.records-status { margin: 0; font-size: 13px; color: var(--text-muted); }
.records-status:empty { display: none; }
.records-kpis { margin: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 1500px) { .records-kpis { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.records-kpis .kpi-sub { font-size: 12px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }
.records-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card { padding: 16px 18px; min-width: 0; }
.chart-card h2 { font-size: 17px; margin: 0 0 4px; }
.chart-wide { grid-column: 1 / -1; }
.chart-note { margin: 0 0 8px; font-size: 12.5px; color: var(--text-muted); }
.chart { width: 100%; min-height: 60px; }
.chart svg { display: block; overflow: visible; }
.chart-empty { margin: 18px 0; font-size: 13.5px; color: var(--text-muted); }
.c-grid { stroke: var(--grid); stroke-width: 1; }
.c-axis { fill: var(--text-muted); font-size: 11px; font-family: inherit; }
.c-axis-gust { fill: var(--series-1); }
.c-gust { fill: none; stroke: var(--series-1); stroke-width: 2; }
.c-gust-dot { fill: var(--surface-1); stroke: var(--series-1); stroke-width: 2; }
.c-lane { fill: var(--page); }
/* A surface-coloured ring under each mark: a gap between stacked segments
   and overlapping marks that never hides a thin one */
.c-type { stroke: var(--surface-1); stroke-width: 2; paint-order: stroke; }
.c-ongoing { stroke: var(--text-primary); stroke-width: 1; stroke-dasharray: 3 2; paint-order: normal; }
.c-cell { stroke: none; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--text-secondary); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.chart-legend i.lg-line { height: 2px; width: 14px; vertical-align: 3px; background: var(--series-1); }
.cause-bars { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.cause-bars li { display: grid; grid-template-columns: minmax(90px, 1.2fr) 2fr auto; align-items: center; gap: 10px; font-size: 13px; }
.cb-bar { height: 12px; background: var(--page); border-radius: 6px; overflow: hidden; }
.cb-bar i { display: block; height: 100%; background: var(--status-critical); border-radius: 6px; }
.cb-val { font-variant-numeric: tabular-nums; color: var(--text-secondary); white-space: nowrap; }
.records-log { padding: 16px 18px; }
.log-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.log-head h2 { font-size: 17px; margin: 0; }
.log-count { color: var(--text-muted); font-size: 13px; }
.log-head .btn-secondary { margin-left: auto; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.log-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.log-table th, .log-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.log-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap; }
.log-table th button { all: unset; cursor: pointer; display: inline-block; padding: 4px 0; margin: -4px 0; min-height: 17px; }
.log-table th button:focus-visible { outline: 2px solid var(--series-1); border-radius: 4px; }
.log-table th[aria-sort="descending"] button::after { content: " ↓"; }
.log-table th[aria-sort="ascending"] button::after { content: " ↑"; }
.log-table td { font-variant-numeric: tabular-nums; }
.log-table tr.is-ongoing td { background: color-mix(in srgb, var(--c, var(--type-closure)) 8%, transparent); }
.td-details { min-width: 220px; }
.td-empty { text-align: center !important; color: var(--text-muted); padding: 22px !important; }
.muted { color: var(--text-muted); }
.type-tag { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; }
.type-tag::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.badge-ongoing { display: inline-block; padding: 0 7px; border-radius: 999px; border: 1px solid var(--c, var(--type-closure)); background: color-mix(in srgb, var(--c, var(--type-closure)) 16%, var(--surface-1)); color: var(--text-primary); font-size: 12px; font-weight: 700; }
.log-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 12px; font-size: 13px; }
.log-pager .btn-secondary { padding: 6px 12px; font-size: 13px; cursor: pointer; }
.log-pager .btn-secondary:disabled { opacity: 0.45; cursor: default; }
@media (max-width: 760px) {
  .records-charts { grid-template-columns: 1fr; }
  /* The log becomes stacked cards on phones */
  .log-table thead { display: none; }
  .log-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--grid); }
  .log-table td { display: grid; grid-template-columns: 88px 1fr; gap: 8px; border: 0; padding: 3px 0; }
  .log-table td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--text-muted); }
  .td-details { min-width: 0; }
}
@media (max-width: 480px) {
  .records { padding-top: 20px; }
  .records-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rf-label { min-width: 0; width: 100%; }
}

/* ---------- /health status page ---------- */
.health { max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; display: grid; gap: 16px; }
.health-head h1 { margin: 0 0 8px; font-size: 26px; }
.health-overall { display: inline-block; margin: 0; padding: 8px 12px; border-radius: 10px; font-weight: 700; }
.health-overall.is-ok { background: color-mix(in srgb, var(--status-good) 15%, var(--surface-1)); color: var(--good-text); }
.health-overall.is-warn { background: color-mix(in srgb, var(--status-warning) 20%, var(--surface-1)); }
.health-overall.is-bad { background: color-mix(in srgb, var(--status-critical) 15%, var(--surface-1)); color: var(--critical-text); }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.health-card { padding: 16px 18px; min-width: 0; }
.health-card h2 { margin: 0 0 10px; font-size: 16px; }
.health-wide { grid-column: 1 / -1; }
.hdl { margin: 0; display: grid; gap: 6px; font-size: 13.5px; }
.hdl > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--grid); padding-bottom: 5px; }
.hdl dt { color: var(--text-muted); }
.hdl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.htable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.health-card { min-width: 0; overflow-x: auto; }
.htable td { overflow-wrap: anywhere; }
.htable th, .htable td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.htable th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.hdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; background: var(--status-warning); }
.hdot.ok { background: var(--status-good); }
.hdot.bad { background: var(--status-critical); }
.health-list, .health-problems { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; }
.health-problems .hp-error { color: var(--critical-text); }
.htable .hsign { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.35; }

/* ---------- Cookie consent banner and privacy page ---------- */
.consent {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 3000;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  background: var(--surface-1);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-raised);
  font-size: 13.5px;
  line-height: 1.45;
}
.consent-text { margin: 0; flex: 1 1 260px; }
.consent-text a { color: inherit; font-weight: 600; }
.consent-actions { display: flex; gap: 8px; margin-left: auto; }
.consent-btn {
  min-width: 92px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
}
.consent-btn:hover { background: var(--hover); }
/* Accept and Reject carry equal weight: neither is the "easy" option */
.consent-accept { background: var(--text-primary); color: var(--surface-1); border-color: var(--text-primary); }
.consent-accept:hover { background: var(--text-primary); filter: brightness(1.2); }

.table-wrap { overflow-x: auto; margin: 10px 0 14px; }
.cookie-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cookie-table th, .cookie-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
.cookie-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.cookie-table code, .about-card code { font-size: 12.5px; background: var(--page); padding: 1px 5px; border-radius: 5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  :root { --sidebar-w: 400px; }
}

@media (max-width: 900px) {
  .brand-name { font-size: 16px; }
  /* Narrow screens: the menu folds into a button with a drop-down */
  .topnav { margin-left: 0; order: 1; }
  .topbar-right { order: 2; }
  .topnav .topnav-toggle { display: inline-flex; }
  .topnav-links {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    flex-direction: column;
    align-items: stretch;
    min-width: 200px;
    padding: 6px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-raised);
    z-index: 1300;
  }
  .topnav.open .topnav-links { display: flex; }
  .topnav-links a { padding: 11px 12px; font-size: 15px; color: var(--text-primary); }
  .topnav-icon { display: block; }
  :root { --topbar-h: 54px; }
  html, body { height: auto; }
  body { display: block; }

  .topbar {
    position: sticky; top: 0;
    gap: 10px;
    padding: 0 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .brand-icon { width: 32px; }
  .refresh-status #refresh-label { display: none; }

  .layout { display: flex; flex-direction: column; }
  .map-wrap { order: 0; height: 44vh; min-height: 260px; }
  .sidebar {
    order: 1;
    overflow: visible;
    padding: 12px 12px 20px;
  }
  .tabs { top: var(--topbar-h); margin: 0 -12px; padding: 0 12px; }
  .tab-panel { scroll-margin-top: calc(var(--topbar-h) + 52px); }
  .map-wrap { scroll-margin-top: var(--topbar-h); }
  .bridge-card { scroll-margin-top: calc(var(--topbar-h) + 10px); }

  .map-controls { top: 10px; right: 10px; }
  .map-wrap { height: 52vh; }
  .leaflet-bottom.leaflet-left { right: 0; }
  .map-time { width: auto; max-width: none; margin: 0 8px 22px !important; padding: 8px 10px; }
  .map-time-row { flex-wrap: wrap; }
  #map-time-range { flex-basis: 100%; }
  .leaflet-control-scale { display: none; }

  /* Filter chips scroll sideways instead of stacking on phones */
  .chip-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -12px;
    padding: 0 12px 2px;
  }
  .chip-group::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}

/* Phones: compact header — icon-only menu, status pill without its prefix */
@media (max-width: 600px) {
  .topbar { gap: 8px; }
  .brand-name { font-size: 15px; }
  .brand-name-sub { font-size: 11px; letter-spacing: 0.05em; }
  .brand-icon, .refresh-status { display: none; }
  .pill-prefix, .pill-prefix-short { display: none !important; }
}

@media (max-width: 360px) {
  .topbar { gap: 6px; padding: 0 10px; }
  /* Three wind tiles still fit their labels ("CROSSWIND") at 320 px */
  .wind-row { gap: 6px; }
  .wind-row .stat-tile { padding: 7px 5px; }
  .wind-row .stat-label { letter-spacing: 0; }
  .wind-row .stat-sub { font-size: 11px; }
  #refresh-now { display: none; } /* data still refreshes automatically */
  .bridge-pill { padding: 6px 9px 6px 8px; }
}

@media (max-width: 480px) {
  .gallery { padding-top: 18px; }
  .gallery-head h1 { font-size: 25px; }
  .viewer { height: 62vh; min-height: 340px; }
  .shot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .shot-title { font-size: 13px; }
  .shot-sub { display: none; }
  .about { padding-top: 20px; }
  .about-hero h1 { font-size: 25px; }
  .about-lede { font-size: 15.5px; }
  .about-card { padding: 18px 16px; }
  .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-sources > div { flex-direction: column; gap: 0; }
  .about-sources dd { text-align: left; }
  .pill-prefix { display: none; }
  .pill-prefix-short { display: inline; }
  .bridge-pill { padding: 6px 11px 6px 9px; }
  .stat-value { font-size: 22px; }
  .stat-tile { padding: 7px 8px; }
  .compass { width: 26px; height: 26px; }
}

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