/* Сайт разбора поверх эталона владельца (RZ-06): шрифты — fonts.css, токены —
   pl-vars.css (копия reference/tokens.css), компоненты — components.css (копия
   reference/components.css). Здесь только то, что сайту нужно иначе: `#app`
   вместо `.screen` эталона и правила экранов, ещё не перенесённых (S16; мини-апп
   M02/M03 — miniapp.css). Цвета только через токены. */

/* Старые имена переменных — алиасы на токены эталона, до блоков 2-3. */
:root {
  --bg: var(--pl-bg);
  --card: var(--pl-card);
  --line: var(--pl-line);
  --text: var(--pl-text);
  --muted: var(--pl-muted);
  --accent: var(--pl-accent);
  --on-accent: var(--pl-on-accent);
  --green: var(--pl-green-text);
  --dust: var(--pl-dust);
  --glint: var(--pl-spark);
  --r: var(--pl-r-card);
  --lv-stoyu: var(--pl-lv-stoyu);
  --lv-buksuyu: var(--pl-lv-buksuyu);
  --lv-idu: var(--pl-lv-idu);
  --lv-polny: var(--pl-lv-polny);
  --b-fog: var(--pl-fog);
  --b-autopilot: var(--pl-autopilot);
  --b-overload: var(--pl-overload);
  --b-cant: var(--pl-cant);
  --b-noroom: var(--pl-noroom);
  --head: var(--pl-font-head);
  --body: var(--pl-font-text);
  --kb: 0px;
}

[hidden] { display: none !important; }
body {
  font: 400 var(--pl-fs-body)/1.4 var(--pl-font-text);
  min-height: 100svh;
  -webkit-tap-highlight-color: transparent;
}

/* --- экран: `#app` вместо `.screen` эталона (`.sc-leaf-page` — его копия на листе книги, sfery.css) --- */
#app, .sc-leaf-page {
  position: relative;
  max-width: 430px; margin: 0 auto;
  min-height: 100svh;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
  overflow: clip;
}
#app > *:not(.pl-bg-canvas), .sc-leaf-page > *:not(.pl-bg-canvas) { position: relative; z-index: 1; }
/* S01, S02, вопросы: поля и шаг эталона (.screen: 56/20/32, между блоками 20). */
#app[data-look="pl"], .sc-leaf-page[data-look="pl"] {
  padding: 56px var(--pl-gutter) calc(32px + env(safe-area-inset-bottom));
  gap: var(--pl-gap);
}

h1, h2, .num { font-family: var(--pl-font-head); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 1.2; margin: 8px 0 8px; }
h2 { font-size: var(--pl-fs-h2); line-height: 1.25; margin: 4px 0 8px; }
p { margin: 6px 0; }
.muted { color: var(--pl-muted); }
.small { font-size: var(--pl-fs-cap); }
.grow { flex: 1 1 auto; }
.center { text-align: center; }
a { color: var(--pl-green-text); }
a.btn { text-decoration: none; }

/* --- S01 (компонент 4) --- */
.s01-title { max-width: 300px; }
.spheres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.foot .link { font-size: var(--pl-fs-cap); }

/* --- S02 (компоненты 1, 11, 28) --- */
.lead.on-text { color: var(--pl-text); }
.card .text { font-size: var(--pl-fs-sm); }
.note-card .cap { font-size: 14px; color: var(--pl-text); }
.s02-actions { display: flex; flex-direction: column; gap: 12px; }
.btn.busy { opacity: .7; }

/* --- вопросы S03, S04, S06, S07 (компоненты 7-10) --- */
.q { display: flex; flex-direction: column; gap: var(--pl-gap); }
.title.q-text { font-size: var(--pl-fs-q); font-weight: 600; line-height: 1.2; }
/* Номер вопроса внутри этапа и пояснение под вопросом (разбор v2, блок 4): тихие строки, дорожка остаётся. */
.q .qcount { margin: -4px 0 -6px; font-size: var(--pl-fs-cap); font-weight: 600; letter-spacing: .02em; color: var(--pl-muted); }
.q .q-hint { margin-top: -6px; }
.opts.locked .opt, .opts.locked ~ .unsure { pointer-events: none; }
@media (max-width: 339px) { .scale10 { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 8px; } }
/* Смена вопроса: сдвиг 16 px и прозрачность за 180 мс, только transform/opacity. */
@keyframes pl-next { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.q.pl-enter { animation: pl-next var(--pl-next-ms) ease-out; }

/* --- вставки S05, S08-S10 (компоненты 11-13): у эталона вставка без карточки-
   контейнера, блоки идут прямо по экрану; секция остаётся ради data-insert. --- */
.insert { display: contents; }
.s05-title { display: flex; flex-direction: column; gap: 6px; font: 400 17px/1.5 var(--pl-font-text); letter-spacing: normal; }
.s05-title .hero { color: var(--pl-text); }
.note-card .note-text { font-size: var(--pl-fs-sm); }
.insert .text.quiet { font-size: var(--pl-fs-sm); color: var(--pl-muted); }
.insert-foot { display: flex; flex-direction: column; gap: 14px; }

/* --- S11 и S12/S13 (компоненты 5, 14-16, 17, поле и шаги эталона) --- */
.stagebar .spacer { width: 32px; flex: none; }      /* место «←» на S11 */
.trail-space { height: 150px; flex: none; }         /* под тропой S11 */
.title.big { font-size: 34px; }
.calc .cap { color: var(--pl-text); font-size: 14px; }
.s11-steps, .s12-benefits { display: flex; flex-direction: column; gap: 10px; }
.s11-steps .text, .row5 .text { font-size: var(--pl-fs-sm); }
.s12-actions { display: contents; }
a.btn2 { display: flex; align-items: center; justify-content: center; text-decoration: none; }
button.code { width: 100%; text-align: left; }
.mail-card { gap: 12px; }
/* S11 при доставке на сайт (PWA-3): карточка почты, галочка 18+, экран кода. */
.check { display: flex; align-items: center; gap: 10px; font-size: var(--pl-fs-sm); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--pl-accent); }
.site-links { display: flex; justify-content: space-between; gap: 12px; }
.site-links .link[disabled] { opacity: .45; pointer-events: none; }
.site-card [data-otp] { letter-spacing: .3em; font-size: 20px; }
/* Состояние очереди S11 — продукт, не эталон: строкой подписи, без карточки. */
.qbox:has(> .qstate[hidden]) { display: none; }
.qstate { margin: 0; font-size: var(--pl-fs-cap); color: var(--pl-muted); }
.qstate[data-s="offline"], .qstate[data-s="error"] { color: var(--pl-noroom); }

/* --- ниже: экраны на старой разметке (S16; `.link` с подчёркиванием держат
   `.link.quiet` S14 и M01 — правило `.link` эталона без него) --- */
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.link { text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; }
.link.quiet { color: var(--pl-muted); font-size: var(--pl-fs-cap); }
.opt.tap { transform: scale(.985); border-color: var(--pl-accent); }   /* M03 мини-аппа: тап по варианту */
.actions { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }   /* S16 */

/* --- APP-0211-1b (П3-28): область нажатия не меньше 44×44 без смены вида (В-1) — прозрачный псевдоэлемент поверх
   кнопки: по оси, где она меньше 44, выходит за край до 44 вокруг центра; где больше — совпадает с коробкой (у
   псевдоэлемента нет скругления, так ловятся и углы круглой кнопки). Опора — сам элемент: relative через :where (нуль
   специфичности), чтобы своё absolute / fixed выигрывало. Классы приложения — в конце ma-vid.css (грузится последним). --- */
:where(.link, .stagebar .back, .field > label, .hn-field > label, label.check, .consent, .sound, .isc-skip) { position: relative; }
.link::after, .stagebar .back::after, .field > label::after, .hn-field > label::after, label.check::after, .consent::after,
.sound::after, .isc-skip::after, #closex::after {
  content: ""; position: absolute; top: min(0px, calc(50% - 22px)); bottom: min(0px, calc(50% - 22px));
  left: min(0px, calc(50% - 22px)); right: min(0px, calc(50% - 22px)); }
/* галочка над слоем подписи: тап по ней — сама галочка (один раз), по подписи и вокруг — label → та же галочка */
.check input, .consent input { position: relative; z-index: 1; }
/* «←» шапки разбора: метка дорожки (.me) заходит на кнопку на 1 px и лежит выше — касание проходит сквозь неё к кнопке */
.stagebar .back { z-index: 1; }
.stagebar .trk .me { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
