:root {
  color-scheme: light;
  --surface-0: #fdfdfb;
  --surface-1: #fdfdfb;
  --border: #d9d7d0;
  --rule: #1a1a1a;
  --text-primary: #111;
  --text-secondary: #444;
  --text-muted: #6f6e69;
  --accent: #1f5fa8;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --grid: #ebe9e4;
  --fuel-coal: #6250d6;
  --fuel-oil: #eb6834;
  --fuel-gas: #2a78d6;
  --fuel-peat: #eda100;
  --fuel-neutral: #008300;
  --line-use: #b2182b;
  --line-prod: #1a1a1a;
  --serif: "Source Serif 4", "Source Serif Pro", Charter, "Bitstream Charter", Cambria, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface-0: #161615; --surface-1: #161615; --border: #3a3936; --rule: #e8e7e3;
    --text-primary: #eceae5; --text-secondary: #c3c2b7; --text-muted: #8f8e86; --accent: #7fb0ea;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181;
    --grid: #2a2a28;
    --fuel-coal: #9085e9; --fuel-oil: #d95926; --fuel-gas: #3987e5; --fuel-peat: #c98500; --fuel-neutral: #0ca30c; --line-use: #e0525e; --line-prod: #eceae5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #161615; --surface-1: #161615; --border: #3a3936; --rule: #e8e7e3;
  --text-primary: #eceae5; --text-secondary: #c3c2b7; --text-muted: #8f8e86; --accent: #7fb0ea;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181;
  --grid: #2a2a28;
  --fuel-coal: #9085e9; --fuel-oil: #d95926; --fuel-gas: #3987e5; --fuel-peat: #c98500; --fuel-neutral: #0ca30c; --line-use: #e0525e; --line-prod: #eceae5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--surface-0); color: var(--text-primary); font: 17px/1.6 var(--serif); }
a { color: var(--accent); }
.wrap { max-width: 900px; margin: 0 auto; padding: 0 16px; }
header.site { border-bottom: 1px solid var(--border); }
header.site .wrap { display: flex; gap: 22px; align-items: baseline; flex-wrap: wrap; padding-top: 14px; padding-bottom: 12px; }
header.site .brand { font-weight: 600; color: var(--text-primary); text-decoration: none; }
header.site nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.95rem; }
header.site nav a { color: var(--text-secondary); text-decoration: none; }
header.site nav a:hover { text-decoration: underline; }
main { padding: 24px 0 48px; }
h1 { font-size: 1.6rem; font-weight: 600; line-height: 1.25; margin: 8px 0 12px; }
h2 { font-size: 1.2rem; font-weight: 600; margin: 36px 0 10px; }
h3 { font-size: 1.02rem; font-weight: 600; margin: 22px 0 6px; }
p { margin: 0 0 12px; }
.lede { color: var(--text-primary); margin: 0 0 16px; }
.muted { color: var(--text-muted); }
.small { font-size: 0.86rem; }
.note { font-size: 0.86rem; color: var(--text-secondary); }
.tablewrap { overflow-x: auto; margin: 8px 0 18px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; border-top: 1.5px solid var(--rule); border-bottom: 1.5px solid var(--rule); }
thead th { border-bottom: 0.75px solid var(--rule); }
th, td { text-align: left; padding: 6px 10px 6px 0; vertical-align: top; }
th { font-weight: 600; }
caption { caption-side: top; text-align: left; font-size: 0.9rem; padding: 0 0 6px; color: var(--text-primary); }
caption b, figcaption b { font-weight: 600; }
table.matrix { table-layout: fixed; min-width: 640px; }
table.matrix th:first-child { width: 22%; position: sticky; left: 0; background: var(--surface-0); }
td.ns, .ns { color: var(--text-muted); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.facts { border-top: 1.5px solid var(--rule); border-bottom: 1.5px solid var(--rule); }
.fact { display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 14px; padding: 10px 0; border-bottom: 0.5px solid var(--border); }
.fact:last-child { border-bottom: 0; }
.fact .k { color: var(--text-secondary); }
.tag { font-size: 0.82rem; color: var(--text-secondary); font-style: italic; margin-left: 4px; }
blockquote { margin: 4px 0 2px; padding: 0 0 0 12px; border-left: 2px solid var(--border); color: var(--text-secondary); font-size: 0.92rem; }
.cite { font-size: 0.82rem; color: var(--text-muted); }
.conv { font-size: 0.86rem; color: var(--text-secondary); margin-top: 3px; }
.doclist { padding-left: 20px; }
.doclist li { margin: 4px 0; }
a.src { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
a.src:hover { text-decoration-color: var(--accent); }
.anchor { scroll-margin-top: 120px; }
.anchor:target { background: rgba(31, 95, 168, 0.09); outline: 6px solid rgba(31, 95, 168, 0.09); }
.claims .claim { padding: 8px 0; border-bottom: 0.5px solid var(--border); }
.chart { margin: 14px 0 22px; max-width: 820px; }
.chart figcaption { font-size: 0.9rem; margin-bottom: 6px; }
.chart .plot { position: relative; }
.chart .plot.scroll { overflow-x: auto; }
.chart .plot.scroll .inner { min-width: 620px; }
.chart p.small { margin: 0 0 6px; }
.chart-svg { width: 100%; height: auto; display: block; font-family: var(--sans); }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; }
.chart-svg .lane { stroke: var(--border); stroke-width: 1; }
.chart-svg .tick { fill: var(--text-muted); font-size: 11px; }
.chart-svg .dlabel { fill: var(--text-secondary); font-size: 12px; }
.chart-svg .rowlabel { fill: var(--text-primary); font-size: 12.5px; }
.chart-svg .evlabel { fill: var(--text-primary); font-size: 11px; }
.chart-svg .xhair { stroke: var(--text-muted); stroke-width: 1; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0; margin: 0 0 6px; font-size: 0.82rem; color: var(--text-secondary); font-family: var(--sans); }
.legend .sw { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; background: var(--c); border: 2px solid var(--c); }
.legend .sw.hollow { background: transparent; }
.legend .sw.square { border-radius: 2px; }
.legend .sw.diamond { border-radius: 2px; transform: rotate(45deg) scale(0.8); }
.tip { position: absolute; z-index: 10; max-width: 320px; background: var(--surface-0); border: 1px solid var(--text-muted); padding: 8px 10px; font: 12.5px/1.45 var(--sans); color: var(--text-primary); box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.tip .t { font-weight: 600; margin-bottom: 3px; }
.tip .row { display: flex; gap: 6px; align-items: center; }
.tip .sw { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.tip .w { color: var(--text-secondary); margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.tip .l { display: inline-block; margin-top: 6px; color: var(--accent); }
.chart p.what { font-size: 0.86rem; color: var(--text-secondary); margin: 0 0 6px; }
.chart-svg .today { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg a.pt { cursor: pointer; }
.chart-svg a.pt:hover .evlabel, .chart-svg a.pt:focus .evlabel { fill: var(--accent); text-decoration: underline; }
.legend.iconkey { gap: 6px 18px; margin-bottom: 10px; }
.legend.iconkey li { display: inline-flex; align-items: center; gap: 4px; }
.legend .li { width: 15px; height: 15px; flex: none; }
.legend .barkey { display: inline-block; width: 26px; height: 7px; border-radius: 4px; }
.legend .barkey.fade { background: linear-gradient(90deg, rgba(110,110,105,0.5), rgba(110,110,105,0)); }
/* Figure 1: header band, one block per country, year axis */
.fig1 { max-width: none; }
.fig1-plot { position: relative; }
.fig1-inner > svg { display: block; width: 100%; height: auto; }
.fig1-head { position: sticky; top: 0; z-index: 2; background: var(--surface-0); }
.fig1-block[hidden] { display: none; }
.chart-svg .keylabel { fill: var(--text-primary); font-size: 12px; }
.fig1-key { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 6px 24px; margin-top: 10px; font: 12.5px/1.45 var(--sans); color: var(--text-secondary); }
.fig1-key b { color: var(--text-primary); font-weight: 600; }
.fig1-key ul { list-style: none; margin: 4px 0 0; padding: 0; }
.fig1-key li { display: flex; align-items: center; gap: 6px; margin: 0; padding: 2px 0; }
.fig1-key .li { width: 15px; height: 15px; flex: none; }
.barkey { display: inline-flex; flex-direction: column; gap: 2px; width: 26px; flex: none; }
.barkey i { display: block; height: 4px; border-radius: 2px; }
.barkey.light i { opacity: 0.4; }
.barkey.fade i { background: linear-gradient(90deg, var(--c), transparent); opacity: 0.6; }
.fig1-key .stopline { display: inline-block; width: 3px; height: 15px; border-radius: 2px; background: var(--line-use); margin: 0 6px; flex: none; }
.fig1-key .stopline.prod { background: var(--line-prod); margin-left: -2px; }
.fig1-key .stopline.grey { background: repeating-linear-gradient(180deg, var(--text-muted) 0 3px, transparent 3px 6px); }
.fig1-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 4px 0 10px; font: 13px/1.3 var(--sans); }
.fig1-filter .flab { color: var(--text-secondary); margin-right: 4px; }
.fig1-filter .chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 14px; padding: 3px 10px; cursor: pointer; user-select: none; }
.fig1-filter .chip:has(input:checked) { border-color: var(--text-secondary); background: var(--grid); }
.fig1-filter .chip input { margin: 0; accent-color: var(--text-primary); }
.fig1-filter .fall { font: inherit; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 3px 6px; }
@media (max-width: 760px) {
  .fig1-plot { overflow-x: auto; }
  .fig1-inner { min-width: 760px; }
  .fig1-head { position: static; }
  .fig1-key { grid-template-columns: 1fr; }
}
.chart-svg .databar.use { fill: #d7301f; opacity: 0.22; }
.chart-svg .databar.abs { fill: #d7301f; opacity: 0.22; }
.chart-svg .databar.prod { fill: #7f0000; opacity: 0.22; }
.chart-svg .num { fill: var(--text-primary); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.chart-svg .colhead { fill: var(--text-secondary); font-size: 11.5px; font-weight: 600; }
.chart-svg .missingcol { fill: var(--grid); opacity: 0.55; }
.legend .stopline.grey { background: repeating-linear-gradient(180deg, var(--text-muted) 0 3px, transparent 3px 6px); }
.legend .stopline { display: inline-block; width: 3px; height: 15px; border-radius: 2px; background: var(--text-primary); margin: 0 4px; }
.chart-svg a.pt:hover path, .chart-svg a.pt:hover rect:not([fill="transparent"]) { filter: brightness(1.12); }
.export { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.92rem; margin: 10px 0 0; }
.export img { display: block; width: 270px; max-width: 100%; border: 1px solid var(--border); margin: 6px 0; }
details.tableview { margin-top: 4px; font-size: 0.85rem; }
details.tableview summary { cursor: pointer; color: var(--text-secondary); }
details.tableview table { margin-top: 6px; }
footer.site { border-top: 1px solid var(--border); padding: 16px 0 28px; color: var(--text-muted); font-size: 0.85rem; }
@media (max-width: 600px) {
  body { font-size: 16px; }
  .fact { grid-template-columns: 1fr; gap: 2px; }
  h1 { font-size: 1.35rem; }
}
.fig1-key > div:nth-child(2) ul { columns: 2; column-gap: 24px; }
.fig1-key > div:nth-child(2) li { break-inside: avoid; }
@media (max-width: 760px) { .fig1-key > div:nth-child(2) ul { columns: 1; } }

/* Figure footer, About this data, Reuse, Citations */
.figfoot { font: 12.5px/1.5 var(--sans); color: var(--text-secondary); margin: 8px 0 4px; }
.figfoot p { margin: 0; }
.figfoot b { color: var(--text-primary); font-weight: 600; }
.about { border-top: 1px solid var(--border); margin-top: 22px; }
.about .arow { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.about h3 { margin: 0; font-size: 1.05rem; }
.about .kicker, .about .lab { font: 600 11.5px/1.4 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); margin: 12px 0 4px; }
.about .kicker { margin-top: 0; }
.about ul { margin: 4px 0 8px; padding-left: 18px; }
.about .srcs li { margin: 3px 0; }
.about .kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; margin-top: 10px; }
.about .kv span { display: block; font: 12px/1.4 var(--sans); color: var(--text-secondary); }
.citebox { position: relative; border: 1px solid var(--border); background: var(--surface-0); padding: 10px 70px 10px 12px; margin: 4px 0 12px; }
.citebox code { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; }
.citebox .copy { position: absolute; top: 8px; right: 8px; font: 12px var(--sans); border: 1px solid var(--border); background: var(--surface-0); padding: 3px 8px; cursor: pointer; }
@media (max-width: 600px) { .about .arow { grid-template-columns: 1fr; gap: 6px; } }

.fig1 > figcaption { white-space: nowrap; font-size: 0.86rem; }
@media (max-width: 900px) { .fig1 > figcaption { white-space: normal; } }

.figtabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; font: 13px var(--sans); }
.figtabs a, .figtabs button { font: inherit; border: 1px solid var(--border); background: var(--surface-0); color: var(--text-primary); padding: 5px 10px; text-decoration: none; cursor: pointer; }
.figtabs button[aria-expanded="true"] { border-color: var(--text-primary); }
.about[hidden] { display: none; }
