:root {
  --bg: #ffffff; --ink: #1f2933; --muted: #5f6b7a; --line: #e4e7eb; --panel: #f5f7fa;
  --accent: #1d5f9f; --warm: #b8322a; --cool: #2c6fbb; --ok: #2f7d4f; --warn: #a15c00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161c; --ink: #e6e9ed; --muted: #9aa5b1; --line: #2a323c; --panel: #19212a;
    --accent: #6ea8de; color-scheme: dark;
  }
  :root:not([data-theme="light"]) figure img { background: #fff; border-radius: 4px; }
}
:root[data-theme="dark"] {
  --bg: #11161c; --ink: #e6e9ed; --muted: #9aa5b1; --line: #2a323c; --panel: #19212a;
  --accent: #6ea8de; color-scheme: dark;
}
:root[data-theme="dark"] figure img { background: #fff; border-radius: 4px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.masthead { border-bottom: 1px solid var(--line); padding: 28px 0 18px; background: var(--panel); }
.eyebrow { margin: 0; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
h1 { margin: 4px 0 8px; font-size: 2rem; line-height: 1.2; }
.meta { margin: 0 0 6px; color: var(--muted); font-size: .9rem; }
.langs { font-size: .9rem; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; margin-right: 6px; }
.badge-final { background: #dcefe3; color: var(--ok); }
.badge-preliminary { background: #fbe9d0; color: var(--warn); }
.toc ol { columns: 2; padding-left: 20px; margin: 18px 0; font-size: .92rem; }
@media (max-width: 640px) { .toc ol { columns: 1; } h1 { font-size: 1.5rem; } }
.section { padding: 8px 0 24px; border-top: 1px solid var(--line); }
.section h2 { font-size: 1.35rem; margin: 18px 0 10px; }
.section h2 .num { color: var(--muted); font-weight: 400; margin-right: 6px; }
.section h3 { font-size: 1.02rem; margin: 18px 0 8px; }
.unavailable h2 { color: var(--muted); }
.note { background: var(--panel); border-left: 3px solid var(--line); padding: 8px 12px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.kpi-label { color: var(--muted); font-size: .85rem; }
.kpi-value { font-size: 1.7rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.kpi-value .unit { font-size: .95rem; font-weight: 400; color: var(--muted); margin-left: 4px; }
.kpi-detail, .kpi-rank { font-size: .85rem; color: var(--muted); }
.chip { display: inline-block; margin: 4px 0 2px; padding: 1px 8px; border-radius: 999px; font-size: .78rem; background: var(--line); }
.chip[class*="above"], .chip.cat-extremely_above { background: #f6d5d1; color: var(--warm); }
.chip[class*="below"] { background: #d6e4f3; color: var(--cool); }
.chip.cat-much_below, .chip.cat-below { background: #f3e2c7; color: #7a4b00; }
.chip.cat-above, .chip.cat-much_above { background: #d4ecdd; color: var(--ok); }
.messages li { margin-bottom: 6px; }
figure { margin: 8px 0 4px; }
figure img { max-width: 100%; height: auto; display: block; }
figcaption, .caption, .source { color: var(--muted); font-size: .82rem; margin: 4px 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; }
td.num, th.num { white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.unit { color: var(--muted); font-weight: 400; }
.footer { color: var(--muted); font-size: .8rem; padding: 24px 16px 40px; border-top: 1px solid var(--line); }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { font-size: 10.5pt; }
  .langs, .toc { display: none; }
  table { font-size: 7.5pt; }
  th, td { padding: 2px 4px; }
  .table-wrap { overflow: visible; }
  .masthead { background: none; padding-top: 0; }
  .section { break-before: auto; }
  figure, .kpi, tr { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  .block-kpi, .block-map, .block-chart { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* Interactive state maps */
figure.choropleth { position: relative; }
figure.choropleth.is-interactive > img { display: none; }
.map-interactive { position: relative; }
.map-interactive svg { width: 100%; height: auto; display: block; }
.map-interactive path { stroke: var(--bg); stroke-width: 0.8; cursor: default; }
.map-interactive path:hover, .map-interactive path:focus { stroke: var(--ink); stroke-width: 1.6; outline: none; }
.map-tip { position: absolute; transform: translate(-50%, -100%); background: var(--ink); color: var(--bg);
  font-size: .82rem; padding: 4px 8px; border-radius: 4px; pointer-events: none; white-space: nowrap; }
.map-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 6px 0; font-size: .82rem; color: var(--muted); }
.map-legend li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
@media print {
  figure.choropleth.is-interactive > img { display: block; }
  .map-interactive, .map-legend { display: none; }
}
