/* Тест-навигатор ПУТЬ — стили: брендбук (HANDOFF §6) + слой опыта v3.
   Mobile-first, макет проверяется на 360px.

   Производительность: анимируются только transform и opacity.
   Единственное исключение — разовое проявление имени архетипа из blur(12px)
   (1.6 с, один раз за прохождение), оно задано спецификацией явно. */

/* Ночная тёмная тема — по умолчанию.
   --accent = золото-заливка (кнопки, прогресс): яркое, работает на любом фоне.
   --accent-text = золото-текст: на тёмном равно заливке, на светлом темнее ради
   контраста (см. дневную тему ниже). --veil = вуаль атмосферы Акта 3. */
:root {
  --bg: #111111;
  --bg-warm: #151310;
  --card: #1C1C1C;
  --card-rgb: 28, 28, 28;
  --text: #F5F1E8;
  --text-rgb: 245, 241, 232;
  --accent: #F0B840;
  --accent-rgb: 240, 184, 64;
  --accent-text: var(--accent);
  --muted: #8A8A8A;
  --veil: #0C0C0C;
  --veil-opacity: 0.82;
  --line: #2A2A2A;          /* рамки, трек прогресса, неактивные точки */
  --reveal-veil: #0A0A0A;   /* затемнение при выходе имени архетипа */
  --radius: 14px;

  --step: 240ms;          /* смена вопросов и проявление строк */
  --touch: 200ms;         /* отклик карточки на касание */
  --atmosphere: 600ms;    /* смена атмосферы между актами */
  --shift: 24px;
  --measure: 34em;        /* предельная ширина строки текста */

  /* Стеклянные раскрытия: тёмная тема — матовое стекло с блюром и тонким
     светлым бордером. В светлой теме токены переопределяются ниже. */
  --glass-bg: rgba(28, 28, 28, 0.5);
  --glass-blur: 11px;
  --glass-border: rgba(245, 241, 232, 0.12);
  --glass-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

/* Дневная светлая тема на цветах бренда: фон и текст инвертируются, золото
   сохраняется. Золото-текст затемняется до #8C6A0E ради контраста на светлом.
   Применяется авто по системной теме (когда пользователь не выбрал вручную)
   и по ручному переключателю data-theme="light". Контраст проверен >= 4.5:1. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #FAF6EC;
    --bg-warm: #F3ECDB;
    --card: #FFFFFF;
    --card-rgb: 255, 255, 255;
    --text: #201C14;
    --text-rgb: 32, 28, 20;
    --accent-text: #8C6A0E;
    --muted: #6E6656;
    --veil: #E8DFC9;
    --veil-opacity: 0.5;
    --line: #DCD4C2;
    --reveal-veil: #FFFFFF;
    --glass-bg: #FFFFFF;
    --glass-blur: 0px;
    --glass-border: var(--line);
    --glass-shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
  }
}
:root[data-theme="light"] {
  --bg: #FAF6EC;
  --bg-warm: #F3ECDB;
  --card: #FFFFFF;
  --card-rgb: 255, 255, 255;
  --text: #201C14;
  --text-rgb: 32, 28, 20;
  --accent-text: #8C6A0E;
  --muted: #6E6656;
  --veil: #E8DFC9;
  --veil-opacity: 0.5;
  --line: #DCD4C2;
  --reveal-veil: #FFFFFF;
  --glass-bg: #FFFFFF;
  --glass-blur: 0px;
  --glass-border: var(--line);
  --glass-shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
}

/* Акт 3: тише, темнее, медленнее */
body.act3 {
  --accent: #C9A24B;
  --accent-rgb: 201, 162, 75;
  --step: 320ms;
  --touch: 320ms;
}

* { box-sizing: border-box; }

html {
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-warm) 100%);
  background-attachment: fixed;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: Montserrat, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  hyphens: none;
  /* Межсловный интервал: слова не слипаются, особенно после букв с выносными
     элементами (д, у, р, ц, щ). Двойные пробелы в текстах не используются. */
  word-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Дышащее золотое свечение: цикл 20 с, предел непрозрачности 3% */
body::before {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(42% 32% at 28% 18%, rgba(240, 184, 64, 1) 0%, rgba(240, 184, 64, 0) 70%),
    radial-gradient(38% 30% at 76% 74%, rgba(240, 184, 64, 1) 0%, rgba(240, 184, 64, 0) 72%);
  opacity: 0.06;
  will-change: opacity, transform;
  animation: breathe 20s ease-in-out infinite;
}

@keyframes breathe {
  0%   { opacity: 0.055; transform: scale(1)      translate3d(0, 0, 0); }
  50%  { opacity: 0.085; transform: scale(1.06) translate3d(0, -1.5%, 0); }
  100% { opacity: 0.055; transform: scale(1)      translate3d(0, 0, 0); }
}

/* Затемнение атмосферы Акта 3: переход 600 мс, только opacity */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--veil);
  opacity: 0;
  transition: opacity var(--atmosphere) ease-out;
}
body.act3::after { opacity: var(--veil-opacity); }

#app {
  display: flex;
  flex-direction: column;
  /* Высота вьюпорта с запасными вариантами: vh (старые) → svh (панель показана) →
     dvh (динамическая, вычитает панель браузера). Нижний отступ гарантирует, что
     последний вариант не уходит под нижнюю панель браузера, даже если dvh не
     поддерживается: панель (~50–88px) + зона касания + safe-area. */
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding: 26px 20px calc(env(safe-area-inset-bottom, 0px) + 116px);
  max-width: 560px;
  margin: 0 auto;
}

.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 18px;
}

h1, h2, h3 { font-weight: 600; margin: 0; }
p { margin: 0; max-width: var(--measure); }

/* Проявление строк. ПРИНЦИП: контент виден СРАЗУ (opacity по умолчанию 1), без
   зависимости от JS/таймеров. Прозрачностный вход — CSS-анимацией fade-in (не
   переходом и не через requestAnimationFrame): она играет сама при рендере и не
   может «застрять» невидимой при торможении rAF (iOS bfcache/фон). Выключены
   анимации (prefers-reduced-motion / stagger) — контент просто виден. Сдвиг снимает
   .shown (косметика позиции, на видимость не влияет). */
.fade {
  opacity: 1;
  transform: translate3d(0, var(--shift), 0);
  transition: transform var(--step) ease-out;
  animation: fade-in var(--step) ease-out both;
}
.fade.shown { transform: translate3d(0, 0, 0); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
/* Кнопки и варианты видны сразу, без прозрачностной анимации: не конфликтуют с
   разовым пульсом кнопки и не зависят ни от чего. */
button.fade { animation: none; }

/* --- Прогресс: три сегмента актов, без цифр --- */
.progress { display: flex; gap: 6px; }
.segment {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}
.segment .fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: var(--accent);
  transition: transform var(--step) ease-out;
}

/* --- Вопрос --- */
/* Держит высоту кнопки «назад» на всех вопросах, включая первый в акте */
.nav-row { display: flex; align-items: center; min-height: 44px; }
.back {
  align-self: flex-start;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 22px;
  font-family: inherit;
  line-height: 1;
  padding: 6px 16px;         /* зона касания шире: раньше слева было 0 */
  margin-left: -16px;        /* визуально стрелка остаётся у края */
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}

/* Сцена и вопрос — один текстовый поток: тот же кегль и интерлиньяж,
   сцена приглушена до 70% и без жирности, разрывов между ними нет */
.narrative { display: flex; flex-direction: column; }

.context,
.q-text {
  font-size: 21px;
  line-height: 1.45;
  max-width: var(--measure);
}

/* Приглушение сцены до 70% — через альфу цвета, а не opacity: иначе
   .fade.shown { opacity: 1 } перебивало бы его по специфичности и сцена
   светилась бы в полную силу после проявления. */
.context {
  color: rgba(var(--text-rgb), 0.7);
  font-weight: 400;
}

/* ui.rules.scene_question_gap: ровно одна пустая строка между сценой и вопросом.
   1.45em при кегле 21px — это в точности высота одной строки того же текста. */
.q-text {
  font-weight: 600;
  margin-top: 1.45em;
}

/* Мелкая подводка над вариантами. padding-top 10px (не 22): у .screen уже
   gap 18px, вместе набегало 40px и низ отваливался от вопроса. */
.question-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
}
.variants-hint {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

/* Варианты карточками во всю ширину, ближе к низу: зона большого пальца */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 52px;
  text-align: left;
  background: var(--card);
  color: var(--text);
  border: 0;
  border-radius: var(--radius);
  padding: 17px 18px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
  transform: translate3d(0, var(--shift), 0);
  /* Въезд синхронен с остальными .fade (--step). Отклик на касание — упругий:
     карточка проседает (scale) и с лёгким перелётом возвращается. */
  transition: opacity var(--step) ease-out, transform var(--step) ease-out;
}
/* Возврат из проседания — упругий (cubic-bezier с перелётом), быстрый */
.option.shown { transform: translate3d(0, 0, 0); transition: opacity var(--step) ease-out, transform 240ms cubic-bezier(0.34, 1.4, 0.64, 1); }
/* Проседание при касании — быстрое, на всех устройствах (тактильность без вибрации) */
.option.shown:active { transform: scale(0.98); transition: transform 90ms ease-out; }

/* Обводка и заливка — отдельными слоями, чтобы анимировать только opacity */
.option::before,
.option::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease-out;
  z-index: -1;
}
.option::before { box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), 0.55); }
.option::after  { background: rgba(var(--accent-rgb), 0.12); }

/* Вспышка обводки и заливки при касании/наведении */
.option:active::before,
.option:active::after,
.option:hover::before { opacity: 1; }

.option.chosen::before { opacity: 1; }
.option.chosen::after  { opacity: 1; }

.option-body { display: block; }

/* --- Экраны настройки: порог и поля --- */
.setup { gap: 16px; }
.setup-title { font-size: 26px; line-height: 1.3; }
.setup-text { font-size: 19px; line-height: 1.5; }

.fine-print {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.field { display: flex; flex-direction: column; gap: 8px; }
/* ui.rules.field_labels: подписи полей порога — выделенные, не серые */
.field-label {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.field-hint {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  opacity: 0;
  transition: opacity var(--touch) ease-out;
}
.field-hint.visible { opacity: 1; }

/* Точки шагов вводного экрана. Активная — золотой слой поверх, гасится
   непрозрачностью: анимируемое свойство совпадает с меняющимся. */
.dots { display: flex; gap: 7px; justify-content: center; padding-top: 6px; }
.dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  /* Заметнее, чем --line: индикатор «первый из трёх» должен читаться */
  background: var(--muted);
  opacity: 0.5;
}
.dot.on { opacity: 1; }
.dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--touch) ease-out;
}
.dot.on::after { opacity: 1; }

/* --- Колесо-барабан возраста --- */
.wheel {
  position: relative;
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}
/* Рамка выбранной строки по центру */
.wheel::before {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 46px;
  margin-top: -23px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35);
  pointer-events: none;
  z-index: 3;                 /* над маской, иначе края рамки размывались вуалью */
}
/* Затухание к краям барабана */
.wheel-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    var(--card) 0%,
    rgba(var(--card-rgb), 0) 32%,
    rgba(var(--card-rgb), 0) 68%,
    var(--card) 100%
  );
}
.wheel-list {
  height: 168px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.wheel-list::-webkit-scrollbar { display: none; }
.wheel-pad { height: 61px; }
.wheel-item {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  transition: opacity var(--touch) ease-out;
  opacity: 0.55;
}
.wheel-item.active {
  color: var(--text);
  font-weight: 600;
  opacity: 1;
}

/* Рамка через inset box-shadow, как у .option и .gender: настоящий border
   занимал бы лишний пиксель и поле было бы шире соседей. */
.input {
  background: var(--card);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 17px;
  min-height: 52px;
  padding: 14px 16px;
}
.input:focus { outline: none; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.6); }

.gender-row { display: flex; gap: 12px; }
.gender {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 52px;
  background: var(--card);
  color: var(--text);
  border: 0;
  border-radius: var(--radius);
  padding: 15px 12px;
  font-family: inherit;
  font-size: 17px;
  cursor: pointer;
  transition: transform var(--touch) ease-out;
}
.gender::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.08);
  opacity: 0;
  transition: opacity var(--touch) ease-out;
  z-index: -1;
}
.gender:active { transform: translate3d(0, -2px, 0); }
.gender.selected { color: var(--accent-text); }
.gender.selected::before { opacity: 1; }

.primary, .secondary {
  margin-top: auto;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius);
  padding: 17px 20px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--touch) ease-out, transform var(--touch) ease-out;
}
.primary { background: var(--accent); color: #111111; }
.primary:disabled { opacity: 0.32; cursor: default; }
.primary:active:not(:disabled) { transform: translate3d(0, -2px, 0); }
.secondary { background: var(--card); color: var(--muted); font-weight: 400; }
/* Кнопка на экранах настройки участвует в очереди проявления */
.primary.fade { transform: translate3d(0, var(--shift), 0); }
.primary.fade.shown { transform: translate3d(0, 0, 0); }

/* Зовущая кнопка «Дальше» на вводных экранах: крупнее, увесистее, золотая. */
.cta { font-size: 19px; font-weight: 700; min-height: 58px; letter-spacing: 0.01em; }
/* Разовый мягкий пульс (только transform) через 2 с бездействия */
.pulse-once { animation: pulse-once 640ms ease-in-out 1; }
@keyframes pulse-once {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  40%      { transform: translate3d(0, 0, 0) scale(1.045); }
}

/* --- Вход в акт --- */
.act-intro { justify-content: center; gap: 18px; }
.act-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.34em;
  margin-right: -0.34em;      /* гасит хвост межбуквенного интервала справа */
  color: var(--accent-text);
}
/* Абзацы входа в акт: воздух между ними */
.act-text { font-size: 19px; line-height: 1.5; }
.act-text + .act-text { margin-top: 4px; }

/* Продолжение касанием: текста кнопки в манифесте нет.
   Без margin-top: auto — иначе авто-отступ съедает свободное место и
   justify-content: center на .act-intro/.reveal перестаёт центрировать. */
.tappable { cursor: pointer; }
/* Кнопка-продолжение: доступна с клавиатуры и скринридеру (сброс вида кнопки). */
.tap-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
  background: none;
  border: 0;
  width: 100%;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}
.tap-hint-label {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
.chevron {
  width: 11px;
  height: 11px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  animation: nudge 2.4s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: rotate(45deg) translate3d(0, 0, 0); opacity: 0.5; }
  50%      { transform: rotate(45deg) translate3d(3px, 3px, 0); opacity: 1; }
}

/* --- Раскрытия: карточка-стекло --- */
.reveal { justify-content: center; }
/* Карточка-стекло: тем-зависимая (на светлом прозрачная белая была невидима).
   Убран backdrop-filter: под ней почти ровная заливка — размывать нечего,
   а стоимость на слабых телефонах реальная. */
.glass {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px 22px;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
}
.reveal-intro { font-size: 18px; line-height: 1.55; color: var(--muted); }
.reveal-lead  { font-size: 21px; line-height: 1.45; font-weight: 600; }
.reveal-bridge { font-size: 17px; line-height: 1.55; }
.reveal-outro { font-size: 16px; line-height: 1.5; color: var(--muted); }

/* --- Результат --- */
.result { gap: 26px; }

.archetype-stage {
  position: relative;
  z-index: 3;
  padding: 26px 0 6px;
}
/* Затемнение сцены на время проявления имени */
.archetype-stage::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--reveal-veil);
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 700ms ease-out;
}
.archetype-stage.settled::before { opacity: 0; }

/* Мелкая золотая метка «ТВОЙ АРХЕТИП» над именем */
.archetype-above {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 6px;
}
/* Поясняющая строка под именем (что такое архетип) */
.archetype-explain {
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: -8px;
}
/* Случай А: подпись перед вторым именем и примечание после блока двух имён */
.second-facet-label {
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
  margin-top: 8px;
}
.case-a-note {
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
}
.headline {
  font-size: 30px;
  line-height: 1.2;
  color: var(--accent-text);
  opacity: 1;          /* видно сразу; blur-вход — только .revealing (украшает, не открывает) */
  filter: none;
}
.archetype-stage.revealing .headline { animation: name-in 1600ms ease-out 800ms both; }
.archetype-stage.settled .headline { opacity: 1; filter: none; animation: none; }

@keyframes name-in {
  0%   { opacity: 0; filter: blur(12px); }
  100% { opacity: 1; filter: blur(0); }
}

/* Второй архетип случая A: отделён линией и отступом, иначе имена слипались
   в одно длинное название вместо «двух кандидатов». */
.headline-alt {
  font-size: 22px;
  line-height: 1.25;
  color: var(--accent-text);
  opacity: 0.85;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Мягкие золотые частицы: 24 штуки, разовый выход, transform + opacity */
.particles {
  position: absolute;
  left: 8px;
  top: 42px;
  width: 0;
  height: 0;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: spark 1600ms ease-out var(--pd) 1 both;
  animation-delay: calc(800ms + var(--pd));
}
@keyframes spark {
  0%   { opacity: 0;   transform: translate3d(0, 0, 0) scale(0.4); }
  35%  { opacity: 0.7; }
  100% { opacity: 0;   transform: translate3d(var(--dx), var(--dy), 0) scale(1); }
}

.section { display: flex; flex-direction: column; gap: 14px; }
.section-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.block-text { font-size: 18px; line-height: 1.55; }
.formula { font-size: 16px; line-height: 1.5; color: var(--accent-text); }
.block-id {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  word-break: break-all;
  opacity: 0.7;
}
.error { color: #E06C5A; font-size: 18px; }
.muted-note { color: var(--muted); font-size: 15px; }

/* Переключатель темы солнце/луна в углу. Над контентом, не мешает потоку. */
.theme-toggle {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 50;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--accent-rgb), 0.55);
  background: var(--card);
  color: var(--accent-text);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform 120ms ease-out;
}
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle:hover { border-color: var(--accent); }

/* Нейтральная заглушка при нарушении целостности манифеста (боевой режим) */
.maintenance { justify-content: center; text-align: center; gap: 14px; }
.maintenance-title { font-size: 24px; color: var(--text); }
.maintenance-text { font-size: 17px; color: var(--muted); margin: 0 auto; }

/* --- План проб («Теперь дело») --- */
.plan {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.plan-title {
  font-size: 24px;
  line-height: 1.25;
  color: var(--accent-text);
}
.plan-intro { font-size: 18px; line-height: 1.55; }
.plan-case-intro {
  font-size: 17px;
  line-height: 1.55;
  color: rgba(var(--text-rgb), 0.85);
}
.plan-bridge {
  font-size: 17px;
  line-height: 1.55;
  margin-top: 4px;
}

/* Карточка пробы */
.probe-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 18px;
}
.probe-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--accent-text);
  letter-spacing: 0.01em;
}
.probe-vhod {                 /* курсив, приглушённо */
  font-size: 16px;
  line-height: 1.5;
  font-style: italic;
  color: rgba(var(--text-rgb), 0.6);
}
.probe-task { font-size: 17px; line-height: 1.55; }
.probe-veer-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}
.probe-veer { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.veer-item {
  position: relative;
  display: flex;
  gap: 10px;
  font-size: 16px;
  line-height: 1.5;
  padding-left: 14px;
}
/* Обычный маркер строки веера */
.veer-item::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.65em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}
/* Подсветка строки по доминирующему импульсу */
.veer-highlight::before { background: var(--accent); }
.veer-highlight .veer-text { color: var(--text); }
.veer-mark {
  flex: 0 0 auto;
  align-self: center;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}
.veer-highlight { padding-left: 0; }
.veer-highlight::before { content: none; }
.veer-text { color: rgba(var(--text-rgb), 0.85); }

.probe-step {                 /* жирным */
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
}
.probe-artifact {             /* мелко, приглушённо */
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

/* Раскрывающийся гид разговора в карточках ПОГОВОРИ */
/* Раскрывающийся гид разговора. Фон тем-зависимый: полупрозрачный белый был
   невидим на светлой теме. */
.talk-guide {
  border-radius: 10px;
  background: rgba(var(--text-rgb), 0.04);
  border: 1px solid var(--line);
  padding: 0 14px;
}
.talk-summary {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-text);
  cursor: pointer;
  padding: 12px 0;
  list-style: none;
}
.talk-summary::-webkit-details-marker { display: none; }
.talk-summary::after {
  content: '+';
  float: right;
  color: var(--muted);
  font-weight: 400;
}
.talk-guide[open] .talk-summary::after { content: '–'; }
.talk-body { padding-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.talk-text { font-size: 15px; line-height: 1.55; color: rgba(var(--text-rgb), 0.85); }
.talk-subtitle { font-size: 14px; font-weight: 600; color: var(--text); }
.talk-rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.talk-rules li { font-size: 15px; line-height: 1.5; color: rgba(var(--text-rgb), 0.85); }

/* Кнопка «Моя карта»: возврат к верху карты результата */
.plan-to-map {
  align-self: center;
  margin-top: 8px;
  background: none;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: var(--radius);
  color: var(--accent-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  min-height: 48px;
  padding: 12px 28px;
  cursor: pointer;
  transition: transform var(--touch) ease-out;
}
.plan-to-map:active { transform: translate3d(0, -2px, 0); }

/* --- Панель отладки ?debug=1 --- */
.debug {
  margin-top: 34px;
  border-top: 1px solid #2A2A2A;
  padding-top: 20px;
  font-size: 13px;
}
.debug h2 { font-size: 15px; color: var(--accent-text); }
.debug h3 { font-size: 13px; color: var(--muted); margin: 18px 0 6px; font-weight: 600; }
.debug table { width: 100%; border-collapse: collapse; }
.debug td { padding: 4px 0; vertical-align: top; border-bottom: 1px solid #1A1A1A; }
.debug td.k { width: 42%; color: var(--muted); padding-right: 10px; word-break: break-word; }
.debug td.v { word-break: break-word; }

/* Быстрые прыжки в панели отладки */
.debug-jumps { display: flex; flex-direction: column; gap: 2px; }
.debug-jump {
  display: block;
  padding: 7px 0;
  font-size: 13px;
  color: var(--accent-text);
  text-decoration: none;
  border-bottom: 1px solid #1A1A1A;
}
.debug-jump:active { opacity: 0.6; }

/* --- Видимый фокус для клавиатуры (доступность) --- */
.option:focus-visible,
.gender:focus-visible,
.primary:focus-visible,
.secondary:focus-visible,
.back:focus-visible,
.input:focus-visible,
.plan-to-map:focus-visible,
.theme-toggle:focus-visible,
.tappable:focus-visible,
.tap-hint:focus-visible,
.talk-summary:focus-visible,
.wheel:focus-visible,
.wheel-item:focus-visible,
.download-btn:focus-visible,
.demo-link:focus-visible,
.chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Только для скринридера: невидимо глазом, доступно ассистивным технологиям. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Полный цикл: кнопки скачивания карты и памятки --- */
.downloads { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.download-btn { width: 100%; }
.download-btn.dl-error { outline: 1.5px solid #C0392B; outline-offset: 2px; }
.downloads-caption { font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 2px; }
.dl-msg { font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 2px; }
.dl-msg-error { color: #C0392B; }

/* --- Плашка согласия на прогон --- */
.consent { justify-content: center; gap: 20px; }
.consent-box {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-radius: 16px;
  padding: 24px 22px;
}
.consent-text { font-size: 18px; line-height: 1.6; }

/* --- Демо-маршрут эффектов (localhost) --- */
.demo { gap: 14px; }
.demo-title { font-size: 24px; color: var(--accent-text); }
.demo-note { font-size: 15px; line-height: 1.5; color: var(--muted); }
.demo-item { border-top: 1px solid var(--line); padding-top: 12px; }
.demo-link { display: inline-block; font-size: 17px; font-weight: 700; color: var(--accent-text); text-decoration: none; }
.demo-link.demo-off { color: var(--muted); font-weight: 400; }
.demo-hint { font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 4px; }

/* --- Форма наблюдателя (инструмент продюсера) --- */
.observer { gap: 16px; }
.observer-title { font-size: 22px; color: var(--accent-text); }
.observer-field { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.observer-field-label { font-size: 15px; color: var(--muted); }
.observer-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: inherit; font-size: 15px; line-height: 1.2;
  padding: 10px 14px; min-height: 40px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text);
  cursor: pointer; transition: transform 90ms ease-out, border-color 120ms ease-out;
}
.chip:active { transform: scale(0.96); }
.chip.on { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.14); color: var(--accent-text); font-weight: 600; }
.observer-machine {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: rgba(var(--accent-rgb), 0.05); display: flex; flex-direction: column; gap: 4px;
}
.observer-machine-title { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.observer-machine-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.omk { color: var(--muted); }
.omv { text-align: right; }
.observer-free { width: 100%; resize: vertical; min-height: 72px; }
.observer-save { margin-top: 8px; }
.observer-msg { font-size: 14px; color: var(--accent-text); min-height: 18px; }

/* --- Уважение к настройке «меньше движения» --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .fade { opacity: 1; transform: none; }
  .headline { opacity: 1; filter: none; }
  .archetype-stage::before { opacity: 0; }
  .particles { display: none; }
  body::before { opacity: 0.05; }
  /* Тактильное проседание и пульс — тоже движение: гасим */
  .option.shown:active,
  .primary:active:not(:disabled),
  .theme-toggle:active,
  .chip:active { transform: none; }
}
