/* ---------- Font (self-hosted: no third-party request, stricter CSP) ---------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --bg: #EAF1FB;
  --surface: #FFFFFF;
  --surface-2: #F4F7FC;
  --ink: #14151A;
  --ink-soft: #6B7280;
  --ink-faint: #9CA3AF;
  --border: #E4E9F2;
  --border-soft: #EEF2F9;

  --accent: #4C6FFF;
  --accent-strong: #2F4FE0;
  --accent-soft: #E7ECFF;
  --accent-contrast: #FFFFFF;

  --safe: #16A34A;
  --safe-soft: #DEFBE6;
  --watch: #B45309;
  --watch-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-soft: #FDE2E1;

  --lavender: #EDE9FE; --lavender-ink: #6D28D9;
  --mint: #DCFCE7; --mint-ink: #15803D;
  --yellow: #FEF3C7; --yellow-ink: #A16207;
  --pink: #FCE7F3; --pink-ink: #BE185D;

  --sea: #DCEAFB;
  --land: #F1ECDF;
  --land-line: #D8CFAE;
  --chart-label-ink: #8A8574;

  --chip-veil: rgba(255, 255, 255, 0.62);
  --live-red: #DC2626;

  /* AQI severity scale (follows the US AQI category order) */
  --aqi1: #15803D; --aqi1-soft: #DCFCE7;
  --aqi2: #A16207; --aqi2-soft: #FEF9C3;
  --aqi3: #C2410C; --aqi3-soft: #FFEDD5;
  --aqi4: #B91C1C; --aqi4-soft: #FEE2E2;
  --aqi5: #7E22CE; --aqi5-soft: #F3E8FF;
  --aqi6: #881337; --aqi6-soft: #FFE4E6;

  --dark-panel: #14151A;
  --dark-panel-ink: #F4F5F7;

  --shadow-soft: 0 1px 2px rgba(20, 21, 26, 0.04), 0 8px 24px -12px rgba(20, 21, 26, 0.10);
  --shadow-lift: 0 4px 10px rgba(20, 21, 26, 0.06), 0 20px 40px -16px rgba(20, 21, 26, 0.16);

  --font-display: "Plus Jakarta Sans", -apple-system, "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Plus Jakarta Sans", -apple-system, "Segoe UI", sans-serif;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0F13; --surface: #17181F; --surface-2: #1D1F28;
    --ink: #F2F3F6; --ink-soft: #A6ABBA; --ink-faint: #767C8D;
    --border: #2A2C36; --border-soft: #23252E;

    --accent: #8CA0FF; --accent-strong: #B0BEFF; --accent-soft: #232746; --accent-contrast: #0E0F13;

    --safe: #4ADE80; --safe-soft: #14301F;
    --watch: #F2B84B; --watch-soft: #3A2C10;
    --danger: #F0716A; --danger-soft: #3A1918;

    --lavender: #241F3D; --lavender-ink: #B9A3F5;
    --mint: #10281B; --mint-ink: #7CD8A0;
    --yellow: #332A10; --yellow-ink: #F2C94C;
    --pink: #331A28; --pink-ink: #F2A0CE;

    --sea: #101C2C; --land: #2F2718; --land-line: #63553A;
    --chart-label-ink: #C0B49A;
    --chip-veil: rgba(0, 0, 0, 0.38);
    --live-red: #DC2626;
    --aqi1: #6EE7A0; --aqi1-soft: #12301F;
    --aqi2: #F0C750; --aqi2-soft: #33290E;
    --aqi3: #FB9A5A; --aqi3-soft: #38210F;
    --aqi4: #F87171; --aqi4-soft: #3A1717;
    --aqi5: #C79BF5; --aqi5-soft: #2A1A3D;
    --aqi6: #F0779A; --aqi6-soft: #3A1224;
    --dark-panel: #0A0B0E; --dark-panel-ink: #F4F5F7;

    --shadow-soft: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px -12px rgba(0,0,0,0.5);
    --shadow-lift: 0 4px 10px rgba(0,0,0,0.35), 0 20px 40px -16px rgba(0,0,0,0.6);
  }
}
:root[data-theme="dark"] {
  --bg: #0E0F13; --surface: #17181F; --surface-2: #1D1F28;
  --ink: #F2F3F6; --ink-soft: #A6ABBA; --ink-faint: #767C8D;
  --border: #2A2C36; --border-soft: #23252E;
  --accent: #8CA0FF; --accent-strong: #B0BEFF; --accent-soft: #232746; --accent-contrast: #0E0F13;
  --safe: #4ADE80; --safe-soft: #14301F;
  --watch: #F2B84B; --watch-soft: #3A2C10;
  --danger: #F0716A; --danger-soft: #3A1918;
  --lavender: #241F3D; --lavender-ink: #B9A3F5;
  --mint: #10281B; --mint-ink: #7CD8A0;
  --yellow: #332A10; --yellow-ink: #F2C94C;
  --pink: #331A28; --pink-ink: #F2A0CE;
  --sea: #101C2C; --land: #2F2718; --land-line: #63553A;
  --chart-label-ink: #C0B49A;
  --chip-veil: rgba(0, 0, 0, 0.38);
  --live-red: #DC2626;
  --aqi1: #6EE7A0; --aqi1-soft: #12301F;
  --aqi2: #F0C750; --aqi2-soft: #33290E;
  --aqi3: #FB9A5A; --aqi3-soft: #38210F;
  --aqi4: #F87171; --aqi4-soft: #3A1717;
  --aqi5: #C79BF5; --aqi5-soft: #2A1A3D;
  --aqi6: #F0779A; --aqi6-soft: #3A1224;
  --dark-panel: #0A0B0E; --dark-panel-ink: #F4F5F7;
  --shadow-soft: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px -12px rgba(0,0,0,0.5);
  --shadow-lift: 0 4px 10px rgba(0,0,0,0.35), 0 20px 40px -16px rgba(0,0,0,0.6);
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body);
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; color: var(--ink); text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent); }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; }
.skip-link a { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-contrast); padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100; }
.skip-link a:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.text-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.micro-note { font-size: 0.82rem; color: var(--ink-faint); line-height: 1.6; margin-top: 14px; }
.icon { width: 20px; height: 20px; flex: none; }
.icon-lg { width: 26px; height: 26px; }

/* ---------- Shared page container (keeps every section's edges aligned) ----------
   Components inside must never set the `padding` shorthand, or they wipe out
   this horizontal gutter — use padding-top / padding-bottom longhand instead. */
.page-x { max-width: 1240px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
@media (max-width: 640px) { .page-x { padding-left: 18px; padding-right: 18px; } }

/* ---------- Breaking-news ticker (single row: LIVE badge + scrolling text) ---------- */
.ticker {
  display: flex; align-items: stretch; background: var(--dark-panel); color: var(--dark-panel-ink);
  border-bottom: 1px solid var(--border-soft);
}
.ticker-live {
  flex: none; display: flex; align-items: center; gap: 6px; font-size: 0.68rem; font-weight: 800;
  letter-spacing: 0.08em; background: var(--live-red); color: #fff; padding: 7px 14px;
}
.ticker-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.8s ease-in-out infinite; }
.ticker-viewport { flex: 1; overflow: hidden; min-width: 0; }
.ticker-track { display: flex; gap: 44px; white-space: nowrap; padding: 7px 0 7px 16px; animation: tickerScroll 55s linear infinite; width: max-content; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item { display: inline-flex; align-items: baseline; gap: 8px; font-size: 0.82rem; font-weight: 500; }
.ticker-item time { font-size: 0.72rem; opacity: 0.65; }
.ticker-item a { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; overflow-x: auto; }
}

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-soft); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.wordmark-glyph { width: 26px; height: 26px; }
.wordmark-glyph path { fill: var(--accent); }
.wordmark-glyph .glyph-vent { fill: var(--watch); }
.wordmark-text { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.wordmark-text strong { font-weight: 800; }
.topbar-status-wrap { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.signal-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.signal-wrap { position: relative; }
.topbar-status {
  display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.01em;
  background: var(--watch-soft); color: var(--watch); padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
}
.topbar-status:hover { border-color: color-mix(in srgb, var(--watch) 45%, transparent); }
/* Wind signal pill — same visual language as the alert pill */
.wind-pill {
  display: flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent; background: var(--surface-2); color: var(--ink-soft);
}
.wind-pill.is-away { background: var(--mint); color: var(--mint-ink); }
.wind-pill.is-cross { background: var(--yellow); color: var(--yellow-ink); }
.wind-pill.is-toward { background: var(--pink); color: var(--pink-ink); }
.wind-pill:hover { border-color: currentColor; }
.wind-pill svg { width: 13px; height: 13px; flex: none; }
.signal-tip[hidden] { display: none; }
.signal-tip {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: max-content; max-width: min(300px, 78vw);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lift); padding: 12px 14px; font-size: 0.82rem; color: var(--ink-soft); line-height: 1.5;
  white-space: normal;
}
.signal-tip strong { display: block; color: var(--ink); font-weight: 700; margin-bottom: 3px; font-size: 0.86rem; }
.signal-tip em { display: block; margin-top: 6px; font-style: normal; font-size: 0.74rem; color: var(--ink-faint); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--watch); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--watch) 55%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--watch) 0%, transparent); } }
.status-freshness { font-size: 0.72rem; color: var(--ink-faint); padding-left: 4px; }
.topbar-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.lang-toggle { display: flex; background: var(--surface-2); border-radius: 999px; overflow: hidden; padding: 3px; }
.lang-btn { border: none; background: transparent; color: var(--ink-soft); font-weight: 700; font-size: 0.76rem; padding: 6px 13px; cursor: pointer; border-radius: 999px; transition: background .18s ease, color .18s ease; }
.lang-btn.is-active { background: var(--dark-panel); color: var(--dark-panel-ink); }

/* ---------- Compact hero ---------- */
.hero-compact { padding-top: 30px; padding-bottom: 6px; }
.eyebrow { font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; font-size: 0.72rem; color: var(--accent); margin-bottom: 10px; }
.hero-compact h1 { font-size: clamp(1.5rem, 2.8vw, 2.15rem); line-height: 1.2; font-weight: 800; max-width: 46ch; }
.hero-compact p { margin-top: 10px; font-size: 0.98rem; color: var(--ink-soft); max-width: 62ch; }

/* ---------- Disclaimer ---------- */
.disclaimer-ribbon {
  margin-top: 18px; padding: 14px 18px 14px 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-md); display: flex; gap: 12px; align-items: flex-start; font-size: 0.85rem; color: var(--ink-soft);
}
.disclaimer-icon { width: 19px; height: 19px; flex: none; margin-top: 1px; color: var(--accent); }
.disclaimer-ribbon strong { color: var(--ink); }

/* ---------- Map section (dominant) ---------- */
.map-section { margin-top: 18px; }
.map-frame {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift); overflow: hidden;
}
.map-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 22px;
  border-bottom: 1px solid var(--border-soft); background: var(--surface);
}
.map-title { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.map-title h2 { font-size: 1.2rem; }
.map-legend { display: flex; gap: 14px; font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); flex-wrap: wrap; }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.legend-swatch { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-away { background: var(--safe); } .legend-cross { background: var(--watch); } .legend-toward { background: var(--danger); }

.map-stage { position: relative; background: var(--sea); }
.chart-map { width: 100%; height: auto; display: block; }
/* Readout sits below the map, never on top of it — the volcano marker is in the
   top-left of the chart and an overlay there hid it. */
.map-readout { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px 22px 0; background: var(--surface); }
.map-chip {
  font-size: 0.8rem; font-weight: 700; padding: 9px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--ink);
}
.map-chip#mapTimeChip { font-weight: 600; color: var(--ink-soft); }
.map-chip.is-toward { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border-soft)); }
.map-chip.is-cross { color: var(--watch); border-color: color-mix(in srgb, var(--watch) 35%, var(--border-soft)); }
.map-chip.is-away { color: var(--safe); border-color: color-mix(in srgb, var(--safe) 35%, var(--border-soft)); }

.map-controls { display: flex; align-items: center; gap: 14px; padding: 16px 22px; background: var(--surface); flex-wrap: wrap; }
.play-btn {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: none;
  background: var(--dark-panel); color: var(--dark-panel-ink); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .15s ease;
}
.play-btn:hover { transform: scale(1.06); }
.play-btn svg { width: 16px; height: 16px; }
.time-slider-wrap { flex: 1 1 260px; min-width: 220px; }
.time-slider { width: 100%; accent-color: var(--accent); }
.time-slider-label { display: flex; justify-content: space-between; font-size: 0.76rem; font-weight: 600; color: var(--ink-soft); margin-top: 4px; }

/* Map: mobile needs a guaranteed-legible minimum size, panned by scroll rather than squished */
@media (max-width: 640px) {
  .map-stage { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .chart-map { width: 640px; height: 314px; max-width: none; }
}

/* SVG chart map internals */
.chart-land { fill: var(--land); stroke: var(--land-line); stroke-width: 1.5; }
.chart-graticule { stroke: color-mix(in srgb, var(--ink) 6%, transparent); stroke-width: 1; }
.chart-label { font-size: 11px; font-weight: 700; fill: var(--chart-label-ink); letter-spacing: 0.03em; }
.chart-place-dot { fill: var(--ink-faint); }
.krakatau-marker circle.pulse { fill: none; stroke: var(--danger); stroke-width: 2; animation: mapPulse 2.6s ease-out infinite; transform-origin: center; }
.krakatau-marker circle.core { fill: var(--danger); }
@keyframes mapPulse { 0% { r: 6; opacity: .9; } 100% { r: 26; opacity: 0; } }
.jakarta-marker circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.jakarta-marker text, .krakatau-marker text { font-weight: 700; font-size: 13px; fill: var(--ink); }
.wind-arrow .shaft-base { stroke: var(--accent); stroke-width: 3.4; stroke-linecap: round; opacity: 0.35; }
.wind-arrow .shaft-flow { stroke: var(--accent-strong); stroke-width: 3.4; stroke-linecap: round; }
.wind-arrow path.head { fill: var(--accent-strong); }
.drift-cone { transition: opacity .3s ease; }
.compass-rose { opacity: 0.55; }
.compass-rose text { font-size: 10px; font-weight: 700; fill: var(--ink-faint); }
.compass-rose line { stroke: var(--ink-faint); stroke-width: 1; }
@media (prefers-reduced-motion: reduce) {
  .krakatau-marker circle.pulse { animation: none; opacity: 0; }
}

/* ---------- Icon bullets (affected-today, actions) ---------- */
.icon-bullets { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.icon-bullet { display: flex; gap: 14px; align-items: flex-start; }
.icon-bullet .icon-badge { flex: none; width: 40px; height: 40px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.icon-bullet .icon-badge.tone-watch { background: var(--yellow); color: var(--yellow-ink); }
.icon-bullet .icon-badge.tone-safe { background: var(--mint); color: var(--mint-ink); }
.icon-bullet .icon-badge.tone-danger { background: var(--pink); color: var(--pink-ink); }
.icon-bullet strong { display: block; font-size: 0.98rem; margin-bottom: 2px; font-weight: 700; }
.icon-bullet span { color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- Section shell (affected-today, actions, aqi) ---------- */
.stack-section { margin-top: 20px; }
.card-block {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 26px 26px; box-shadow: var(--shadow-soft);
}
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.section-head .icon-badge { flex: none; width: 38px; height: 38px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.section-head h2 { font-size: 1.3rem; }
.panel-kicker { font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; font-size: 0.7rem; color: var(--accent); }

/* Actions phases */
.phase-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.phase-card { border-radius: var(--radius-md); padding: 18px 18px 16px; min-width: 0; }
.phase-card.phase-a { background: var(--mint); }
.phase-card.phase-b { background: var(--yellow); }
.phase-card.phase-c { background: var(--pink); }
.phase-card h3 { font-size: 0.98rem; font-weight: 800; margin-bottom: 10px; }
.phase-card.phase-a h3 { color: var(--mint-ink); } .phase-card.phase-b h3 { color: var(--yellow-ink); } .phase-card.phase-c h3 { color: var(--pink-ink); }
.phase-card ul { display: flex; flex-direction: column; gap: 8px; }
.phase-card li { font-size: 0.88rem; color: var(--ink); padding-left: 16px; position: relative; }
.phase-card li::before { content: "—"; position: absolute; left: 0; opacity: 0.5; }

/* ---------- AQI: schematic Jakarta map ---------- */
.aqi-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; margin-top: 18px; align-items: start; }
.aqi-map-wrap { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 10px; }
.aqi-map { width: 100%; height: auto; display: block; }
.aqi-zone-shape { stroke-width: 2; stroke-linejoin: round; transition: opacity .2s ease; cursor: default; }
.aqi-zone-name { font-size: 12px; font-weight: 700; text-anchor: middle; }
.aqi-zone-value { font-size: 25px; font-weight: 800; text-anchor: middle; }
.aqi-sea { fill: var(--sea); }
.aqi-sea-label { font-size: 11px; font-weight: 700; fill: var(--chart-label-ink); letter-spacing: 0.06em; text-anchor: middle; }
.aqi-side { display: flex; flex-direction: column; gap: 14px; }
.aqi-headline { display: flex; flex-direction: column; gap: 2px; }
.aqi-headline .aqi-avg { font-size: 2.1rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.aqi-headline .aqi-avg-label { font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; }
.aqi-scale { display: flex; flex-direction: column; gap: 6px; }
.aqi-scale-row { display: flex; align-items: center; gap: 9px; font-size: 0.78rem; color: var(--ink-soft); }
.aqi-scale-row.is-current { color: var(--ink); font-weight: 700; }
.aqi-swatch { width: 14px; height: 14px; border-radius: 5px; flex: none; border: 1.5px solid; }
.aqi-scale-range { margin-left: auto; font-size: 0.72rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .aqi-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Accordion ---------- */
.accordion { margin-top: 20px; padding-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.accordion-item { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-md); overflow: hidden; }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: transparent; border: none;
  cursor: pointer; text-align: left; color: var(--ink);
}
.accordion-trigger .icon-badge { flex: none; width: 38px; height: 38px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.accordion-trigger .label { flex: 1; }
.accordion-trigger .label strong { display: block; font-size: 1.02rem; font-weight: 700; }
.accordion-trigger .label span { font-size: 0.82rem; color: var(--ink-faint); }
.accordion-trigger .chevron { flex: none; width: 18px; height: 18px; color: var(--ink-faint); transition: transform .25s ease; }
.accordion-item.is-open .chevron { transform: rotate(180deg); }
.accordion-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.accordion-item.is-open .accordion-panel { grid-template-rows: 1fr; }
.accordion-panel-inner { overflow: hidden; padding: 0 20px; min-width: 0; }
.accordion-item.is-open .accordion-panel-inner { padding: 0 20px 24px; }
@media (prefers-reduced-motion: reduce) { .accordion-panel { transition: none; } }

/* ---------- Wind detail (inside accordion) ---------- */
.wind-layout { display: grid; grid-template-columns: minmax(0,220px) minmax(0,1fr); gap: 28px; align-items: start; }
.compass-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.compass { width: 100%; max-width: 200px; }
.compass-ring { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.5; }
.compass-ring-inner { fill: none; stroke: var(--border-soft); stroke-width: 1; }
.compass-cardinal { font-size: 11px; font-weight: 700; fill: var(--ink-faint); text-anchor: middle; }
.compass-tick { stroke: var(--border); stroke-width: 1; }
.wind-needle { transform-origin: 110px 110px; transition: transform 1s cubic-bezier(.34,1.4,.4,1); }
.needle-shape { fill: var(--accent); }
.needle-hub { fill: var(--accent-strong); stroke: var(--surface); stroke-width: 2; }
.readout-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 22px; margin-top: 8px; }
.readout-grid dt { font-size: 0.74rem; color: var(--ink-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.readout-grid dd { margin: 3px 0 0; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.outlook-table-shell { overflow-x: auto; margin-top: 18px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); }
.outlook-table { border-collapse: collapse; width: 100%; min-width: 680px; }
.outlook-table th, .outlook-table td { padding: 9px 11px; text-align: center; border-bottom: 1px solid var(--border-soft); }
.outlook-table th { font-size: 0.7rem; color: var(--ink-faint); font-weight: 700; text-transform: uppercase; background: var(--surface-2); }
.outlook-table td:first-child, .outlook-table th:first-child { text-align: left; font-weight: 600; font-size: 0.82rem; color: var(--ink-soft); white-space: nowrap; background: var(--surface-2); position: sticky; left: 0; }
.wind-chip { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; }
.wind-chip svg { width: 13px; height: 13px; }
.wind-chip.away { background: var(--mint); color: var(--mint-ink); }
.wind-chip.cross { background: var(--yellow); color: var(--yellow-ink); }
.wind-chip.toward { background: var(--pink); color: var(--pink-ink); }

/* ---------- Link lists / timeline / checklists (reused inside accordion) ---------- */
.link-list { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.link-list li { display: flex; flex-direction: column; gap: 4px; }
.link-list a { font-weight: 700; text-decoration: none; }
.link-list a:hover { text-decoration: underline; }
.link-note { font-size: 0.84rem; color: var(--ink-soft); }

.timeline { display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 18px; padding: 14px 0; border-top: 1px solid var(--border-soft); }
.timeline li:first-child { border-top: none; }
.timeline time { font-size: 0.8rem; color: var(--accent); font-weight: 700; padding-top: 2px; }
.timeline p { color: var(--ink-soft); font-size: 0.92rem; }

.check-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.check-list li { position: relative; padding-left: 24px; color: var(--ink-soft); font-size: 0.92rem; }
.check-list li::before { content: ""; position: absolute; left: 0; top: 4px; width: 13px; height: 13px; border-radius: 5px; border: 1.5px solid var(--accent); background: var(--accent-soft); }
.check-list li::after { content: ""; position: absolute; left: 3.5px; top: 7px; width: 6px; height: 3px; border-left: 1.6px solid var(--accent); border-bottom: 1.6px solid var(--accent); transform: rotate(-45deg); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border-soft); margin-bottom: 18px; }
.tab-btn { font-size: 0.88rem; font-weight: 700; color: var(--ink-faint); background: transparent; border: none; padding: 9px 4px; margin-right: 18px; cursor: pointer; border-bottom: 2px solid transparent; transition: color .18s ease, border-color .18s ease; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; animation: fadeIn .3s ease; }
.tab-panel.is-active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Sources footer ---------- */
.sources-footer { margin-top: 10px; padding-top: 34px; padding-bottom: 90px; border-top: 1px solid var(--border-soft); }
.sources-footer h2 { font-size: 1.2rem; margin-bottom: 18px; }
.sources-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.source-card { display: flex; flex-direction: column; gap: 4px; padding: 15px 17px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border-soft); text-decoration: none; color: var(--ink); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; min-width: 0; }
.source-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--accent); }
.source-card strong { font-size: 0.96rem; font-weight: 700; }
.source-card span { font-size: 0.82rem; color: var(--ink-soft); }
.foot-note { margin-top: 22px; font-size: 0.78rem; color: var(--ink-faint); max-width: 78ch; }

/* ---------- Floating status badge ---------- */
.floating-badge { position: fixed; right: 18px; bottom: 18px; z-index: 50; max-width: 300px; }
.floating-badge-btn {
  display: flex; align-items: center; gap: 10px; background: var(--dark-panel); color: var(--dark-panel-ink);
  border: none; border-radius: 999px; padding: 10px 16px 10px 10px; box-shadow: var(--shadow-lift); cursor: pointer;
  font-size: 0.78rem; font-weight: 700;
}
.floating-badge-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--watch); flex: none; animation: pulse 2.2s ease-in-out infinite; }
.floating-badge-detail {
  margin-top: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; box-shadow: var(--shadow-lift); font-size: 0.84rem; color: var(--ink-soft); display: none;
}
.floating-badge.is-open .floating-badge-detail { display: block; }
.floating-badge-detail strong { color: var(--ink); display: block; margin-bottom: 4px; }
.floating-badge-freshness { font-size: 0.72rem; color: var(--ink-faint); margin-top: 8px; display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .wind-layout { grid-template-columns: minmax(0,1fr); }
  .phase-grid { grid-template-columns: minmax(0,1fr); }
  .aqi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .sources-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .aqi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sources-grid { grid-template-columns: minmax(0,1fr); }
  .map-readout { padding: 12px 16px 0; }
  .map-toolbar, .map-controls { padding-left: 16px; padding-right: 16px; }
  .card-block { padding: 20px 18px; }
  .floating-badge { right: 10px; bottom: 10px; max-width: calc(100vw - 20px); }
}

/* ---------- Data freshness stamps + model-resolution note ---------- */
.data-stamp { font-size: 0.72rem; color: var(--ink-faint); font-weight: 600; align-self: center; }
.grid-note { font-size: 0.76rem; color: var(--ink-faint); line-height: 1.5; margin-top: 2px; }

/* An AWAS escalation must look different, not just read differently. */
.topbar-status.is-critical { background: var(--danger-soft); color: var(--danger); }
.topbar-status.is-critical .live-dot { background: var(--danger); }

/* ---------- Quick jump (actionable content is otherwise ~3 screens down) ---------- */
.quick-jump { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.quick-jump a {
  font-size: 0.82rem; font-weight: 700; text-decoration: none; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 8px 14px;
  border: 1px solid transparent; transition: border-color .16s ease;
}
.quick-jump a:hover { border-color: var(--accent); }

/* ---------- Region picker ---------- */
.region-picker { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.region-picker label { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
.region-picker select {
  font: inherit; font-size: 0.85rem; font-weight: 600; padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer;
}
.region-readout { font-size: 0.85rem; font-weight: 700; }
.aqi-zone-shape.is-selected { stroke-width: 4; }
