/* Лендинг и документация SecurityFlow. Заголовки - SF Pixel Soft (OFL, OFL-sf-pixel-soft.txt
   рядом): наш мягкий пиксель на основе Departure Mono - углы скруглены, соседние пиксели
   слиты, штрих тоньше. Сборка - asoc/brand, tools/sf-pixel-soft.py. Шрифт нарисован на сетке
   11px, поэтому кегли заголовков кратны 11 - 22, 33, 44, 55. Тёмная тема одна, как на экранах входа.
   Цвета продуктов - те же, что у буквы S в знаках: Core фиолетовый, Radar
   красный, лицензии зелёный, F синяя у всех. Здесь цвет несёт смысл: им
   помечено, к какой части платформы относится блок. */

@font-face {
  font-family: "SF Pixel Soft";
  src: url(sf-pixel-soft.woff2) format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Montserrat";
  src: url(../assets/Montserrat-VariableFont_wght-DI3p5GXo.ttf) format("truetype-variations");
  font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: "Roboto Mono";
  src: url(../assets/RobotoMono-VariableFont_wght-BmolPSYj.ttf) format("truetype-variations");
  font-weight: 100 700; font-display: swap;
}

:root {
  --ink: #0c1322;
  --deck: #131c30;
  --rail: #223049;
  --rail-hi: #32436a;
  --paper: #e7ecf6;
  --body: #c9d2e4;
  --mist: #93a1bd;
  --portal: #b376fa;
  --auditor: #ff4d5e;
  --license: #34d399;
  --flow: #6aa6fa;
  --pixel: "SF Pixel Soft", ui-monospace, monospace;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Roboto Mono", ui-monospace, "SFMono-Regular", monospace;
  --top: 64px;
  color-scheme: dark;
}

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

* { box-sizing: border-box; }
html { background: var(--ink); font-synthesis: none; scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 24px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--body); font: 400 17px/1.6 var(--sans); text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
a { color: var(--flow); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #9cc4ff; }
:focus-visible { outline: 2px solid var(--flow); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(106, 166, 250, .35); color: #fff; }
h1, h2, h3 { color: var(--paper); margin: 0; }
h1, h2 { font-family: var(--pixel); font-weight: 400; font-synthesis: none; letter-spacing: 0; text-wrap: balance; }
/* Пробел пиксельного шрифта - 7 клеток и рвёт строку. Сужаем до 4: только там, где набрано пиксельным шрифтом. */
.hero h1, .band h2, .doc h1, .docindex h2, .part h3, .caps dt { word-spacing: calc(-3em / 11); }
h3 { font-weight: 650; font-size: 1.1rem; line-height: 1.35; }
p { margin: 0 0 1em; }
p, li, dd { text-wrap: pretty; }
kbd { font: 500 .78rem/1 var(--mono); color: var(--mist); border: 1px solid var(--rail-hi); border-bottom-width: 2px; border-radius: 5px; padding: 3px 6px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 50; background: var(--flow); color: var(--ink); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── шапка ─────────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 40; height: var(--top); view-transition-name: top;
  background: rgba(12, 19, 34, .72); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent; transition: border-color .2s, background .2s; }
.top[data-scrolled] { border-bottom-color: var(--rail); background: rgba(12, 19, 34, .9); }
.top-in { max-width: 1400px; height: 100%; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { flex: none; padding: 6px 0; }
.brand img { width: 130px; height: 18px; image-rendering: pixelated; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--mist); text-decoration: none; font-size: .92rem; font-weight: 500; padding: 8px 12px; white-space: nowrap; border-radius: 8px; transition: color .15s, background .15s; }
.nav a:hover { color: var(--paper); background: rgba(255, 255, 255, .04); }
.nav a[aria-current] { color: var(--paper); box-shadow: inset 0 -2px 0 var(--flow); border-radius: 0; }
/* Вход в кабинет: пиксельный SF в цветах сервера лицензий (S зелёная, F синяя), как
   во вкладке браузера и в шапке Core. Клетка знака - ровно 3px, иначе пиксели плывут. */
.cab { flex: none; display: inline-flex; align-items: center; gap: 12px; height: 44px; padding: 0 18px 0 13px; border-radius: 12px;
  color: var(--paper); font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap;
  background: linear-gradient(var(--deck), var(--deck)) padding-box,
              linear-gradient(90deg, #34d399, #6aa6fa) border-box;
  border: 1px solid transparent; transition: box-shadow .2s, background .2s, transform .15s; }
.cab:hover { color: #fff; background: linear-gradient(#1b2a44, #1b2a44) padding-box,
              linear-gradient(90deg, #5ee0b0, #8dbbfc) border-box;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, .14), 0 10px 28px rgba(52, 211, 153, .22); }
.cab-short { display: none; }
.cab.big { height: 48px; padding: 0 20px 0 15px; font-size: .98rem; margin-top: 28px; }
.cab:active { transform: translateY(1px); }
.cab .glyph { flex: none; transition: filter .2s; }
.cab:hover .glyph { filter: drop-shadow(0 0 5px rgba(52, 211, 153, .55)); }
.burger { display: none; flex: none; margin-left: auto; width: 40px; height: 40px; border: 1px solid var(--rail-hi); border-radius: 10px;
  background: none; padding: 0; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.burger i { display: block; width: 16px; height: 2px; background: var(--paper); transition: transform .2s, opacity .2s; }
.burger[aria-expanded="true"] i:nth-of-type(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] i:nth-of-type(2) { opacity: 0; }
.burger[aria-expanded="true"] i:nth-of-type(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── кнопки ────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 10px; font-weight: 600; font-size: .98rem;
  text-decoration: none; color: var(--ink); background: var(--flow); border: 1px solid var(--flow); transition: background .15s, border-color .15s, color .15s, transform .15s; }
.btn:hover { color: var(--ink); background: #8dbbfc; border-color: #8dbbfc; }
.btn:active { transform: translateY(1px); }
.btn.ghost { color: var(--paper); background: var(--ink); border-color: var(--rail-hi); }
.btn.ghost:hover { border-color: var(--paper); background: #121a2a; }

/* ── первый экран ──────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: 64px 0 88px; isolation: isolate; }
/* Поле точек рисует site.js на canvas: дыхание точек, волна сканера от арки, свет под
   курсором. Пока скрипт не запустился (или его нет) - те же точки статикой в ::before. */
.hero > .field { position: absolute; inset: 0; z-index: -1; display: block; width: 100%; height: 100%; pointer-events: none; }
.hero.has-field::before { display: none; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(circle, rgba(147, 161, 189, .22) 1px, transparent 1.6px); background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 72% 45%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse 70% 80% at 72% 45%, #000 0%, transparent 70%); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); align-items: center; gap: 40px; }
.hero h1 { font-size: 55px; line-height: 1.2; max-width: 13ch; }
.lead { font-size: 1.16rem; line-height: 1.6; color: var(--mist); max-width: 54ch; margin: 28px 0 36px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-mark { position: relative; margin: 0; justify-self: center; width: 100%; max-width: 560px; }
.hero-mark::before { content: ""; position: absolute; inset: 8% 4% 4%; z-index: -1; border-radius: 50%; filter: blur(40px);
  background: radial-gradient(closest-side, rgba(106, 166, 250, .22), rgba(52, 211, 153, .10) 55%, transparent); }
.hero-mark img { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }

/* ── секции ────────────────────────────────────────────────────────── */
.band { padding: 104px 0; border-top: 1px solid var(--rail); }
.band h2 { font-size: 44px; line-height: 1.25; max-width: 30ch; }
.sub { color: var(--mist); max-width: 62ch; margin: 18px 0 0; }
.more { display: inline-block; margin-top: 24px; font-weight: 600; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.split-head { position: sticky; top: calc(var(--top) + 32px); }

/* ── проявление главного заголовка ────────────────────────────────
   При загрузке заголовок первого экрана проявляется сверху вниз ступеньками, как строки
   на пиксельном экране. Один раз; при "уменьшить движение" - сразу. Обрезка clip-path:
   у маски с анимированным @property бывали кадры, где заголовок оставался пустым. */
.hero h1 { animation: h1-scan 1.1s steps(22) .15s both; }
@keyframes h1-scan { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 -10% 0); } }
@media (prefers-reduced-motion: reduce) { .hero h1 { animation: none; } }

/* ── поток: пять остановок ─────────────────────────────────────────
   Пиксели едут вдоль линии остановок: на широком экране слева направо, на узком сверху
   вниз. На остановке "Core" две трети гаснут - так выглядит дедупликация. Уцелевшие
   перекрашиваются в цвет остановки, мимо которой проехали. Позиции остановок меряет
   site.js, поэтому пиксель меняет цвет ровно на квадрате остановки. Едет, только пока
   блок на экране. */
.flow { position: relative; margin-top: 64px; }
.flow-track { position: absolute; left: 7px; right: 0; top: 6px; height: 2px; container-type: inline-size;
  background: linear-gradient(90deg, var(--rail-hi), var(--rail-hi) 85%, transparent); }
.px { position: absolute; left: 0; top: -3px; width: 8px; height: 8px; background: var(--paper); opacity: 0;
  will-change: transform, opacity; }
.flow-stops { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; counter-reset: stop; }
.flow-stops li { position: relative; padding-top: 40px; counter-increment: stop; }
.flow-stops li::before { content: ""; position: absolute; left: 0; top: 0; width: 14px; height: 14px; background: var(--c); box-shadow: 0 0 0 4px var(--ink); }
.flow-stops b { display: block; color: var(--paper); font-weight: 650; margin-bottom: 6px; }
.flow-stops b::before { content: counter(stop); font-family: var(--pixel); font-weight: 400; font-size: 22px; vertical-align: -2px; color: var(--c); margin-right: 10px; }
.flow-stops span { display: block; color: var(--mist); font-size: .95rem; }

/* ── три части ─────────────────────────────────────────────────────── */
.parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 64px; margin-top: 56px; border-top: 1px solid var(--rail); }
.part { position: relative; padding: 36px 0 8px; display: flex; flex-direction: column; }
.part + .part::after { content: ""; position: absolute; left: -32px; top: 0; bottom: 0; width: 1px; background: var(--rail); }
.part::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--c) 8px, transparent 8px) left top / 12px 4px space no-repeat; }
.part .glyph { width: 54px; height: 36px; margin-bottom: 22px; }
.part h3 { font-family: var(--pixel); font-weight: 400; font-size: 33px; line-height: 1.2; margin-bottom: 12px; }
.part p { color: var(--mist); }
.part ul { list-style: none; margin: 4px 0 24px; padding: 0; }
.part li { position: relative; padding: 7px 0 7px 20px; border-top: 1px solid var(--rail); }
.part li::before { content: ""; position: absolute; left: 0; top: 17px; width: 6px; height: 6px; background: var(--c); }
.part > a { margin-top: auto; color: var(--c); font-weight: 600; }
.part > a:hover { color: var(--paper); }

/* ── возможности Core ───────────────────────────────────────────────── */
.caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 40px; margin: 0; }
.caps dt { font-family: var(--pixel); font-weight: 400; font-size: 22px; color: var(--paper); padding-bottom: 12px;
  margin-bottom: 4px; border-bottom: 2px solid var(--c, var(--portal)); }
.caps dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--rail); color: var(--body); font-size: .97rem; }

/* ── сканеры ───────────────────────────────────────────────────────── */
.scan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 32px; margin-top: 56px; }
.scan-row h3 { font-size: 1rem; margin-bottom: 14px; }
.scan-row h3::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; background: var(--c); vertical-align: 1px; }
.scan-row small { font-family: var(--pixel); font-weight: 400; color: var(--c); font-size: 22px; line-height: 1; margin-left: 4px; vertical-align: -2px; white-space: nowrap; }
.scan-row ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.scan-more { margin-top: 48px; padding: 22px 24px; border: 1px dashed var(--rail-hi); border-radius: 12px; }
.scan-more h3 { font-size: 1rem; margin-bottom: 8px; }
.scan-more h3::before { content: "+"; font-family: var(--pixel); font-weight: 400; font-size: 22px; color: var(--flow); margin-right: 10px; vertical-align: -2px; }
.scan-more p { color: var(--mist); margin: 0; max-width: 76ch; }
.scan-row li { font-size: .92rem; font-weight: 500; color: var(--paper); padding: 6px 12px; border: 1px solid var(--rail-hi); border-radius: 7px;
  background: linear-gradient(var(--c), var(--c)) left / 3px 100% no-repeat, var(--deck); }

/* ── таблицы (лендинг и документация) ──────────────────────────────── */
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { text-align: left; color: var(--mist); font-size: .9rem; padding-bottom: 12px; }
th { text-align: left; font-size: .82rem; font-weight: 600; color: var(--mist); padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rail-hi); vertical-align: bottom; }
td { padding: 14px 14px 14px 0; border-bottom: 1px solid var(--rail); color: var(--body); vertical-align: top; }
.note { color: var(--mist); font-size: .9rem; margin-top: 16px; }

/* ── лицензия ──────────────────────────────────────────────────────── */
.steps { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; counter-reset: step; }
.steps li { counter-increment: step; padding-top: 22px; border-top: 2px solid var(--rail-hi); position: relative; }
.steps li::after { content: ""; position: absolute; top: -2px; left: 0; width: 48px; height: 2px; background: var(--license); }
.steps b { display: block; color: var(--paper); font-weight: 650; font-size: 1.1rem; margin-bottom: 8px; }
.steps b::before { content: counter(step); display: block; font-family: var(--pixel); font-weight: 400; font-size: 44px; line-height: 1; color: var(--license); margin-bottom: 14px; }
.steps span { color: var(--mist); }
.plans { margin: 40px 0 0; padding: 16px 20px; border: 1px dashed var(--rail-hi); border-radius: 10px; color: var(--body); }


/* ── последний призыв ──────────────────────────────────────────────── */
.band.last { padding-bottom: 120px; }
.closer { position: relative; padding: 56px; border: 1px solid var(--rail-hi); border-radius: 18px; overflow: hidden; isolation: isolate;
  background: radial-gradient(ellipse 60% 120% at 100% 0%, rgba(179, 118, 250, .14), transparent 60%), var(--deck); }
.closer::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 46%; z-index: -1;
  background-image: radial-gradient(circle, rgba(147, 161, 189, .25) 1px, transparent 1.6px); background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000); mask-image: linear-gradient(90deg, transparent, #000); }
.closer .sub { margin-bottom: 32px; }

/* ── подвал ────────────────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--rail); padding: 40px 0; color: var(--mist); font-size: .9rem; }
.foot-in { max-width: 1400px; margin: 0 auto; padding: 0 24px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px 48px; }
.foot-brand img { width: 130px; height: 18px; image-rendering: pixelated; margin-bottom: 10px; }
.foot-brand p { margin: 0; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-left: auto; }
.foot-nav a { color: var(--mist); text-decoration: none; }
.foot-nav a:hover { color: var(--paper); }
.foot-copy { width: 100%; margin: 0; color: #6c7a96; }

/* ── документация ──────────────────────────────────────────────────── */
.docs-in { max-width: 1400px; margin: 0 auto; padding: 36px 24px 96px; display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 220px; gap: 56px; align-items: start; }
.side { position: sticky; top: calc(var(--top) + 20px); z-index: 20; display: flex; flex-direction: column; max-height: calc(100vh - var(--top) - 40px); }
.tree-box { min-height: 0; overflow: auto; padding: 0 4px 0 10px; margin-left: -10px; scrollbar-width: thin; }
.tree-box > summary { display: none; }
.search { position: relative; margin-bottom: 18px; }
.search input { width: 100%; font: 500 .92rem var(--sans); color: var(--paper); background: var(--deck); border: 1px solid var(--rail-hi);
  border-radius: 9px; padding: 9px 36px 9px 12px; outline: none; transition: border-color .15s; }
.search input:focus { border-color: var(--flow); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { position: absolute; right: 10px; top: 9px; pointer-events: none; }
.hits { position: absolute; left: 0; top: calc(100% + 6px); width: min(420px, 86vw); z-index: 30; list-style: none; margin: 0; padding: 6px;
  background: var(--deck); border: 1px solid var(--rail-hi); border-radius: 12px; max-height: 60vh; overflow: auto; box-shadow: 0 18px 40px rgba(0, 0, 0, .45); }
.hits a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--paper); text-decoration: none; }
.hits a small { display: block; color: var(--mist); font-size: .78rem; }
.hits a span { display: block; color: var(--mist); font-size: .84rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hits a mark { background: rgba(106, 166, 250, .25); color: var(--paper); border-radius: 3px; }
.hits [aria-selected="true"] a, .hits a:hover { background: var(--rail); }
.hits .empty { padding: 10px; color: var(--mist); font-size: .9rem; }
.tree h2 { font-family: var(--sans); font-weight: 650; font-size: .86rem; color: var(--paper); margin: 22px 0 6px; }
.tree h2:first-child { margin-top: 4px; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 7px; color: var(--mist); text-decoration: none; font-size: .92rem; line-height: 1.4; }
.tree a:hover { color: var(--paper); background: rgba(255, 255, 255, .03); }
.tree a[aria-current] { color: var(--paper); background: rgba(106, 166, 250, .1); box-shadow: inset 2px 0 var(--flow); }

.doc { min-width: 0; max-width: 780px; }
.crumb { font-size: .86rem; color: var(--mist); margin-bottom: 14px; }
.crumb a { color: var(--mist); }
.doc h1 { font-size: 44px; line-height: 1.25; margin-bottom: 24px; }
.doc .lead { margin: 0 0 40px; }
.prose { color: var(--body); }
.prose h2 { font-family: var(--sans); font-weight: 700; font-size: 1.45rem; line-height: 1.3; margin: 52px 0 14px; }
.prose h3 { font-size: 1.12rem; margin: 34px 0 10px; }
.prose h2:first-child { margin-top: 8px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--mist); }
.prose strong { color: var(--paper); font-weight: 650; }
.prose code { font: 500 .86em var(--mono); color: var(--paper); background: var(--deck); border: 1px solid var(--rail); padding: 1px 6px; border-radius: 5px; }
.prose pre { position: relative; margin: 20px 0; padding: 16px 18px; background: #0a101c; border: 1px solid var(--rail); border-radius: 10px; overflow-x: auto; line-height: 1.55; }
.prose pre code { font-size: .84rem; background: none; border: 0; padding: 0; color: #d6def0; }
.copy { position: absolute; top: 8px; right: 8px; font: 600 .76rem var(--sans); color: var(--mist); background: var(--deck);
  border: 1px solid var(--rail-hi); border-radius: 7px; padding: 4px 9px; cursor: pointer; opacity: 0; transition: opacity .15s, color .15s; }
.prose pre:hover .copy, .copy:focus-visible { opacity: 1; }
.copy[data-done] { color: var(--license); opacity: 1; }
.prose table { margin: 20px 0; font-size: .94rem; display: block; overflow-x: auto; }
.prose td, .prose th { overflow-wrap: anywhere; }
.prose blockquote { margin: 20px 0; padding: 4px 18px; border-left: 3px solid var(--rail-hi); color: var(--mist); }
.admonition { margin: 22px 0; padding: 14px 18px; border-radius: 10px; background: var(--deck); border: 1px solid var(--rail); border-left: 3px solid var(--flow); }
.admonition.warning { border-left-color: var(--auditor); }
.admonition.tip { border-left-color: var(--license); }
.admonition > p:last-child { margin-bottom: 0; }
.admonition-title { font-weight: 650; color: var(--paper); margin-bottom: 4px; }
.prose a { color: var(--flow); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--rail); }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--rail-hi); border-radius: 12px; color: var(--paper); text-decoration: none; font-weight: 600; transition: border-color .15s, background .15s; }
.pager a:hover { border-color: var(--flow); background: rgba(106, 166, 250, .05); }
.pager small { display: block; color: var(--mist); font-weight: 500; font-size: .8rem; margin-bottom: 2px; }
.pager .next { text-align: right; grid-column: 2; }
.toc { position: sticky; top: calc(var(--top) + 20px); font-size: .86rem; }
.toc h2 { font-family: var(--sans); font-weight: 650; font-size: .86rem; color: var(--paper); margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 12px; }
.toc a { display: block; padding: 4px 0 4px 12px; color: var(--mist); text-decoration: none; border-left: 1px solid var(--rail); line-height: 1.4; }
.toc a:hover { color: var(--paper); }
.toc a.is-active { color: var(--paper); border-left-color: var(--flow); }
.docindex { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 40px; }
.docindex h2 { font-size: 22px; margin-bottom: 8px; }
.docindex a { display: block; padding: 12px 0; border-bottom: 1px solid var(--rail); text-decoration: none; }
.docindex b { display: block; color: var(--paper); font-weight: 600; }
.docindex span { display: block; color: var(--mist); font-size: .88rem; }
.docindex a:hover b { color: var(--flow); }

/* ── узкие экраны ──────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .docs-in { grid-template-columns: 230px minmax(0, 1fr); gap: 44px; }
  .toc { display: none; }
  .top-in { gap: 20px; }
  .nav { gap: 0; }
  .nav a { padding: 8px 9px; }
  .top .cab-label { display: none; }
  .top .cab-short { display: inline; }
  .hero h1 { font-size: 44px; }
  .hero-in { gap: 24px; }
}
/* Меню прячется в бургер раньше, чем ломается сетка: семь пунктов и кнопка
   кабинета перестают помещаться в одну строку около 1000px. */
@media (max-width: 1000px) {
  .burger { display: flex; }
  .nav { position: absolute; left: 0; right: 0; top: var(--top); flex-direction: column; gap: 0; margin: 0; padding: 8px 16px 16px;
    background: rgba(12, 19, 34, .97); border-bottom: 1px solid var(--rail); display: none; }
  .nav[data-open] { display: flex; }
  .nav a { padding: 12px 8px; border-radius: 0; border-bottom: 1px solid var(--rail); font-size: 1rem; }
  .nav a[aria-current] { box-shadow: inset 2px 0 var(--flow); }
}
@media (max-width: 940px) {
  .hero { padding: 40px 0 56px; }
  .hero-in { grid-template-columns: 1fr; gap: 16px; }
  .hero-copy { max-width: 640px; }
  .hero-mark { width: min(100%, 520px); justify-self: center; }
  .split { grid-template-columns: 1fr; gap: 40px; }
  .split-head { position: static; }
  .parts { grid-template-columns: 1fr; border-top: 0; }
  .part { padding: 32px 0 8px; border-top: 1px solid var(--rail); }
  .part + .part::after { display: none; }
  .scan { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  /* Поток по вертикали: рельс слева, по нему сверху вниз едут те же пиксели. */
  .flow { margin-top: 48px; }
  .flow-track { left: 6px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; background: none; }
  .flow-track .px { left: -3px; top: 0; }
  .flow-stops { grid-template-columns: 1fr; gap: 0; padding-left: 7px; border-left: 2px solid var(--rail-hi); margin-left: 6px; }
  .flow-stops li { padding: 0 0 26px 26px; }
  .flow-stops li:last-child { padding-bottom: 4px; }
  .flow-stops li::before { left: -15px; top: 4px; }
  .docs-in { grid-template-columns: 1fr; gap: 28px; padding-top: 24px; }
  .side { position: static; max-height: none; }
  .tree-box { overflow: visible; border: 1px solid var(--rail-hi); border-radius: 10px; padding: 0 14px; margin-left: 0; }
  .tree-box > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; padding: 11px 0; font-weight: 600; color: var(--paper); }
  .tree-box > summary::-webkit-details-marker { display: none; }
  .tree-box > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--mist); border-bottom: 2px solid var(--mist); transform: rotate(45deg); transition: transform .2s; }
  .tree-box[open] > summary::after { transform: rotate(225deg); }
  .tree-box[open] { padding-bottom: 12px; }
  .tree { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
  .tree h2 { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .lead { font-size: 1rem; line-height: 1.55; margin: 20px 0 28px; }
  .hero { padding: 28px 0 40px; }
  .hero h1 { font-size: 33px; }
  .hero-mark { width: calc(100% + 16px); margin: 0 -8px; }
  .band h2, .doc h1 { font-size: 33px; }
  .part h3 { font-size: 22px; }
  .steps b::before { font-size: 33px; }
  .wrap, .top-in, .foot-in, .docs-in { padding-left: 16px; padding-right: 16px; }
  .top-in { gap: 12px; }
  .cab { height: 40px; padding: 0 12px 0 10px; gap: 9px; border-radius: 10px; }
  .cab.big { display: flex; width: 100%; height: auto; min-height: 52px; padding: 10px 16px; justify-content: center;
    white-space: normal; text-align: left; line-height: 1.25; }
  /* Кнопки первого экрана и призыва - во всю ширину, одинаковые: так в них проще попасть пальцем. */
  .cta { flex-direction: column; }
  .cta .btn, .closer .btn { width: 100%; justify-content: center; padding: 15px 22px; }
  .band { padding: 64px 0; }
  .flow { margin-top: 36px; }
  .sub { margin-top: 14px; }
  .parts, .scan, .steps { margin-top: 40px; }
  .caps, .scan, .docindex, .tree { grid-template-columns: 1fr; }
  .closer { padding: 30px 20px 22px; border-radius: 14px; }
  .closer::after { display: none; }
  .band.last { padding-bottom: 72px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .foot-nav { margin-left: 0; }
  /* Таблица документации на телефоне - стопкой: строка становится карточкой,
     у каждого значения подпись из шапки. Иначе правая колонка уезжает за край. */
  .prose table[data-stack] { display: block; overflow: visible; }
  .prose table[data-stack] thead { display: none; }
  .prose table[data-stack] tbody, .prose table[data-stack] tr, .prose table[data-stack] td { display: block; width: 100%; }
  .prose table[data-stack] tr { padding: 12px 0; border-bottom: 1px solid var(--rail); }
  .prose table[data-stack] tr:first-child { border-top: 1px solid var(--rail-hi); }
  .prose table[data-stack] td { border: 0; padding: 2px 0; }
  .prose table[data-stack] td::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--mist); margin-top: 6px; }
  .prose table[data-stack] td:first-child { color: var(--paper); font-weight: 650; }
  .prose table[data-stack] td:first-child::before { display: none; }
}
@media (max-width: 360px) {
  /* Шапка в 320px: кнопка кабинета - только знак SF, подпись в aria-label. */
  .top .cab-short { display: none; }
  .top .cab { padding: 0 9px; }
  .hero h1 { font-size: 30px; }
  .band h2, .doc h1 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .px { display: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
  @view-transition { navigation: none; }
}
