:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --border: #dedcd6;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #6f6e69;
  --grid: #e6e4df;
  --axis: #8a8984;
  --series-1: #2a78d6;
  --series-1-soft: #cde2fb;
  --series-2: #eb6834;
  --paid: #0b0b0b;
  --gap-hatch: #c9c7c0;
  --event-band: rgba(120, 110, 200, 0.13);
  --event-text: #5b52a8;
  --link: #1c5cab;
  --focus: #2a78d6;
  --chip-calc: #e3eefb;
  --chip-model: #fbeee3;
  --chip-proj: #fdf0e8;
  --chip-official: #e7f3ec;
  --chip-intl: #eeeaf8;
  --chip-none: #efeeea;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211;
    --surface: #1a1a19;
    --surface-2: #232321;
    --border: #3a3a37;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --text-3: #9d9c93;
    --grid: #2e2e2b;
    --axis: #7d7c75;
    --series-1: #3987e5;
    --series-1-soft: #184f95;
    --series-2: #d95926;
    --paid: #ffffff;
    --gap-hatch: #4a4a46;
  --event-band: rgba(160, 150, 240, 0.16);
  --event-text: #b3abf2;
    --event-band: rgba(160, 150, 240, 0.16);
    --event-text: #b3abf2;
    --link: #86b6ef;
    --focus: #86b6ef;
    --chip-calc: #1c3350;
    --chip-model: #3d2a1c;
    --chip-proj: #40261a;
    --chip-official: #1d3527;
    --chip-intl: #2b2745;
    --chip-none: #2b2b28;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211;
  --surface: #1a1a19;
  --surface-2: #232321;
  --border: #3a3a37;
  --text: #ffffff;
  --text-2: #c3c2b7;
  --text-3: #9d9c93;
  --grid: #2e2e2b;
  --axis: #7d7c75;
  --series-1: #3987e5;
  --series-1-soft: #184f95;
  --series-2: #d95926;
  --paid: #ffffff;
  --gap-hatch: #4a4a46;
  --link: #86b6ef;
  --focus: #86b6ef;
  --chip-calc: #1c3350;
  --chip-model: #3d2a1c;
  --chip-proj: #40261a;
  --chip-official: #1d3527;
  --chip-intl: #2b2745;
  --chip-none: #2b2b28;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.2rem; margin-top: .25rem; }
h3 { font-size: 1rem; }
p { margin: .25rem 0 .75rem; }
small, .muted { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand span { color: var(--text-2); font-weight: 400; }
nav.main { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .95rem; }
nav.main a { text-decoration: none; color: var(--text-2); padding: .25rem 0; border-bottom: 2px solid transparent; }
nav.main a[aria-current="page"] { color: var(--text); border-bottom-color: var(--series-1); }
.theme-toggle { margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text-2); border-radius: 6px; padding: .25rem .6rem; font: inherit; font-size: .85rem; cursor: pointer; }
.theme-toggle.lang-toggle { margin-left: .4rem; }

main { padding: 1rem 0 3rem; }
.controls { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin-bottom: 1rem; }
.controls label { display: flex; flex-direction: column; font-size: .8rem; color: var(--text-2); gap: .2rem; }
select { max-width: 100%; }
.controls label { max-width: 100%; }
select, .btn {
  font: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; padding: .4rem .6rem; min-height: 40px;
}
.btn { cursor: pointer; }
.btn[disabled] { opacity: .4; cursor: default; }
.year-step { display: flex; gap: .25rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }
.card > h2:first-child { margin-top: 0; }
.context { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem 1.25rem; font-size: .9rem; }
.context dt { color: var(--text-2); font-size: .8rem; }
.context dd { margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .85rem 1rem; display: flex; flex-direction: column; gap: .3rem; }
.tile .label { font-size: .85rem; color: var(--text-2); }
.tile .label b { color: var(--text); font-weight: 600; }
.tile .value { font-size: 1.55rem; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .sub { font-size: .85rem; color: var(--text-2); }
.tile .sub strong { color: var(--text); font-weight: 600; }
.tile .nodata { font-size: 1rem; color: var(--text-2); font-weight: 500; }

.tile .chip { align-self: flex-start; max-width: 100%; white-space: normal; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; line-height: 1.2; padding: .15rem .45rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text); white-space: nowrap; vertical-align: middle; }
.chip .ico { font-size: .8em; }
.chip.calc { background: var(--chip-calc); }
.chip.model { background: var(--chip-model); }
.chip.proj { background: var(--chip-proj); border-style: dashed; }
.chip.official { background: var(--chip-official); }
.chip.intl { background: var(--chip-intl); }
.chip.none { background: var(--chip-none); color: var(--text-2); }
.chip.mixed { background: var(--chip-calc); }
.chip.derived, .chip.derived_mixed { background: var(--chip-calc); border-style: dotted; }

.chart-card h2 { font-size: 1.15rem; }
.chart-sub { color: var(--text-2); font-size: .92rem; margin-bottom: .5rem; }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .85rem; color: var(--text-2); margin: .25rem 0 .5rem; }
.legend .key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: .35rem; }
.legend .key.line { height: 2px; border-radius: 1px; vertical-align: 3px; width: 14px; }
.legend .key.dot { width: 8px; height: 8px; border-radius: 50%; vertical-align: 1px; }
.legend .key.hatch { background-image: repeating-linear-gradient(135deg, var(--gap-hatch) 0 2px, transparent 2px 5px); border: 1px solid var(--gap-hatch); }
.legend .key.proj { background-image: repeating-linear-gradient(45deg, var(--series-2) 0 2px, transparent 2px 4px); border: 1px solid var(--series-2); }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--text-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .zero { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .bar-hover { outline: none; }
.chart .sel { stroke: var(--text); stroke-width: 1.5; fill: none; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 10; min-width: 160px; max-width: 280px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.15); padding: .5rem .65rem; font-size: .82rem; line-height: 1.35;
}
.tooltip .t-head { font-weight: 600; margin-bottom: .2rem; }
.tooltip .t-row { display: flex; align-items: baseline; gap: .4rem; }
.tooltip .t-row .k { display: inline-block; width: 12px; height: 2px; flex: none; transform: translateY(-3px); }
.tooltip .t-row strong { font-variant-numeric: tabular-nums; }
.tooltip .t-row span.lab { color: var(--text-2); }

details.table-view { margin-top: .5rem; }
details.table-view summary { cursor: pointer; color: var(--link); font-size: .9rem; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: .5rem; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--grid); vertical-align: top; }
th { color: var(--text-2); font-weight: 600; font-size: .78rem; position: sticky; top: 0; background: var(--surface); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.issue { cursor: pointer; }
tr.issue:hover td { background: var(--surface-2); }
tr.detail td { background: var(--surface-2); }
.flowlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .15rem 1rem; margin: .35rem 0; }

.note { border-left: 3px solid var(--border); padding: .25rem .75rem; color: var(--text-2); font-size: .9rem; margin: .5rem 0; }
.note strong { color: var(--text); }
.gaps li { margin-bottom: .35rem; }
.split-bar { display: flex; height: 14px; border-radius: 4px; overflow: hidden; margin: .35rem 0; gap: 2px; background: var(--surface); }
.split-bar span { display: block; height: 100%; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }

.doc { max-width: 820px; }
.doc h1 { font-size: 1.5rem; }
.doc h2 { margin-top: 1.75rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.doc h3 { margin-top: 1.25rem; }
.doc pre { background: var(--surface-2); padding: .75rem; border-radius: 6px; overflow-x: auto; font-size: .85rem; }
.doc code { font-size: .9em; background: var(--surface-2); padding: 0 .2rem; border-radius: 3px; }
.doc pre code { background: none; padding: 0; }
.doc table { margin: .5rem 0 1rem; }
.doc .table-scroll { margin: 0; }
.source-list > li { margin-bottom: 1rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .1rem .75rem; font-size: .85rem; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; word-break: break-all; }
.loading { color: var(--text-2); padding: 2rem 0; }
footer.site { border-top: 1px solid var(--border); color: var(--text-2); font-size: .85rem; padding: 1rem 0 2rem; }

@media (max-width: 560px) {
  .tile .value { font-size: 1.3rem; }
  h1 { font-size: 1.2rem; }
  .card { padding: .8rem; }
  .hide-sm { display: none; }
}
@media (forced-colors: active) {
  .chip { border: 1px solid CanvasText; }
}
.source-list, .doc p { overflow-wrap: anywhere; }
.coverage { font-size: .82rem; line-height: 1.35; color: var(--text); background: var(--surface-2); border-left: 3px solid var(--series-2); padding: .3rem .5rem; border-radius: 0 4px 4px 0; }
.coverage strong { font-weight: 650; }
.note.compare { border-left-color: var(--series-1); color: var(--text); margin: .25rem 0 .5rem; }
table.wrap-cells td.r, table.wrap-cells th.r { white-space: normal; }
.intro-link { flex-basis: 100%; font-size: .9rem; }
.lead { font-size: 1.1rem; }
.missing { background: #fbe3e3; color: #8a1c1c; padding: 0 .3rem; border-radius: 3px; font-weight: 600; }
.status-legend { list-style: none; padding-left: 0; }
.status-legend li { margin-bottom: .5rem; }
a.btn { display: inline-block; text-decoration: none; }
.doc .card > h2 { border-top: none; margin-top: 0; padding-top: 0; }
.note { overflow-wrap: anywhere; }
.pilot { background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--series-1); border-radius: 6px; padding: .6rem .85rem; margin: .25rem 0 1rem; font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere; }
.events { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .2rem .9rem; font-size: .85rem; color: var(--text-2); }
.events .num { display: inline-block; min-width: 1.3rem; height: 1.3rem; line-height: 1.3rem; text-align: center; border-radius: 50%; background: var(--event-band); color: var(--event-text); font-weight: 600; font-size: .75rem; margin-right: .35rem; }
.timeline h3 { margin: .75rem 0 .1rem; font-size: 1rem; }
.timeline .controls { margin-bottom: .25rem; }
