@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../vendor/fonts/inter-400-700-latin.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(../vendor/fonts/ibm-plex-mono-400-latin.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(../vendor/fonts/ibm-plex-mono-500-latin.woff2) format('woff2'); }

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --rail-w: 280px;
  --panel-w: 400px;
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f4f3ef;
  --seg-bg: #f1efea;
  --ink: #16191d;
  --ink-2: #2e343b;
  --ink-3: #5a616b;
  --ink-4: #3d444c;
  --rule: #e3e0d8;
  --rule-soft: #ece9e2;
  --rule-strong: #d9d5cc;
  --accent: #0e6b73;
  --accent-hover: #0a4f55;
  --accent-bg: #eef5f5;
  --accent-border: #a9d0d3;
  --ocean: #f4f3ef;
  --space: #d6d2c8;
  --land: #e4e1d9;
  --coast: #c9c4b8;
  --plate: #3b4350;
  --nodata: #b9b6ae;
  --hatch: #5b6470;
  --note-bg: #fff6e5;
  --note-fg: #5c4200;
  --note-border: #f0ddb5;
  --v-ok-fg: #0b5a3a; --v-ok-bg: #e3f2ea; --v-ok-bd: #b9dec9;
  --v-close-fg: #1f4e8c; --v-close-bg: #e8eff8; --v-close-bd: #c3d4ea;
  --v-bad-fg: #8a2b0e; --v-bad-bg: #fbe9e2; --v-bad-bd: #efc6b6;
  --v-na-fg: #5c4200; --v-na-bg: #fff6e5; --v-na-bd: #f0ddb5;
  --v-neutral-fg: #3d444c; --v-neutral-bg: #f1efea; --v-neutral-bd: #e3e0d8;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --band-op: 0.14;
  --grid: #ece9e2;
  --axis: #c9c4b8;
  --shadow: 0 1px 2px rgba(22, 25, 29, 0.05), 0 6px 20px rgba(22, 25, 29, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #111315; --surface: #1a1d21; --surface-2: #202429; --seg-bg: #262a30;
    --ink: #eceae4; --ink-2: #d3cfc6; --ink-3: #a3a9b1; --ink-4: #c2c7ce;
    --rule: #30353b; --rule-soft: #282c31; --rule-strong: #3e444c;
    --accent: #63bcc3; --accent-hover: #8ad0d5; --accent-bg: #17302f; --accent-border: #2d6268;
    --ocean: #14171a; --space: #050607; --land: #2a2e33; --coast: #4b5159; --plate: #b9c0c9; --nodata: #7a7f86; --hatch: #aab1bb;
    --note-bg: #2b2414; --note-fg: #f1d9a2; --note-border: #4a3c1d;
    --v-ok-fg: #86d7aa; --v-ok-bg: #12301f; --v-ok-bd: #24553a;
    --v-close-fg: #a4c2ec; --v-close-bg: #16243a; --v-close-bd: #2b4466;
    --v-bad-fg: #f3a88c; --v-bad-bg: #3a1b12; --v-bad-bd: #64301f;
    --v-na-fg: #f1d9a2; --v-na-bg: #2b2414; --v-na-bd: #4a3c1d;
    --v-neutral-fg: #d3cfc6; --v-neutral-bg: #262a30; --v-neutral-bd: #3e444c;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --band-op: 0.2;
    --grid: #282c31; --axis: #3e444c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #111315; --surface: #1a1d21; --surface-2: #202429; --seg-bg: #262a30;
  --ink: #eceae4; --ink-2: #d3cfc6; --ink-3: #a3a9b1; --ink-4: #c2c7ce;
  --rule: #30353b; --rule-soft: #282c31; --rule-strong: #3e444c;
  --accent: #63bcc3; --accent-hover: #8ad0d5; --accent-bg: #17302f; --accent-border: #2d6268;
  --ocean: #14171a; --space: #050607; --land: #2a2e33; --coast: #4b5159; --plate: #b9c0c9; --nodata: #7a7f86; --hatch: #aab1bb;
  --note-bg: #2b2414; --note-fg: #f1d9a2; --note-border: #4a3c1d;
  --v-ok-fg: #86d7aa; --v-ok-bg: #12301f; --v-ok-bd: #24553a;
  --v-close-fg: #a4c2ec; --v-close-bg: #16243a; --v-close-bd: #2b4466;
  --v-bad-fg: #f3a88c; --v-bad-bg: #3a1b12; --v-bad-bd: #64301f;
  --v-na-fg: #f1d9a2; --v-na-bg: #2b2414; --v-na-bd: #4a3c1d;
  --v-neutral-fg: #d3cfc6; --v-neutral-bg: #262a30; --v-neutral-bd: #3e444c;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --band-op: 0.2;
  --grid: #282c31; --axis: #3e444c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; overflow: hidden; display: flex; flex-direction: column; height: 100dvh;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--surface); padding: 8px 12px; z-index: 60; border-radius: 6px; }
.skip:focus { top: 8px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hint { font-size: 12.5px; color: var(--ink-3); margin: 4px 0 0; line-height: 1.5; }
.muted { color: var(--ink-3); }
.error { color: var(--v-bad-fg); font-size: 14px; }

/* ---------- header and disclaimer ---------- */
.top {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--rule); position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand:hover { color: var(--ink); }
.logo { width: 28px; height: 28px; flex: none; }
.logo polygon { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.logo polyline { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-tag { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 6px; color: var(--ink-2); font-size: 14px; text-decoration: none; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current='page'] { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 12px; }
.version { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.icon-btn {
  width: 40px; height: 40px; flex: none; border-radius: 8px; border: 1px solid var(--rule); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { border-color: var(--rule-strong); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

.disclaimer {
  flex: none; display: flex; align-items: center; gap: 10px; padding: 7px 24px; background: var(--note-bg);
  border-bottom: 1px solid var(--note-border); color: var(--note-fg); font-size: 13px; position: relative; z-index: 29;
}
.disclaimer svg { width: 16px; height: 16px; flex: none; }
.disclaimer a { color: var(--note-fg); font-weight: 500; }

main { flex: 1 1 auto; position: relative; min-height: 0; }
.view { position: absolute; inset: 0; }

/* ---------- map view layout ---------- */
#view-map { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); }
.chips { display: none; }
.rail {
  grid-column: 1; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--rule);
  padding: 20px; display: flex; flex-direction: column; gap: 22px;
}
.group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.group-title { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-3); margin: 0 0 4px; padding: 0; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--seg-bg); border-radius: 8px; }
.seg label {
  min-height: 40px; display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 6px;
  font-size: 13px; cursor: pointer; color: var(--ink-4); border: 1px solid transparent; padding: 0 6px; line-height: 1.25;
}
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label:has(input:checked) { background: var(--surface); border-color: var(--rule-strong); font-weight: 600; color: var(--ink); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg label:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.layer-list { display: flex; flex-direction: column; gap: 2px; }
.layer-list label {
  display: grid; grid-template-columns: 1fr; gap: 1px; min-height: 44px; padding: 7px 10px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer;
}
.layer-list label:hover { background: var(--surface-2); }
.layer-list input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.layer-list label:has(input:checked) { background: var(--accent-bg); border-color: var(--accent-border); }
.layer-list label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.ll-name { font-size: 14px; font-weight: 500; }
.ll-hint { font-size: 12px; color: var(--ink-3); }
.select { width: 100%; margin-top: 6px; min-height: 36px; padding: 4px 8px; border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--surface); font-size: 13.5px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; min-height: 30px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.check:has(input:disabled) { color: var(--ink-3); cursor: not-allowed; }
.events-opts { margin: 2px 0 0 28px; display: grid; gap: 6px; }
.range-row { display: grid; grid-template-columns: 42px 1fr 38px; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-4); }
.range-row input { width: 100%; accent-color: var(--accent); }
.stat-window { padding-top: 14px; border-top: 1px solid var(--rule-soft); gap: 4px; margin-top: auto; }
.stat-window .mono { font-size: 13px; }
.link-btn { background: none; border: 0; padding: 4px 0; margin-top: 6px; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; font-size: 13px; }

.map-area { grid-column: 2; position: relative; min-width: 0; overflow: hidden; background: var(--ocean); }
#map { position: absolute; inset: 0; }
.map-area.globe { background: radial-gradient(circle at 50% 50%, var(--space) 0, var(--space) 60%, color-mix(in srgb, var(--space) 80%, var(--ink)) 100%); }
.map-buttons { position: absolute; top: 16px; right: 16px; z-index: 4; display: flex; flex-direction: column; gap: 6px; }
.map-btn {
  width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--rule-strong); background: var(--surface); font-size: 20px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink); line-height: 1;
}
.map-btn:hover { background: var(--surface-2); }
.map-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.map-btn[aria-pressed='true'] { background: var(--accent-bg); border-color: var(--accent-border); color: var(--accent); }
.attrib { position: absolute; right: 12px; bottom: 8px; z-index: 3; font-size: 11px; color: var(--ink-4); background: color-mix(in srgb, var(--ocean) 90%, transparent); padding: 2px 6px; border-radius: 4px; }
.map-status {
  position: absolute; z-index: 6; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 12px 16px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow); max-width: 340px; text-align: center;
}

/* legend card */
.legend {
  position: absolute; left: 16px; bottom: 16px; z-index: 4; width: 300px; max-height: calc(100% - 32px); overflow-y: auto;
  padding: 14px 16px; background: color-mix(in srgb, var(--surface) 96%, transparent); border: 1px solid var(--rule); border-radius: 10px;
  display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--ink-4);
}
.lg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lg-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.lg-depth { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.lg-unit { margin: 0; color: var(--ink-3); line-height: 1.45; }
.lg-bar { display: grid; gap: 2px; }
.lg-bar div { height: 14px; }
.lg-bar div:first-child { border-radius: 3px 0 0 3px; }
.lg-bar div:last-child { border-radius: 0 3px 3px 0; }
.lg-ticks { display: grid; gap: 2px; font-family: var(--mono); font-size: 11px; color: var(--ink-4); text-align: center; }
.lg-rows { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lg-rows li { display: flex; align-items: center; gap: 8px; }
.lg-rows .cnt { margin-left: auto; font-family: var(--mono); color: var(--ink-3); font-size: 11px; }
.sw { width: 14px; height: 14px; flex: none; border-radius: 2px; }
.sw-hatch { background: repeating-linear-gradient(45deg, var(--hatch) 0 1.5px, var(--ocean) 1.5px 4px); }
.sw-wash { background: var(--nodata); opacity: 0.5; }
.sw-line { height: 0; border-top: 2px dashed var(--plate); border-radius: 0; }
.lg-count { color: var(--ink-3); }
.lg-sizes { display: flex; align-items: flex-end; gap: 12px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.lg-sizes span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lg-sizes i { display: block; border-radius: 50%; background: var(--ink); opacity: 0.6; }
.lg-extra { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--rule-soft); }

.tooltip {
  position: absolute; z-index: 20; pointer-events: none; max-width: 300px; padding: 8px 10px; font-size: 13px; line-height: 1.45;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 8px; box-shadow: var(--shadow);
}
.tt-main strong, .tt-sub strong { font-family: var(--mono); font-weight: 500; }
.tt-main { font-size: 13.5px; }
.tt-sub { color: var(--ink-2); }
.tt-foot { color: var(--ink-3); margin-top: 4px; font-size: 12px; }

.maplibregl-popup-content { background: var(--surface) !important; color: var(--ink); border-radius: 10px !important; box-shadow: var(--shadow) !important; padding: 12px 14px !important; font-family: var(--font); font-size: 13.5px; }
.maplibregl-popup-tip { border-top-color: var(--surface) !important; border-bottom-color: var(--surface) !important; }
.maplibregl-popup-close-button { font-size: 20px; width: 32px; height: 32px; color: var(--ink-3); }
.ev-pop h3 { margin: 0 0 4px; font-size: 15px; }
.ev-pop dl { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin: 6px 0; }
.ev-pop dt { color: var(--ink-3); }
.ev-pop dd { margin: 0; font-family: var(--mono); font-size: 12.5px; }

/* ---------- cell panel ---------- */
.panel {
  grid-column: 3; width: var(--panel-w); overflow: hidden; background: var(--surface); border-left: 1px solid var(--rule);
  display: flex; flex-direction: column; min-height: 0;
}
.panel-grip { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 12px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-3); }
.panel-head h2 { margin: 2px 0; font-size: 18px; font-weight: 600; font-family: var(--font); }
.panel-head .meta { margin: 0; font-size: 13px; color: var(--ink-3); }
.panel-body { overflow-y: auto; padding: 4px 22px 28px; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.panel-body > section { display: flex; flex-direction: column; gap: 10px; }
.panel-body > section + section { padding-top: 16px; border-top: 1px solid var(--rule-soft); }
.panel-body h3 { font-size: 14px; font-weight: 600; margin: 0; }
.bhead { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.bhead .lbl { font-size: 13px; color: var(--ink-3); display: block; }
.bbig { font-family: var(--mono); font-size: 40px; font-weight: 500; line-height: 1.05; }
.bside { display: flex; flex-direction: column; gap: 4px; padding-bottom: 4px; }
.bside .mono { font-size: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--v-neutral-bd); background: var(--v-neutral-bg); color: var(--v-neutral-fg); white-space: nowrap; width: fit-content;
}
.pill.ok { border-color: var(--v-ok-bd); background: var(--v-ok-bg); color: var(--v-ok-fg); }
.pill.close { border-color: var(--v-close-bd); background: var(--v-close-bg); color: var(--v-close-fg); }
.pill.bad { border-color: var(--v-bad-bd); background: var(--v-bad-bg); color: var(--v-bad-fg); }
.pill.na { border-color: var(--v-na-bd); background: var(--v-na-bg); color: var(--v-na-fg); }
.pill-line { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.scale { position: relative; height: 28px; }
.scale .track { position: absolute; left: 0; right: 0; top: 12px; height: 2px; background: var(--rule); }
.scale .ci { position: absolute; top: 8px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--s1) 40%, var(--surface)); }
.scale .est { position: absolute; top: 4px; width: 2px; height: 18px; margin-left: -1px; background: var(--ink); }
.scale .one { position: absolute; top: 0; width: 1px; height: 28px; background: var(--ink-3); }
.scale span { position: absolute; top: 17px; font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { padding: 10px 12px; border: 1px solid var(--rule-soft); border-radius: 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .k { font-size: 12px; color: var(--ink-3); }
.tile .v { font-family: var(--mono); font-size: 16px; }
.tile .v small { font-size: 12px; color: var(--ink-3); }
.withheld { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface-2); border-radius: 10px; }
.withheld strong { font-size: 15px; }
.withheld p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.agree-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.agree { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 13px; }
.agree dt { color: var(--ink-4); }
.agree dd { margin: 0; font-family: var(--mono); text-align: right; }
.agree dd.flagged { color: var(--v-bad-fg); font-weight: 500; }
.plain { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--rule); color: var(--ink-2); font-size: 14px; text-decoration: none; background: var(--surface); cursor: pointer;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn.primary { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.btn.solid { background: var(--accent); border-color: var(--accent); color: var(--surface); font-weight: 600; min-height: 48px; width: 100%; }
.full-only { display: contents; }
.peek-only { display: none; }
.loading { color: var(--ink-3); font-size: 14px; padding: 10px 0; display: flex; align-items: center; gap: 8px; }
.loading::before { content: ''; width: 14px; height: 14px; border: 2px solid var(--rule-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.small-btn { border: 1px solid var(--rule-strong); background: var(--surface); border-radius: 8px; padding: 5px 12px; font-size: 13.5px; cursor: pointer; min-height: 32px; }

/* ---------- charts ---------- */
.chart { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.chart figcaption { display: flex; flex-direction: column; gap: 1px; }
.chart-title { font-weight: 600; font-size: 14px; }
.chart-sub { font-size: 12px; color: var(--ink-3); }
.chart-wrap { position: relative; width: 100%; }
.chart-wrap:focus-visible { outline-offset: 4px; }
.chart-svg { display: block; overflow: visible; font-family: var(--font); }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; }
.chart-svg .axis { stroke: var(--axis); stroke-width: 1; }
.chart-svg .tick { fill: var(--ink-3); font-size: 10.5px; font-family: var(--mono); }
.chart-svg .axis-label { fill: var(--ink-3); font-size: 11.5px; }
.chart-svg .row-label { fill: var(--ink-2); font-size: 13px; }
.chart-svg .row-label.emph { fill: var(--ink); font-weight: 600; }
.chart-svg .row-value { fill: var(--ink); font-size: 12px; font-family: var(--mono); }
.chart-svg .line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .seg { stroke: var(--c); stroke-width: 2.5; stroke-linecap: round; }
.chart-svg .ci { stroke: var(--c); stroke-width: 2; stroke-linecap: round; }
.chart-svg .band { fill: var(--c); opacity: var(--band-op); }
.chart-svg .dot { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.chart-svg .dot.hollow { fill: var(--surface); stroke: var(--c); stroke-width: 2; }
.chart-svg .dot.focus { stroke-width: 2.5; }
.chart-svg .col { fill: var(--c); }
.chart-svg .colhover { fill: var(--ink); opacity: 0.08; }
.chart-svg .nodata { stroke: var(--rule-strong); stroke-width: 1; }
.chart-svg .span { fill: var(--ink); opacity: 0.06; }
.chart-svg .rule { stroke: var(--ink-3); stroke-width: 1; }
.chart-svg .rule.dashed { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart-svg .rule-label { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.chart-svg .crosshair { stroke: var(--ink-3); stroke-width: 1; }
.chart-svg .hit { fill: transparent; }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; font-size: 12px; color: var(--ink-2); }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.key { display: inline-block; flex: none; }
.key-line { width: 14px; height: 2.5px; border-radius: 2px; background: var(--c); }
.key-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.key-ring { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--c); }
.chart-tip {
  position: absolute; z-index: 3; pointer-events: none; background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 8px;
  box-shadow: var(--shadow); padding: 6px 9px; font-size: 12.5px; white-space: nowrap;
}
.tip-title { color: var(--ink-3); font-size: 12px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row strong { font-family: var(--mono); font-weight: 500; }
.tip-row span:last-child { color: var(--ink-2); }
.chart-note { font-size: 12px; color: var(--ink-3); margin: 0; line-height: 1.45; }
.chart-table summary { font-size: 12.5px; color: var(--accent); cursor: pointer; width: fit-content; }
.chart-table { max-height: 260px; overflow: auto; }
table.data { border-collapse: collapse; font-size: 12.5px; margin-top: 6px; width: 100%; }
table.data th, table.data td { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--rule-soft); }
table.data td { font-family: var(--mono); font-size: 12px; }
table.data th { color: var(--ink-3); font-weight: 600; }


/* ---------- language switcher ---------- */
.lang { position: relative; display: inline-flex; align-items: center; height: 40px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink); }
.lang:hover { border-color: var(--rule-strong); background: var(--surface-2); }
.lang:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang svg { position: absolute; left: 9px; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; pointer-events: none; }
.lang select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; height: 100%; padding: 0 10px 0 31px; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; cursor: pointer; border-radius: 8px; }
.lang select:focus-visible { outline: none; }

/* ---------- comparison ---------- */
.cmp-banner {
  position: absolute; z-index: 5; top: 16px; left: 50%; transform: translateX(-50%); max-width: min(560px, calc(100% - 140px));
  display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; font-size: 13px; color: var(--ink);
  background: var(--accent-bg); border: 1px solid var(--accent-border); border-radius: 10px; box-shadow: var(--shadow);
}
.cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cmp-card { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--rule-soft); border-radius: 10px; min-width: 0; }
.cmp-key { flex: none; width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; font-weight: 500; background: var(--ink); color: var(--surface); }
.cmp-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cmp-name { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.cmp-vals { display: flex; flex-direction: column; }
.cmp-b { font-size: 28px; font-weight: 500; line-height: 1.1; }
.cmp-ci { font-size: 12px; color: var(--ink-2); }
.cmp-verdict { padding: 14px 16px; border-radius: 10px; border: 1px solid var(--v-neutral-bd); background: var(--v-neutral-bg); gap: 6px !important; }
.panel-body > .cmp-verdict + * { border-top: 0; }
.cmp-verdict strong { font-size: 15px; color: var(--ink); }
.cmp-verdict p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.cmp-verdict.separate { border-color: var(--v-close-bd); background: var(--v-close-bg); }
.cmp-verdict.missing { border-color: var(--v-na-bd); background: var(--v-na-bg); }
.cmp-pinned { margin: 0; font-size: 13.5px; color: var(--ink-2); padding: 10px 12px; background: var(--accent-bg); border: 1px solid var(--accent-border); border-radius: 8px; }
.cmp-pinned .link-btn { margin: 0; }
.panel-actions button.btn { cursor: pointer; font: inherit; font-size: 14px; }

/* ---------- regional catalogues in the legend ---------- */
.lg-region { display: flex; flex-direction: column; gap: 3px; }
.lg-region strong { color: var(--ink); font-size: 12.5px; }

/* ---------- pages ---------- */
.page { overflow-y: auto; background: var(--bg); }
.page-inner { max-width: 1120px; margin: 0 auto; padding: 40px 24px 64px; display: flex; flex-direction: column; gap: 28px; }
.page section { display: flex; flex-direction: column; gap: 12px; }
.prose { max-width: 72ch; }
.page h1 { margin: 0; font-size: 34px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.page h2 { margin: 0; font-size: 20px; font-weight: 600; }
.page h3 { margin: 0; font-size: 16px; font-weight: 600; }
.page p, .page li, .page dd { color: var(--ink-2); line-height: 1.6; }
.page p { margin: 0; }
.lede { font-size: 16px; max-width: 760px; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.sec-head .sub { font-size: 13px; color: var(--ink-3); }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 20px 24px; }
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.summary-cards > div { padding: 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.summary-cards .pill { white-space: normal; max-width: 100%; }
.summary-cards .n { font-family: var(--mono); font-size: 30px; font-weight: 500; line-height: 1.1; }
.table-card { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; }
.vtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.vtable thead tr { background: var(--surface-2); text-align: left; }
.vtable th { padding: 12px 16px; font-weight: 600; text-align: left; }
.vtable td { padding: 12px 16px; border-top: 1px solid var(--rule-soft); vertical-align: top; line-height: 1.45; color: var(--ink-2); }
.vtable td:first-child { color: var(--ink); }
.vtable td.num { font-family: var(--mono); font-size: 13px; white-space: nowrap; color: var(--ink); }
.vtable .detail { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.toolbar .lbl { font-size: 13px; color: var(--ink-3); margin-right: 8px; }
.toolbar .seg { display: inline-flex; }
.toolbar .seg label { min-height: 36px; padding: 0 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.seq-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 16px; }
.seq { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.seq-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.seq h3 { font-size: 15.5px; }
.seq-mag { font-family: var(--mono); font-weight: 500; font-size: 18px; white-space: nowrap; }
.seq-meta { font-size: 12.5px; color: var(--ink-3); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.params { display: flex; flex-wrap: wrap; gap: 2px 16px; font-size: 13px; margin: 0; }
.params div { display: flex; gap: 6px; }
.params dt { color: var(--ink-3); }
.params dd { margin: 0; font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.mon-notice { font-size: 15px; line-height: 1.55; border-left-width: 4px; }
.mon-facts { font-size: 14px; }
.mon-list { align-items: start; }
.mon-seq { scroll-margin-top: 76px; }
.mon-seq.focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mon-seq h3 a { color: inherit; text-decoration: none; }
.mon-seq h3 a:hover, .mon-seq h3 a:focus-visible { text-decoration: underline; }
.mon-params { display: grid; gap: 3px; }
.mon-params div { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); column-gap: 10px; }
.mon-params dd { font-family: inherit; font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
.mon-notes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 2px; }
.mon-notes:empty { display: none; }
.mon-links { margin: 0; font-size: 13px; }
.notice { border: 1px solid var(--note-border); background: var(--note-bg); color: var(--note-fg); padding: 12px 16px; border-radius: 10px; }
.notice a { color: var(--note-fg); }
.page .notice p, .page .notice { color: var(--note-fg); }
details.method summary { cursor: pointer; color: var(--accent); font-size: 14px; }
details.method pre { white-space: pre-wrap; font-family: var(--mono); font-size: 12px; margin: 10px 0 0; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--ink); }
.src-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.src-list li { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 16px; min-width: 0; overflow-wrap: anywhere; }
.src-list strong { color: var(--ink); }
.cite { font-family: var(--mono); font-size: 13px; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 16px; color: var(--ink); max-width: 80ch; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; margin: 0; }
.steps div { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; }
.steps dt { font-weight: 600; margin-bottom: 4px; }
.steps dd { margin: 0; font-size: 14px; }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .brand-tag, .version { display: none; }
  :root { --panel-w: 360px; --rail-w: 250px; }
}
@media (max-width: 860px) {
  .nav a { padding: 8px 8px; }
}
@media (max-width: 720px) {
  .top { padding: 8px 12px; }
  .brand-long { display: none; }
  .brand-name { font-size: 16px; }
  .logo { width: 24px; height: 24px; }
  .menu-btn { display: inline-flex; width: 44px; height: 44px; }
  #theme-btn { width: 44px; height: 44px; }
  .top-right { gap: 8px; }
  .lang { height: 44px; }
  .lang select { padding: 0 8px 0 29px; }
  .cmp-banner { top: auto; bottom: 28px; max-width: calc(100% - 24px); width: max-content; }
  .cmp { grid-template-columns: minmax(0, 1fr); }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 12px 12px;
    background: var(--surface); border-bottom: 1px solid var(--rule); box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 10px; font-size: 16px; }
  .disclaimer { padding: 6px 14px; font-size: 12px; }
  .disclaimer .long, .disclaimer svg { display: none; }

  #view-map { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .chips { display: flex; grid-row: 1; gap: 8px; padding: 10px 14px; overflow-x: auto; background: var(--surface); border-bottom: 1px solid var(--rule); scrollbar-width: none; }
  .chip { flex: none; min-height: 44px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); font-size: 13px; cursor: pointer; }
  .chip[aria-pressed='true'] { border-color: var(--accent-border); background: var(--accent-bg); color: var(--accent-hover); font-weight: 600; }
  :root[data-theme='dark'] .chip[aria-pressed='true'] { color: var(--accent); }
  .chip-depth, #chip-more { background: var(--seg-bg); border-color: var(--rule-strong); }
  .map-area { grid-column: 1; grid-row: 2; }
  .rail {
    position: absolute; z-index: 25; left: 0; right: 0; bottom: 0; max-height: 78%; border: 0; border-top: 1px solid var(--rule);
    border-radius: 16px 16px 0 0; box-shadow: 0 -6px 20px rgba(22, 25, 29, 0.12); padding: 18px 18px 24px;
  }
  .rail:not(.open) { display: none; }
  .layer-list label, .check { min-height: 44px; }
  .map-buttons { top: 12px; right: 12px; }
  .map-btn { width: 44px; height: 44px; }
  .legend { top: 12px; bottom: auto; left: 12px; width: 168px; padding: 8px 10px; gap: 6px; max-height: calc(100% - 24px); }
  .legend .lg-unit, .legend.has-bar .lg-rows, .legend .lg-count, .legend .lg-extra, .legend .lg-depth, .legend .cnt { display: none; }
  .legend .lg-rows { gap: 3px; font-size: 11px; }
  .legend .lg-title { font-size: 12px; }
  .legend .lg-bar div { height: 10px; }
  .legend .lg-ticks { font-size: 10.5px; }
  .attrib { font-size: 10px; right: 6px; bottom: 4px; }
  .panel {
    position: absolute; z-index: 26; left: 0; right: 0; bottom: 0; width: auto; max-height: 64%; border: 0;
    border-radius: 16px 16px 0 0; box-shadow: 0 -6px 20px rgba(22, 25, 29, 0.12);
  }
  .panel.full { max-height: calc(100% - 8px); top: 8px; }
  .panel-grip { display: block; align-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--rule-strong); margin-top: 8px; flex: none; }
  .panel-head { padding: 8px 18px 6px; }
  .panel-head h2 { font-size: 16px; }
  .panel-head .icon-btn { width: 44px; height: 44px; }
  .eyebrow { display: none; }
  .panel-body { padding: 4px 18px 20px; gap: 14px; }
  .panel:not(.full) .full-only { display: none; }
  .panel:not(.full) .peek-only { display: flex; }
  .bbig { font-size: 36px; }
  .page-inner { padding: 24px 16px 48px; gap: 22px; }
  .page h1 { font-size: 26px; }
  .card { padding: 16px; }
  .vtable thead { display: none; }
  .vtable tr { display: block; border-top: 1px solid var(--rule-soft); padding: 10px 14px; }
  .vtable td { display: block; border: 0; padding: 2px 0; }
  .vtable td.num { white-space: normal; }
  .vtable td[data-h]::before { content: attr(data-h) ': '; color: var(--ink-3); font-family: var(--font); font-size: 12px; }
  .toolbar .seg label { padding: 0 9px; }
}
@media (max-width: 380px) {
  .toolbar .seg label { padding: 0 6px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .sw, .key, .lg-bar div { forced-color-adjust: none; } }
.vtable td.num.long { white-space: normal; min-width: 18ch; max-width: 36ch; overflow-wrap: anywhere; }
.vtable .detail, .vtable td { overflow-wrap: anywhere; }
.reg-dd { font-family: var(--font) !important; text-align: right; overflow-wrap: anywhere; }
