/* Мини-приложение «Монтажник» основного бота. Тема — светлая или тёмная, как у Telegram
   (boot.js и app.js ставят data-theme на <html> по Telegram.WebApp.colorScheme). */
:root {
  --bg: #f4f4f6;
  --card: #ffffff;
  --ink: #15161a;
  --soft: #6a6b73;
  --line: #e6e6ea;
  --field: #f0f0f3;
  --on-bg: #15161a;
  --on-ink: #ffffff;
  --track-off: #d9d9de;
  --frame: #2a2d33;
  --ok: #1f7a4d;
  --ok-wash: #e2f3ea;
  --warn: #9a3412;
  --warn-wash: #fde4dc;
  --soon: #4338ca;
  --soon-wash: #e5e3ff;
  --hot-a: #ff8a3d;
  --hot-b: #e0338a;
  --hot-c: #8a3df0;
  --tab-h: 64px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1012;
  --card: #1b1c20;
  --ink: #f2f2f4;
  --soft: #9b9ca3;
  --line: #2a2b30;
  --field: #24252a;
  --on-bg: #f2f2f4;
  --on-ink: #15161a;
  --track-off: #3a3b40;
  --ok: #6fd3a1;
  --ok-wash: #183326;
  --warn: #ffb59b;
  --warn-wash: #3a2219;
  --soon: #c4c0ff;
  --soon-wash: #2a2850;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
/* Без приближения (владелец 07.10.2026: «случайно двумя пальцами и двойным нажатием на свободном
   месте приближаю»): листать можно, щипок и двойное касание экран не увеличивают */
html, body { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, label, input, a { touch-action: manipulation; }
body {
  font: 16px/1.4 "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 24px);
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; }

.app { max-width: 480px; margin: 0 auto; padding: 0 14px; }
.screen { display: flex; flex-direction: column; gap: 14px; padding-top: 12px; }
h1 { margin: 6px 0 0; font-size: 26px; letter-spacing: -0.01em; }
h2 { margin: 6px 0 -4px; font-size: 17px; }
.muted { margin: 0; color: var(--soft); }
/* Подписи разделов «Баланса» — как у Brandly: мелкие заглавные с разрядкой */
.eyebrow { margin: 6px 0 -6px; font-size: 13px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--soft); }

/* Загрузка и сбой */
.loading { display: flex; justify-content: center; padding: 40vh 0 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line);
  border-top-color: var(--ink); animation: spin .8s linear infinite; }
.spinner.small { width: 22px; height: 22px; border-width: 2px; margin: 12px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.failed { margin-top: 30vh; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.failed p { margin: 0; }

/* Вне Telegram */
.stub { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.stub-card { max-width: 380px; width: 100%; background: var(--card); border-radius: 22px; padding: 26px 22px;
  display: flex; flex-direction: column; gap: 12px; }
.stub-card h1 { margin: 4px 0 0; }
.stub-mark { width: 60px; height: 60px; border-radius: 50%; background: var(--field);
  display: flex; align-items: center; justify-content: center; }

/* Шапка */
.top { display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }
.balance-pill { display: flex; align-items: center; gap: 6px; background: var(--card); border: 0;
  border-radius: 16px; padding: 6px 12px; font-size: 14px; font-weight: 600; min-height: 34px; }

/* Пример ролика. Шрифт, цвет и размер субтитров — переменные --cap-*, их ставит app.js. Место —
   как в боте: снизу низ надписи на нижней границе безопасной зоны (16 % высоты), сверху — верх
   на верхней (12 %), `safe_zone` в config/style.yaml. Высокий шрифт снизу растёт вверх сам */
.preview-wrap { display: flex; justify-content: center; }
.frame { position: relative; width: 214px; height: 380px; border-radius: 18px; overflow: hidden;
  background: var(--frame); }
/* Кадр-пример — фото владельца (07.10.2026: «Поставь эту картинку для дизайна как основную, на
   которую будут шрифты накладываться»), 9:16, как ролик */
.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Видео человека поверх фото (владелец 15.10.2026) — проявляется, когда пошёл первый кадр; не
   пошёл (телефон файл не показывает) — остаётся фото */
.clip { opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.frame.own .clip { opacity: 1; }
.badge { position: absolute; right: 10px; top: 10px; padding: 4px 8px; border-radius: 10px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; }
/* Субтитры сверху — значок «Пример» уходит вниз, чтобы не лезть на строку */
.frame[data-place="top"] .badge { top: auto; bottom: 10px; }
/* Надпись видна, только когда выбор и шрифт уже на месте (app.js, replay) */
.caption:not(.on), .caption.wait { visibility: hidden; }
.caption { position: absolute; left: 10px; right: 10px; display: flex; flex-direction: column;
  align-items: center; text-align: center; text-shadow: 0 2px 8px rgba(0, 0, 0, .75); bottom: 16%; }
/* Место «Сверху» — только надписи браузера: слова-картинки сервер уже поставил на места в кадре, а
   коробка с ними без низа сжималась в строку, и все слова вставали на одну высоту (владелец
   15.10.2026: «наслаиваются друг на друга субтитры в примере») */
.frame[data-place="top"] .caption:not(.art) { bottom: auto; top: 12%; }
.caption .small { color: #fff; line-height: 1.1; font-family: var(--cap-font); font-weight: var(--cap-small-weight, 600);
  font-size: var(--cap-small, 14px); }
.caption .key { line-height: 1; letter-spacing: -0.02em; font-family: var(--cap-font);
  font-weight: var(--cap-weight, 900); font-size: var(--cap-key, 44px); color: var(--cap-color, #FFC53D); }
/* Стиль Duo (владелец 14.10.2026): обычные слова — основным шрифтом пары, главное — акцентным,
   строки вплотную (в ролике хвосты букв ещё и проходят между словами — app/render/duo.py) */
.frame[data-style="duo"] .caption .small {
  font-family: var(--duo-main); font-weight: var(--duo-main-weight, 600);
  text-transform: var(--duo-main-case, none); line-height: .92; }
.frame[data-style="duo"] .caption .key {
  font-family: var(--duo-accent); font-weight: var(--duo-accent-weight, 400);
  text-transform: var(--duo-accent-case, none); letter-spacing: 0; line-height: .9; margin: -.06em 0; }
/* Надпись выходит, как в ролике: app/render/anim.py — каждое слово раскрывает маска снизу вверх за
   captions.word_in_ms = 90 мс по кривой motion.easing [0.22, 1, 0.36, 1] из config/style.yaml.
   Маска шире слова на половину высоты со всех сторон: хвосты букв и тень не видны до своего мига */
.caption .w { display: inline-block; }
.caption.play .w { animation: word-in 90ms cubic-bezier(0.22, 1, 0.36, 1) var(--at, 0ms) backwards; }
/* Надпись как в ролике (владелец 15.10.2026): слова-картинки сервера на своих местах в кадре;
   пока их нет — надпись браузера выше */
.caption.art { inset: 0; display: block; text-shadow: none; }
.caption.art .w { position: absolute; display: block; height: auto; max-width: none; }
.frame:not(.arted) .caption.art, .frame.arted .caption:not(.art) { display: none; }
@keyframes word-in {
  from { clip-path: inset(150% -50% -50% -50%); }
  to { clip-path: inset(-50% -50% -50% -50%); }
}

/* Чипы стиля, шрифта и цвета */
.chips { display: flex; gap: 6px; overflow-x: auto; background: var(--card); border-radius: 22px; padding: 6px;
  scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.center > :first-child { margin-left: auto; }
.chips.center > :last-child { margin-right: auto; }
.chip { flex-shrink: 0; border: 0; border-radius: 16px; padding: 9px 14px; font-size: 15px; background: transparent;
  display: flex; align-items: center; gap: 7px; min-height: 40px; }
.chip[aria-pressed="true"] { background: var(--on-bg); color: var(--on-ink); font-weight: 600; }
.dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
/* «Палитра» — любой цвет (владелец 15.10.2026): значок, при своём цвете — его точка; окно выбора —
   телефона (input color внутри label) */
.chip.pick { position: relative; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.chip.pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0;
  padding: 0; cursor: pointer; }
.chip.pick:not([aria-pressed="true"]) .pick-dot { display: none; }
.chip.soon { cursor: default; color: var(--soft); box-shadow: inset 0 0 0 1.5px var(--line); }
.chip.soon .soon-name { opacity: .6; }
.soon-pill { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 8px; background: var(--soon-wash); color: var(--soon); }

/* Плитки субтитров и монтажа */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid .tile:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 0; }
.tile { background: var(--card); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column;
  gap: 10px; justify-content: space-between; min-height: 96px; }
.tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; font-size: 14px;
  line-height: 1.25; }
.ask { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--soft); font-size: 13px; }
.cycle { border: 0; background: var(--field); border-radius: 10px; padding: 9px 10px; display: flex;
  justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; min-height: 40px; }
.switch { width: 50px; height: 30px; border: 0; border-radius: 15px; padding: 2px; display: flex;
  background: var(--track-off); justify-content: flex-start; transition: background .15s ease; }
.switch[aria-pressed="true"] { background: var(--on-bg); justify-content: flex-end; }
.switch span { width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch[aria-pressed="true"] span { background: var(--on-ink); }

/* Видео: загрузка в приложении, как у Brandly (владелец 08.10.2026) */
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: -4px; }
.section-head h2 { margin: 6px 0 0; }
.link { border: 0; background: none; color: var(--soft); font-size: 14px; text-decoration: underline;
  text-underline-offset: 3px; padding: 6px 0; }
.info-link { display: inline-flex; align-items: center; gap: 5px; }
.info-link svg { flex-shrink: 0; }
/* Зона «Загрузите видео»: пунктир — пусто, сплошная зелёная — файл подходит, сплошная
   тёплая — не подходит. Нажатие в любом месте открывает выбор файла (input внутри label) */
.upload { position: relative; border: 2px dashed var(--line); border-radius: 18px; background: var(--card);
  padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer; min-height: 84px; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.upload.ready { border-style: solid; border-color: var(--ok); }
.upload.bad { border-style: solid; border-color: var(--warn); }
.upload.locked { cursor: default; }
.upload.locked .plus { opacity: .35; }
/* Видео выбрано — «Заменить» вместо «+»: «+» читался как «добавить ещё» (владелец 09.10.2026) */
.swap { flex-shrink: 0; padding: 12px 18px; border-radius: 24px; background: var(--on-bg); color: var(--on-ink);
  font-size: 15px; font-weight: 700; }
.upload-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.upload-title { font-size: 18px; font-weight: 800; overflow-wrap: anywhere; }
.upload-hint { font-size: 13px; color: var(--soft); }
.upload.bad .upload-hint { color: var(--warn); }
.plus { flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; background: var(--on-bg); color: var(--on-ink);
  display: flex; align-items: center; justify-content: center; }
.upload-alert { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.upload-alert p { margin: 0; white-space: pre-line; }
/* Части одного ролика (владелец 15.10.2026): номер у каждой, когда частей больше одной; со второй —
   «убрать»; «Добавить ещё видео» — пунктиром, как пустая зона */
.parts { display: flex; flex-direction: column; gap: 10px; }
.parts:empty { display: none; }
.upload.part { cursor: default; justify-content: flex-start; }
.upload.part .upload-text { flex: 1; }
.part-n { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--field);
  color: var(--ink); font-size: 14px; font-weight: 800; display: flex; align-items: center;
  justify-content: center; }
.upload:not(.numbered) .first-n { display: none; }
.part-remove { flex-shrink: 0; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: var(--field); color: var(--soft); display: flex; align-items: center;
  justify-content: center; }
.upload.add { min-height: 72px; justify-content: flex-start; }
.upload.add .upload-title { font-size: 16px; }
.add-mark { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; border: 2px dashed var(--line);
  color: var(--ink); display: flex; align-items: center; justify-content: center; }
.parts-note { margin: 0; color: var(--warn); font-size: 14px; }

/* Лист «В видео нет речи» (владелец 15.10.2026, по образцу): как снимать и что получится —
   5 секунд ролика владельца 041, ниже — что подойдёт, кнопка — выбрать другое видео */
.nospeech { display: flex; flex-direction: column; gap: 10px; }
.ns-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ns-tile { position: relative; aspect-ratio: 9 / 16; max-height: 42vh; border-radius: 18px;
  overflow: hidden; background: var(--frame); }
.ns-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ns-label { position: absolute; left: 10px; top: 10px; padding: 5px 10px; border-radius: 14px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; font-weight: 700; }
.ns-sound { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); border: 0;
  padding: 9px 16px; border-radius: 20px; background: #fff; color: #15161a; font-size: 14px;
  font-weight: 800; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.ns-sound::before { content: "▶"; margin-right: 6px; font-size: 11px; }
/* «?» у переключателя — пример видео и что в нём смотреть (владелец 18.10.2026) */
.example { display: flex; flex-direction: column; gap: 8px; }
.ex-frame { position: relative; align-self: center; width: min(100%, calc(46vh * 9 / 16));
  aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: var(--frame); }
.ex-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sheet h3.ex-title { margin: 6px 0 0; font-size: 18px; }
.example .ex-watch { color: var(--ink); }
.example .ex-help { font-size: 14px; }
.sheet h3.ns-title { margin-top: 6px; font-size: 24px; }
.ns-points { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.ns-point { display: flex; gap: 12px; align-items: center; font-size: 15px; line-height: 1.35; }
.ns-point .req-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--soon-wash);
  color: var(--soon); align-items: center; justify-content: center; }
.ns-point .req-icon svg { width: 22px; height: 22px; }
/* Большая кнопка во всю ширину — градиент, как круглая «Монтаж» на панели */
.launch { position: relative; min-height: 60px; border: 0; border-radius: 30px; color: #fff;
  background: linear-gradient(90deg, var(--hot-a), var(--hot-b) 55%, var(--hot-c));
  font-size: 17px; font-weight: 800; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px; width: 100%; padding: 8px 18px; box-shadow: 0 8px 20px rgba(224, 51, 138, .25); }
.launch:disabled { opacity: .45; cursor: default; box-shadow: none; }
.launch-note { font-size: 12px; font-weight: 600; opacity: .9; }
/* Ход загрузки — на месте кнопки, той же формы */
.progress { position: relative; height: 60px; border-radius: 30px; overflow: hidden; background: var(--field);
  display: flex; align-items: center; justify-content: center; }
/* Градиент — во всю дорожку (--box-w): заливка его открывает, а не сжимает в полоску */
.progress-bar { position: absolute; inset: 0 auto 0 0; width: 0; overflow: hidden; transition: width .2s ease;
  background: linear-gradient(90deg, var(--hot-a), var(--hot-b) 55%, var(--hot-c)) 0 0 / var(--box-w, 100%) 100% no-repeat; }
.progress-text { position: relative; font-size: 16px; font-weight: 800; color: var(--ink); padding: 0 16px;
  text-align: center; line-height: 1.2; }
/* Белая копия подписи — во всю ширину дорожки (--box-w ставит app.js), видна только по заливке;
   ширина и поля те же, поэтому и переносится она так же */
.progress-text.on-bar { position: absolute; inset: 0 auto 0 0; width: var(--box-w, 100vw); color: #fff;
  display: flex; align-items: center; justify-content: center; }
.under { text-align: center; font-size: 13px; color: var(--soft); margin-top: -4px; }
.under-label { font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

/* Экран «Монтаж запущен» */
.done { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; }
.done h1 { margin: 0; }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-wash); color: var(--ok);
  display: flex; align-items: center; justify-content: center; }
.started-text { white-space: pre-line; }
.done .summary div { padding: 9px 0; font-size: 15px; }
/* Чек после оплаты (09.10.2026) — тот же экран, что «Монтаж запущен» */
.receipt-lead { margin: 0; font-size: 17px; font-weight: 600; }
.receipt-note { text-align: center; font-size: 13px; }
/* «Проверяем оплату…» — поверх всего, пока покупка не дошла до сервера */
.checking { position: fixed; inset: 0; z-index: 25; background: rgba(15, 16, 18, .35); display: flex;
  align-items: center; justify-content: center; padding: 16px; }
.checking-card { background: var(--card); border-radius: 18px; padding: 22px 28px 16px; display: flex;
  flex-direction: column; align-items: center; gap: 12px; font-size: 16px; font-weight: 700; text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18); }
.checking-card .link { font-size: 14px; font-weight: 600; }

/* Баланс — как у Brandly */
.card { background: var(--card); border-radius: 18px; padding: 14px 16px; }
.balance-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 22px; }
.balance-card .eyebrow { margin: 0; }
.balance-big { font-size: 46px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.05; }
.balance-unit { font-size: 20px; font-weight: 600; color: var(--soft); letter-spacing: 0; }
.free-note { margin: 0; color: var(--ok); font-weight: 600; }
.balance-card .wide { margin-top: 10px; }
.pack { position: relative; width: 100%; border: 2px solid transparent; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-radius: 20px; }
.pack[aria-checked="true"] { border-color: var(--ink); }
.popular { position: absolute; left: 14px; top: -10px; padding: 3px 10px; border-radius: 10px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff;
  background: linear-gradient(90deg, var(--hot-a), var(--hot-b) 60%, var(--hot-c)); }
.pack-left, .pack-right { display: flex; flex-direction: column; gap: 3px; }
.pack-right { text-align: right; align-items: flex-end; }
.pack-videos { font-size: 18px; font-weight: 700; }
.pack-n { font-size: 30px; font-weight: 900; letter-spacing: -0.02em; }
.pack-price { font-size: 22px; font-weight: 900; white-space: nowrap; }
.pack-sub { font-size: 14px; color: var(--soft); white-space: nowrap; }
.method { width: 100%; border: 2px solid transparent; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; padding: 16px; min-height: 58px; border-radius: 18px; text-align: left; }
.method[aria-checked="true"] { border-color: var(--ink); }
.method-name { font-size: 17px; font-weight: 700; }
/* Stripe — логотипом, а не словами (владелец 08.10.2026: «для приложения Stripe с лого страйпа») */
.method-logo { display: flex; align-items: center; }
.method-logo img { display: block; height: 26px; width: auto; }
.method-price { color: var(--soft); white-space: nowrap; }
.summary { margin: 0; background: var(--card); border-radius: 18px; padding: 4px 16px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; }
.summary div + div { border-top: 1px solid var(--line); }
.summary dt { color: var(--soft); }
.summary dd { margin: 0; text-align: right; font-weight: 800; }
.email { display: flex; flex-direction: column; gap: 8px; }
.email-saved { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field input { font: inherit; color: var(--ink); background: var(--field); border: 1.5px solid transparent;
  border-radius: 12px; padding: 12px 14px; min-height: 46px; }
.field input:focus { outline: none; border-color: var(--ink); }
.field-error { font-size: 13px; color: var(--warn); }
.consent { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 15px; padding: 4px 0; }
.consent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.consent .box { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line);
  background: var(--card); display: flex; align-items: center; justify-content: center; }
.consent input:checked + .box { background: var(--on-bg); border-color: var(--on-bg); }
.consent input:checked + .box::after { content: ""; width: 12px; height: 7px; border-left: 2.5px solid var(--on-ink);
  border-bottom: 2.5px solid var(--on-ink); transform: translateY(-2px) rotate(-45deg); }
.consent input:focus-visible + .box { outline: 2px solid var(--ink); outline-offset: 2px; }
.doc { text-decoration: underline; text-underline-offset: 3px; }
.pay { min-height: 58px; border: 0; border-radius: 29px; background: var(--on-bg); color: var(--on-ink);
  font-size: 18px; font-weight: 800; width: 100%; }
.pay:disabled { background: var(--track-off); color: var(--soft); cursor: default; }
/* Не хватает почты или согласия — кнопка серая, но нажимается и ведёт к полю */
.pay.wait { background: var(--track-off); color: var(--ink); }
.field.need input { border-color: var(--warn); }

/* История операций */
.history { display: flex; flex-direction: column; max-height: 55vh; overflow-y: auto; }
.history-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; }
.history-row + .history-row { border-top: 1px solid var(--line); }
.history-what { font-weight: 600; }
.history-at { font-size: 13px; color: var(--soft); }
.history-credits { font-weight: 800; white-space: nowrap; }
.history-credits.plus { color: var(--ok); }

/* Списки и карточки других вкладок */
.list { display: flex; flex-direction: column; gap: 8px; }
.row { background: var(--card); border-radius: 16px; padding: 12px 14px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; }
.row.gone { opacity: .6; }
.row-title { font-weight: 600; }
.row-sub { font-size: 13px; color: var(--soft); }
.row-main.tap { cursor: pointer; flex: 1; }
/* Экран ролика: плеер во всю ширину листа, снизу «Прислать в чат» и «Сохранить» поровну */
.player-box { display: flex; flex-direction: column; gap: 12px; }
.player-stage { position: relative; }
.player { display: block; width: 100%; max-height: 62vh; aspect-ratio: 9 / 16; border-radius: 14px;
  background: #000; object-fit: contain; }
/* Пока ролик загружается в память — поверх плеера ход загрузки, как у загрузки видео */
.player-veil { position: absolute; inset: 0; border-radius: 14px; background: rgba(0, 0, 0, .6);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: #fff; font-size: 17px; font-weight: 800; text-align: center; padding: 0 24px; }
.player-veil.failed { cursor: pointer; font-size: 15px; font-weight: 600; }
.player-veil.failed .veil-bar { display: none; }
.veil-bar { width: 72%; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.veil-fill { height: 100%; width: 0; transition: width .2s ease;
  background: linear-gradient(90deg, var(--hot-a), var(--hot-b) 55%, var(--hot-c)); }
.player-actions { display: flex; gap: 8px; }
.player-actions > button { flex: 1; padding: 0 10px; }
.player-actions .save { gap: 8px; }
.player-actions .save svg { width: 19px; height: 19px; flex-shrink: 0; }
.player-actions .save:disabled { opacity: .45; cursor: default; }
.player-actions .save.ready { background: var(--on-bg); color: var(--on-ink); border-color: transparent; }
.sheet .player-hint { font-size: 14px; }
/* «Посмотреть ролик» у свежего ролика, пока он сам загружается в память, — с заливкой хода, как
   у загрузки видео: градиент во всю кнопку (--btn-w), --p его открывает; белая копия подписи во
   всю кнопку видна только по заливке */
.dl { position: relative; overflow: hidden; }
.dl-text { position: relative; }
.dl-fill { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); overflow: hidden; display: none;
  transition: width .2s ease;
  background: linear-gradient(90deg, var(--hot-a), var(--hot-b) 55%, var(--hot-c)) 0 0 / var(--btn-w, 100%) 100% no-repeat; }
.dl.loading .dl-fill { display: block; }
.dl-text.on-fill { position: absolute; inset: 0 auto 0 0; width: var(--btn-w, 100%); color: #fff;
  display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.status { font-size: 13px; padding: 4px 10px; border-radius: 10px; background: var(--field); color: var(--soft);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
/* В очереди и «Монтирую» — с мигающей точкой: ролик живой, страница сама обновит список */
.status.live { background: var(--soon-wash); color: var(--soon); font-weight: 600; }
.status.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  animation: pulse 1.2s ease-in-out infinite; }
.status.bad { background: var(--warn-wash); color: var(--warn); font-weight: 600; }
@keyframes pulse { 50% { opacity: .25; } }
.empty { padding: 4px 2px; }
.label { font-size: 13px; color: var(--soft); }
.ref-link { margin: 4px 0 12px; font-weight: 600; overflow-wrap: anywhere; user-select: text; }
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.buttons > * { flex: 1 1 140px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stat-card .label { overflow-wrap: break-word; }
.stat { font-size: 22px; font-weight: 800; }
.secondary, .primary { min-height: 44px; border-radius: 12px; padding: 0 18px; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.secondary { border: 1px solid var(--line); background: var(--card); }
.primary { border: 0; background: var(--on-bg); color: var(--on-ink); }
.wide { width: 100%; min-height: 52px; border-radius: 26px; font-size: 16px; }
.faq details { background: var(--card); border-radius: 16px; padding: 12px 14px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 8px 0 0; color: var(--soft); white-space: pre-line; }
.faq details[open] > p:only-child { margin: 0; }

/* Нижняя панель */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 4px 6px calc(6px + env(safe-area-inset-bottom, 0px)); min-height: var(--tab-h); }
.tab { position: relative; border: 0; background: none; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; gap: 3px; font-size: 11px; color: var(--soft); min-height: 52px; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tab svg { width: 22px; height: 22px; }
.tab.center .orb { width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; color: #fff;
  background: linear-gradient(135deg, var(--hot-a), var(--hot-b) 55%, var(--hot-c));
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(224, 51, 138, .35); }
.tab.center .orb svg { width: 26px; height: 26px; }
.tab-badge { position: absolute; top: 2px; left: 50%; margin-left: 4px; min-width: 18px; padding: 1px 6px;
  border-radius: 9px; background: var(--hot-b); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; }
.tab-badge:empty { display: none; }

/* Шторка «?» и истории */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(15, 16, 18, .45);
  display: flex; flex-direction: column; justify-content: flex-end; }
.sheet { background: var(--card); border-radius: 22px 22px 0 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 10px; max-width: 480px; width: 100%; margin: 0 auto;
  max-height: 94vh; }
/* Лист выше экрана — листается только середина: заголовок и кнопка стоят на месте, как на образце
   «Требований к видео» (15.10.2026) */
.sheet-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sheet h3 { margin: 0; font-size: 19px; }
.sheet p { margin: 0; color: var(--soft); white-space: pre-line; line-height: 1.45; }
.sheet .primary { align-self: flex-start; margin-top: 6px; }

/* «Требования к видео» (владелец 15.10.2026, по образцу): тёмная карточка — что подойдёт и что
   нет; одинаковая в светлой и тёмной теме, как значок ролика */
.req { display: flex; flex-direction: column; gap: 10px; }
.req-card { border-radius: 24px; padding: 22px 18px 16px; color: #fff;
  background: radial-gradient(120% 75% at 100% 0%, rgba(138, 61, 240, .55), transparent 62%),
    radial-gradient(90% 60% at 0% 100%, rgba(224, 51, 138, .32), transparent 62%), #131217; }
.req-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255, 255, 255, .72); }
.req-title { margin: 8px 0 14px; font-size: 30px; font-weight: 900; line-height: 1.08; letter-spacing: -0.02em;
  text-wrap: balance; }
.req-hot { background: linear-gradient(90deg, var(--hot-c), var(--hot-b) 60%, var(--hot-a));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.req-rows { border-top: 1px solid rgba(255, 255, 255, .14); }
.req-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; font-size: 17px; font-weight: 600;
  line-height: 1.25; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.req-n { flex-shrink: 0; width: 22px; font: 500 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: rgba(255, 255, 255, .55); }
.req-icon { display: inline-flex; flex-shrink: 0; color: #ff6fa8; }
.req-not { margin-top: 16px; padding: 12px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .03); }
.req-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.req-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px;
  border-radius: 14px; background: rgba(255, 255, 255, .07); font-size: 13px; line-height: 1.2;
  text-align: center; color: rgba(255, 255, 255, .9); }
.req-tile .req-icon { color: rgba(255, 255, 255, .85); }
.sheet h3.req-head { margin-top: 8px; font-size: 22px; }
:root[data-theme="dark"] .req-card { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }

/* Лист при первом открытии (09.10.2026): три шага и «Попробовать» */
.intro-steps { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.intro-step { display: flex; gap: 12px; align-items: flex-start; }
.intro-step b { display: block; font-size: 16px; }
.intro-step div span { color: var(--soft); font-size: 14px; line-height: 1.35; }
.intro-n { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--hot-a), var(--hot-b) 55%, var(--hot-c)); }
.sheet .primary.intro-go { align-self: stretch; min-height: 56px; border-radius: 28px; color: #fff;
  font-size: 17px; font-weight: 800; margin-top: 8px;
  background: linear-gradient(90deg, var(--hot-a), var(--hot-b) 55%, var(--hot-c)); }

/* Сообщение внизу — над панелью */
.toast { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 14px); width: min(100% - 28px, 452px);
  background: var(--on-bg); color: var(--on-ink); border-radius: 14px; padding: 12px 14px; font-size: 14px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .25); }
