/* Weather what-ifs v2: light, minimal, Vicomtech tokens. 8-pt grid; cards with soft layered shadows instead of borders;
   a frosted sticky header; segmented controls; thin sliders; 250 ms ease-out motion (none with reduced motion). */

/* Mulish's @font-face rules are in index.html: in a private Space the fonts must be asked for by the signed page */

:root {
  --cyan: #00A7C4; --cyan-d: #018299; --cyan-h: #076C7F;
  --ink: #231F20; --ink2: #636C72; --hair: rgba(35, 31, 32, 0.08);
  --surface: #F5F8FA; --wash: #EBF3F5; --card: #FFFFFF;
  --crit: #D03B3B; --serious: #EC835A; --good: #0CA30C; --amber: #8A5300;
  --r-card: 20px; --r-ctl: 12px; --r-pill: 999px;
  --sh-card: 0 1px 2px rgba(17, 38, 46, 0.04), 0 4px 12px rgba(17, 38, 46, 0.05), 0 16px 40px rgba(17, 38, 46, 0.05);
  --sh-float: 0 1px 2px rgba(17, 38, 46, 0.06), 0 8px 24px rgba(17, 38, 46, 0.12);
  --ease: cubic-bezier(.2, .8, .2, 1); --t: 250ms;
}
@media (prefers-reduced-motion: reduce) { :root { --t: 0ms; } *, *::before, *::after { animation: none !important; } }
* { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: Mulish, "Helvetica Neue", Arial, sans-serif; font-size: 14px;
  line-height: 1.45; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, select, input { font-family: inherit; font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
.quiet { color: var(--ink2); margin: 0; font-size: 13px; }
.small { font-size: 12px; }

/* ---------------------------------------------------------------- header: sticky, frosted */
.hdr { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.72); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--hair); }
.hdr-in { max-width: 1440px; margin: 0 auto; padding: 12px 32px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 40px; height: 40px; flex: none; }
.by { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--ink2);
  text-decoration: none; }
.by img { height: 13px; width: auto; }
.hdr-title h1 { font-size: 20px; font-weight: 800; line-height: 1.15; }
.hdr-title p { margin: 2px 0 0; font-size: 12.5px; color: var(--ink2); }

/* ---------------------------------------------------------------- layout */
.page { max-width: 1440px; margin: 0 auto; padding: 20px 32px 40px; }
.layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
/* the page's four claims, above the heat tab; each opens its paragraph of the How-it-works sheet */
.proof { list-style: none; margin: -8px 0 8px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
/* the page's two parts, each with a title: this what-if, then many what-ifs, apart. The first title's gaps are tight: the
   map under it is the hero (tools/ui_test.py asserts how much of the first viewport it fills). */
.many { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--hair); }
.sec-title { margin: 0 0 16px; }
.sec-title.one { margin-bottom: 12px; }
.sec-title h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.sec-title p { margin: 4px 0 0; font-size: 13px; color: var(--ink2); max-width: 820px; }
.proof-i { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 10px minmax(0, 1fr); column-gap: 10px;
  padding: 6px 12px; border-radius: var(--r-ctl); transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.proof-i::before { content: ""; grid-row: 1 / span 2; margin-top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 167, 196, 0.16); }
.proof-i b { font-size: 13.5px; font-weight: 800; color: var(--ink); line-height: 1.35; }
.proof-i span { font-size: 12px; color: var(--ink2); line-height: 1.35; }
.proof-i:hover { background: var(--card); box-shadow: var(--sh-card); }
.proof-i:focus-visible { background: var(--card); outline: 2px solid var(--cyan-d); outline-offset: 2px; }
.main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card { background: var(--card); border-radius: var(--r-card); box-shadow: var(--sh-card); padding: 20px 24px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.card-h h2 { font-size: 15px; font-weight: 700; }

/* ---------------------------------------------------------------- side panel */
.side { position: sticky; top: 80px; max-height: calc(100vh - 104px); overflow-y: auto; padding: 8px 24px 16px; scrollbar-width: thin; }
.sec { padding: 16px 0; border-bottom: 1px solid var(--hair); }
.sec:last-child { border-bottom: 0; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sec-h h2 { font-size: 13px; font-weight: 700; }
.sec-h .btn.text { padding: 2px 0; }
.dome { padding: 8px 0; }
.dome + .dome { border-top: 1px dashed var(--hair); }
.dome-body { padding: 4px 0 0 2px; }
.dome-body[hidden] { display: none; }
details.more > summary { list-style: none; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--cyan-d); padding: 8px 0 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: " ›"; }
details.more[open] > summary::after { content: " ‹"; }
.field { margin: 8px 0 12px; }
.flabel { display: block; font-size: 13px; margin-bottom: 6px; }
.select { width: 100%; border: 0; border-radius: var(--r-ctl); background: var(--surface); padding: 10px 12px; font-size: 13.5px; color: var(--ink);
  appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink2) 50%), linear-gradient(135deg, var(--ink2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.select:focus-visible, input:focus-visible, button:focus-visible { outline: 2px solid var(--cyan-d); outline-offset: 2px; }
.seg-btn:focus-visible { outline-offset: -2px; }       /* inside the control: its own overflow would clip a ring outside */
/* the engine's loading: a banner at the top of the results card; gone when it is ready */
.engine { padding: 16px 20px 14px; box-shadow: inset 0 -1px 0 var(--hair); }
.engine-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 14px; }
.engine-row b { font-weight: 700; }
#engine-text { color: var(--ink2); }
.engine-pct { margin-left: auto; font-weight: 700; }
.engine .prog { margin: 10px 0 8px; height: 6px; border-radius: 3px; }
.engine .prog i { background: linear-gradient(90deg, var(--cyan-d) 0%, var(--cyan) 50%, var(--cyan-d) 100%); background-size: 200% 100%; transition: width 400ms var(--ease); animation: shimmer 1.6s linear infinite; }
.engine-note { margin: 0; font-size: 12px; color: var(--ink2); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.engine .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); animation: pulse 1.2s var(--ease) infinite; }
.engine.ready { display: none; }
.engine.error { color: var(--crit); }
.engine.error .dot { background: var(--crit); animation: none; }
.engine.error .prog, .engine.error .engine-pct, .engine.error .engine-note { display: none; }
.mock { color: var(--amber); font-weight: 700; }

/* ---------------------------------------------------------------- segmented control */
.seg { position: relative; display: inline-flex; background: var(--surface); border-radius: var(--r-ctl); padding: 3px; gap: 0; max-width: 100%;
  overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; border-radius: 9px; background: #FFFFFF; box-shadow: 0 1px 3px rgba(17, 38, 46, 0.12);
  transition: transform var(--t) var(--ease), width var(--t) var(--ease), opacity var(--t); }
.seg-btn { position: relative; z-index: 1; border: 0; background: none; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--ink2);
  cursor: pointer; white-space: nowrap; border-radius: 9px; transition: color var(--t) var(--ease); }
.seg-btn[aria-checked=true] { color: var(--ink); }
.seg-btn:disabled { opacity: 0.4; cursor: default; }
.seg.small .seg-btn { padding: 5px 12px; font-size: 12.5px; }
.seg.full { display: flex; }
.seg.full .seg-btn { flex: 1; }
.seg-btn[hidden] { display: none; }

/* ---------------------------------------------------------------- slider */
.sl { margin: 10px 0 14px; }
.sl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; }
.sl-val { display: inline-flex; align-items: baseline; gap: 2px; }
.sl-lab { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.sl-lab .i-btn { width: 16px; height: 16px; line-height: 16px; font-size: 10px; flex: 0 0 16px; position: relative; }
.sl-lab .i-btn::after { content: ""; position: absolute; inset: -4px -6px; }    /* a larger target around the small button */
.sl-num { width: 64px; border: 0; background: transparent; text-align: right; font-size: 13px; font-weight: 600; color: var(--ink); padding: 0;
  -moz-appearance: textfield; }
.sl-num::-webkit-inner-spin-button, .sl-num::-webkit-outer-spin-button { -webkit-appearance: none; }
.sl-unit { color: var(--ink2); font-size: 12px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 4px 0 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--cyan) var(--p, 50%), #E2E8EB var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: #E2E8EB; }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--cyan); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(17, 38, 46, 0.22); transition: transform var(--t) var(--ease); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #FFFFFF; box-shadow: 0 2px 6px rgba(17, 38, 46, 0.22); }

/* ---------------------------------------------------------------- switch */
.sw { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; user-select: none; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-track { position: relative; width: 36px; height: 22px; border-radius: 11px; background: #DCE3E6; transition: background var(--t) var(--ease); flex: 0 0 36px; }
.sw-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(17, 38, 46, 0.25); transition: transform var(--t) var(--ease); }
.sw input:checked + .sw-track { background: var(--cyan); }
.sw input:checked + .sw-track::after { transform: translateX(14px); }
.sw input:focus-visible + .sw-track { outline: 2px solid var(--cyan-d); outline-offset: 2px; }
.sw-label { font-weight: 600; }

/* ---------------------------------------------------------------- picker */
.pk { margin: 8px 0 14px; }
.pk-label { display: block; font-size: 13px; margin-bottom: 2px; }
.pk-info { font-size: 11.5px; color: var(--ink2); margin-bottom: 6px; }
.pk input[type=search] { width: 100%; border: 0; border-radius: var(--r-ctl); background: var(--surface); padding: 10px 12px; font-size: 13px; color: var(--ink); }
.pk-list { margin-top: 6px; max-height: 220px; overflow-y: auto; border-radius: var(--r-ctl); background: #FFFFFF; box-shadow: var(--sh-float); padding: 4px; }
.pk-list[hidden] { display: none; }
.pk-opt { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; font-size: 12.5px; color: var(--ink); border-radius: 8px; cursor: pointer; }
.pk-opt:hover, .pk-opt:focus-visible { background: var(--wash); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--wash); color: var(--cyan-h); border-radius: var(--r-pill); padding: 3px 4px 3px 10px; font-size: 12px; font-weight: 600; }
.chip button { border: 0; background: none; color: var(--ink2); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; }

/* ---------------------------------------------------------------- buttons */
.btn { border: 0; border-radius: var(--r-ctl); font-size: 14px; font-weight: 700; padding: 11px 16px; cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), transform 120ms var(--ease); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--cyan-d); color: #FFFFFF; }
.btn.primary:hover { background: var(--cyan-h); }
.btn.ghost { background: var(--wash); color: var(--cyan-d); }
.btn.ghost:hover { background: #DDEDF1; color: var(--cyan-h); }
.btn.text { background: none; color: var(--cyan-d); padding: 6px 4px; font-weight: 600; }
.btn.text:hover { color: var(--cyan-h); }
.btn.small { font-size: 12.5px; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }

/* ---------------------------------------------------------------- KPIs: one slim row */
/* the KPI row and the rail are one card: the selected node drives the numbers */
.status-card { padding: 0; }
.kpi-card { padding: 12px 20px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; align-items: center; }
.kpi { padding: 0 16px; min-width: 0; }
.kpi + .kpi { box-shadow: inset 1px 0 0 var(--hair); }
.kpi:first-child { padding-left: 4px; }
.kpi-v { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; white-space: nowrap; }
.kpi-v small { font-size: 13px; font-weight: 600; color: var(--ink2); margin-left: 2px; letter-spacing: 0; }
.kpi-v.wait { color: #C3CACE; }
.kpi-v { transition: opacity var(--t) var(--ease); }
.kpi-v.stale { opacity: 0.35; }                /* the last what-if's value while the new one computes */
/* rolling numbers (controls_v2.js countTo): every glyph a column one line tall, top-aligned so its baseline matches the
   line's; a changed digit slides out one way and in from the other. Columns never change width while digits roll. */
.rl .g { display: inline-block; position: relative; vertical-align: top; overflow: hidden; }
.rl .g i { display: inline-block; font-style: normal; }
.rl .g .o { position: absolute; left: 0; top: 0; }
.rl .g.gone .o { position: static; }
.rl .g.fade { animation: rl-fade 350ms var(--ease) both; }
.rl .g.up .n { animation: rl-in-up 350ms var(--ease) both; }
.rl .g.up .o { animation: rl-out-up 350ms var(--ease) both; }
.rl .g.down .n { animation: rl-in-down 350ms var(--ease) both; }
.rl .g.down .o { animation: rl-out-down 350ms var(--ease) both; }
.rl .g.swap .n { animation: rl-fade 350ms var(--ease) both; }
.rl .g.swap .o { animation: rl-fade-out 350ms var(--ease) both; }
.rl .g.in { animation: rl-grow 350ms var(--ease) both; }           /* a digit that appears or goes: its column grows or shrinks */
.rl .g.gone { animation: rl-shrink 350ms var(--ease) both; }
@keyframes rl-in-up { from { transform: translateY(100%); opacity: 0; } }
@keyframes rl-out-up { to { transform: translateY(-100%); opacity: 0; } }
@keyframes rl-in-down { from { transform: translateY(-100%); opacity: 0; } }
@keyframes rl-out-down { to { transform: translateY(100%); opacity: 0; } }
@keyframes rl-fade { from { opacity: 0; } }
@keyframes rl-fade-out { to { opacity: 0; } }
@keyframes rl-grow { from { max-width: 0; } to { max-width: var(--w, 1em); } }
@keyframes rl-shrink { from { max-width: var(--w, 1em); } to { max-width: 0; } }
.kpi-l { font-size: 11.5px; color: var(--ink2); margin-top: 1px; }
.kpi-l .kpi-d { opacity: 0.8; }
.kpi-l .kpi-d::before { content: " · "; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); padding: 4px 12px 4px 10px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.kpi .badge { font-size: 15px; padding: 5px 13px 5px 11px; }
.badge.ok { background: rgba(12, 163, 12, 0.10); color: #087A08; }
.badge.no { background: rgba(208, 59, 59, 0.10); color: #B02E2E; }
.badge.neutral { background: var(--surface); color: var(--ink2); }
.badge.wait { background: var(--surface); color: var(--ink2); }
.range-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 360px; background: rgba(255, 255, 255, 0.82); backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px); box-shadow: var(--sh-float); border-radius: var(--r-ctl); padding: 6px 10px 6px 12px; font-size: 12px; color: var(--ink2); }
.range-chip:empty { display: none; }
.range-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: 0 0 7px; }
.range-chip.warn { color: var(--amber); }
.range-chip.warn .dot { background: var(--serious); }
.range-chip .txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- the step rail: a compact strip */
.rail-card { box-shadow: inset 0 1px 0 var(--hair); padding: 8px 18px 8px 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.rail-card .how { padding: 4px 2px; white-space: nowrap; }
.rail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; position: relative; }
/* a stepper: the indicators sit on one hairline, the text below them, so the line never crosses the text */
.node { position: relative; display: block; border-radius: 14px; padding: 10px 10px 8px; cursor: default; min-width: 0;
  transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.node.clickable { cursor: pointer; }
.node.clickable:hover { background: var(--surface); }
.node:focus-visible { outline: 2px solid var(--cyan-d); outline-offset: -2px; }
.node.sel { background: var(--wash); box-shadow: inset 0 0 0 1.5px rgba(0, 167, 196, 0.35); }
.ind { position: relative; z-index: 1; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800;
  color: #9AA3A8; background: #FFFFFF; box-shadow: inset 0 0 0 1.5px #CBD3D7; transition: background var(--t) var(--ease), box-shadow var(--t) var(--ease), color var(--t); }
.node.running .ind { box-shadow: inset 0 0 0 1.5px var(--cyan); }
.node.running .ind::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 167, 196, 0.35); animation: ring 1.2s var(--ease) infinite; }
.node.done .ind { background: var(--cyan); box-shadow: none; color: #FFFFFF; }
.node.warn .ind { background: var(--serious); box-shadow: none; color: #FFFFFF; }
.node.failed .ind { background: var(--crit); box-shadow: none; color: #FFFFFF; }
.nb { min-width: 0; flex: 1; margin-top: 7px; }
.nt { display: flex; align-items: center; gap: 6px; }
.node-name { font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-name small { font-weight: 600; color: var(--ink2); font-size: 11.5px; margin-left: 3px; }
.nt .i-btn { width: 16px; height: 16px; line-height: 16px; font-size: 10px; flex: 0 0 16px; }
.nk { margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.node-key { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.node-key.amber { color: var(--amber); }
.node-key.muted { color: var(--ink2); font-weight: 600; font-size: 13px; }
.node-kl { font-size: 11.5px; font-weight: 600; color: var(--ink2); margin-left: 3px; }
.nm { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; min-height: 18px; font-size: 11.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; }
.nm .node-time { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tbtn { border: 0; background: none; padding: 0; font-size: 12px; font-weight: 700; color: var(--cyan-d); cursor: pointer; }
.tbtn:hover { color: var(--cyan-h); text-decoration: underline; }
.tbtn:disabled { color: #B9C1C5; cursor: default; text-decoration: none; }
/* a continuous hairline between the indicators, cyan up to the last node that has finished */
.rail .node + .node::before { content: ""; position: absolute; top: 20px; height: 1.5px; left: calc(-100% + 26px); width: calc(100% - 18px);
  background: #DCE2E5; transition: background var(--t) var(--ease); }
.rail .node + .node.linked::before { background: var(--cyan); }
@keyframes ring { 0% { transform: scale(0.85); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------------------------------------------------------------- map: the hero */
.map-card { padding: 0; overflow: hidden; }
.map-wrap { position: relative; }
.map { width: 100%; height: clamp(480px, calc(100vh - 300px), 820px); background: #EEF2F4; }
.map-over { position: absolute; left: 16px; right: 16px; display: flex; align-items: center; gap: 12px; pointer-events: none; z-index: 2; }
.map-over > * { pointer-events: auto; }
.map-over.top { top: 16px; justify-content: space-between; flex-wrap: wrap; align-items: flex-start; }
.map-over.bottom { bottom: 16px; }
.map-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.map-over .seg { background: rgba(255, 255, 255, 0.78); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: var(--sh-float); }
.map-over .seg-thumb { background: var(--cyan-d); box-shadow: none; }
.map-over .seg-btn[aria-checked=true] { color: #FFFFFF; }
#gen-sw .sw { background: rgba(255, 255, 255, 0.78); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: var(--sh-float); border-radius: var(--r-ctl); padding: 6px 12px; }
.legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; background: rgba(255, 255, 255, 0.82); backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px); box-shadow: var(--sh-float); border-radius: 14px; padding: 8px 14px; font-size: 12px; max-width: 100%; }
.lg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lg-bar { width: 120px; height: 6px; border-radius: 3px; }
.lg-tick { color: var(--ink2); font-size: 11px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-cap { width: 14px; height: 14px; border-radius: 50%; background: rgba(99, 108, 114, 0.2); display: inline-grid; place-items: center; }
.lg-cap::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #636C72; }
.arr { display: inline-block; width: .95em; height: .95em; vertical-align: -0.12em; margin: 0 .08em; }   /* map_v2.js ARROW */
.lg-line { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.lg-line.thin { height: 1.5px; }
.lg-xfo { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #D03B3B; box-shadow: 0 0 0 1.2px #FFFFFF, 0 0 0 4px rgba(208, 59, 59, 0.25); }
.lg-dash { width: 18px; height: 0; border-top: 2px dashed var(--ink); display: inline-block; }
.lg-ring { width: 8px; height: 8px; border-radius: 50%; border: 2.5px solid var(--serious); background: #FFFFFF; display: inline-block; }
.map-none { margin: 0; padding: 24px; font-size: 13px; color: var(--ink2); }
.map-cap { font-size: 12px; color: var(--ink2); padding: 12px 24px 14px; min-height: 40px; }
.maplibregl-ctrl-attrib { font-size: 10px; background: rgba(255, 255, 255, 0.7) !important; border-radius: 8px; }
.map-tip { position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; max-width: 280px; background: #FFFFFF; color: var(--ink);
  font-size: 12px; border-radius: 10px; box-shadow: var(--sh-float); padding: 8px 10px; line-height: 1.4; }
.map-tip[hidden] { display: none; }

/* ---------------------------------------------------------------- tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink2); padding: 8px 10px; box-shadow: inset 0 -1px 0 var(--hair); }
.tbl td { padding: 9px 10px; box-shadow: inset 0 -1px 0 var(--hair); vertical-align: top; }
.tbl tr:last-child td { box-shadow: none; }
.tbl .num { text-align: right; white-space: nowrap; }
.tblwrap { overflow-x: auto; max-width: 100%; }
.note { font-size: 12px; color: var(--ink2); margin: 10px 0 0; }

/* ---------------------------------------------------------------- what the what-ifs teach (the insights card) */
.insights-card .ins-sub { margin: 0 0 14px; font-size: 12.5px; color: var(--ink2); }
.ins-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ins { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.ins-n { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; color: var(--ink); }
.ins-n small { font-size: 15px; font-weight: 700; color: var(--ink2); margin-left: 3px; }
.ins h3 { font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.ins p { margin: 0; flex: 1; font-size: 12px; line-height: 1.5; color: var(--ink2); }
.ins .tbtn { align-self: flex-start; margin-top: 4px; }
.study { margin-top: 22px; padding-top: 18px; box-shadow: inset 0 1px 0 var(--hair); scroll-margin-top: 80px; }
.study-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.study-h > div:first-child { min-width: 0; }
.study-h h3 { font-size: 14px; font-weight: 700; }
.study-h p { margin: 4px 0 0; max-width: 660px; font-size: 12px; line-height: 1.5; color: var(--ink2); }
.study-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.prog { height: 4px; border-radius: 2px; background: #E2E8EB; overflow: hidden; margin: -4px 0 12px; }
.prog[hidden] { display: none; }
.prog i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--cyan-d); transition: width var(--t) var(--ease); }
#study-kind { min-width: 0; max-width: 100%; }              /* on a phone the control scrolls inside the card, not the page */
.study-opt { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.study-opt[hidden] { display: none; }
.study-ctl .select { width: auto; min-width: 150px; max-width: 100%; padding-right: 34px; }   /* room for the arrow */
.strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 13), minmax(0, 1fr)); gap: 6px; }
.strip[hidden] { display: none; }
.sday { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px 7px; border-radius: 12px; background: var(--surface);
  cursor: pointer; min-width: 0; transition: box-shadow var(--t) var(--ease); }
.sday:hover { box-shadow: inset 0 0 0 1.5px rgba(0, 167, 196, 0.45); }
.sday:focus-visible { outline: 2px solid var(--cyan-d); outline-offset: 1px; }
.sd-barbox { height: 28px; display: flex; align-items: flex-end; }
.sd-bar { width: 6px; border-radius: 3px; background: #C9D3D8; }
.sd-dot { width: 12px; height: 12px; border-radius: 50%; background: #FFFFFF; box-shadow: inset 0 0 0 1.5px #B9C1C5; }
.sday.running .sd-dot { box-shadow: inset 0 0 0 2px var(--cyan); animation: studypulse 1s var(--ease) infinite; }
.sday.done .sd-dot, .lg-s.by-check { background: var(--cyan); box-shadow: none; }
.sday.warn .sd-dot, .lg-s.warn { background: var(--crit); box-shadow: none; }
.sday.failed .sd-dot { background: #9AA3A8; box-shadow: none; }
.sd-d { font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.sd-ref { font-size: 11px; font-weight: 800; line-height: 1; min-height: 11px; }
.ref-feasible { color: var(--good); } .ref-infeasible { color: var(--crit); } .ref-undecided { color: var(--ink2); }
.strip-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; font-size: 11.5px; color: var(--ink2); }
.strip-legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg-s { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.lg-s.idle { background: #FFFFFF; box-shadow: inset 0 0 0 1.5px #B9C1C5; }
.lg-grp { font-weight: 700; color: var(--ink); }
.strip-legend .lg-grp:not(:first-child) { margin-left: 10px; }
.study-desc:empty { display: none; }
.study-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0 0 14px; max-width: 760px; font-size: 12px; line-height: 1.5; }
.study-dl dt { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); padding-top: 1px; }
.study-dl dd { margin: 0; color: var(--ink2); }
.study-dl dd b { color: var(--ink); font-weight: 700; }
.strip-key { margin: 0 0 8px; font-size: 11.5px; color: var(--ink2); }
.strip-key[hidden] { display: none; }
@media (max-width: 560px) { .study-dl { grid-template-columns: minmax(0, 1fr); gap: 0; } .study-dl dd { margin-bottom: 6px; } }
.study-sum { margin-top: 6px; color: var(--ink); }
@keyframes studypulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@media (max-width: 760px) { .strip { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.ins-map { margin-top: 20px; }
.ins-map[hidden] { display: none; }
.ins-map-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.ins-map-h h3 { font-size: 14px; font-weight: 700; }
.ins-map-h p { margin: 4px 0 0; max-width: 640px; font-size: 12px; line-height: 1.5; color: var(--ink2); }
.ins-map-h > div:first-child { min-width: 0; }
.ins-map-wrap { border-radius: 16px; overflow: hidden; }
.ins-map-wrap .map { height: 460px; }
.ins-map .map-cap { padding: 10px 2px 0; }
@media (max-width: 760px) { .ins-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- info popovers and the sheet */
.i-btn { width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink2); font-size: 11px; font-weight: 800;
  font-style: italic; cursor: pointer; line-height: 18px; padding: 0; flex: 0 0 18px; }
.i-btn:hover { background: var(--wash); color: var(--cyan-d); }
.pop { position: absolute; z-index: 80; background: #FFFFFF; color: var(--ink); border-radius: 14px; box-shadow: var(--sh-float); padding: 12px 14px;
  font-size: 12.5px; line-height: 1.5; animation: popin var(--t) var(--ease); }
@keyframes popin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
dialog.sheet { border: 0; padding: 0; border-radius: 24px; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); box-shadow: 0 24px 80px rgba(17, 38, 46, 0.25);
  color: var(--ink); }
dialog.sheet::backdrop { background: rgba(240, 245, 247, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
dialog.sheet[open] { animation: popin var(--t) var(--ease); }
.sheet-in { padding: 24px 28px 28px; overflow-y: auto; max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); }
.sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#how-tabs { margin: 4px 0 14px; }
.how-panel[hidden] { display: none; }
.sheet-h h2 { font-size: 20px; font-weight: 800; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 14px 0; box-shadow: inset 0 -1px 0 var(--hair); }
.step:last-of-type { box-shadow: none; }
.step-n { width: 26px; height: 26px; border-radius: 50%; background: var(--wash); color: var(--cyan-d); font-weight: 800; display: grid; place-items: center; font-size: 13px; }
.step h3 { font-size: 14.5px; font-weight: 700; }
.step h3 small { color: var(--ink2); font-weight: 600; font-size: 12px; margin-left: 6px; }
.step p { margin: 4px 0 0; color: var(--ink2); font-size: 13px; line-height: 1.55; }
.sheet h4 { font-size: 14px; margin: 20px 0 6px; }
.sheet p.body { font-size: 13px; color: var(--ink2); line-height: 1.55; margin: 4px 0; }
.sheet p.lede { font-size: 14.5px; line-height: 1.55; color: var(--ink); margin: 0 0 12px; }
.claims { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.claim { background: var(--surface); border-radius: 14px; padding: 12px 14px; scroll-margin-top: 12px; transition: box-shadow var(--t) var(--ease); }
.claim.hl { box-shadow: inset 0 0 0 2px var(--cyan); }
.claim h3 { font-size: 14px; font-weight: 800; }
.claim p { margin: 4px 0 0; color: var(--ink2); font-size: 12.5px; line-height: 1.5; }

.foot { font-size: 11.5px; color: var(--ink2); padding: 32px 0 0; text-align: center; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .proof { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
  .side { position: static; max-height: none; order: 2; }
  .main { order: 1; }
  .rail { grid-template-columns: repeat(4, minmax(160px, 1fr)); overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
}
@media (max-width: 760px) {
  .claims { grid-template-columns: minmax(0, 1fr); }
  .proof-i { padding: 6px 8px; }
  .hdr-in { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .hdr { position: static; }
  .brand { flex: 1 1 0; }
  .logo { width: 32px; height: 32px; }
  .hdr-title h1 { font-size: 17px; }
  .hdr-title p { font-size: 12px; }
  .page { padding: 16px 16px 32px; }
  .card { padding: 16px; border-radius: 18px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .kpi { padding: 4px 12px; }
  .kpi:nth-child(odd) { padding-left: 0; box-shadow: none; }
  .kpi-v { font-size: 22px; }
  .rail { grid-template-columns: minmax(0, 1fr); overflow: visible; gap: 4px; }
  .node { display: flex; align-items: flex-start; gap: 10px; }
  .nb { margin-top: 0; }
  .rail-card { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 8px 10px 10px; }
  .rail-card .how { justify-self: start; margin-left: 10px; }
  .rail .node + .node::before { left: 20.25px; top: calc(-100% + 30px); width: 1.5px; height: calc(100% - 22px); }
  .map { height: 440px; }
  .range-chip { max-width: 100%; }
  .map-over.top { flex-direction: column; align-items: flex-start; }
  .legend { font-size: 11px; gap: 4px 10px; }
  .lg-bar { width: 80px; }
  .select, .sl-num, .pk input[type=search] { font-size: 16px; }
  .tbl { table-layout: fixed; }
  .tbl th, .tbl td { white-space: normal !important; overflow-wrap: anywhere; padding: 7px 6px; }
}

/* real weather (heat source: a real heat wave) */
#heat-src { margin-bottom: 12px; }
#realwx .wx-date { margin: 2px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* hurricane panel: the new-damage button with its "i"; the storm card (what it took out, what GENCO sees) */
.dmg { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.dmg .btn { flex: 1; }
.stm-lead { margin: 0 0 16px; font-size: 13px; font-weight: 600; }
.stm .nb { white-space: nowrap; }
.stm-h { margin: 18px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink2); }
.stm-lead + .stm-h { margin-top: 0; }
.stm-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stm-t { background: var(--surface); border-radius: var(--r-ctl); padding: 12px 14px; min-width: 0; }
.stm-v { display: flex; align-items: center; gap: 8px; font-size: 27px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stm-v::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink2)); }
.stm-t[data-k=lines] { --c: var(--crit); }
.stm-t[data-k=zone] { --c: var(--serious); }
.stm-n { margin-top: 4px; font-size: 13px; font-weight: 700; }
.stm-s { margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: var(--ink2); }
.stm-sees { list-style: none; margin: 0; padding: 0; }
.stm-sees li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 8px 0; font-size: 13px; box-shadow: inset 0 -1px 0 var(--hair); }
.stm-sees li:last-child { box-shadow: none; }
.stm-sees b { font-weight: 600; color: var(--ink2); }
@media (max-width: 560px) { .stm-tiles { grid-template-columns: minmax(0, 1fr); } .stm-sees li { grid-template-columns: minmax(0, 1fr); gap: 0; } }
