/* Identity v1 (18-HANDOFF-v0.2.0.md §2; supersedes D-050's neutral
 * placeholder) — ported from the approved mockup (ref/mockup-v0.2/*.dc.html
 * <helmet><style>, its .swx/.swx.night tokens) onto the existing theme
 * contract: `data-theme="day"|"night"` on <html>, set pre-paint by
 * base.html's inline script from localStorage['theme'] (same key/values as
 * the group site, D-053). Day is the bare :root default, night overrides
 * under `[data-theme='night']` — no `prefers-color-scheme` fallback, same
 * reasoning as D-053: the stored choice must carry over to the group site
 * exactly, default included.
 *
 * --chart-* and --status-* keep their D-053 names (web/charts.py,
 * web/static/web/js/charts.js read them) but now alias the mockup's own
 * tokens instead of a separate palette. */
:root {
  color-scheme: light;
  --bg:          #f3f6f9;
  --band:        #e8eef3;
  --raised:      #ffffff;
  --ink:         #16181b;
  --ink-soft:    #454c55;
  --ink-faint:   #6b737c;
  --line:        rgba(22, 24, 27, .12);
  --grid:        rgba(22, 24, 27, .07);
  --accent:      #3f7688;
  --accent-ink:  #ffffff;
  --accent-soft: #dbe8e8;
  --s1:          #2a78d6;
  --s1-band:     rgba(42, 120, 214, .16);
  --s2:          #eb6834;
  --bt:          #454c55;
  --ref:         #8a929a;
  --ok:          #1f8a4c;
  --ok-soft:     #e3f3e9;

  /* Colour tokens v1.1 (22-HANDOFF-v0.3.0.md §1.3, ref/mockup-v0.3): the
   * dark "space" surfaces -- utility bar, hero band, status strip, footer --
   * stay dark in BOTH themes, so these are not redefined under night except
   * --tint (the "En la red chilena" band). --sun is the amber accent, used
   * only on those dark surfaces (>= 8:1 on --space). */
  --space:       #0a1222;
  --space-2:     #101c33;
  --space-ink:   #eef1f4;
  --space-soft:  #b9c4d0;
  --sun:         #f0a14a;
  --tint:        #e3eef0;

  /* Shared severity scale (§2): NOAA scale chips, Kp/Dst chips, and the
   * X-ray class bands all read this one five-step ramp, text+colour never
   * colour alone. "ok" aliases the mockup's own --ok/--ok-soft above. */
  --severity-ok:            var(--ok);
  --severity-ok-soft:       var(--ok-soft);
  --severity-minor:         #8a6000;
  --severity-minor-soft:    #f6ecd2;
  --severity-moderate:      #a14e0e;
  --severity-moderate-soft: #fbe6d4;
  --severity-strong:        #b02f23;
  --severity-strong-soft:   #fbdcd8;
  --severity-severe:        #8c1e4c;
  --severity-severe-soft:   #f5d9e4;

  /* Heartbeat status (is *our* collector healthy — unrelated to how severe
   * the space weather is, D-053). Carried over unchanged: already checked
   * for AA contrast against the white text/dots in .status-badge__dot and
   * .scale-badge__level. */
  --status-ok:       #0ca30c;
  --status-stale:    #fab219;
  --status-serious:  #ec835a;
  --status-error:    #d03b3b;
  --status-nodata:   #898781;
  /* D-085: healthy collector, old data ("al día · con retraso"). A true
   * yellow, kept apart from the amber --status-stale; the label beside the
   * dot carries the meaning, the dot only reinforces it. */
  --status-delayed:  #d4b106;

  /* Chart contract (D-053 §2): charts.js resolves these once per render,
   * never inside a draw hook (16-PERF B5). s1/s2 alias the mockup's own
   * series colours; s3-s6 extend the same validated 8-hue default order
   * (dataviz skill references/palette.md) for panels with 3+ series
   * (protons) carried over from D-053 unchanged -- the surface shift here
   * (--raised #fcfcfb->#ffffff) is too small to matter to the validator. */
  --chart-text:  var(--ink-faint);
  --chart-grid:  var(--grid);
  --chart-axis:  var(--line);
  --chart-ref:   var(--ref);
  --chart-s1:    var(--s1);
  --chart-s2:    var(--s2);
  --chart-s3:    #1baf7a;
  --chart-s4:    #eda100;
  --chart-s5:    #e87ba4;
  --chart-s6:    #008300;

  --font-display: 'Bebas Neue', 'Poppins', sans-serif;
  --font-ui:      'Poppins', system-ui, sans-serif;
  --font-body:    'Roboto', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
  --radius:    14px;
  --radius-sm: 8px;
}

/* Night: deep-navy "operations" look (D-007/D-035 — related lineage to the
 * group site, never confusable), ported from the mockup's .swx.night. */
:root[data-theme='night'] {
  color-scheme: dark;
  --bg:          #0b0f14;
  --band:        #0f1a2a;
  --raised:      #131a22;
  --ink:         #eef1f4;
  --ink-soft:    #b7c0c9;
  --ink-faint:   #8a95a2;
  --line:        rgba(255, 255, 255, .11);
  --grid:        rgba(255, 255, 255, .06);
  --accent:      #6ddeff;
  --accent-ink:  #06121a;
  --accent-soft: #2c4a5a;
  --s1:          #3987e5;
  --s1-band:     rgba(57, 135, 229, .22);
  --s2:          #d95926;
  --bt:          #b7c0c9;
  --ref:         #6b7682;
  --ok:          #5fd18f;
  --ok-soft:     #173326;
  --tint:        #0f1a2a;

  --severity-ok:            var(--ok);
  --severity-ok-soft:       var(--ok-soft);
  --severity-minor:         #e3b54a;
  --severity-minor-soft:    #3a3115;
  --severity-moderate:      #e98a4a;
  --severity-moderate-soft: #3a2414;
  --severity-strong:        #e55b4a;
  --severity-strong-soft:   #3a1a14;
  --severity-severe:        #e0569c;
  --severity-severe-soft:   #3a1830;

  --status-ok:       #1fae55;
  --status-stale:    #e0a83c;
  --status-serious:  #e0794f;
  --status-error:    #e2463f;
  --status-nodata:   #8a93ab;
  --status-delayed:  #e6cf3f;

  --chart-text:  var(--ink-faint);
  --chart-grid:  var(--grid);
  --chart-axis:  var(--line);
  --chart-ref:   var(--ref);
  --chart-s1:    var(--s1);
  --chart-s2:    var(--s2);
  --chart-s3:    #199e70;
  --chart-s4:    #c98500;
  --chart-s5:    #d55181;
  --chart-s6:    #008300;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.skip-link { position: absolute; left: -999px; top: 0; }
/* The day --accent is too dark for a focus ring on the always-dark
 * surfaces (v1.1 tokens); amber keeps it >= 3:1 there in both themes. */
.ubar :focus-visible, .strip :focus-visible, .heroband :focus-visible, .foot :focus-visible { outline-color: var(--sun); }
.skip-link:focus { left: 0; background: var(--raised); padding: .6em 1em; z-index: 10; }

/* ---------- utility bar (22-HANDOFF-v0.3.0.md §1.1) ---------- */
/* The portal is a sub-page of the group site: a thin dark bar above the
 * header on every page, back link left, network tagline right. */
.ubar { background: var(--space); color: var(--space-soft); font-family: var(--font-ui); font-size: 12.5px; }
.ubar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 34px; }
.ubar a { color: var(--space-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.ubar a:hover { color: var(--sun); }
.ubar span { color: var(--space-soft); }
@media (max-width: 680px) { .ubar span { display: none; } }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.hdr-in { display: flex; align-items: center; gap: 24px; height: 64px; }
/* Emblem + wordmark. Two <img>s, one per theme, swapped by CSS so the
 * right one is there at first paint (data-theme is set pre-paint). */
.brand-row { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-row img { width: 38px; height: 38px; display: block; }
.brand-row .em-night { display: none; }
:root[data-theme='night'] .brand-row .em-night { display: block; }
:root[data-theme='night'] .brand-row .em-day { display: none; }
.brand { display: flex; flex-direction: column; line-height: 1; text-decoration: none; color: var(--ink); }
.brand b { font-family: var(--font-display); font-weight: 400; font-size: 27px; letter-spacing: .02em; color: var(--ink); }
.brand span { font-family: var(--font-ui); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px; }
.nav { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.nav a { font-family: var(--font-ui); font-size: 13.5px; color: var(--ink-soft); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current] { color: var(--ink); font-weight: 500; }
.tools { display: flex; align-items: center; gap: 10px; }
/* National platform pill (§1.2); the mobile menu carries it as .nav-natl. */
a.natl {
  font-family: var(--font-ui); font-size: 13px; font-weight: 500; color: var(--ink);
  border: 1px solid var(--accent); border-radius: 999px; padding: 7px 14px;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap;
}
a.natl:hover { background: var(--accent); color: var(--accent-ink); }
.natl .dot { background: var(--sun); }
.nav .nav-natl { display: none; }
.lang-switch { font-family: var(--font-ui); font-size: 12.5px; color: var(--ink-faint); display: flex; gap: .4em; }
.lang-switch a { color: var(--ink-faint); text-decoration: none; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current] { color: var(--ink); font-weight: 600; }
.ibtn {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.ibtn:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .icon-night { display: none; }
:root[data-theme='night'] .theme-toggle .icon-day { display: none; }
:root[data-theme='night'] .theme-toggle .icon-night { display: inline; }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .hdr-in { position: relative; flex-wrap: wrap; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--raised); border-bottom: 1px solid var(--line);
    padding: .5rem 24px 1rem;
  }
  .nav a { display: block; padding: .75rem 0; border-bottom: 1px solid var(--line); }
  .nav .nav-natl { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
  .hdr[data-open='true'] .nav { display: flex; }
  a.natl.natl-nav { display: none; }
}
@media (max-width: 680px) { .brand-row img { width: 32px; height: 32px; } }
@media (max-width: 420px) { .wrap { padding-left: 16px; padding-right: 16px; } }

/* ---------- status strip ---------- */
/* Dark in both themes (v1.1), so its severity chips always take the night
 * ramp -- the day ramp's dark-on-pale chips are meant for a light surface. */
.strip {
  background: var(--space-2);
  --severity-ok:            #5fd18f;
  --severity-ok-soft:       #173326;
  --severity-minor:         #e3b54a;
  --severity-minor-soft:    #3a3115;
  --severity-moderate:      #e98a4a;
  --severity-moderate-soft: #3a2414;
  --severity-strong:        #e55b4a;
  --severity-strong-soft:   #3a1a14;
  --severity-severe:        #e0569c;
  --severity-severe-soft:   #3a1830;
}
.strip-in {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  padding-top: 9px; padding-bottom: 9px;
  font-family: var(--font-mono); font-size: 12px; color: var(--space-soft);
}
.scale { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: inherit; }
.scale:hover { color: var(--ink); }
.strip .scale:hover { color: var(--space-ink); }
.scale i {
  font-style: normal; font-weight: 500; border-radius: 6px; padding: 1px 7px;
  color: var(--severity-ok); background: var(--severity-ok-soft);
}
.scale i.sv-minor    { color: var(--severity-minor);    background: var(--severity-minor-soft); }
.scale i.sv-moderate { color: var(--severity-moderate); background: var(--severity-moderate-soft); }
.scale i.sv-strong   { color: var(--severity-strong);   background: var(--severity-strong-soft); }
.scale i.sv-severe   { color: var(--severity-severe);   background: var(--severity-severe-soft); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--severity-ok); display: inline-block; }
.sep { width: 1px; height: 16px; background: var(--line); }
.strip .sep { background: rgba(255, 255, 255, .14); }
@media (max-width: 680px) { .strip-in .sep { display: none; } }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; padding-top: 64px; padding-bottom: 56px; align-items: start; }
.eyebrow { font-family: var(--font-ui); font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
h1 { font-family: var(--font-display); font-weight: 400; font-size: 76px; line-height: .92; letter-spacing: .01em; margin: 14px 0 18px; text-wrap: balance; }
.lede { font-size: 17px; color: var(--ink-soft); max-width: 56ch; margin: 0 0 1.5rem; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  font-family: var(--font-ui); font-size: 14px; font-weight: 500; border-radius: 999px; padding: 11px 20px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); color: var(--ink);
}
.btn:hover { border-color: var(--accent); color: var(--ink); }
a.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
a.btn.pri:hover { color: var(--accent-ink); opacity: .9; }
.offer { display: grid; gap: 12px; }
.ocard { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 6px; }
.ocard h3 { font-family: var(--font-ui); font-size: 16px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.ocard p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.pill {
  font-family: var(--font-ui); font-size: 11px; font-weight: 500; letter-spacing: .04em; border-radius: 999px;
  padding: 2px 9px; border: 1px solid var(--line); color: var(--ink-soft); white-space: nowrap;
}
.pill.beta { background: var(--accent-soft); border-color: transparent; color: var(--ink); }
.pill.ok { background: var(--severity-ok-soft); border-color: transparent; color: var(--severity-ok); display: inline-flex; align-items: center; gap: 6px; }
.pill.delayed { background: var(--severity-minor-soft); border-color: transparent; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
/* D-078: the provider pill links to the provider's page for this product. */
a.pill { color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }
a.pill:hover { border-color: var(--accent); color: var(--accent); }
a.pill:focus-visible { border-radius: 999px; }
.ext { flex: none; vertical-align: -1px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 40px; }
  h1 { font-size: 56px; }
}

/* Home hero: a full-bleed dark band in both themes (§1.3), the group's
 * solar-wind/magnetosphere illustration behind a left-to-right gradient
 * (vertical on phones, where the text spans the full width). */
.heroband {
  position: relative; color: var(--space-ink);
  background:
    linear-gradient(90deg, rgba(7, 11, 31, .96) 0%, rgba(7, 11, 31, .86) 42%, rgba(7, 11, 31, .35) 75%, rgba(7, 11, 31, .2) 100%),
    url("../img/solar-wind-magnetosphere.b2c092b3e905.svg") right center / cover no-repeat,
    var(--space);
}
.heroband .hero { padding-top: 72px; padding-bottom: 72px; }
.heroband h1 { color: #ffffff; }
.heroband .lede { color: var(--space-soft); }
.heroband .eyebrow { color: var(--sun); }
/* The right column's eyebrow sits where the gradient is lightest: a field
 * line crossing it measured 4.3:1. A tight --space halo keeps the glyph
 * edges >= 4.5:1 (AA) without changing the look. */
.heroband .eyebrow { text-shadow: 0 0 3px var(--space), 0 0 6px var(--space); }
.heroband .ocard { background: rgba(10, 18, 34, .72); border-color: rgba(255, 255, 255, .14); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.heroband .ocard h3 { color: #ffffff; }
.heroband .ocard h3 a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .4); text-underline-offset: 3px; }
.heroband .ocard h3 a:hover { color: var(--sun); }
.heroband .ocard p { color: var(--space-soft); }
.heroband .pill { color: var(--space-soft); border-color: rgba(255, 255, 255, .22); }
.heroband .pill.beta { background: var(--sun); color: #1a1206; border-color: transparent; }
.heroband a.btn { color: #ffffff; border-color: rgba(255, 255, 255, .4); }
.heroband a.btn:hover { border-color: #6ddeff; color: #ffffff; }
.heroband a.btn.pri { background: #6ddeff; border-color: #6ddeff; color: #06121a; }
.heroband a.btn.pri:hover { color: #06121a; }
@media (max-width: 900px) {
  .heroband {
    background:
      linear-gradient(180deg, rgba(7, 11, 31, .92) 0%, rgba(7, 11, 31, .85) 100%),
      url("../img/solar-wind-magnetosphere.b2c092b3e905.svg") center / cover no-repeat,
      var(--space);
  }
}

/* ---------- sections, cards, chart stack ---------- */
.sec { padding-top: 24px; padding-bottom: 56px; }
.sec-live { padding-top: 56px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 14px; }
h2 { font-family: var(--font-display); font-weight: 400; font-size: 44px; line-height: 1; margin: 6px 0 0; letter-spacing: .01em; }
.meta { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); }
.ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { font-family: var(--font-ui); font-size: 12.5px; border: 0; background: transparent; color: var(--ink-soft); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--bg); }
.seg button[aria-disabled='true'] { opacity: .45; cursor: not-allowed; }
.seg[hidden] { display: none; }
.sbtn {
  font-family: var(--font-ui); font-size: 12.5px; border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 999px; padding: 6px 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.sbtn:hover { border-color: var(--accent); }
.sbtn[disabled] { color: var(--ink-faint); cursor: not-allowed; }
.card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); }
.card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.figwrap { padding: 16px 16px 10px; }

/* One ECharts instance per stack (web/static/web/js/charts.js); the
 * readout column is plain DOM, driven by updateAxisPointer/globalout. */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 168px; gap: 16px; }
.plot { position: relative; min-width: 0; }
.read { display: grid; align-content: start; font-family: var(--font-mono); font-size: 12.5px; }
.rrow { border-left: 1px solid var(--line); padding-left: 12px; display: grid; align-content: center; gap: 3px; }
.rrow div { display: flex; justify-content: space-between; gap: 8px; }
/* No wrapping (19-HANDOFF-v0.2.1.md §1.4): the X-ray readout combines a
 * class letter and a flux in one cell ("B6.2 · 6.2×10⁻⁷") and must stay on
 * one line even at the readout column's fixed 168px width -- the label
 * (`.k`) shrinks/wraps first instead. */
.rrow b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
.k { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); }
.sw { width: 12px; height: 2px; border-radius: 1px; display: inline-block; }
.unit { color: var(--ink-faint); font-size: 11px; }
.snap { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; }
/* Error/empty state, per product, overlaid on just that product's grids
 * (16-PERF B4: the mount point keeps its height, nothing collapses). */
.swx-stack-status {
  position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); font-size: .85rem; text-align: center; padding: 0 1rem; pointer-events: none;
}

@media (max-width: 680px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .read { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rrow { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; }
}

/* "En la red chilena" sits on the --tint band (§1.3). */
.tintband { background: var(--tint); margin-top: 8px; }
.tintband .sec { padding-top: 48px; }

/* ---------- link cards ---------- */
.more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mcard { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 6px; text-decoration: none; color: var(--ink); }
.mcard:hover { border-color: var(--accent); color: var(--ink); }
.mcard b { font-family: var(--font-ui); font-size: 14.5px; font-weight: 600; }
.mcard span { font-size: 13.5px; color: var(--ink-soft); }
.mcard em { font-style: normal; font-family: var(--font-ui); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 900px) { .more { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .more { grid-template-columns: minmax(0, 1fr); } }

/* ---------- footer ---------- */
/* Dark in both themes (v1.1). */
.foot { background: var(--space); color: var(--space-soft); margin-top: 24px; }
.foot-in { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 32px; padding-top: 40px; padding-bottom: 40px; font-size: 13.5px; color: var(--space-soft); }
.foot h4 { font-family: var(--font-ui); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #8fa0b3; margin: 0 0 10px; font-weight: 600; }
.foot a { color: var(--space-ink); }
.foot a:hover { color: var(--sun); }
.foot .brand b { color: #ffffff; }
.foot .brand span { color: #8fa0b3; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot p { margin: 0 0 8px; }
@media (max-width: 900px) { .foot-in { grid-template-columns: minmax(0, 1fr); } }

/* ---------- product page ---------- */
.crumb { font-family: var(--font-ui); font-size: 13px; color: var(--ink-faint); padding-top: 28px; }
.crumb a { text-decoration: none; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; padding-top: 10px; padding-bottom: 22px; }
.head h1 { font-size: 60px; line-height: .95; margin: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.now { display: flex; gap: 28px; flex-wrap: wrap; }
.now div { display: grid; gap: 2px; }
.now small { font-family: var(--font-ui); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.now b { font-family: var(--font-mono); font-weight: 500; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.now b span { font-size: 14px; color: var(--ink-faint); margin-left: 4px; }
.now .now-asof { flex-basis: 100%; margin: -18px 0 0; font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); }
.below { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; padding-top: 32px; padding-bottom: 64px; }
.below h2 { font-family: var(--font-ui); font-size: 17px; font-weight: 600; margin: 0 0 10px; }
.below p { margin: 0 0 12px; color: var(--ink-soft); max-width: 64ch; }
.below dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 20px; font-size: 14px; }
.below dt { color: var(--ink-faint); font-family: var(--font-ui); font-size: 12.5px; }
.below dd { margin: 0; color: var(--ink); }
@media (max-width: 900px) { .below { grid-template-columns: minmax(0, 1fr); } .head h1 { font-size: 46px; } }
@media (max-width: 680px) { .now b { font-size: 24px; } }

/* Every page's own content supplies its own .wrap for width + side
 * padding (the mockup's own pattern) -- main only adds bottom spacing, so
 * a .wrap never ends up padded twice by nesting inside a padded main.
 * .page is the plain top-level pages (catalogue, status, about, ...) that
 * aren't built from mockup sections (hero/sec/card), which supply their
 * own top spacing already. */
main { display: block; padding-bottom: 3rem; }
/* Home ends on the full-bleed tint band: no bare strip under it. */
main:has(> .tintband:last-child) { padding-bottom: 0; }
.page { padding-top: 32px; }

/* ---------- retained components (status badges, catalogue, forms) ---------- */
.status-badge { display: inline-flex; align-items: center; gap: .4em; font-size: .82rem; color: var(--ink-soft); }
.status-badge__note { color: var(--ink-faint); }
.status-badge__dot { width: .6em; height: .6em; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--raised); }

/* NOAA scale badges (G/S/R) on a product_detail_event page (e.g.
 * noaa.scales itself) -- the home page strip replaces these there. */
.scale-row { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; }
.scale-badge { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .6rem 1rem; border-radius: var(--radius-sm); background: var(--raised); border: 1px solid var(--line); min-width: 5.5rem; }
.scale-badge__letter { font-weight: 700; font-size: .78rem; color: var(--ink-faint); }
.scale-badge__level { font-size: 1.4rem; font-weight: 700; width: 2em; height: 2em; line-height: 2em; text-align: center; border-radius: 50%; color: #fff; }
.scale-badge__text { font-size: .72rem; color: var(--ink-soft); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.product-card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.product-card h3 { margin: 0; font-size: 1rem; }
.badge { display: inline-block; font-size: .72rem; padding: .15em .6em; border-radius: 999px; background: var(--band); color: var(--ink-soft); border: 1px solid var(--line); width: fit-content; }
.status-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.status-table th, .status-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }

.form-field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .25rem; max-width: 32rem; }
.form-field label { font-size: .85rem; color: var(--ink-soft); }
.form-field input, .form-field select, .form-field textarea {
  font: inherit; padding: .5em .6em; border-radius: 6px; border: 1px solid var(--line);
  background: var(--raised); color: var(--ink);
}
.form-field--checkbox label { display: flex; align-items: flex-start; gap: .5em; font-size: .9rem; color: var(--ink); }
.form-field--checkbox input { width: auto; margin-top: .2em; }
button.primary { font: inherit; background: var(--accent); color: var(--accent-ink); border: none; border-radius: 6px; padding: .6em 1.2em; cursor: pointer; }
.errorlist { color: var(--severity-strong); font-size: .82rem; padding-left: 1em; }

/* que_ofrecemos.html's stakeholder cards (home uses .offer/.ocard instead) */
.offer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.offer-card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.25rem; }
.offer-card h3 { margin-top: 0; }

/* ---------- forecast product page (v0.4.0 §5-§6) ---------- */
/* The readout is one block (observed / forecast / interval), not one row
 * per panel, so it sizes to its content instead of a panel's height. */
.rrow.fc-read { height: auto; padding-top: 8px; padding-bottom: 8px; }
.perf { padding-top: 32px; padding-bottom: 8px; }
.perf h2 { font-family: var(--font-ui); font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.perf .meta { max-width: 80ch; margin: 0 0 12px; }
.table-scroll { overflow-x: auto; background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius); }
.perf-table { font-family: var(--font-mono); font-size: 12.5px; }
.perf-table th { font-family: var(--font-ui); font-size: 11.5px; font-weight: 600; color: var(--ink-faint); white-space: nowrap; }
.perf-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.perf-table tbody tr:last-child td { border-bottom: 0; }
.perf-table abbr { text-decoration: none; }

/* Data access (v0.5.0): /datos-api/, the key page, the CSV dialog. */
.data-access .toc { font-family: var(--font-ui); font-size: 13px; margin: 0 0 1.5rem; }
/* Anchored sections (#hapi is where /hapi lands, D-093) clear the 64px sticky header. */
.data-access h2[id] { scroll-margin-top: 80px; }
.data-access .table-wrap { overflow-x: auto; }
.data-access .relay-tag { color: var(--ink-faint); }
.data-access .note { color: var(--ink-soft); }
.data-access .hapi-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 20px; margin: 0 0 1rem; }
.data-access .hapi-facts dt { color: var(--ink-faint); font-family: var(--font-ui); font-size: 13px; }
.data-access .hapi-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .data-access .hapi-facts { grid-template-columns: minmax(0, 1fr); } .data-access .hapi-facts dd { margin-bottom: 6px; } }
pre.code { background: var(--band); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
  overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; white-space: pre; max-width: 100%; }
.data-access code, pre.code code { font-family: var(--font-mono); font-size: inherit; }
.key-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 1rem 0; }
.key-box .key { flex: 1 1 22rem; min-width: 0; font-family: var(--font-mono); font-size: 14px; padding: .6em .8em;
  border: 1px solid var(--line); border-radius: 6px; background: var(--raised); color: var(--ink); }
/* Honeypot: off-screen rather than display:none, which some bots skip. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.csv-dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--raised); color: var(--ink);
  padding: 20px; width: min(28rem, calc(100vw - 32px)); }
.csv-dialog::backdrop { background: rgba(10, 18, 34, .55); }
.csv-dialog h2 { margin-top: 0; }
.csv-dialog fieldset { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .35rem; }
.csv-dialog legend { font-size: .85rem; color: var(--ink-soft); margin-bottom: .35rem; }
.csv-dialog .csv-custom { display: flex; flex-wrap: wrap; gap: 8px; }
.csv-dialog .csv-custom[hidden] { display: none; }
.csv-dialog .csv-remember { display: flex; gap: .4em; align-items: center; font-size: .85rem; }
.csv-dialog .csv-hint { font-size: .85rem; color: var(--ink-soft); }
.csv-dialog .csv-error { color: var(--severity-strong); font-size: .9rem; }
.csv-dialog .csv-actions { display: flex; justify-content: flex-end; gap: 8px; }
