/* Wildwell Weather — house design system.
   Dark deep-navy/BLUE is the house default (reference: GNOME weather aesthetic).
   Light theme via [data-theme="light"] on <html>. Tokens only here; no per-page colors. */

:root {
  /* dark (default) — blue family, never neutral gray/black */
  --bg: #0a1322;
  --bg-raised: #0f1b30;
  --bg-panel: #101f38;
  --border: #1d2f4d;
  --border-strong: #2a4570;
  --text: #e9eef6;
  --text-muted: #93a5c0;
  --text-faint: #647692;
  --accent: #4da3ff;
  --accent-dim: #2b6cb0;
  --ok: #3fb96b;
  --warn: #e0a83a;      /* staleness, advisories */
  --danger: #e05252;    /* warnings — reserved */
  --extreme: #b64ae0;   /* reserved for genuinely extreme values only */
  --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="light"] {
  --bg: #f3f6fb;
  --bg-raised: #ffffff;
  --bg-panel: #ffffff;
  --border: #d4ddea;
  --border-strong: #b6c4d9;
  --text: #16233a;
  --text-muted: #48597a;
  --text-faint: #7c8aa5;
  --accent: #1f6fd0;
  --accent-dim: #4a90d9;
}

* { box-sizing: border-box; }
/* [hidden] must ALWAYS win — class display rules (.ww-panel{display:flex} etc.)
   out-specify the UA's [hidden]{display:none}, which made "hidden" panels
   render as empty boxes (design review R2 finding #1, the real R1-C bug). */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- header ---------- */
.ww-header {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.ww-wordmark {
  /* typographic wordmark — logo drops in here later without layout change */
  font-weight: 700; letter-spacing: 0.14em; font-size: 1.05rem;
  color: var(--text); white-space: nowrap;
}
.ww-wordmark a { color: inherit; }
.ww-wordmark .ww-wm-weather { color: var(--accent); }
.ww-header-controls { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.ww-search { position: relative; }
.ww-search input.ww-search-err { border-color: var(--danger, #e05252); }
.ww-search-suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 50; margin-top: 2px;
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35); min-width: 12rem; }
.ww-suggest-item { display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--text); padding: 0.4rem 0.6rem; font-size: 0.85rem; cursor: pointer; }
.ww-suggest-item:hover { background: var(--bg-hover, rgba(120,150,190,0.15)); }
.ww-header-controls select, .ww-header-controls button, .ww-search input {
  background: var(--bg-panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0.3rem 0.55rem; font-size: 0.85rem; font-family: var(--sans);
}
.ww-header-controls button { cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; }
.ww-header-controls button:hover { border-color: var(--border-strong); }
.ww-icon { width: 16px; height: 16px; vertical-align: -3px; }
:root:not([data-theme="light"]) img.ww-icon { filter: invert(0.9) hue-rotate(180deg); }

/* ---------- nav tabs ---------- */
.ww-nav {
  display: flex; gap: 0.15rem; flex-wrap: wrap;
  padding: 0 0.75rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.ww-nav a {
  padding: 0.45rem 0.8rem; color: var(--text-muted);
  border-bottom: 2px solid transparent; font-size: 0.9rem;
}
.ww-nav a:hover { color: var(--text); text-decoration: none; }
.ww-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.ww-nav a.ww-nav-placeholder { color: var(--text-faint); font-style: italic; }

/* ---------- layout ---------- */
.ww-main { max-width: 1280px; margin: 0 auto; padding: 1rem; }
.ww-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* ---------- panel (every data panel uses this shell) ---------- */
.ww-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ww-panel-head {
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--border);
}
.ww-panel-title { font-size: 0.95rem; font-weight: 600; margin: 0; }
.ww-panel-age { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; color: var(--text-faint); white-space: nowrap; }
.ww-panel-body { padding: 0.8rem; flex: 1; }
.ww-panel-credit {
  padding: 0.35rem 0.8rem;
  border-top: 1px solid var(--border);
  font-size: 0.7rem; color: var(--text-faint);
}

/* staleness states (A3 machinery drives these) */
.ww-panel.is-stale .ww-panel-age { color: var(--warn); }
.ww-panel.is-stale::after {
  content: attr(data-stale-msg);
  display: block; padding: 0.4rem 0.8rem;
  background: color-mix(in srgb, var(--warn) 18%, var(--bg-panel));
  color: var(--warn); font-size: 0.78rem;
}
.ww-panel.is-stale-critical::after {
  background: color-mix(in srgb, var(--danger) 22%, var(--bg-panel));
  color: var(--danger); font-weight: 600;
}

/* ---------- numerics: monospace-flavored data readouts ---------- */
.ww-num, .ww-data { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ww-big-num { font-family: var(--mono); font-size: 2.4rem; font-weight: 500; line-height: 1.1; }
.ww-unit { font-size: 0.6em; color: var(--text-muted); }

/* ---------- badges / alert severity (NWS display conventions arrive in B7) ---------- */
.ww-badge {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 4px;
  font-size: 0.75rem; font-weight: 600;
}
.ww-badge-quiet { background: var(--bg-raised); color: var(--text-muted); border: 1px solid var(--border); }
.ww-badge-experimental { background: color-mix(in srgb, var(--accent) 20%, var(--bg-panel)); color: var(--accent); }
.ww-cat-badge { background: var(--bg-raised); color: var(--text-muted); border: 1px solid var(--border-strong); }

/* ---------- named-storm archive: year index (decade groups + chips) ---------- */
.ww-archive-decade { margin: 1.4rem 0; }
.ww-archive-decade-h { font-size: 1rem; color: var(--text-muted); margin: 0 0 0.5rem; }
.ww-archive-years { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.ww-year-chip {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  padding: 0.5rem 0.4rem; border-radius: 8px; text-decoration: none;
  background: var(--bg-panel); border: 1px solid var(--border);
  color: var(--text); transition: border-color 0.12s;
}
.ww-year-chip:hover { border-color: var(--accent); }
.ww-year-chip strong { font-family: var(--mono); font-size: 0.95rem; }
.ww-year-count { font-size: 0.68rem; color: var(--text-faint); }
.ww-year-current { border-color: var(--accent); }
.ww-year-pending { opacity: 0.6; }
.ww-archive-card .ww-cat-badge { vertical-align: middle; }

/* ---------- the official/Wildwell separator (legal structure on event pages) ----------
   The most legally load-bearing element on the page: it must read as a hard
   boundary between official content (above) and Wildwell content (below) —
   never as fine print. */
.ww-separator {
  margin: 3.5rem 0; padding: 1.1rem 1.25rem;
  border-top: 5px solid var(--accent);
  border-bottom: 5px solid var(--accent);
  background: var(--bg-panel);
  color: var(--text); font-size: 1.05rem; font-weight: 600;
  line-height: 1.5; text-align: center;
}

/* ---------- Wildwell section grouping (storm-page reorg) ----------
   Measured-data subsections vs the ONE model-output subsection (Wildwell
   Modeling) — kickers + zone styling keep the two framings apart. */
.ww-wgroup-head {
  display: flex; align-items: baseline; gap: 0.6rem;
  margin: 2rem 0 0.9rem; padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.ww-wgroup-head h2 { margin: 0; font-size: 1.05rem; }
.ww-wgroup-kicker {
  font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ok);
}
.ww-wgroup-kicker-model { color: var(--warn); }
.ww-wgrid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .ww-wgrid { grid-template-columns: 1fr; } }
.ww-wthumb { width: 100%; border-radius: 4px; cursor: zoom-in; }
.ww-wzone-model {
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border));
  background: color-mix(in srgb, var(--warn) 6%, var(--bg-raised));
  border-radius: 10px; padding: 0.9rem;
}
/* Wildwell Models page (first model live) */
.wm-init-notice {
  margin: 0.6rem 0; padding: 0.6rem 0.8rem; border-radius: 8px;
  border: 1px solid var(--warn); color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--bg-raised));
  font-size: 0.88rem; font-weight: 600; line-height: 1.45;
}
.wm-meta { margin: 0.5rem 0; }
.wm-verif { margin-top: 0.7rem; font-size: 0.88rem; }
.wm-caveats { margin: 0.5rem 0 0; padding-left: 1.2rem; font-size: 0.85rem; line-height: 1.5; }
#wm-lead { white-space: nowrap; }
#wm-lead.wm-beyond { color: var(--warn); }
.wm-story { margin-top: 1rem; }
.wm-story h3 { font-size: 0.95rem; margin: 1.1rem 0 0.3rem; color: var(--text); }
.wm-story p { font-size: 0.9rem; line-height: 1.6; color: var(--text-muted); margin: 0.4rem 0; }
.wm-story p strong, .wm-story p em { color: var(--text); }
/* full-size lightbox for Wildwell thumbnails (mobile + desktop) */
.ww-wlightbox {
  position: fixed; inset: 0; z-index: 210; cursor: zoom-out;
  background: rgba(4, 8, 16, 0.93);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.ww-wlightbox figure { margin: 0; max-width: min(1140px, 96vw); }
.ww-wlightbox img { width: 100%; max-height: 82vh; object-fit: contain; border-radius: 6px; }
.ww-wlightbox figcaption { margin-top: 0.6rem; text-align: center; color: var(--text); font-size: 0.95rem; }
.ww-wlightbox .ww-wlb-tag { display: block; color: var(--warn); font-size: 0.85rem; margin-top: 0.3rem; }

/* ---------- update clock ---------- */
.ww-clock-row {
  display: flex; gap: 0.75rem; align-items: baseline;
  font-family: var(--mono); font-size: 0.82rem;
  padding: 0.25rem 0;
  border-bottom: 1px dotted var(--border);
}
.ww-clock-row:last-child { border-bottom: none; }
.ww-clock-when { margin-left: auto; color: var(--accent); white-space: nowrap; }
.ww-clock-past { color: var(--text-faint); }

/* ---------- footer ---------- */
.ww-footer {
  margin-top: 2rem; padding: 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-muted); font-size: 0.78rem;
}
.ww-footer p { max-width: 1280px; margin: 0.35rem auto; }
.ww-footer .ww-footer-links a { margin-right: 1rem; }

/* ---------- map attribution (mandatory on every map) ---------- */
.ww-map { position: relative; }
.ww-map-attrib {
  position: absolute; right: 4px; bottom: 4px;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  padding: 1px 6px; border-radius: 3px;
  font-size: 0.68rem; color: var(--text-muted);
}

/* ---------- main page components ---------- */
.ww-severe-banner {
  padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 1rem;
  font-weight: 700; text-align: center;
}
.ww-locbar {
  display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem;
  font-size: 0.95rem;
}
.ww-locbar button {
  background: var(--bg-panel); color: var(--accent);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 0.25rem 0.6rem; font-size: 0.8rem; cursor: pointer;
}
.ww-alert { padding: 0.5rem 0.8rem; margin-bottom: 0.6rem; background: var(--bg-raised); border-radius: 4px; }
.ww-alert-event { padding: 0.05rem 0.45rem; border-radius: 3px; font-weight: 700; font-size: 0.85rem; }
.ww-alert-headline { margin: 0.3rem 0; font-size: 0.88rem; }
.ww-wx-icon { width: 42px; height: 42px; }
.ww-cond-top { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.8rem; }
.ww-cond-icon { width: 84px; height: 84px; }
.ww-cond-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.5rem 1rem; margin: 0;
}
.ww-cond-grid dt { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.ww-cond-grid dd { margin: 0; font-size: 0.95rem; }
.ww-hourly {
  display: flex; gap: 0.3rem; overflow-x: auto; padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border); margin-bottom: 0.8rem;
}
.ww-hour { min-width: 58px; text-align: center; font-size: 0.78rem; }
.ww-periods { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.6rem; }
.ww-period { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem; font-size: 0.8rem; }
.ww-period-name { font-weight: 600; }
.ww-period-short { color: var(--text-muted); font-size: 0.75rem; }
.ww-sunmoon { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.6rem; }
.ww-sunmoon > div { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.ww-sunmoon img { width: 38px; height: 38px; }
.ww-map video { display: block; width: 100%; border-radius: 4px; }
.ww-fixture-badge { position: absolute; top: 6px; left: 6px; }

/* ---------- global models page ---------- */
.gm-selectors { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.gm-pill {
  background: var(--bg-panel); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.3rem 0.9rem; font-size: 0.85rem; cursor: pointer;
}
.gm-pill[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg-panel)); }
.gm-pill:disabled { color: var(--text-faint); font-style: italic; cursor: not-allowed; }
.gm-field { margin-left: auto; background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.5rem; }
#gm-frame { display: block; width: 100%; border-radius: 4px; background: var(--bg); min-height: 200px; }
.gm-controls { display: flex; gap: 0.6rem; align-items: center; margin: 0.6rem 0; }
.gm-controls input[type="range"] { flex: 1; }
.gm-controls button { background: var(--bg-raised); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 0.25rem 0.7rem; cursor: pointer; }
.gm-exports { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; font-size: 0.82rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--border); }
.gm-exports button { background: var(--bg-raised); color: var(--accent); border: 1px solid var(--border); border-radius: 6px; padding: 0.25rem 0.7rem; cursor: pointer; }
.gm-exports select { background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: 4px; }
.gm-busy { opacity: 0.5; pointer-events: none; }
.gm-compare-bar { margin-top: 0.6rem; font-size: 0.82rem; color: var(--text-muted); }
.gm-compare-bar label { margin-right: 0.8rem; }
.gm-compare-controls {
  display: flex; align-items: center; gap: 0.6rem; margin-top: 0.8rem;
  padding: 0.4rem 0.6rem; border-radius: 8px;
  background: var(--bg-raised); border: 1px solid var(--border);
}
.gm-compare-controls input[type="range"] { flex: 1; }
.gm-cmp-time { font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
#gm-compare { margin-top: 0.6rem; }
.gm-compare-cell { position: relative; }
.gm-compare-cell img { width: 100%; border-radius: 4px; display: block; }
.gm-compare-cap {
  position: absolute; left: 6px; bottom: 6px;
  padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.72rem;
  font-family: var(--mono); color: var(--text);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
}
/* a compare model held past the end of its run reads as held, not live */
.gm-compare-cell.gm-past-horizon img { opacity: 0.45; filter: grayscale(0.4); }
.gm-compare-cell.gm-past-horizon .gm-compare-cap { color: var(--warn); }

/* ---------- tropics + live storm ---------- */
.ww-tropics-banners { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.ww-storm-banner {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.9rem; border-radius: 6px;
  background: color-mix(in srgb, var(--warn) 16%, var(--bg-panel));
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border));
  color: var(--text);
}
.ww-storm-banner-hu {
  background: color-mix(in srgb, var(--danger) 18%, var(--bg-panel));
  border-color: color-mix(in srgb, var(--danger) 50%, var(--border));
}
.ww-storm-banner:hover { text-decoration: none; border-color: var(--accent); }
.ww-icon-lg { width: 28px; height: 28px; }
:root:not([data-theme="light"]) img.ww-icon-lg { filter: none; }
.ww-storm-title { margin: 0.2rem 0 0.1rem; font-size: 1.5rem; }
.ww-storm-vitals { color: var(--text-muted); margin-bottom: 0.8rem; }
.ww-official-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0.8rem; }
/* SP-R1 §1: NHC drops legible inline — full-res images, 1-2 across */
.ww-official-grid-lg { grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr)); }
.ww-official-grid-lg img { cursor: zoom-in; }
.ww-recon-chips { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-bottom: 0.8rem; }
.ww-official-fig { margin: 0; background: #fff; border-radius: 4px; padding: 4px; }
.ww-official-fig img { display: block; width: 100%; }
.ww-official-fig figcaption { font-size: 0.7rem; color: #333; padding: 2px 4px; }
.ww-winter-note {
  padding: 0.7rem 0.9rem; border-radius: 8px; margin: 0.4rem 0 1rem;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-raised));
  border: 1px solid var(--border); color: var(--text-muted); font-size: 0.9rem;
}
/* verbatim official TWO text (En / NHC-issued Es) */
.ww-two-text { margin-top: 1rem; }
.ww-two-text-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.ww-two-textlang { margin-left: auto; display: flex; gap: 0.3rem; }
.ww-two-langbtn {
  font-size: 0.75rem; padding: 0.15rem 0.55rem; border-radius: 999px; cursor: pointer;
  background: var(--bg-raised); color: var(--text-muted); border: 1px solid var(--border);
}
.ww-two-langbtn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.ww-two-pre {
  margin: 0; padding: 0.8rem 1rem; border-radius: 8px; overflow-x: auto;
  background: var(--bg-raised); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.5; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.ww-product-text {
  white-space: pre-wrap; font-family: var(--mono); font-size: 0.78rem;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 4px; padding: 0.6rem; max-height: 420px; overflow: auto;
}
details > summary { cursor: pointer; color: var(--accent); margin: 0.5rem 0; }
.ww-buoy-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.ww-buoy-table th, .ww-buoy-table td { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border); }
.ww-buoy-table th { color: var(--text-muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; }
.ww-wildwell-tag { display: block; margin: 0 0.8rem 0.4rem; }
#official-sections section { margin-bottom: 1rem; }
#wildwell-section .ww-panel { margin-bottom: 1rem; }
#sm-frame { display: block; width: 100%; border-radius: 4px; min-height: 160px; background: var(--bg); }

/* ---------- front-page storm banner (event band, lite) ---------- */
.ww-event-banner {
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
  margin-bottom: 1rem; padding: 0.55rem 0.9rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left-width: 6px;           /* tier color set inline */
  border-radius: 6px;
  color: var(--text);
}
.ww-event-banner:hover { text-decoration: none; background: var(--bg-panel); }
.ww-event-tag { padding: 0.1rem 0.55rem; border-radius: 4px; font-weight: 700; font-size: 0.9rem; }
.ww-event-vitals { color: var(--text-muted); font-size: 0.82rem; }
.ww-event-cta { margin-left: auto; color: var(--accent); font-weight: 600; white-space: nowrap; }

/* ---------- R1: search bar ---------- */
.ww-searchbar { position: relative; margin-bottom: 1rem; }
#ww-main-search { display: flex; gap: 0.5rem; }
#ww-main-search input {
  flex: 1; background: var(--bg-panel); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 0.55rem 0.9rem; font-size: 0.95rem;
}
#ww-main-search button {
  background: var(--accent-dim); color: #fff; border: 0; border-radius: 8px;
  padding: 0.55rem 1.1rem; font-weight: 600; cursor: pointer;
}
#ww-main-search button:hover { background: var(--accent); }
.ww-suggest {
  position: absolute; z-index: 30; left: 0; right: 4.5rem; top: 2.6rem;
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  border-radius: 8px; overflow: hidden;
}
.ww-suggest button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--text); padding: 0.45rem 0.9rem; cursor: pointer; font-size: 0.9rem;
}
.ww-suggest button:hover { background: var(--bg-panel); color: var(--accent); }
.ww-showing { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.45rem; font-size: 0.85rem; color: var(--text-muted); }
.ww-showing button {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--accent); padding: 0.15rem 0.55rem; font-size: 0.78rem; cursor: pointer;
}

/* ---------- R1: conditions tiles ---------- */
.ww-tiles { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ww-tile { background: var(--bg-raised); border: 1px solid var(--border); border-radius: 8px; padding: 0.55rem 0.7rem; }
.ww-tile-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }
.ww-tile-value { font-size: 1.15rem; margin: 0.15rem 0; }
.ww-tile-sub { font-size: 0.68rem; color: var(--text-faint); }
.ww-tile-gust { color: var(--warn); font-size: 0.85em; }
.ww-tile-graphic { margin: 0.35rem 0 0.15rem; }
.ww-fill-bar { height: 7px; border-radius: 4px; background: rgba(120,150,190,0.15); overflow: hidden; }
.ww-fill-bar-in { display: block; height: 100%; border-radius: 4px; }
.ww-trend-up { color: #6fc0b2; } .ww-trend-dn { color: var(--warn, #e0a83a); } .ww-trend-eq { color: var(--text-faint); }
.ww-aq-chip { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 3px; margin-right: 0.35em; vertical-align: -1px; }

/* ---------- R1: zoom/pan maps + valid line ---------- */
.ww-zoomable { overflow: hidden; border-radius: 4px; }
.ww-zoom-stage { cursor: grab; }
.ww-zoom-stage:active { cursor: grabbing; }
.ww-zoom-stage video, .ww-zoom-stage img { display: block; width: 100%; transition: transform 0.12s ease-out; transform-origin: center center; }
.ww-zoom-ctl { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; }
.ww-zoom-ctl button {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--text);
  font-size: 1rem; cursor: pointer;
}
.ww-zoom-ctl button:hover { border-color: var(--accent); color: var(--accent); }
.ww-valid-line { margin-top: 0.4rem; font-size: 0.78rem; color: var(--text-muted); }
/* R2-3: radar + satellite share one footprint; letterbox blends into the
   render's ocean navy. Fullscreen via the ⛶ control. */
.ww-media-frame {
  aspect-ratio: 4 / 3; background: #060c18; border-radius: 4px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.ww-media-frame video { width: 100%; height: 100%; object-fit: contain; }
.ww-media-frame .ww-zoom-stage { width: 100%; height: 100%; }
.ww-media-frame:fullscreen { aspect-ratio: auto; border-radius: 0; }
.ww-media-frame:fullscreen video { width: 100vw; height: 100vh; }
/* lightbox fallback when the Fullscreen API is denied/unsupported */
.ww-map-lightbox {
  position: fixed !important; inset: 0; z-index: 200; aspect-ratio: auto;
  border-radius: 0; background: #060c18;
}
body.ww-lightbox-open { overflow: hidden; }
.ww-panel-unavailable { padding: 1rem 0; }
.ww-sat-bar { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.5rem; font-size: 0.85rem; }
.ww-sat-bar select { background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 0.25rem 0.5rem; }

/* ---------- R1: forecast blocks ---------- */
.ww-fc-h { margin: 0.2rem 0 0.5rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.ww-fc-h:not(:first-child) { margin-top: 1.1rem; }
.ww-fc-disclaimer { font-size: 0.75rem; color: var(--text-faint); margin: -0.2rem 0 0.6rem; }
button.ww-period { font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.ww-period[aria-expanded="true"] { border-color: var(--accent); }
.ww-day-detail { margin-top: 0.8rem; padding: 0.8rem; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 8px; font-size: 0.88rem; }
.ww-day-detail h4 { margin: 0 0 0.4rem; }

/* ---------- R1: update-schedule modal ---------- */
.ww-modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: color-mix(in srgb, #000 55%, transparent);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.ww-modal {
  background: var(--bg-panel); border: 1px solid var(--border-strong);
  border-radius: 10px; max-width: 560px; width: 100%; max-height: 80vh;
  display: flex; flex-direction: column;
}
.ww-modal-head { display: flex; align-items: center; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); }
.ww-modal-head h2 { margin: 0; font-size: 1rem; }
.ww-modal-close { margin-left: auto; background: none; border: 0; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; }
.ww-modal-close:hover { color: var(--text); }
.ww-modal-body { padding: 0.8rem 1rem; overflow-y: auto; }

/* ---------- air quality ---------- */
.ww-aq-local { display: flex; align-items: center; gap: 1rem; }
.ww-aq-badge { font-family: var(--mono); font-size: 2rem; font-weight: 700; padding: 0.35rem 0.9rem; border-radius: 8px; }
.ww-aq-prelim { font-size: 0.72rem; color: var(--warn); margin: 0.5rem 0 0; }
.ww-aq-station { margin: 0.9rem 0 0.3rem; }
.ww-aq-pol { margin: 0.55rem 0; }
.ww-aq-pol-head { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.ww-aq-pol-head > span:first-child { min-width: 3.6em; font-weight: 600; }
.ww-aq-conc { font-family: var(--mono); color: var(--fg); }
.ww-aq-src { font-size: 0.68rem; margin-top: 0.2rem; }
.ww-aq-pol-none { opacity: 0.6; }
.ww-aq-pol-none .ww-aq-pol-head { font-size: 0.85rem; }
.ww-aq-vary { font-size: 0.72rem; margin-top: 0.6rem; }
.ww-aq-bar { position: relative; height: 7px; border-radius: 4px; margin-top: 0.3rem; }
.ww-aq-bar-mark { position: absolute; top: -2px; width: 3px; height: 11px; background: #fff; box-shadow: 0 0 0 1px #101f38; transform: translateX(-50%); border-radius: 1px; }
.ww-aq-scope-top { font-size: 0.85rem; color: var(--fg); background: var(--panel-2, rgba(120,150,190,0.08)); border-left: 3px solid var(--accent, #4da3ff); border-radius: 4px; padding: 0.6rem 0.85rem; margin: 0 0 1.1rem; }
.ww-tile-note { display: block; font-size: 0.64rem; color: var(--text-faint); margin-top: 0.3rem; line-height: 1.35; }
.ww-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; font-size: 0.72rem; color: var(--muted); margin: 0.5rem 0; }
.ww-legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.ww-legend-sw { width: 0.9em; height: 0.9em; border-radius: 2px; border: 1px solid rgba(255,255,255,0.15); }
.ww-legend-ramp { display: inline-block; width: 120px; height: 0.7em; border-radius: 3px; vertical-align: middle; }

/* ---------- marine ---------- */
.ww-safety { border: 2px solid var(--accent, #4da3ff); border-radius: 8px; padding: 0.9rem 1rem; margin: 0.5rem 0 0.4rem; background: rgba(77,163,255,0.06); }
.ww-safety-title { margin: 0 0 0.6rem; font-size: 1.1rem; }
.ww-safety-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ww-safety-table th { text-align: left; white-space: nowrap; padding: 0.25rem 0.7rem 0.25rem 0; vertical-align: top; }
.ww-safety-table td { padding: 0.25rem 0.7rem 0.25rem 0; vertical-align: top; }
.ww-safety-table td.ww-mono { white-space: nowrap; }
.ww-safety-local { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.8rem; }
.ww-safety-cell, .ws-safety-cell { flex: 1 1 240px; }
.ww-safety-note { font-size: 0.8rem; color: var(--muted); margin: 0.7rem 0 0; }
.ww-marine-scope { font-size: 0.78rem; margin: 0 0 1rem; }
.ww-marine-text { white-space: pre-wrap; font-family: var(--mono); font-size: 0.78rem; line-height: 1.4; max-height: 22rem; overflow: auto; margin: 0; }
.ww-warn-active { border-color: var(--warn, #e0a83a); }
.ww-marine-alert { margin: 0.5rem 0; }
.ww-marine-alert-txt { white-space: pre-wrap; font-size: 0.82rem; color: var(--muted); }
.ww-tide-table, .ww-buoy { font-size: 0.88rem; }
.ww-tide-table td { padding: 0.15rem 0.8rem 0.15rem 0; }
.ww-buoy { margin: 0.5rem 0; }
.ww-buoy-time { font-size: 0.68rem; }
.ww-fc-period { margin: 0.45rem 0; font-size: 0.9rem; }

/* ---------- solar & space ---------- */
.ww-sun-safety { border-color: #e0a83a; background: rgba(224,168,58,0.08); }
.ww-safety-urgent { border-color: #e05252; background: rgba(224,82,82,0.12); }
.ww-subnav { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0 0.2rem; }
.ww-subnav-link { font-size: 0.8rem; padding: 0.25rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); }
.ww-section-h { margin: 1.4rem 0 0.5rem; font-size: 1.05rem; border-bottom: 1px solid var(--line); padding-bottom: 0.3rem; }
.ss-imgrow { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.ss-imgrow figure { flex: 1 1 240px; margin: 0; }
.ss-big { font-family: var(--mono); font-size: 2.2rem; font-weight: 700; }
.ss-unit { font-size: 1rem; font-weight: 400; color: var(--muted); }
.ss-flare-hi { color: #e05252; } .ss-flare-mid { color: #e0a83a; } .ss-flare-lo { color: #6fc0b2; }
.ss-kv, .ss-scales, .ss-kp { width: 100%; }
.ss-kv th, .ss-scales th { text-align: left; padding: 0.2rem 0.8rem 0.2rem 0; white-space: nowrap; }
.ss-kv td, .ss-scales td { padding: 0.2rem 0.6rem 0.2rem 0; }
.ss-bz-south { color: #e05252; font-weight: 600; }
.ss-kp { display: flex; align-items: baseline; gap: 0.8rem; margin-bottom: 0.6rem; }
.ss-scale-badge { display: inline-block; min-width: 2em; text-align: center; border-radius: 4px; padding: 0 0.35em; color: #fff; font-family: var(--mono); font-weight: 700; }
.ss-alert summary, .ss-shower-all summary, .ss-learn summary { cursor: pointer; font-weight: 600; }
.ss-shower-next { margin: 0.5rem 0; }
.ss-verdict { color: var(--fg); margin-top: 0.2rem; }
.ss-flare { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin: 0.6rem 0; }
.ss-flare th, .ss-flare td { text-align: left; padding: 0.3rem 0.6rem 0.3rem 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.ss-flare thead th { color: var(--muted); font-weight: 600; }
.ss-flare tbody th { font-family: var(--mono); font-weight: 700; white-space: nowrap; }

/* ---------- night sky ---------- */
.ns-verdict-hero { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.8rem; }
.ns-rating { font-size: 1.4rem; font-weight: 700; padding: 0.3rem 1rem; border-radius: 8px; color: #0b1526; white-space: nowrap; }
.ns-strip { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.ns-strip-night { flex: 1 1 90px; text-align: center; border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem; font-size: 0.78rem; }
.ns-strip-day { font-weight: 600; margin-bottom: 0.3rem; }
.ns-strip-dot { display: inline-block; width: 0.9em; height: 0.9em; border-radius: 50%; margin-bottom: 0.3rem; }
.ns-moon { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.ns-moon-illum { font-family: var(--mono); font-size: 2rem; font-weight: 700; }
.ns-cirrus { color: var(--warn, #e0a83a); font-size: 0.85rem; }
.ns-timeline { position: relative; height: 16px; background: var(--panel-2, rgba(120,150,190,0.12)); border-radius: 8px; margin: 0.4rem 0 0.8rem; overflow: hidden; }
.ns-tl-dark { position: absolute; top: 0; height: 100%; background: rgba(30,40,70,0.9); }
.ns-tl-use { position: absolute; top: 0; height: 100%; background: #4da3ff; }
.ns-lightning-alert { border-color: #e05252; }
.ns-alert { background: #e05252; color: #fff; font-weight: 600; padding: 0.6rem 0.9rem; border-radius: 6px; margin-bottom: 0.7rem; }
.ns-glm-wrap { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.ns-glm-stats { flex: 1 1 220px; font-size: 0.9rem; }
#ns-glm { background: rgba(10,16,28,0.6); border-radius: 8px; flex: 0 0 auto; }

/* ---------- ad slots (off until a network is configured) ---------- */
.ww-ad-slot { display: none; }
.ww-ad-slot.ww-ad-active { display: block; margin: 1rem 0; text-align: center; }
.ww-ad-slot iframe { border: 0; width: 100%; max-width: 728px; height: 90px; }

/* ---------- utility ---------- */
.ww-muted { color: var(--text-muted); }
.ww-placeholder-note {
  border: 1px dashed var(--border-strong); border-radius: 8px;
  padding: 1.2rem; color: var(--text-muted); font-size: 0.9rem;
}
img, video { max-width: 100%; }
@media (max-width: 640px) {
  .ww-header { gap: 0.5rem; }
  .ww-main { padding: 0.6rem; }
}

/* ---------- Follow-us social rail (site CHROME; shell.js buildSocial) --------
   ONE component, two responsive states. Mobile/base: a centered wrapping social
   row that flows above the footer (no overlap, no horizontal scroll, 44px touch
   targets). Desktop (>=1200px): a fixed labeled left rail, with a reserved
   content gutter so the fixed rail can never overlap content at any scroll.
   Icons: self-hosted SVGs masked with currentColor -> theme-adaptive + CSP-tight
   (mask urls are same-origin). Distinct chrome, never confusable with a data
   panel. Relocatable: change the injection point (shell.js) / these rules only. */
.ww-social {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  align-items: center; justify-content: center;
  max-width: 1280px; margin: 0 auto; padding: 0.8rem 1rem 1.4rem;
}
.ww-social-head {
  width: 100%; text-align: center; color: var(--text-muted);
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; margin-bottom: 0.15rem;
}
.ww-social-btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  min-height: 44px; padding: 0 0.9rem;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-raised); color: var(--text);
  font-size: 0.9rem; font-weight: 600; text-decoration: none;
  transition: border-color .15s, background .15s, transform .05s;
}
.ww-social-btn:hover { border-color: var(--border-strong); background: var(--bg-panel); }
.ww-social-btn:active { transform: translateY(1px); }
.ww-social-ico {
  width: 20px; height: 20px; flex: none; background-color: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
          mask: var(--ico) center / contain no-repeat;
}
.ww-social-btn[data-social="youtube"]   { --ico: url(/assets/icons/social/youtube.svg); }
.ww-social-btn[data-social="x"]         { --ico: url(/assets/icons/social/x.svg); }
.ww-social-btn[data-social="facebook"]  { --ico: url(/assets/icons/social/facebook.svg); }
.ww-social-btn[data-social="tiktok"]    { --ico: url(/assets/icons/social/tiktok.svg); }
.ww-social-btn[data-social="instagram"] { --ico: url(/assets/icons/social/instagram.svg); }
.ww-social-soon {                           /* planned slot: marked, non-interactive */
  color: var(--text-faint); background: transparent;
  border-style: dashed; cursor: default;
}
.ww-social-soon-tag {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 1px 5px; border-radius: 999px;
  background: var(--border); color: var(--text-muted); margin-left: 0.15rem;
}
@media (min-width: 1200px) {
  .ww-social {
    position: fixed; z-index: 40;
    left: max(24px, calc((100vw - 2200px) / 2 + 24px));   /* hugs the content's left */
    top: 50%; transform: translateY(-50%);
    flex-direction: column; flex-wrap: nowrap;
    align-items: stretch; justify-content: flex-start; gap: 0.5rem;
    width: 156px; max-width: none; margin: 0; padding: 0.7rem;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .28);
  }
  .ww-social-head { text-align: left; margin-bottom: 0.35rem; }
  .ww-social-btn { width: 100%; justify-content: flex-start; }
  /* Content fills the viewport (small margins) instead of a narrow 1280 column;
     196px left gutter reserves the rail (24 + 156 + 16 gap) so it never overlaps. */
  .ww-main { max-width: 2200px; padding-left: 196px; }
}
