/* «Научный атлас»: белая бумага, чёрный гротеск, моноширинные метки, волосяные линии.
   Шрифты: Golos Text и JetBrains Mono (SIL OFL 1.1), локально в vendor/fonts. */
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(vendor/fonts/GolosText-400-700-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(vendor/fonts/GolosText-400-700-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(vendor/fonts/JetBrainsMono-400-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(vendor/fonts/JetBrainsMono-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --mast-h: 56px;
}
.viz-root {
  color-scheme: light;
  --page: #ffffff;
  --surface-1: #ffffff;
  --surface-2: #f4f4f1;
  --surface-3: #ebebe6;
  --text-primary: #111110;
  --text-secondary: #42413d;
  --text-muted: #63625c;
  --grid: #e6e5df;
  --axis: #c9c8c0;
  --border: #e3e2dc;
  --rule: #111110;
  --nodata: #e6e5df;
  --absent: #f2f1ed;
  --accent: #1c5cab;
  --accent-ink: #1c5cab;
  --accent-soft: #eef3fb;
  --night: #0d1014;
  --radius: 4px;
  --gap: 20px;
  --sans: "Golos Text", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-family: var(--sans);
  color: var(--text-primary);
  background: var(--page);
  line-height: 1.5;
  font-feature-settings: "tnum" 0, "ss01" 1;
}
* { box-sizing: border-box; }
html { overflow-x: clip; scroll-padding-top: calc(var(--mast-h) + 8px); scrollbar-color: #c9c8c0 transparent; }
body { margin: 0; overflow-x: clip; background: #ffffff; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: #111110; color: #fff; }
.viz-root { max-width: 1320px; margin: 0 auto; padding: 0 32px 64px; }
a { color: var(--text-primary); text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--axis); }
a:hover { text-decoration-color: var(--text-primary); }

h1 { font-size: clamp(40px, 4.1vw, 60px); line-height: 1; margin: 0 0 22px; font-weight: 650; letter-spacing: -0.035em; text-wrap: balance; }
h2 { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.08; margin: 0 0 12px; font-weight: 620; letter-spacing: -0.02em; text-wrap: balance; }
h3 { font-size: 16px; line-height: 1.3; margin: 0 0 6px; font-weight: 620; letter-spacing: -0.005em; }
.sub, .note, .muted { color: var(--text-secondary); font-size: 14.5px; margin: 0 0 12px; }
.muted { color: var(--text-muted); }
span.muted { margin: 0; }
.sub { max-width: 88ch; }
.mono, .kicker, .eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); font-weight: 400; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- мачта ---------- */
.mast { position: sticky; top: 0; z-index: 30; height: var(--mast-h); display: flex; align-items: center; gap: 28px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
  margin: 0 calc((100% - 100vw) / 2); padding: 0 calc((100vw - 100%) / 2); transition: background-color .9s ease, border-color .9s ease; }
body.is-night .mast { background: rgba(13, 16, 20, 0.92); border-bottom-color: #232833; }
body.is-night .mast .brand, body.is-night .toc a.on, body.is-night .toc a:hover { color: #f3f4f6; border-bottom-color: #f3f4f6; }
body.is-night .toc a { color: #7d8594; }
body.is-night .links a { background: transparent; color: #f3f4f6; border-color: #3a4150; }
.mast .brand { display: flex; align-items: center; gap: 10px; font-weight: 620; font-size: 14px; letter-spacing: -0.01em; white-space: nowrap; color: var(--text-primary); text-decoration: none; }
.mast .brand i { display: grid; grid-template-columns: repeat(3, 5px); gap: 2px; }
.mast .brand i b { width: 5px; height: 5px; border-radius: 50%; display: block; }
.mast .brand span { font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--text-muted); letter-spacing: 0.06em; }
.toc { display: flex; gap: 20px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; overflow-x: auto; white-space: nowrap; scrollbar-width: none; flex: 1; }
.toc::-webkit-scrollbar { display: none; }
.toc a { color: var(--text-muted); text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.toc a:hover, .toc a.on { color: var(--text-primary); border-bottom-color: var(--text-primary); }
.links { display: flex; flex-wrap: nowrap; gap: 6px; margin: 0; font-size: 13px; }
.links a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--axis); border-radius: 999px;
  background: #fff; color: var(--text-primary); text-decoration: none; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.links a:hover { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }

/* ---------- история со сценой ---------- */
.story { position: relative; display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 0 48px; margin: 0 calc((100% - 100vw) / 2); padding: 0 0 0 calc((100vw - 100%) / 2); }
.story-steps { position: relative; z-index: 2; padding-bottom: 0; }
.step:last-child { min-height: calc(100vh - var(--mast-h)); }
.step { min-height: 88vh; display: flex; flex-direction: column; justify-content: center; padding: 48px 0; opacity: .28; transition: opacity .5s ease; }
.step.on { opacity: 1; }
.step.hero { min-height: calc(100vh - var(--mast-h)); justify-content: flex-end; padding: 40px 0 9vh; opacity: 1; }
.step p.eyebrow { margin: 0 0 14px; display: flex; gap: 10px; align-items: center; font-size: 12px; line-height: 1.4; color: var(--text-muted); max-width: none; }
.step .eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--text-primary); display: inline-block; }
.step h2 { font-size: clamp(26px, 2.3vw, 34px); margin-bottom: 14px; }
.step p { font-size: 16.5px; line-height: 1.6; color: var(--text-secondary); margin: 0 0 12px; max-width: 46ch; }
.step p b { color: var(--text-primary); font-weight: 620; }
.step .lede { font-size: 17.5px; line-height: 1.55; color: var(--text-secondary); max-width: 40ch; }
.step .byline { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--text-muted); margin: 18px 0 0; line-height: 1.6; text-transform: uppercase; }
.step .fig { font-family: var(--mono); font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 8px; max-width: 46ch; }
.step .btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.findings { list-style: none; counter-reset: f; padding: 0; margin: 4px 0 18px; display: grid; gap: 12px; max-width: 48ch; }
.findings li { counter-increment: f; position: relative; padding: 10px 0 0 34px; border-top: 1px solid var(--border); font-size: 15px; line-height: 1.55; color: var(--text-secondary); }
.findings li::before { content: counter(f, decimal-leading-zero); position: absolute; left: 0; top: 12px; font-family: var(--mono); font-size: 12px; color: var(--text-muted); }
.findings li b { color: var(--text-primary); font-weight: 620; }
.cta { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--text-primary); color: #fff; border-radius: 999px; text-decoration: none; font-size: 14px; border: 1px solid var(--text-primary); }
.cta:hover { background: #fff; color: var(--text-primary); }
.cta.ghost { background: #fff; color: var(--text-primary); border-color: var(--axis); }
.cta.ghost:hover { border-color: var(--text-primary); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 26px 0 0; border-top: 1px solid var(--rule); }
.tile { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--border); }
.tile:nth-child(odd) { border-right: 1px solid var(--border); }
.tile:nth-child(even) { padding-left: 16px; }
.tile .v { font-size: 30px; line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.tile .l { font-size: 12.5px; line-height: 1.45; color: var(--text-secondary); }

.story-stage { position: sticky; top: var(--mast-h); height: calc(100vh - var(--mast-h)); z-index: 1; overflow: hidden; background: #fff; transition: background-color .9s ease; }
.story-stage.night { background: var(--night); }
.story { transition: background-color .9s ease; }
.story.night { background: var(--night); }
.story .step h2, .story .step p, .story .step p b { transition: color .9s ease; }
.story.night .step h2 { color: #f3f4f6; }
.story.night .step p { color: #a9b0bc; }
.story.night .step p b { color: #ffffff; }
.story.night .step p.eyebrow { color: #7d8594; }
.story.night .step .eyebrow::before { background: #f3f4f6; }
.story-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 50%; pointer-events: none; transition: opacity .8s ease; }
.stage-poster.gone { opacity: 0; }
.story-stage .hud { position: absolute; left: 24px; right: 24px; top: 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; pointer-events: none; }
.story-stage .hud .state { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); transition: color .6s; }
.story-stage .hud .state b { color: var(--text-primary); font-weight: 500; transition: color .6s; }
.story-stage.night .hud .state { color: #8b93a1; }
.story-stage.night .hud .state b { color: #f3f4f6; }
.story-stage .hud .count { font-family: var(--mono); font-size: 12px; color: var(--text-muted); text-align: right; letter-spacing: .04em; }
.story-stage.night .hud .count { color: #8b93a1; }
.stage-legend { position: absolute; left: 24px; bottom: 20px; right: 24px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-secondary); pointer-events: none; opacity: 0; transition: opacity .6s; }
.stage-legend.show { opacity: 1; }
.stage-legend span { display: inline-flex; align-items: center; gap: 6px; }
.stage-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.story-stage.night .stage-legend { color: #c6cbd3; }
.stage-time { position: absolute; left: 24px; right: 24px; bottom: 54px; display: flex; align-items: center; gap: 14px; opacity: 0; pointer-events: none; transition: opacity .5s; }
.stage-time.show { opacity: 1; pointer-events: auto; }
.stage-time button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--text-primary); background: #fff; cursor: pointer; display: grid; place-items: center; flex: none; }
.stage-time button:hover { background: var(--text-primary); color: #fff; }
.stage-time input[type=range] { flex: 1; height: 24px; padding: 0; border: 0; background: transparent; accent-color: var(--text-primary); }
.stage-time .t { font-family: var(--mono); font-size: 12px; min-width: 190px; text-align: right; color: var(--text-primary); }
.stage-nav { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px; z-index: 3; }
.stage-nav button { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: var(--text-muted); background: none; border: 0; padding: 3px 0 3px 14px; cursor: pointer; position: relative; text-align: right; }
.stage-nav button::before { content: ""; position: absolute; left: 0; top: 50%; width: 8px; height: 1px; background: currentColor; transition: width .3s; }
.stage-nav button.on { color: var(--text-primary); }
.stage-nav button.on::before { width: 12px; left: -4px; }
.story-stage.night .stage-nav button { color: #6f7785; }
.story-stage.night .stage-nav button.on { color: #f3f4f6; }
@media (max-width: 820px) { .stage-nav { display: none; } }
.stage-tip { position: absolute; pointer-events: none; z-index: 5; background: #111110; color: #fff; font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 4px; max-width: 280px; box-shadow: 0 8px 24px -10px rgba(0,0,0,.45); }
.stage-tip b { font-size: 13px; font-weight: 600; }
.stage-tip .m { font-family: var(--mono); font-size: 11px; color: #a8a8a2; letter-spacing: .04em; text-transform: uppercase; }
.story-stage.night .stage-tip { background: #f3f4f6; color: #111; }
.story-stage.night .stage-tip .m { color: #6b6b66; }
.stage-labels { position: absolute; inset: 0; pointer-events: none; }
.stage-labels .il { position: absolute; transform: translate(-50%, 0); text-align: center; font-size: 12px; line-height: 1.3; color: var(--text-primary); opacity: 0; transition: opacity .6s; width: 170px; }
.stage-labels .il b { display: block; font-weight: 620; font-size: 12.5px; }
.stage-labels .il span { font-family: var(--mono); font-size: 11.5px; color: var(--text-muted); letter-spacing: .03em; }
.stage-labels.show .il { opacity: 1; }
.stage-labels .gl { position: absolute; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); opacity: 0; transition: opacity .6s; transform: translate(-50%, -50%); white-space: nowrap; }
.stage-labels.geo .gl { opacity: 1; }
.stage-labels .ml { position: absolute; transform: translate(-50%, -100%); font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); opacity: 0; transition: opacity .6s; white-space: nowrap; border-bottom: 1px solid var(--axis); padding-bottom: 3px; }
.stage-labels.show .ml { opacity: 1; }
.stage-labels .city { position: absolute; transform: translate(6px, -50%); font-size: 11.5px; font-weight: 600; color: var(--text-primary); opacity: 0; transition: opacity .6s; white-space: nowrap; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
.stage-labels .city::before { content: ""; position: absolute; left: -6px; top: 50%; width: 3px; height: 3px; margin-top: -1.5px; border-radius: 50%; background: var(--text-primary); }
.stage-labels.cities .city { opacity: 1; }
.hint-touch { display: none; }
@media (pointer: coarse) { .hint-fine { display: none; } .hint-touch { display: inline; } }

/* ---------- обозреватель: разделы ---------- */
.explorer-head { margin: 32px 0 0; padding-top: 28px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end; }
.explorer-head h2 { margin: 6px 0 0; }
.section { padding-top: 64px; }
.section > .kicker { display: block; margin-bottom: 10px; }
.section > h2 { padding-top: 14px; border-top: 1px solid var(--rule); max-width: 32ch; }
.section > .kicker + h2 { border-top: 0; padding-top: 0; }
.section > h2 + .sub { margin-bottom: 22px; font-size: 15px; }
.card { background: transparent; border: 0; border-top: 1px solid var(--rule); border-radius: 0; padding: 16px 0 6px; margin-bottom: 28px; }
.card > h3 { font-size: 15px; }
.card > h3 + .sub { margin-bottom: 14px; }

/* ---------- фильтры ---------- */
.filters { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.35fr) minmax(0, 1.35fr) minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, 1.3fr); gap: 12px; align-items: end; margin: 22px 0 16px; }
.f { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); min-width: 0; }
.f.period-f .row { display: flex; gap: 6px; }
select, input { font: inherit; font-family: var(--sans); text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text-primary); background: #fff; width: 100%; min-width: 0; height: 38px;
  border: 1px solid var(--axis); border-radius: var(--radius); padding: 0 10px; accent-color: var(--text-primary); }
select:hover, input:hover { border-color: var(--text-primary); }
select:disabled { color: var(--text-muted); background: var(--surface-2); }
input::placeholder { color: var(--text-muted); }
select:focus-visible, input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, .tcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { font: inherit; font-size: 13px; border: 1px solid var(--axis); background: #fff; border-radius: var(--radius); padding: 6px 12px; cursor: pointer; color: var(--text-primary); white-space: nowrap; }
.btn:hover { border-color: var(--text-primary); }
.btn.play { width: 38px; height: 38px; padding: 0; flex: none; display: grid; place-items: center; font-size: 12px; }
.btn.play[aria-pressed="true"] { background: var(--text-primary); color: #fff; border-color: var(--text-primary); }
.seg { display: inline-flex; border: 1px solid var(--axis); border-radius: var(--radius); overflow: hidden; }
.seg button { font: inherit; font-size: 12.5px; border: 0; background: #fff; padding: 6px 12px; cursor: pointer; color: var(--text-secondary); white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--axis); }
.seg button:hover { color: var(--text-primary); }
.seg button[aria-pressed="true"] { background: var(--text-primary); color: #fff; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- карта и карточка МО ---------- */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: var(--gap); align-items: stretch; }
.map-card { margin-bottom: 0; display: flex; flex-direction: column; }
.map-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 4px; }
.map-head h2 { font-size: 20px; margin: 0 0 2px; letter-spacing: -0.01em; }
.map-head .sub { margin: 0; }
.map-wrap { position: relative; width: 100%; aspect-ratio: 1.85; margin-top: 6px; }
#map-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#map-svg:active { cursor: grabbing; }
.mo { stroke: #fff; stroke-width: 0.25; vector-effect: non-scaling-stroke; }
.mo.extra { stroke: #d9d8d0; stroke-width: 0.6; }
.mo.sel { stroke: var(--text-primary); stroke-width: 2; }
.mo.dim { fill-opacity: 0.14; }
.mo.dot { stroke: #fff; stroke-width: 0.6; }
.mo.dot.sel { stroke: var(--text-primary); stroke-width: 2; }
.map-card .note { margin: 6px 0 0; font-size: 13px; }
.panel { margin-bottom: 0; overflow: auto; overscroll-behavior: contain; }
.map-layout > .panel { contain: size; border-left: 1px solid var(--border); padding-left: 22px; }
.panel h3 { font-size: 22px; line-height: 1.15; margin-bottom: 4px; letter-spacing: -0.015em; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: #fff; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 14px; margin: 12px 0; align-items: center; }
.kv .k { color: var(--text-secondary); }
.levels { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; align-items: center; margin: 12px 0 10px; font-size: 14px; }
.levels .k { color: var(--text-secondary); white-space: nowrap; }
.levels .chip { max-width: 100%; border-radius: 6px; justify-self: start; line-height: 1.35; }
.btn.back { margin: 0 0 12px; padding: 5px 10px; font-size: 12px; color: var(--text-secondary); }
.btn.back:hover { color: var(--text-primary); }
.kv .v { font-variant-numeric: tabular-nums; text-align: right; }
.strip { display: flex; gap: 2px; margin: 6px 0 3px; }
.strip span { flex: 1; height: 16px; border-radius: 2px; }
.strip-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11.5px; color: var(--text-muted); }
.examples { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 2px; }
.examples li { display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 8px 10px; border-radius: var(--radius); cursor: pointer; }
.examples li:hover { background: var(--surface-2); }
.examples li .sw { margin-top: 4px; }
.examples li b { display: block; font-weight: 600; font-size: 14px; }
.examples li span.t { display: block; font-size: 12px; color: var(--text-muted); }
.panel table td, .panel table th { padding: 5px 6px; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 12px; font-size: 13px; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; text-align: left; cursor: pointer; padding: 3px 8px; border-radius: var(--radius); border: 1px solid transparent; color: var(--text-primary); background: none; font: inherit; font-size: 13px; }
.legend .item:hover { background: var(--surface-2); }
.legend .item.off { opacity: 0.35; }
.legend .item.on { border-color: var(--axis); background: #fff; }
.legend span.item { cursor: default; }
.legend span.item:hover { background: none; }
.sw { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; vertical-align: -1px; }
.ramp { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); padding: 3px 8px; }
.ramp .bar { display: flex; height: 10px; width: 240px; border-radius: 2px; overflow: hidden; }
.ramp .bar span { flex: 1; }
.vsup { display: grid; grid-template-columns: auto repeat(4, 22px); gap: 2px 3px; align-items: center; font-size: 12px; color: var(--text-muted); padding: 3px 8px; }
.vsup i { width: 22px; height: 12px; display: block; border-radius: 2px; }

/* ---------- типы ---------- */
.macro-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 4px 0 var(--gap); border-top: 1px solid var(--rule); }
.macro { padding: 16px 18px 18px 0; display: flex; flex-direction: column; gap: 8px; border-right: 1px solid var(--border); }
.macro + .macro { padding-left: 18px; }
.macro:last-child { border-right: 0; }
.macro .mbar { display: flex; height: 6px; overflow: hidden; gap: 2px; }
.macro .mbar span { min-width: 2px; }
.macro h3 { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 17px; }
.macro .mnum { font-family: var(--mono); font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.macro p { font-size: 13px; color: var(--text-secondary); margin: 0; }
.macro .mtypes { font-size: 12px; color: var(--text-muted); margin-top: auto; }
.types-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 40px; }
.tcard { background: transparent; border: 0; border-top: 3px solid var(--text-primary); border-radius: 0; padding: 14px 0 6px; cursor: pointer; display: flex; flex-direction: column; transition: background-color .15s ease-out; }
.tcard:hover { background: linear-gradient(var(--surface-2), transparent 90px); }
.tcard .tmacro { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 6px; }
.tcard h3 { display: flex; gap: 8px; align-items: center; font-size: 17px; margin: 0; min-height: 2.6em; }
.tcard canvas { width: 100%; height: auto; display: block; margin: 8px 0 6px; }
.tcard p { font-size: 13px; line-height: 1.5; color: var(--text-secondary); margin: 0 0 10px; }
.tcard .transit { background: var(--surface-2); border-radius: var(--radius); padding: 8px 10px; }
.tcard .rule { font-family: var(--sans); font-size: 13.5px; line-height: 1.5; color: var(--text-primary); background: var(--surface-2); border-left: 2px solid var(--text-primary); padding: 8px 10px; margin: 0 0 10px; }
.tcard .rule em { font-style: normal; color: var(--text-muted); display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; }
.tcard .nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; font-size: 12px; color: var(--text-secondary); margin: 4px 0 10px; padding: 10px 0; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
.tcard .nums b { font-size: 19px; line-height: 1.2; display: block; color: var(--text-primary); font-variant-numeric: tabular-nums; font-weight: 600; }
.tcard .bars { display: grid; gap: 4px; }
.tcard .bars .row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 46px; gap: 8px; align-items: center; font-size: 12px; }
.tcard .bars .row > span:first-child { color: var(--text-secondary); }
.tcard .bars .row > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.tcard .typ { font-size: 12px; color: var(--text-muted); margin-top: auto; padding-top: 12px; }

/* ---------- раскладки ---------- */
.dyn-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 40px; }
.dyn-layout.wide-left { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.dyn-layout > .card { margin-bottom: var(--gap); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.mini-charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.mini-charts.stack { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.chart-label { color: var(--text-secondary); font-size: 13px; margin-bottom: 2px; }

table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 8px 8px; border-bottom: 1px solid var(--grid); text-align: right; font-variant-numeric: tabular-nums; vertical-align: middle; }
th:first-child, td:first-child { text-align: left; }
th { font-family: var(--mono); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); font-weight: 400; vertical-align: bottom; border-bottom-color: var(--rule); }
td.best { font-weight: 650; }
tr.final td { background: var(--accent-soft); }
table.left th, table.left td { text-align: left; vertical-align: top; }
.tm td { text-align: center; }
.tm th.col { font-family: var(--sans); text-transform: none; letter-spacing: 0; font-weight: 600; text-align: center; font-size: 12px; line-height: 1.25; color: var(--text-secondary); }
.tm th.col .sw { display: block; margin: 0 auto 4px; }
.tname { white-space: nowrap; }
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 44px; gap: 8px; align-items: center; font-size: 13px; padding: 8px 0 2px; border-top: 1px solid var(--grid); }
.flow .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.flow-ex { font-size: 12px; color: var(--text-muted); margin: 2px 0 8px; }

.intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.intro p { font-size: 15px; line-height: 1.6; color: var(--text-secondary); margin: 0 0 10px; max-width: 72ch; }
.intro p b { color: var(--text-primary); }
.gloss { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 7px 14px; font-size: 13px; margin: 0; }
.gloss dt { font-weight: 620; }
.gloss dd { margin: 0; color: var(--text-secondary); }
.pipeline { counter-reset: s; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin: 0 0 var(--gap); border-top: 1px solid var(--rule); }
.pipeline li { padding: 14px 16px 14px 0; font-size: 13px; line-height: 1.5; color: var(--text-secondary); border-right: 1px solid var(--border); }
.pipeline li + li { padding-left: 16px; }
.pipeline li:last-child { border-right: 0; }
.pipeline li b { display: block; color: var(--text-primary); font-size: 14px; margin-bottom: 4px; font-weight: 620; }
.pipeline li::before { counter-increment: s; content: "0" counter(s); display: block; font-family: var(--mono); font-size: 12px; color: var(--text-muted); margin-bottom: 8px; letter-spacing: .06em; }

.ext { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-bottom: 12px; border-top: 1px solid var(--rule); }
.ext .tile { border-right: 1px solid var(--border); padding: 12px 14px 12px 0; }
.ext .tile + .tile { padding-left: 14px; }
.ext .tile .v { font-size: 26px; }
#external .ext { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#official th { font-size: 11px; line-height: 1.25; }
#data-notes { columns: 2 340px; column-gap: 40px; }
#data-notes h3 { break-after: avoid; }
#data-notes p { break-inside: avoid; }
.big-stat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 4px 0 12px; }
.big-stat .tile .v { font-size: 26px; }
.prose { font-size: 14px; color: var(--text-secondary); }
.prose p { max-width: 78ch; margin: 0 0 12px; }
.prose h3 { color: var(--text-primary); margin: 18px 0 6px; }
.prose h3:first-child { margin-top: 0; }
.use-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.use-grid .card { margin-bottom: 0; }
#cases { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.use-grid .card p { font-size: 14px; color: var(--text-secondary); margin: 0 0 10px; }
.case { display: flex; flex-direction: column; }
.case .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 12px; }
.case .facts div { background: var(--surface-2); border-radius: var(--radius); padding: 8px 10px; font-size: 12px; color: var(--text-secondary); }
.case .facts b { display: block; font-size: 17px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.case .btn { align-self: flex-start; margin-top: auto; }
.table-view { margin-top: 14px; font-size: 14px; }
.table-view summary { cursor: pointer; color: var(--text-secondary); font-family: var(--mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.table-view summary:hover { color: var(--text-primary); }
.v2-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.more { border-top: 1px solid var(--rule); margin: 6px 0 0; }
.more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 0; font-size: 15.5px; font-weight: 600; color: var(--text-primary); }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::before { content: ""; width: 26px; height: 26px; flex: none; border: 1px solid var(--text-primary); border-radius: 50%; background: no-repeat center/10px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3 1l4 4-4 4' fill='none' stroke='%23111' stroke-width='1.6'/%3E%3C/svg%3E"); transition: transform .2s; }
.more[open] > summary::before { transform: rotate(90deg); }
.more > summary:hover::before { background-color: var(--surface-2); }
.more > summary:hover { text-decoration: underline; text-underline-offset: 4px; }
.more[open] > summary { margin-bottom: 8px; }
.verdict { font-size: 15px; line-height: 1.55; color: var(--text-primary); border-left: 2px solid var(--text-primary); padding: 2px 0 2px 12px; margin: 4px 0 12px; }
.foot { color: var(--text-muted); font-size: 12px; padding-top: 24px; border-top: 1px solid var(--rule); margin-top: 48px; }
.foot p { max-width: 110ch; margin: 0 0 6px; }

.tooltip { position: fixed; pointer-events: none; z-index: 40; background: #111110; color: #fff; font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 4px; max-width: 300px; box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .45); }
.tooltip b { font-size: 13px; }
.axis text { fill: var(--text-muted); font-size: 12px; font-family: var(--mono); }
.axis path, .axis line { stroke: var(--axis); }
.gridline line { stroke: var(--grid); }

/* ---------- адаптивность ---------- */
#graphs-table, #methods-table, #methods-when, #trans, #official, #final-icvi, #types-table, #flows, #alluvial, .table-view, #panel table, #admin-table, #robust, #agg-table, #ross-table, #synth { overflow-x: auto; max-width: 100%; }
.dyn-layout > *, .map-layout > *, .types-grid > *, .mini-charts > *, .split > *, .use-grid > *, .intro > *, .v2-grid > * { min-width: 0; }
@media (max-width: 1180px) {
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline li:nth-child(3n) { border-right: 0; }
  .types-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .macro-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 0 32px; }
}
@media (max-width: 1000px) {
  .map-layout, .dyn-layout, .split, .intro, .use-grid, #cases, .v2-grid { grid-template-columns: minmax(0, 1fr); }
  .map-layout > .panel { contain: none; max-height: none; }
  .links a span { display: none; }
}
@media (max-width: 820px) {
  :root { --mast-h: 52px; }
  .viz-root { padding: 0 16px 40px; }
  .mast { margin: 0 -16px; padding: 0 16px; gap: 12px; }
  .mast .brand { font-size: 0; gap: 0; }
  .mast .brand span, .links { display: none; }
  .toc { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
  .story { display: flex; flex-direction: column; margin: 0 -16px; padding: 0; }
  .story-stage { position: sticky; top: var(--mast-h); height: 46vh; order: -1; z-index: 3; box-shadow: 0 1px 0 var(--border); }
  .story-steps { padding: 0 16px 30vh; z-index: 1; }
  .step { min-height: 46vh; justify-content: flex-start; padding: 4vh 0 3vh; }
  .step.hero { min-height: 0; justify-content: flex-start; padding: 4vh 0 10vh; }
  .step.hero h1 { font-size: 34px; }
  .step p, .step .lede { font-size: 15.5px; }
  .stage-time .t { min-width: 0; font-size: 11px; }
  .stage-legend { font-size: 11px; bottom: 8px; left: 12px; right: 12px; gap: 2px 10px; }
  .stage-time { bottom: 30px; left: 12px; right: 12px; }
  .story-stage .hud { left: 12px; right: 12px; top: 10px; }
  .story-stage .hud .count { display: none; }
  .stage-labels .il { width: 96px; font-size: 10.5px; line-height: 1.2; }
  .stage-labels .il b { font-size: 11px; }
  .stage-labels .il span { display: none; }
  .stage-labels .ml { display: none; }
}
@media (max-width: 820px) {
  .explorer-head { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  #trans::before, #methods-table::before, #graphs-table::before, #official::before, #agg-table::before, #synth::before, #ross-table::before, #admin-table::before {
    content: "таблица листается вбок →"; display: block; font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .f.grow, .f.w { grid-column: 1 / -1; }
  .mini-charts, .ext, .big-stat, .types-grid, .macro-row, .pipeline, .case .facts { grid-template-columns: minmax(0, 1fr); }
  .macro, .macro + .macro, .pipeline li, .pipeline li + li, .ext .tile, .ext .tile + .tile { padding-left: 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .tile .v { font-size: 24px; }
  .map-head { flex-direction: column; }
  .tools { justify-content: flex-start; }
  .card { padding: 16px; }
  .section { padding-top: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
