/* Модель 850 — стили витрины банка.
 *
 * Дизайн-система семейства в одном файле: токены → каркас → компоненты →
 * графики. Палитра графиков: синий — модель, оранжевый — рынок (вторая
 * категория акций — тот же цвет пунктиром), бирюзовый — эталоны и третий ряд,
 * красный — отрицательная сторона. Ряды держат контраст ≥ 3 : 1 к карточке в
 * обеих темах; текст — в токенах текста. Шрифт системный: CSP font-src 'self'.
 * Самый мелкий текст — 12,5 px.
 */

/* ── токены ── */

:root {
  color-scheme: light;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Pro Text",
          "Helvetica Neue", Roboto, "Noto Sans", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system,
          "SF Pro Display", "Helvetica Neue", Roboto, "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --page: #f4f3ee;
  --surface: #fcfcfb;
  --surface-2: #f4f3ef;
  --surface-3: #ebe9e3;
  --ink: #121211;
  --ink-2: #52514e;
  --muted: #6b6a65;
  --line: #e2e0d9;
  --line-2: #ecebe6;
  --grid: #e7e5df;
  --axis: #c3c2b7;
  --series-neutral: #7d7b74;

  --model: #2a78d6;
  --model-ink: #1f5fae;
  --model-wash-1: rgba(42, 120, 214, 0.09);
  --model-wash-2: rgba(42, 120, 214, 0.18);
  --model-wash-3: rgba(42, 120, 214, 0.30);
  --market: #eb6834;
  --market-ink: #b8481c;
  --market-wash: rgba(235, 104, 52, 0.12);
  --third: #179f6f;
  --third-ink: #0e7a54;
  --neg: #e34948;
  --neg-ink: #b42318;
  --neg-wash: rgba(227, 73, 72, 0.12);
  --good: #0ca30c;
  --good-ink: #006300;
  --warn: #fab219;
  --warn-ink: #7a5200;
  --warn-wash: rgba(250, 178, 25, 0.14);
  --bad: #d03b3b;
  --bad-wash: rgba(208, 59, 59, 0.08);

  --seq-0: #cde2fb;
  --seq-1: #9ec5f4;
  --seq-2: #6da7ec;
  --seq-3: #3987e5;
  --seq-4: #2a78d6;
  --seq-5: #1c5cab;
  --seq-6: #104281;
  --seq-none: #f0efea;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(24, 22, 16, 0.04), 0 6px 24px rgba(24, 22, 16, 0.04);
  --masthead-bg: rgba(244, 243, 238, 0.86);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0f0e;
  --surface: #1a1a19;
  --surface-2: #212120;
  --surface-3: #2a2a28;
  --ink: #f2f1ec;
  --ink-2: #c3c2b7;
  --muted: #a3a199;
  --line: #2e2e2b;
  --line-2: #262624;
  --grid: #2c2c2a;
  --axis: #4a4944;
  --series-neutral: #8a887f;

  --model: #3987e5;
  --model-ink: #6aa6f0;
  --model-wash-1: rgba(57, 135, 229, 0.10);
  --model-wash-2: rgba(57, 135, 229, 0.20);
  --model-wash-3: rgba(57, 135, 229, 0.34);
  --market: #d95926;
  --market-ink: #f08a5d;
  --market-wash: rgba(217, 89, 38, 0.16);
  --third: #199e70;
  --third-ink: #3fcf98;
  --neg: #e66767;
  --neg-ink: #f07070;
  --neg-wash: rgba(230, 103, 103, 0.16);
  --good: #0ca30c;
  --good-ink: #3fcf3f;
  --warn: #fab219;
  --warn-ink: #fcc955;
  --warn-wash: rgba(250, 178, 25, 0.12);
  --bad: #d03b3b;
  --bad-wash: rgba(208, 59, 59, 0.14);

  --seq-0: #183253;
  --seq-1: #1c4476;
  --seq-2: #225a9e;
  --seq-3: #2a78d6;
  --seq-4: #5598e7;
  --seq-5: #86b6ef;
  --seq-6: #b7d3f6;
  --seq-none: #242422;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --masthead-bg: rgba(15, 15, 14, 0.84);
}

/* ── основа ── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 120px; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-kerning: normal;
}
a { color: var(--model-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--model); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); }
p { margin: 0; }
strong { font-weight: 620; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.small { font-size: 13px; }
.skip {
  position: absolute; left: 16px; top: -48px; z-index: 60;
  background: var(--ink); color: var(--surface); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* ── шапка ── */

.masthead {
  position: sticky; top: 0; z-index: 30; background: var(--masthead-bg);
  -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line);
}
.masthead-row { display: flex; align-items: center; gap: 14px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-bg { fill: var(--ink); }
.brand-curve { fill: none; stroke: var(--surface); stroke-width: 2; stroke-linecap: round; }
.brand-mid { fill: none; stroke: var(--surface); stroke-width: 1.4; stroke-dasharray: 1.6 2.2; opacity: 0.7; }
.brand-dot { fill: var(--market); }
.brand-text { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-name { font: 650 17px/1.2 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 13px; color: var(--ink-2); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 10px; background: var(--surface);
}
.chip:hover { border-color: var(--axis); }
.chip-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-extra { color: var(--muted); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--axis); flex: none; }
.chip[data-state="ok"] .chip-dot { background: var(--good); box-shadow: 0 0 0 3px rgba(12, 163, 12, 0.16); }
.chip[data-state="warn"] .chip-dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(250, 178, 25, 0.2); }
.chip[data-state="stale"] .chip-dot { background: var(--bad); box-shadow: 0 0 0 3px rgba(208, 59, 59, 0.18); }
.icon-btn {
  appearance: none; flex: none; width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  display: grid; place-items: center; background: transparent; border: 1px solid var(--line);
}
.icon-btn:hover { background: var(--surface); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--ink-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root:not([data-theme="dark"]) .icon-moon { display: none; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; border: 0; background: none; cursor: pointer; position: relative;
  font-weight: 540; font-size: 14.5px; color: var(--muted); white-space: nowrap; padding: 11px 12px 13px;
}
.tab:first-child { margin-left: -12px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--ink); border-radius: 2px;
}

/* ── экран ── */

main { outline: none; padding-bottom: 32px; }
.boot, .fatal { padding: 96px 0; color: var(--muted); font-size: 16px; }
.fatal h1 { font-size: 26px; color: var(--ink); margin-bottom: 10px; }
.fatal pre { white-space: pre-wrap; overflow-wrap: break-word; font: 13px/1.5 var(--mono); color: var(--ink-2); background: var(--surface-2); padding: 12px 14px; border-radius: 10px; }
.screen { animation: rise 0.28s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.screen-head { padding: 40px 0 26px; max-width: 860px; }
.screen-head .eyebrow { margin-bottom: 10px; }
.screen-head h1 { font-size: clamp(27px, 3.3vw, 36px); font-weight: 660; letter-spacing: -0.022em; line-height: 1.12; margin-bottom: 12px; }
.screen-head p { color: var(--ink-2); font-size: 16.5px; line-height: 1.55; }
.eyebrow { display: block; text-transform: uppercase; font-size: 12.5px; letter-spacing: 0.07em; color: var(--muted); font-weight: 650; }
.section { margin-top: 36px; }
.row-label { margin: 0 0 12px 2px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-12 { grid-column: span 12; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px 24px; box-shadow: var(--shadow); min-width: 0; position: relative; container-type: inline-size;
}
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head > div { min-width: 0; flex: 1; }
.card-head > .chooser, .card-head > .pick-row { flex: none; }
.card h2, .card h3 { font-size: 16.5px; font-weight: 640; letter-spacing: -0.01em; line-height: 1.3; }
.card .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; line-height: 1.45; }
.card-foot { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.card-foot p + p { margin-top: 6px; }
.card-link { font-size: 13.5px; font-weight: 560; white-space: nowrap; text-decoration: none; }
.card-link::after { content: " →"; }
.card-link:hover { text-decoration: underline; }
.prose { color: var(--ink-2); font-size: 14.5px; line-height: 1.6; max-width: 72ch; }
.prose p + p { margin-top: 10px; }
.prose strong { color: var(--ink); }

/* второстепенные карточки длинных экранов: на телефоне — «ещё N карточек» */
.more-toggle {
  display: none; appearance: none; width: 100%; margin-top: 14px; padding: 12px 16px; cursor: pointer;
  border: 1px dashed var(--axis); border-radius: 12px; background: transparent; color: var(--model-ink);
  font-size: 14px; font-weight: 580; text-align: left;
}

/* ── плашки ── */

/* Развёрнутая плашка — во всю ширину; свёрнутые нажатием — ярлыки в одну строку под ними. */
.belt { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 20px; }
.banner {
  display: flex; flex: 1 1 100%; gap: 12px; align-items: flex-start; min-width: 0;
  border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: 12px;
  background: var(--surface); padding: 11px 16px; font-size: 14px; color: var(--ink-2);
}
.banner strong { color: var(--ink); }
.banner-icon { flex: none; font-weight: 700; line-height: 1.5; }
.banner-body { min-width: 0; flex: 1; overflow-wrap: break-word; }
.banner-degraded { background: linear-gradient(90deg, var(--warn-wash), var(--surface) 55%); }
.banner-stale { border-left-color: var(--bad); background: linear-gradient(90deg, var(--bad-wash), var(--surface) 55%); }
.banner-event { border-left-color: var(--market); }
.banner-info { border-left-color: var(--model); }
.reasons { margin: 6px 0 0; padding-left: 18px; }
.reasons li { overflow-wrap: break-word; }
.banner[role="button"] { cursor: pointer; }
.banner[aria-expanded="true"]::after { content: "–"; flex: none; color: var(--muted); line-height: 1.5; }
.banner.is-folded { order: 1; flex: 0 1 auto; max-width: min(100%, 44ch); padding: 5px 12px; font-size: 13px; }
.banner.is-folded .banner-body { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner.is-folded .reasons { display: none; }

/* ── герой ── */

.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; padding: 36px 0 8px; align-items: stretch; }
.hero-copy { display: flex; flex-direction: column; min-width: 0; }
.hero-figure { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 6px; flex-wrap: wrap; }
.hero-approx { font: 500 clamp(30px, 3.6vw, 44px)/1 var(--font-display); color: var(--muted); }
.hero-value { font: 660 clamp(64px, 8.6vw, 112px)/0.92 var(--font-display); letter-spacing: -0.045em; }
.hero-unit { font: 560 clamp(26px, 3vw, 38px)/1 var(--font-display); color: var(--ink-2); }
.hero-caption { color: var(--ink-2); font-size: 15px; margin-top: 8px; }
.hero-caption .muted { font-size: 13.5px; }
.upside { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.upside strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.bands { display: grid; gap: 8px; margin: 20px 0 0; }
.band-row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 12px; font-size: 15px; }
.band-key { height: 12px; border-radius: 3px; }
.band-key.b80 { background: var(--model-wash-2); }
.band-key.b50 { background: var(--model-wash-3); box-shadow: inset 0 0 0 1px var(--model); }
.band-row .range { font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; }
.band-row .what { color: var(--ink-2); }
.verdict { margin-top: 22px; padding: 16px 18px 15px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.verdict-top { display: flex; align-items: baseline; gap: 14px; }
.verdict-num { font: 660 38px/1 var(--font-display); letter-spacing: -0.025em; flex: none; }
.verdict-title { font-weight: 560; font-size: 15px; line-height: 1.35; color: var(--ink); }
.verdict-note { display: block; color: var(--muted); font-size: 13px; margin-top: 8px; line-height: 1.4; }
.meter { position: relative; height: 8px; border-radius: 4px; background: var(--market-wash); margin-top: 12px; overflow: hidden; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px 0 0 4px; background: var(--model); }
.hero-chart { display: flex; flex-direction: column; min-width: 0; padding: 20px 22px 18px; }
.hero-chart .card-head { margin-bottom: 4px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin: 8px 0 0; }
.legend + .fig, .legend + .chart { margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.legend .key { flex: none; }
.key { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.key-line { width: 16px; height: 0; border-top: 2px solid; border-radius: 0; }
.key-dot { width: 9px; height: 9px; border-radius: 50%; }
.key-model { background: var(--model); border-color: var(--model); }
.key-market { background: var(--market); border-color: var(--market); }
.key-market2 { border-top: 2px dashed var(--market); background: none; }
.key-third { background: var(--third); border-color: var(--third); }
.key-ink { background: var(--ink); border-color: var(--ink); }
.key-neg { background: var(--neg); border-color: var(--neg); }
.key-neutral { background: var(--series-neutral); border-color: var(--series-neutral); }
.key-b80 { background: var(--model-wash-2); }
.key-b50 { background: var(--model-wash-3); }
.key-dash { border-top: 2px dotted var(--ink-2); background: none; }
.key-diamond { width: 9px; height: 9px; border: 1.6px solid var(--ink); background: var(--surface); transform: rotate(45deg); border-radius: 1px; }

/* ползунок λ */
.lambda { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.lambda-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lambda-title { font-weight: 600; font-size: 14px; }
.lambda-out { font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lambda-ends { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.lambda-ends span { display: inline-flex; align-items: center; gap: 6px; }
.lambda-ends .key { width: 10px; height: 10px; border-radius: 50%; }
.lambda-reset { appearance: none; border: 0; background: none; color: var(--model-ink); cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.lambda-reset[hidden] { display: none; }
.lambda-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--market) 0%, var(--model) 100%); opacity: 0.85; }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--market) 0%, var(--model) 100%); opacity: 0.85; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--model-wash-3); }

/* ── плитки, паспорт ── */

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; }
.tile-label { font-size: 13px; color: var(--muted); font-weight: 560; line-height: 1.35; }
.tile-value { font: 650 30px/1.08 var(--font-display); letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.tile-value .unit { font-size: 16px; font-weight: 560; color: var(--ink-2); letter-spacing: 0; }
.tile-note { font-size: 13px; color: var(--ink-2); line-height: 1.45; padding-top: 4px; }
.passport { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; margin-top: 20px; padding: 4px 8px; }
.passport .pp { padding: 10px 16px; border-left: 1px solid var(--line); min-width: 0; }
.passport .pp:first-child { border-left: 0; }
.passport .pp-foot { grid-column: 1 / -1; padding: 8px 16px 6px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.pp-value { font: 640 19px/1.2 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-label { font-size: 12.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; }
.kpi { padding: 12px 0 0; border-top: 1px solid var(--line-2); min-width: 0; }
.kpi-value { font: 640 22px/1.15 var(--font-display); letter-spacing: -0.012em; white-space: nowrap; }
.kpi-value .unit { font-size: 14px; font-weight: 540; color: var(--ink-2); }
.kpi-label { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }

/* ── значки ── */

.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line);
  color: var(--ink-2); background: var(--surface-2); line-height: 1.5;
}
.badge-good { color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 35%, transparent); background: color-mix(in srgb, var(--good) 9%, transparent); }
.badge-out { color: var(--muted); }
.badge-warn { color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-wash); }
.badge-bad { color: var(--neg-ink); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-wash); }
.badge-model { color: var(--model-ink); border-color: color-mix(in srgb, var(--model) 35%, transparent); background: var(--model-wash-1); }
.code { font: 600 12.5px/1.4 var(--mono); color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }

/* ── таблицы ── */

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -24px; padding: 0 24px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.data caption { text-align: left; color: var(--muted); font-size: 13px; padding-bottom: 8px; }
table.data thead th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; line-height: 1.3;
  padding: 0 10px 9px; border-bottom: 1px solid var(--line); vertical-align: bottom;
  overflow-wrap: normal; word-break: normal; hyphens: manual;
}
table.data td { padding: 10px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data th:first-child, table.data td:first-child { padding-left: 0; }
table.data th:last-child, table.data td:last-child { padding-right: 0; }
table.data td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data th.num { text-align: right; }
table.data td.txt { color: var(--ink-2); }
table.data tr.is-pick td { background: var(--model-wash-1); }
table.data tr.is-total td { font-weight: 640; border-top: 1px solid var(--line); }
table.data tr.is-muted td { color: var(--muted); }
table.data td.name { font-weight: 540; }
table.data td .hint { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kpi-label .hint { display: block; margin-top: 2px; }
table.data tr.detail td { padding-top: 0; color: var(--ink-2); font-size: 13.5px; }
table.data tr.detail details { max-width: 110ch; }
table.data tr.has-detail td { border-bottom: 0; }
table.compact td { padding: 7px 10px; }
table.dense { font-size: 13.5px; }
table.dense th, table.dense td { padding-left: 3px; padding-right: 3px; }
td .cell-badge { display: block; margin-top: 5px; font-weight: 400; }
details > summary { cursor: pointer; color: var(--model-ink); font-size: 13px; font-weight: 560; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; }
details[open] > summary::before { content: "▾ "; }
details .detail-text { margin-top: 6px; line-height: 1.55; overflow-wrap: break-word; color: var(--ink-2); font-size: 13.5px; }

/* ── переключатели ── */

.chooser { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.chooser button { appearance: none; border: 0; background: transparent; cursor: pointer; border-radius: 9px; padding: 6px 12px; font-size: 13.5px; font-weight: 560; color: var(--ink-2); }
.chooser button:hover { color: var(--ink); }
.chooser button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.chooser .w { color: var(--muted); font-weight: 500; margin-left: 6px; font-variant-numeric: tabular-nums; }
.view-toggle { appearance: none; border: 1px solid var(--line); background: var(--surface); cursor: pointer; border-radius: 8px; padding: 4px 10px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.view-toggle:hover { border-color: var(--axis); color: var(--ink); }
.pick-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; }

/* ── графики ── */

.chart { width: 100%; position: relative; min-height: 20px; }
.chart svg { display: block; overflow: visible; }
.chart text { font-family: var(--font); font-size: 12.5px; fill: var(--muted); }
.chart .tick { font-size: 12.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .label { font-size: 12.5px; fill: var(--ink-2); font-weight: 520; }
.chart .label-strong { font-size: 13px; fill: var(--ink); font-weight: 640; }
.chart .halo { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axisline { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart [data-tip] { cursor: help; }
.chart [data-tip]:focus-visible { outline: none; }
.fig-table { margin-top: 10px; }
.fig-table .split { gap: 20px; }
.tip {
  position: fixed; z-index: 70; pointer-events: none; max-width: 300px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.4; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
}
.tip-title { font-weight: 640; margin-bottom: 4px; }
.tip-row { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.tip-row .k { color: var(--muted); }
.tip-row .v { font-weight: 620; white-space: nowrap; }
.tip-note { color: var(--muted); margin-top: 4px; font-size: 12.5px; }

/* ряды «диапазон книги и что нужно рынку» */
.rows { display: grid; gap: 0; }
.rrow { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.95fr); gap: 18px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); }
.rrow:first-child { border-top: 0; }
.rrow-name { font-weight: 560; font-size: 14px; line-height: 1.35; }
.rrow-name .hint { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; margin-top: 2px; }
.rrow-need { font-size: 14px; line-height: 1.35; }
.rrow-need .v { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rrow-need .b { color: var(--muted); font-size: 12.5px; display: block; margin-top: 3px; }

/* полосы вклада */
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, 1.1fr) 56px; gap: 12px; align-items: center; font-size: 13.5px; }
.hbar-name { color: var(--ink-2); line-height: 1.3; min-width: 0; }
.hbar-track { height: 10px; border-radius: 0 4px 4px 0; background: var(--surface-2); position: relative; overflow: hidden; }
.hbar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--model); border-radius: 0 4px 4px 0; }
.hbar-val { text-align: right; font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* поток расчёта */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; counter-reset: step; }
.flow-step { position: relative; padding: 18px 20px 18px 18px; border-right: 1px solid var(--line-2); min-width: 0; }
.flow-step:last-child { border-right: 0; }
.flow-step::before {
  counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); color: var(--surface); font-size: 12.5px; font-weight: 700; margin-bottom: 10px;
}
.flow-step h3 { font-size: 15px; margin-bottom: 6px; }
.flow-step p { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.flow-step .big { font: 650 20px/1.2 var(--font-display); letter-spacing: -0.015em; color: var(--ink); margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.flow-step:not(:last-child)::after {
  content: ""; position: absolute; right: -7px; top: 26px; width: 12px; height: 12px;
  background: var(--surface); border-top: 1px solid var(--line-2); border-right: 1px solid var(--line-2); transform: rotate(45deg);
}

/* теплокарта сетки */
.heat-wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.heat-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.heat-title strong { font-size: 14.5px; }
.heat-title span { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
table.heat { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
table.heat th { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 2px 0; text-align: center; overflow-wrap: break-word; line-height: 1.2; }
table.heat th.row-h { text-align: left; width: 30%; padding-right: 4px; }
table.heat td { height: 54px; border-radius: 8px; text-align: center; vertical-align: middle; padding: 4px 2px; background: var(--seq-none); color: var(--ink); position: relative; line-height: 1.15; }
table.heat td .p { display: block; font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.heat td .w { display: block; font-size: 12.5px; opacity: 0.8; font-variant-numeric: tabular-nums; }
table.heat td .flag { position: absolute; top: 3px; right: 5px; font-size: 12.5px; line-height: 1; }
table.heat td.h0 { background: var(--seq-none); color: var(--muted); }
table.heat td.h1 { background: var(--seq-0); color: #0b1f3a; }
table.heat td.h2 { background: var(--seq-1); color: #0b1f3a; }
table.heat td.h3 { background: var(--seq-2); color: #06162b; }
table.heat td.h4 { background: var(--seq-3); color: #ffffff; }
table.heat td.h5 { background: var(--seq-4); color: #ffffff; }
table.heat td.h6 { background: var(--seq-5); color: #ffffff; }
table.heat td.h7 { background: var(--seq-6); color: #ffffff; }
:root[data-theme="dark"] table.heat td.h1, :root[data-theme="dark"] table.heat td.h2,
:root[data-theme="dark"] table.heat td.h3, :root[data-theme="dark"] table.heat td.h4 { color: #eef4fd; }
:root[data-theme="dark"] table.heat td.h5, :root[data-theme="dark"] table.heat td.h6,
:root[data-theme="dark"] table.heat td.h7 { color: #0a1a30; }
table.heat td:hover, table.heat td:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.scale { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.scale i { display: inline-block; width: 26px; height: 10px; border-radius: 2px; }
.scale .gap { margin-left: 10px; }

/* события */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 92px 16px minmax(0, 1fr); gap: 12px; padding: 0 0 16px; position: relative; }
.timeline li:last-child { padding-bottom: 0; }
.tl-date { text-align: right; font-weight: 620; font-size: 13.5px; font-variant-numeric: tabular-nums; line-height: 1.35; }
.tl-date .muted { display: block; font-weight: 500; font-size: 12.5px; }
.tl-rail { position: relative; }
.tl-rail::before { content: ""; position: absolute; left: 7px; top: 14px; bottom: -16px; width: 2px; background: var(--line); }
.timeline li:last-child .tl-rail::before { display: none; }
.tl-rail i { position: absolute; left: 2px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--axis); }
.timeline li.is-div .tl-rail i { background: var(--market); border-color: var(--market); }
.timeline li.is-fact .tl-rail i { background: var(--ink); border-color: var(--ink); }
.tl-body { font-size: 14px; line-height: 1.45; min-width: 0; }
.tl-body strong { display: block; }
.tl-body > .muted { display: block; font-size: 13px; }
.countdown { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.countdown .big { font: 660 44px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.countdown + .countdown { margin-top: 12px; }

/* перечни */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.list li:first-child { border-top: 0; }
.list li.total { border-top: 1px solid var(--line); }
.list li.total .v { font-weight: 660; }
.list .v { font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list .t { color: var(--ink-2); min-width: 0; }
.list .t .muted { display: block; font-size: 12.5px; }
.list.stacked li { display: block; }
.list.stacked .t { display: block; color: var(--muted); font-size: 12.5px; }
.list.stacked .v { display: block; white-space: normal; font-weight: 560; margin-top: 2px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.split.wide-left { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 28px; }
.admission { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.admission-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stack > * + * { margin-top: 14px; }
.note-box { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.note-box strong { color: var(--ink); }
.empty { color: var(--muted); font-size: 14px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; }
.broken { border-left: 3px solid var(--bad); }

/* ── подвал ── */

.colophon { padding-top: 24px; padding-bottom: 48px; border-top: 1px solid var(--line); margin-top: 40px; color: var(--muted); font-size: 13px; }
.colophon p { max-width: 90ch; overflow-wrap: break-word; }

/* ── составные компоненты ── */

.bt-track { position: relative; height: 16px; border-radius: 5px; background: var(--surface-2); }
.bt-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 3px; background: var(--model); }
.bt-bar.is-total { background: var(--ink-2); }
.bt-bar.is-down { background: var(--neg); }
.bt-bar.is-up { background: var(--model); }
.bt-center { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; z-index: 1; }
.bt-mark { position: absolute; top: -3px; bottom: -3px; width: 14px; margin-left: -7px; z-index: 2; }
.tornado { display: grid; gap: 12px; }
.tn-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 2fr) minmax(0, 0.95fr); gap: 16px; align-items: center; }
.tn-name { font-size: 14px; font-weight: 540; line-height: 1.3; }
.tn-vals { text-align: right; font-weight: 620; font-variant-numeric: tabular-nums; font-size: 13.5px; white-space: nowrap; }
.tn-vals .hint { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; white-space: normal; }
.tn-axis-row { margin-top: 2px; }
.tn-axis { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tn-cell { display: grid; grid-template-columns: minmax(120px, 1fr) auto; gap: 10px; align-items: center; min-width: 210px; }
.tn-nums { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 13px; color: var(--ink-2); }
.wf { display: grid; gap: 7px; }
.wf-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 2fr) 84px; gap: 14px; align-items: center; font-size: 13.5px; }
.wf-row.is-total { font-weight: 640; }
.wf-name { color: var(--ink-2); line-height: 1.3; }
.wf-row.is-total .wf-name { color: var(--ink); }
.wf-val { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wf-name .hint { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.wf.wide .wf-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) 136px; }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ladder li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.ladder li.is-current { background: var(--model-wash-1); box-shadow: inset 3px 0 0 var(--model); color: var(--ink); }
.ladder-rung { font-weight: 620; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ladder li.is-current .ladder-rung { color: var(--model-ink); }
.progress { display: flex; gap: 6px; margin-top: 14px; max-width: 360px; }
.progress i { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-3); }
.progress i.on { background: var(--model); }
.stackbar { display: flex; gap: 2px; height: 20px; border-radius: 6px; overflow: hidden; margin: 6px 0 2px; }
.stackbar i { display: block; min-width: 4px; }
.minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.mini .tile-label { display: block; margin-bottom: 2px; }
.ind-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.ind-tile { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); min-width: 0; }
.spark { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.spark .chart { height: 40px; }
.ind-value { font: 650 24px/1.15 var(--font-display); letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.gates { display: grid; margin-top: 16px; }
.gate { padding: 14px 0; border-top: 1px solid var(--line-2); }
.gate-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.gate-head strong { font-size: 14.5px; }
.gate-mass { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ── адаптивность ── */

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-step { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .flow-step::after { display: none; }
  .heat-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .split, .split.wide-left { grid-template-columns: minmax(0, 1fr); }
  .span-5, .span-6, .span-7 { grid-column: span 12; }
  .rrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rrow-name { grid-column: span 2; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .brand-sub, .chip-extra, .chip-word { display: none; }
  .masthead-row { gap: 8px; }
  .brand { flex: none; gap: 8px; }
  .brand-name { font-size: 16px; }
  .chip { padding: 4px 8px 4px 7px; gap: 6px; font-size: 12.5px; }
  .screen-head { padding: 28px 0 18px; }
  .screen-head p { font-size: 15.5px; }
  .card { padding: 18px 16px 20px; border-radius: 14px; }
  .scroll { margin: 0 -16px; padding: 0 16px; }
  .tiles { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .grid { gap: 14px; }
  .hero { padding-top: 26px; }
  .hero-chart { padding: 16px 14px 14px; }
  .flow, .minis { grid-template-columns: minmax(0, 1fr); }
  .timeline li { grid-template-columns: 76px 16px minmax(0, 1fr); gap: 10px; }
  .hbar { grid-template-columns: minmax(0, 1fr) 70px 52px; }
  .verdict-num { font-size: 30px; }
  .passport .pp, .passport .pp-foot { border-left: 0; border-top: 1px solid var(--line-2); padding: 8px 4px; }
  .more-toggle { display: block; }
  .more:not(.is-open) > .more-body { display: none; }
  .more.is-open > .more-toggle { display: none; }
  .tn-row { grid-template-columns: minmax(0, 1fr) 124px; gap: 6px 12px; }
  .tn-row .tn-name { grid-column: 1 / -1; }
  .tn-row .tn-bar { grid-column: 1; }
  .tn-axis-row > span:first-child { display: none; }
  .wf-row { grid-template-columns: minmax(0, 1fr) 84px; gap: 4px 12px; }
  .wf-row .wf-name { grid-column: 1 / -1; }
  .wf-row .wf-bar { grid-column: 1; }
}
@media (max-width: 480px) {
  /* Узкий экран: число не переносится; широкая таблица едет внутри карточки,
     первая колонка закреплена. */
  table.data th:first-child, table.data td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); max-width: 42vw; }
  table.data tr.is-pick td:first-child { background: linear-gradient(var(--model-wash-1), var(--model-wash-1)), var(--surface); }
  table.data tr.detail td:first-child { position: static; max-width: none; }
  .rrow { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .rrow-name { grid-column: auto; }
  .tab { padding: 10px 10px 12px; font-size: 14px; }
  .tab:first-child { margin-left: -10px; }
  .card-head:has(> .card-link, > .chooser, > .pick-row) { flex-wrap: wrap; row-gap: 8px; }
  .card-head:has(> .card-link, > .chooser, > .pick-row) > div:first-child { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  * { scroll-behavior: auto !important; }
}
@media print {
  .masthead, .view-toggle, .lambda, .more-toggle { display: none; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
  .more > .more-body { display: block !important; }
  .banner.is-folded { flex: 1 1 100%; max-width: none; }
  .banner.is-folded .banner-body { white-space: normal; }
}

/* страница 404 */
.notfound { padding-top: 120px; padding-bottom: 120px; max-width: 720px; }
.notfound h1 { font-size: 36px; letter-spacing: -0.02em; margin: 10px 0 14px; }
.notfound p { color: var(--ink-2); font-size: 16px; margin-top: 8px; }
.notfound code { font: 14px var(--mono); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ── дополнения банка ── */
.key-band { background: var(--market-wash); border: 1px solid var(--market); box-sizing: border-box; }
.key-neg2 { border-top: 2px dashed var(--neg); background: none; }
.key-neg3 { border-top: 2px dotted var(--neg); background: none; }
.key-model2 { border-top: 2px dashed var(--model); background: none; }
.key-third2 { border-top: 2px dashed var(--third); background: none; }
th [data-tip] { cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
table.data td.nowrap { white-space: nowrap; }
table.heat td .flag { display: block; position: static; font-size: 12.5px; line-height: 1.1; letter-spacing: 0.04em; }
@media (max-width: 720px) {
  table.heat th.row-h { width: 36%; }
  .wf.wide .wf-row { grid-template-columns: minmax(0, 1fr) 132px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 10px 16px; }
  .kpi-value { font-size: 19px; }
  table.data td.txt .hint { min-width: 22ch; }
}
