/* Шапка и подвал сайта: копия из test.html, строки 17–118 и 152–232 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }

/* ─── Header ──────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 64px;
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
}
.logo__mark {
  height: 36px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.logo__wordmark {
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: -0.015em;
  line-height: 1;
}
.logo__wordmark--session { color: var(--brand-strong); }
.logo__wordmark--flow    { color: var(--brand); }

/* Personal lockup для /therapy — line drawing профиль + 2-строчный wordmark */
.logo--personal {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.logo--personal__mark {
  display: block;
  width: 31.5px;          /* aspect 470:718 = 0.655 при height 48 */
  height: 48px;
  flex-shrink: 0;
  background-color: var(--brand-strong);
  -webkit-mask: url('/public/personal-mark.png') center/contain no-repeat;
  mask: url('/public/personal-mark.png') center/contain no-repeat;
  transition: background-color 200ms var(--ease-out-quart);
}
.logo--personal:hover .logo--personal__mark { background-color: var(--brand); }
.logo--personal__text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo--personal__role {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 6px;
}
.logo--personal__name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--brand-strong);
  letter-spacing: -0.012em;
}

.nav-actions { display: flex; align-items: center; gap: var(--space-3); }
.nav-actions a.nav-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 6px 4px;
  transition: color 150ms var(--ease-out-quart);
}
.nav-actions a.nav-link:hover { color: var(--text-strong); }
.nav-actions a.nav-link--active { color: var(--brand-strong); font-weight: 600; }

/* ─── Footer ──────────────────────────────────────── */
.site-footer {
  background: var(--surface-2);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}
.site-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.site-footer__armchairs {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.site-footer__armchair {
  display: block;
  width: 48px;
  height: 48px;
  background-color: var(--brand);
  -webkit-mask: url('/public/icons/armchair.svg') center/contain no-repeat;
  mask: url('/public/icons/armchair.svg') center/contain no-repeat;
  opacity: 0.7;
}
.site-footer__armchair--mirror {
  transform: scaleX(-1);
}
.site-footer__links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-4);
  font-size: 0.9375rem;
}
.site-footer__links a {
  color: var(--text-muted);
  transition: color 150ms var(--ease-out-quart);
}
.site-footer__links a:hover { color: var(--brand-strong); }
.site-footer__bottom {
  max-width: 1120px;
  margin: var(--space-5) auto 0;
  padding: var(--space-3) var(--space-5) 0;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-subtle);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .section[data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ─── Mobile ──────────────────────────────── */
@media (max-width: 880px) {
  .site-header__inner { height: auto; min-height: 64px; padding: var(--space-2) var(--space-3); flex-wrap: wrap; row-gap: 0; }
  .nav-actions { width: 100%; justify-content: flex-start; gap: var(--space-2); padding-bottom: var(--space-1); }
  .nav-actions a.nav-link { white-space: nowrap; font-size: 0.75rem; }
  .nav-actions { gap: 10px; }

  .site-footer__inner { padding: 0 var(--space-3); gap: var(--space-3); }
  .site-footer__armchair { width: 40px; height: 40px; }
  .site-footer__links { gap: var(--space-3); font-size: 0.875rem; }
}

@media (max-width: 540px) {
  .site-footer__links { flex-direction: column; gap: var(--space-1); align-items: flex-end; }
}

/* ─── Справочник ─────────────────────────── */
/* Направление: спокойное длинное чтение. Только токены tokens.css; производные
   значения (--st-*) собраны здесь, чтобы не расползались по правилам. */
.st {
  --st-header-h: 65px;                                   /* высота липкой шапки сайта с бордером */
  --st-sticky-top: calc(var(--st-header-h) + var(--space-3));
  --st-link-line: color-mix(in oklch, var(--brand-text) 40%, transparent);
  --st-danger-text: oklch(50% 0.17 25);                  /* --destructive темнее: AA для мелкого текста */
  --st-danger-soft: oklch(97% 0.015 25);                 /* фон блока «Не удалось отправить», тон --destructive */
  --st-danger-line: oklch(85% 0.06 25);
  --st-shadow: 0 10px 30px oklch(20% 0.02 200 / 0.12), 0 1px 3px oklch(20% 0.02 200 / 0.08);
  background: var(--surface);
  color: var(--text);
}
.st-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.st-skip { position: absolute; left: 16px; top: -100px; z-index: 100; padding: var(--space-1) var(--space-2); background: var(--brand-strong); color: var(--brand-text-on); border-radius: var(--radius-sm); font-weight: 600; }
.st-skip:focus { top: 8px; }
.st :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.st-main:focus { outline: none; }
.st [id] { scroll-margin-top: calc(var(--st-header-h) + var(--space-3)); }
/* ≤880px меню шапки переносится второй строкой: замер 125.6px на 375 и 800 */
@media (max-width: 880px) { .st { --st-header-h: 126px; } }
.st summary { cursor: pointer; list-style: none; }
.st summary::-webkit-details-marker { display: none; }
.st summary::before {
  content: ""; display: inline-block; width: 0.45em; height: 0.45em; margin-right: 0.55em; vertical-align: 0.12em;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--duration-quick) var(--ease-out-quart);
}
.st details[open] > summary::before { transform: rotate(45deg); }

/* ─── Полоса раздела: название, меню, поиск ─── */
.st-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3);
  max-width: var(--container-wide); margin: 0 auto; padding: var(--space-2) 16px;
  /* линия на всю ширину окна: border-image-outset рисуется за пределами бокса и не даёт прокрутки */
  border-bottom: 1px solid var(--border);
  border-image: linear-gradient(var(--border), var(--border)) 0 0 1 0 / 0 0 1px 0 / 0 100vw 0 100vw;
}
.st-bar__home { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; color: var(--text-strong); }
.st-bar__home:hover { color: var(--brand-strong); }
.st-search { position: relative; flex: 1 1 280px; min-width: 0; max-width: 34rem; margin-left: auto; }
.st-search input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text-strong);
  padding: 0.55rem 1rem 0.55rem 2.5rem; border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  background: var(--surface);
  transition: border-color var(--duration-quick) var(--ease-out-quart), box-shadow var(--duration-quick) var(--ease-out-quart);
}
.st-search::before {
  /* лупа маской: цвет берётся из токена */
  content: ""; position: absolute; left: 1rem; top: 50%; width: 1rem; height: 1rem; margin-top: -0.5rem; pointer-events: none;
  background-color: var(--text-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.st-search input::placeholder { color: var(--text-muted); opacity: 1; }
.st-search input:hover { border-color: var(--text-subtle); }
.st-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.st-search__results {
  position: absolute; z-index: 30; inset: calc(100% + 6px) 0 auto 0; max-height: min(70vh, 32rem); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-1);
  box-shadow: var(--st-shadow);
}
.st-search__results ul { list-style: none; }
.st-search__results li a { display: block; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); font-weight: 600; color: var(--text-strong); }
.st-search__results li a:hover, .st-search__results li a:focus-visible { background: var(--surface-2); }
.st-search__results li p { padding: 0 0.75rem 0.5rem; font-size: 0.875rem; line-height: 1.45; color: var(--text-muted); }
.st-search__results mark { background: var(--brand-soft); color: var(--text-strong); border-radius: 2px; }
.st-search__empty { padding: 0.5rem 0.75rem; color: var(--text-muted); font-size: 0.9375rem; }
.st-menu-btn {
  font: inherit; font-size: 0.9375rem; font-weight: 600; color: var(--text-strong);
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 1rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface);
}
.st-menu-btn::before { content: ""; width: 1rem; height: 0.7rem; border-block: 1.5px solid currentColor; background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat; }
.st-menu-btn[aria-expanded="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }

/* ─── Раскладка ─── */
.st-layout {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "main";
  column-gap: var(--space-4); max-width: var(--container-wide); margin: 0 auto;
  padding: var(--space-4) 16px var(--space-7);
}
.st-main { grid-area: main; min-width: 0; }

/* ─── Оглавление справочника ─── */
.st-nav { grid-area: nav; font-size: 0.9375rem; line-height: 1.35; }
.st-nav ul { list-style: none; }
.st-nav a, .st-nav__title, .st-nav summary { display: block; padding: 0.3rem 0.625rem; border-radius: var(--radius-sm); }
.st-nav a { color: var(--text-muted); transition: background-color var(--duration-quick) var(--ease-out-quart), color var(--duration-quick) var(--ease-out-quart); }
.st-nav a:hover { color: var(--text-strong); background: var(--surface-2); }
.st-nav a[aria-current="page"] { color: var(--brand-strong); font-weight: 600; background: var(--brand-soft); }
.st-nav__home a { font-weight: 600; color: var(--text-strong); }
.st-nav__group { margin-top: var(--space-2); }
.st-nav__group > a, .st-nav__title, .st-nav summary { font-weight: 600; color: var(--text-strong); }
.st-nav summary:hover { background: var(--surface-2); }
.st-nav__group ul, .st-nav__overview { margin-left: 0.625rem; padding-left: 0.375rem; border-left: 1px solid var(--border); font-size: 0.875rem; }
.st-nav__group ul { margin-top: 2px; }

/* ─── Оглавление страницы ─── */
.st-aside { grid-area: toc; display: none; font-size: 0.875rem; line-height: 1.35; }
.st-toc-side__title { font-weight: 600; color: var(--text-strong); padding: 0 0 var(--space-1) 0.75rem; }
.st-toc-side ol, .st-toc-inline ol { list-style: none; border-left: 1px solid var(--border); }
.st-toc-side a, .st-toc-inline a { display: block; padding: 0.25rem 0 0.25rem 0.75rem; color: var(--text-muted); transition: color var(--duration-quick) var(--ease-out-quart); }
.st-toc-side a:hover, .st-toc-inline a:hover { color: var(--brand-strong); }
.st-toc-inline { margin: var(--space-3) 0 0; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); font-size: 0.9375rem; }
.st-toc-inline summary { font-weight: 600; color: var(--text-strong); }
.st-article .st-toc-inline ol { margin-top: var(--space-1); padding-left: 0; }
.st-article .st-toc-inline li + li { margin-top: 0; }
.st-article .st-toc-inline a { text-decoration: none; }

/* телефон: меню выезжает слева */
@media (max-width: 767px) {
  .st-bar { gap: 0.75rem; }
  .st-bar__home { flex: 1 1 0; min-width: 0; font-size: 0.875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .st-menu-btn { padding: 0 0.75rem; }
  .st-search { flex-basis: 100%; max-width: none; margin-left: 0; order: 3; }
  .st-layout { padding-top: var(--space-3); }
  .st-layout > .st-nav {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(calc(100vw - 72px), 320px); overflow-y: auto; overscroll-behavior: contain;
    padding: var(--space-3) 12px var(--space-5); background: var(--surface); box-shadow: 4px 0 24px oklch(20% 0.02 200 / 0.15);
    transform: translateX(-100%); visibility: hidden;
    transition: transform var(--duration-normal) var(--ease-out-quart), visibility 0s linear var(--duration-normal);
  }
  .st-nav-open .st-layout > .st-nav { transform: none; visibility: visible; transition: transform var(--duration-normal) var(--ease-out-quart); }
  .st-layout > .st-nav a, .st-layout > .st-nav summary, .st-layout > .st-nav .st-nav__title { padding-block: 0.6rem; }
  /* открытое меню: кнопка превращается в «закрыть» и остаётся видимой справа от панели при любой прокрутке.
     Затемнения нет: касание вне панели меню не закрывает (это JS), ложной подсказки не даём */
  .st-nav-open .st-menu-btn { position: fixed; z-index: 41; top: 12px; right: 12px; width: 44px; padding: 0; justify-content: center; font-size: 0; background: var(--surface); box-shadow: var(--st-shadow); }
  .st-nav-open .st-menu-btn::before { width: 1rem; height: 1rem; border: 0; background: linear-gradient(45deg, transparent calc(50% - 0.75px), currentColor calc(50% - 0.75px) calc(50% + 0.75px), transparent calc(50% + 0.75px)), linear-gradient(-45deg, transparent calc(50% - 0.75px), currentColor calc(50% - 0.75px) calc(50% + 0.75px), transparent calc(50% + 0.75px)); }
}
@media (min-width: 768px) {
  .st-menu-btn { display: none; }
  .st-layout { grid-template-columns: 224px minmax(0, 1fr); grid-template-areas: "nav main"; }
  .st-layout > .st-nav {
    position: sticky; top: var(--st-sticky-top); align-self: start;
    max-height: calc(100vh - var(--st-sticky-top) - var(--space-2)); overflow-y: auto; overscroll-behavior: contain;
    margin-left: -0.625rem; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
  }
}
@media (min-width: 1100px) {
  .st-layout { grid-template-columns: 224px minmax(0, 1fr) 184px; grid-template-areas: "nav main toc"; }
  /* страницы без оглавления страницы (словарь, указатели, 404): правая колонка не резервируется,
     основная колонка занимает и её место */
  .st-layout.st-layout--no-toc { grid-template-columns: 224px minmax(0, 1fr); grid-template-areas: "nav main"; }
  .st-aside { display: block; position: sticky; top: var(--st-sticky-top); align-self: start; max-height: calc(100vh - var(--st-sticky-top) - var(--space-2)); overflow-y: auto; scrollbar-width: thin; }
  .st-toc-inline { display: none; }
}

/* ─── Чтение: мера строки ~65–75 знаков, шкала заголовков 1.25 ─── */
/* мера 44em — на текстовых элементах, а не на .st-article целиком: иначе она
   ужимает и таблицы/сетки, которым мера ни к чему (см. .table-scroll ниже) */
.st-article { font-size: 1.0625rem; line-height: 1.7; color: var(--text); overflow-wrap: break-word; }
.st-article > h1, .st-article > h2, .st-article > h3, .st-article > p, .st-article > ul, .st-article > ol, .st-article > dl,
.st-body > h1, .st-body > h2, .st-body > h3, .st-body > p, .st-body > ul, .st-body > ol, .st-body > dl, .st-body > hr,
.st-lead, .st-card-head, .st-motto, figure.verbatim { max-width: 44em; }
@media (max-width: 767px) { .st-body p, .st-body li { hyphens: auto; } }
.st-article h1, .st-article h2, .st-article h3 { color: var(--text-strong); text-wrap: balance; }
.st-article h1 { font-size: 2.075rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.st-article h2 { font-size: 1.66rem; line-height: 1.25; font-weight: 700; letter-spacing: -0.015em; margin-top: var(--space-6); }
.st-article h3 { font-size: 1.328rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; margin-top: var(--space-4); }
.st-article h2 + h3 { margin-top: var(--space-3); }
.st-article p { text-wrap: pretty; }
.st-article p, .st-article ul, .st-article ol, .st-article dl { margin-top: var(--space-2); }
.st-article h2 + p, .st-article h3 + p, .st-article h2 + ul, .st-article h3 + ul { margin-top: var(--space-1); }
.st-article ul, .st-article ol { padding-left: 1.25em; }
.st-article li + li { margin-top: 0.3em; }
.st-article li::marker { color: var(--text-subtle); }
.st-article strong { font-weight: 700; color: var(--text-strong); }
.st-article hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-5) 0; }
.st-article code { font-size: 0.9em; padding: 0.1em 0.35em; border-radius: 4px; background: var(--surface-3); }
.st-article a {
  color: var(--brand-text); text-decoration: underline; text-decoration-color: var(--st-link-line);
  text-decoration-thickness: 1px; text-underline-offset: 0.2em;
  transition: text-decoration-color var(--duration-quick) var(--ease-out-quart), color var(--duration-quick) var(--ease-out-quart);
}
.st-article a:hover { color: var(--brand-hover); text-decoration-color: currentColor; }
.st-lead { font-size: 1.1875rem; line-height: 1.6; color: var(--text); }

/* ─── Шапка карточки ─── */
.st-card-head { padding-bottom: var(--space-4); border-bottom: 1px solid var(--border); }
.st-card-head > * + * { margin-top: var(--space-2); }
.st-card-head:has(> .st-title:only-child) { padding-bottom: 0; border-bottom: 0; }
.st-card-head > .st-en { margin-top: var(--space-1); }
.st-en { color: var(--text-muted); font-size: 1.25rem; line-height: 1.35; }
.st-prov { font-size: 0.9375rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.st-badge {
  font-family: inherit; font-size: 0.8125rem; font-weight: 600; line-height: 1; letter-spacing: 0.01em;
  padding: 0.4rem 0.7rem; min-height: 28px; white-space: nowrap; border-radius: var(--radius-pill); border: 1px solid color-mix(in oklch, var(--brand) 35%, var(--border));
  background: var(--brand-soft); color: var(--brand-strong); cursor: pointer;
  transition: background-color var(--duration-quick) var(--ease-out-quart), border-color var(--duration-quick) var(--ease-out-quart);
}
.st-badge:hover, .st-badge[aria-expanded="true"] { border-color: var(--brand); background: oklch(91% 0.04 200); }
.st-variants { font-size: 0.9375rem; }
.st-variants__label, .st-facts dt { font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); }
.st-article .st-variants ul { list-style: none; padding: 0; margin-top: 0.25rem; }
.st-variants li { display: inline; margin: 0; color: var(--text-strong); }
.st-variants li:not(:last-child)::after { content: "\00a0· "; color: var(--text-subtle); }
.st-variants--narrow { display: none; }
@media (max-width: 767px) { .st-variants--wide { display: none; } .st-variants--narrow { display: block; } }
.st-variants details { margin-top: 0.25rem; }
.st-variants summary { color: var(--brand-text); font-size: 0.875rem; font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.st-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--space-2) var(--space-3); font-size: 0.9375rem; line-height: 1.45; }
.st-facts dd { margin-top: 0.2rem; color: var(--text-strong); }
.st-facts__more { margin-top: 0.3rem; font-size: 0.8125rem; }
.st-facts__more a { color: var(--text-muted); text-decoration-color: var(--border-strong); }
.st-facts__more a:hover { color: var(--brand-strong); text-decoration-color: currentColor; }
.st-motto { font-size: 1.1875rem; line-height: 1.45; font-style: italic; color: var(--text-strong); }
.st-motto__link { font-style: normal; font-size: 0.875rem; margin-left: 0.35rem; }

/* ─── Блок «Домен в трёх моделях» (генерируется, вставляется в тело карточки схемы) ─── */
.st-domains { max-width: none; margin-top: var(--space-3); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-2); }
.st-domains__title { font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); margin: 0; }
.st-domains .table-scroll { margin-top: var(--space-2); background: var(--surface); }
.st-domains__link { margin-top: var(--space-2); font-size: 0.9375rem; }
.st-report-cta { font-size: 0.875rem; }
.st-article .st-report-cta a { color: var(--text-muted); text-decoration-color: var(--border-strong); }
.st-article .st-report-cta a:hover { color: var(--brand-strong); text-decoration-color: currentColor; }
.st-card-head .st-report-cta { margin-top: var(--space-3); }

/* значок-кнопка «кратко о термине» у ссылки */
.st-peek {
  position: relative; display: inline-grid; place-items: center; width: 1.05em; height: 1.05em; margin-left: 0.2em; vertical-align: -0.12em;
  border: 1px solid color-mix(in oklch, var(--brand) 40%, var(--border)); border-radius: 50%; background: var(--surface);
  color: var(--brand-strong); font-family: inherit; cursor: pointer;
  transition: background-color var(--duration-quick) var(--ease-out-quart);
}
.st-peek::before { content: "i"; font-size: 0.72rem; font-weight: 700; line-height: 1; }
.st-peek::after { content: ""; position: absolute; inset: -8px; }          /* зона нажатия ≥24px */
.st-peek:hover, .st-peek[aria-expanded="true"] { background: var(--brand-soft); }

/* ─── Дословные цитаты: плашка, метка и подпись, различимы в ч/б ─── */
figure.verbatim {
  margin: var(--space-3) 0; padding: var(--space-3) var(--space-3) var(--space-2);
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 1rem; line-height: 1.65;
}
figure.verbatim::before {
  content: "Дословно из источника"; display: block; margin-bottom: var(--space-1);
  font-size: 0.8125rem; font-weight: 600; color: var(--text-muted);
}
figure.verbatim blockquote { color: var(--text-strong); }
/* на тонированной плашке --brand-text даёт 4.1:1, поэтому ссылки темнее (AA) */
.st-article figure.verbatim a { color: var(--brand-strong); }
figure.verbatim blockquote > :first-child { margin-top: 0; }
figure.verbatim figcaption { margin-top: var(--space-2); padding-top: var(--space-1); border-top: 1px solid var(--border-strong); font-size: 0.875rem; line-height: 1.45; color: var(--text-muted); }
figure.verbatim figcaption::before { content: "Источник: "; font-weight: 600; }

/* ─── Таблицы ─── */
/* таблица не обязана укладываться в меру текста (44em): занимает всю ширину
   колонки main, а не только текстовую меру; скролл — только когда правда не влезает.
   width:max-content раньше растягивал таблицу по самой длинной НЕразрывной строке
   (одна строка EN без переноса) — колонки съезжали за экран, хотя ячейки могли
   переноситься. table-layout:auto + width:100% + обычный перенос слов внутри ячеек;
   min-width держит таблицу читаемой и включает горизонтальный скролл только когда
   .table-scroll теснее этого порога. */
.table-scroll { width: 100%; max-width: none; overflow-x: auto; margin-top: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.table-scroll table { table-layout: auto; border-collapse: collapse; width: 100%; min-width: 36rem; font-size: 0.9375rem; line-height: 1.5; }
.table-scroll table.st-table--wide { min-width: 44rem; }
.table-scroll th, .table-scroll td { padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; min-width: 9ch; overflow-wrap: break-word; }
.table-scroll th { background: var(--surface-2); font-size: 0.8125rem; font-weight: 600; color: var(--text-muted); }
.table-scroll tr:last-child td { border-bottom: 0; }
.table-scroll td:first-child { color: var(--text-strong); }

/* ─── Низ карточки ─── */
.st-card-foot { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.st-card-foot h2 { margin-top: 0; font-size: 1.328rem; }
.st-card-foot section + section { margin-top: var(--space-5); }
.st-card-foot h3 { margin-top: var(--space-3); font-size: 0.9375rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }
.st-article .st-card-foot ul { list-style: none; padding: 0; margin-top: var(--space-1); columns: 15rem 2; column-gap: var(--space-4); }
.st-card-foot li { break-inside: avoid; margin: 0 0 0.35rem; }
/* списки из одних ссылок: подчёркивание только при наведении, иначе колонка рябит */
.st-article .st-card-foot li > a, .st-article .st-index a { text-decoration-color: transparent; }
.st-article .st-card-foot li > a:hover, .st-article .st-index a:hover { text-decoration-color: currentColor; }
.st-card-foot .st-report-cta { margin-top: var(--space-5); }

/* ─── Словарь и указатели ─── */
.st-letters { display: flex; flex-wrap: wrap; gap: 4px; margin-top: var(--space-3); }
.st-article .st-letters a {
  display: inline-grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding: 0 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; color: var(--text-strong);
}
.st-article .st-letters a:hover { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-soft); }
.st-article .st-index { list-style: none; padding: 0; columns: 17rem 2; column-gap: var(--space-4); }
.st-index li { break-inside: avoid; margin: 0 0 0.35rem; }
.st-index__main { color: var(--text-muted); font-size: 0.9375rem; }

/* ─── Поповер ─── */
.st-popover {
  position: fixed; z-index: 50; max-width: min(340px, calc(100vw - 16px)); padding: var(--space-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--st-shadow);
  font-size: 0.9375rem; line-height: 1.5; animation: st-pop-in var(--duration-quick) var(--ease-out-quart);
}
.st-popover > * + * { margin-top: 0.35rem; }
.st-popover__title { font-weight: 700; color: var(--text-strong); }
.st-popover__en { color: var(--text-muted); font-size: 0.875rem; margin-top: 0 !important; }
.st-popover__short { color: var(--text); }
.st-popover a { color: var(--brand-text); text-decoration: underline; text-decoration-color: var(--st-link-line); text-underline-offset: 0.2em; font-weight: 600; }
.st-popover a:hover { text-decoration-color: currentColor; }
@keyframes st-pop-in { from { opacity: 0; transform: translateY(4px); } }

/* ─── Форма «Сообщить об ошибке» ─── */
.st-report {
  margin: auto; width: min(560px, calc(100vw - 32px)); max-height: min(90vh, 52rem); padding: var(--space-4);
  border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--st-shadow);
  font-size: 1rem; line-height: 1.5;
}
.st-report[open] { animation: st-dialog-in var(--duration-normal) var(--ease-out-quart); }
.st-report::backdrop { background: oklch(20% 0.02 200 / 0.4); }
.st-report h2 { font-size: 1.328rem; line-height: 1.25; font-weight: 700; color: var(--text-strong); letter-spacing: -0.01em; }
.st-report__page { margin-top: var(--space-1); font-size: 0.875rem; color: var(--text-muted); }
.st-report__page output { color: var(--text-strong); font-weight: 600; }
.st-report label { display: grid; gap: 6px; margin-top: var(--space-3); font-size: 0.9375rem; font-weight: 600; color: var(--text-strong); }
.st-report fieldset { border: 0; margin-top: var(--space-3); }
.st-report legend { font-size: 0.9375rem; font-weight: 600; color: var(--text-strong); margin-bottom: var(--space-1); }
.st-report textarea, .st-report input[type="text"] {
  font: inherit; font-weight: 400; color: var(--text-strong); width: 100%; padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color var(--duration-quick) var(--ease-out-quart), box-shadow var(--duration-quick) var(--ease-out-quart);
}
.st-report textarea { resize: vertical; min-height: 4.5rem; }
.st-report textarea:focus, .st-report input[type="text"]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.st-report [aria-invalid="true"] { border-color: var(--st-danger-text); }
.st-report .st-radio, .st-report .st-check { display: flex; gap: 0.6rem; align-items: center; margin-top: 0; min-height: 36px; font-weight: 400; color: var(--text); }
.st-report .st-check { margin-top: var(--space-3); }
.st-report input[type="radio"], .st-report input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--brand-strong); flex-shrink: 0; }
.st-hint { margin-top: 4px; font-size: 0.8125rem; color: var(--text-muted); }
.st-report__error { margin-top: 4px; color: var(--st-danger-text); font-size: 0.875rem; font-weight: 600; }
.st-report__actions { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-4); }
.st-report__status { margin-top: var(--space-2); }
.st-report__ok { font-size: 1.125rem; font-weight: 600; color: var(--brand-strong); }
.st-report__fail { display: grid; gap: var(--space-2); padding: var(--space-2); border: 1px solid var(--st-danger-line); border-radius: var(--radius-md); background: var(--st-danger-soft); }
.st-report__fail a { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 0.2em; }
.st-report__fail .st-btn { justify-self: start; }
.st-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.st-btn {
  font: inherit; font-weight: 600; min-height: 44px; padding: 0.6rem 1.25rem; border-radius: var(--radius-pill); border: 1px solid transparent;
  background: var(--brand-strong); color: var(--brand-text-on); cursor: pointer;
  transition: background-color var(--duration-quick) var(--ease-out-quart);
}
.st-btn:hover { background: var(--brand-hover); }
.st-btn:disabled { opacity: 0.6; cursor: progress; }
.st-btn--ghost { background: transparent; color: var(--brand-strong); border-color: var(--border-strong); }
.st-btn--ghost:hover { background: var(--surface-2); }
.st-report-float {
  position: fixed; z-index: 45; left: 16px; right: 16px; bottom: 16px; min-height: 48px;
  font: inherit; font-weight: 600; border: 0; border-radius: var(--radius-pill);
  background: var(--brand-strong); color: var(--brand-text-on); box-shadow: var(--st-shadow);
}
@keyframes st-dialog-in { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 767px) {
  .st-report { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 92vh; padding: var(--space-3) 16px var(--space-4); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .st-report[open] { animation-name: st-sheet-in; }
  .st-report__actions .st-btn { flex: 1 1 auto; }
}
@keyframes st-sheet-in { from { transform: translateY(100%); } }

/* ─── 404: всё оглавление в тексте страницы ─── */
.st-nav--inline { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.st-nav--inline .st-nav__list { columns: 15rem 2; column-gap: var(--space-4); }
.st-nav--inline .st-nav__group { break-inside: avoid-column; }
.st-article .st-nav--inline ul { padding-left: 0.375rem; margin-top: 2px; }
.st-article .st-nav--inline a { text-decoration: none; color: var(--text-muted); }
.st-article .st-nav--inline .st-nav__home a, .st-article .st-nav--inline .st-nav__group > a { color: var(--text-strong); }
.st-article .st-nav--inline a:hover { color: var(--brand-strong); }

/* ─── Подвал раздела ─── */
.st-section-footer { background: var(--surface-2); border-top: 1px solid var(--border); }
.st-section-footer__inner { max-width: var(--container-wide); margin: 0 auto; padding: var(--space-4) 16px; font-size: 0.875rem; line-height: 1.55; color: var(--text-muted); }
.st-section-footer__inner p { max-width: 44rem; }
.st-section-footer__inner p + p { margin-top: 0.5rem; }
.st-section-footer a { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 0.2em; }
