/* ─────────────────────────────────────────────────────────────────────────
   визуальный язык. палитра своя, а не телеграмная: разбор за деньги не должен
   выглядеть по-разному у человека со светлой темой и у человека с тёмной.
   апп просит телеграм перекрасить свою рамку под нас (setHeaderColor в app.js),
   поэтому шва между чужим верхом и нашим фоном не видно.

   менять вид = менять этот блок, дальше по файлу голых цветов нет.
   ───────────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;

  /* монохромная шкала: цвет в интерфейсе значит «сюда смотри», поэтому он
     ровно один. всё остальное - градации серого */
  --bg:        #101012;
  --surface:   #1a1a1d;
  --surface-2: #1a1a1d;

  /* линии вместо заливок: плотность строится волосяными границами */
  --line-card:  rgba(233, 233, 230, .08);
  --line-rule:  rgba(233, 233, 230, .10);
  --line-field: rgba(233, 233, 230, .14);
  --line-btn:   rgba(233, 233, 230, .20);
  --line-stamp: rgba(233, 233, 230, .25);
  --separator:  var(--line-rule);

  --text:      #e9e9e6;
  --text-body: #cfcfcb;   /* длинное чтение */
  --text-dim:  #8a8a86;   /* подписи, лейблы */
  /* в хэндоффе #6d6d6a, поднят до 4.9:1 на фоне и 4.5:1 на карточке: им
     подписаны оверлайны и мета мелким кеглем, а мелкий норму не прощает.
     на глаз разница неразличима, откат - одна строка */
  --text-faint:#828280;   /* номера, мета, плейсхолдеры */

  /* единственный сигнал: одно оранжевое пятно на экран - ключевая цифра,
     кнопка денег или записи, активный элемент. служебная шпала цитаты
     в счёт не идёт */
  --accent:    #ff4a1c;
  --on-accent: #101012;

  /* один шрифт для всего + моно для служебных надписей (номера, оверлайны) */
  --font-ui:   "Onest", -apple-system, system-ui, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  /* «чем ближе к пальцу - тем мягче» */
  --radius:       20px;   /* внешняя карточка */
  --radius-inner: 16px;   /* вложенная */
  --radius-btn:   14px;
  --radius-field: 12px;

  /* типографика: один масштаб на весь апп */
  --step--2: .6875rem;    /* 11px мета */
  --step--1: .8125rem;    /* 13px подписи */
  --step-0:  .90625rem;   /* 14.5px основной текст */
  --step-1:  1.0625rem;   /* 17px значение в таблице */
  --step-2:  1.25rem;     /* 20px заголовок блока */
  --step-3:  1.5rem;      /* 24px заголовок экрана */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding:
    calc(24px + var(--tg-content-safe-area-inset-top, 0px))
    calc(22px + var(--tg-content-safe-area-inset-right, 0px))
    calc(28px + var(--tg-content-safe-area-inset-bottom, 0px))
    calc(22px + var(--tg-content-safe-area-inset-left, 0px));
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  /* на macOS текст рендерится жирнее задуманного */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1 {
  font-size: var(--step-3);
  line-height: 1.3;
  margin: 0 0 12px;
  font-weight: 600;
  text-wrap: balance;       /* заголовок из двух слов не должен ломаться 3+1 */
}

/* оверлайн — служебная шапка раздела: «01 · SWOT». моно + разрядка,
   он держит номерную систему всего продукта */
.overline {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 12px;
}
.overline .num { color: var(--text-faint); }

/* круглая печать номера аудита — документ, а не чат */
.stamp {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-stamp);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.lead {
  margin: 0 0 18px;
  color: var(--text-body);
  max-width: 46ch;
  text-wrap: pretty;        /* без висячего слова на последней строке */
}
.muted { font-size: var(--step--1); color: var(--text-faint); }
.screen[hidden] { display: none; }

::selection { background: var(--accent); color: var(--on-accent); }

/* фокус виден всегда: без него анкету нельзя пройти с клавиатуры */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ── кнопки ─────────────────────────────────────────────────────────────── */

/* иерархия из хэндоффа: accent (деньги и запись, одна на экран) →
   primary (ход вперёд) → outline → ghost */
button {
  font: inherit;
  min-height: 44px;              /* палец, а не курсор */
  border-radius: var(--radius-btn);
  border: 0;
  cursor: pointer;
}

.primary {
  width: 100%;
  background: var(--text);
  color: var(--on-accent);
  font-weight: 600;
  font-size: var(--step--1);
  padding: 14px 16px;
}

/* единственная оранжевая кнопка на экран: оплата и запись голоса */
.accent {
  width: 100%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: var(--step--1);
  padding: 14px 16px;
}

.outline {
  background: none;
  border: 1px solid var(--line-btn);
  color: var(--text);
  font-weight: 500;
  font-size: var(--step--1);
  padding: 13px 16px;
}

.ghost {
  background: none;
  color: var(--text-dim);
  font-size: var(--step--1);
  padding: 12px;
}

button:disabled { opacity: .45; cursor: default; }
[aria-busy="true"] { opacity: .7; }

/* ── старт ──────────────────────────────────────────────────────────────── */

/* строки-факты = таблица данных: тихий лейбл слева, значение справа.
   ни вертикальных линий, ни заливок — только волосяные линейки */
.facts { list-style: none; padding: 0; margin: 0 0 26px; }
.facts li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line-rule);
  color: var(--text-dim);
  font-size: var(--step--1);
  line-height: 1.5;
}
.facts span {
  order: 2;
  text-align: right;
  color: var(--text);
  font-weight: 600;
  font-size: var(--step-1);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── согласие на данные ─────────────────────────────────────────────────── */

.consent { margin-top: 14px; font-size: .82rem; color: var(--text-dim); }
.consent summary {
  cursor: pointer;
  padding: 8px 0;          /* палец должен попадать по строке, а не по тексту */
  list-style: none;
}
.consent summary::-webkit-details-marker { display: none; }
.consent summary::after { content: ' — подробнее'; opacity: .7; }
.consent[open] summary::after { content: ' — свернуть'; }
.consent-body { white-space: pre-line; line-height: 1.5; padding-bottom: 8px; }

/* ── поля контактов ─────────────────────────────────────────────────────── */

.field {
  display: block;
  margin: 14px 0 6px;
  font-size: .82rem;
  color: var(--text-dim);
}

/* ── прогресс ───────────────────────────────────────────────────────────── */

.progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 26px;
}
/* линия 2px, заливка — единственное оранжевое на экране шага */
.bar { height: 2px; background: var(--line-rule); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); }
.progress p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

@media (prefers-reduced-motion: no-preference) {
  .bar > div { transition: width .25s ease; }
}

/* ── шаг ────────────────────────────────────────────────────────────────── */

/* вопрос: сдержанный кегль, набор одним шрифтом. читается как строка
   документа, а не как рекламный слоган */
.prompt {
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.35;
  white-space: pre-line;
  text-wrap: pretty;
  max-width: 26ch;
  margin: 0 0 22px;
}

textarea, input[type="text"], input[type="url"], input[type="email"] {
  width: 100%;
  font: inherit;
  font-size: 16px;               /* меньше — и ios зумит страницу при фокусе */
  padding: 13px 14px;
  border-radius: var(--radius-field);
  border: 1px solid var(--line-field);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
::placeholder { color: var(--text-faint); }

textarea { min-height: 116px; line-height: 1.6; }

[aria-invalid="true"] { border-color: var(--accent); }

.nav { display: flex; gap: 10px; align-items: center; margin-top: 22px; }
/* «назад» узкой колонкой, «дальше» шире — вес хода вперёд виден геометрией */
.nav .outline { flex: 1; }
.nav .primary { flex: 2; }

.error { color: var(--accent); margin: 12px 0 0; font-size: var(--step--1); }
.error[hidden] { display: none; }

/* кнопка телеграма висит поверх страницы и перекрывает то, что под ней —
   низ страницы должен заканчиваться выше неё */
body.has-main-button { padding-bottom: 88px; }
body.has-main-button .nav .primary { display: none; }

.save-state {
  position: sticky;
  top: 0;
  margin: 0 0 4px;
  min-height: 1.2em;
  font-size: .8rem;
  color: var(--text-dim);
  text-align: right;
}
.save-state[data-status="failed"] { color: var(--accent); }

/* ── варианты выбора: крупные капсулы во всю ширину ─────────────────────── */

.choices { display: grid; gap: 8px; }
.choice {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding: 15px 16px;
  font-size: var(--step-0);
  border-radius: var(--radius-field);
  background: var(--bg);
  border: 1px solid var(--line-field);
  color: var(--text-dim);
}
/* выбранный вариант — единственное оранжевое пятно этого экрана */
.choice[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--text);
}
.choice::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: transparent;
}
.choice[aria-pressed="true"]::after { background: var(--accent); }

/* ── запись голосового: большой круг по центру, как check in в рефе ─────── */

.recorder {
  display: grid;
  justify-items: center;
  gap: 20px;
  padding: 30px 0 10px;
}
/* таймер моноширинный: цифры не пляшут по секундам */
.rec-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1;
  color: var(--text);
}
.rec-hint {
  text-align: center;
  color: var(--text-faint);
  font-size: var(--step--1);
  margin: 0;
}
/* кнопка записи — вторая законная оранжевая после кнопки денег */
.rec-btn {
  width: 84px;
  height: 84px;
  min-height: 84px;
  border-radius: 50%;
  padding: 0;
  font-size: var(--step--1);
  font-weight: 600;
  background: var(--accent);
  color: var(--on-accent);
}
.rec-btn[data-recording="true"] {
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .rec-btn[data-recording="true"] { animation: rec-pulse 1.6s ease-in-out infinite; }
  @keyframes rec-pulse { 50% { opacity: .55; } }
}

.attach { display: block; text-align: center; color: var(--text-dim); padding: 12px; font-size: var(--step--1); }
.attach input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ── списки принятого (голосовое, треки, демки) ─────────────────────────── */

/* карточка принятого: подпись и «убрать» строкой сверху, плеер под ними.
   раньше audio во всю ширину выталкивал подпись в колонку шириной в букву */
.items { list-style: none; padding: 0; margin: 16px 0 0; }
.items li {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-inner);
  margin-bottom: 8px;
}
.items .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.items .label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: var(--step--1);
  color: var(--text-body);
}
.items audio { width: 100%; height: 36px; display: block; }
.drop {
  flex: none;
  background: none;
  border: 1px solid var(--line-btn);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: var(--step--2);
  padding: 7px 14px;
  min-height: 36px;
}

.upload-bar { height: 3px; background: var(--separator); border-radius: 2px; overflow: hidden; }
.upload-bar > div { height: 100%; width: 0; background: var(--accent); }

/* ── пейволл ────────────────────────────────────────────────────────────── */

.price {
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  margin: 8px 0 18px;
  font-variant-numeric: tabular-nums;
}

/* ── этапы разбора ──────────────────────────────────────────────────────── */

/* этапы генерации — строки состояния, не светофор: пройденные тихие,
   текущий оранжевой точкой */
.stages { list-style: none; padding: 0; margin: 26px 0 0; display: grid; }
.stages li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line-rule);
  color: var(--text-faint);
  font-size: var(--step--1);
}
.stages li::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--text-faint);
  background: transparent;
  flex: none;
}
.stages li[data-state="done"]::before { background: var(--text-dim); border-color: var(--text-dim); }
.stages li[data-state="done"] { color: var(--text-dim); }
.stages li[data-state="now"]::before { background: var(--accent); border-color: var(--accent); }
.stages li[data-state="now"] { color: var(--text); font-weight: 600; }
/* статус текущего этапа читается не только цветом точки */
.stages li[data-state="now"]::after { content: '…'; color: var(--text-faint); }

@media (prefers-reduced-motion: no-preference) {
  .stages li[data-state="now"]::before { animation: pulse 1.6s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .4; } }
}

/* ── разбор: шапка раздела ──────────────────────────────────────────────── */

.branch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.branch-head h1 {
  font-size: var(--step-2);
  margin-bottom: 4px;
}

.share {
  flex: none;
  width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 50%;
  background: none;
  border: 1px solid var(--line-btn);
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1;
}
.share[data-done="true"] { color: var(--text-faint); border-color: var(--line-card); }

.branch-meta {
  margin: 0 0 22px;
  font-size: var(--step--1);
  color: var(--text-faint);
}

/* ── разбор: нижний таб-бар ─────────────────────────────────────────────── */

/* сегмент-контрол разделов: пилюля внизу контента, активный сегмент светлый.
   не floating — в макете он часть документа, а не панель поверх него */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + var(--tg-content-safe-area-inset-bottom, 0px));
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line-btn);
  z-index: 10;
}
.tabbar[hidden] { display: none; }

.tab {
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 999px;
  background: none;
  color: var(--text-dim);
  font-size: var(--step--1);
  font-weight: 500;
  white-space: nowrap;
}
.tab[aria-selected="true"] {
  background: var(--text);
  color: var(--on-accent);
  font-weight: 600;
}

/* контент не должен уезжать под пилюлю */
body.has-tabbar { padding-bottom: 100px; }

/* ── структурный рендер разбора (формы из мокапа) ───────────────────────── */

/* проверенные цифры — таблица данных, а не пилюли: лейбл тихо слева,
   значение справа. первое значение оранжевое = ключевой факт диагноза */
.chips { display: grid; margin-bottom: 24px; }
ul.chips { list-style: none; padding: 0; margin: 0 0 24px; }
.chip {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line-rule);
}
.chip-value {
  order: 2;
  font-weight: 600;
  font-size: var(--step-1);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  white-space: nowrap;
}
.chip:first-child .chip-value { color: var(--accent); }
.chip-label { font-size: var(--step--1); color: var(--text-dim); }

/* голос продюсера — не курсив, а блок со шпалой: он комментирует данные,
   а не цитирует их */
.pullquote {
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--text-body);
  margin: 0 0 26px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--accent);
  text-wrap: pretty;
}

/* сетка 2×2 из макета: смысл swot в том, что пары видны рядом — сильное
   против слабого, возможности против рисков. на узком экране пары
   разворачиваются в строки, но порядок противопоставления сохраняется */
.quadrants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin-bottom: 26px;
}
.quadrant {
  padding: 16px 0;
  border-top: 1px solid var(--line-rule);
}

/* русские формулировки бывают по 100+ знаков: в колонке 170px это стена.
   контейнерный запрос переключает на одну колонку по фактической ширине */
@container (max-width: 420px) {
  .quadrants { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@supports not (container-type: inline-size) {
  @media (max-width: 420px) {
    .quadrants { grid-template-columns: minmax(0, 1fr); gap: 0; }
  }
}
.quadrant-title {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.quadrant-items {
  display: grid;
  gap: 7px;
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--text-body);
}
/* маркер — тире, как в наборе документа */
.quadrant-items > div { display: flex; gap: 8px; }
.quadrant-items > div::before { content: '—'; color: var(--text-faint); flex: none; }

.section-title {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-faint);
  margin: 2em 0 .8em;
}
.body-p { margin: 0 0 1em; max-width: 66ch; overflow-wrap: anywhere; color: var(--text-body); }
.plain-list { margin: 0 0 1em; padding-left: 0; list-style: none; color: var(--text-body); }
.plain-list li { margin-bottom: .5em; padding-left: 1.1em; position: relative; }
.plain-list li::before { content: '—'; position: absolute; left: 0; color: var(--text-faint); }

/* стратегия: цели таблицей, этапы карточками на линии */
.goals-card {
  background: var(--surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-inner);
  padding: 18px;
  margin-bottom: 24px;
}
.goals-title {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.goals-list { display: grid; font-size: var(--step--1); color: var(--text-body); }
.goal-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line-rule);
}
.goal-row:first-child { border-top: 0; padding-top: 0; }
.goal-num {
  order: 2;
  color: var(--text);
  font-weight: 600;
  font-size: var(--step-1);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* первая цель — единственная оранжевая цифра в блоке */
.goal-row:first-child .goal-num { color: var(--accent); }

.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 4px; top: 10px; bottom: 10px;
  width: 1px;
  background: var(--line-rule);
}
.stage { position: relative; margin-bottom: 10px; }
.stage-dot {
  position: absolute;
  left: -20px; top: 20px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid var(--text-faint);
  background: var(--bg);
}
.stage-dot.active { background: var(--accent); border-color: var(--accent); }
.stage-card {
  background: var(--surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-inner);
  padding: 18px;
}
.stage-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.stage-title { font-weight: 600; font-size: var(--step-0); }
.stage-months {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--text-faint);
  white-space: nowrap;
}
.stage-goal { margin: 0 0 12px; font-size: var(--step--1); color: var(--text-body); }
.stage-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.stage-chip {
  font-size: var(--step--2);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-btn);
  color: var(--text-dim);
}
.stage-metrics {
  font-size: var(--step--1);
  color: var(--text-body);
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line-rule);
}
.stage-metrics-label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.principle {
  margin-top: 24px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--accent);
}
.principle-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.principle-item { font-size: var(--step--1); color: var(--text-body); margin-bottom: .7em; }
.principle-item:last-child { margin-bottom: 0; }

/* faq — вопросы линейками, без карточек: список документа */
.faq-intro { color: var(--text-body); }
.faq-list { display: grid; margin-top: 10px; }
.faq-item { border-top: 1px solid var(--line-rule); }
.faq-q {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  background: none;
  text-align: left;
  color: var(--text);
  border-radius: 0;
}
.faq-q-text { font-weight: 500; font-size: var(--step-0); line-height: 1.45; }
/* знак раскрытия — тонкий плюс/минус, оранжевый только у открытого */
.faq-mark { flex: none; width: 12px; height: 12px; position: relative; margin-top: 5px; }
.faq-mark::before, .faq-mark::after {
  content: '';
  position: absolute;
  background: var(--text-faint);
  left: 0; top: 5px; width: 12px; height: 1.5px;
  transition: transform .18s ease, background .18s ease;
}
.faq-mark::after { transform: rotate(90deg); }
.faq-q[aria-expanded="true"] .faq-mark::after { transform: rotate(0); }
.faq-q[aria-expanded="true"] .faq-mark::before { background: var(--accent); }
.faq-a { padding: 0 0 18px; font-size: var(--step--1); line-height: 1.65; color: var(--text-body); }
.faq-a .body-p { margin-bottom: .8em; font-size: var(--step--1); }

@media (prefers-reduced-motion: reduce) {
  .faq-mark::before, .faq-mark::after { transition: none; }
}

/* практики — нумерованные строки, а не цветные плитки: тот же документ */
.tiles { display: grid; }
.tile {
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: 100%;
  padding: 16px 0;
  border-top: 1px solid var(--line-rule);
  border-radius: 0;
  background: none;
  text-align: left;
  color: var(--text);
}
.tile-num {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-faint);
  flex: 0 0 22px;
}
.tile-title { font-weight: 500; font-size: var(--step-0); line-height: 1.35; flex: 1; }
.tile-meta { font-size: var(--step--2); color: var(--text-faint); white-space: nowrap; }

/* ── текст разбора ──────────────────────────────────────────────────────── */

.prose {
  /* контейнер для запросов: квадранты swot решают свою раскладку по
     фактической ширине колонки, а не по ширине окна */
  container-type: inline-size;
  /* мера: 60-70 знаков в строке. длинная строка заставляет глаз искать начало
     следующей, и на 28 тысячах знаков это решает, дочитают или нет */
  max-width: 66ch;
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text-body);
  text-wrap: pretty;
}
.prose p { margin: 0 0 1.15em; overflow-wrap: anywhere; }

/* подзаголовок внутри раздела: serif цветом раздела - тише текста по весу,
   громче по идентичности. кегль здесь не нужен - нужна пауза перед ним */
.prose h3 {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-faint);
  margin: 2.2em 0 .8em;
  line-height: 1.4;
}
.prose h3:first-child { margin-top: 0; }

.prose ul { margin: 0 0 1.15em; padding-left: 0; list-style: none; }
.prose li {
  position: relative;
  margin-bottom: .6em;
  padding-left: 1.1em;
}
/* свой маркер вместо браузерного: тот прыгает по вертикали от кегля к кеглю */
.prose li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
}

/* акцент внутри абзаца работает не весом, а яркостью: жирный на тёмном
   расплывается, а более светлый тон читается как выделение */
.prose strong { font-weight: 600; color: var(--text); }
.prose a {
  color: var(--accent);
  overflow-wrap: anywhere;
  text-decoration-thickness: from-font;
  text-underline-offset: .2em;
  text-decoration-skip-ink: auto;
}

/* разделитель между этапами — не линия во всю ширину, а короткий штрих:
   линия читается как «конец», а тут просто смена мысли */
.prose hr {
  border: 0;
  height: 1px;
  background: var(--line-rule);
  margin: 2em 0;
}

/* ── сводка ─────────────────────────────────────────────────────────────── */

/* сводка — строки-капсулы, как список friends в рефе: тихий вопрос,
   serif-ответ, незаполненное подсвечено */
.review { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.review button {
  width: 100%;
  display: grid;
  gap: 5px;
  text-align: left;
  padding: 14px 0;
  background: none;
  color: var(--text);
  border-top: 1px solid var(--line-rule);
  border-radius: 0;
}
.review .q { font-size: .75rem; color: var(--text-faint); }
.review .a {
  font-size: var(--step-0);
  font-weight: 500;
  overflow-wrap: anywhere;
  /* длинный ответ в сводке — превью, не чтение */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.review .empty { color: var(--accent); font-weight: 400; }

/* ссылка «продолжить анкету» на разборе: тихая строка, не конкурирует с контентом */
.draft-link {
  color: var(--accent);
  width: auto;
  padding: 8px 0;
  margin: -6px 0 10px;
  min-height: 44px;
  font-size: .85rem;
  text-align: left;
}

/* ── раунд 5: хаб → раздел → провал ──────────────────────────────────────── */

/* хаб: карта разбора. вход не в текст, а в структуру */
.hub-list { list-style: none; padding: 0; margin: 0 0 24px; }
.hub-row {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 15px 0;
  border-top: 1px solid var(--line-rule);
  border-radius: 0;
  background: none;
  text-align: left;
  color: var(--text);
}
.hub-num {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-faint);
  flex: 0 0 22px;
}
.hub-text { display: grid; gap: 3px; flex: 1; }
.hub-title { font-weight: 500; font-size: var(--step-0); }
.hub-sub { font-size: var(--step--1); color: var(--text-faint); }
.hub-row::after { content: '→'; color: var(--text-faint); }

/* пейджер: горизонталь для 3-4 элементов, скролл вниз остаётся для чтения */
.pager-wrap { margin: 0 0 22px; }
.pager {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* карточки должны доезжать до краёв экрана, а не упираться в поля */
  margin: 0 -22px;
  padding: 0 22px;
}
.pager::-webkit-scrollbar { display: none; }
.pager-item {
  scroll-snap-align: start;
  flex: 0 0 82%;
}
.pager-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.pager-dots .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--line-btn);
}
.pager-dots .dot.active { background: var(--accent); }

/* карточка-тезис: заголовок, первый пункт, счётчик, тап = провал */
.q-card, .problem-card {
  display: grid;
  gap: 10px;
  align-content: start;
  width: 100%;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-inner);
  background: var(--surface);
  text-align: left;
  color: var(--text);
}
.problem-card { margin-bottom: 8px; }
.q-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.q-count {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--text-faint);
}
.q-lead { font-size: var(--step--1); line-height: 1.5; color: var(--text-body); }
.q-more { font-size: var(--step--2); color: var(--text-faint); }

/* цели сеткой цифр: год виден одним взглядом */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin: 0 0 24px;
}
.goal-cell { display: grid; gap: 2px; }
.goal-cell .goal-num {
  order: 0;
  font-size: var(--step-2);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.goal-cell:first-child .goal-num { color: var(--accent); }
.goal-label { font-size: var(--step--2); color: var(--text-dim); line-height: 1.4; }
.goal-label.wide { grid-column: 1 / -1; }

/* цели фразой: нумерованный список вместо сетки цифр */
.goals-list { list-style: none; counter-reset: g; padding: 0; margin: 0 0 24px; }
.goals-list li {
  counter-increment: g;
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line-rule);
  font-size: var(--step--1);
  color: var(--text-body);
}
.goals-list li::before {
  content: counter(g);
  flex: none;
  width: 18px;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--text-faint);
}

/* провал: полный текст пункта живёт здесь */
.detail-count {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 18px;
}
.detail-item { padding: 16px 0; border-top: 1px solid var(--line-rule); }
.detail-text { font-weight: 600; font-size: var(--step-0); margin-bottom: 8px; }
.detail-link {
  padding: 2px 0 2px 12px;
  border-left: 2px solid var(--accent);
  border-radius: 0;
  background: none;
  color: var(--text-dim);
  font-size: var(--step--1);
  min-height: 0;
  text-align: left;
}
.detail-link:disabled { opacity: 1; color: var(--text-faint); }
.detail-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-rule);
}
.detail-nav .ghost { padding: 10px 0; }

/* этап в провале: действия чек-листом, «не делаем» плашкой */
.stage-goal-box { margin-bottom: 18px; }
.stage-goal-box .body-p { margin: 6px 0 0; color: var(--text); font-size: var(--step-1); }
.checklist { list-style: none; padding: 0; margin: 0 0 18px; }
.checklist li {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line-rule);
  font-size: var(--step--1);
  color: var(--text-body);
}
.checklist li::before {
  content: '';
  flex: none;
  width: 14px; height: 14px;
  margin-top: 3px;
  border: 1px solid var(--line-btn);
  border-radius: 4px;
}
.notdo {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-inner);
  background: var(--surface);
}
.notdo .body-p { margin: 6px 0 0; font-size: var(--step--1); }

/* подвал раздела: к хабу слева, следующий раздел справа */
.branch-foot {
  display: flex;
  gap: 10px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line-rule);
}
.branch-foot .outline { flex: 1; }
.branch-foot .primary { flex: 2; }

/* ── раунд 6: один экран - одна сетка ────────────────────────────────────
   даниель: «не скролить ни в бок, ни вниз». обзорные экраны разбора живут
   ровно в высоту окна и раскладываются плитками, длинный текст листается
   страницами. класс вешает report.js, потому что интейк с клавиатурой по
   этим правилам жить не может. */

body.fixed-screen {
  height: 100dvh;
  overflow: hidden;
  /* body сам грид: экран получает ровно оставшееся место. с height:100%
     в процентах вылезала разница в пару пикселей и документ начинал скроллиться */
  display: grid;
  /* первый ряд — строка статуса сохранения, второй — сам экран */
  grid-template-rows: auto minmax(0, 1fr);
  padding-bottom: calc(18px + var(--tg-content-safe-area-inset-bottom, 0px));
}
body.fixed-screen #app { display: grid; grid-template-rows: minmax(0, 1fr); min-height: 0; }
body.fixed-screen .screen:not([hidden]) {
  display: grid;
  /* шапка по содержимому, сетка забирает остаток, футер прижат вниз */
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}
/* контейнер сетки не должен растягивать грид: min-height:0 снимает
   автоминимум грид-элемента, иначе плитки распирают экран */
body.fixed-screen .prose { min-height: 0; overflow: hidden; }

/* сетка плиток: две колонки, ряды делят высоту поровну */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  height: 100%;
  min-height: 0;
}
.grid.rows-2 { grid-template-rows: repeat(2, minmax(0, 1fr)); }
.grid.rows-3 { grid-template-rows: repeat(3, minmax(0, 1fr)); }
.grid.rows-4 { grid-template-rows: repeat(4, minmax(0, 1fr)); }

/* плитка: заголовок сверху, тезис под ним, счётчик в углу */
.cell {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-inner);
  background: var(--surface);
  text-align: left;
  color: var(--text);
  overflow: hidden;
}
.cell-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.cell-title {
  font-weight: 600;
  font-size: var(--step--1);
  line-height: 1.25;
}
.cell-num {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--text-faint);
  flex: none;
}
/* текст обрезается клампом, а не переполняет плитку: полностью он живёт
   в читалке, поэтому обрезка ничего не теряет */
.cell-lead {
  font-size: var(--step--2);
  line-height: 1.45;
  color: var(--text-body);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  min-height: 0;
}
.cell-foot {
  align-self: end;
  font-size: var(--step--2);
  color: var(--text-faint);
}

/* полоса под сеткой: главная проблема, цели года - один вход во всю ширину */
.band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-inner);
  background: var(--surface);
  text-align: left;
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 500;
}
.band::after { content: '→'; color: var(--text-faint); }
.band-sub { color: var(--text-faint); font-weight: 400; font-size: var(--step--2); }

/* ── читалка: длинный текст страницами ──────────────────────────────────── */

.reader {
  display: grid;
  grid-template-rows: 1fr auto;
  /* высоту задаёт грид-ряд родителя; своя height:100% прибавляла бы к нему
     собственный gap и выпихивала футер за экран */
  min-height: 0;
  height: 100%;
  gap: 10px;
  box-sizing: border-box;
}
.reader-page {
  min-height: 0;
  overflow: hidden;   /* страница набивается ровно по высоте, см. reader() */
}
/* исключение: абзац длиннее целого экрана. режем по абзацам, поэтому такому
   разрешаем скроллиться внутри своей страницы - иначе конец текста пропадёт */
.reader-page.overflowing { overflow-y: auto; }
.reader-dots { display: flex; gap: 6px; align-items: center; }
.reader-dots .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--line-btn);
}
.reader-dots .dot.active { background: var(--accent); }
.reader-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.reader-page .body-p { margin: 0 0 1.1em; }
.reader-page .body-p:last-child { margin-bottom: 0; }
.reader-lead { font-size: var(--step-1); font-weight: 600; margin: 0 0 12px; }

/* футер разбора прижат к низу: в fixed-screen он третий ряд грида */
body.fixed-screen .branch-foot { margin-top: 12px; padding-top: 12px; }
body.fixed-screen .branch-head { margin-bottom: 2px; }
body.fixed-screen .branch-meta { margin-bottom: 10px; }
body.fixed-screen .overline { margin-bottom: 6px; }

/* три ряда экрана разбора: шапка по содержимому, сетка/читалка на остаток,
   низ прижат. вне fixed-screen обёртки ничего не делают */
body.fixed-screen .screen-top,
body.fixed-screen .screen-bottom { min-height: 0; }
body.fixed-screen .screen-bottom { display: grid; gap: 8px; }
body.fixed-screen .branch-foot.screen-bottom {
  grid-auto-flow: column;
  grid-template-columns: 1fr 2fr;
  align-items: center;
}
body.fixed-screen .branch-foot.screen-bottom .outline,
body.fixed-screen .branch-foot.screen-bottom .primary { width: 100%; }
/* хаб: сетка секций - второй ряд, значит скролла нет и здесь */
body.fixed-screen #hub-sections { margin: 0; padding: 0; list-style: none; }
body.fixed-screen .grid-item { display: grid; min-height: 0; }
body.fixed-screen #hub-chips { margin: 0; padding: 0; list-style: none; }
body.fixed-screen .pullquote { margin: 0 0 10px; }
/* цитата на хабе не должна съедать сетку: три строки максимум */
body.fixed-screen #hub-quote {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* шапка экрана — грид, а не блок: у блока margin детей схлопывается наружу,
   высота считается нулевой, и экран уезжает за пределы окна на эти margin */
body.fixed-screen .screen-top {
  display: grid;
  align-content: start;
  gap: 4px;
}
body.fixed-screen .screen-top > * { margin: 0; }
