/* LIFE B12 — токены оформления публичного контура.
   Источник значений: ТЗ 13.09.2026, разделы 5 и 6; раздел 15 актуальной части.
   Ничего не добавлять «на глаз»: новый токен сначала появляется здесь. */

:root {
  color-scheme: light;

  /* Базовый шаг 4px, шкала отступов из раздела 3 */
  --s-4: 4px;   --s-8: 8px;   --s-12: 12px; --s-16: 16px; --s-20: 20px;
  --s-24: 24px; --s-32: 32px; --s-40: 40px; --s-48: 48px; --s-64: 64px;
  --s-72: 72px; --s-80: 80px; --s-96: 96px; --s-120: 120px;

  /* Радиусы назначаются по ролям (раздел 6) */
  --r-field: 12px;
  --r-card: 20px;
  --r-task: 16px;
  --r-badge: 8px;
  --r-hero-btn: 14px;

  /* Цвет — светлая тема. Палитра презентационного комплекта (Оренбург, 2026).
     Каждое сочетание проверено измерением, а не перенесено на глаз:

       #20A78E на бумаге #F7F9FA   = 2,85  — текстом использовать нельзя
       белый текст на #20A78E      = 3,01  — подписью кнопки использовать нельзя
       #6B7C86 на бумаге           = 4,10  — вторичным текстом использовать нельзя

     Поэтому изумруд презентации остаётся фирменным цветом заливок, свечения
     и границ, а для текста и кнопок взяты затемнённые варианты того же тона. */
  --c-bg: #F7F9FA;
  --c-surface: #FFFFFF;
  --c-surface-2: #F1F6F6;
  --c-text: #102B3B;
  --c-text-2: #65757E;          /* 4,52 на бумаге */
  --c-text-3: #AEBBC4;          /* только для крупного и декоративного */
  --c-divider: #CFDDE3;
  --c-divider-2: #C9DDE6;
  --c-brand: #20A78E;           /* заливки, границы, свечение — не текст */
  --c-brand-ink: #19816D;       /* 4,52 на бумаге: рубрики, ссылки, подписи кнопок */
  --c-blue: #168FE5;
  --c-green: #63C132;
  --c-mint: #EAF4F2;
  --c-action: #19816D;
  --c-action-hover: #14695A;
  --c-action-text: #FFFFFF;     /* 4,77 на #19816D */
  --c-link: #19816D;
  --c-ok-text: #166534;   --c-ok-bg: #DCFCE7;
  --c-warn-text: #92400E; --c-warn-bg: #FEF3C7;
  --c-err-text: #B42318;  --c-err-bg: #FEE4E2;

  /* Графитовая сцена первого экрана — постоянна в обеих темах */
  --c-scene-bg: #0A1620;
  --c-scene-bg-2: #16303F;
  --c-scene-text: #F7F9FA;      /* 17,31 на сцене */
  --c-scene-text-2: #B8C4D1;    /* 10,32 на сцене */
  --c-scene-silver: #C7D3DE;    /* 12,02 на сцене */
  --c-scene-emerald: #20A78E;   /* 6,08 на сцене: здесь изумруд читается */
  --c-scene-glow: #00E5FF; /* только свечение, не мелкий текст */

  /* Тени (раздел 6) */
  --sh-card: 0 8px 24px rgba(16, 24, 40, 0.06);
  --sh-pop: 0 16px 48px rgba(16, 24, 40, 0.16);

  /* Слои (раздел 6) */
  --z-sticky: 10;
  --z-nav: 20;
  --z-menu: 30;
  --z-scrim: 40;
  --z-dialog: 50;
  --z-toast: 60;

  /* Движение (раздел 8) */
  --t-press: 140ms;
  --t-expand: 180ms;
  --t-panel: 220ms;
  --t-scene-build: 1600ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  /* Сетка: значения переопределяются медиа-запросами в base.css */
  --grid-pad: 16px;
  --grid-cols: 4;
  --grid-gap: 16px;
  --grid-max: 1320px;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --c-bg: #0A1620;
  --c-surface: #16303F;
  --c-surface-2: #1C3A4B;
  --c-text: #F7F9FA;
  --c-text-2: #B8C4D1;
  --c-text-3: #8496A3;
  --c-divider: #2E4C5E;
  --c-divider-2: #35586C;
  --c-brand: #20A78E;
  --c-brand-ink: #4FD1B5;
  --c-blue: #168FE5;
  --c-green: #63C132;
  --c-mint: #12312C;
  --c-action: #20A78E;          /* на тёмном изумруд проходит: 6,08 */
  --c-action-hover: #27BEA2;
  --c-action-text: #052018;
  --c-link: #5EEAD4;
  --c-ok-text: #86EFAC;   --c-ok-bg: #123023;
  --c-warn-text: #FCD34D; --c-warn-bg: #35270D;
  --c-err-text: #FDA29B;  --c-err-bg: #3A1718;
  --sh-card: 0 8px 24px rgba(0, 0, 0, 0.32);
  --sh-pop: 0 16px 48px rgba(0, 0, 0, 0.48);
}

/* LIFE B12 — основа: сброс, контейнер, сетка, типографика.
   Формулы контейнера — раздел 3.1 ТЗ. Ширины колонок не округляются вручную. */

*, *::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(--c-bg);
  color: var(--c-text);
  font-family: 'Inter', 'Inter Display', 'Manrope', -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 1rem;       /* 16px */
  line-height: 1.5;      /* 24px */
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;      /* страница целиком горизонтально не прокручивается */
}

img, svg, canvas, video { max-width: 100%; }
img { height: auto; }

:where(h1, h2, h3, h4, p, figure, ul, ol) { margin: 0; }
:where(ul, ol) { padding: 0; list-style: none; }

a { color: var(--c-link); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Фокус: кольцо 2px с отступом 2px (раздел 6.1) */
:focus-visible {
  outline: 2px solid var(--c-action);
  outline-offset: 2px;
  border-radius: 4px;
}
:root[data-theme='dark'] :focus-visible { outline-color: var(--c-link); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--s-16); top: var(--s-16);
  transform: translateY(-200%);
  z-index: var(--z-toast);
  background: var(--c-surface); color: var(--c-text);
  padding: var(--s-12) var(--s-16); border-radius: var(--r-field);
  box-shadow: var(--sh-pop);
}
.skip-link:focus { transform: translateY(0); }

/* ---------- Контейнер и сетка ---------- */
/* W < 768: P=16, N=4, G=16 */
/* 768 <= W < 1200: P=32, N=8, G=16 */
/* W >= 1200: P=48, N=12, G=24, C = min(W-96, 1320) */

@media (min-width: 768px) {
  :root { --grid-pad: 32px; --grid-cols: 8; --grid-gap: 16px; }
}
@media (min-width: 1200px) {
  :root { --grid-pad: 48px; --grid-cols: 12; --grid-gap: 24px; }
}

.container {
  width: 100%;
  max-width: calc(var(--grid-max) + 2 * var(--grid-pad));
  margin-inline: auto;
  padding-inline: var(--grid-pad);
}

.grid {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  gap: var(--grid-gap);
}

.grid > * { min-width: 0; }

/* Вертикальный ритм секций: 96 / 64 / 48 (раздел 3.3).
   Ритм задаёт один родитель — у секции только padding-block. */
.section { padding-block: var(--s-48); }
@media (min-width: 768px) { .section { padding-block: var(--s-64); } }
@media (min-width: 1200px) { .section { padding-block: var(--s-96); } }

.section__head { max-width: 680px; }
.section__title { margin-bottom: var(--s-16); }
.section__lead + .section__body,
.section__title + .section__body { margin-top: var(--s-32); }
.section__lead { margin-bottom: 0; }
.section__head + .section__body { margin-top: var(--s-32); }

/* ---------- Типографика (раздел 5) ---------- */

.t-h1 { font-size: 32px; line-height: 38px; font-weight: 700; letter-spacing: -0.022em; }
.t-h2 { font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -0.02em; }
.t-h3 { font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -0.02em; }
.t-card-title { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.02em; }
.t-lead { font-size: 18px; line-height: 28px; font-weight: 400; }
.t-body { font-size: 16px; line-height: 24px; }
.t-caption { font-size: 14px; line-height: 20px; }

@media (max-width: 359px) {
  .t-h1 { font-size: 28px; line-height: 34px; }
}
@media (min-width: 768px) {
  .t-h1 { font-size: 38px; line-height: 44px; }
  .t-h2 { font-size: 32px; line-height: 40px; }
  .t-h3 { font-size: 28px; line-height: 36px; }
  .t-lead { font-size: 18px; line-height: 28px; }
}
@media (min-width: 1200px) {
  .t-h1 { font-size: 44px; line-height: 50px; }
  .t-h2 { font-size: 40px; line-height: 48px; }
  .t-h3 { font-size: 32px; line-height: 40px; }
  .t-lead { font-size: 20px; line-height: 32px; }
}

.t-muted { color: var(--c-text-2); }
.prose { max-width: 680px; }
.prose p + p { margin-top: var(--s-16); }
.prose h2 { margin-top: var(--s-40); margin-bottom: var(--s-16); }
.prose h3 { margin-top: var(--s-32); margin-bottom: var(--s-12); }
.prose ul { margin-top: var(--s-16); display: grid; gap: var(--s-8); }
.prose li { padding-left: var(--s-20); position: relative; }
.prose li::before {
  content: ''; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--c-action);
}

/* ---------- Набор строк (B23) ---------- */

/* Короткий заголовок не должен ронять одно слово на отдельную строку.
   balance выравнивает длину строк, pretty убирает висячие слова в абзацах. */
.t-h1, .t-h2, .t-h3, .t-card-title { text-wrap: balance; }
.t-lead, .t-body { text-wrap: pretty; }

/* Строка длиннее 75 знаков читается заметно хуже: глаз теряет начало следующей. */
.section__lead { max-width: 58ch; }
.prose p, .prose li { max-width: 72ch; }

/* Пустой отступ в 96 px сверху и снизу отрывал заголовок от содержимого. */
@media (min-width: 1200px) { .section { padding-block: var(--s-72, 72px); } }
.section__title + .section__lead { margin-top: var(--s-12); }

/* Сообщение без модификатора раньше выглядело как голый текст среди страницы. */
.notice {
  border: 1px solid var(--c-divider);
  background: var(--c-surface);
}

/* ---------- Скрытие атрибутом hidden (B23) ---------- */
/*
   Браузер прячет [hidden] правилом display:none из своей таблицы стилей,
   и любое авторское правило display его перебивает. У нас display задают
   .fieldset, .notice, .btn, .sheet, .scrim — то есть ровно то, что мы
   скрываем. Из-за этого на странице пилота второй шаг опроса был виден
   под первым, на странице помощника показывались кнопки «Повторить»
   и «Остановить», а пустое сообщение занимало место белой полосой.
   Приёмка это не ловила: она меряет геометрию, а не видимость.

   Правило намеренно с !important: оно должно побеждать любой класс,
   иначе следующий компонент со своим display снова всё сломает.
*/
[hidden] { display: none !important; }

/* LIFE B12 — компоненты. Геометрия из раздела 6 ТЗ, состояния из 6.1. */

/* ---------- Кнопки ---------- */

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--c-text);
  --btn-bd: var(--c-divider);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-8);
  min-height: 48px;
  padding: var(--s-12) var(--s-20);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-field);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-press) var(--ease),
              border-color var(--t-press) var(--ease),
              color var(--t-press) var(--ease);
}

.btn:hover:not(:disabled):not([aria-disabled='true']) { background: var(--c-surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.6; cursor: not-allowed; }

.btn--primary {
  --btn-bg: var(--c-action);
  --btn-fg: var(--c-action-text);
  --btn-bd: var(--c-action);
}
.btn--primary:hover:not(:disabled):not([aria-disabled='true']) {
  background: var(--c-action-hover);
  border-color: var(--c-action-hover);
}

.btn--ghost { --btn-bd: transparent; }

/* Кнопка первого экрана (раздел 6) */
.btn--hero { min-height: 56px; padding: var(--s-16) var(--s-24); border-radius: var(--r-hero-btn); }

/* Кнопка только с иконкой */
.btn--icon { width: 48px; height: 48px; min-height: 48px; padding: 0; }

/* Кнопка на графитовой сцене */
.btn--on-dark {
  --btn-fg: var(--c-scene-text);
  --btn-bd: rgba(199, 211, 222, 0.32);
}
.btn--on-dark:hover:not(:disabled) { background: rgba(199, 211, 222, 0.12); }

/* Ширина не должна меняться при «Сохраняем…» — состояние задаётся data-атрибутом */
.btn[data-state='pending'] { pointer-events: none; }
.btn[data-state='pending'] .btn__spin {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 640ms linear infinite;
}
.btn__spin { display: none; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn[data-state='pending'] .btn__spin { animation-duration: 2s; }
}

.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-12); }
@media (max-width: 767px) {
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn-row > .btn { width: 100%; }
}

/* ---------- Поля ---------- */

.field { display: grid; gap: var(--s-8); }
.field__label { font-size: 14px; line-height: 20px; font-weight: 600; }
.field__optional { color: var(--c-text-2); font-weight: 400; }

.input, .textarea, .select {
  width: 100%;
  min-height: 48px;
  padding: var(--s-12) var(--s-16);
  border: 1px solid var(--c-divider);
  border-radius: var(--r-field);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: 16px;
  line-height: 24px;
}
.textarea { min-height: 120px; resize: vertical; }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { border-color: var(--c-action); }

.field__hint { font-size: 14px; line-height: 20px; color: var(--c-text-2); }
.field__error { font-size: 14px; line-height: 20px; color: var(--c-err-text); font-weight: 600; }
.field[data-invalid='true'] .input,
.field[data-invalid='true'] .textarea { border-color: var(--c-err-text); }

.fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s-24); }
@media (max-width: 767px) { .fieldset { gap: var(--s-20); } }
.fieldset__legend { font-size: 20px; line-height: 28px; font-weight: 600; padding: 0; margin-bottom: var(--s-8); }

/* Радио и флажок: знак 20, зона нажатия >= 44 */
.choice {
  display: flex; align-items: flex-start; gap: var(--s-12);
  min-height: 44px; padding-block: var(--s-12);
  cursor: pointer;
}
.choice input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--c-action); }
.choice__text { display: grid; gap: 2px; }
.choice__note { font-size: 14px; line-height: 20px; color: var(--c-text-2); }

.choice-card {
  border: 1px solid var(--c-divider);
  border-radius: var(--r-task);
  padding: var(--s-16);
  background: var(--c-surface);
}
.choice-card:has(input:checked) { border-color: var(--c-action); box-shadow: inset 0 0 0 1px var(--c-action); }

/* ---------- Карточки ---------- */

.card {
  display: flex;
  flex-direction: column;
  gap: var(--s-12);
  padding: var(--s-16);
  border: 1px solid var(--c-divider);
  border-radius: var(--r-card);
  background: var(--c-surface);
  box-shadow: var(--sh-card);
}
@media (min-width: 768px) { .card { padding: var(--s-24); } }
.card__foot { margin-top: auto; padding-top: var(--s-8); }

/* Ряды карточек: 3 при W>=1200, 2 при 768..1199, 1 ниже */
.cards { display: grid; gap: var(--grid-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Метка статуса ---------- */

.badge {
  display: inline-flex; align-items: center; gap: var(--s-4);
  min-height: 28px; padding: var(--s-4) 10px;
  border-radius: var(--r-badge);
  font-size: 14px; line-height: 20px; font-weight: 600;
  background: var(--c-surface-2); color: var(--c-text-2);
}
.badge--ok   { background: var(--c-ok-bg);   color: var(--c-ok-text); }
.badge--warn { background: var(--c-warn-bg); color: var(--c-warn-text); }
.badge--err  { background: var(--c-err-bg);  color: var(--c-err-text); }
.badge__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- Сообщение о результате ---------- */

.notice {
  display: grid; gap: var(--s-8);
  padding: var(--s-16);
  border-radius: var(--r-task);
  border: 1px solid transparent;
}
.notice--ok   { background: var(--c-ok-bg);   color: var(--c-ok-text);   border-color: currentColor; }
.notice--warn { background: var(--c-warn-bg); color: var(--c-warn-text); border-color: currentColor; }
.notice--err  { background: var(--c-err-bg);  color: var(--c-err-text);  border-color: currentColor; }
.notice__title { font-weight: 700; }
.notice__body { color: inherit; }

/* ---------- Таблица ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; min-width: 480px; }
.table th, .table td {
  text-align: left; padding: var(--s-12) var(--s-16);
  border-bottom: 1px solid var(--c-divider);
  font-size: 16px; line-height: 24px;
}
.table th { font-weight: 600; color: var(--c-text-2); font-size: 14px; line-height: 20px; }
.table tr { min-height: 56px; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Диалог / панель ---------- */

.scrim {
  position: fixed; inset: 0; background: rgba(10, 14, 18, 0.48);
  z-index: var(--z-scrim); opacity: 0; pointer-events: none;
  transition: opacity var(--t-panel) var(--ease);
}
.scrim[data-open='true'] { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; inset: 0 0 0 auto;
  width: min(440px, 100vw);
  background: var(--c-surface);
  z-index: var(--z-dialog);
  box-shadow: var(--sh-pop);
  transform: translateX(100%);
  transition: transform var(--t-panel) var(--ease);
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet[data-open='true'] { transform: translateX(0); }
@media (prefers-reduced-motion: reduce) {
  .sheet, .scrim { transition-duration: 1ms; }
}
.sheet__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-12); padding: var(--s-16); border-bottom: 1px solid var(--c-divider);
}
.sheet__body { padding: var(--s-16); overflow-y: auto; display: grid; gap: var(--s-8); align-content: start; }

/* ---------- Разное ---------- */

.stack { display: grid; gap: var(--s-16); align-content: start; }
.stack--8 { gap: var(--s-8); }
.stack--24 { gap: var(--s-24); }
.stack--32 { gap: var(--s-32); }
.divider { height: 1px; background: var(--c-divider); border: 0; }

/* LIFE B12 — публичные экраны: шапка, первый экран, сцена, секции, подвал. */

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-divider);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--s-16);
  height: 64px;
}
@media (min-width: 1440px) {
  .site-header__inner { height: 80px; gap: var(--s-24); }
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-12);
  min-width: 0;
  max-width: 224px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
@media (min-width: 1200px) { .brand { max-width: 280px; } }

.brand__mark { width: 36px; height: 30px; flex: none; object-fit: contain; }
@media (min-width: 1200px) { .brand__mark { width: 44px; height: 36px; } }

/* Тёмная подложка — серебро, светлая — исходный чёрный.
   На главной шапка графитовая всегда, поэтому там серебро при любой теме. */
:root:not([data-theme='dark']) body:not(.page-home) .scene__mat--silver { display: none; }
:root:not([data-theme='dark']) body:not(.page-home) .scene__mat--origin { display: block; }

.brand__mark--empty {
  border: 1px dashed var(--c-divider);
  border-radius: 8px;
}

.brand__name { font-size: 16px; line-height: 20px; }
@media (max-width: 359px) { .brand__name { font-size: 14px; line-height: 18px; } }

.site-nav { display: none; margin-left: auto; }
.site-nav__list { display: flex; gap: var(--s-24); }
.site-nav__link {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--c-text); text-decoration: none; font-weight: 500;
}
.site-nav__link:hover { color: var(--c-action); }
.site-nav__link[aria-current='page'] { color: var(--c-action); text-decoration: underline; }

.site-header__actions { display: flex; align-items: center; gap: var(--s-12); margin-left: auto; }
.site-header__cta, .site-header__login { display: none; }
.site-header__menu { display: inline-flex; }

/* Полная шапка — только от 1440 (раздел 7.1: ниже компактная) */
@media (min-width: 1440px) {
  .site-nav { display: block; }
  .site-header__actions { margin-left: 0; }
  .site-header__cta, .site-header__login { display: inline-flex; }
  .site-header__menu { display: none; }
}
/* На ноутбуке помещается вход — он показывается, меню остаётся */
@media (min-width: 900px) and (max-width: 1439px) {
  .site-header__login { display: inline-flex; }
}

.menu-link {
  display: flex; align-items: center; min-height: 48px;
  padding-inline: var(--s-4);
  color: var(--c-text); text-decoration: none; font-weight: 500;
}

/* Главная открывается графитовой сценой: шапка на ней тоже графитовая,
   иначе на стыке появляется светлая полоса поверх тёмного первого экрана. */
.page-home .site-header {
  background: var(--c-scene-bg);
  border-bottom-color: rgba(199, 211, 222, 0.16);
  color: var(--c-scene-text);
}
.page-home .brand,
.page-home .site-nav__link { color: var(--c-scene-text); }
.page-home .site-nav__link:hover { color: var(--c-scene-glow); }
.page-home .brand__mark--empty { border-color: rgba(199, 211, 222, 0.34); }
.page-home .site-header .btn:not(.btn--primary) {
  --btn-fg: var(--c-scene-text);
  --btn-bd: rgba(199, 211, 222, 0.32);
}
.page-home .site-header .btn:not(.btn--primary):hover { background: rgba(199, 211, 222, 0.12); }

/* ---------- Первый экран ---------- */

.hero {
  background: radial-gradient(120% 100% at 78% 12%, var(--c-scene-bg-2) 0%, var(--c-scene-bg) 62%);
  color: var(--c-scene-text);
  padding-block: var(--s-32);
}
@media (min-width: 768px) { .hero { padding-block: var(--s-40); } }
@media (min-width: 1200px) { .hero { padding-block: var(--s-64); } }

.hero__grid { display: grid; gap: var(--s-32); align-items: center; }
@media (min-width: 1200px) {
  .hero__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--grid-gap);
  }
  .hero__text { grid-column: span 6; }
  .hero__scene { grid-column: span 6; }
}

.hero__label {
  display: inline-flex; align-items: center; gap: var(--s-8);
  min-height: 28px; padding: var(--s-4) 10px; border-radius: var(--r-badge);
  background: rgba(199, 211, 222, 0.14);
  color: var(--c-scene-text-2);
  font-size: 14px; line-height: 20px; font-weight: 600;
}

.hero__title { margin-top: var(--s-24); color: var(--c-scene-text); }
.hero__lead { margin-top: var(--s-24); color: var(--c-scene-text-2); max-width: 34ch; }
.hero__actions { margin-top: var(--s-32); }
.hero__note { margin-top: var(--s-24); color: var(--c-scene-text-2); }

.hero .btn--primary { --btn-bg: var(--c-scene-emerald); --btn-bd: var(--c-scene-emerald); }
.hero .btn--primary:hover:not(:disabled) { background: #12897F; border-color: #12897F; }

/* ---------- Сцена ---------- */

.scene { display: grid; gap: var(--s-12); }

.scene__stage {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: var(--r-card);
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 90% at 50% 18%, var(--c-scene-bg-2) 0%, #0c1b25 48%, #07131b 100%);
  border: 1px solid rgba(199, 211, 222, 0.16);
}
@media (max-width: 359px) { .scene__stage { height: 240px; } }
@media (min-width: 768px) { .scene__stage { height: 400px; max-width: 640px; margin-inline: auto; } }
@media (min-width: 1200px) {
  /* Квадрат по ТЗ 7.2 с потолком: иначе первый экран выходит за диапазон 740–820 px. */
  .scene__stage { height: auto; aspect-ratio: 1 / 1; max-width: none; max-height: 480px; }
}

.scene__field, .scene__layer {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  pointer-events: none;
}
.scene__field { z-index: 0; }
.scene__layer { z-index: 2; mix-blend-mode: screen; }

.scene__depth {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 220ms var(--ease);
}

/* Эмблема занимает 80–88% области и не обрезается. */
.scene__emblem, .scene__volume {
  grid-area: 1 / 1;
  width: 84%; height: 84%;
  object-fit: contain;
  user-select: none; -webkit-user-drag: none;
}
.scene__emblem { position: relative; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45)); }

/* Слой объёма: та же эмблема, размытая и отодвинутая по оси Z.
   При наклоне смещение между слоями меняется — плоский рисунок читается объёмным. */
.scene__volume {
  filter: blur(14px) brightness(0.35) saturate(0.6);
  opacity: 0.85;
  transform: translate3d(0, 10px, -40px) scale(1.015);
}

/* Материал выбирает тема, а не скрипт: без JavaScript виден правильный. */
.scene__mat--origin { display: none; }
.scene__mat--silver { display: block; }

.scene__placeholder {
  grid-area: 1 / 1;
  width: 84%; height: 84%;
  display: grid; place-content: center; gap: var(--s-8); text-align: center;
  padding: var(--s-16);
  border: 2px dashed rgba(199, 211, 222, 0.34);
  border-radius: var(--r-card);
  color: var(--c-scene-text-2);
}
.scene__placeholder-title { font-weight: 700; color: var(--c-scene-text); font-size: 16px; line-height: 24px; }
.scene__placeholder-note { font-size: 14px; line-height: 20px; }
.scene__placeholder code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.scene__nodes { position: absolute; inset: 0; z-index: 3; }
.scene__node { position: absolute; left: var(--nx); top: var(--ny); transform: translate(-50%, -50%); }

.scene__node-btn {
  display: inline-flex; align-items: center; gap: var(--s-8);
  min-height: 44px; padding: var(--s-8) var(--s-12);
  border: 1px solid rgba(199, 211, 222, 0.3);
  border-radius: 999px;
  background: rgba(7, 19, 27, 0.72);
  color: var(--c-scene-text);
  font: inherit; font-size: 14px; line-height: 20px; font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color var(--t-press) var(--ease), transform var(--t-press) var(--ease);
}
.scene__node-btn:hover { border-color: var(--c-scene-glow); transform: scale(1.04); }
.scene__node-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-scene-glow); flex: none; }

.scene__caption { color: var(--c-scene-text-2); }

/* Дублирующие кнопки узлов: обычные, достижимые с клавиатуры, вне холста. */
.scene__alt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-8); }
.scene__alt-btn { width: 100%; min-height: 44px; padding-inline: var(--s-8); }

/* Сборка проигрывается один раз. */
.scene[data-scene-mode="live"] .scene__emblem,
.scene[data-scene-mode="live"] .scene__volume {
  animation: emblem-rise 1600ms cubic-bezier(.16, .84, .28, 1) both;
}
@keyframes emblem-rise {
  from { opacity: 0; transform: translate3d(0, 26px, 0) scale(.965); }
  to { opacity: 1; }
}
.scene[data-scene-mode="live"] .scene__volume {
  animation-name: emblem-rise-volume;
}
@keyframes emblem-rise-volume {
  from { opacity: 0; transform: translate3d(0, 34px, -40px) scale(.98); }
  to { opacity: .85; transform: translate3d(0, 10px, -40px) scale(1.015); }
}

@media (prefers-reduced-motion: reduce) {
  .scene__depth { transition: none; transform: none !important; }
  .scene[data-scene-mode="live"] .scene__emblem,
  .scene[data-scene-mode="live"] .scene__volume { animation: none; }
}

/* ---------- Секции ---------- */

.steps { display: grid; gap: var(--grid-gap); grid-template-columns: minmax(0, 1fr); counter-reset: step; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.step { counter-increment: step; }
.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--c-surface-2); color: var(--c-action);
  font-weight: 700; font-size: 14px;
}
.step__num::before { content: counter(step); }

.stage-list { display: grid; gap: var(--s-12); }
.stage-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-8) var(--s-12);
  padding: var(--s-12) 0; border-bottom: 1px solid var(--c-divider);
}
.stage-row__name { font-weight: 600; flex: 1 1 240px; min-width: 0; }

.cta-band {
  background: var(--c-surface);
  border: 1px solid var(--c-divider);
  border-radius: var(--r-card);
  padding: var(--s-24);
  display: grid; gap: var(--s-16);
}
@media (min-width: 1200px) {
  .cta-band { padding: var(--s-32) var(--s-40); grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-32); }
}

/* ---------- Подвал ---------- */

.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-divider);
  padding-block: var(--s-48);
  margin-top: var(--s-48);
}
.site-footer__grid { display: grid; gap: var(--s-32); }
@media (min-width: 768px) { .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .site-footer__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.site-footer__rule { margin-block: var(--s-32) var(--s-16); }

.theme-switch { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.theme-switch__opt {
  display: flex; align-items: center; gap: var(--s-12);
  min-height: 44px; cursor: pointer;
}
.theme-switch__opt input { width: 20px; height: 20px; accent-color: var(--c-action); }

/* ---------- Формы страниц ---------- */

.form-layout { display: grid; gap: var(--s-24); max-width: 1120px; }
@media (min-width: 1024px) {
  .form-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-24); align-items: start; }
}
.form-card { display: grid; gap: var(--s-24); }
.summary-card { position: sticky; top: 96px; }

.form-foot { display: grid; gap: var(--s-12); }
@media (min-width: 768px) { .form-foot { grid-template-columns: auto auto; justify-content: start; } }

.step-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-12); flex-wrap: wrap; }
.progress { height: 4px; border-radius: 2px; background: var(--c-surface-2); overflow: hidden; }
.progress__bar { height: 100%; background: var(--c-action); transition: width var(--t-expand) var(--ease); }

.summary-list { display: grid; gap: var(--s-12); }
.summary-list div { display: grid; gap: 2px; }
.summary-list dt { font-size: 14px; line-height: 20px; color: var(--c-text-2); }
.summary-list dd { margin: 0; font-weight: 500; }

/* ---------- Демонстрационный контур (B21) ---------- */

.demo-layout { display: grid; gap: var(--s-24); align-items: start; }
@media (min-width: 1024px) {
  .demo-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.demo-roles { display: grid; gap: var(--s-12); }
.demo-role[aria-pressed="true"] {
  background: var(--c-action);
  border-color: var(--c-action);
  color: var(--c-action-text);
}

.demo-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: var(--s-12);
}
.demo-count {
  display: grid; gap: 2px; justify-items: center;
  padding: var(--s-12);
  border: 1px solid var(--c-divider);
  border-radius: 12px;
  background: var(--c-surface);
}
.demo-count__num { font-size: 28px; line-height: 34px; font-weight: 600; font-variant-numeric: tabular-nums; }
.demo-count__label { color: var(--c-text-2); text-align: center; }

.demo-tasks, .demo-events, .demo-doclist, .demo-bullets { list-style: none; margin: 0; padding: 0; display: grid; }
.demo-tasks { gap: var(--s-16); }
.demo-events { gap: var(--s-8); }
.demo-doclist, .demo-bullets { gap: var(--s-8); }
.demo-bullets li { padding-left: var(--s-20); position: relative; }
.demo-bullets li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--c-brand);
}

.demo-task {
  display: grid; gap: var(--s-8);
  padding: var(--s-16);
  border: 1px solid var(--c-divider);
  border-radius: 12px;
  background: var(--c-surface);
}
.demo-task--empty { border-style: dashed; }
.demo-task__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-12); flex-wrap: wrap; }
.demo-task__title { color: var(--c-link); text-decoration: none; }
.demo-task__title:hover { text-decoration: underline; }
.demo-task__meta { margin: 0; }
.demo-task__note { margin: 0; color: var(--c-text-2); }

.demo-detail { display: grid; gap: var(--s-16); align-content: start; }
.demo-criteria { display: grid; gap: var(--s-8); border: 0; margin: 0; padding: 0; }
.demo-criteria[disabled] { opacity: 0.72; }
.demo-actions { flex-wrap: wrap; }
.demo-actions [aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

.demo-event {
  display: grid; gap: 2px;
  padding-block: var(--s-8);
  border-bottom: 1px solid var(--c-divider);
}
.demo-event:last-child { border-bottom: 0; }
@media (min-width: 768px) {
  .demo-event { grid-template-columns: 132px minmax(0, 1fr) 160px; align-items: baseline; gap: var(--s-12); }
}
.demo-event__at { font-variant-numeric: tabular-nums; }

.demo-doc { display: grid; gap: var(--s-12); }

/* ---------- Помощник (B22) ---------- */

.chat { display: grid; gap: var(--s-24); align-items: start; }
@media (min-width: 1024px) {
  .chat { grid-template-columns: minmax(0, 1fr) 320px; }
}
.chat__main { display: grid; gap: var(--s-16); }
.chat__side { display: grid; gap: var(--s-16); align-content: start; }

.chat__thread {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--s-12);
  min-height: 120px;
  max-height: 52vh; overflow-y: auto;
}
.chat__thread:empty::after {
  content: "Переписка пуста. Задайте вопрос — ответ появится здесь.";
  color: var(--c-text-2); font-size: 14px; line-height: 20px;
}

.chat-msg {
  display: grid; gap: var(--s-4);
  padding: var(--s-12) var(--s-16);
  border: 1px solid var(--c-divider);
  border-radius: 12px;
  background: var(--c-surface);
  max-width: 46rem;
}
.chat-msg--user { background: var(--c-surface-2); justify-self: end; }
.chat-msg--assistant { justify-self: start; }
.chat-msg--pending { opacity: 0.7; border-style: dashed; }
.chat-msg__who { color: var(--c-text-2); }
.chat-msg__body { overflow-wrap: anywhere; }

.chat__form { display: grid; gap: var(--s-8); }
.chat__input { min-height: 96px; resize: vertical; }
.chat__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-12); flex-wrap: wrap; }
.chat__prompt { text-align: left; justify-content: flex-start; white-space: normal; height: auto; padding-block: var(--s-8); }

.chat-sample { margin-top: var(--s-8); }
.chat-sample__pre {
  margin: var(--s-8) 0 0; padding: var(--s-12);
  border-radius: 8px; background: var(--c-surface-2);
  font-size: 13px; line-height: 19px;
  white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 220px; overflow: auto;
}

/* ---------- Оформление по снимкам экрана (B23) ---------- */

/* Заголовок первого экрана держит крупный кегль, но собственный:
   общий .t-h1 опущен ради внутренних страниц, здесь он задан отдельно. */
.hero__title {
  font-size: clamp(30px, 7.2vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.028em;
  text-wrap: balance;
  max-width: 17ch;
}
@media (min-width: 768px)  { .hero__title { font-size: clamp(38px, 5vw, 46px); } }
@media (min-width: 1200px) { .hero__title { font-size: 54px; line-height: 1.06; } }

.hero__lead { max-width: 32ch; text-wrap: pretty; }
.hero__note { max-width: 44ch; }

/* Сцена: дерево тонуло в подложке, потому что и то и другое почти чёрное.
   Виньетка делает края темнее центра, а материал получает немного контраста. */
/* Первая попытка была ошибкой: затемнение легло ПОВЕРХ эмблемы (z-index 2)
   и погасило рисунок — на снимке остались висеть одни точки свечения.
   Теперь затемнение уходит ПОД эмблему, а сам рисунок заметно светлее:
   серебряный материал тонул в графитовой подложке. */
.scene__stage::after {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
  background: radial-gradient(62% 56% at 50% 52%, rgba(64,120,140,0.10) 0%, rgba(4,12,18,0.42) 100%);
}
.scene__emblem.scene__mat--silver {
  filter: drop-shadow(0 18px 44px rgba(0, 0, 0, 0.6)) contrast(1.22) brightness(1.55) saturate(0.9);
}
.scene__volume { filter: blur(18px) brightness(0.8) saturate(0.7); opacity: 0.6; }

/* Подпись на краю сцены вылезала за границу на узком экране. */
.scene__node { left: clamp(14%, var(--nx), 86%); top: clamp(10%, var(--ny), 90%); }

/* Запасные кнопки узлов нужны там, где сцена не отрисовалась.
   Раньше они спорили по весу с основным действием первого экрана. */
.scene__alt { display: grid; grid-auto-flow: column; justify-content: start; gap: var(--s-8); }
.scene__alt-btn {
  /* width: 100% из прежнего правила растягивал их на всю колонку. */
  width: auto;
  min-height: 34px; padding: var(--s-4) var(--s-12);
  font-size: 14px; font-weight: 500;
  background: transparent;
  border-color: rgba(199, 211, 222, 0.28);
  color: var(--c-scene-text-2);
}
.scene__alt-btn:hover { color: var(--c-scene-text); border-color: rgba(199, 211, 222, 0.5); }

/* Второе действие шапки не должно читаться как равное первому. */
.site-header__login {
  background: transparent;
  border-color: transparent;
  color: var(--c-text-2);
  font-weight: 500;
}
.site-header__login:hover { color: var(--c-text); border-color: var(--c-divider); }
/* На главной шапка графитовая, и серый цвет светлой темы на ней не читается. */
.page-home .site-header .site-header__login {
  color: var(--c-scene-text-2);
  border-color: transparent;
  background: transparent;
}
.page-home .site-header .site-header__login:hover {
  color: var(--c-scene-text);
  border-color: rgba(199, 211, 222, 0.34);
}

/* Заготовки вопросов выглядели как заголовки раздела. */
.chat__prompt {
  font-size: 14px; line-height: 20px; font-weight: 500;
  color: var(--c-text-2);
  min-height: 0; padding: var(--s-8) var(--s-12);
}
.chat__prompt:hover { color: var(--c-text); }
.chat__side .card { padding: var(--s-16); }

/* Выравнивание колонок помощника по верхнему краю, а не по содержимому. */
.chat__main, .chat__side { align-self: start; }
.chat__thread { align-content: start; }

/* Светлая полоса под первым экраном начиналась резкой границей. */
.page-home .hero + .section { position: relative; }
.page-home .hero + .section::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 96px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(10, 22, 32, 0.06), rgba(10, 22, 32, 0));
}

/* Строка «название — состояние» шириной 1320 px рвёт связь между концами. */
.stage-list { max-width: 1040px; }
