/* Park Pulse Live. No inline styles anywhere: CSP style-src 'self'. */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/Inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f4f4f1;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6b6a65;          /* text-grade muted: 5.0:1 on surface */
  --axis-muted: #898781;     /* chart tick labels (non-essential, direct values are in text) */
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --series: #2a78d6;         /* today */
  --series-soft: rgba(42, 120, 214, 0.22);
  --compare: #6b6a65;        /* last year: neutral, dashed */
  --now: #0b0b0b;
  --good: #006300;
  --attention: #9a3412;
  --good-dot: #0ca30c;
  --warn-dot: #fab219;
  --warn-bg: #fff3d6;
  --warn-ink: #5c3a00;
  --warn-border: #e0a200;
  --pill-bg: #eceae4;
  --focus: #1c5cab;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #a9a8a0;
    --axis-muted: #898781; --grid: #2c2c2a; --baseline: #383835; --border: rgba(255,255,255,0.10);
    --series: #3987e5; --series-soft: rgba(57,135,229,0.28); --compare: #a9a8a0; --now: #f0efec;
    --good: #0ca30c; --attention: #f3a07a; --warn-bg: #3a2c00; --warn-ink: #ffe3a1; --warn-border: #fab219;
    --pill-bg: #2a2a28; --focus: #86b6ef;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #a9a8a0;
  --axis-muted: #898781; --grid: #2c2c2a; --baseline: #383835; --border: rgba(255,255,255,0.10);
  --series: #3987e5; --series-soft: rgba(57,135,229,0.28); --compare: #a9a8a0; --now: #f0efec;
  --good: #0ca30c; --attention: #f3a07a; --warn-bg: #3a2c00; --warn-ink: #ffe3a1; --warn-border: #fab219;
  --pill-bg: #2a2a28; --focus: #86b6ef;
}
/* Teams high-contrast: black, white, yellow. Text is 15:1 or better. */
:root[data-theme="contrast"] {
  color-scheme: dark;
  --bg: #000; --surface: #000; --ink: #fff; --ink-2: #fff; --muted: #fff;
  --axis-muted: #fff; --grid: #666; --baseline: #fff; --border: #fff;
  --series: #ffff00; --series-soft: rgba(255,255,0,0.35); --compare: #fff; --now: #fff;
  --good: #3ff23f; --attention: #ffb08a; --good-dot: #3ff23f; --warn-dot: #ffff00;
  --warn-bg: #000; --warn-ink: #ffff00; --warn-border: #ffff00; --pill-bg: #000; --focus: #ffff00;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  padding: 12px 12px 28px;
  max-width: 1100px;
  margin-inline: auto;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 13px; font-weight: 650; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.sub { color: var(--ink-2); font-size: 13px; }
.small { font-size: 12.5px; color: var(--ink-2); }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.topbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 4px 2px 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--pill-bg); border: 1px solid var(--border); font-size: 13px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.pill-live .dot { background: var(--good-dot); }
.pill-stale { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-border); }
.pill-stale .dot { background: var(--warn-dot); }
@media (prefers-reduced-motion: no-preference) {
  .pill-live .dot { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: 0.45; } }
}

.banner { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-weight: 600; font-size: 14px; }

.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.grid.dim .card .big, .grid.dim .card svg, .grid.dim .card .stat { opacity: 0.7; }
@media (min-width: 720px) {
  .grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .span-2 { grid-column: 1 / -1; }
  body { padding: 16px 20px 32px; }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 14px 16px; min-width: 0; }
.big { font-size: 40px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.05; }
.hero .big { font-size: 64px; letter-spacing: -0.03em; line-height: 1; }
.big-label { color: var(--ink-2); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.big + .big-label { margin-top: 2px; }
.hero .big-label:first-child, .hero .big-label:first-of-type { margin-bottom: 4px; }
.hero .split { margin-top: 6px; font-size: 16px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chip { background: var(--pill-bg); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; min-width: 88px; }
.chip .n { display: block; font-size: 18px; font-weight: 700; }
.chip .l { display: block; font-size: 12px; color: var(--ink-2); }
.pace { margin-top: 10px; font-weight: 600; }
.pace-note { color: var(--ink-2); font-size: 12.5px; font-weight: 400; }
.cmp { margin-top: 8px; font-size: 14px; }
.cmp .row { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; margin-top: 3px; }
.delta { font-weight: 700; }
.delta.up { color: var(--good); }
.delta.down { color: var(--attention); }
.delta.same { color: var(--ink-2); }

.cars .line { margin-top: 4px; font-size: 14px; }
.kv { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; }
.kv > div { min-width: 0; }
.kv b { font-size: 20px; font-weight: 700; display: block; }
.kv span { font-size: 12px; color: var(--ink-2); }

.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart text { font-family: "Inter", "Helvetica Neue", Arial, sans-serif; font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .t-ink { fill: var(--ink-2); }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--baseline); stroke-width: 1; }
.chart .bar { fill: var(--series); }
.chart .area { fill: var(--series-soft); }
.chart .line-today { stroke: var(--series); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.chart .line-ly { stroke: var(--compare); stroke-width: 2; fill: none; stroke-dasharray: 4 3; opacity: 0.8; }
.chart .now-line { stroke: var(--now); stroke-width: 1.5; stroke-dasharray: 2 2; }
.chart .now-dot { fill: var(--series); stroke: var(--surface); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--series); vertical-align: middle; margin-right: 5px; }
.legend i.ly { border-top: 2px dashed var(--compare); }
.legend i.bar { height: 9px; width: 9px; border: 0; background: var(--series); border-radius: 2px 2px 0 0; }
.legend i.nowm { border-top: 2px dotted var(--now); }

.weather-now { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.segs { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.seg { background: var(--pill-bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.seg .nm { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.seg .em { font-size: 20px; margin-right: 4px; }
.seg .tt { font-size: 16px; font-weight: 700; }

.rec { margin-top: 10px; }
.rec:first-of-type { margin-top: 0; }
.rec .txt { font-size: 14px; }
.rec svg { display: block; width: 100%; height: 8px; margin-top: 5px; }
.rec .track { fill: var(--grid); }
.rec .fill { fill: var(--series); }
.rec.broken .txt { font-weight: 700; color: var(--good); }
.rec.broken .fill { fill: var(--good-dot); }

details { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px; }
summary { cursor: pointer; padding: 12px 14px; font-weight: 650; font-size: 14px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--ink-2); }
details[open] > summary::after { content: "–"; }
.tickets { margin-top: 10px; }
.tickets-line { font-size: 14px; font-weight: 600; }
.tickets .small { margin-top: 3px; }
.unscan-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.unscan-txt { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.unscan-txt b { font-size: 18px; }
.spark { flex: none; width: 84px; height: 20px; }
.spark .line-today { stroke: var(--series); stroke-width: 1.5; fill: none; }
.spark .now-dot { fill: var(--series); stroke: var(--surface); stroke-width: 1; }
.stn-h { margin-top: 10px; font-weight: 600; }
details > .body { padding: 0 14px 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--grid); }
th:first-child, td:first-child { text-align: left; }
th { font-size: 12px; color: var(--ink-2); font-weight: 600; }
tfoot td { font-weight: 700; border-bottom: 0; }
.details-wrap { display: contents; }

.message { text-align: center; padding: 48px 20px; }
.message h2 { font-size: 20px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.message p { color: var(--ink-2); margin-top: 8px; }
.footer { margin-top: 16px; font-size: 12px; color: var(--ink-2); text-align: center; line-height: 1.6; }

body.config { display: grid; place-items: center; min-height: 100vh; }
.config-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; max-width: 460px; }
.config-card p { margin-top: 10px; }

@media (forced-colors: active) {
  .chart .bar, .rec .fill { forced-color-adjust: none; }
}

.tri { display: inline-block; margin-right: 4px; vertical-align: baseline; fill: currentColor; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.retry { margin-top: 16px; font: inherit; font-weight: 650; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--pill-bg); color: var(--ink); cursor: pointer; }
