:root {
  color-scheme: light dark;

  --ink:        #111A2E;
  --paper:      #F6F7F9;
  --surface:    #FFFFFF;
  --surface-2:  #EEF1F4;
  --cloth:      #0E5C4F;
  --cloth-soft: #E3EFEB;
  --cloth-hi:   #127563;
  --muted:      #5A6478;
  --line:       #E2E5EA;
  --line-soft:  #EDEFF3;
  --signal:     #B3261E;
  --signal-bg:  #FBEBE9;
  --on-cloth:   #FFFFFF;

  --font-ui: "Golos Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-doc: "Source Serif 4", "Times New Roman", Georgia, serif;

  /* Одна шкала радиусов на весь сайт: инпуты и кнопки 10, карточки 14, чипы pill */
  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --r-pill: 999px;

  --t-fast: 150ms;
  --t-med:  220ms;
  --t-slow: 420ms;
  --ease:      cubic-bezier(0.23, 1, 0.32, 1);
  --ease-panel: cubic-bezier(0.32, 0.72, 0, 1);

  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 48px);

  --z-sticky: 100;
  --z-dropdown: 200;
  --z-chat: 300;
  --z-modal: 400;
  --z-cookie: 500;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Тёмная тема не инверсия: другой набор значений, ночная бумага и более светлый акцент */
    --ink:        #E8ECF3;
    --paper:      #0D1524;
    --surface:    #16203A;
    --surface-2:  #1D2947;
    --cloth:      #3BAF98;
    --cloth-soft: #17332F;
    --cloth-hi:   #56C7B0;
    --muted:      #9AA6BC;
    --line:       #26324F;
    --line-soft:  #1E2942;
    --signal:     #FF8A80;
    --signal-bg:  #3A1D1B;
    --on-cloth:   #06231D;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "ss01" on;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(34px, 5.2vw, 60px); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: clamp(27px, 3.6vw, 42px); }
h3 { font-size: clamp(19px, 2vw, 23px); letter-spacing: -0.015em; }
p  { margin: 0; text-wrap: pretty; }
a  { color: var(--cloth); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 3px solid var(--cloth);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

section { padding-block: clamp(64px, 9vw, 120px); }
section.tight { padding-block: clamp(48px, 6vw, 80px); }

.lede { color: var(--muted); font-size: clamp(17px, 1.5vw, 19px); max-width: 62ch; margin-top: 14px; }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cloth); margin-bottom: 14px;
}

/* --- Кнопки ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 52px; padding: 0 26px;
  border: 1px solid transparent; border-radius: var(--r-s);
  font: inherit; font-weight: 600; font-size: 16px; white-space: nowrap;
  cursor: pointer; text-decoration: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn-primary { background: var(--cloth); color: var(--on-cloth); }
.btn-primary:hover { background: var(--cloth-hi); }
.btn-primary:active { transform: translateY(1px) scale(0.995); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--cloth); color: var(--cloth); }
.btn-ghost:active { transform: translateY(1px); }
.btn-sm { min-height: 44px; padding: 0 18px; font-size: 15px; }

/* --- Шапка -------------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: var(--z-sticky);
  height: 68px; display: flex; align-items: center;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med) var(--ease), background var(--t-med) var(--ease);
}
.site-head.is-stuck { border-bottom-color: var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 32px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.logo svg { flex: none; }
/* Меню: четыре пункта в строку и «Ещё» для редкого. Подписи не переносятся,
   ховер — мягкая подложка, а не смена цвета на соседние пункты. */
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-right: 10px; }
.nav-links > a, .nav-more > summary {
  display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 0 12px;
  border-radius: 999px; white-space: nowrap; cursor: pointer; list-style: none;
  color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-links > a:hover, .nav-more > summary:hover, .nav-more[open] > summary {
  color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.nav-more { position: relative; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more svg { transition: transform var(--t-med) var(--ease); }
.nav-more[open] svg { transform: rotate(180deg); }
.nav-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: var(--z-dropdown);
  min-width: 220px; padding: 6px; display: grid; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: 0 20px 44px -22px color-mix(in srgb, var(--ink) 45%, transparent);
}
.nav-menu a {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500;
}
.nav-menu a:hover { background: var(--surface-2); }
.nav-menu .nav-narrow { display: none; }
/* На главной это кнопка, на внутренних страницах сборка делает из неё
   ссылку: оформление одинаковое для обоих, отсюда inline-flex и без подчёркивания. */
.nav-login {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none;
  transition: color var(--t-fast) var(--ease);
 white-space: nowrap;}
.nav-login:hover { color: var(--cloth); }
/* На телефоне и планшете внизу есть плашка с «Составить». Чтобы кнопки не
   повторялись, в шапке вместо неё вход в ИИ-помощника, а круглая плавающая
   кнопка чата не показывается — вход в чат один. */
.nav-ai { display: none; }
@media (max-width: 860px) {
  .nav-ai {
    display: inline-flex; gap: 7px; background: var(--cloth-soft); color: var(--cloth);
    border-color: color-mix(in srgb, var(--cloth) 25%, transparent);
  }
  .nav-ai:hover { background: color-mix(in srgb, var(--cloth) 18%, var(--surface)); }
  .nav > .nav-cta { display: none; }
  .chat-launch { display: none !important; }
}
/* ~1024 px: «Статьи» уходят в «Ещё», иначе строка не помещается */
@media (max-width: 1100px) {
  .nav-links > .nav-wide { display: none; }
  .nav-menu .nav-narrow { display: flex; }
}
/* кнопка в шапке не должна перекрашиваться правилом .nav a (провал контраста) */
.nav a.btn-primary { color: var(--on-cloth); }
.nav a.btn-primary:hover { color: var(--on-cloth); }
.nav a.btn-ghost { color: var(--ink); }
@media (max-width: 900px) { .nav .nav-hide { display: none; } }
@media (max-width: 560px) { .nav-links { display: none; } }
.nav-burger { display: none; position: relative; }
@media (max-width: 900px) { .nav-burger { display: block; } }
.nav-burger > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 15px; cursor: pointer; }
.nav-burger > summary::-webkit-details-marker { display: none; }
@media (max-width: 420px) { .nav-burger > summary span { display: none; } .nav-burger > summary { padding: 0; justify-content: center; } .nav-ai { padding: 0 10px; font-size: 14px; } .nav { gap: 6px; } }
.nav-burger-panel { position: fixed; right: 16px; top: calc(env(safe-area-inset-top, 0px) + 68px); z-index: 60; width: min(280px, calc(100vw - 32px)); display: grid; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); }
.nav-burger-panel a { display: flex; align-items: center; min-height: 48px; padding: 0 12px; border-radius: var(--r-s); color: var(--ink); text-decoration: none; font-weight: 600; }
.nav-burger-panel a:hover { background: var(--cloth-soft); }
.nav-burger-panel a.nb-main { background: var(--cloth); color: var(--on-cloth); margin-bottom: 4px; }

/* --- Первый экран -------------------------------------------------------- */
.hero { position: relative; padding-top: clamp(36px, 5vw, 68px); padding-bottom: clamp(56px, 7vw, 96px); overflow: hidden; }
.hero > .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: clamp(32px, 4vw, 56px); align-items: start; }
@media (min-width: 1000px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; } }

.hero h1 { max-width: 15ch; }
.hero-sub { color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); max-width: 46ch; margin-top: 18px; }

/* Поиск: главный призыв страницы */
.search-shell { margin-top: 30px; position: relative; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-s); padding: 6px 6px 6px 16px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.search-box:focus-within { border-color: var(--cloth); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cloth) 14%, transparent); }
.search-box svg { flex: none; color: var(--muted); }
.search-box input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 17px; padding: 14px 0; outline: none;
}
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-box .btn { flex: none; }
@media (max-width: 560px) {
  .search-box { flex-wrap: wrap; padding: 6px; }
  .search-box input { padding-inline: 10px; width: 100%; flex-basis: 100%; }
  .search-box .btn { width: 100%; }
  .search-box svg { display: none; }
}

.hint-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.hint-row .hint-label { font-size: 14.5px; color: var(--muted); margin-right: 2px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--r-pill); padding: 10px 15px; min-height: 44px;
  font: inherit; font-size: 14.5px; cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--cloth); color: var(--cloth); }
.chip[aria-pressed="true"] { background: var(--cloth); border-color: var(--cloth); color: var(--on-cloth); }

/* Выпадающие результаты поиска */
.results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: var(--z-dropdown);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: 0 18px 44px -18px color-mix(in srgb, var(--ink) 38%, transparent);
  max-height: min(58vh, 460px); overflow-y: auto; padding: 6px;
}
.results[hidden] { display: none !important; }
.result {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--ink); font: inherit; padding: 12px 14px; border-radius: var(--r-s); cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.result:hover, .result.is-active { background: var(--cloth-soft); }
.result b { font-weight: 600; }
.result span { display: block; color: var(--muted); font-size: 14.5px; margin-top: 3px; }
.result mark { background: color-mix(in srgb, var(--cloth) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.results-empty { padding: 16px 14px; color: var(--muted); font-size: 15px; }

/* --- Живой документ (демо на первом экране) ------------------------------ */
.demo {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l);
  overflow: hidden; box-shadow: 0 24px 60px -32px color-mix(in srgb, var(--ink) 45%, transparent);
}
.demo-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.demo-title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.demo-note { font-size: 13px; color: var(--muted); }
.demo-body { display: grid; grid-template-columns: 1fr; }
@media (min-width: 620px) { .demo-body { grid-template-columns: 0.9fr 1.1fr; } }

.demo-form { padding: 18px; display: grid; gap: 14px; align-content: start; border-bottom: 1px solid var(--line); }
@media (min-width: 620px) { .demo-form { border-bottom: 0; border-right: 1px solid var(--line); } }
.field { display: grid; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.field input {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: var(--r-s);
  background: var(--paper); color: var(--ink); font: inherit; font-size: 16px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.field input:focus { outline: none; border-color: var(--cloth); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cloth) 15%, transparent); }
.field .hint { font-size: 12.5px; color: var(--muted); }

.mic-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; width: 100%; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: var(--r-s);
  background: var(--paper); color: var(--ink); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.mic-btn:hover { border-color: var(--cloth); color: var(--cloth); }
.mic-btn[data-state="listening"] { border-color: var(--cloth); background: var(--cloth-soft); color: var(--cloth); }
.mic-btn[data-state="listening"] .mic-dot { animation: pulse 1.1s var(--ease) infinite; }
.mic-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.55); opacity: 0.45; } }
.mic-transcript { font-family: var(--font-doc); font-size: 15px; color: var(--ink); min-height: 0; }
.mic-transcript:empty { display: none; }
.mic-plan-note { display: block; font-size: 12.5px; color: var(--muted); margin-top: -4px; }

/* Лист документа */
.doc-sheet {
  padding: 20px 20px 24px; font-family: var(--font-doc); font-size: 13.6px; line-height: 1.62;
  color: var(--ink); background: var(--surface); max-height: 460px; overflow-y: auto;
}
.doc-sheet .doc-h { font-family: var(--font-doc); font-size: 15px; font-weight: 600; text-align: center; letter-spacing: 0; margin-bottom: 4px; }
.doc-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; margin: 12px 0 16px; }
.doc-sheet p { margin-bottom: 10px; }
.doc-sheet .clause-no { color: var(--muted); }
.slot {
  background: var(--cloth-soft); color: var(--cloth); border-radius: 4px; padding: 0 4px;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
.slot.is-filled { background: transparent; color: var(--ink); font-weight: 600; }
.slot.just-filled { animation: fill-flash 620ms var(--ease); }
@keyframes fill-flash {
  0%   { background: color-mix(in srgb, var(--cloth) 34%, transparent); }
  100% { background: transparent; }
}
.doc-sign { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.doc-sign-block { display: block; border-top: 1px solid var(--line); }
.doc-sign-line { margin: 0 0 8px; color: var(--ink); }
.doc-sign-line:last-child { margin-bottom: 0; }
.doc-sign + .doc-sign { border-top: 0; margin-top: 10px; padding-top: 0; }

/* --- Проблема: пункты как в договоре, без карточек ------------------------ */
.band { background: var(--surface); border-block: 1px solid var(--line); }
.clauses { margin-top: clamp(28px, 4vw, 44px); }
.clause { display: grid; grid-template-columns: 1fr; gap: 8px; padding-block: clamp(24px, 3vw, 34px); border-top: 1px solid var(--line); }
@media (min-width: 860px) { .clause { grid-template-columns: minmax(0, 24ch) minmax(0, 1fr); gap: 40px; align-items: start; } }
.clause h3 { letter-spacing: -0.02em; }
.clause p { color: var(--muted); max-width: 66ch; }
.clause .cost { display: inline-block; margin-top: 12px; font-weight: 600; color: var(--ink); }

/* --- Вторая точка входа: проверка своего документа ------------------------- */
.check-band { background: var(--surface); border-block: 1px solid var(--line); }
.check-grid { display: grid; gap: clamp(20px, 3vw, 36px); align-items: center; }
@media (min-width: 880px) { .check-grid { grid-template-columns: 1fr 1fr; } }
.check-copy h2 { font-size: clamp(23px, 2.6vw, 30px); max-width: 20ch; }
.check-copy p { color: var(--muted); margin-top: 12px; max-width: 50ch; }
.dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--r-m); background: var(--paper);
  padding: 26px 22px; text-align: center; cursor: pointer; display: block;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--cloth); background: var(--cloth-soft); }
.dropzone:focus-within { border-color: var(--cloth); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cloth) 14%, transparent); }
.dropzone svg { color: var(--cloth); margin-bottom: 10px; }
.dropzone .dz-main { font-weight: 600; font-size: 16px; }
.dropzone .dz-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-result { margin-top: 14px; font-size: 15px; color: var(--cloth); min-height: 22px; font-weight: 500; }
.check-note { margin-top: 10px; font-size: 13.5px; color: var(--muted); }

/* --- 3D-переход: из стопки бумаг один документ ---------------------------- */
.stack-wrap { display: grid; gap: clamp(24px, 4vw, 48px); align-items: center; }
@media (min-width: 940px) { .stack-wrap { grid-template-columns: 0.9fr 1.1fr; } }
.stack-copy h2 { max-width: 16ch; }
.stack-copy p { color: var(--muted); margin-top: 16px; max-width: 44ch; }
.stack-copy { position: relative; z-index: 1; }
.stack-scene { position: relative; z-index: 0; min-height: clamp(300px, 42vw, 480px); display: grid; place-items: center; }
/* Канвас шире контейнера: разлетевшиеся листы не режутся по его границе.
   Кратность повторяется в JS (stackScale()), менять вместе — и порог
   640px тоже. На узких экранах 170% бывает шире самой страницы: body
   зажимает это через overflow-x:hidden, но scrollWidth документа всё
   равно раздувается, поэтому на мобильном бleed убираем совсем. */
.stack-scene canvas {
  display: block; position: absolute; left: 50%; top: 50%;
  width: 170%; height: 170%; transform: translate(-50%, -50%);
  pointer-events: none;
}
@media (max-width: 640px) {
  .stack-scene canvas { width: 100%; height: 100%; }
}
.stack-fallback { width: min(100%, 420px); border-radius: var(--r-m); }

/* --- Как работает -------------------------------------------------------- */
.steps { display: grid; gap: clamp(28px, 4vw, 40px); margin-top: clamp(32px, 4vw, 48px); }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 36px; } }
.step img { border-radius: var(--r-m); background: var(--surface-2); aspect-ratio: 4 / 3; object-fit: cover; }
.step h3 { margin-top: 18px; }
.step p { color: var(--muted); margin-top: 8px; font-size: 16px; }

/* --- Каталог -------------------------------------------------------------- */
.cat-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.cat-search { position: relative; display: block; max-width: 560px; margin-top: 24px; }
.cat-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cat-search input {
  width: 100%; min-height: 48px; padding: 0 16px 0 44px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 16px;
}
.cat-search input:focus { outline: 2px solid var(--cloth); outline-offset: 1px; border-color: var(--cloth); }
.cat-more-wrap { margin-top: 18px; }
.cat-more-wrap:has(> [hidden]) { display: none; }
.cat-grid { display: grid; gap: 12px; margin-top: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); align-items: start; }
.cat-all { margin-top: 20px; }
.cat-all summary { cursor: pointer; color: var(--muted); font-size: 15px; padding: 8px 0; }
.cat-all-groups { display: grid; gap: 16px 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); margin-top: 8px; }
.cat-all-groups h3 { font-size: 15px; margin: 0 0 6px; }
.cat-all-groups ul { list-style: none; margin: 0; padding: 0; }
.cat-all-groups li { margin: 0 0 6px; font-size: 14px; line-height: 1.4; }
.doc-card {
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
  padding: 0; overflow: hidden; transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.doc-card:hover { border-color: color-mix(in srgb, var(--cloth) 55%, var(--line)); }
.doc-card > summary {
  list-style: none; cursor: pointer; padding: 16px 18px; display: flex; align-items: flex-start; gap: 12px; min-height: 56px;
}
.doc-card > summary::-webkit-details-marker { display: none; }
.doc-card summary .name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; flex: 1; }
.doc-card summary .min { font-size: 13px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.doc-card summary .caret { flex: none; color: var(--muted); transition: transform var(--t-med) var(--ease); margin-top: 3px; }
.doc-card[open] summary .caret { transform: rotate(180deg); }
.doc-card .body { padding: 0 18px 18px; border-top: 1px solid var(--line-soft); margin-top: 2px; padding-top: 14px; }
.doc-card .body dt { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 12px; }
.doc-card .body dt:first-child { margin-top: 0; }
.doc-card .body dd { margin: 4px 0 0; font-size: 15px; color: var(--ink); }
.doc-card .law { font-family: var(--font-doc); font-size: 13.5px; color: var(--muted); margin-top: 12px; }
.doc-card .doc-more { margin-top: 10px; font-size: 14.5px; }
.doc-card .mode-tag {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  border-radius: var(--r-pill); padding: 3px 10px; margin-top: 6px;
  background: var(--surface-2); color: var(--muted);
}
.doc-card .mode-note { margin-top: 12px; font-size: 14px; color: var(--muted); }
.doc-card summary .name-wrap { flex: 1; }
.doc-card summary .kit { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.4; color: var(--cloth); font-weight: 500; }
.doc-card .btn { margin-top: 16px; width: 100%; }
.cat-empty { color: var(--muted); padding: 24px 0; }

/* --- Разделы по темам: карточки собирает build-pages.py --update-home из temy.json --- */
.tema-grid { display: grid; gap: 14px; margin-top: clamp(26px, 3vw, 36px); grid-template-columns: 1fr; }
@media (min-width: 640px) { .tema-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .tema-grid { grid-template-columns: repeat(4, 1fr); } }
.tema-card {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
  padding: 20px 22px; text-decoration: none; color: inherit; transition: border-color .15s;
}
.tema-card:hover { border-color: var(--cloth); }
.tema-card h3 { font-size: 16.5px; line-height: 1.35; margin: 0; color: var(--ink); }
.tema-card p { font-size: 14px; color: var(--muted); margin: 0; }
.tema-card .tema-meta { margin-top: auto; padding-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--cloth); }

/* --- Сравнение до и после -------------------------------------------------- */
.compare {
  position: relative; margin-top: clamp(28px, 4vw, 40px); border-radius: var(--r-m);
  border: 1px solid var(--line); overflow: hidden; background: var(--surface);
  user-select: none; touch-action: pan-y;
}
.compare-pane { padding: clamp(20px, 3vw, 30px); font-family: var(--font-doc); font-size: 14.5px; line-height: 1.7; }
.compare-pane .pane-h { font-family: var(--font-ui); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 14px; font-weight: 600; }
.compare-after { position: absolute; inset: 0; background: var(--surface); clip-path: inset(0 0 0 var(--split, 50%)); }
.compare-before { position: relative; }
.compare del { text-decoration: none; background: var(--signal-bg); color: var(--signal); border-radius: 3px; padding: 1px 3px; box-decoration-break: clone; }
.compare ins { text-decoration: none; background: var(--cloth-soft); color: var(--cloth); border-radius: 3px; padding: 1px 3px; box-decoration-break: clone; }
.compare .flaw { display: block; font-family: var(--font-ui); font-size: 13px; color: var(--signal); margin-top: 6px; }
.compare .fixed { display: block; font-family: var(--font-ui); font-size: 13px; color: var(--cloth); margin-top: 6px; }
.compare-handle {
  position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; background: var(--cloth);
  z-index: 3; cursor: ew-resize;
}
.compare-handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%);
  border-radius: 50%; background: var(--cloth); box-shadow: 0 4px 16px -4px color-mix(in srgb, var(--ink) 60%, transparent);
}
.compare-handle::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 10px; transform: translate(-50%, -50%);
  z-index: 1;
  background: var(--on-cloth);
  clip-path: polygon(0 50%, 34% 0, 34% 35%, 66% 35%, 66% 0, 100% 50%, 66% 100%, 66% 65%, 34% 65%, 34% 100%);
}
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; z-index: 4; margin: 0; }
.compare-labels { display: flex; justify-content: space-between; margin-top: 12px; font-size: 14px; color: var(--muted); }

/* --- Калькулятор ---------------------------------------------------------- */
.calc { display: grid; gap: clamp(28px, 4vw, 44px); margin-top: clamp(28px, 4vw, 40px); }
@media (min-width: 900px) { .calc { grid-template-columns: 0.85fr 1.15fr; align-items: center; } }
.calc-control label { display: block; font-weight: 600; margin-bottom: 6px; }
.calc-out { font-size: clamp(40px, 6vw, 60px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; margin-bottom: 18px; }
.calc-out #calcWord { font-size: 0.4em; font-weight: 500; color: var(--muted); letter-spacing: -0.01em; margin-left: -0.1em; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--line); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--cloth);
  border: 4px solid var(--surface); box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--ink) 55%, transparent);
  margin-top: -11px; transition: transform var(--t-fast) var(--ease);
}
input[type="range"]::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%; background: var(--cloth); border: 4px solid var(--surface);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
.calc-rows { display: grid; gap: 2px; }
.calc-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.calc-row:first-child { border-top: 0; }
.calc-row .who { font-weight: 600; }
.calc-row .note { display: block; font-weight: 400; font-size: 14.5px; color: var(--muted); margin-top: 4px; max-width: 46ch; }
.calc-row .sum { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-row.is-us .sum { color: var(--cloth); }
.calc-row.is-risk .sum { color: var(--signal); font-size: clamp(17px, 1.8vw, 20px); }
.calc-source { margin-top: 18px; font-size: 13.5px; color: var(--muted); }

/* --- Тарифы ---------------------------------------------------------------- */
.plan-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); margin-top: 22px; }
.plan-switch button {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 15px;
  padding: 10px 18px; min-height: 44px; border-radius: var(--r-pill); cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.plan-switch button[aria-pressed="true"] { background: var(--cloth); color: var(--on-cloth); }
.plan-switch .save { font-weight: 500; opacity: 0.85; }

.picker { margin-top: 26px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 18px; }
.picker p { font-weight: 600; margin-bottom: 12px; }
.picker-options { display: flex; flex-wrap: wrap; gap: 8px; }
.picker-answer { margin-top: 14px; font-size: 15.5px; color: var(--muted); }
.picker-answer b { color: var(--cloth); }

.plans { display: grid; gap: 14px; margin-top: 26px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.plan { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 24px; display: flex; flex-direction: column; }
.plan.is-highlight { border-color: var(--cloth); border-width: 2px; padding: 23px; }
.plan.is-suggested { box-shadow: 0 0 0 4px color-mix(in srgb, var(--cloth) 16%, transparent); }
.plan .tag { display: inline-block; font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--cloth); background: var(--cloth-soft); border-radius: var(--r-pill); padding: 5px 12px; margin-bottom: 12px; align-self: flex-start; }
.plan h3 { font-size: 20px; }
.plan .price { font-size: clamp(32px, 4vw, 40px); font-weight: 700; letter-spacing: -0.04em; margin-top: 12px; font-variant-numeric: tabular-nums; }
.plan .price small { font-size: 16px; font-weight: 500; color: var(--muted); letter-spacing: -0.01em; }
.plan .price-note { font-size: 14px; color: var(--muted); margin-top: 4px; min-height: 20px; }
.plan ul { list-style: none; margin: 20px 0 24px; padding: 0; display: grid; gap: 10px; }
.plan li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 15.5px; align-items: start; }
.plan li svg { margin-top: 4px; color: var(--cloth); }
.plan .btn { margin-top: auto; width: 100%; }
.plan-foot { margin-top: 20px; color: var(--muted); font-size: 15px; max-width: 72ch; }

/* --- Юридические услуги ---------------------------------------------------- */
.ai-disclosure, .ai-diff {
  margin-top: clamp(22px, 3vw, 32px); padding: 18px 20px; border-radius: var(--r-m);
  background: var(--surface); border: 1px solid var(--line); max-width: 74ch;
}
.ai-disclosure p, .ai-diff p { color: var(--muted); font-size: 15.5px; margin-top: 10px; }
.ai-disclosure p:first-child, .ai-diff p:first-child { margin-top: 0; }
.ai-disclosure strong, .ai-diff strong { color: var(--ink); font-weight: 600; }
.services { margin-top: clamp(28px, 4vw, 40px); }
.service { display: grid; grid-template-columns: 1fr; gap: 6px; padding-block: 26px; border-top: 1px solid var(--line); }
@media (min-width: 780px) { .service { grid-template-columns: minmax(0, 22ch) minmax(0, 1fr) auto; gap: 32px; align-items: baseline; } }
.service h3 { font-size: 20px; }
.service p { color: var(--muted); }
.service .from { font-weight: 600; color: var(--ink); }

/* --- О нас ------------------------------------------------------------------ */
.about { display: grid; gap: clamp(28px, 4vw, 48px); align-items: center; }
@media (min-width: 940px) { .about { grid-template-columns: 1.05fr 0.95fr; } }
.about-text p { margin-top: 16px; color: var(--ink); max-width: 60ch; }
.about-text p.first { font-size: clamp(19px, 2.1vw, 23px); line-height: 1.45; letter-spacing: -0.015em; color: var(--ink); }
.about-text .src { margin-top: 22px; font-size: 13.5px; color: var(--muted); }
.about img { border-radius: var(--r-m); }

/* --- Отзывы и цифры ---------------------------------------------------------- */
.reviews { display: grid; gap: 14px; margin-top: clamp(26px, 3vw, 36px); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) { .reviews { grid-template-columns: repeat(2, 1fr); } }
.review { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 22px; }
.review blockquote { margin: 0; font-size: 16.5px; line-height: 1.55; }
.review figcaption { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.review img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.review .who { font-size: 14.5px; font-weight: 600; }
.review .where { font-size: 13.5px; color: var(--muted); font-weight: 400; }
.reviews-note { margin-top: 20px; font-size: 14.5px; color: var(--muted); max-width: 74ch; }

.situ-grid { display: grid; gap: 14px; margin-top: clamp(26px, 3vw, 36px); grid-template-columns: 1fr; }
@media (min-width: 760px) { .situ-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .situ-grid { grid-template-columns: repeat(3, 1fr); } }
.situ-card {
  display: block; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
  padding: 22px; text-decoration: none; color: inherit; transition: border-color .15s;
}
.situ-card:hover { border-color: var(--cloth); }
.situ-card h3 { font-size: 16.5px; line-height: 1.35; margin: 0 0 8px; color: var(--ink); }
.situ-card p { font-size: 14px; color: var(--muted); margin: 0; }
.situ-card[hidden] { display: none; }

/* Поиск по разборам: разборов будет много, человек ищет своими словами */
.situ-tools { display: grid; gap: 14px; margin-top: clamp(22px, 3vw, 30px); }
.situ-search { position: relative; display: block; max-width: 560px; }
.situ-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.situ-search input {
  width: 100%; min-height: 50px; padding: 10px 14px 10px 42px;
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--r-s);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.situ-search input:focus { outline: none; border-color: var(--cloth); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cloth) 15%, transparent); }
.situ-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.situ-count { margin: 14px 0 0; min-height: 1.4em; font-size: 14px; color: var(--muted); }
.situ-count + .situ-grid { margin-top: 10px; }
.situ-empty { margin-top: 14px; padding: 18px 20px; border: 1px dashed var(--line); border-radius: var(--r-m); color: var(--muted); }
.situ-link { border: 0; padding: 0; background: none; font: inherit; color: var(--cloth); text-decoration: underline; cursor: pointer; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 24px; margin-top: clamp(36px, 5vw, 56px); }
@media (min-width: 780px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding-block: 20px; border-top: 1px solid var(--line); }
.stat .num { font-size: clamp(30px, 4vw, 42px); font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stat .cap { color: var(--muted); font-size: 15px; margin-top: 4px; }

/* --- FAQ --------------------------------------------------------------------- */
.faq { margin-top: clamp(26px, 3vw, 36px); max-width: 860px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 44px 22px 0; position: relative;
  font-size: clamp(17px, 1.8vw, 19px); font-weight: 600; letter-spacing: -0.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 13px; height: 2px; background: var(--muted);
  transform: translateY(-50%); transition: background var(--t-fast) var(--ease);
}
.faq summary::before {
  content: ""; position: absolute; right: 8px; top: 50%; width: 13px; height: 2px; background: var(--muted);
  transform: translateY(-50%) rotate(90deg); transition: transform var(--t-med) var(--ease), background var(--t-fast) var(--ease);
}
.faq details[open] summary::before { transform: translateY(-50%) rotate(0deg); }
.faq details[open] summary::after, .faq details[open] summary::before { background: var(--cloth); }
.faq .answer { padding: 0 0 24px; color: var(--muted); max-width: 70ch; }
.faq .answer p + p { margin-top: 12px; }

/* --- Финальный призыв и форма -------------------------------------------------- */
.final { background: var(--ink); color: var(--paper); border-radius: 0; }
@media (prefers-color-scheme: dark) { .final { background: var(--surface); color: var(--ink); } }
.final h2 { color: var(--paper); max-width: 18ch; }
@media (prefers-color-scheme: dark) { .final h2, .final .final-sub { color: var(--ink); } }
.final .final-sub { color: color-mix(in srgb, var(--paper) 72%, transparent); margin-top: 14px; max-width: 52ch; }
@media (prefers-color-scheme: dark) { .final .final-sub { color: var(--muted); } }
.signup { display: flex; gap: 10px; margin-top: 26px; max-width: 520px; flex-wrap: wrap; }
.signup input {
  flex: 1 1 240px; min-height: 52px; padding: 12px 16px; border-radius: var(--r-s);
  border: 1.5px solid color-mix(in srgb, var(--paper) 28%, transparent);
  background: color-mix(in srgb, var(--paper) 8%, transparent); color: var(--paper); font: inherit; font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  .signup input { border-color: var(--line); background: var(--paper); color: var(--ink); }
}
.signup input::placeholder { color: color-mix(in srgb, var(--paper) 58%, transparent); }
@media (prefers-color-scheme: dark) { .signup input::placeholder { color: var(--muted); } }
.signup input:focus { outline: none; border-color: var(--cloth); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cloth) 30%, transparent); }
.signup input[aria-invalid="true"] { border-color: var(--signal); }
.signup .btn-primary { flex: 0 0 auto; }
.form-msg { margin-top: 12px; font-size: 15px; min-height: 22px; }
.form-msg.is-error { color: #FF9A93; }
.form-msg.is-ok { color: #8BE0C9; }
@media (prefers-color-scheme: dark) { .form-msg.is-error { color: var(--signal); } .form-msg.is-ok { color: var(--cloth); } }
.final small { display: block; margin-top: 16px; font-size: 13.5px; color: color-mix(in srgb, var(--paper) 55%, transparent); }
@media (prefers-color-scheme: dark) { .final small { color: var(--muted); } }

/* --- Подвал --------------------------------------------------------------------- */
.site-foot { background: var(--surface); border-top: 1px solid var(--line); padding-block: 56px 40px; }
.foot-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.foot-grid h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; }
.foot-grid ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.foot-grid a { color: var(--ink); text-decoration: none; font-size: 15.5px; }
.foot-grid a:hover { color: var(--cloth); text-decoration: underline; }
.footer-link-btn {
  display: inline; border: 0; background: transparent; padding: 0; font: inherit;
  color: var(--ink); text-decoration: none; font-size: 15.5px; cursor: pointer; min-height: 44px;
}
.footer-link-btn:hover { color: var(--cloth); text-decoration: underline; }
.foot-brand p { color: var(--muted); font-size: 15px; margin-top: 12px; max-width: 30ch; }
.foot-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }

/* --- Липкая панель на мобильном ------------------------------------------------- */
.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  transform: translateY(110%);
  transition: transform var(--t-slow) var(--ease-panel);
}
.sticky-bar.is-open { transform: translateY(0); }
.sticky-bar form { display: flex; gap: 8px; align-items: center; }
.sticky-bar input {
  flex: 1; min-width: 0; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-s); background: var(--surface); color: var(--ink);
}
.sticky-bar input:focus { outline: none; border-color: var(--cloth); }
.sticky-bar .btn { flex: none; padding-inline: 14px; }
/* Подсказка чуть мельче вводимого текста, чтобы «Какой документ нужен?» влезал
   целиком; сам ввод остаётся 16px — иначе iOS увеличивает страницу при фокусе. */
.sticky-bar input::placeholder { font-size: 15px; }
@media (max-width: 370px) { .sticky-bar .btn { padding-inline: 10px; } }
@media (min-width: 860px) { .sticky-bar { display: none; } }

/* --- Уведомление о cookie ---------------------------------------------------------- */
.cookie-bar {
  position: fixed; left: 16px; right: 16px; z-index: var(--z-cookie);
  bottom: calc(16px + env(safe-area-inset-bottom));
  max-width: 640px; margin-inline: auto; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--ink) 55%, transparent);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  animation: chat-in 260ms var(--ease);
}
.cookie-bar[hidden] { display: none !important; }
.cookie-bar p { font-size: 14px; color: var(--muted); flex: 1 1 260px; margin: 0; }
.cookie-bar a { color: var(--ink); text-decoration: underline; }
.cookie-bar .btn { flex: none; }
@media (max-width: 640px) {
  /* Текст — первой строкой на всю ширину, кнопки — второй строкой пополам.
     Раньше текст и кнопки стояли в одной строке: кнопки сжимались почти до
     нуля, а подпись (nowrap) вылезала поверх текста и соседней кнопки. */
  .cookie-bar { padding: 14px 16px; gap: 10px; }
  /* Текст на всю ширину, кнопки строкой ниже: иначе «Только необходимые»
     втискивалась рядом с текстом в тридцать точек и вылезала за край.
     Подпись кнопки переносится, чтобы не вылезать за край на 375 точках. */
  .cookie-bar p { flex: 1 1 100%; }
  .cookie-bar .btn {
    flex: 1 1 0; min-width: 0; min-height: 46px; padding: 6px 10px;
    font-size: 15px; line-height: 1.2; white-space: normal; text-align: center;
  }
}

/* --- Чат «Спросить ИИ» ------------------------------------------------------------- */
/* --- Вход по почте или телефону ---------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: color-mix(in srgb, var(--ink) 55%, transparent);
  display: grid; place-items: center; padding: 20px;
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
  position: relative; width: min(360px, 100%); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-l); padding: 28px 24px 24px;
  box-shadow: 0 32px 80px -28px color-mix(in srgb, var(--ink) 65%, transparent);
  animation: chat-in 220ms var(--ease);
}
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px;
  border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1;
  border-radius: var(--r-s); cursor: pointer;
}
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.login-step h3 { font-size: 21px; }
.login-sub { color: var(--muted); font-size: 14.5px; margin-top: 8px; }
#loginEnterForm, #loginCodeForm { margin-top: 16px; display: grid; gap: 10px; }
.login-step input {
  width: 100%; min-height: 50px; padding: 12px 14px; font: inherit; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-s); background: var(--paper); color: var(--ink);
}
#loginCode { letter-spacing: 0.5em; font-weight: 700; font-size: 22px; text-align: center; }
.login-step input:focus { outline: none; border-color: var(--cloth); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cloth) 15%, transparent); }
.login-step input[aria-invalid="true"] { border-color: var(--signal); }
.login-step .btn { width: 100%; }
.login-msg { font-size: 14px; min-height: 20px; }
.login-msg.is-error { color: var(--signal); }
.login-msg.is-ok { color: var(--cloth); }
.login-back {
  display: block; margin: 14px auto 0; border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 13.5px; text-decoration: underline; cursor: pointer; min-height: 44px;
}
.login-back:hover { color: var(--ink); }
.login-done-icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--cloth-soft); color: var(--cloth);
  display: grid; place-items: center; margin-bottom: 14px;
}
#loginDoneCta { margin-top: 18px; }
.login-help { margin-top: 12px; font-size: 13.5px; }

/* --- Диалог составления документа: общается с бэкендом движка (docgen-app) ------- */
.doc-modal { width: min(560px, 100%); max-height: min(680px, calc(100dvh - 40px)); overflow-y: auto; }
.doc-progress { height: 6px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.doc-progress-bar { height: 100%; background: var(--cloth); transition: width var(--t-fast) var(--ease); }
.doc-progress-label { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.doc-question-text { font-size: 17px; margin-top: 4px; }
.doc-reject { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--signal); }
.doc-legal-note { margin: 18px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.doc-legal-note a { color: var(--muted); text-decoration: underline; }
.doc-dialog-example, .doc-dialog-note { color: var(--muted); font-size: 14px; margin-top: 6px; }
.doc-answer-area { margin-top: 16px; display: grid; gap: 10px; }
.doc-answer-area input, .doc-answer-area textarea, .doc-answer-area select {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-s); background: var(--paper); color: var(--ink);
}
.doc-answer-area textarea { resize: vertical; min-height: 90px; }
.doc-answer-area input:focus, .doc-answer-area textarea:focus, .doc-answer-area select:focus {
  outline: none; border-color: var(--cloth); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cloth) 15%, transparent);
}
.doc-answer-area .btn { justify-self: start; }
.doc-options { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-option { font-size: 14.5px; text-align: left; }
.doc-list-items { display: grid; gap: 8px; margin-bottom: 4px; }
.doc-list-items li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface-2);
  font-size: 14.5px;
}
.doc-list-remove {
  border: 0; background: transparent; color: var(--signal); font: inherit; font-size: 13.5px;
  text-decoration: underline; cursor: pointer; min-height: 32px; flex: 0 0 auto;
}
.doc-list-form { display: grid; gap: 10px; padding-top: 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.doc-subfield { display: grid; gap: 5px; font-size: 13.5px; color: var(--muted); }
.doc-list-error { color: var(--signal); font-size: 13.5px; }
.doc-dialog-hint { color: var(--signal); font-size: 14px; margin-top: 10px; }
.doc-dialog-error { color: var(--signal); font-size: 14px; margin-top: 10px; min-height: 1em; }
.doc-dialog-error.doc-payment-box { color: inherit; }
.doc-payment-note { color: var(--muted); font-size: 13px; margin-top: 10px; }
.doc-payment-msg { color: var(--signal); font-size: 14px; margin: 0 0 10px; }
.doc-payment-options { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-format-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.doc-dialog-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.doc-back {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px;
  text-decoration: underline; cursor: pointer; min-height: 44px;
}
.doc-back:hover { color: var(--ink); }
.doc-dialog-loading { color: var(--muted); font-size: 15px; padding: 40px 0; text-align: center; }
.doc-preview-frame {
  margin-top: 14px; max-height: 320px; overflow-y: auto; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--paper);
}
.cab-modal { width: min(640px, 100%); max-height: min(720px, calc(100dvh - 40px)); overflow-y: auto; }
.cab-modal h3 { margin: 0 0 4px; }
.cab-modal h4 { margin: 22px 0 8px; font-size: 16px; }
.cab-email { color: var(--muted); font-size: 14px; margin: 0; }
/* «Удалить аккаунт» стоит в конце раздела «Подписка и оплата», отдельно от «Выйти». */
.cab-account-del { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
/* Подпись кнопки в блоке подписки переносится: «Отказаться и вернуть деньги за
   неиспользованные дни» была шире экрана телефона (467 px при колонке 309 px) и обрезалась. */
.cab-sub .btn { white-space: normal; text-align: left; height: auto; min-height: 44px; padding-block: 10px; max-width: 100%; box-sizing: border-box; }
.cab-link { background: none; border: 0; padding: 0; font: inherit; color: var(--cloth); text-decoration: underline; cursor: pointer; }
.cab-sub { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--paper); font-size: 15px; }
.cab-sub p { margin: 0 0 6px; }
.cab-sub p:last-child { margin-bottom: 0; }
.cab-sub .btn { margin-top: 8px; }
.cab-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cab-doc { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-s); }
.cab-doc-name { font-weight: 600; font-size: 15px; }
.cab-doc-meta { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.cab-doc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cab-doc-confirm { font-size: 14px; }
.cab-msg { color: var(--signal); font-size: 14px; margin: 10px 0 0; min-height: 1em; }
.cab-empty { color: var(--muted); font-size: 15px; }
.cab-demo { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r-s); background: var(--signal-bg); color: var(--ink); font-size: 14px; }
.cab-limits { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.cab-reqs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.cab-req { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); font-size: 14.5px; }
.cab-req b { display: block; font-weight: 600; }
.cab-req span { color: var(--muted); font-size: 13.5px; }
.cab-req-note { margin: 8px 0 0; font-size: 14.5px; white-space: pre-line; }
.cab-req .cab-sub-buy { margin-top: 10px; }
.cab-req-stages { margin: 8px 0 0; padding-left: 18px; font-size: 14.5px; }
.cab-req-stages li { margin: 2px 0; }
.cab-form label { display: block; margin-top: 12px; font-weight: 600; font-size: 14.5px; }
.cab-form input[type=text], .cab-form textarea, .cab-form select { width: 100%; margin-top: 6px; }
.cab-form textarea { min-height: 150px; }
.cab-form .cab-count { color: var(--muted); font-size: 13px; font-weight: 400; }
.doc-voice { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font: inherit; font-size: 14px; cursor: pointer; }
.doc-voice[data-state="listening"] { border-color: var(--signal); color: var(--signal); }
.doc-heard { color: var(--cloth); }
.plan-buy { margin-bottom: 10px; }
.plan-autopay { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 6px 0 0; }
.plan-buy-msg { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; min-height: 1em; }
.cab-sub-buy { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cab-files { list-style: none; margin: 6px 0 0; padding: 0; font-size: 14px; color: var(--muted); }
.cab-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.final-steps { list-style: none; margin: 18px auto 0; padding: 0; display: grid; gap: 10px; max-width: 620px; text-align: left; }
.final-steps li { padding: 12px 16px; border-radius: var(--r-s); background: color-mix(in srgb, var(--on-cloth) 10%, transparent); font-size: 15px; }
@media (prefers-color-scheme: dark) { .final-steps li { background: color-mix(in srgb, var(--ink) 8%, transparent); } }

/* --- Кабинет и проверка договора страницей (/kabinet, /proverka) ------------- */
html.page-open { overflow: hidden; }
.modal-backdrop.page-full { place-items: stretch; padding: 0; background: var(--paper); overflow-y: auto; }
.page-full > .modal {
  width: 100%; max-width: none; max-height: none; min-height: 100%; overflow: visible;
  border: 0; border-radius: 0; box-shadow: none; padding: 0; animation: none; background: var(--paper);
}
.page-full .modal-close { position: fixed; top: 14px; right: 16px; z-index: 2; background: var(--surface); border: 1px solid var(--line); }
.page-full #cabBody, .page-full #chkBody { max-width: 1180px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) 16px 64px; }
.pg-crumbs { font-size: 14px; color: var(--muted); margin: 0 0 10px; padding-right: 52px; }
.pg-crumbs a { color: var(--muted); }
.pg-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pg-head h3 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; margin: 0; letter-spacing: -0.02em; }
.pg-lead { color: var(--muted); font-size: 16px; margin: 8px 0 0; max-width: 62ch; }
.cab-grid { display: grid; gap: 20px; margin-top: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .cab-grid { grid-template-columns: 280px minmax(0, 1fr); align-items: start; } }
.cab-side { display: grid; gap: 14px; min-width: 0; }
.cab-main { min-width: 0; }
.cab-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px; min-width: 0; }
.cab-avatar { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--cloth); color: var(--on-cloth); font-weight: 700; }
.cab-who { display: block; margin-top: 10px; font-weight: 600; overflow-wrap: anywhere; }
.cab-plan { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.cab-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
@media (min-width: 900px) { .cab-nav { flex-direction: column; overflow: visible; } }
.cab-nav button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 10px; background: none; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; text-align: left;
}
.cab-nav button:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.cab-nav button[aria-current="true"] { background: var(--surface); border-color: var(--line); font-weight: 600; }
.cab-nav .cnt { color: var(--muted); font-size: 13px; font-weight: 500; }
.cab-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.cab-tools input, .cab-tools select {
  min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit;
}
.cab-tools input { flex: 1 1 220px; min-width: 0; font-size: 16px; }
.cab-tools select { font-size: 16px; }
.cab-tip { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r-s); background: var(--cloth-soft); font-size: 14.5px; }
.cab-full-docs { margin-top: 14px; }
.cab-full-docs .cab-doc { background: var(--surface); padding: 14px 16px; }
.cab-doc-main { display: flex; gap: 12px; align-items: center; min-width: 0; flex: 1 1 260px; }
.cab-doc-main > div { min-width: 0; }
.cab-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); color: var(--cloth); }
.cab-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--signal-bg); color: var(--ink); vertical-align: 1px; }
.cab-badge.ok { background: var(--cloth-soft); color: var(--cloth); }
.cab-prog { display: block; height: 4px; margin-top: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; max-width: 240px; }
.cab-prog i { display: block; height: 100%; background: var(--cloth); }
.chk-grid { display: grid; gap: 20px; margin-top: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .chk-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); align-items: start; } }
.chk-form textarea { width: 100%; min-height: 260px; margin-top: 10px; padding: 12px 14px; font: inherit; font-size: 16px; resize: vertical; border: 1.5px solid var(--line); border-radius: var(--r-s); background: var(--paper); color: var(--ink); }
.chk-progress { margin: 0; padding-left: 22px; display: grid; gap: 8px; color: var(--muted); }
.chk-progress li.is-on { color: var(--ink); font-weight: 600; }
.chk-progress li.is-on::after { content: " …"; animation: dot 1.2s infinite; }
.chk-progress li.is-done { color: var(--cloth); }
.chk-progress li.is-done::after { content: " ✓"; }
.chk-muted { color: var(--muted); font-style: italic; }
.chat-lawyer-btn { margin-top: 8px; }
.chk-form textarea:focus { outline: none; border-color: var(--cloth); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cloth) 15%, transparent); }
.chk-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.chk-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; font-size: 15px; }
.chk-steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; }
.chk-steps b { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); font-size: 14px; }
.chk-items { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.chk-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px 18px; }
.chk-item h4 { margin: 0; font-size: 16.5px; }
.chk-item dl { margin: 0; }
.chk-item dt { font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 12px; }
.chk-item dd { margin: 4px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.chk-item blockquote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--line); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 14.5px; }
.chk-norm { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.chk-hist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; }
.doc-live { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.doc-live > summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--cloth); list-style: none; }
.doc-live > summary::-webkit-details-marker { display: none; }
.doc-live > summary::after { content: " ▾"; }
.doc-live[open] > summary::after { content: " ▴"; }
.doc-live-note, .doc-live-loading { color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.doc-preview-iframe { display: block; width: 100%; height: clamp(340px, 52vh, 560px); margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; }
.doc-live .doc-preview-iframe { height: clamp(260px, 42vh, 460px); margin-top: 10px; }
.doc-preview-frame mark.empty { background: var(--signal-bg); color: var(--signal); padding: 0 3px; border-radius: 3px; }
.doc-warnings-more { margin-top: 14px; font-size: 14px; }
.doc-warnings-more summary, .doc-edit summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--cloth); font-weight: 600; }
.doc-edit { margin-top: 12px; font-size: 14px; }
.doc-option-none { border-style: dashed; color: var(--muted); }
.doc-payment-options .doc-payment-option { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; text-align: left; white-space: normal; width: 100%; min-height: 52px; height: auto; padding: 10px 14px; }
.doc-payment-option .w { font-weight: 400; font-size: 13px; opacity: 0.8; }
.doc-payment-more { margin-top: 10px; font-size: 14px; }
.doc-payment-more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--cloth); font-weight: 600; }
.doc-after { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-s); background: var(--cloth-soft); }
.doc-after-title { margin: 0; font-weight: 700; }
.doc-after-note { margin: 6px 0 10px; font-size: 14px; color: var(--muted); }
.doc-edit-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.doc-edit-item { width: 100%; min-height: 44px; text-align: left; display: grid; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.doc-edit-item .v { color: var(--muted); font-size: 13px; }
.doc-group { display: grid; gap: 16px; }
.doc-group-row { display: grid; gap: 6px; }
.doc-group-row label { font-weight: 500; font-size: 15px; line-height: 1.4; }
.doc-group-row input, .doc-group-row textarea, .doc-group-row select { width: 100%; box-sizing: border-box; font-size: 16px; }
.doc-group-example { color: var(--muted); font-size: 13.5px; }
.doc-group-opt { color: var(--muted); font-weight: 400; font-size: 13px; }
.doc-group-row.has-error input, .doc-group-row.has-error textarea, .doc-group-row.has-error select { border-color: var(--signal); }
.doc-group-row textarea { min-height: 64px; }
.doc-field-error { margin: 0; color: var(--signal); font-size: 14px; }
/* Общая ошибка экрана (правило шаблона без поля, контракт 0.29): строкой над кнопкой отправки. */
.doc-group .doc-batch-error { margin: 0; }
.doc-opt-actions .doc-batch-error { margin: 0 0 10px; }
/* Управляющее поле экрана типовых условий: от выбора зависят следующие вопросы. Спокойная пометка, не ошибка. */
.doc-typical-controls { padding: 12px 14px; border-radius: var(--r-s); background: var(--surface-2); border-left: 3px solid var(--cloth); }
.doc-typical-controls.has-error { border-left-color: var(--signal); }
.doc-branch-mark { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink); }
.doc-branch-mark svg { flex: none; margin-top: 1px; color: var(--cloth); }
.doc-people { display: grid; gap: 8px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--r-s); }
.doc-people-title { margin: 0; font-weight: 500; font-size: 14.5px; }
.doc-people-note { margin: 0; color: var(--muted); font-size: 13.5px; }
.doc-optional { gap: 8px; }
.doc-opt-row { border: 1px solid var(--line); border-radius: var(--r-s); padding: 0; }
.doc-opt-toggle { width: 100%; min-height: 44px; text-align: left; padding: 10px 14px; background: none; border: 0; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.doc-opt-toggle::before { content: "+"; font-weight: 600; color: var(--accent, var(--ink)); }
.doc-opt-toggle[aria-expanded="true"]::before { content: "\2212"; }
.doc-opt-row .doc-group-row { padding: 0 14px 12px; }
.doc-opt-row .doc-group-row[hidden] { display: none; }
.doc-opt-row.has-error { border-color: var(--signal); }
.doc-opt-actions { margin-top: 8px; }
/* Предупреждения правил шаблона: ответ принят, просьба проверить. Спокойный зелёный блок, не ошибка. */
.doc-notice { margin: 12px 0 4px; padding: 12px 14px; border-radius: var(--r-s); background: var(--cloth-soft); border-left: 3px solid var(--cloth); }
.doc-notice-title { margin: 0 0 6px; font-weight: 600; font-size: 14.5px; }
.doc-notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.5; }
.doc-notice-list li { display: grid; justify-items: start; gap: 0; overflow-wrap: anywhere; }
.doc-notice-edit { min-height: 44px; padding: 0; background: none; border: 0; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--cloth); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.doc-notice-more { margin-top: 2px; }
.doc-notice-more summary { min-height: 44px; display: flex; align-items: center; font-size: 14.5px; font-weight: 600; color: var(--cloth); cursor: pointer; }
.doc-notice-more summary::-webkit-details-marker { display: none; }
.doc-notice-more summary::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 9px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.doc-notice-more[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.doc-notice-more[open] summary { margin-bottom: 4px; }
.doc-warnings-info { margin-top: 14px; padding-left: 20px; color: var(--muted); font-size: 13.5px; display: grid; gap: 6px; }
.doc-warnings-important {
  margin-top: 14px; padding: 14px 16px; border-radius: var(--r-s);
  background: var(--signal-bg); border: 1px solid color-mix(in srgb, var(--signal) 35%, transparent);
}
.doc-warnings-important p { font-size: 14.5px; margin-bottom: 8px; }
.doc-warnings-important p:last-of-type { margin-bottom: 0; }
.doc-confirm { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.doc-confirm-hint { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.doc-confirm input { width: 18px; height: 18px; }
.doc-download-row { margin-top: 18px; }
.doc-download-row .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.doc-companions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.doc-companions-title { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }
.doc-companions-note { color: var(--muted); font-size: 13.5px; margin-bottom: 10px; }
.doc-companion-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.doc-companion-row:first-of-type { border-top: 0; }
.doc-companion-info { font-size: 14px; }
.doc-companion-info .when { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.doc-companion-row .btn { flex: none; }

.chat-launch {
  position: fixed; right: 20px; bottom: 20px; z-index: var(--z-chat);
  display: inline-flex; align-items: center; gap: 9px; min-height: 52px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  box-shadow: 0 12px 32px -12px color-mix(in srgb, var(--ink) 55%, transparent);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.chat-launch:hover { border-color: var(--cloth); transform: translateY(-1px); }
@media (max-width: 860px) {
  /* на узком экране кнопка сжимается в круг, чтобы не перекрывать содержимое */
  .chat-launch {
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: 16px; width: 52px; padding: 0; justify-content: center;
  }
  .chat-launch .chat-launch-text { display: none; }
  /* Плавающие панели не наслаиваются: пока висит плашка про cookie, кнопки
     чата нет вовсе; когда снизу появляется поиск, кнопка поднимается над ним
     ровно на его высоту, а не на число, подобранное на глаз. */
  body.cookie-open .chat-launch { display: none; }
  body.sticky-open .chat-launch { bottom: calc(20px + 68px + env(safe-area-inset-bottom)); }
  /* Плашка cookie и липкий поиск идут по очереди, а не друг над другом: вместе они
     закрывали около 200 px телефона. Пока человек не ответил про cookie, поиск
     спрятан и плашка стоит внизу одна; после ответа поиск выезжает сам. */
  body.cookie-open .sticky-bar { transform: translateY(110%); visibility: hidden; }
}

.chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: var(--z-chat);
  width: min(370px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 40px));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  box-shadow: 0 28px 70px -24px color-mix(in srgb, var(--ink) 60%, transparent);
  transform-origin: bottom right;
}
@media (max-width: 860px) { .chat-panel { bottom: 84px; right: 16px; left: 16px; width: auto; } }
.chat-panel[hidden] { display: none !important; }
.chat-panel.is-in { animation: chat-in 260ms var(--ease); }
@keyframes chat-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-head .t { font-weight: 600; font-size: 15.5px; }
.chat-head .s { font-size: 13px; color: var(--muted); }
.chat-close { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; width: 44px; height: 44px; border-radius: var(--r-s); font-size: 20px; line-height: 1; }
.chat-close:hover { background: var(--surface-2); color: var(--ink); }
.chat-log { flex: 1 1 auto; min-height: 160px; overflow-y: auto; padding: 16px; display: grid; gap: 10px; align-content: start; }
.msg { max-width: 84%; padding: 11px 14px; border-radius: var(--r-m); font-size: 15px; line-height: 1.5; white-space: pre-line; }
.msg.bot { background: var(--surface-2); justify-self: start; border-bottom-left-radius: 5px; }
.msg.me { background: var(--cloth); color: var(--on-cloth); justify-self: end; border-bottom-right-radius: 5px; }
.msg.typing span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite; }
.msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }
/* Блоки живого ответа: предупреждения, непроверенное, опоры, документы.
   Непроверенное намеренно отбито цветом и рамкой: сливать его с ответом
   нельзя, это разные по надёжности вещи. */
.chat-wait { justify-self: start; max-width: 90%; font-size: 13px; color: var(--muted); padding: 0 2px; }
.chat-progress { width: 84%; font-size: 13.5px; color: var(--muted); }
.chat-progress-row { display: flex; justify-content: space-between; gap: 12px; }
.chat-progress-pct { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.chat-progress-track { height: 5px; margin-top: 8px; border-radius: 3px; background: var(--line); overflow: hidden; }
.chat-progress-fill { width: 0; height: 100%; border-radius: 3px; background: var(--cloth); transition: width 0.2s linear; }
.chat-note {
  justify-self: start; max-width: 90%; font-size: 13.5px; line-height: 1.5;
  padding: 10px 12px; border-radius: 10px; background: var(--surface-2);
  border-left: 3px solid var(--line); color: var(--ink);
}
.chat-note p { margin: 4px 0 0; }
.chat-unverified { border-left-color: var(--signal); }
.chat-unverified strong { font-size: 13px; }
.chat-lawyer { border-left-color: var(--cloth); }
.chat-docs { justify-self: start; max-width: 90%; display: grid; gap: 8px; }
.chat-doc {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14px;
}
.chat-cites { justify-self: start; max-width: 90%; font-size: 12.5px; color: var(--muted); }
.chat-steps { justify-self: start; max-width: 90%; font-size: 14px; }
.chat-steps-t { font-weight: 600; margin-bottom: 4px; }
.chat-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.chat-cites-t { font-weight: 600; margin-bottom: 3px; }
.chat-cite { line-height: 1.5; }
.chat-foot { justify-self: start; max-width: 90%; font-size: 12px; color: var(--muted); line-height: 1.5; }
.chat-fb { justify-self: start; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.chip-sm { font-size: 13px; padding: 6px 12px; min-height: 32px; }
.chat-consent {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 16px 0;
  font-size: 12.5px; line-height: 1.45; color: var(--muted);
}
.chat-consent input { margin-top: 2px; flex: none; width: 16px; height: 16px; }
.chat-opts {
  padding: 12px 16px 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px;
  flex: 0 1 auto; max-height: 168px; overflow-y: auto;
}
.chat-opts .chip { font-size: 14px; padding: 10px 13px; min-height: 44px; }
.chat-input-row { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat-input-row input {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 10px 16px; font: inherit; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--paper); color: var(--ink);
}
.chat-input-row input:focus { outline: none; border-color: var(--cloth); }
.chat-mic, .chat-send {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.chat-mic { border: 1.5px solid var(--line); background: var(--paper); color: var(--muted); }
.chat-mic:hover { border-color: var(--cloth); color: var(--cloth); }
.chat-mic[data-state="listening"] { border-color: var(--cloth); background: var(--cloth-soft); color: var(--cloth); }
.chat-mic[data-state="listening"] .mic-dot { animation: pulse 1.1s var(--ease) infinite; }
.chat-mic[hidden] { display: none; }
.chat-send { border: 0; background: var(--cloth); color: var(--on-cloth); }
.chat-send:hover { background: var(--cloth-hi); }

/* --- Появление секций (JS добавляет .is-in) --------------------------------------- */
/* Контент виден по умолчанию. Скрывает его только JS и только для блоков ниже
   экрана: если скрипт не отработал или вкладка была в фоне, страница остаётся целой. */
.reveal { opacity: 1; }
.reveal.will-reveal { opacity: 0; transform: translateY(18px); }
.reveal.will-reveal.is-in { opacity: 1; transform: none; transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.no-motion .reveal, .no-js .reveal { opacity: 1 !important; transform: none !important; }

.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;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 999; background: var(--cloth); color: var(--on-cloth);
  padding: 12px 18px; border-radius: var(--r-s); font-weight: 600; text-decoration: none;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 12px; }

/* --- Страница документа (build-pages.py) --------------------------------------- */
.doc-wrap { max-width: 780px; }

.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 28px; font-size: 14px; color: var(--muted);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--cloth); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.crumbs .sep { color: var(--muted); }

.doc-wrap h1 { margin-top: 18px; overflow-wrap: anywhere; }
/* Длинное слово в заголовке («предпринимательство») на 375 точках шире колонки:
   переносим только когда слово целиком не влезает. */
.legal-meta { color: var(--muted); font-size: 14px; margin-top: 10px; }
.situ-source { color: var(--muted); font-size: 14px; margin-top: 10px; }
.situ-source a { color: var(--muted); text-decoration: underline; }
.situ-source a:hover { color: var(--cloth); }
.situ-docs { margin-top: 40px; }
.situ-links {
  margin-top: 32px; padding: 18px 22px; border-radius: var(--r-m);
  background: var(--cloth-soft); border: 1px solid color-mix(in srgb, var(--cloth) 26%, transparent);
}
.doc-wrap .situ-links h2 { margin: 0 0 8px; font-size: 16px; color: var(--cloth); }
.situ-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.situ-links a { font-size: 15.5px; color: var(--ink); text-decoration: underline; }
.situ-links a:hover { color: var(--cloth); }
.stati-related {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line);
}
.stati-related h2 { margin: 0 0 10px; font-size: 16px; }
.stati-related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stati-related a { font-size: 15.5px; color: var(--ink); text-decoration: underline; }
.stati-related a:hover { color: var(--cloth); }
.legal-wrap h2 + p, .legal-wrap p + p { margin-top: 12px; }
.doc-lead { color: var(--muted); font-size: clamp(17px, 1.5vw, 19px); max-width: 62ch; margin-top: 14px; }
.doc-mode {
  margin: 22px 0 0; padding: 16px 18px; border-radius: var(--r-m);
  background: var(--cloth-soft); border: 1px solid color-mix(in srgb, var(--cloth) 26%, transparent);
}
.doc-mode strong { display: block; font-size: 15px; margin-bottom: 6px; color: var(--cloth); }
.doc-mode p { font-size: 15px; color: var(--ink); margin: 0; }
.doc-illustration { width: 100%; max-width: 520px; margin: 26px 0 4px; border-radius: var(--r-m); background: var(--surface); }

.doc-facts {
  margin: 32px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px 28px; padding: 22px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-m);
}
.doc-facts dt { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 0; }
.doc-facts dd { margin: 6px 0 0; font-size: 16px; color: var(--ink); }

.doc-wrap h2 { margin-top: 48px; font-size: clamp(24px, 3vw, 32px); }

.doc-steps { list-style: none; counter-reset: step; margin: 24px 0 0; padding: 0; display: grid; gap: 22px; }
.doc-steps li { position: relative; padding-left: 46px; }
.doc-steps li::before {
  counter-increment: step; content: counter(step); position: absolute; left: 0; top: 1px;
  width: 32px; height: 32px; border-radius: var(--r-pill); background: var(--cloth-soft);
  color: var(--cloth); font-weight: 700; font-size: 14px; font-family: var(--font-ui);
  display: flex; align-items: center; justify-content: center;
}
.doc-steps h3 { font-size: 17px; margin: 0 0 6px; }
.doc-steps p { color: var(--muted); margin: 0; }

.doc-warn { margin-top: 32px; background: var(--signal-bg); border-radius: var(--r-m); padding: 20px 22px; }
.doc-warn p { color: var(--ink); font-size: 15.5px; margin: 0; }

.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-of-type { border-bottom: 1px solid var(--line); }

.doc-top-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 22px; }
.doc-top-cta .btn { white-space: normal; text-align: center; max-width: 100%; box-sizing: border-box; }
.doc-top-cta-note { color: var(--muted); font-size: 14.5px; line-height: 1.4; max-width: 44ch; }
@media (max-width: 560px) {
  .doc-top-cta { flex-direction: column; align-items: stretch; gap: 10px; }
  .doc-top-cta .btn { width: 100%; justify-content: center; }
  .doc-top-cta-note { text-align: center; max-width: none; }
}

.doc-cta {
  margin-top: 48px; padding: clamp(28px, 4vw, 40px); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-l); text-align: center;
}
.doc-cta h2 { margin-top: 0; font-size: clamp(22px, 3vw, 28px); }
.doc-cta .doc-cta-note { color: var(--muted); margin-top: 10px; }
.doc-cta .btn { margin-top: 20px; }
/* Название документа в кнопке бывает длинным («Претензия соседям о возмещении
   ущерба от залива: составить бесплатно»); общий .btn запрещает перенос, и на
   телефоне кнопка уезжала за экран на 700 точек, страница получала
   горизонтальную прокрутку. */
.doc-cta .btn { white-space: normal; text-align: center; max-width: 100%; box-sizing: border-box; }

.doc-related { margin-top: 48px; padding-bottom: 56px; }
.doc-related ul { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; }
.doc-related a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 44px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r-m);
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.doc-related a:hover { border-color: var(--cloth); color: var(--cloth); }
.doc-related .min { color: var(--muted); font-weight: 400; font-size: 14px; white-space: nowrap; }
/* Строка списка документов: карточка-ссылка и рядом кнопка «Составить». */
.doc-row { display: flex; gap: 10px; align-items: stretch; }
.doc-row > a:first-child { flex: 1 1 auto; min-width: 0; }
.doc-related a.doc-row-cta {
  flex: none; justify-content: center; padding: 0 18px; min-height: 48px;
  background: var(--cloth); border-color: var(--cloth); color: var(--on-cloth);
}
.doc-related a.doc-row-cta:hover { background: var(--cloth-hi); border-color: var(--cloth-hi); color: var(--on-cloth); }
@media (max-width: 560px) {
  /* Рядом с кнопкой карточке тесно: время под названием, а не сбоку. */
  .doc-row { align-items: center; gap: 8px; }
  .doc-row > a:first-child { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 12px 14px; }
  .doc-related a.doc-row-cta { padding: 0 12px; min-height: 44px; font-size: 14px; border-radius: var(--r-s); }
}

.site-foot .foot-brand p { margin-top: 12px; }

.stati-glyph {
  display: inline-block; margin-top: 28px; padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--cloth-soft); color: var(--cloth); font-weight: 700; font-size: 13px;
  letter-spacing: 0.04em; font-family: var(--font-ui);
}
.stati-wrap .stati-glyph + h1 { margin-top: 12px; }

.fork-block {
  margin-top: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px;
}
.fork-card { padding: 20px 22px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); }
.fork-card h3 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.fork-card p { margin: 0; font-size: 15.5px; color: var(--ink); }
.fork-card.fork-fact { border-color: color-mix(in srgb, var(--cloth) 30%, var(--line)); background: var(--cloth-soft); }
.fork-card.fork-fact h3 { color: var(--cloth); }

.stati-cta { margin-top: 40px; }
.stati-cta-more { margin: 14px 0 0; font-size: 15px; }
.stati-law { color: var(--muted); font-size: 13.5px; margin-top: 18px; }

.stati-index-wrap .stati-cat { margin-top: 44px; }
.stati-index-wrap .stati-cat:first-of-type { margin-top: 32px; }
.stati-index-wrap .stati-cat h2 { font-size: clamp(20px, 2.4vw, 26px); margin: 0 0 16px; }
.stati-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.stati-card {
  display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-m);
  color: var(--ink); text-decoration: none; background: var(--surface);
}
.stati-card:hover { border-color: var(--cloth); }
.stati-card h3 { margin: 0 0 8px; font-size: 16px; }
.stati-card p { margin: 0; font-size: 14px; color: var(--muted); }
.stati-card-cat { display: block; margin-top: 10px; font-size: 12.5px; color: var(--cloth); font-weight: 600; }
/* Списки статей (/stati и разделы /tema): на компьютере 4 карточки в ряд, на планшете 3, на телефоне 2 (решение владельца 26.09). */
.doc-wrap.stati-index-wrap { max-width: 1200px; }
.stati-index-wrap > h1, .stati-index-wrap > .lead, .stati-index-wrap > p, .stati-index-wrap .stati-search { max-width: 780px; }
/* В разделе текст остаётся шириной 780, а сетка статей выходит шире, по центру. */
.tema-wrap > .stati-grid { width: min(1168px, calc(100vw - 32px)); position: relative; left: 50%; transform: translateX(-50%); }
.stati-index-wrap .stati-grid, .tema-wrap > .stati-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1023px) { .stati-index-wrap .stati-grid, .tema-wrap > .stati-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .stati-index-wrap .stati-grid, .tema-wrap > .stati-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stati-index-wrap .stati-card, .tema-wrap .stati-card { padding: 12px 12px; }
  .stati-index-wrap .stati-card h3, .tema-wrap .stati-card h3 { font-size: 14.5px; overflow-wrap: break-word; }
  .stati-index-wrap .stati-card p, .tema-wrap .stati-card p { font-size: 13px; overflow-wrap: anywhere; hyphens: auto;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
}

.stati-search { margin-top: 28px; }
.stati-search-field {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 18px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
}
.stati-search-field:focus-within { border-color: var(--cloth); }
.stati-search input {
  flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent;
  font: inherit; font-size: 16px; color: var(--ink); outline: none;
}
.stati-search input::placeholder { color: var(--muted); }
.stati-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.stati-examples button {
  min-height: 36px; padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer;
}
.stati-examples button:hover { border-color: var(--cloth); color: var(--cloth); }
.stati-status { margin-top: 18px; font-size: 14px; color: var(--muted); }
.stati-empty { margin-top: 18px; color: var(--muted); }
.stati-empty a { color: var(--cloth); }
#statiResults { margin-top: 18px; }

.tema-wrap > h2, .tema-wrap .doc-related h2 { margin-top: 44px; font-size: clamp(22px, 2.6vw, 28px); }
.tema-wrap .doc-related { margin-top: 0; padding: 0; }
.tema-wrap .stati-grid { margin-top: 18px; }
.tema-wrap .doc-cta { margin-top: 56px; margin-bottom: 56px; }
.tema-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tema-chips a.chip { display: inline-flex; align-items: center; text-decoration: none; }
.tema-chips a.chip:hover { border-color: var(--cloth); color: var(--cloth); }
.faq-src { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.faq-src a { color: var(--cloth); }
.tema-more { margin: 14px 0 0; font-size: 15px; }
.tema-more a { color: var(--cloth); }

.instr-wrap h2 { scroll-margin-top: 90px; }
.instr-meta { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.instr-short {
  margin-top: 28px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface-2);
}
.instr-short h2 { margin: 0 0 10px; font-size: 18px; }
.instr-short ul { margin: 0; padding-left: 20px; }
.instr-short li { margin: 6px 0; }
.instr-toc { margin-top: 24px; font-size: 15.5px; }
.instr-toc h2 { margin: 0 0 8px; font-size: 16px; color: var(--cloth); }
.instr-toc ol { margin: 0; padding-left: 22px; }
.instr-toc li { margin: 4px 0; }
.instr-toc a { color: var(--ink); }
.instr-body p { margin: 14px 0 0; }
.instr-body h2 { margin-top: 40px; font-size: clamp(22px, 2.6vw, 28px); }
.instr-steps { margin: 14px 0 0; padding-left: 24px; }
.instr-steps li { margin: 10px 0; }
.instr-note {
  margin-top: 18px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r-m);
  background: var(--surface-2); font-size: 15.5px;
}
.instr-body p a, .instr-steps a, .instr-note a, .instr-short a, .faq a { color: var(--cloth); }
