@font-face { font-family: 'Literata'; src: url('fonts/literata.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('fonts/literata-italic.woff2') format('woff2'); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --ink: #2f2d2a; --ink2: #5b5852; --ink3: #6b6861; --grid: #e7e3da; --grid2: #d8d3c8;
  --paper: #fbfaf6; --bg: #f4f2ec;
  --measure: 40rem;
  --series-w: 0px; /* non-zero under the ≥960px left rail */
  --view-w: 100vw; /* content viewport: 100vw minus the rail when the rail is fixed */
  --figw: min(calc(var(--view-w) - 28px), 64rem);
  --sans: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Literata', Georgia, 'Times New Roman', serif;
  --solar: #e3a922; --wind: #4f9fcb; --hydro: #2c6795; --nuclear: #8e62b5; --lignite: #8b6a4c; --coal: #55524d; --gas: #e0773f;
  --peaker: #c5473f; --storage: #2fa58a; --price: #b52f6a; --procurement: #e0a03a; --network: #6a7db0; --taxes: #a49d90;
  --phaseA: #d1495b; --phaseB: #e8a33c; --phaseC: #1f8a9b; --electron: #3a78d4; --hot: #d94a2b; --cold: #3a78d4; --freq: #1f8a9b;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); font-size: 18.5px; line-height: 1.68; font-optical-sizing: auto; text-rendering: optimizeLegibility; }
main { padding: 0 20px 6rem; }
article > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
p { margin: 0 auto 1.15em; hyphens: auto; }
h1, h2, h3 { font-family: var(--sans); color: var(--ink); letter-spacing: -0.015em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.4rem); line-height: 1.05; margin: 0.2em auto 0.25em; font-weight: 750; letter-spacing: -0.03em; }
h2 { font-size: 1.55rem; line-height: 1.2; margin: 3.4em auto 0.8em; font-weight: 700; }
h2 .num { color: var(--ink3); font-weight: 500; margin-right: 0.4em; font-variant-numeric: tabular-nums; }
h3 { font-size: 1.1rem; margin: 2.2em auto 0.6em; font-weight: 650; }
a { color: inherit; text-decoration-color: var(--grid2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink2); }
em, i { font-style: italic; }
b, strong { font-weight: 650; }
small { font-size: 0.82em; }
.lede { font-size: 1.18em; color: var(--ink2); line-height: 1.55; }
.byline { font-family: var(--sans); font-size: 0.85rem; color: var(--ink3); margin-bottom: 2.2rem; }
header.top { padding-top: 4.5rem; }
sup.fn { line-height: 0; }
sup.fn a { font-family: var(--sans); font-size: 0.7em; text-decoration: none; color: var(--ink3); padding: 0 1px; }
sup.fn a:hover { color: var(--ink); }
sup.fn .fn-sep { font-family: var(--sans); font-size: 0.7em; color: var(--ink3); }
.k { font-family: var(--sans); font-size: 0.86em; font-weight: 600; letter-spacing: 0.01em; }
.c-solar { color: #b27f0d; } .c-wind { color: var(--wind); } .c-gas { color: var(--gas); } .c-coal { color: var(--coal); } .c-lignite { color: var(--lignite); }
.c-nuclear { color: var(--nuclear); } .c-hydro { color: var(--hydro); } .c-storage { color: var(--storage); } .c-price { color: var(--price); } .c-peaker { color: var(--peaker); }
.c-procurement { color: #b97b10; } .c-network { color: var(--network); } .c-taxes { color: #7d776b; } .c-hot { color: var(--hot); } .c-cold { color: var(--cold); }
.c-A { color: var(--phaseA); } .c-B { color: #c4831d; } .c-C { color: var(--phaseC); } .c-electron { color: var(--electron); } .c-freq { color: var(--freq); }
.c-solar, .c-wind, .c-gas, .c-coal, .c-lignite, .c-nuclear, .c-hydro, .c-storage, .c-price, .c-peaker, .c-procurement, .c-network, .c-taxes, .c-hot, .c-cold, .c-A, .c-B, .c-C, .c-electron, .c-freq, .c-field { font-weight: 600; }

/* figures */
figure.fig { width: var(--figw); max-width: none; margin: 2.2rem 0 2.4rem calc((100% - var(--figw)) / 2); padding: 14px 14px 12px; background: var(--paper); border-radius: 16px; box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 8px 30px -18px rgba(60,50,30,0.25); }
/* one card width for every figure, so the left edge does not jump as you scroll */
.canvas-wrap { position: relative; width: 100%; }
.canvas-wrap canvas { display: block; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.canvas-wrap canvas.dragging { cursor: grabbing !important; }
.three-wrap { border-radius: 10px; overflow: hidden; }
figcaption { font-family: var(--sans); font-size: 0.82rem; line-height: 1.5; color: var(--ink2); margin: 10px 4px 0; max-width: 46rem; }
figcaption .tagline { display: inline-block; font-weight: 650; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; padding: 1px 7px; border-radius: 99px; margin-right: 6px; vertical-align: 1px; }
.tag-real { background: #e2efe9; color: #29765c; } .tag-ill { background: #efe9dc; color: #7f6431; } .tag-mixed { background: #e6e8f2; color: #4d5c8e; }
.fig-error::after { content: 'This figure failed to load.'; font-family: var(--sans); color: var(--peaker); }

/* controls */
.controls { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: flex-end; margin: 12px 4px 2px; font-family: var(--sans); font-size: 0.84rem; color: var(--ink2); }
.ctl.slider { flex: 1 1 210px; max-width: 330px; min-width: 180px; --c: var(--ink2); }
.ctl.slider.wide { max-width: none; flex-basis: 100%; }
.ctl.slider label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 2px; line-height: 1.3; }
.ctl.slider .name small { color: var(--ink3); font-size: 0.9em; }
.ctl.slider output { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); white-space: nowrap; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; margin: 0; cursor: pointer; --p: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--c) 0 var(--p), color-mix(in srgb, var(--c) 22%, #ddd8cc) var(--p) 100%); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--c) 22%, #ddd8cc); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--c); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: #fff; border: 2.5px solid var(--c); box-shadow: 0 1px 4px rgba(0,0,0,0.15); transition: transform .12s; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2.5px solid var(--c); box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent); }
.ctl.segmented { display: flex; flex-direction: column; gap: 4px; }
.seg-label { font-size: 0.8rem; color: var(--ink3); }
.seg-group { display: inline-flex; flex-wrap: wrap; background: #ebe7dd; border-radius: 10px; padding: 3px; gap: 2px; }
.seg-group button { font: inherit; font-size: 0.82rem; border: 0; background: transparent; color: var(--ink2); padding: 6px 11px; border-radius: 8px; cursor: pointer; line-height: 1.2; }
.seg-group button[aria-pressed=true] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.seg-group button:focus-visible, .btn:focus-visible { outline: 2px solid var(--ink2); outline-offset: 2px; }
.btnrow, .toggles { display: flex; flex-wrap: wrap; gap: 8px; flex-basis: 100%; }
.btn { font: inherit; font-size: 0.84rem; border: 1px solid var(--grid2); background: #fff; color: var(--ink); padding: 7px 13px; border-radius: 99px; cursor: pointer; line-height: 1.2; --c: var(--ink2); }
.btn:hover { border-color: var(--ink3); }
.btn small { color: var(--ink3); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.danger { border-color: color-mix(in srgb, var(--peaker) 45%, #fff); color: #9e2f29; }
.btn.danger:hover { background: #fbefed; }
.btn.ghost { background: transparent; }
.btn.chip, .btn.toggle { padding: 5px 11px 5px 9px; }
.btn.chip::before, .btn.toggle::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; border: 1.5px solid var(--c); vertical-align: 0; }
.btn.chip[aria-pressed=true]::before, .btn.toggle[aria-pressed=true]::before { background: var(--c); }
.btn.chip[aria-pressed=false], .btn.toggle[aria-pressed=false] { color: var(--ink3); }
.controls.chips { gap: 8px; }
.readout { font-family: var(--sans); font-size: 0.86rem; line-height: 1.5; color: var(--ink2); margin: 10px 4px 0; min-height: 1.5em; }
.readout b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* global play toggle */
#play-toggle { font-family: var(--sans); font-size: 0.76rem; background: transparent; border: 1px solid var(--grid2); border-radius: 99px; padding: 4px 11px; color: var(--ink2); cursor: pointer; white-space: nowrap; flex: none; }
#play-toggle:hover { color: var(--ink); border-color: var(--ink3); }

/* misc blocks */
.aside { font-family: var(--sans); font-size: 0.9rem; line-height: 1.55; color: var(--ink2); background: #efebe2; border-radius: 12px; padding: 14px 18px; margin: 1.6em auto; }
.aside b { color: var(--ink); }
.toc { font-family: var(--sans); font-size: 0.88rem; columns: 2; column-gap: 2rem; padding: 0; list-style: none; margin: 1.6rem auto 2.4rem; }
.toc li { margin: 0 0 0.35em; break-inside: avoid; }
.toc a { text-decoration: none; color: var(--ink2); }
.toc a:hover { color: var(--ink); }
.toc .n { color: var(--ink3); display: inline-block; width: 1.7em; font-variant-numeric: tabular-nums; }
ol.notes { font-family: var(--sans); font-size: 0.8rem; line-height: 1.5; color: var(--ink2); padding-left: 1.8em; }
ol.notes li { margin-bottom: 0.55em; word-break: break-word; }
ol.notes li:target { background: #fff3c9; border-radius: 4px; }
.truth { list-style: none; padding: 0; }
.truth li { position: relative; padding-left: 1.6em; margin-bottom: 0.7em; }
.truth li::before { content: '→'; position: absolute; left: 0; color: var(--ink3); font-family: var(--sans); }
hr.sep { border: 0; height: 1px; background: var(--grid2); margin: 3.5rem auto; }
footer { font-family: var(--sans); font-size: 0.8rem; color: var(--ink3); }
table.mini { font-family: var(--sans); font-size: 0.82rem; border-collapse: collapse; width: 100%; }
table.mini td, table.mini th { padding: 4px 6px; border-bottom: 1px solid var(--grid); text-align: right; }
table.mini th:first-child, table.mini td:first-child { text-align: left; }

@media (max-width: 640px) {
  body { font-size: 17px; line-height: 1.62; }
  main { padding: 0 16px 5rem; }
  figure.fig, figure.fig.showpiece, figure.fig.narrow { --figw: calc(var(--view-w) - 12px); padding: 8px 6px 10px; border-radius: 10px; }
  .controls { gap: 10px 18px; }
  .ctl.slider { max-width: none; flex-basis: 100%; }
  .toc { columns: 1; }
  h2 { margin-top: 2.6em; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* series navigation — left rail on wide screens, drawer on narrower ones */
nav.series { font-family: var(--sans); font-size: 0.8rem; background: rgba(251,250,246,0.94); z-index: 20; }
nav.series .series-toggle { display: none; align-items: center; gap: 8px; width: 100%; margin: 0; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--grid2); background: transparent; font: inherit; color: var(--ink2); cursor: pointer; text-align: left; }
nav.series .series-toggle:hover { color: var(--ink); }
nav.series .series-toggle:focus-visible { outline: 2px solid var(--ink2); outline-offset: -2px; }
nav.series .series-toggle-icon { font-size: 1.1em; line-height: 1; }
nav.series .series-toggle-label { font-weight: 700; color: var(--ink); }
nav.series .series-here { margin-left: auto; color: var(--ink3); font-weight: 500; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav.series .series-in { display: flex; flex-direction: column; gap: 10px; padding: 16px 12px 24px; }
nav.series .series-title { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.015em; line-height: 1.3; white-space: normal; padding: 2px 8px 8px; border-bottom: 1px solid var(--grid2); }
nav.series .series-title:hover { color: var(--ink2); }
nav.series ol { list-style: none; display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; }
nav.series li a { display: flex; align-items: baseline; gap: 7px; padding: 6px 8px; border-radius: 8px; color: var(--ink2); text-decoration: none; line-height: 1.35; }
nav.series li a:hover { background: #ece8de; color: var(--ink); }
nav.series li a .n { color: var(--ink3); font-variant-numeric: tabular-nums; font-size: 0.92em; flex: none; min-width: 1.4em; }
nav.series li a[aria-current=page] { background: var(--ink); color: #fff; }
nav.series li a[aria-current=page] .n { color: #cfcac0; }
nav.series li.deep-first { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--grid2); }
nav.series li.deep a { color: var(--ink3); }
nav.series li.deep a[aria-current=page] { color: #fff; }
.series-scrim { display: none; }
@media (min-width: 960px) {
  :root { --series-w: 13.5rem; --view-w: calc(100vw - var(--series-w)); }
  nav.series { position: fixed; left: 0; top: 0; bottom: 0; width: var(--series-w); border-right: 1px solid var(--grid2); overflow-y: auto; -webkit-overflow-scrolling: touch; background: rgba(251,250,246,0.98); }
  body { padding-left: var(--series-w); }
  header.top { padding-top: 2.2rem; }
  nav.series #play-toggle { margin: 0 20px 20px; }
}
@media (max-width: 959px) {
  nav.series { position: sticky; top: 0; width: 100%; border-bottom: 1px solid var(--grid2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
  nav.series { display: flex; align-items: center; }
  nav.series .series-toggle { display: inline-flex; flex: 1; min-width: 0; border-bottom: 0; }
  nav.series #play-toggle { margin-right: 12px; }
  nav.series .series-in { display: none; position: fixed; left: 0; top: 0; bottom: 0; width: min(18.5rem, 88vw); max-width: 100%; background: rgba(251,250,246,0.98); border-right: 1px solid var(--grid2); box-shadow: 8px 0 28px rgba(0,0,0,.14); overflow-y: auto; z-index: 22; padding-top: 12px; }
  nav.series.open { backdrop-filter: none; -webkit-backdrop-filter: none; } /* a filter would trap the fixed drawer inside the bar */
  nav.series.open .series-in { display: flex; }
  .series-scrim { position: fixed; inset: 0; z-index: 19; /* under nav.series (z 20), whose stacking context holds the drawer */ background: rgba(20,18,14,.35); border: 0; padding: 0; cursor: pointer; }
  body.series-open .series-scrim { display: block; }
  body.series-open { overflow: hidden; }
  header.top { padding-top: 1.6rem; }
}
@media print {
  nav.series { position: static; width: auto; border: 0; padding: 0; }
  body { padding-left: 0 !important; }
  nav.series .series-toggle, .series-scrim, #play-toggle { display: none !important; }
}
nav.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 3.5rem auto 1rem; font-family: var(--sans); }
nav.pager a { display: block; padding: 14px 16px; border: 1px solid var(--grid2); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.95rem; line-height: 1.35; background: var(--paper); }
nav.pager a:hover { border-color: var(--ink3); }
nav.pager a small { display: block; font-weight: 500; color: var(--ink3); font-size: 0.78rem; margin-bottom: 3px; }
nav.pager a.next { text-align: right; grid-column: 2; }
/* cross-references between pages */
a.xref { text-decoration-style: dotted; text-decoration-color: var(--ink3); }
a.xref::after { content: '↗'; font-family: var(--sans); font-size: 0.72em; color: var(--ink3); margin-left: 1px; vertical-align: 0.25em; }
.deepdive { font-family: var(--sans); font-size: 0.86rem; line-height: 1.5; color: var(--ink2); border-left: 3px solid var(--solar); padding: 4px 0 4px 14px; margin: 1.4em auto; }
.deepdive b { color: var(--ink); }
.deepdive.d-transmission { border-color: var(--network); } .deepdive.d-transformers { border-color: var(--phaseC); } .deepdive.d-fuels { border-color: var(--storage); } .deepdive.d-renewables { border-color: var(--wind); } .deepdive.d-main { border-color: var(--ink3); }
.plan h3 { font-weight: 550; color: var(--ink2); }
.plan h3 .num { color: var(--ink3); margin-right: 0.6em; font-variant-numeric: tabular-nums; }
.eq { font-family: var(--serif); font-style: italic; text-align: center; margin: 1em auto; }
@media (max-width: 640px) {
  nav.pager { grid-template-columns: 1fr; }
  nav.pager a.next { grid-column: 1; }
}

/* select control (solar yield map) */
.ctl.selectctl { display: flex; flex-direction: column; gap: 6px; }
.ctl.selectctl select { font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--grid2, #d8d3c8); border-radius: 8px; background: #fff; color: inherit; max-width: 100%; }
.kicker { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.02em; color: var(--ink3); margin: 0 0 0.4rem; }

/* Touch targets: at least 36px tall on coarse pointers / narrow screens */
@media (max-width: 600px), (pointer: coarse) {
  .seg-group button { min-height: 36px; min-width: 36px; padding: 8px 12px; }
  .btn { min-height: 36px; }
  input[type=range] { height: 36px; }
  input[type=range]::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -11px; }
}
.ctl.more { flex: 1 1 100%; }
.ctl.more > summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border: 1px solid var(--grid2, #d8d3c8); border-radius: 16px; color: var(--ink2); font-weight: 600; list-style: none; user-select: none; }
.ctl.more > summary::-webkit-details-marker { display: none; }
.ctl.more > summary::before { content: '+'; font-weight: 700; width: 0.8em; text-align: center; }
.ctl.more[open] > summary::before { content: '−'; }
.ctl.more > summary:hover { border-color: var(--ink3); color: var(--ink); }
.more-in { display: flex; flex-wrap: wrap; gap: 12px 26px; align-items: flex-end; margin-top: 12px; }
@media (max-width: 600px), (pointer: coarse) { .ctl.more > summary { min-height: 36px; } }

/* Phones: on tall figures whose controls sit below the canvas, the canvas stays pinned at the top of the
   screen while you scroll down to the sliders, so you can watch it while dragging (fix 9). */
@media (max-width: 600px) {
  .fig.sticky-canvas .canvas-wrap { position: sticky; top: 0; z-index: 3; background: var(--paper, #fbfaf6); box-shadow: 0 6px 8px -8px rgba(0,0,0,.25); }
}
.anchor { display: block; height: 0; }


/* methodology tucked into the caption */
figcaption details.method { display: inline; }
figcaption details.method summary { display: inline; cursor: pointer; color: var(--ink3); text-decoration: underline dotted; text-underline-offset: 3px; list-style: none; }
figcaption details.method summary::-webkit-details-marker { display: none; }
figcaption details.method[open] summary { display: block; margin: 4px 0 2px; }
figcaption details.method[open] { display: block; color: var(--ink3); }

/* the day model: power-flow strip beside the day chart on wide screens */
@media (min-width: 1220px) { .day-pair { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; } .day-pair > .canvas-wrap { min-width: 0; } }

/* landing page: the list of essays */
ol.essays { list-style: none; padding: 0; margin: 1.2rem auto 3rem; font-family: var(--sans); }
ol.essays li { border-top: 1px solid var(--grid2); }
ol.essays li:last-child { border-bottom: 1px solid var(--grid2); }
ol.essays a { display: grid; grid-template-columns: 2.2rem 1fr; gap: 2px 0; padding: 14px 4px; text-decoration: none; color: var(--ink); }
ol.essays a:hover { background: #efebe2; }
ol.essays .n { grid-row: span 2; font-size: 1.05rem; color: var(--ink3); font-variant-numeric: tabular-nums; padding-top: 1px; }
ol.essays .t { font-weight: 650; font-size: 1.02rem; line-height: 1.35; }
ol.essays .d { font-size: 0.88rem; line-height: 1.5; color: var(--ink2); }

/* "In brief" box at the top of each essay */
.brief { font-family: var(--sans); font-size: 0.95rem; line-height: 1.55; color: var(--ink2); border-left: 3px solid var(--ink3, #999); padding: 2px 0 2px 16px; margin: 1.4em auto 1.8em; }
.brief p { margin: 0.35em 0; }
.brief b { color: var(--ink); }
.byline time { white-space: nowrap; }

/* Coloured words in the text: darker than the figure colours they name, so they meet WCAG AA contrast (4.5:1). */
.c-solar { color: #89620a; }
.c-wind { color: #376f8e; }
.c-gas { color: #9f542d; }
.c-lignite { color: #816347; }
.c-nuclear { color: #7e57a1; }
.c-storage { color: #217562; }
.c-peaker { color: #b5413a; }
.c-procurement { color: #8e5f0c; }
.c-network { color: #586892; }
.c-taxes { color: #6d685d; }
.c-hot { color: #b83f25; }
.c-cold { color: #3268b8; }
.c-A { color: #b6404f; }
.c-B { color: #8d5e15; }
.c-C { color: #1a7381; }
.c-electron { color: #3268b8; }
.c-freq { color: #1a7381; }
.c-field { color: #b6404f; }

/* the market-designs table (text columns) */
table.mini.designs td, table.mini.designs th { text-align: left; vertical-align: top; }
table.mini caption { caption-side: top; text-align: left; font-size: 0.85rem; color: var(--ink2); margin-bottom: 6px; }

/* a static chart image that links to its live figure */
figure.fig.thumb a { display: block; }
figure.fig.thumb img { display: block; width: 100%; height: auto; border-radius: 9px; background: var(--paper); }

/* the step selector of a merged figure */
.controls.fig-steps { margin-bottom: 8px; }
/* keyboard pointer (src/lib/fig.js): shown only while a figure has keyboard focus */
.canvas-wrap canvas:focus-visible { outline: 2px solid var(--ink2); outline-offset: 2px; }
.kbd-ptr { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink, #1a1a1a); box-shadow: 0 0 0 2px rgba(255,255,255,.9); pointer-events: none; display: none; z-index: 2; }
.kbd-ptr::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: var(--ink, #1a1a1a); }
.kbd-ptr.grab { background: color-mix(in srgb, var(--ink, #1a1a1a) 25%, transparent); }
canvas:focus-visible + .kbd-ptr.on, canvas:focus-visible ~ .kbd-ptr.on { display: block; }

/* ── Dark mode (9 Nov 2026) ──────────────────────────────────────────────────────────────────────────────
   The page goes dark; each figure stays a light plate. Canvas figures draw with a fixed light palette
   (src/lib/colors.js and colours in the figure code), so a figure keeps the light tokens, and its legends,
   readouts and controls keep matching what the canvas draws. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #ece8df; --ink2: #c4bfb4; --ink3: #a39e93; --grid: #34312c; --grid2: #4a463f;
    --paper: #24221f; --bg: #1a1916;
  }
  figure.fig {
    color-scheme: light;
    --ink: #2f2d2a; --ink2: #5b5852; --ink3: #6b6861; --grid: #e7e3da; --grid2: #d8d3c8;
    --paper: #fbfaf6; --bg: #f4f2ec;
    color: var(--ink);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 8px 30px rgba(0,0,0,0.35);
  }
  figure.fig.thumb img { opacity: 0.94; }
  /* colour words in prose: lighter variants that read on the dark page (figures keep the darker ones) */
  .c-solar:not(figure.fig *) { color: #e6b44a; } .c-wind:not(figure.fig *) { color: #74b6de; }
  .c-gas:not(figure.fig *) { color: #ee9466; } .c-coal:not(figure.fig *) { color: #b0aba1; }
  .c-lignite:not(figure.fig *) { color: #c7a07d; } .c-nuclear:not(figure.fig *) { color: #bc98dc; }
  .c-hydro:not(figure.fig *) { color: #79abd6; } .c-storage:not(figure.fig *) { color: #52c4a6; }
  .c-price:not(figure.fig *) { color: #ec7fae; } .c-peaker:not(figure.fig *) { color: #ef8a82; }
  .c-procurement:not(figure.fig *) { color: #e9b55c; } .c-network:not(figure.fig *) { color: #9daede; }
  .c-taxes:not(figure.fig *) { color: #bdb6a9; } .c-hot:not(figure.fig *) { color: #f08a6e; }
  .c-cold:not(figure.fig *) { color: #82abf0; } .c-electron:not(figure.fig *) { color: #82abf0; }
  .c-A:not(figure.fig *) { color: #ef8b97; } .c-B:not(figure.fig *) { color: #e8b25e; }
  .c-C:not(figure.fig *) { color: #4fbfd0; } .c-freq:not(figure.fig *) { color: #4fbfd0; }
  .c-field:not(figure.fig *) { color: #ef8b97; }
  /* page elements that used fixed light colours */
  .aside { background: #26241f; }
  ol.notes li:target { background: #4a3f17; }
  nav.series { background: rgba(26,25,22,0.94); }
  @media (min-width: 960px) { nav.series { background: rgba(26,25,22,0.98); } }
  nav.series .series-in { background: rgba(26,25,22,0.98); }
  nav.series li a:hover, ol.essays a:hover { background: #2c2a26; }
  nav.series li a[aria-current=page], nav.series li.deep a[aria-current=page] { background: var(--ink); color: var(--bg); }
  nav.series li a[aria-current=page] .n { color: #5b5852; }
  .series-scrim { background: rgba(0,0,0,.55); }
  a { text-decoration-color: #6a655c; }
  a:hover { text-decoration-color: var(--ink2); }
}
