/* Сайт ТРЭК. Визуальный язык — генератор статей docs/gtm/articles/modules/build-site.cjs
   (палитра, шрифты, каркас, типографика). От приложений взяты только метки продуктов:
   плитка с глифом из favicon.svg и вордмарк — как BrandMark, эталон docs/uikit/logo-gallery.html (B1).
   Рамок у блоков нет: блоки отделяются подложкой, тонкие линии — только между строками списков и таблиц. */
/* Шрифты — локальные копии (fonts/, OFL-1.1, см. fonts/LICENSE-OFL.txt): внешних шрифтовых
   сервисов нет. Начертания 400 и 500, подмножества cyrillic и latin — диапазоны как у @fontsource. */
@font-face { font-family: "Geologica"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/geologica-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Geologica"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/geologica-latin-400-normal.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: "Geologica"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/geologica-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Geologica"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/geologica-latin-500-normal.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: "Golos Text"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/golos-text-cyrillic-400-normal.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; font-display: swap; src: url(/fonts/golos-text-latin-400-normal.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: "Golos Text"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/golos-text-cyrillic-500-normal.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: 500; font-display: swap; src: url(/fonts/golos-text-latin-500-normal.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 {
  --paper: #fcfcfb;
  --surface: #f4f5f3;
  --surface-2: #eceeeb;
  --ink: #22272b;
  --ink-2: #454d54;
  --muted: #676f77;
  --rule: #e4e7e3;
  --accent-soft: #eaf1fa;
  --asphalt: #2b3035;
  --asphalt-ink: #eef0f1;
  --asphalt-muted: #aab2b9;
  --marking: #d49a1c;
  /* Главная кнопка на светлой бумаге (шапка, таб-бар): горчичный --marking на белом грязнит — в светлой теме синяя */
  --cta: var(--accent); --cta-ink: #fff;
  --accent: #1d5ba8;
  --door: #f1f6fc;
  --door-edge: #d6e3f3;
  --door-ink: #113b70;
  --display: "Geologica", "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Разметка — мелкий пунктир: штрих 3px, зазор 3px */
  --dash-marking: repeating-linear-gradient(90deg, var(--marking) 0 3px, transparent 3px 6px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #121517; --surface: #181c1f; --surface-2: #1f2427; --ink: #e5e8ea; --ink-2: #c2c8cd; --muted: #8d969e;
    --rule: #2a3035; --asphalt: #0b0d0f; --asphalt-ink: #e5e8ea; --asphalt-muted: #8d969e;
    --marking: #e0ad3f; --cta: #e0ad3f; --cta-ink: #1c1f22; --accent: #7fb1ee;
    --door: #16263a; --door-edge: #294466; --door-ink: #cfe0f6; --accent-soft: #1b2a3c;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121517; --surface: #181c1f; --surface-2: #1f2427; --ink: #e5e8ea; --ink-2: #c2c8cd; --muted: #8d969e;
  --rule: #2a3035; --asphalt: #0b0d0f; --asphalt-ink: #e5e8ea; --asphalt-muted: #8d969e;
    --marking: #e0ad3f; --cta: #e0ad3f; --cta-ink: #1c1f22; --accent: #7fb1ee;
  --door: #16263a; --door-edge: #294466; --door-ink: #cfe0f6; --accent-soft: #1b2a3c;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.65 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ─── Метка продукта (BrandMark / logo-gallery B1) ─── */
.mark { --p: var(--pa); --tile-mix: 11%; --block-mix: 4.5%; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark { --p: var(--pa-dark); --tile-mix: 20%; --block-mix: 6%; }
}
:root[data-theme="dark"] .mark { --p: var(--pa-dark); --tile-mix: 20%; --block-mix: 6%; }
.lockup { display: inline-flex; align-items: center; gap: 10px; min-width: 0; vertical-align: middle; }
.tile { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--p) var(--tile-mix), transparent); }
.tile svg { display: block; width: 21px; height: 21px; fill: var(--p); }
.wm { white-space: nowrap; letter-spacing: -0.015em; }
.wm-umbrella { font-weight: 400; color: var(--muted); }
.wm-dot { font-weight: 400; color: var(--p); }
.wm-name { font-weight: 500; color: var(--ink); }
.lockup-sm .tile { width: 30px; height: 30px; border-radius: 9px; }
.lockup-sm .tile svg { width: 19px; height: 19px; }
.lockup-xs { gap: 7px; }
.lockup-xs .tile { width: 22px; height: 22px; border-radius: 7px; }
.lockup-xs .tile svg { width: 14px; height: 14px; }
.lockup-xl { gap: 14px; }
.lockup-xl .tile { width: 54px; height: 54px; border-radius: 15px; }
.lockup-xl .tile svg { width: 33px; height: 33px; }
.lockup-xl .wm { white-space: normal; }

/* ─── Каркас: шапка с меню и один широкий контейнер по центру. Внутри — блоки
   лендинга (сетки тизеров, две колонки); длинный текст держит меру чтения ─── */
.col { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 40px; }
.site-head { position: sticky; top: 0; z-index: 40; padding-block: 14px; background: color-mix(in srgb, var(--paper) 94%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); transition: box-shadow .2s; }
/* Липкая шапка (план 138, З1): тень появляется, когда под ней поехала страница. */
.site-head.is-scrolled { box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 8%, transparent), 0 10px 24px -18px rgba(10, 14, 18, .35); }
html { scroll-padding-top: 84px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; flex-wrap: wrap; }
.brand { position: relative; display: inline-flex; text-decoration: none; color: var(--ink); }
.brand-mark { font: 500 1.5rem/1 var(--display); letter-spacing: 0.02em; }
/* Пунктир — вне потока: иначе бренд выше пунктов меню и строка шапки «кривая». */
.brand-lane { position: absolute; left: 0; top: calc(100% + 8px); height: 2px; width: 69px; background: var(--dash-marking); }
.site-nav { display: flex; gap: 4px; }
.nav-link { padding: 6px 12px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 0.95rem; line-height: 1.35; white-space: nowrap; }
.nav-link:hover { background: var(--surface); color: var(--ink); }
.nav-link[aria-current] { background: var(--accent-soft); color: var(--accent); }
.head-actions { display: flex; align-items: center; gap: 10px; }
/* Главная кнопка — --cta: в светлой теме синяя (горчичный на белой шапке грязнит), в тёмной — цветом разметки. */
.btn.head-cta { background: var(--cta); color: var(--cta-ink); }
.btn.head-cta:hover { background: color-mix(in srgb, var(--cta) 86%, #fff); }
/* «Войти» — квадратная иконка высотой с главную кнопку (её padding 9px + строка 1.2em), белая: второстепенная рядом с главной;
   обводка — чтобы не терялась на светлой шапке. */
.btn.head-login { box-sizing: border-box; width: calc(18px + 1.2em); height: calc(18px + 1.2em); padding: 0; justify-content: center; background: #fff; color: #1c1f22; box-shadow: inset 0 0 0 1px rgb(28 31 34 / 14%); }
.btn.head-login:hover { background: #f1f2f0; }
.btn.head-login svg { width: 20px; height: 20px; fill: currentColor; }
/* Тема — тихая полупрозрачная кнопка без подложки, глиф — солнце в обеих темах. */
.btn.head-theme { box-sizing: border-box; width: calc(18px + 1.2em); height: calc(18px + 1.2em); padding: 0; justify-content: center; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; opacity: 0.55; transition: opacity .15s; }
.btn.head-theme:hover, .btn.head-theme:focus-visible { background: var(--surface); color: var(--ink); opacity: 1; }
.btn.head-theme svg { width: 20px; height: 20px; fill: currentColor; }
/* На тёмной шапке чистый белый слепит рядом с жёлтой — приглушённый светло-серый. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.head-login { background: #c9ccc8; box-shadow: none; }
  :root:not([data-theme="light"]) .btn.head-login:hover { background: #d8dbd7; }
}
:root[data-theme="dark"] .btn.head-login { background: #c9ccc8; box-shadow: none; }
:root[data-theme="dark"] .btn.head-login:hover { background: #d8dbd7; }
.burger { display: none; width: 44px; height: 44px; margin-right: -10px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--ink); cursor: pointer; place-content: center; gap: 5px; }
.burger span { display: block; width: 22px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
.is-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.is-open .burger span:nth-child(2) { opacity: 0; }
.is-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Нижняя панель телефона — «таблетка», как в Аккаунте (план 138, Р37). На
   десктопе её нет: там всё в шапке. */
.tabbar { display: none; }
main.col { padding-block: 64px 0; }
.measure { max-width: 760px; }

/* Статья: заголовок во всю ширину, под ним колонка чтения и боковая колонка */
.page-grid { display: grid; grid-template-columns: minmax(0, 760px) 280px; justify-content: space-between; gap: 64px; }
.page-aside { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; scrollbar-width: thin; display: flex; flex-direction: column; gap: 28px; }
.aside-title { font: 500 0.95rem/1.35 var(--display); color: var(--ink); margin-bottom: 8px; }
.aside-text { margin: 0 0 12px; font-size: 0.92rem; line-height: 1.5; color: var(--ink-2); }
.page-aside .link-list a { padding: 10px 0; font-size: 0.93rem; }
.page-main .prose > :first-child { margin-top: 0; }

/* ─── Статья ─── */
/* Подписи над заголовками — тихие: обычный шрифт, без капса */
.eyebrow { font: 400 0.88rem/1.4 var(--body); color: var(--muted); }
h1 { font: 500 clamp(1.9rem, 4vw, 2.6rem)/1.12 var(--display); letter-spacing: -0.015em; margin: 10px 0 16px; text-wrap: balance; }
.lede { font-size: 1.22rem; line-height: 1.5; color: var(--ink-2); margin: 0 0 8px; max-width: 40em; text-wrap: pretty; }
.article-head { max-width: 900px; padding-bottom: 12px; margin-bottom: 20px; }
.head-mark { display: inline-flex; margin-top: 14px; font: 500 1.1rem/1.2 var(--display); text-decoration: none; }
.head-mark + h1 { margin-top: 14px; }

.prose h2, .section h2 { font: 500 1.35rem/1.3 var(--display); letter-spacing: -0.005em; margin: 2.4em 0 0.7em; text-wrap: balance; }
.prose h2::before, .section h2::before { content: ""; display: block; width: 51px; height: 2px; margin-bottom: 14px; background: var(--dash-marking); }
.prose h3 { font: 500 1.08rem/1.35 var(--display); margin: 1.8em 0 0.5em; }
.prose h4 { font: 500 1rem/1.4 var(--display); color: var(--ink-2); margin: 1.5em 0 0.4em; }
.prose p { margin: 0 0 1em; text-wrap: pretty; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--muted); }
.prose strong { font-weight: 500; color: var(--ink); }
.prose hr { border: 0; height: 1px; background: var(--rule); margin: 2em 0; }
.prose blockquote { margin: 1.4em 0; padding: 12px 18px; border-radius: 8px; background: var(--surface); color: var(--ink-2); }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code { font: 0.88em var(--mono); background: var(--surface); padding: 1px 5px; border-radius: 4px; }
.prose pre { overflow-x: auto; background: var(--surface); padding: 12px 16px; border-radius: 8px; }
.prose pre code { padding: 0; background: none; }
/* Снимок экрана: на ширину колонки, подпись — тихая */
.prose figure { margin: 1.8em 0 2em; }
.prose figure img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 28px rgb(0 0 0 / 0.08); }
.prose figcaption { margin-top: 10px; font-size: 0.86rem; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
/* Схема (SVG из _build/diagrams/, вставляется в страницу): узлы — подложки без рамок, продукт —
   заливка тоном кнопки продукта (--pa-btn), смежные системы — нейтральные, зоны — тонированные поля
   с «разметкой» у подписи. Всё на токенах темы, поэтому тёмная тема работает сама. */
.prose .dg { margin: 2em 0 2.2em; overflow-x: auto; }
.dg svg { display: block; width: 100%; min-width: 640px; height: auto; font-family: var(--body); }
.dg .b { fill: color-mix(in srgb, var(--p, var(--accent)) 8%, var(--paper)); }
.dg .tile { fill: color-mix(in srgb, var(--p, var(--accent)) 17%, var(--paper)); }
.dg .ic { fill: none; stroke: color-mix(in srgb, var(--p, var(--accent)) 72%, var(--ink)); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dg .t { fill: var(--ink); font: 500 14.5px/1 var(--display); }
.dg .s { fill: var(--muted); font-size: 12.5px; }
.dg .c { text-anchor: middle; }
.dg .core .b { fill: var(--pa-btn, var(--accent)); }
.dg .core .tile { fill: rgb(255 255 255 / 0.17); }
.dg .core .ic { stroke: #fff; }
.dg .core .t { fill: #fff; }
.dg .core .s { fill: rgb(255 255 255 / 0.78); }
.dg .ext .b { fill: color-mix(in srgb, var(--ink) 5%, var(--paper)); }
.dg .ext .tile { fill: color-mix(in srgb, var(--ink) 9%, var(--paper)); }
.dg .ext .ic { stroke: var(--muted); }
.dg .ext .t { fill: var(--ink-2); font-weight: 400; }
.dg .z { fill: color-mix(in srgb, var(--ink) 3.5%, transparent); }
.dg .zt { fill: var(--muted); font: 500 10.5px var(--mono); letter-spacing: 0.09em; text-transform: uppercase; }
.dg .zm { stroke: var(--marking); stroke-width: 2; stroke-dasharray: 3 3; }
.dg .e { fill: none; stroke: color-mix(in srgb, var(--ink) 40%, var(--paper)); stroke-width: 1.6; stroke-linejoin: round; }
.dg .ah { fill: color-mix(in srgb, var(--ink) 40%, var(--paper)); }
.dg .el { fill: var(--ink-2); font-size: 12px; paint-order: stroke; stroke: var(--paper); stroke-width: 5px; stroke-linejoin: round; }
.dg .note { fill: var(--muted); font-size: 12.5px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dg .core .b { fill: var(--p, var(--accent)); }
  :root:not([data-theme="light"]) .dg .core :is(.ic) { stroke: #121517; }
  :root:not([data-theme="light"]) .dg .core .t { fill: #121517; }
  :root:not([data-theme="light"]) .dg .core .s { fill: rgb(18 21 23 / 0.72); }
  :root:not([data-theme="light"]) .dg .core .tile { fill: rgb(0 0 0 / 0.12); }
}
:root[data-theme="dark"] .dg .core .b { fill: var(--p, var(--accent)); }
:root[data-theme="dark"] .dg .core .ic { stroke: #121517; }
:root[data-theme="dark"] .dg .core .t { fill: #121517; }
:root[data-theme="dark"] .dg .core .s { fill: rgb(18 21 23 / 0.72); }
:root[data-theme="dark"] .dg .core .tile { fill: rgb(0 0 0 / 0.12); }

.table-wrap { overflow-x: auto; margin: 1.2em 0 1.6em; border-top: 1px solid var(--rule); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.93rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.prose th { text-align: left; font: 500 0.82rem/1.4 var(--body); color: var(--muted); padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: bottom; }
.prose td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose td:first-child { color: var(--ink); min-width: 9em; }
.docs-table td { vertical-align: middle; }
.mark-link { text-decoration: none; }

/* «Дверь» к соседнему модулю: только подложка */
.door { background: var(--door); color: var(--door-ink); border-radius: 10px; padding: 18px 20px 16px; margin: 1.6em 0; display: flex; flex-direction: column; gap: 6px; }
.door-eyebrow { font: 400 0.84rem/1.4 var(--body); opacity: 0.75; }
.door-title { font: 500 1.08rem/1.35 var(--display); }
.door .door-teaser { margin: 0; font-size: 0.97rem; line-height: 1.5; }
.door-link { align-self: flex-start; margin-top: 4px; font-weight: 500; color: var(--door-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.door-link:hover { text-decoration-thickness: 2px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.4em 0 0.4em; }
.btn { display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 8px; background: var(--surface); color: var(--accent); text-decoration: none; font-weight: 500; font-size: 0.97rem; line-height: 1.2; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent-soft); }
.btn-primary:hover { background: var(--door-edge); }

.toc { padding: 14px 18px; background: var(--surface); border-radius: 8px; }
.toc summary { cursor: pointer; font: 500 0.95rem/1.4 var(--display); color: var(--ink); }
.toc ol { margin: 10px 0 2px; padding-left: 1.4em; font-size: 0.9rem; line-height: 1.45; }
.toc li { margin-bottom: 0.45em; }
.toc li::marker { color: var(--muted); }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* Галерея «Иллюстрации» в боковой колонке: миниатюры на всю ширину колонки, по одной в строке;
   клик подлетает к большому снимку (#fig-N). Свёрнута по умолчанию, как .toc (DETAILS_OPEN). */
.fig-gallery { padding: 14px 18px; background: var(--surface); border-radius: 8px; }
.fig-gallery summary { cursor: pointer; font: 500 0.95rem/1.4 var(--display); color: var(--ink); }
.fig-thumbs { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.fig-thumb { display: block; text-decoration: none; }
.fig-num { display: block; margin-bottom: 5px; font: 500 0.78rem/1.3 var(--body); color: var(--muted); }
.fig-thumb img { display: block; width: 100%; height: auto; border-radius: 6px; background: var(--surface-2); transition: transform 0.15s ease, opacity 0.15s ease; }
.fig-thumb:hover img { transform: translateY(-2px); opacity: 0.88; }
.fig-thumb:focus-visible img { transform: translateY(-2px); }

/* Клик по миниатюре — плавный переход к большому снимку и краткая подсветка цели. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
.prose figure { scroll-margin-top: 96px; }
.prose figure:target img { animation: fig-target-pulse 1s ease-out; }
@keyframes fig-target-pulse {
  0% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 45%, transparent), 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 28px rgb(0 0 0 / 0.08); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent), 0 1px 2px rgb(0 0 0 / 0.06), 0 8px 28px rgb(0 0 0 / 0.08); }
}
@media (prefers-reduced-motion: reduce) {
  .prose figure:target img { animation: none; }
}

/* Списки ссылок: линии только между строками */
.link-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.link-list li { border-bottom: 1px solid var(--rule); }
.link-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 0; color: var(--ink); text-decoration: none; }
.link-list a::after { content: "→"; color: var(--muted); }
.link-list a:hover { color: var(--accent); }
.link-list a:hover::after { color: var(--accent); }

/* ─── Блоки лендинга ─── */
.overview-head { max-width: 860px; margin-bottom: 40px; }
.overview-head h1 { font-size: clamp(2.2rem, 5vw, 3.3rem); }
.section { margin-top: 72px; }
.section h2 { margin-top: 0; }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-3 > :last-child:nth-child(3n+1) { grid-column: 1 / -1; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 64px; align-items: start; }
.split p { margin: 0 0 1em; color: var(--ink-2); max-width: 34em; }
.split .link-list { margin-top: 44px; }

/* Схема линейки: агент сверху, модули в три колонки стоят на основании —
   подписи колонок в одну линию, блоки прижаты к низу и стоят на плите основания через тонкий зазор.
   Подложка каждого блока — светлый тон акцента своего продукта (как у метки). */
/* Дерево модулей (как схема в draw.io): Основание — плита во всю ширину внизу, модули стоят
   на ней, к каждому от плиты — линия со стрелкой вверх. Строки сетки общие (subgrid), поэтому
   все плитки одного размера, а подписи групп — на одной линии. Линии — непрозрачные: на стыках
   не темнеют. Строки снизу вверх: Основание, подпись группы, модуль, зазор, дочерний модуль. */
.tree { --tl: color-mix(in srgb, var(--ink) 30%, var(--paper)); --tw: 1.5px; --tg: 28px; --tx: 50%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1fr var(--tg) 1fr auto auto; column-gap: var(--tg); }
.tree-root { grid-column: 1 / -1; grid-row: 5; }
.tree-branch { grid-column: var(--col); grid-row: 1 / span 4; display: grid; grid-template-rows: subgrid; }
/* Линии и стрелки — по центру колонки (--tx): от плиты Основания сквозь строку подписи до
   модуля. Подпись — под модулем, правее линии, по центру зазора до плиты по высоте. */
.tree-label { grid-row: 4; position: relative; display: flex; align-items: center; padding: 18px 0 18px calc(var(--tx) + 14px); font: 400 0.84rem/1.4 var(--body); color: var(--muted); }
.tree-label::after { content: ""; position: absolute; left: calc(var(--tx) - var(--tw) / 2); top: 0; bottom: 0; width: var(--tw); background: var(--tl); }
.tree-node { position: relative; grid-row: 3; }
.tree-child { grid-row: 1; }
/* Стрелка в низ плитки; к дочерней — ещё линия от родителя. */
.tree-node::before { content: ""; position: absolute; left: calc(var(--tx) - 5px); bottom: -7px; border: solid transparent; border-width: 0 5px 7px; border-bottom-color: var(--tl); }
.tree-child::after { content: ""; position: absolute; left: calc(var(--tx) - var(--tw) / 2); top: calc(100% + 7px); height: calc(var(--tg) - 7px); width: var(--tw); background: var(--tl); }
/* MCP-доступ — над РоадХабом, в первой строке третьей колонки. Линия от Основания идёт по
   зазору между колонками мимо РоадХаба и входит в плитку слева. */
@media (min-width: 1101px) {
  /* Плита Основания во всю ширину — содержимое по центру. */
  .tree-root { align-items: center; text-align: center; }
  .tree-root .stack-sub { padding-left: 0; }
  .tree-branch--under { grid-row: 1; grid-template-rows: 1fr; }
  .tree-branch--under .tree-label { display: none; }
  .tree-branch--under .tree-node { grid-row: 1; }
  /* Ветка РоадХаба — только плитка и подпись: иначе её строки заняли бы и место MCP. */
  .tree-branch:has(+ .tree-branch--under) { position: relative; grid-row: 3 / span 2; }
  .tree-branch:has(+ .tree-branch--under) .tree-node { grid-row: 1; }
  .tree-branch:has(+ .tree-branch--under) .tree-label { grid-row: 2; }
  .tree-branch:has(+ .tree-branch--under)::before { content: ""; position: absolute; left: calc(-1 * var(--tg) / 2 - var(--tw) / 2); top: 0; bottom: 0; width: var(--tw); background: var(--tl); }
  .tree-branch--under .tree-node::after { content: ""; position: absolute; left: calc(-1 * var(--tg) / 2 - var(--tw) / 2); top: 50%; width: calc(var(--tg) / 2 - 7px); height: calc(50% + var(--tg)); border: solid var(--tl); border-width: var(--tw) 0 0 var(--tw); border-radius: 6px 0 0 0; }
  .tree-branch--under .tree-node::before { left: -7px; top: calc(50% - 5px); bottom: auto; border-width: 5px 0 5px 7px; border-color: transparent transparent transparent var(--tl); }
}
@media (max-width: 1100px) {
  /* Уже 1100px четыре колонки тесны — дерево как в проводнике — ствол слева под иконкой Основания, к модулю отвод
     со стрелкой; дочерний модуль — с отступом, отвод от иконки родителя. 34px — центр иконки
     плитки (padding 18px + половина иконки). */
  .tree { display: flex; flex-direction: column; }
  .tree-branch { position: relative; display: flex; flex-direction: column; padding-left: 52px; }
  .tree-branch:not(:last-of-type)::before { content: ""; position: absolute; left: calc(34px - var(--tw) / 2); top: 0; bottom: 0; width: var(--tw); background: var(--tl); }
  .tree-label { padding: 14px 0 10px; }
  .tree-label::after { left: calc(-18px - var(--tw) / 2); bottom: 0; }
  .tree-node::before { left: -7px; top: 27px; bottom: auto; border-width: 5px 0 5px 7px; border-color: transparent transparent transparent var(--tl); }
  .tree-node:not(.tree-child)::after, .tree-child::after { content: ""; position: absolute; left: calc(-18px - var(--tw) / 2); top: 0; width: 11px; height: 32px; background: none; border: solid var(--tl); border-width: 0 0 var(--tw) var(--tw); border-radius: 0 0 0 8px; }
  .tree-child { margin: 10px 0 0 52px; }
  .tree-child::after { top: -10px; height: 42px; }
}
.stack-block { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 10px; background: color-mix(in srgb, var(--p) var(--block-mix), transparent); color: var(--ink); text-decoration: none; font: 500 1rem/1.3 var(--display); }
.stack-block:hover { background: color-mix(in srgb, var(--p) calc(var(--block-mix) + 4%), transparent); }
.stack-sub { padding-left: 40px; font: 400 0.88rem/1.45 var(--body); color: var(--muted); }

/* Тизер: блок на подложке, без рамки */
.teaser { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.teaser:hover { background: var(--surface-2); }
.teaser-top { font: 500 1.05rem/1.3 var(--display); }
.teaser-title { font: 500 1.15rem/1.35 var(--display); }
.teaser-text { color: var(--ink-2); font-size: 0.95rem; line-height: 1.55; }
.teaser-foot { margin-top: auto; padding-top: 4px; }
.teaser-offer { padding: 26px 28px; }
.teaser-offer .teaser-title { font-size: 1.3rem; line-height: 1.3; text-wrap: balance; }
.teaser-offer .teaser-text { font-size: 1.02rem; }
.go { font-size: 0.9rem; color: var(--muted); }
.go::after { content: " →"; }
.teaser:hover .go { color: var(--accent); }

/* ─── Хиро главной: полоса «асфальт» во всю ширину окна (вне контейнера, без 100vw),
   контент выровнен по контейнеру. Слева текст, справа живая схема перекрёстка ─── */
.has-hero > .col { padding-block: 0; }
.hero { background: var(--asphalt); color: var(--asphalt-ink); overflow: hidden; }
.hero-row { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 24px 48px; align-items: center; padding-block: 72px 80px; }
.hero-kicker { display: flex; align-items: center; gap: 14px; font: 400 1rem/1.4 var(--body); color: var(--asphalt-muted); }
.hero-kicker::before { content: ""; width: 33px; height: 2px; background: var(--dash-marking); }
.hero h1 { font: 500 clamp(2rem, 3.9vw, 3.15rem)/1.06 var(--display); letter-spacing: -0.028em; color: var(--asphalt-ink); margin: 22px 0 26px; }
.hero-accent { color: var(--marking); }
/* Слово, подчёркнутое пунктиром разметки: штрих 3px, зазор 3px, чуть ниже базовой линии */
.mark-u { background: var(--dash-marking) left calc(100% - 0.02em) / 100% 3px no-repeat; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.nowrap { white-space: nowrap; }
.hero-lede { margin: 0; max-width: 35em; font-size: 1.1rem; line-height: 1.62; color: var(--asphalt-muted); text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero .btn { padding: 14px 22px; border-radius: 10px; font-size: 1rem; }
.btn-marking { background: var(--marking); color: #1c1f22; }
.btn-marking:hover { background: color-mix(in srgb, var(--marking) 86%, #fff); }
.btn-ghost { background: color-mix(in srgb, var(--asphalt-ink) 9%, transparent); color: var(--asphalt-ink); }
.btn-ghost:hover { background: color-mix(in srgb, var(--asphalt-ink) 15%, transparent); }
.hero .btn:focus-visible { outline-color: var(--marking); }
.hero-art { align-self: center; }
.hero-art svg { display: block; width: 128%; height: auto; margin-left: -20%; pointer-events: none; }

/* Шесть фактов под текстом и схемой: иконка линией цвета разметки, заголовок, пояснение */
.hero-facts { grid-column: 1 / -1; list-style: none; margin: 40px 0 0; padding: 44px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 48px; background: linear-gradient(90deg, color-mix(in srgb, var(--asphalt-muted) 22%, transparent), transparent) top / 100% 1px no-repeat; }
.fact { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px 16px; align-content: start; }
.fact svg { grid-row: span 2; width: 24px; height: 24px; margin-top: 1px; fill: none; stroke: var(--marking); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fact-title { font: 500 1.04rem/1.35 var(--display); color: var(--asphalt-ink); }
.fact-text { font-size: 0.9rem; line-height: 1.5; color: var(--asphalt-muted); text-wrap: pretty; }

/* Схема перекрёстка: кромки и полосы — приём «широкая линия под покрытием»: из-под полосы
   покрытия (88) выглядывает кромка, из-под внутренней (44) — штрихи разделителей полос */
.hx { --hx-surface: color-mix(in srgb, var(--asphalt-ink) 4%, var(--asphalt)); --hx-line: color-mix(in srgb, var(--asphalt-muted) 60%, var(--asphalt)); }
.hx path { fill: none; }
.hx-grid { stroke: var(--asphalt-ink); stroke-opacity: 0.07; stroke-width: 1; }
.hx-edge path { stroke: var(--hx-line); stroke-width: 90.4; }
.hx-road path { stroke: var(--hx-surface); stroke-width: 88; }
.hx-road-in path { stroke-width: 44; }
.hx-lane path { stroke: var(--hx-line); stroke-width: 46.2; stroke-dasharray: 10 12; }
.hx .hx-corner { fill: var(--hx-surface); }
.hx-curb { stroke: var(--hx-line); stroke-width: 1.2; }
.hx-axis path { stroke: var(--marking); stroke-width: 1.8; stroke-dasharray: 2.7 2.7; }
.hx-zebra path { stroke: var(--asphalt-ink); stroke-opacity: 0.32; stroke-width: 9; stroke-dasharray: 1.4 4.6; }
.hx-stop path { stroke: var(--asphalt-ink); stroke-opacity: 0.6; stroke-width: 1.6; stroke-linecap: round; }
.hx-car circle { fill: var(--c); }
.hx-glow-in { stop-color: var(--asphalt-ink); stop-opacity: 0.05; }
.hx-glow-out { stop-color: var(--asphalt-ink); stop-opacity: 0; }
.hx-signal { filter: drop-shadow(0 0 3px currentColor); }
.hx-bar rect { opacity: 0.8; }
.hx-label { font: 400 10.5px/1 var(--body); fill: var(--asphalt-muted); text-anchor: end; }
.hx-cursor path { stroke: var(--asphalt-ink); stroke-width: 1.2; stroke-linecap: round; }
@media (prefers-reduced-motion: reduce) {
  .hx-trail, .mh-trail { display: none; }
}

/* ─── Хиро страницы модуля: светлая полоса в тон продукта во всю ширину окна (как хиро главной),
   слева метка, лид статьи и кнопки, справа схема продукта (heroArt.mjs). Акцент — --p метки ─── */
.mhero {
  --mh-bg: color-mix(in srgb, var(--p) 8%, var(--paper)); --mh-bg-2: color-mix(in srgb, var(--p) 3.5%, var(--paper));
  --mh-surface: color-mix(in srgb, var(--p) 3%, #fff); --mh-line: color-mix(in srgb, var(--ink) 28%, transparent);
  --mh-btn: var(--pa-btn, color-mix(in srgb, var(--p) 84%, #15191c)); --mh-on-p: #fff;
  margin-top: 26px; background: linear-gradient(100deg, var(--mh-bg-2) 0%, var(--mh-bg) 55%); overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mhero { --mh-bg: color-mix(in srgb, var(--p) 9%, var(--paper)); --mh-bg-2: color-mix(in srgb, var(--p) 4%, var(--paper)); --mh-surface: color-mix(in srgb, var(--p) 7%, #1c2125); --mh-btn: var(--p); --mh-on-p: #121517; }
}
:root[data-theme="dark"] .mhero { --mh-bg: color-mix(in srgb, var(--p) 9%, var(--paper)); --mh-bg-2: color-mix(in srgb, var(--p) 4%, var(--paper)); --mh-surface: color-mix(in srgb, var(--p) 7%, #1c2125); --mh-btn: var(--p); --mh-on-p: #121517; }
.mhero-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px; align-items: center; padding-block: 60px 64px; }
.mhero-mark { font: 500 1.9rem/1 var(--display); }
.lockup-hero { gap: 16px; }
.lockup-hero .tile { width: 58px; height: 58px; border-radius: 16px; }
.lockup-hero .tile svg { width: 35px; height: 35px; }
.mhero h1 { font: 500 clamp(1.9rem, 3.2vw, 2.7rem)/1.1 var(--display); letter-spacing: -0.024em; color: var(--ink); margin: 34px 0 20px; }
.mhero h1.mhero-long { font-size: clamp(1.7rem, 2.6vw, 2.2rem); line-height: 1.14; }
.inmark { white-space: nowrap; }
.inmark .tile { display: inline-grid; width: 0.9em; height: 0.9em; border-radius: 0.26em; vertical-align: -0.1em; margin-right: 0.2em; }
.inmark .tile svg { width: 0.58em; height: 0.58em; }
.mhero-lede { margin: 0; max-width: 33em; font-size: 1.1rem; line-height: 1.6; color: var(--ink-2); text-wrap: pretty; }
.mhero .hero-actions { margin-top: 34px; }
.mhero .btn { padding: 14px 22px; border-radius: 10px; font-size: 1rem; }
.btn-product { background: var(--mh-btn); color: var(--mh-on-p); }
.btn-product:hover { background: color-mix(in srgb, var(--mh-btn) 86%, var(--ink)); }
.btn-soft { background: color-mix(in srgb, var(--p) 11%, transparent); color: var(--ink); }
.btn-soft:hover { background: color-mix(in srgb, var(--p) 17%, transparent); }
.mhero .btn:focus-visible { outline-color: var(--p); }
.mhero-art svg { display: block; width: 112%; height: auto; margin-left: -4%; pointer-events: none; }
.has-hero > .col > .page-grid:first-child { margin-top: 64px; }

/* Схемы продуктов: линии 1–1.6, скруглённые концы; покрытие светлее фона, кромки нейтральные,
   разметка — пунктир цвета --marking, всё предметное — цветом продукта */
.mh path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mh-grid { stroke: var(--ink); stroke-opacity: 0.05; stroke-width: 1; }
.mh .mh-surface, .mh-surface path { fill: var(--mh-surface); }
.mh-kerb path, .mh path.mh-kerb { stroke: var(--mh-line); stroke-width: 1.2; }
.mh-divider path { stroke: var(--mh-line); stroke-width: 1; stroke-dasharray: 8 10; }
.mh .mh-axis, .mh-axis path { stroke: var(--marking); stroke-width: 1.6; stroke-dasharray: 2.7 2.7; stroke-linecap: butt; }
.mh-stop path { stroke: var(--ink); stroke-opacity: 0.45; stroke-width: 1.6; }
.mh-zebra path { stroke: var(--ink); stroke-opacity: 0.18; stroke-width: 9; stroke-dasharray: 1.4 4.6; stroke-linecap: butt; }
.mh-edge path, .mh-arrow path { stroke: var(--p); stroke-width: 1.4; }
.mh-foundation path, .mh-foundation circle { vector-effect: non-scaling-stroke; }
.mh-foundation .mh-edge path { stroke-width: 1.8; }
.mh-foundation .mh-move path { stroke-width: 1.3; }
.mh-foundation .mh-chev { stroke-width: 1.7; }
.mh-arrow-soft path { stroke-opacity: 0.4; }
.mh-move path { stroke: var(--p); stroke-width: 1.1; stroke-opacity: 0.5; }
.mh-conflict circle { fill: var(--mh-surface); stroke: var(--p); stroke-width: 1.3; }
.mh-osm path { stroke: color-mix(in srgb, var(--ink) 55%, transparent); stroke-width: 2.4; }
.mh-node circle { fill: var(--mh-surface); stroke: color-mix(in srgb, var(--ink) 60%, transparent); stroke-width: 1.6; }
.mh-ctx path { stroke: var(--mh-line); stroke-width: 1; stroke-opacity: 0.6; }
.mh-halo circle { fill: var(--ink); fill-opacity: 0.04; stroke: var(--ink); stroke-opacity: 0.14; stroke-width: 0.8; }
.mh-ping-raw { fill: color-mix(in srgb, var(--ink) 48%, transparent); }
.mh-ping, .mh-car circle, .mh-agent circle, .mh-veh, .mh-fmt-dot circle { fill: var(--p); }
.mh .mh-track { stroke: var(--p); stroke-width: 2; stroke-opacity: 0.4; }
.mh .mh-divider-p { stroke: var(--mh-line); stroke-width: 1; stroke-dasharray: 8 10; }
.mh-stack path { stroke-width: 2.4; stroke-linecap: butt; stroke-opacity: 0.85; }
.mh-legend { font-size: 10.5px; }
.mh .mh-surfw-light { stroke: var(--mh-surface); }
.mh-chev { stroke: var(--p); stroke-width: 1.4; }
.mh-flowing { pointer-events: none; }
.mh-days path { stroke: var(--ink); stroke-opacity: 0.1; stroke-width: 1; stroke-dasharray: 2 3; }
.mh-veil { fill: var(--mh-surface); fill-opacity: 0.62; }
.mh-proj circle { fill: var(--mh-surface); stroke: var(--mh-line); stroke-width: 1.2; }
.mh-card { fill: var(--mh-surface); }
.mh-caption { font: 400 11.5px/1 var(--body); fill: var(--muted); }
.mh-cursor path { stroke: var(--p); stroke-width: 1.3; }
.mh-webster .mh-move path { stroke-opacity: 1; stroke-width: 1.6; }
.mh-sig-red { fill: #e57373; }
.mh-sig-amber { fill: var(--marking); }
.mh-sig-green { fill: var(--p); }
.mh-ring-track { fill: none; stroke: var(--ink); stroke-opacity: 0.08; stroke-width: 1; }
.mh .mh-ring-main { stroke: var(--p); stroke-width: 3.2; }
.mh .mh-ring-ig { stroke: var(--marking); stroke-width: 3.2; }
.mh-label { font: 400 10.5px/1 var(--body); fill: var(--muted); text-anchor: middle; }
.mh-now { font: 500 17px/1 var(--display); fill: var(--ink); text-anchor: middle; }
.mh-hand path { stroke: var(--ink); stroke-opacity: 0.5; stroke-width: 1.2; }
.mh-hand circle { fill: var(--mh-surface); stroke: var(--ink); stroke-width: 1.4; }
.mh .mh-band { fill: var(--p); fill-opacity: 0.14; stroke: none; }
.mh .mh-band-r { fill: #64b5f6; fill-opacity: 0.13; stroke: none; }
.mh .mh-traj { stroke: var(--p); stroke-width: 1; stroke-opacity: 0.55; }
.mh-row path { stroke: var(--ink); stroke-opacity: 0.16; stroke-width: 1.2; }
.mh .mh-green { stroke: var(--p); stroke-width: 4.5; }
.mh-now-line path { stroke: var(--ink); stroke-opacity: 0.5; stroke-width: 1; stroke-dasharray: 2 4; }
.mh-veh-c circle { fill: var(--c); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mh-veh-c circle { fill: var(--cd); } }
:root[data-theme="dark"] .mh-veh-c circle { fill: var(--cd); }
.mh-plate { fill: var(--mh-surface); fill-opacity: 0.92; }
.mh .mh-kerbw { stroke: var(--mh-line); stroke-width: 24; stroke-linecap: butt; }
.mh .mh-surfw { stroke: color-mix(in srgb, var(--ink) 5%, var(--mh-surface)); stroke-width: 22; stroke-linecap: butt; }
.mh-roadhub .mh-axis path { stroke-width: 1.3; }
.mh-fmt path { stroke: var(--p); stroke-width: 1.3; }
.mh-fmt-faint path { stroke: var(--p); stroke-opacity: 0.4; stroke-width: 1; stroke-dasharray: 3 3; }
.mh-fmt-tick path { stroke: var(--ink); stroke-opacity: 0.35; stroke-width: 1; }
.mh-fmt-node circle { fill: var(--mh-surface); stroke: var(--p); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.mh .mh-fmt-fill { fill: var(--p); fill-opacity: 0.14; }
.mh-fmt-name { font: 400 12.5px/1 var(--body); fill: var(--ink-2); }
.mh .mh-pin { stroke: var(--p); stroke-width: 1; stroke-dasharray: 2 3; stroke-opacity: 0.7; }
.mh-link path { stroke: var(--mh-line); stroke-width: 1.2; }
.mh-proj rect { fill: none; stroke: var(--ink); stroke-opacity: 0.4; stroke-width: 1.1; }
.mh-proj path { stroke: var(--ink); stroke-opacity: 0.45; stroke-width: 2.2; }
.mh-visited circle { fill: var(--mh-surface); stroke: var(--p); stroke-width: 1.6; }
.mh-visited rect { fill: none; stroke: var(--p); stroke-width: 1.3; }
.mh-visited path { stroke: var(--p); stroke-width: 2.4; }
.mh-req path { stroke: var(--p); stroke-width: 1.1; stroke-dasharray: 3 3; }
.mh-spark path { stroke: var(--p); stroke-width: 1.6; }
.mh .mh-check { stroke: var(--p); stroke-width: 1.6; }
.mh .mh-skel { stroke: var(--ink); stroke-opacity: 0.15; stroke-width: 5; }
.mh .mh-skel-2 { stroke-opacity: 0.08; }

/* Было / стало: две колонки; «было» приглушённо, «стало» — на подложке */
.shift-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shift-col { padding: 24px 28px 18px; border-radius: 14px; }
.shift-label { font: 500 1.05rem/1.3 var(--display); margin-bottom: 6px; }
.shift-col ul { list-style: none; margin: 0; padding: 0; }
.shift-col li { position: relative; padding: 9px 0 9px 30px; font-size: 1.05rem; line-height: 1.45; }
.shift-col li::before { content: ""; position: absolute; left: 2px; top: calc(9px + 0.725em); }
.shift-was { color: var(--muted); }
.shift-was .shift-label { color: var(--muted); }
.shift-was li::before { width: 12px; height: 1.6px; margin-top: -0.8px; border-radius: 1px; background: currentColor; opacity: 0.6; }
.shift-now { background: var(--surface); color: var(--ink); }
.shift-now li::before { width: 5px; height: 10px; margin-top: -7.5px; left: 5px; border: solid var(--accent); border-width: 0 1.7px 1.7px 0; transform: rotate(45deg); }
.shift + .tree { margin-top: 72px; }

@media (max-width: 1100px) {
  .hero-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── Контакт и реквизиты: подвал — сосед <main>, не его потомок (ориентир contentinfo) ─── */
.site-foot { margin-top: 88px; padding-bottom: 64px; }
.contact { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px 48px; padding: 30px 32px; border-radius: 14px; background: var(--surface); }
.contact h2 { font: 500 1.2rem/1.3 var(--display); margin: 8px 0 8px; }
.contact p { margin: 0; color: var(--ink-2); max-width: 36em; }
.contact-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.contact-mail { font: 500 1.05rem/1 var(--mono); color: var(--ink); text-decoration: none; user-select: all; }
.copy-btn { font: 500 0.8rem/1 var(--body); padding: 8px 12px; border: 0; border-radius: 6px; background: var(--paper); color: var(--ink); cursor: pointer; }
.copy-btn:hover { background: var(--accent-soft); color: var(--accent); }
.holder { margin-top: 22px; font-size: 0.8rem; line-height: 1.55; color: var(--muted); }
.holder p { margin: 0 0 8px; }
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.legal-links a, .holder p a { color: var(--muted); text-decoration: none; }
.legal-links a:hover, .holder p a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 900px) {
  .col { padding-inline: 16px; }
  .site-head { padding-block: 8px; }
  html { scroll-padding-top: 72px; scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .head-row { flex-wrap: nowrap; gap: 10px; }
  /* «Войти» и регистрация видны и на телефоне — в шапке рядом с бургером, компактнее. */
  .head-actions { margin-left: auto; gap: 8px; }
  .head-actions .btn { font-size: .875rem; }
  .btn.head-cta { padding: 8px 14px; white-space: nowrap; }
  .btn.head-login, .btn.head-theme { width: 38px; height: 38px; }
  .burger { display: grid; order: 1; }
  /* Меню за бургером: выпадает панелью под шапкой. */
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 2px; padding: 8px 16px 16px; background: var(--paper); box-shadow: 0 18px 30px -20px rgba(10, 14, 18, .45); }
  .is-open .site-nav { display: flex; }
  .nav-link { padding: 12px 12px; font-size: 1.05rem; }
  main.col { padding-block: 32px 0; }
  .site-foot { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  .tabbar { position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: 480px; margin-inline: auto; display: grid; grid-template-columns: 1fr 1.8fr 1fr; gap: 4px; padding: 6px; border-radius: 999px; background: color-mix(in srgb, var(--paper) 86%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 7%, transparent), 0 14px 34px -14px rgba(10, 14, 18, .45); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 6px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 11px; line-height: 1.15; font-weight: 500; text-align: center; }
  .tab svg { width: 22px; height: 22px; fill: currentColor; }
  .tab:active { background: var(--surface); }
  /* Главная — цветом --cta, как «Начать работу» в шапке компьютера. */
  .tab-main { background: var(--cta); color: var(--cta-ink); font-weight: 600; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--cta) 70%, transparent); }
  .tab-main:active { background: color-mix(in srgb, var(--cta) 86%, #000); }
  .page-grid, .grid-2, .grid-3, .split, .contact { grid-template-columns: minmax(0, 1fr); }
  .page-grid { gap: 28px; }
  .page-aside { position: static; max-height: none; overflow: visible; padding-top: 0; }
  .toc-first .page-aside { order: -1; }
  .section { margin-top: 56px; }
  .split .link-list { margin-top: 0; }
  .lockup-xl .tile { width: 44px; height: 44px; border-radius: 12px; }
  .lockup-xl .tile svg { width: 27px; height: 27px; }
  .contact { padding: 22px 20px 24px; }
  body { font-size: 16px; }
  .hero-row { grid-template-columns: minmax(0, 1fr); padding-block: 48px 48px; }
  .hero-art { margin-block: -24px -8px; }
  .hero-art svg { width: min(120%, 620px); margin-left: max(-14%, calc(50% - 310px)); }
  .hero-facts { margin-top: 8px; padding-top: 32px; gap: 28px 32px; }
  .mhero { margin-top: 18px; }
  .mhero-row { grid-template-columns: minmax(0, 1fr); padding-block: 40px 32px; }
  .mhero-mark { font-size: 1.55rem; }
  .lockup-hero .tile { width: 48px; height: 48px; border-radius: 13px; }
  .lockup-hero .tile svg { width: 29px; height: 29px; }
  .mhero h1 { margin-top: 26px; }
  .mhero-art svg { width: 100%; max-width: 560px; margin-inline: auto; }
  .has-hero > .col > .page-grid:first-child { margin-top: 40px; }
  .shift-grid { grid-template-columns: minmax(0, 1fr); }
  .shift + .tree { margin-top: 56px; }
}
@media (max-width: 600px) {
  .hero-facts { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .hero .btn { padding: 12px 18px; }
  .shift-col { padding: 20px 20px 14px; }
}

/* ─── Плашка «поставить на экран телефона» (план 138, Р37) — только телефон,
   над нижней панелью; на десктопе браузер предлагает установку сам ─── */
.install { position: fixed; z-index: 46; left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); max-width: 480px; margin-inline: auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; column-gap: 12px; row-gap: 10px; padding: 12px 6px 14px 12px; border-radius: 18px; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 7%, transparent), 0 20px 40px -18px rgba(10, 14, 18, .5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .install { background: var(--surface); } }
:root[data-theme="dark"] .install { background: var(--surface); }
.install[hidden] { display: none; }
.install-icon { display: block; width: 44px; height: 44px; border-radius: 11px; }
.install-title { font: 500 0.98rem/1.25 var(--display); }
.install-hint { margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.install-hint svg { width: 16px; height: 16px; vertical-align: -3px; fill: var(--accent); }
.install-btn { grid-column: 2; justify-self: start; font: 500 14px/1 var(--body); border: 0; border-radius: 999px; padding: 10px 14px; cursor: pointer; background: var(--accent); color: #fff; white-space: nowrap; }
.install-btn[hidden] { display: none; }
.install-x { grid-column: 3; grid-row: 1; margin-top: -4px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.install-x svg { width: 20px; height: 20px; fill: currentColor; }
@media (min-width: 901px) { .install { display: none; } }

/* ─── Уведомление о cookie — «путевой лист» ───
   Билет с отрывным корешком: слева опись, справа штамп и кнопка. Рамки нет — билет
   отделяется подложкой и тенью; пунктир между частями — линия отрыва, не рамка. */
.ticket { --ok: #2f8f4e; --no: #c8453b; position: fixed; z-index: 50; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: min(600px, calc(100% - 32px)); transform: translateX(-50%); display: grid; grid-template-columns: minmax(0, 1fr) auto; background: var(--paper); color: var(--ink); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent), 0 24px 50px -22px rgba(10, 14, 18, .45); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ticket { --ok: #5cc27d; --no: #ec6a5f; background: var(--surface); } }
:root[data-theme="dark"] .ticket { --ok: #5cc27d; --no: #ec6a5f; background: var(--surface); }
.ticket[hidden] { display: none; }
/* На телефоне билет встаёт над нижней панелью, а не на неё. На низком экране
   (телефон боком) он не выше просвета между шапкой и панелью — прокручивается внутри. */
@media (max-width: 900px) { .ticket { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); max-height: calc(100dvh - 156px - env(safe-area-inset-bottom, 0px)); overflow-y: auto; } }
.ticket-main { border-right: 2px dashed var(--rule); padding: 16px 20px 16px; display: grid; gap: 10px; min-width: 0; }
.ticket-date { font: 400 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ticket .ticket-title { margin: 0; font: 500 1.2rem/1.2 var(--display); letter-spacing: -0.015em; }
.ticket-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ticket-h { font: 500 11px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 7px; }
.ticket-h-yes { color: var(--ok); }
.ticket-h-no { color: var(--no); }
.ticket ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.ticket-no li { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: color-mix(in srgb, var(--no) 75%, transparent); }
.ticket-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.ticket-stub { position: relative; isolation: isolate; min-width: 150px; padding: 16px 18px; display: grid; align-content: space-between; justify-items: center; gap: 12px; margin-left: 10px; background: var(--surface); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ticket-stub { background: var(--surface-2); } }
:root[data-theme="dark"] .ticket-stub { background: var(--surface-2); }
.ticket-stub::before, .ticket-stub::after { content: ""; position: absolute; left: -19px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); }
.ticket-stub::before { top: -8px; }
/* Перечёркнутая камера — водяной знак на корешке: «не снимаем». Штамп ложится поверх. */
.ticket-cam { position: absolute; z-index: -1; left: 50%; top: 40%; width: 118px; height: 118px; transform: translate(-50%, -50%) rotate(-8deg); fill: color-mix(in srgb, var(--ink) 7%, transparent); pointer-events: none; }
.ticket-stub::after { bottom: -8px; }
/* Штамп «Согласовано» — прямоугольный, двойная рамка, как на согласовательном листе. */
.ticket-stamp { padding: 6px 10px; border-radius: 4px; border: 4px double var(--accent); color: var(--accent); font: 500 13px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; opacity: 0; transform: rotate(-8deg) scale(1.6); }
.ticket-btn { font: 500 14px/1 var(--body); border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer; background: var(--ink); color: var(--paper); white-space: nowrap; }
.ticket-btn:hover { background: var(--accent); }
.ticket.is-stamped .ticket-stamp { opacity: .9; transform: rotate(-8deg) scale(1); }
@media (prefers-reduced-motion: no-preference) {
  .ticket { animation: ticket-rise .6s cubic-bezier(.2, .8, .2, 1) both; }
  .ticket-stamp { transition: opacity .2s, transform .35s cubic-bezier(.3, 1.6, .5, 1); }
  .ticket.is-leaving { animation: ticket-leave .6s cubic-bezier(.6, 0, .8, .2) both; }
}
@keyframes ticket-rise { from { transform: translate(-50%, 130%); } to { transform: translateX(-50%); } }
@keyframes ticket-leave { from { transform: translateX(-50%); } to { transform: translate(-50%, 130%) rotate(2deg); opacity: 0; } }
@media (max-width: 600px) {
  .ticket { grid-template-columns: minmax(0, 1fr); }
  .ticket-cols { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ticket-main { border-right: 0; border-bottom: 2px dashed var(--rule); }
  /* Дата и штамп — в одной ячейке (штамп ложится на дату), кнопка — во второй
     колонке: иначе три элемента в ряд выдавливают кнопку за край. */
  .ticket-stub { min-width: 0; margin: 10px 0 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; justify-items: start; padding: 12px 16px; }
  .ticket-date, .ticket-stamp { grid-area: 1 / 1; }
  .ticket-btn { grid-area: 1 / 2; }
  .ticket-stub::before, .ticket-stub::after { display: none; }
  .ticket-cam { top: 50%; width: 76px; height: 76px; }
  .ticket-stamp { padding: 5px 8px; font-size: 11px; }
}
/* Совсем узкий телефон: дата и кнопка в ряд не помещаются — кнопка под датой во всю ширину. */
@media (max-width: 400px) {
  .ticket-stub { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ticket-btn { grid-area: 2 / 1; justify-self: stretch; padding-block: 12px; }
}
