/* Оболочка мини-приложения «Метод Элины», демо: экран входа, корпус экранов, меню «Линия пути», подсказка, своя полоса
   «Назад», пометки «Демо». Экраны — свои файлы: screens_a.css (v2a-), screens_b.css (v2b-), screens_c.css (v2c-).

   Две системы цветов, и это намеренно:
   - экран входа (пока проверяем подпись) — палитра ниже (--w-* / --d-*): тему выбирает Telegram (data-scheme на <html>,
     app.js), а пока он молчит — система;
   - экраны пути — токены --s-* на .ap-screen: «Тёплая» (data-theme="warm") при светлой теме Telegram и «Тёмная с сиянием»
     (data-theme="aura") при тёмной. Контраст текста проверен на этих токенах, поэтому цвета Telegram (--tg-theme-*) здесь
     не берём: шапку и фон Telegram app.js красит в наш фон (setHeaderColor, setBackgroundColor).
   Шрифты — свои статические копии (SIL OFL): Google Fonts нет — кто открыл приложение, чужой сервис не узнаёт. Literata у
   нас нет — цитаты берут Georgia или системный serif. */

@font-face { font-family: "Manrope"; src: url("fonts/Manrope-Regular.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/Manrope-SemiBold.ttf") format("truetype"); font-weight: 600 800; font-display: swap; }
/* цифры (--s-num) — Poppins; у нас одно начертание, Medium, оно и на 600–700 */
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Medium.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }

/* Палитра экрана входа — значениями один раз. Тёмная нужна в двух случаях (Telegram сказал «тёмная»; Telegram молчит, а
   система тёмная), и CSS не умеет объединить селектор с @media — поэтому ниже два блока выбора, но в них только имена. */
:root {
  --w-bg: #FBF4EE; --w-card: #FFFFFF; --w-tx: #2B2826; --w-tx2: #56504C; --w-acc: #D2461F;
  --w-ok-tx: #236B40; --w-ok-soft: #DFEEDD; --w-bad-tx: #B3261E; --w-bad-soft: #FDE2DE;
  --w-warn-tx: #865A00; --w-warn-soft: #FFF0C2;

  --d-bg: #1F1C1A; --d-card: #2B2724; --d-tx: #F5F1EC; --d-tx2: #CBC4BD; --d-acc: #E8502A;
  --d-ok-tx: #76CE93; --d-ok-soft: rgba(47, 158, 94, .18); --d-bad-tx: #FF8F86; --d-bad-soft: rgba(229, 72, 77, .17);
  --d-warn-tx: #FFD36B; --d-warn-soft: rgba(242, 181, 58, .16);

  --acc-on: #FFFFFF; --warn: #F2B53A; --r: 16px;
}

/* Полный экран Telegram (Bot API 8.0; просит app.js, только телефоны): шапки Telegram нет, страница идёт до верха, а
   поверх неё — статус-строка телефона, вырез и плашки «Закрыть» / «⌄ ⋯». Сколько они занимают, telegram-web-app.js
   ставит на <html> сам: --tg-safe-area-inset-* — вырез и системные полосы, --tg-content-safe-area-inset-* — плашки
   Telegram (считаются от первых, поэтому складываем). Класс mx-fs ставит app.js, пока Telegram говорит «полный экран»;
   без него — в обычном режиме и вне Telegram — отступы нулевые, вид прежний. Переменных ещё нет — запасной 0px.
   --mx-fs-t — верх; --mx-fs-l / --mx-fs-r — бока, за вычетом того, что колонку экранов (до 480 px по центру) и так
   отодвигает от края; --mx-fs-b — плашки Telegram снизу (низ телефона уже в --mx-safe-b у .ap-screen). */
:root { --mx-fs-t: 0px; --mx-fs-l: 0px; --mx-fs-r: 0px; --mx-fs-b: 0px; }
:root.mx-fs {
  --mx-fs-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --mx-fs-l: max(0px, calc(var(--tg-safe-area-inset-left, 0px) + var(--tg-content-safe-area-inset-left, 0px) - max(0px, (100vw - 480px) / 2)));
  --mx-fs-r: max(0px, calc(var(--tg-safe-area-inset-right, 0px) + var(--tg-content-safe-area-inset-right, 0px) - max(0px, (100vw - 480px) / 2)));
  --mx-fs-b: var(--tg-content-safe-area-inset-bottom, 0px);
}

/* тёплая (светлая) — по умолчанию */
:root {
  --bg: var(--w-bg); --card: var(--w-card); --tx: var(--w-tx); --tx2: var(--w-tx2); --acc: var(--w-acc);
  --ok-tx: var(--w-ok-tx); --ok-soft: var(--w-ok-soft); --bad-tx: var(--w-bad-tx); --bad-soft: var(--w-bad-soft);
  --warn-tx: var(--w-warn-tx); --warn-soft: var(--w-warn-soft);
}
/* тёмная с сиянием: Telegram сказал «тёмная»… */
:root[data-scheme="dark"] {
  --bg: var(--d-bg); --card: var(--d-card); --tx: var(--d-tx); --tx2: var(--d-tx2); --acc: var(--d-acc);
  --ok-tx: var(--d-ok-tx); --ok-soft: var(--d-ok-soft); --bad-tx: var(--d-bad-tx); --bad-soft: var(--d-bad-soft);
  --warn-tx: var(--d-warn-tx); --warn-soft: var(--d-warn-soft);
}
/* …или Telegram молчит, а система тёмная */
@media (prefers-color-scheme: dark) {
  :root:not([data-scheme]) {
    --bg: var(--d-bg); --card: var(--d-card); --tx: var(--d-tx); --tx2: var(--d-tx2); --acc: var(--d-acc);
    --ok-tx: var(--d-ok-tx); --ok-soft: var(--d-ok-soft); --bad-tx: var(--d-bad-tx); --bad-soft: var(--d-bad-soft);
    --warn-tx: var(--d-warn-tx); --warn-soft: var(--d-warn-soft);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
/* Масштаб страницы — только 1 (и maximum-scale=1, user-scalable=no в index.html): 30.10 на iPhone в полном экране после
   «Уровни» → «Назад» страница осталась чуть увеличенной, край ушёл за экран. В Chromium раскладка та же — увеличивал сам
   WebView двойным касанием или щипком. Двойное касание гасит touch-action, щипок — viewport; прокрутка остаётся */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--tx);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;            /* прокручивается поле экрана (.ap-page), а не страница: иначе в Telegram она уезжала бы вся */
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; text-align: inherit; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid #5AA9F0; outline-offset: 2px; }

/* ---------- экран входа: пока проверяем подпись ---------- */
.shell {
  max-width: 480px;
  min-height: 100%;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top), calc(var(--mx-fs-t) + 16px)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.title { font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -.01em; }
/* Экран входа — один вид в обоих интерфейсах и всегда светлый (тот же, что в ui/shell.css): набор выключает эти стили и включает свои посреди входа, и разный вид давал
   заметный скачок — персиковый или тёмный экран и шапка Telegram, потом серый. Старые экраны закрашивают всё своим видом, когда открываются (reveal). */
#gate { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; max-width: none; min-height: 0; margin: 0; padding: 16px;
  background: #F2F2F5; font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; color: #5C5C66; text-align: center; }
#gate .title { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: 0; color: #16161F; }
#gate .out { padding: 0; border-radius: 0; background: none; font-weight: 400; color: #5C5C66; }
/* Пока всё идёт, вход пустой. Слово остаётся для чтения с экрана, сбой показывается как раньше */
#gate .out[data-state="wait"] { opacity: 0; }
#gate .out[data-state="bad"] { color: #B3261E; }
#gate .out[data-state="warn"] { color: #8A5A00; }
/* Разметка пришла, скрипты нет: сторожа в этот раз тоже нет, и человек ждал бы вечно на пустом экране. Только CSS: строка проявляется сама через 12 с, скрипт, если дошёл, прячет её атрибутом hidden. */
#gate .gate-lost { margin: 0; opacity: 0; color: #5C5C66; animation: gate-lost .2s linear 12s forwards; }
#gate .gate-lost[hidden] { display: none; }
@keyframes gate-lost { to { opacity: 1; } }
/* Приложение ещё не открыто: номер человека и кнопка. Номер можно и выделить: не везде копирование срабатывает */
#gate .gate-note { margin: 0; color: #5C5C66; }
#gate .gate-id { margin: 8px 0 0; font-size: 20px; font-weight: 600; letter-spacing: .02em; color: #16161F; -webkit-user-select: text; user-select: text; }
#gate .gate-copy { min-height: 44px; padding: 10px 18px; border-radius: 22px; background: #E9E9EE; color: #16161F; font-weight: 600; text-align: center; }
#gate .btn { margin-top: 8px; background: #D2461F; color: #fff; }
.btn {
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: var(--r);
  background: var(--acc);
  color: var(--acc-on);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: default; }
.out:empty { display: none; }
.out { padding: 10px 14px; border-radius: var(--r); background: var(--card); font-weight: 600; }
.out[data-state="ok"] { background: var(--ok-soft); color: var(--ok-tx); }
.out[data-state="bad"] { background: var(--bad-soft); color: var(--bad-tx); }
.out[data-state="warn"] { background: var(--warn-soft); color: var(--warn-tx); }

/* локальный режим — плашкой поверх всего, мелко: и на экране входа, и на экранах пути */
.dev-note {
  position: fixed; z-index: 100; top: max(6px, env(safe-area-inset-top), calc(var(--mx-fs-t) + 6px)); right: calc(8px + var(--mx-fs-r));
  padding: 3px 9px; border-radius: 999px;
  background: var(--warn-soft); color: var(--tx); box-shadow: inset 0 0 0 1.5px var(--warn);
  font-weight: 700; font-size: 11px; line-height: 1.3; pointer-events: none;
}

/* ---------- экраны пути: токены и темы ---------- */
@property --aura { syntax: '<color>'; inherits: true; initial-value: #F2A93B; }

.ap-screen {
  position: fixed; top: 0; bottom: 0; left: 0; right: 0;
  width: 100%; max-width: 480px; margin: 0 auto;
  overflow: hidden; overflow: clip; isolation: isolate;
  background: var(--s-bg); color: var(--s-tx);
  font-family: var(--s-font); font-size: 15px; line-height: 1.42;
  transition: background .4s, color .4s;
  user-select: none; -webkit-user-select: none;
  /* низ телефона: полоска «домой» iPhone — от системы или от Telegram (Bot API 8.0 ставит --tg-safe-area-inset-bottom);
     в полном экране — ещё и плашки Telegram снизу, если они есть (--mx-fs-b, :root выше) */
  --mx-safe-b: calc(max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px)) + var(--mx-fs-b));
  /* сколько места снизу занимает меню: поле прокрутки держит под него отступ, подсказка встаёт над ним */
  --bot: var(--mx-safe-b);
}
.ap-screen.mx-menu { --bot: calc(99px + var(--mx-safe-b)); }
.ap-screen input, .ap-screen textarea { user-select: text; -webkit-user-select: text; }
.ap-screen {
  --s-font: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --s-num: 'Poppins', 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --s-quote: 'Literata', Georgia, 'Times New Roman', serif;
  --s-bg: #1F1C1A; --s-card: #2B2724; --s-card2: #36312D; --s-shadow: 0 0 0 transparent;
  --s-line: rgba(255,255,255,.09); --s-tx: #F5F1EC; --s-tx2: #CBC4BD; --s-tx3: #A69E97;
  --s-acc: #E8502A; --s-acc-d: #C8401C; --s-acc-tx: #F47B57; --s-acc-soft: rgba(232,80,42,.16);
  --s-ok: #2F9E5E; --s-ok-tx: #76CE93; --s-ok-soft: rgba(47,158,94,.18);
  --s-warn: #F2B53A; --s-warn-tx: #FFD36B; --s-warn-soft: rgba(242,181,58,.16);
  --s-bad: #E5484D; --s-bad-tx: #FF8F86; --s-bad-soft: rgba(229,72,77,.17);
  --s-blue: #4C8DF6; --s-blue-tx: #7DB8F5; --s-blue-soft: rgba(76,141,246,.16);
  --s-r1: 12px; --s-r2: 18px; --s-r3: 24px; --s-rb: 16px;
  --s-link: #62AEF2;
  --s-menu-bg: #25211F; --s-menu-tx: #B5ADA6; --s-menu-on: #F47B57; --s-menu-ontx: #F68D6D; --s-menu-pill: #45291F; --s-menu-line: rgba(255,255,255,.07);
  --s-menu-sh: 0 -14px 30px -16px rgba(0,0,0,.7);
  --s-tgbtn: #D2461F;
  --s-paper: #F3EEE8; --s-paper-tx: #2B2826; --s-paper-line: #D8D0C7;
  --s-scrim: rgba(8,6,5,.55);
  --s-aura-op: .95;
}
.ap-screen[data-theme=warm] {
  --s-bg: #FBF4EE; --s-card: #FFFFFF; --s-card2: #F6ECE3; --s-shadow: 0 8px 24px -10px rgba(140,80,40,.18);
  --s-line: #EEE2D7; --s-tx: #2B2826; --s-tx2: #56504C; --s-tx3: #655E59;
  --s-acc: #D2461F; --s-acc-tx: #C23D1A; --s-acc-soft: #FDE3D5; --s-ok: #2B8A52; --s-ok-tx: #236B40; --s-ok-soft: #DFEEDD; --s-warn-tx: #865A00; --s-warn-soft: #FFF0C2;
  --s-bad-tx: #B3261E; --s-bad-soft: #FDE2DE;
  --s-blue-tx: #1F5FA0; --s-blue-soft: #E1ECF8;
  --s-r1: 16px; --s-r2: 26px; --s-r3: 32px; --s-rb: 999px;
  --s-link: #1F6FB8;
  --s-menu-bg: #FFFFFF; --s-menu-tx: #655E59; --s-menu-on: #D2461F; --s-menu-ontx: #B4391B; --s-menu-pill: #FDE3D5; --s-menu-line: #F0E5DA;
  --s-menu-sh: 0 -10px 28px -14px rgba(140,80,40,.24);
  --s-paper: #FFFFFF; --s-paper-line: #EDE2D8;
  --s-scrim: rgba(60,40,30,.38);
  --s-aura-op: .42;
}

/* свечение — сверху, цвет по состоянию (отказ «имя не скрылось» красит его в красный). Центр — выше края экрана: шапки над
   полем у приложения нет (её место — шапка Telegram), и при top: -200px самое яркое ложилось под первые строки — мелкий
   текст там падал ниже 4,5:1 */
.ap-aura {
  position: absolute; left: -30%; right: -30%; top: -320px; height: 520px; z-index: 0; pointer-events: none; opacity: var(--s-aura-op);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--aura) 58%, transparent), color-mix(in srgb, var(--aura) 14%, transparent) 60%, transparent);
  transition: --aura 1.1s ease, opacity .5s;
}
/* Обычный режим в Telegram: над страницей — его шапка, app.js красит её в --s-bg (paintBars). Самое яркое сияния лежало у
   самого верха, и с шапкой выходил стык (верх страницы rgb(113,82,38) под шапкой #1F1C1A — проверка полного экрана 30.10,
   F4). Поэтому сияние начинается из цвета фона: первые 56 px оно проявляется, а у края его нет. Маска — от верха свечения
   (оно с top: -320px): 320px — край экрана. В полном экране шапки нет, сияние идёт под часы и плашки — без маски; вне
   Telegram (класса mx-in нет) — как было. */
:root.mx-in:not(.mx-fs) .ap-aura {
  -webkit-mask-image: linear-gradient(to bottom, transparent 320px, #000 376px);
  mask-image: linear-gradient(to bottom, transparent 320px, #000 376px);
}

/* поле экрана: своя прокрутка; снизу — отступ под меню (--bot), сверху — под свою полосу «Назад», если она есть.
   В полном экране поле начинается ниже плашек Telegram (--mx-fs-t) и не заходит под вырез сбоку: прокрученный текст
   обрезается по их краю, а не уходит под часы и «Закрыть». Над полем остаются фон и сияние экрана — стыка нет */
.ap-pages { position: absolute; top: var(--mx-fs-t); left: var(--mx-fs-l); right: var(--mx-fs-r); bottom: 0; z-index: 2; overflow: hidden; overflow: clip; }
.ap-screen.mx-bar-on .ap-pages { top: calc(48px + var(--mx-fs-t)); }
/* шторка оплаты: её затемнение — внутри поля, а полосу над полем (плашки Telegram) затемняем здесь, тем же цветом.
   В обычном режиме полосы нет (--mx-fs-t: 0px) */
.ap-screen.mx-on-pay::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: var(--mx-fs-t); z-index: 3; pointer-events: none;
  background: var(--s-scrim); animation: mx-fade .35s ease both;
}
@keyframes mx-fade { from { opacity: 0; } to { opacity: 1; } }
.ap-page {
  position: absolute; top: 0; bottom: 0; left: 0; right: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 16px max(20px, env(safe-area-inset-right)) calc(var(--bot) + 40px) max(20px, env(safe-area-inset-left));
  scrollbar-width: none; overscroll-behavior: contain; background: transparent;
  /* --dock-h — высота липкого низа экрана (ставит screens_a.js): фокус с клавиатуры не уходит ни под меню, ни под кнопку */
  scroll-padding: 12px 0 calc(var(--bot) + var(--dock-h, 0px) + 24px);
  -webkit-overflow-scrolling: touch;
}
.ap-page::-webkit-scrollbar { display: none; }
.ap-page:focus { outline: none; }
@media (max-width: 359px) {
  .ap-page { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}

.ap-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; }
.ap-layer { position: absolute; top: 0; bottom: 0; left: 0; right: 0; z-index: 40; pointer-events: none; }
.ap-layer > * { pointer-events: auto; }

/* ---------- значки ---------- */
.ap-ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; flex: none; display: inline-block; vertical-align: middle; }
.ap-nsvg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; display: block; }
.ap-nsvf { stroke: none; }
/* маски заливки значков меню — в невидимом svg; display:none у него погасил бы маски */
.mx-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
/* скрытый текст для чтения с экрана */
.ap-vh, .mx-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; }

/* ---------- меню «Линия пути»: строка пути над вкладками ---------- */
/* фон меню — во всю ширину, строка пути и вкладки — не под вырезом сбоку (полный экран, --mx-fs-l / -r) */
.ap-rw { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 var(--mx-fs-r) 0 var(--mx-fs-l); background: var(--s-menu-bg); border-top: 1px solid var(--s-menu-line); box-shadow: var(--s-menu-sh); transition: background .4s; }
.ap-screen[data-theme=warm] .ap-rw { border-radius: 24px 24px 0 0; border-top: 0; }
.ap-path { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 16px; border-bottom: 1px solid var(--s-menu-line); }
.ap-pn { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--s-menu-tx); white-space: nowrap; line-height: 1; }
.ap-pn i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--s-menu-tx); flex: none; display: grid; place-items: center; transition: all .35s; }
.ap-pn i svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.ap-p-done { color: var(--s-tx2); }
.ap-p-done i { width: 15px; height: 15px; border: 0; background: var(--s-ok); color: #fff; }
.ap-screen[data-theme=aura] .ap-p-done i { color: #0B2716; }
.ap-p-now { color: var(--s-tx); font-weight: 800; }
.ap-p-now i { width: 12px; height: 12px; border: 0; background: var(--s-acc); box-shadow: 0 0 0 4px var(--s-acc-soft); }
.ap-pln { flex: 1; height: 2px; border-radius: 1px; background: var(--s-menu-line); min-width: 8px; transition: background .4s; }
.ap-screen[data-theme=warm] .ap-pln { background: #E5D9CD; }
.ap-pln.ap-done { background: var(--s-ok); }
/* шаги, которых у купленного уровня нет (у C — ни переписанного резюме, ни PDF): строка пути их не обещает */
.ap-path .mx-gone { display: none; }
.ap-m5 { display: grid; grid-template-columns: repeat(5, 1fr); align-items: start; padding: 3px 6px calc(4px + var(--mx-safe-b)); }
.ap-t {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 58px; min-width: 44px;
  color: var(--s-menu-tx); font-size: 11.5px; font-weight: 600; letter-spacing: -.005em; transition: color .2s;
}
.ap-t .ap-tl { line-height: 1.1; white-space: nowrap; transition: color .2s; }
.ap-t.ap-on { color: var(--s-menu-on); }
.ap-t.ap-on .ap-tl { color: var(--s-menu-ontx); font-weight: 800; }
.ap-ti { position: relative; display: grid; place-items: center; width: 28px; height: 28px; flex: none; }
.ap-io, .ap-if { grid-area: 1/1; width: 28px; height: 28px; transition: opacity .2s, transform .4s cubic-bezier(.3,1.6,.5,1); }
.ap-io svg, .ap-if svg { width: 28px; height: 28px; }
.ap-if { opacity: 0; transform: scale(.6); }
.ap-on .ap-if { opacity: 1; transform: none; }
.ap-on .ap-io { opacity: 0; transform: scale(1.1); }
.ap-c { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 58px; min-width: 60px; color: var(--s-acc-tx); font-size: 11.5px; font-weight: 800; }
.ap-cb { position: relative; display: grid; place-items: center; width: 56px; height: 34px; border-radius: 12px; background: var(--s-acc); color: #fff; flex: none; transition: transform .2s; }
.ap-c:active .ap-cb { transform: scale(.94); }
.ap-cic { grid-area: 1/1; width: 22px; height: 22px; transition: opacity .3s, transform .45s cubic-bezier(.3,1.4,.4,1); }
.ap-cic svg { width: 22px; height: 22px; }
.ap-cic.ap-off { opacity: 0; transform: scale(.3) rotate(-90deg); }
.ap-c0 {
  position: absolute; top: -9px; right: -16px; padding: 2px 7px; border-radius: 999px; background: #fff; color: #1C1917; font-family: var(--s-num); font-size: 11.5px; font-weight: 700; line-height: 1.35;
  box-shadow: 0 0 0 2px var(--s-acc); white-space: nowrap; transition: transform .35s cubic-bezier(.3,1.5,.4,1), opacity .2s;
}
.ap-c0.ap-off { transform: scale(0); opacity: 0; }
.ap-cl { white-space: nowrap; transition: opacity .2s; }

/* ---------- подсказка (тост) — над меню ---------- */
.ap-toast {
  position: absolute; left: calc(16px + var(--mx-fs-l)); right: calc(16px + var(--mx-fs-r)); bottom: calc(var(--bot) + 18px); display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px;
  background: #2F2A27; color: #F5F1EC; box-shadow: 0 18px 40px -16px rgba(0,0,0,.6); transform: translateY(20px); opacity: 0;
  transition: transform .35s cubic-bezier(.3,1.3,.5,1), opacity .25s; pointer-events: none !important;
}
.ap-toast.ap-on { transform: none; opacity: 1; }
.ap-toast svg { width: 20px; height: 20px; flex: none; fill: none; stroke: #76CE93; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.ap-toast span { flex: 1; font-size: 14.5px; font-weight: 600; line-height: 1.3; }

/* фокус переводится на заголовок нового экрана (app.js, show): он не кнопка, рамка ему не нужна */
.ap-page h1:focus { outline: none; }
/* в «Тёплой» #5AA9F0 к белому меню — 2,5:1, к фону шторки — 2,3:1; #2F7FD0 — не ниже 3:1 к обоим */
.ap-screen[data-theme=warm] :focus-visible, .v2b-shw[data-th=warm] :focus-visible { outline-color: #2F7FD0; }

/* ---------- своя полоса «Назад»: только если у клиента нет BackButton Telegram (старый клиент, браузер) ---------- */
.mx-bar {
  position: absolute; top: var(--mx-fs-t); left: var(--mx-fs-l); right: var(--mx-fs-r); z-index: 8; height: 48px; display: flex; align-items: center; padding: 0 8px;
  background: var(--s-bg); border-bottom: 1px solid var(--s-line);
}
.mx-back { display: flex; align-items: center; gap: 2px; min-height: 44px; min-width: 44px; padding: 0 10px 0 4px; border-radius: 12px; color: var(--s-link); font-size: 16px; font-weight: 600; }
.mx-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mx-back.mx-off { visibility: hidden; }

/* ---------- кнопки Telegram: показаны настоящие — свои в экране прячем (app.js ставит классы) ---------- */
.mx-tg-main [data-tg="main"], .mx-tg-sec [data-tg="sec"] { display: none !important; }

/* ---------- пометки демо ---------- */
/* «Демо» — спокойно, но заметно: где человек мог бы решить, что всё по-настоящему (файл, проверка, оплата, доступ) */
.mx-demo {
  display: flex; gap: 8px; align-items: baseline; margin: 12px 0; padding: 9px 12px; border-radius: 12px;
  background: var(--s-warn-soft); color: var(--s-tx); font-size: 13px; line-height: 1.4; font-weight: 600; text-align: left;
}
.mx-demo b {
  flex: none; padding: 1px 7px; border-radius: 999px; background: var(--s-warn); color: #2B1C00;
  font-size: 11.5px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
}
.mx-demo span { min-width: 0; }
/* ссылка демо (список отказов, учебное резюме без файла) — тише основных кнопок */
.mx-demo-link {
  display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 44px; margin-top: 14px; padding: 6px 12px;
  border-radius: 12px; border: 1.5px dashed color-mix(in srgb, var(--s-tx3) 55%, transparent); color: var(--s-tx2);
  font-size: 14px; font-weight: 700; text-align: center;
}
.mx-demo-link svg { width: 17px; height: 17px; }
/* ссылка на документ в тексте сервера (политика, согласие) — оболочка открывает её окном Telegram (app.js, openDoc) */
.mx-doc {
  color: var(--s-link, #62AEF2); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
/* список «Экраны отказов» */
.mx-elist { margin-top: 18px; }
.mx-elist h2 { font-size: 13px; font-weight: 800; color: var(--s-tx2); letter-spacing: .01em; margin: 0 0 6px 2px; }
.mx-erow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--s-card); box-shadow: var(--s-shadow); color: var(--s-tx); font-size: 15px; font-weight: 700; text-align: left;
}
.mx-erow:first-of-type { border-radius: 14px 14px 0 0; }
.mx-erow:last-of-type { border-radius: 0 0 14px 14px; }
.mx-erow:only-of-type { border-radius: 14px; }
.mx-erow + .mx-erow { border-top: 1px solid var(--s-line); }
.mx-erow svg { width: 18px; height: 18px; color: var(--s-tx3); }

/* ---------- без движения: как prefers-reduced-motion ---------- */
.ap-screen[data-motion=off] *, .ap-screen[data-motion=off] *::before, .ap-screen[data-motion=off] *::after,
.ap-screen[data-motion=off]::before {
  animation-duration: 0s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  transition-duration: 0s !important; transition-delay: 0s !important;
}

/* ---------- узкий телефон (320–359 px): строка пути в четыре шага не влезала на «Доступ открыт» ---------- */
@media (max-width: 359px) {
  .ap-path { gap: 4px; padding: 0 10px; }
  .ap-pn { font-size: 11px; gap: 4px; }
  .ap-pln { min-width: 4px; }
}
