/* ============================================================
   GRID MARGIN — "The Settlement Ledger"
   A two-ink system: black = in balance, red = a limit has failed.
   Sibling to the Subsidy Clock (masthead / card / source-line / footer
   grammar) but its own voice: red-on-white, sans display + serif read,
   the half-dial gauge as the instrument. No green, no amber, no navy.
   ============================================================ */

:root {
  --field:     #f4f5f6;   /* settlement grey — the ground (cool, not warm oat) */
  --paper:     #ffffff;   /* leaf — cards/tables lift a hair off the field */
  --ink:       #15181c;   /* ledger ink — all neutral figures, rules, needle at rest */
  --slate:     #565e66;   /* secondary text, every baked source line, year ticks */
  --rule:      #d7dbdf;   /* hairlines, card borders */
  --rule-soft: #eaecee;   /* intra-table rules, the stripe's pale (windy) end */
  --red:       #d6121f;   /* debit red — THE accent: headline, armed needle, failures */
  --red-deep:  #a8101b;   /* deep debit — failing body ink at small sizes, sub-5% ticks */
  --heading:   var(--red);/* section-headline colour (Entry 01's red) — one knob for all headlines */
  --hatch:     #c9c6c0;   /* known-gap days only (never white, never red) */
  --hatch-bg:  #edebe6;

  --display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --read: "Newsreader", Georgia, "Times New Roman", serif;
  --mono: "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 2px;
  --container: 1040px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font-family: var(--read);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 22px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums lining-nums; }

a { color: var(--red-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- masthead ---------- */
.masthead { background: var(--paper); border-bottom: 2px solid var(--ink); }
.masthead-inner {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px 24px; flex-wrap: wrap; padding: 16px 0 14px;
}
.brand {
  margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.5rem;
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink);
  display: flex; align-items: center;
}
.brand a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; }
.brand-tick {
  width: 10px; height: 10px; border-radius: 2px; background: var(--red);
  margin-right: 11px; flex: none; animation: tick 2s steps(1) infinite;
}
@keyframes tick { 50% { opacity: 0.28; } }
.brand-strap {
  font-family: var(--read); font-style: italic; font-size: 1rem;
  color: var(--slate); margin: 2px 0 0;
}
.masthead nav { display: flex; gap: 18px; flex-wrap: wrap; }
.masthead nav a {
  font-family: var(--display); font-size: 0.8125rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink);
  text-decoration: none; padding-bottom: 2px; border-bottom: 1px solid transparent;
}
.masthead nav a:hover { color: var(--ink); border-bottom-color: var(--red); }
.masthead nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--rule); }
.live-dot {
  font-family: var(--display); font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.12em; color: var(--red); display: inline-flex; align-items: center; gap: 6px;
}
.live-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

/* clock strip under the masthead */
.clockstrip {
  font-family: var(--mono); font-size: 0.78rem; color: var(--slate);
  padding: 9px 0; border-bottom: 1px solid var(--rule); background: var(--paper);
}

/* ---------- the live warning light ---------- */
.warnstrip { border-bottom: 1px solid var(--rule); background: var(--paper); }
.warnstrip-inner {
  display: flex; align-items: baseline; gap: 10px;
  font-family: var(--mono); font-size: 0.78rem; padding: 9px 0; color: var(--slate);
}
.wl-lamp {
  flex: none; align-self: center; width: 9px; height: 9px; border-radius: 50%;
  background: var(--rule);  /* dormant: a dark, unlit bulb */
}
.wl-text { line-height: 1.4; }
.wl-text.wl-muted { color: var(--slate); }
/* source + issued-at provenance on the lit banner: small, quiet, never competes with the notice */
.wl-src { display: inline-block; font-size: 0.78em; opacity: 0.85; white-space: nowrap; }
/* lit: the one red, a steady pulse, bold notice text */
.warnstrip[data-status="in_force"] {
  background: var(--red); border-bottom-color: var(--red-deep);
}
.warnstrip[data-status="in_force"] .warnstrip-inner { color: #fff; }
.warnstrip[data-status="in_force"] .wl-text strong { color: #fff; }
.warnstrip[data-status="in_force"] .wl-lamp {
  background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,0.9);
  animation: warnpulse 1.4s ease-in-out infinite;
}
@keyframes warnpulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.85); opacity: 1; }
  70%  { box-shadow: 0 0 0 7px rgba(255,255,255,0); opacity: 0.7; }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .warnstrip[data-status="in_force"] .wl-lamp { animation: none; box-shadow: none; }
}

/* ---------- the ledger: entries separated by a double rule ---------- */
main { padding-bottom: 40px; }
.entry { padding: 30px 0 26px; border-top: 3px double var(--rule); }
.entry:first-of-type { border-top: none; }
.eyebrow {
  font-family: var(--display); font-size: 0.75rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.13em; color: var(--slate); margin: 0 0 6px;
}
.eyebrow .live-tag { color: var(--red); margin-left: 8px; }
.headline {
  font-family: var(--display); font-weight: 700; line-height: 1.05;
  font-size: clamp(1.7rem, 4.2vw, 2.7rem); letter-spacing: -0.02em;
  color: var(--heading); margin: 0 0 8px;
}
.headline.ink { color: var(--ink); }
.def {
  font-family: var(--read); font-style: italic; color: #2a2f35; font-size: 1.3rem;
  margin: 0 0 18px;
}
/* homepage orientation lede — tells arrivals what the site is, above Entry 01 */
.site-lede {
  font-family: var(--read); font-size: 1.42rem; font-weight: 500; line-height: 1.5; color: var(--ink);
  max-width: 46em; margin: 30px 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--rule);
}
.src {
  font-family: var(--mono); font-size: 0.8125rem; color: var(--slate);
  margin: 14px 0 0; letter-spacing: -0.01em;
}
.src a { color: var(--slate); text-decoration-color: var(--rule); }
.src a:hover { color: var(--red); }

/* a limit-is-attached caveat — full ink, red left-rule, never grey, never buried */
.caveat {
  font-family: var(--read); font-style: italic; color: var(--ink);
  border-left: 3px solid var(--red); padding: 4px 0 4px 14px; margin: 16px 0 0;
  max-width: 40em;
}
.caveat strong { font-style: normal; font-weight: 600; }

/* ---------- verdict: gauge and receipt side by side ---------- */
.verdict-cols {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 56px); align-items: center; margin-top: 6px;
}
.verdict-receipt { min-width: 0; }   /* let the table shrink inside its grid track */
/* Side-by-side only when each column is wide enough to hold the gauge's stamp pair
   without it wrapping; below that, stack full-width so the gauge never breaks. */
@media (max-width: 1024px) {
  .verdict-cols { grid-template-columns: 1fr; gap: 4px; }
}

.gauge-block { text-align: center; margin: 6px 0 2px; }
.gauge { width: min(440px, 92%); height: auto; display: block; margin: 0 auto; }
.gauge-zonelabels {
  display: flex; justify-content: space-between; margin: 2px auto 0;
  width: min(440px, 92%); padding: 0 5%; box-sizing: border-box;
  font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--slate);
}
.stamp-pair {
  display: flex; justify-content: space-between; gap: clamp(20px, 7vw, 70px);
  width: min(440px, 92%); margin: 10px auto 0; flex-wrap: wrap;
}
.stamp { text-align: center; }
.stamp-val {
  font-family: var(--display); font-weight: 700; font-size: clamp(1.9rem, 5vw, 2.8rem);
  letter-spacing: -0.02em; line-height: 1; display: block;
}
.stamp-val.red { color: var(--red); }
.stamp-val.reliable { color: #1b6e45; }     /* reliable group — green, matches the receipt + inner arc */
.stamp-val.unreliable { color: var(--red); }/* unreliable group — red */
.stamp-label {
  font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--slate); margin-top: 6px; display: block;
}
.ssline {
  font-family: var(--display); font-size: 0.74rem; letter-spacing: 0.04em;
  text-align: center; margin: 4px 0 0; color: var(--slate);
}
.ssline.export { color: #c2188f; }   /* magenta — the exported surplus */
.receipt .export-row td { color: var(--slate); font-style: italic; border-top: 1px dashed #cfd4d8; }

/* ---------- the receipt table ---------- */
.receipt { width: 100%; border-collapse: collapse; margin: 12px 0 0; font-family: var(--display); font-variant-numeric: tabular-nums lining-nums; }
.receipt caption {
  font-family: var(--display); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--slate); text-align: left;
  padding-bottom: 6px; border-bottom: 1px solid var(--ink);
}
.receipt th, .receipt td { padding: 5px 8px; font-size: 0.86rem; }
.receipt thead th {
  font-family: var(--display); font-weight: 500; font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--slate);
  text-align: right; border-bottom: 1px solid var(--rule);
}
.receipt thead th:first-child { text-align: left; }
.receipt td { border-bottom: 1px solid var(--rule-soft); }
.receipt td.fuel { text-align: left; font-family: var(--display); font-style: normal; }
.receipt td.n, .receipt thead th:not(:first-child) { text-align: right; white-space: nowrap; }
.receipt .bar-cell { width: 24%; }
.bar { height: 9px; background: var(--ink); border-radius: 1px; }
.bar.red { background: var(--red); }
.receipt tr.total td {
  border-top: 2px solid var(--ink); border-bottom: none; font-weight: 600;
  padding-top: 6px; color: var(--ink);
}
/* subtotal rows that head each reliability group (Firm power / Weather & imports) */
.receipt tr.group td {
  border-top: 1px solid var(--ink); border-bottom: none; padding-top: 7px;
  font-family: var(--display); font-weight: 500; font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink);
}
.receipt tr.group.fail td.fuel, .receipt tr.group.fail td.n { color: var(--red-deep); }
.receipt tr.group.pass td.fuel, .receipt tr.group.pass td.n { color: #1b6e45; }   /* reliable = green */
.receipt tr.group + tr td { padding-top: 5px; }
.receipt td.fuel { padding-left: 16px; }
.receipt tr.group td.fuel, .receipt tr.total td.fuel { padding-left: 8px; }

/* ---------- punch line (capacity trap) ---------- */
.duel-punch { font-family: var(--read); font-size: 1.05rem; margin: 12px 0 0; max-width: 34em; }
.duel-punch strong { color: var(--red); }

/* ---------- the wind stripe ---------- */
.stripe-wrap { margin: 12px 0 0; }
.stripe-meanrow {
  display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px;
  font-family: var(--mono); font-size: 0.7rem; color: var(--slate);
}
.stripe-meanrow b { color: var(--ink); font-weight: 600; }
#stripe-canvas { width: 100%; height: 160px; display: block; border: 1px solid var(--rule); background: var(--paper); }
.stripe-axis {
  display: flex; justify-content: space-between; margin: 5px 2px 0;
  font-family: var(--mono); font-size: 0.68rem; color: var(--slate);
}
.stripe-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0 0;
  font-family: var(--display); font-size: 0.64rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--slate); align-items: center;
}
.swatch { display: inline-block; width: 14px; height: 10px; vertical-align: -1px; margin-right: 5px; border: 1px solid var(--rule); }
.tick-mark { display: inline-block; width: 2px; height: 11px; background: var(--red); vertical-align: -2px; margin-right: 5px; }
.tick-mark.deep { background: var(--red-deep); height: 14px; }

/* ---------- the reliability stripe (Entry 01, under the gauge) ---------- */
.rel-strip { margin: 18px 0 2px; }
.rel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin: 0 0 7px; }
.rel-cap { margin: 0; max-width: 56ch; font-family: var(--read); font-size: 0.92rem; color: var(--slate); }
.rel-cap strong { color: var(--ink); font-weight: 600; }
.rel-key { flex: none; text-align: right; }
.rel-key-lab {
  display: block; margin-bottom: 3px; font-family: var(--display); font-size: 0.6rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate);
}
.rel-key-wrap { position: relative; width: 150px; margin-top: 15px; }
#reliability-key { width: 100%; height: 9px; display: block; box-sizing: border-box; border: 1px solid var(--rule); }
.rel-now {
  position: absolute; bottom: 100%; margin-bottom: 4px; transform: translateX(-50%);
  font-family: var(--display); font-size: 0.56rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink); white-space: nowrap; pointer-events: none;
}
.rel-now[hidden] { display: none; }
.rel-now::after {
  content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 4px solid var(--ink);
}
.rel-key-ticks { display: flex; justify-content: space-between; width: 150px; margin-top: 2px; font-family: var(--mono); font-size: 0.62rem; color: var(--slate); }
.rel-key-note { margin: 1px 0 0; font: 0.56rem var(--mono); color: var(--slate); text-align: right; }
#reliability-canvas { width: 100%; height: 40px; display: block; border: 1px solid var(--rule); background: var(--paper); }
.rel-axis { position: relative; margin: 3px 0 0; height: 26px; }
.rel-months { position: relative; height: 12px; }
.rel-months span { position: absolute; transform: translateX(-50%); font-family: var(--mono); font-size: 0.62rem; color: var(--slate); }
.rel-years { position: relative; height: 13px; }
.rel-years span { position: absolute; padding-left: 3px; border-left: 1px solid var(--ink); font-family: var(--display); font-size: 0.68rem; font-weight: 600; color: var(--ink); }
.rel-toggle { display: flex; gap: 0; }
.rel-toggle button { font: 0.62rem var(--display); text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 8px; border: 1px solid var(--rule); background: var(--paper); color: var(--slate); cursor: pointer; }
.rel-toggle button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.rel-toggle button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.rel-toggle button:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
@media (max-width: 640px) { .rel-head { flex-direction: column; align-items: stretch; } .rel-key { text-align: left; } .rel-key-ticks, .rel-key-wrap { width: 100%; } }

/* ---------- the self-writing tally ---------- */
.tally { width: 100%; border-collapse: collapse; margin: 8px 0 0; }
.tally th {
  font-family: var(--display); font-size: 0.66rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--slate); text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--ink);
}
.tally th:first-child { text-align: left; }
.tally td { padding: 7px 10px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.tally td.year { font-family: var(--mono); color: var(--slate); }
.tally td.marks { width: 62%; line-height: 1; }
.tally td.n { font-family: var(--mono); text-align: right; font-weight: 600; }
.tally td.n.red { color: var(--red); }
.tally tr.partial td.year::after { content: " · so far"; color: var(--slate); font-family: var(--read); font-style: italic; font-size: 0.8em; }
.mark { display: inline-block; width: 2px; height: 13px; background: var(--ink); margin: 0 2px 0 0; vertical-align: middle; }
/* sub-5% days carry a second, non-colour signal: taller + a foot, so they are
   distinguishable from sub-10% strokes without relying on the red alone. */
.mark.sub5 { background: var(--red); height: 18px; border-bottom: 2px solid var(--red-deep); }
.mark-gap { display: inline-block; width: 9px; }

/* ---------- records ---------- */
.records { margin: 18px 0 0; font-family: var(--read); }
.records .rec { margin: 6px 0; }
.records .rec b { font-family: var(--mono); font-weight: 600; color: var(--ink); }

/* ---------- footer ---------- */
.footer { border-top: 2px solid var(--ink); background: var(--paper); padding: 28px 0 44px; margin-top: 8px; }
.footer .freshness { font-family: var(--mono); font-size: 0.78rem; color: var(--slate); }
.footer .links { font-family: var(--display); font-size: 0.875rem; letter-spacing: 0.01em; color: var(--ink); margin: 10px 0 0; }
.footer .links a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 2px; }
.footer .links a:hover { color: var(--red); text-decoration-color: var(--red); }
.footer .trace { font-family: var(--read); font-style: normal; font-size: 0.9rem; color: var(--slate); margin: 10px 0 0; }

/* ---------- mode badge / fallback states ---------- */
.modebadge {
  font-family: var(--display); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 2px 8px; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--slate);
}
.modebadge.fallback { color: var(--red-deep); border-color: var(--red-deep); }
.modebadge.unavailable { color: var(--red); border-color: var(--red); }
.warn { font-family: var(--read); font-style: italic; color: var(--red-deep); margin: 8px 0 0; }

/* ---------- prose pages (methodology / about) ---------- */
.prose { padding: 30px 22px 50px; }
.prose h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -0.02em; margin: 0 0 6px; }
.prose .lede { font-family: var(--read); font-size: 1.42rem; font-weight: 500; line-height: 1.5; color: var(--ink); max-width: 40em; margin: 0 0 10px; }
.prose h2 { font-family: var(--display); font-weight: 700; font-size: 1.5rem; margin: 34px 0 4px; padding-top: 22px; border-top: 1px solid var(--rule); }
.prose h2:first-of-type { border-top: none; }
.prose p, .prose li { max-width: 40em; font-size: 1.2rem; line-height: 1.6; }
.prose .meta { font-family: var(--mono); font-size: 0.78rem; color: var(--slate); }
.prose .formula { font-family: var(--mono); font-size: 0.84rem; background: var(--paper); border: 1px solid var(--rule); border-left: 3px solid var(--ink); padding: 12px 14px; white-space: pre-wrap; max-width: 40em; }
.prose .index { font-family: var(--display); font-size: 0.8rem; letter-spacing: 0.04em; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .container { padding: 0 16px; }
  .receipt .bar-cell { display: none; }
  .tally td.marks { display: none; }
  #stripe-canvas { height: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-tick, .live-dot::before { animation: none !important; }
  * { scroll-behavior: auto !important; }
}

/* ---------- share buttons + gallery ---------- */
.share-row { display:flex; gap:8px; margin-top:16px; flex-wrap:wrap; }
.share-btn { font:500 13px "Spline Sans Mono",monospace; letter-spacing:.04em;
  padding:6px 12px; border:1px solid var(--rule); border-radius:999px; color:var(--ink);
  text-decoration:none; }
.share-btn:hover { border-color:var(--red); color:var(--red); }
.action-row { display:flex; gap:8px; margin-top:8px; flex-wrap:wrap; }
.action-btn { font:500 13px "Spline Sans Mono",monospace; letter-spacing:.04em;
  padding:6px 12px; border:1px solid var(--rule); border-radius:5px; background:none;
  color:var(--ink); cursor:pointer; text-decoration:none; }
.action-btn:hover { border-color:var(--red); color:var(--red); }
.card-gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(420px,1fr)); gap:28px; margin-top:24px; }
.card-tile img { width:100%; height:auto; border:1px solid var(--rule); border-radius:6px; display:block; }
.card-tile figcaption { font-family:var(--read); font-size:.95rem; margin:10px 0 4px; color:var(--ink); }

/* Entry 02 — capacity trap: per-source blocks (label row · dial 1/3 + carpet 2/3 · aligned source row) */
.trap-grid { display: grid; grid-template-columns: 1fr 2fr; column-gap: 24px; row-gap: 4px; align-items: stretch; }
.trap-grid.gauge-only { grid-template-columns: 1fr; }

/* the single colour legend shares the Wind label's row, in the stripe column (same width as the
   stripe), the gradient bar filling the column between its end labels */
.carpet-legend { grid-column: 2; align-self: center; display: flex; align-items: center; gap: 10px; margin: 18px 0 24px;
  font-family: var(--display); font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--slate); }
.carpet-legend .cl-bar-wrap { position: relative; flex: 1 1 0; display: flex; align-items: center; }
/* ramp gradient (white = no output → saturated source colour = full output) is set inline per source */
.carpet-legend .cl-bar { width: 100%; height: 10px; border: 1px solid var(--rule); }
/* live "now" caret over the bar, at the instantaneous capacity-factor reading (cf. Entry 01) */
.carpet-legend .cl-now { position: absolute; bottom: 100%; margin-bottom: 4px; transform: translateX(-50%);
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; color: var(--ink); white-space: nowrap; pointer-events: none; }
.carpet-legend .cl-now::after { content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border-left: 3px solid transparent; border-right: 3px solid transparent; border-top: 4px solid var(--ink); }
/* rolling-year distribution box-plot below the bar: p10–p90 whisker, p25–p75 usual half, average tick.
   Colours are set inline per source (band/core hue) to match the dial's distribution bands. */
.carpet-legend .cl-box { position: absolute; top: 100%; left: 0; right: 0; height: 8px; margin-top: 3px; }
.carpet-legend .cl-box-line { position: absolute; top: 3px; height: 2px; background: var(--slate); }
.carpet-legend .cl-box-iqr { position: absolute; top: 1px; height: 6px; background: var(--slate); }
.carpet-legend .cl-box-avg { position: absolute; top: 0; width: 2px; height: 8px; background: var(--ink); transform: translateX(-50%); }
/* numeric markers under the box: the 9-in-10 ends (in the source hue) and the average (ink) */
.carpet-legend .cl-nums { position: absolute; top: 100%; left: 0; right: 0; margin-top: 14px; height: 0.8em; }
.carpet-legend .cl-num { position: absolute; transform: translateX(-50%); white-space: nowrap;
  font: 600 0.72rem/1 'Spline Sans Mono', monospace; letter-spacing: 0; text-transform: none; }
.carpet-legend .cl-num-avg { color: var(--ink); }

/* the source label (Wind / Solar) sits in the gauge column, with the rolling-year average alongside */
.trap-label { grid-column: 1; margin: 16px 0 2px; font-family: var(--display); font-weight: 600;
  font-size: 1.05rem; color: var(--ink); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.trap-avg { font-family: var(--read); font-weight: 400; font-size: 0.85rem; color: var(--slate); }

.trap-gauge-cell { grid-column: 1; min-width: 0; }
/* compact, self-documenting key for the box-plot under each carpet legend — shown once, with
   mini-glyphs that mirror the real marks (thin line, thick bar, tick, caret) */
.legend-key { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center;
  gap: 5px 16px; margin: 10px 0 2px; font: 0.78rem var(--mono); color: var(--slate); }
.legend-key .lk-cap { color: var(--ink); }
.legend-key .lk-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-key .lk-g { position: relative; display: inline-block; width: 16px; height: 8px; flex: none; }
.legend-key .lk-g::before { content: ''; position: absolute; }
.legend-key .lk-whisker::before { top: 3px; left: 0; width: 16px; height: 2px; background: var(--slate); }
.legend-key .lk-bar::before { top: 1px; left: 3px; width: 10px; height: 6px; background: var(--slate); }
.legend-key .lk-avg::before { top: 0; left: 7px; width: 2px; height: 8px; background: var(--ink); }
.legend-key .lk-now::before { top: 0; left: 4px; border-left: 4px solid transparent;
  border-right: 4px solid transparent; border-top: 5px solid var(--ink); }
/* bottom-align the stripe so its base lines up with the dial below it (legend sits just above) */
.carpet-cell { grid-column: 2; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.carpet-stage { flex: 0 0 auto; display: flex; gap: 6px; height: var(--carpet-h, 150px); }
.carpet-yaxis { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: space-between;
  font: 500 12px/1 'Spline Sans Mono', monospace; color: #565e66; }
.carpet { flex: 1 1 0; min-width: 0; height: 100%; display: block; image-rendering: pixelated;
  box-sizing: border-box; border: 1px solid var(--rule); }
.carpet-xaxis { position: relative; height: 14px; margin: 3px 0 0; font: 500 12px/1 'Spline Sans Mono', monospace; color: #565e66; }
.carpet-xaxis span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.carpet-xaxis b { color: var(--ink); font-weight: 600; }

/* the two source lines share one grid row below their unit, so they align vertically */
.trap-src { margin: 6px 0 0; }
.trap-src-gauge { grid-column: 1; }
.trap-src-strip { grid-column: 2; }

.gauge .g-pct { font: 600 11px 'Spline Sans Mono', monospace; fill: #15181c; }
.gauge .g-mw { font: 500 9px 'Spline Sans Mono', monospace; fill: #565e66; }
/* The trap dials fill their 1/3 column; the calibration text is enlarged for legibility. */
.trap-gauge-cell .gauge { width: 100%; max-width: 380px; }
.trap-gauge-cell .gauge .g-pct { font-size: 11px; }
.trap-gauge-cell .gauge .g-mw { font-size: 9px; }
@media (max-width: 900px) {
  .trap-grid, .trap-grid.gauge-only { grid-template-columns: 1fr; }
  .trap-label, .carpet-legend, .trap-gauge-cell, .carpet-cell, .trap-src-gauge, .trap-src-strip { grid-column: 1; }
}

/* ---------- Entry 03 — wind unreliability carpet ---------- */
.wind-carpet-cell { display: grid; grid-template-columns: 2.4rem 1fr; align-items: stretch; }
.wind-yaxis { display: flex; flex-direction: column; justify-content: space-between;
  font: 500 11px var(--mono); color: var(--ink); padding-right: 6px; text-align: right; }
.wind-carpet { width: 100%; display: block; image-rendering: pixelated; }
.wind-carpet-x { position: relative; height: 1.2em; margin-left: 2.4rem;
  font: 500 11px var(--mono); color: var(--ink); }
.wind-carpet-x span { position: absolute; transform: translateX(-50%); }
.wind-drought { width: 100%; display: block; margin-top: 1rem; }
.wind-caption { font: 400 italic 1rem/1.5 var(--read); color: var(--ink); margin-top: .5rem; }
.wind-howto { font: 400 0.95rem/1.55 var(--read); color: #3f464d; margin: 0 0 12px; }
.wind-howto strong { color: var(--ink); font-weight: 600; }
/* the drought-plot intro follows the carpet's month axis — give it room to breathe */
.wind-carpet-x + .wind-howto { margin-top: 2.25rem; }
.wind-drought + .wind-caption { margin-top: .5rem; }
