/* MaxAlert Verification — UI styles.
   Tokens first; light is the default, dark applies from the OS setting unless
   the viewer picked a theme (data-theme on <html>, set by theme.js). Series
   colours: MaxAlert = categorical slot 1 (blue), NWS = slot 2 (orange) —
   validated as a pair in both modes (CVD ΔE ≥ 24, contrast ≥ 3:1). */

:root {
  color-scheme: light;
  --page: #f4f5f7;
  --surface: #fdfdfc;
  --surface-2: #f3f4f6;
  --surface-3: #e9ebef;
  --ink: #111418;
  --ink-2: #4a5160;
  --muted: #6f7684;
  --line: #e3e5ea;
  --line-strong: #cfd3da;
  --grid: #e7e8ec;
  --axis: #c3c2b7;
  --series-ours: #2a78d6;
  --series-nws: #eb6834;
  --map-tornado: #ff0000;
  --map-severe: #ffff00;
  --map-flash-flood: #13a04a;
  --map-flood: #3fb6a8;
  --ours-wash: rgba(42, 120, 214, .10);
  --nws-wash: rgba(235, 104, 52, .10);
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-soft: #e6f0fc;
  --good: #0ca30c;
  --good-ink: #006300;
  --critical: #d03b3b;
  --critical-ink: #b42828;
  --warning: #fab219;
  --warning-ink: #8a5a00;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-2: 0 8px 24px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .06);
  --ring: 0 0 0 3px rgba(42, 120, 214, .35);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 236px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0e1014; --surface: #171a1f; --surface-2: #1e2228; --surface-3: #272c33;
    --ink: #eef0f3; --ink-2: #c3c7cf; --muted: #8d939e;
    --line: #2a2f37; --line-strong: #3a404a; --grid: #262a31; --axis: #383d45;
    --series-ours: #3987e5; --series-nws: #d95926;
    --ours-wash: rgba(57, 135, 229, .14); --nws-wash: rgba(217, 89, 38, .14);
    --accent: #3987e5; --accent-ink: #86b6ef; --accent-soft: #15253a;
    --good-ink: #3fc23f; --critical-ink: #ff7b7b; --warning-ink: #f5c04a;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 10px 30px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35);
    --ring: 0 0 0 3px rgba(57, 135, 229, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e1014; --surface: #171a1f; --surface-2: #1e2228; --surface-3: #272c33;
  --ink: #eef0f3; --ink-2: #c3c7cf; --muted: #8d939e;
  --line: #2a2f37; --line-strong: #3a404a; --grid: #262a31; --axis: #383d45;
  --series-ours: #3987e5; --series-nws: #d95926;
  --ours-wash: rgba(57, 135, 229, .14); --nws-wash: rgba(217, 89, 38, .14);
  --accent: #3987e5; --accent-ink: #86b6ef; --accent-soft: #15253a;
  --good-ink: #3fc23f; --critical-ink: #ff7b7b; --warning-ink: #f5c04a;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35);
  --ring: 0 0 0 3px rgba(57, 135, 229, .45);
}

/* ---- base -------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--page); color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
h1 { font-size: 24px; line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0; font-weight: 600; }
h3 { font-size: 13px; margin: 18px 0 8px; color: var(--muted); font-weight: 600;
     text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 10px; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2);
       padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none;
        stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 14px; height: 14px; }

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

/* ---- app shell ----------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px 14px;
  z-index: 1100;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 6px 10px 20px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo { display: block; height: 28px; width: auto; max-width: 100%; }
.brand .app-name { font-size: 12.5px; font-weight: 650; color: var(--ink-2); letter-spacing: .06em; text-transform: uppercase; }
.brand.compact { flex-direction: row; align-items: center; gap: 9px; padding: 0; font-weight: 650; font-size: 15px; }
.brand .mark { width: 26px; height: 26px; display: block; }
/* Wordmark letters are white in the supplied artwork: show the ink-lettered
   copy on light surfaces and the original on dark ones. */
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .logo-light { display: none !important; }
  :root:where(:not([data-theme="light"])) .logo-dark { display: block !important; }
}
:root[data-theme="dark"] .logo-light { display: none !important; }
:root[data-theme="dark"] .logo-dark { display: block !important; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase;
             letter-spacing: .06em; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 9px;
  color: var(--ink-2); font-weight: 500; transition: background .15s var(--ease), color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); }
.nav a.on .icon { stroke: var(--accent); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px;
                display: flex; flex-direction: column; gap: 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; color: var(--ink); }
.user-chip:hover { background: var(--surface-2); text-decoration: none; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
          background: var(--surface-3); color: var(--ink-2); font-weight: 650; font-size: 13px; }
.user-chip b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.user-chip span { font-size: 12px; color: var(--muted); }
.foot-actions { display: flex; gap: 6px; }
.foot-actions > * { flex: 1; }

.main { min-width: 0; }
.topbar { display: none; }
.content { max-width: 1340px; margin: 0 auto; padding: 26px 28px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
             flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }
footer.app-foot { color: var(--muted); font-size: 12px; text-align: center; padding: 8px 16px 28px; }

/* ---- buttons & inputs ------------------------------------------------------ */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  padding: 9px 14px; border-radius: 9px; border: 1px solid transparent; cursor: pointer;
  background: var(--accent); color: #fff; transition: background .15s, box-shadow .15s, transform .05s;
  white-space: nowrap;
}
.btn:hover, button:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active, button:active { transform: translateY(1px); }
.btn.ghost, button.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-2); filter: none; }
.btn.subtle, button.subtle { background: transparent; color: var(--ink-2); border-color: transparent; padding: 7px 10px; }
.btn.subtle:hover, button.subtle:hover { background: var(--surface-2); filter: none; }
button.danger { background: var(--critical); }
.btn.sm, button.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 11px;
  transition: border-color .15s, box-shadow .15s; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; padding: 0; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
form.inline { display: inline; }
form.stack { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
form.stack input { width: 100%; }
form.row-form { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.card.narrow { max-width: 620px; }

/* ---- filter bar ------------------------------------------------------------- */
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line);
       border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button {
  padding: 6px 11px; border-radius: 7px; font-size: 13px; font-weight: 550; color: var(--ink-2);
  background: transparent; border: 0; line-height: 1.2;
}
.seg a:hover { background: var(--surface); text-decoration: none; color: var(--ink); }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.custom-range { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.custom-range input { padding: 6px 8px; font-size: 13px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
        padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 99px;
        font-size: 13px; font-weight: 550; color: var(--ink-2); background: var(--surface);
        transition: background .15s, border-color .15s, color .15s; user-select: none; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { border-color: var(--muted); }
.chip:has(input:checked) { background: var(--surface-3); color: var(--ink); border-color: var(--ink-2); }
.chip:has(input:focus-visible) { box-shadow: var(--ring); }
.chip:not(:has(input:checked)) .dot { opacity: .35; }
.search { position: relative; display: inline-flex; align-items: center; }
.search .icon { position: absolute; left: 10px; color: var(--muted); pointer-events: none; width: 16px; height: 16px; }
.search input { padding-left: 32px; width: 230px; }
.filter-row .grow { flex: 1; }
.js .js-hide { display: none; }

/* ---- cards / grid ---------------------------------------------------------------- */
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow-1); padding: 18px 20px; min-width: 0; margin-bottom: 16px; }
.grid > .card { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .hint { color: var(--muted); font-size: 13px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 16px 20px 0; }

/* ---- stat tiles -------------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 15px 16px 14px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 4px; }
.tile .label { color: var(--muted); font-size: 13px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.tile .label .key { width: 10px; height: 3px; border-radius: 2px; background: var(--series-ours); }
.tile .value { font-size: 30px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.tile .value small { font-size: 15px; font-weight: 550; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.tile .vs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.tile .vs .nws-key { display: inline-block; width: 10px; height: 3px; border-radius: 2px; background: var(--series-nws); margin-right: 5px; vertical-align: 3px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 1px 7px 1px 5px; border-radius: 99px; }
.delta.better { color: var(--good-ink); background: color-mix(in srgb, var(--good) 12%, transparent); }
.delta.worse { color: var(--critical-ink); background: color-mix(in srgb, var(--critical) 12%, transparent); }
.delta.same { color: var(--muted); background: var(--surface-2); }

/* ---- pills / badges ------------------------------------------------------------------ */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 99px;
        font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.pill .icon { width: 13px; height: 13px; stroke-width: 2.5; }
.pill.ok { color: var(--good-ink); background: color-mix(in srgb, var(--good) 13%, transparent); }
.pill.no { color: var(--critical-ink); background: color-mix(in srgb, var(--critical) 12%, transparent); }
.pill.warn { color: var(--warning-ink); background: color-mix(in srgb, var(--warning) 20%, transparent); }
.pill.na { color: var(--muted); background: var(--surface-2); }
.pill.info { color: var(--accent-ink); background: var(--accent-soft); }
.hz { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
/* Hazard identity follows NWS map conventions; the label always rides along. */
.dot.h-tornado { background: #e02020; }
.dot.h-severe { background: #f2a400; }
.dot.h-flash_flood { background: #13a04a; }
.dot.h-flood { background: #3fb6a8; }

/* ---- tabs ---------------------------------------------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 0; overflow-x: auto;
        padding: 0 20px; }
.tabs a { padding: 11px 12px 10px; color: var(--muted); font-weight: 550; font-size: 14px; border-bottom: 2px solid transparent;
          margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2);
         border-radius: 99px; padding: 0 7px; line-height: 1.6; }
.tabs a.on .count { color: var(--accent-ink); background: var(--accent-soft); }

/* ---- tables ------------------------------------------------------------------------------------ */
.tbl-wrap { overflow-x: auto; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted);
           font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
thead th a { color: inherit; display: inline-flex; gap: 4px; align-items: center; }
thead th a.on { color: var(--ink); }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 55%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
tr[data-href] { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 240px; max-width: 520px; }
td .title { font-weight: 550; color: var(--ink); }
td .title:hover { color: var(--accent-ink); }
td .sub { display: block; color: var(--muted); font-size: 12.5px; }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 20px; }
.card.flush table th:last-child, .card.flush table td:last-child { padding-right: 20px; }
.side-ours { color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
.side-ours::before, .side-nws::before { content: ""; width: 10px; height: 3px; border-radius: 2px; background: var(--series-ours); }
.side-nws { color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
.side-nws::before { background: var(--series-nws); }
tr.group-start td { border-top: 1px solid var(--line-strong); }
.pos { color: var(--good-ink); font-weight: 600; }
.neg { color: var(--critical-ink); font-weight: 600; }

.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
              padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pager { display: inline-flex; gap: 4px; align-items: center; }
.pager a, .pager span.cur { min-width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0 8px;
                            border-radius: 8px; border: 1px solid var(--line); color: var(--ink-2); font-weight: 550; }
.pager a:hover { background: var(--surface-2); text-decoration: none; }
.pager span.cur { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .gap { padding: 0 4px; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .icon { width: 30px; height: 30px; margin-bottom: 8px; color: var(--line-strong); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---- key/value lists --------------------------------------------------------------------- */
dl.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; margin: 0; }
dl.kv dt, dl.kv dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; }
dl.kv dt { color: var(--ink-2); }
dl.kv dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
dl.kv dd .sub { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
dl.kv > :nth-last-child(-n+2) { border-bottom: 0; }

/* ---- summary strip (product page) -------------------------------------------------------- */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0;
         background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
         box-shadow: var(--shadow-1); margin-bottom: 16px; overflow: hidden; }
.strip > div { padding: 14px 18px; border-right: 1px solid var(--line); }
.strip > div:last-child { border-right: 0; }
.strip .label { color: var(--muted); font-size: 12.5px; font-weight: 550; }
.strip .value { font-size: 18px; font-weight: 650; margin-top: 2px; }
.strip .value small { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---- timeline: three lanes — other side's issuances (squares, top), the
   alert's valid period + verifying reports (track), key moments labelled
   underneath; a clock axis at the bottom. Details live in hover titles and
   the tables below, so markers never need text of their own. */
.timeline { position: relative; height: 112px; margin: 4px 8px 0; }
.timeline .track { position: absolute; left: 0; right: 0; top: 46px; height: 4px; border-radius: 2px; background: var(--surface-3); }
.timeline .window { position: absolute; top: 42px; height: 12px; border-radius: 6px; background: var(--ours-wash);
                    border: 1.5px solid var(--series-ours); }
.timeline.nws .window { background: var(--nws-wash); border-color: var(--series-nws); }
.tl-ev { position: absolute; top: 41px; transform: translateX(-50%); width: 14px; height: 14px; outline: none; }
.tl-ev i { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--surface);
           background: var(--ink-2); transition: transform .15s var(--ease); }
.tl-ev:hover i, .tl-ev:focus-visible i { transform: scale(1.35); }
.tl-ev.issued i, .tl-ev.end i { background: var(--series-ours); }
.timeline.nws .tl-ev.issued i, .timeline.nws .tl-ev.end i { background: var(--series-nws); }
.tl-ev.report i { background: var(--good); }
.tl-ev.cancel i { background: var(--critical); }
.tl-ev.other { top: 12px; }
.tl-ev.other i { border-radius: 3px; background: var(--series-nws); }
.timeline.nws .tl-ev.other i { background: var(--series-ours); }
.tl-ev .l { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); white-space: nowrap;
            font-size: 12px; color: var(--ink-2); }
.tl-ev .l b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.tl-ev.key.first .l { left: 0; transform: none; }
.tl-ev.key.last .l { left: auto; right: 0; transform: none; }
.tl-ev.key.alt .l { top: 36px; }
.timeline .axis { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; border-top: 1px solid var(--line); }
.timeline .tick { position: absolute; top: 2px; transform: translateX(-50%); font-size: 11px; color: var(--muted);
                  font-variant-numeric: tabular-nums; }
.tl-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* ---- charts ----------------------------------------------------------------------------------- */
.chart { position: relative; height: 260px; }
.g-main > [data-chart-card] { display: flex; flex-direction: column; }
.g-main > [data-chart-card] .chart { flex: 1 1 260px; min-height: 260px; height: auto; }
.g-main > [data-chart-card] .chart + .chart { margin-top: 12px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.legend .lk { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }
.legend .lk.box { width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.lk.ours { background: var(--series-ours); } .lk.nws { background: var(--series-nws); }
.view-toggle { display: inline-flex; }
.chart-table { display: none; max-height: 260px; overflow: auto; }
.show-table .chart-table { display: block; }
.show-table .chart { display: none; }

/* ---- map ---------------------------------------------------------------------------------------- */
#map { height: 480px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.map-legend i { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.map-legend .poly { width: 22px; height: 14px; border-radius: 2px; border: 2px dashed currentColor; background: transparent; color: #8a8f98; }
.map-legend .poly.nws { border-style: solid; }
.map-legend .poly.edit { border-style: dotted; }
.map-legend .poly.h-tornado { color: var(--map-tornado); }
.map-legend .poly.h-severe { color: var(--map-severe); }
.map-legend .poly.h-flash_flood { color: var(--map-flash-flood); }
.map-legend .poly.h-flood { color: var(--map-flood); }
.map-legend .pt { width: 10px; height: 10px; border-radius: 50%; background: #1a7f37; box-shadow: 0 0 0 2px var(--surface); }
.map-legend .pt.other { background: #8a8f98; }
.leaflet-container { font: 13px/1.4 var(--font); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
/* leaflet.css loads after this file, so these need the extra container class to win. */
.leaflet-container .leaflet-bar a, .leaflet-container .leaflet-control-layers { background-color: var(--surface); color: var(--ink); border-color: var(--line); }
.leaflet-container .leaflet-bar a:hover { background-color: var(--surface-2); }
.leaflet-container .leaflet-bar { border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.leaflet-container .leaflet-control-layers { border: 1px solid var(--line); box-shadow: var(--shadow-1); border-radius: 8px; }
:root[data-theme="dark"] .leaflet-control-layers-toggle { filter: invert(.9); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .leaflet-control-layers-toggle { filter: invert(.9); } }
.map-card { display: flex; flex-direction: column; }
.map-card #map { flex: 1 1 480px; min-height: 480px; height: auto; }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--accent-ink); }
/* OSM has no dark style: invert its tiles in dark mode (polygons and markers
   live in other panes, so their colours are untouched). */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .tiles-osm { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }
}
:root[data-theme="dark"] .tiles-osm { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9); }

/* ---- notices --------------------------------------------------------------------------------------- */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 16px;
          border: 1px solid; font-size: 14px; }
.notice .icon { margin-top: 1px; }
.notice.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--ink); }
.notice.info .icon { color: var(--accent); }
.notice.bad { background: color-mix(in srgb, var(--critical) 9%, var(--surface)); border-color: color-mix(in srgb, var(--critical) 35%, transparent); }
.notice.bad .icon { color: var(--critical); }
.err { color: var(--critical-ink); background: color-mix(in srgb, var(--critical) 9%, var(--surface));
       border: 1px solid color-mix(in srgb, var(--critical) 30%, transparent); padding: 10px 12px; border-radius: 9px; font-size: 14px; }
.note { background: var(--accent-soft); padding: 10px 12px; border-radius: 9px; font-size: 14px; }
pre.raw { max-height: 420px; overflow: auto; background: var(--surface-2); padding: 14px; border-radius: 9px;
          font-family: var(--mono); font-size: 12px; margin: 10px 0 0; }
details > summary { cursor: pointer; color: var(--ink-2); font-weight: 550; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; display: inline-block; }
details[open] > summary::before { transform: rotate(90deg); }

/* ---- auth ------------------------------------------------------------------------------------------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
             background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%), var(--page); }
.auth { width: 100%; max-width: 400px; }
.auth .brand { align-items: center; padding-bottom: 24px; gap: 12px; }
.auth .brand .logo { height: 44px; }
.auth .card { padding: 26px 26px 24px; box-shadow: var(--shadow-2); }
.auth h1 { font-size: 20px; margin-bottom: 6px; }
.auth .lede { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth input { padding: 10px 12px; font-size: 15px; width: 100%; }
.auth button { padding: 11px 14px; font-size: 15px; }
.auth .qr { display: block; margin: 6px auto 14px; width: 200px; height: 200px; background: #fff; border-radius: 10px; padding: 6px; }
.secret { font-family: var(--mono); font-size: 16px; letter-spacing: 1px; user-select: all; background: var(--surface-2);
          padding: 10px 12px; border-radius: 8px; word-break: break-all; margin: 8px 0 0; }
.code-input { font-family: var(--mono); font-size: 22px !important; letter-spacing: .35em; text-align: center; }

/* ---- responsive --------------------------------------------------------------------------------------- */
@media (max-width: 1100px) { .g-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-100%);
             transition: transform .22s var(--ease); box-shadow: var(--shadow-2); }
  .nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 1050; opacity: 0;
           pointer-events: none; transition: opacity .2s; }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 1000;
            padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .topbar .brand { padding: 0; }
  .content { padding: 18px 16px 40px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .search input { width: 100%; }
  .search { flex: 1; min-width: 180px; }
  #map { height: 360px; }
  h1 { font-size: 21px; }
}
@media (min-width: 901px) { .scrim { display: none; } }
.tl-k { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.tl-k.ours { border-radius: 3px; background: var(--ours-wash); border: 1px solid var(--series-ours); width: 16px; }
.timeline.nws ~ .tl-legend .tl-k.ours { background: var(--nws-wash); border-color: var(--series-nws); }
.tl-k.other { background: var(--series-nws); border-radius: 3px; }
.timeline.nws ~ .tl-legend .tl-k.other { background: var(--series-ours); }
.tl-k.report { background: var(--good); }
.tl-k.cancel { background: var(--critical); }
.content { transition: opacity .18s var(--ease); }
.content.loading { opacity: .55; pointer-events: none; }
