/* Snapcut — своя визуальная система.
   Светлая и тёмная тема приезжают из themeParams Telegram, но цвета мы
   держим свои: приложение должно узнаваться, а не растворяться в клиенте. */

:root {
  /* Фирменные цвета Pikcut: янтарь, чернила, бумага */
  --accent: #F6D65A;
  --accent-ink: #121212;

  /* Фон приложения: почти белый (было кремовый #F5F1E8). Цвет текста,
     карточек и акцента не менялся. */
  --bg: #FCFBF8;
  --surface: #FFFFFF;
  --surface-2: #EFEADF;
  --ink: #121212;
  --ink-soft: #6B7280;
  --line: #E6E0D3;
  --danger: #E5484D;
  --ok: #30A46C;

  --r-lg: 24px;
  --r-md: 20px;
  --r-sm: 14px;
  --gap: 16px;
  --tabbar: 76px;
}

:root[data-theme="dark"] {
  --bg: #121212;
  --surface: #1C1C1C;
  --surface-2: #262626;
  --ink: #F4F1EA;
  --ink-soft: #9AA4B2;
  --line: #262C36;
}

@font-face {
  font-family: "Unbounded";
  src: url("/fonts/Unbounded-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "InterUI";
  src: url("/fonts/Inter-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "InterUI";
  src: url("/fonts/Inter-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "InterUI";
  src: url("/fonts/Inter-Black.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "InterUI", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.45;
  padding-bottom: calc(var(--tabbar) + 24px + env(safe-area-inset-bottom, 0px));
}

h1, h2, h3, .display {
  font-family: "Unbounded", -apple-system, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

h1 { font-size: 24px; }
h2 { font-size: 17px; }

/* Шапка с логотипом: в тёмной теме подменяется светлый вариант */
.brandbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 2px;
}
.token-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; cursor: pointer;
  color: var(--ink); font-family: inherit; font-size: 15px; font-weight: 700;
}
.token-chip svg { width: 18px; height: 18px; }
.brandbar img { height: 22px; width: auto; }

.screen { display: none; padding: 8px 16px 8px; }
.screen.active { display: block; }

.section { margin-bottom: 28px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}
.section-head .hint { color: var(--ink-soft); font-size: 13px; }

.card {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 16px;
}

/* --- Чипы стилей --- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-sm);
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  min-height: 46px;
}
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.chip[disabled] { opacity: .45; cursor: default; }
.chip .badge {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  background: var(--surface-2); color: var(--ink-soft);
  border-radius: 6px; padding: 2px 6px;
}

/* --- Лента палитр --- */
.palette-strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 8px;
  scrollbar-width: none;
}
.palette-strip::-webkit-scrollbar { display: none; }
.swatch {
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--ink);
  cursor: pointer; min-height: 44px; white-space: nowrap;
}
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; }

/* --- Зона загрузки --- */
.drop {
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
}
.drop.over { border-color: var(--accent); background: var(--surface-2); }
.drop .title { font-weight: 700; margin-bottom: 6px; }
.drop .hint { color: var(--ink-soft); font-size: 13px; }
.drop .filename { color: var(--ink); font-weight: 600; margin-top: 10px; word-break: break-all; }

.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 14px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.progress-label { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }

/* --- Переключатели --- */
.toggle-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .label { flex: 1; font-weight: 500; }
.help {
  width: 26px; height: 26px; flex: 0 0 auto;
  border-radius: 50%; border: 1.5px solid var(--line);
  background: transparent; color: var(--ink-soft);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.switch {
  width: 50px; height: 30px; flex: 0 0 auto;
  border-radius: 999px; border: 0; cursor: pointer;
  background: var(--surface-2); position: relative; transition: background .15s;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.toggle-hint {
  font-size: 13px; color: var(--ink-soft);
  padding: 0 0 12px; margin-top: -4px;
}

/* --- Кнопки --- */
.btn {
  width: 100%; border: 0; border-radius: var(--r-md);
  padding: 17px 20px; font-size: 16px; font-weight: 700;
  font-family: inherit; cursor: pointer; min-height: 56px;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
/* Выключенная жёлтая кнопка на тёмном фоне давала грязный оливковый
   и нечитаемый текст — делаем её нейтральной, а не полупрозрачной */
.btn-primary[disabled] {
  background: var(--surface-2); color: var(--ink-soft); cursor: default;
}
.btn-secondary { background: var(--surface-2); color: var(--ink); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.btn-sm { padding: 12px 14px; font-size: 14px; min-height: 44px; border-radius: var(--r-sm); }

/* Панель действия закреплена над нижним меню: sticky прилипал слишком
   рано и накрывал список фишек. Экран получает отступ снизу, чтобы
   контент не прятался под ней. */
.sticky-cta {
  position: fixed; left: 0; right: 0; z-index: 9;
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px));
  padding: 12px 16px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
#screen-edit { padding-bottom: 130px; }
.balance-line { text-align: center; color: var(--ink-soft); font-size: 13px; margin-top: 8px; }

/* --- Ролики --- */
.video-card { background: var(--surface); border-radius: var(--r-md); overflow: hidden; margin-bottom: 14px; }
.video-card .thumb {
  aspect-ratio: 9 / 16; max-height: 260px; width: 100%;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 13px;
}
.video-card .body { padding: 14px 16px 16px; }
.video-card .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; }
.video-card .meta .dot { width: 10px; height: 10px; }
.video-card .sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 12px; }
.pill {
  display: inline-block; font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 3px 10px;
  background: var(--surface-2); color: var(--ink-soft);
}
.pill.ok { background: rgba(48,163,108,.15); color: var(--ok); }
.pill.bad { background: rgba(229,72,77,.15); color: var(--danger); }

.subtabs { display: flex; gap: 8px; margin-bottom: 18px; }
.subtab {
  flex: 1; border: 0; border-radius: var(--r-sm); padding: 11px;
  background: var(--surface); color: var(--ink-soft);
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 44px;
}
.subtab[aria-selected="true"] { background: var(--ink); color: var(--bg); }

/* --- Баланс --- */
/* Карточка пакета из макета: крупно число роликов и цена,
   мельче — название, токены и цена за ролик */
.pack {
  position: relative;
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface); border-radius: var(--r-md);
  padding: 18px 18px 16px; margin-bottom: 12px;
  border: 2px solid transparent; cursor: pointer;
}
.pack.best { padding-top: 34px; }  /* бейдж «Популярный» остаётся, а рамка — только у выбранного */
.pack-badge {
  position: absolute; top: 12px; left: 18px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  border-radius: 999px; padding: 4px 10px;
}
.pack .grow { flex: 1; }
.pack-head { display: flex; align-items: baseline; gap: 6px; }
.pack-num {
  font-family: "Unbounded", sans-serif; font-weight: 700;
  font-size: 28px; line-height: 1;
}
.pack-unit { font-size: 15px; font-weight: 600; }
.pack-title { font-weight: 700; margin-top: 4px; }
.pack .note { color: var(--ink-soft); font-size: 13px; }
.pack-right { text-align: right; }
.pack-price {
  font-family: "Unbounded", sans-serif; font-weight: 700;
  font-size: 20px; white-space: nowrap;
}

.row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row .amount { font-weight: 700; white-space: nowrap; }
.row .amount.plus { color: var(--ok); }

.field { display: flex; gap: 10px; }
.field input {
  flex: 1; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: var(--r-sm); padding: 14px;
  font-family: inherit; font-size: 15px; min-height: 48px;
}
.field input::placeholder { color: var(--ink-soft); }

/* --- Профиль и ссылки --- */
.link-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; background: var(--surface); border-radius: var(--r-md);
  margin-bottom: 10px; cursor: pointer; color: var(--ink);
  font-weight: 500; min-height: 56px;
}
.link-row .chev { color: var(--ink-soft); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--surface); border-radius: var(--r-md); padding: 16px; text-align: center; }
.stat .num { font-family: "Unbounded", sans-serif; font-size: 26px; font-weight: 700; }
.stat .cap { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

.ref-link {
  background: var(--surface); border-radius: var(--r-md);
  padding: 14px 16px; font-size: 13px; color: var(--ink-soft);
  word-break: break-all; margin-bottom: 12px;
}

/* --- Нижнее меню --- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: end;
  background: var(--bg); border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
}
.tabbar button {
  border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--ink-soft); font-family: inherit; font-size: 11px; font-weight: 600;
  padding: 4px 2px; min-height: 52px;
}
.tabbar button[aria-selected="true"] { color: var(--ink); }
.tabbar .ico { width: 24px; height: 24px; line-height: 0; }
.tabbar .ico svg { width: 100%; height: 100%; }

/* Центр — фирменный знак на чернилах, как в макете */
.tabbar .center .ico {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--ink);
  display: flex; align-items: center; justify-content: center;
  margin-top: -22px; padding: 12px;
  box-shadow: 0 6px 18px rgba(18, 18, 18, .28);
}
.tabbar .center .ico img { width: 100%; height: 100%; }

.empty { text-align: center; color: var(--ink-soft); padding: 48px 20px; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar) + 16px);
  background: var(--ink); color: var(--bg);
  border-radius: var(--r-sm); padding: 14px 16px; text-align: center;
  font-size: 14px; z-index: 20; opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }

/* Заметка про бесплатный ролик над списком пакетов */
#free-note {
  background: var(--surface-2); color: var(--ink);
  border-radius: var(--r-sm); padding: 12px 14px;
  font-size: 13px; margin-bottom: 14px;
}

/* Карточка баланса на чернилах — по макету 3-balans.png */
.balance-card {
  background: var(--ink); color: #F4F1EA;
  border-radius: var(--r-lg); padding: 22px 20px;
}
.balance-card .cap {
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  color: rgba(244,241,234,.55); text-transform: uppercase;
}
.balance-card .amount {
  display: flex; align-items: baseline; gap: 10px; margin: 6px 0 8px;
}
.balance-card .amount #balance-num {
  font-family: "Unbounded", sans-serif; font-weight: 700;
  font-size: 46px; line-height: 1; color: var(--accent);
}
.balance-card .amount .unit { font-size: 18px; font-weight: 700; }
.balance-card .sub { color: rgba(244,241,234,.75); font-size: 14px; margin-bottom: 16px; }
.btn-dark {
  background: rgba(244,241,234,.12); color: #F4F1EA;
  border-radius: 999px; min-height: 50px;
}
.free-note {
  background: var(--surface-2); color: var(--ink);
  border-radius: var(--r-sm); padding: 12px 14px;
  font-size: 13px; margin-bottom: 14px;
}

/* --- Платёжный блок (только интерфейс, оплата не подключена) --- */
.pay-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; border-radius: var(--r-md); padding: 16px 18px;
  margin-bottom: 10px; min-height: 58px;
  font-family: inherit; font-size: 15px; color: var(--ink); text-align: left;
}
.pay-option .name { font-weight: 600; }
.pay-option.is-on {
  background: var(--surface); border: 2px solid var(--ink); cursor: pointer;
}
.pay-option.is-on .sum { color: var(--ink-soft); font-weight: 600; }
.pay-option.is-off {
  background: transparent; border: 1.5px dashed var(--line); color: var(--ink-soft);
}
.pay-option .chip {
  background: var(--surface-2); color: var(--ink-soft);
  border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600;
}

.pack.is-picked { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }

.summary .row { align-items: center; }
.summary .row.total { border-bottom: 0; padding-top: 14px; }
.summary .row.total b {
  font-family: "Unbounded", sans-serif; font-size: 20px;
}
.summary .row b { font-size: 15px; }

.agree {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 16px 2px 16px; font-size: 14px; color: var(--ink); cursor: pointer;
}
.agree input {
  width: 22px; height: 22px; flex: 0 0 auto; margin: 0;
  accent-color: var(--accent);
}

/* ================= Экран «Монтаж» по макету 1-montazh.png ================= */

.lead { color: var(--ink-soft); font-size: 14px; margin: 8px 0 22px; }
.lead.small { margin: 0 0 14px; font-size: 13px; }

/* Номер шага слева, текущее значение справа */
.step-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.step-cap {
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft);
}
.step-value { font-size: 14px; font-weight: 700; color: var(--ink); }
.step-link {
  font-size: 14px; font-weight: 600; color: var(--ink);
  text-decoration: underline; cursor: pointer;
}

/* Стили — карточки с превью */
/* В макете три стиля в ряд, но пресетов четыре — 2x2 не оставляет
   одинокую карточку на второй строке */
/* Стили одним рядом, как палитра: листается вбок и занимает одну строку */
.style-grid {
  display: flex; gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity; scroll-padding: 0 var(--gap); scrollbar-width: none;
  margin: 0 calc(var(--gap) * -1); padding: 2px var(--gap) 6px;
}
.style-grid::-webkit-scrollbar { display: none; }
.style-grid .style-card { flex: 0 0 156px; scroll-snap-align: start; }
.style-card {
  position: relative; background: transparent; cursor: pointer;
  font-family: inherit; display: flex; flex-direction: column; gap: 8px;
  padding: 6px; border: 3px solid transparent; border-radius: 20px;
  transition: border-color .12s, background .12s;
}
.style-thumb {
  aspect-ratio: 4 / 3; border-radius: var(--r-sm);
  background: var(--ink); border: 2px solid transparent;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; padding: 8px; overflow: hidden;
}
/* Выбранный стиль: подложка превью чёрная, чёрная рамка у самого превью была
   не видна. Рамка вокруг всей карточки + галочка, как у направлений. */
.style-card[aria-pressed="true"] { border-color: var(--accent); background: var(--surface); }
.style-card[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 12px; right: 12px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; line-height: 1;
}
.style-card.is-soon .style-thumb {
  background: transparent; border: 1.5px dashed var(--line);
}
.style-thumb .badge {
  background: var(--surface); color: var(--ink-soft);
  border-radius: 999px; padding: 5px 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em;
}
.style-thumb .t-line { font-size: 11px; font-weight: 700; color: #F4F1EA; }
.style-thumb .t-word {
  font-family: "Unbounded", sans-serif; font-size: 20px; font-weight: 700;
  color: var(--accent); line-height: 1;
}
.style-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.style-card.is-soon .style-name { color: var(--ink-soft); }

/* Цвета — сетка 4x2 кружков */
/* Палитра одним рядом: листается вбок, занимает одну строку вместо двух */
.color-grid {
  display: flex; gap: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity; scroll-padding: 0 var(--gap); scrollbar-width: none;
  /* уходит к краям экрана: следующий цвет выглядывает и подсказывает прокрутку */
  margin: 0 calc(var(--gap) * -1); padding: 2px var(--gap) 6px;
}
.color-grid::-webkit-scrollbar { display: none; }
.color-grid .color-cell { flex: 0 0 76px; scroll-snap-align: start; }
.color-cell {
  background: var(--surface); border: 2px solid transparent;
  border-radius: var(--r-sm); padding: 12px 4px 10px; cursor: pointer;
  font-family: inherit; display: flex; flex-direction: column;
  align-items: center; gap: 8px;
}
.color-cell[aria-pressed="true"] { border-color: var(--ink); }
.color-dot {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(18,18,18,.08);
}
.color-name { font-size: 12px; font-weight: 600; color: var(--ink); }

/* Живое превью субтитров */
.subs-preview {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg);
  background: var(--ink); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.subs-preview .figure {
  position: absolute; bottom: 0; width: 46%; height: 72%;
  border-radius: 999px 999px 0 0; background: rgba(244,241,234,.07);
}
.subs-preview .subs {
  position: relative; text-align: center; padding: 0 16px;
}
.subs-preview .line {
  font-family: "Montserrat", sans-serif;
  font-size: 17px; font-weight: 800; color: #F4F1EA;
  line-height: 0.92; text-shadow: 0 3px 14px rgba(0,0,0,.55);
}
/* Превью повторяет эталон C-temnyy-fon.png: подложки под словом нет,
   только тень — плашки в фирменном стиле не используются */
.subs-preview .word {
  font-family: "Montserrat", "Unbounded", sans-serif; font-weight: 900;
  font-size: 34px; line-height: 0.92; color: var(--accent);
  letter-spacing: -1px; margin: 0 0 0 16px;
  text-shadow: 0 3px 14px rgba(0,0,0,.55);
}
.subs-preview .line:first-of-type { margin-right: 28px; }
.subs-preview .line:last-of-type { margin-right: 40px; }

/* Зона загрузки с круглым плюсом */
.drop {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  text-align: left; padding: 18px 18px;
}
.drop-body { flex: 1; }
.drop .title { font-size: 17px; }
.drop-plus {
  width: 52px; height: 52px; flex: 0 0 auto; border-radius: 50%;
  background: var(--ink); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; line-height: 1;
}
.shoot-note {
  background: var(--surface-2); color: var(--ink);
  border-radius: var(--r-sm); padding: 14px;
  font-size: 13px; margin-top: 12px;
}

/* Кнопка с пилюлей стоимости */
#submit { display: flex; align-items: center; justify-content: center; gap: 10px; }
.cost-pill {
  background: var(--ink); color: var(--accent);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700;
}
#submit[disabled] .cost-pill { background: rgba(18,18,18,.25); color: var(--bg); }

/* ============ Нижний лист «Какое видео подойдёт» (6-trebovaniya.png) ============ */

.req-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(18, 18, 18, .55);
  display: flex; align-items: flex-end;
  opacity: 0; transition: opacity .22s;
}
.req-backdrop.is-open { opacity: 1; }

.req-wrap {
  width: 100%; max-height: 94vh; overflow-y: auto;
  background: var(--bg);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%); transition: transform .24s;
}
.req-backdrop.is-open .req-wrap { transform: none; }

.req-grip {
  width: 44px; height: 4px; border-radius: 999px;
  background: var(--line); margin: 2px auto 14px;
}

/* Тёмная карточка с требованиями */
.req-dark {
  background: var(--ink); color: #F4F1EA;
  border-radius: var(--r-lg); padding: 22px 20px;
}
.req-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.req-head img { height: 18px; }
.req-kicker {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(244,241,234,.6); text-align: right;
}
.req-title {
  font-family: "Unbounded", sans-serif; font-weight: 700;
  font-size: 27px; line-height: 1.18; margin: 18px 0 12px;
}
.req-title em { font-style: normal; color: var(--accent); }
.req-lead { color: rgba(244,241,234,.72); font-size: 14px; margin: 0 0 18px; }

.req-list { border-top: 1px solid rgba(244,241,234,.12); }
.req-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid rgba(244,241,234,.12);
}
.req-num {
  font-size: 12px; font-weight: 700; color: rgba(244,241,234,.4);
  width: 20px; flex: 0 0 auto; padding-top: 3px;
}
.req-ico { color: var(--accent); flex: 0 0 auto; line-height: 0; padding-top: 1px; }
.req-text { display: flex; flex-direction: column; gap: 2px; }
.req-text b { font-size: 16px; font-weight: 700; }
.req-text span { font-size: 13px; color: rgba(244,241,234,.6); }

.req-bad {
  margin-top: 18px; border: 1px solid rgba(244,241,234,.14);
  border-radius: var(--r-md); padding: 16px;
}
.req-bad-cap {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(244,241,234,.5); margin-bottom: 12px;
}
.req-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.req-tile {
  background: rgba(244,241,234,.07); border-radius: var(--r-sm);
  padding: 14px 6px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(244,241,234,.75);
}
.req-tile span { font-size: 12px; font-weight: 600; line-height: 1.25; }

/* Советы */
.req-tips-title {
  font-family: "Unbounded", sans-serif; font-weight: 700;
  font-size: 22px; line-height: 1.2; margin: 26px 0 14px;
}
.req-tip {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border-radius: var(--r-md);
  padding: 16px; margin-bottom: 10px;
}
.req-tip-ico {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%;
  background: var(--ink); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.req-tip b { display: block; font-size: 16px; margin-bottom: 3px; }
.req-tip span { font-size: 14px; color: var(--ink-soft); }

.req-quote {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface-2); border-radius: var(--r-md);
  padding: 16px; margin: 16px 0 14px;
}
.req-avatar {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.req-quote p { margin: 0 0 4px; font-size: 14px; }
.req-quote span { font-size: 14px; color: var(--ink-soft); }

.req-foot { font-size: 13px; color: var(--ink-soft); margin: 0 0 16px; }

/* Главная фишка — отдельной карточкой над остальными */
.main-toggle { margin-bottom: 12px; border: 2px solid var(--ink); }
.main-toggle .toggle-row { padding-top: 4px; padding-bottom: 4px; }
.main-toggle .label { font-weight: 700; }

/* ============ Экран «Проверь текст» (8-proverka-teksta.png) ============ */

.check-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.back {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer;
  font-family: inherit;
}

.legend {
  background: var(--surface-2); border-radius: var(--r-md);
  padding: 16px; margin-bottom: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.legend-row { display: flex; align-items: flex-start; gap: 14px; font-size: 14px; }
.legend-row > span:last-child { color: var(--ink); }
.chip-main {
  background: var(--accent); color: var(--accent-ink);
  border-radius: 8px; padding: 6px 12px; font-weight: 700; font-size: 14px;
  flex: 0 0 auto;
}
.chip-doubt {
  font-weight: 700; font-size: 14px; flex: 0 0 auto; padding: 6px 2px;
  text-decoration: underline wavy var(--danger) 2px;
  text-underline-offset: 4px;
}

/* Карточка фрагмента */
.cue-card {
  background: var(--surface); border-radius: var(--r-md);
  border: 2px solid transparent; padding: 16px; margin-bottom: 12px;
}
.cue-card.is-doubt { border-color: rgba(229,72,77,.45); }
.cue-card.is-hidden { opacity: .55; }
.cue-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cue-time { color: var(--ink-soft); font-size: 15px; font-weight: 600; }
.cue-tools { display: flex; gap: 8px; }
.round-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--line); background: transparent;
  color: var(--ink); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.round-btn svg { width: 19px; height: 19px; }
.round-btn.is-off { background: var(--surface-2); color: var(--ink-soft); }

.cue-doubt { color: var(--danger); font-size: 14px; font-weight: 600; margin-bottom: 10px; }

.cue-words { display: flex; flex-wrap: wrap; gap: 8px; }
.word {
  background: var(--surface-2); color: var(--ink);
  border: 0; border-radius: 10px; padding: 10px 14px;
  font-family: inherit; font-size: 16px; cursor: pointer;
}
.word.is-main { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.word.is-low {
  background: var(--surface);
  text-decoration: underline wavy var(--danger) 2px;
  text-underline-offset: 4px;
}
.word.is-main.is-low { background: var(--accent); }

.cue-input {
  width: 100%; border: 2px solid var(--ink); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink); padding: 14px;
  font-family: inherit; font-size: 16px; margin-bottom: 8px; min-height: 52px;
}
.cue-hint { color: var(--ink-soft); font-size: 13px; margin-top: 8px; }

#screen-check { padding-bottom: 130px; }

/* Загрузка с прогрессом */
.upload-box { margin-top: 12px; }
.upload-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 8px;
}
.upload-row span { font-size: 13px; color: var(--ink-soft); }
.upload-cancel {
  border: 0; background: transparent; color: var(--danger);
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 4px 2px;
}

/* Нереализованная фишка */
.toggle-row.is-soon .label { color: var(--ink-soft); }
.soon-tag {
  margin-left: 8px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  background: var(--surface-2); color: var(--ink-soft);
  border-radius: 6px; padding: 3px 7px;
}
.switch[disabled] { opacity: .45; cursor: default; }

/* ============ Вкладка «Ролики» (2-roliki.png) ============ */

.work-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--ink); color: #F4F1EA;
  border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px;
}
.work-ico {
  width: 76px; height: 96px; flex: 0 0 auto; border-radius: var(--r-sm);
  background: rgba(244,241,234,.08); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.work-ico svg { width: 34px; height: 34px; }
.work-body { flex: 1; min-width: 0; }
.work-title {
  font-family: "Unbounded", sans-serif; font-weight: 700;
  font-size: 20px; margin-bottom: 4px;
}
.work-sub { color: rgba(244,241,234,.66); font-size: 14px; margin-bottom: 12px; }
.work-bar {
  height: 10px; border-radius: 999px; overflow: hidden;
  background: rgba(244,241,234,.14); margin-bottom: 10px;
}
.work-bar > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.work-note { color: rgba(244,241,234,.6); font-size: 13px; }

.video-card { display: flex; gap: 14px; padding: 14px; align-items: flex-start; }
.video-card .thumb {
  position: relative; width: 76px; height: 100px; flex: 0 0 auto;
  aspect-ratio: auto; max-height: none; border-radius: var(--r-sm);
  background: var(--ink); overflow: hidden;
}
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-tag {
  position: absolute; left: 6px; bottom: 6px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--accent-ink);
  border-radius: 6px; padding: 3px 7px;
}
.video-card .body { padding: 0; flex: 1; min-width: 0; }
.card-title { font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.video-card .sub { font-size: 14px; margin-bottom: 4px; }
.video-card .btn-row { margin-top: 12px; gap: 8px; }
/* Три кнопки в узкой карточке: без переносов слов и без вылета за край */
.video-card .btn-row .btn { white-space: nowrap; padding-left: 10px; padding-right: 10px; min-width: 0; }
.btn-dark { background: var(--ink); color: #F4F1EA; }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn-sm[disabled] { opacity: .45; cursor: default; }

/* --- Мой стиль: список и мастер --- */
.design-list { display: flex; flex-wrap: wrap; gap: 10px; }
.design-empty { color: var(--ink-soft); font-size: 14px; padding: 6px 0; }
.design-chip {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--line); background: var(--surface);
  border-radius: var(--r-sm); overflow: hidden; min-height: 46px;
}
.design-chip[aria-pressed="true"] { border-color: var(--ink); outline: 2px solid var(--ink); }
.design-pick, .design-edit, .design-remove {
  background: transparent; border: 0; font-family: inherit; cursor: pointer; color: var(--ink);
}
.design-remove {
  align-self: stretch; padding: 0 14px 0 6px; font-size: 14px; font-weight: 700;
  color: var(--ink-soft); border-left: 1px solid var(--line); margin-left: 4px;
}
.design-remove:active { background: var(--danger); color: #fff; }
.design-pick { display: inline-flex; align-items: center; gap: 8px; padding: 10px 6px 10px 14px; font-size: 15px; font-weight: 700; }
.design-edit { padding: 10px 14px 10px 8px; font-size: 12px; color: var(--ink-soft); }
.design-dot { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; }

/* Направления одним рядом, как палитра и стили: листается вбок */
.direction-grid {
  display: flex; gap: 12px; margin-top: 10px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity; scroll-padding: 0 var(--gap); scrollbar-width: none;
  margin-left: calc(var(--gap) * -1); margin-right: calc(var(--gap) * -1);
  padding: 2px var(--gap) 6px;
}
.direction-grid::-webkit-scrollbar { display: none; }
.direction-grid .direction-card { flex: 0 0 170px; scroll-snap-align: start; }
.direction-card {
  position: relative; background: transparent; cursor: pointer; text-align: left;
  font-family: inherit; display: flex; flex-direction: column; gap: 6px;
  padding: 6px; border: 3px solid transparent; border-radius: 20px;
  transition: border-color .12s, background .12s;
}
.direction-thumb {
  aspect-ratio: 4 / 3; border-radius: var(--r-sm); background: var(--ink);
  border: 2px solid transparent; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; padding: 8px; overflow: hidden;
}
.direction-thumb .t-line { font-size: 11px; font-weight: 700; }
.direction-thumb .t-word { font-size: 22px; font-weight: 800; line-height: 1; }
/* Выбранное направление: подложка превью чёрная, поэтому чёрная рамка у самого
   превью не была видна. Рамка идёт вокруг всей карточки + галочка в углу. */
.direction-card[aria-pressed="true"] { border-color: var(--accent); background: var(--surface); }
.direction-card[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 12px; right: 12px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; line-height: 1;
}
.direction-blurb { font-size: 12px; color: var(--ink-soft); line-height: 1.35; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.swatch {
  width: 42px; height: 42px; border-radius: 50%; border: 3px solid transparent;
  cursor: pointer; padding: 0; position: relative; display: inline-flex;
  align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.swatch-custom { background: var(--surface-2); color: var(--ink-soft); font-weight: 800; }
.color-panel {
  flex: 1 1 100%; display: flex; flex-direction: column; gap: 12px;
  padding: 14px; border-radius: 16px; background: var(--surface-2);
}
.color-top { display: flex; gap: 10px; align-items: center; }
.color-sample { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--ink-soft); flex: none; }
.color-hex {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 12px;
  border: 1.5px solid var(--ink-soft); background: var(--surface); color: var(--ink);
  font: 700 16px/1 ui-monospace, Menlo, monospace; text-transform: uppercase;
}
.color-row { display: flex; align-items: center; gap: 10px; }
.color-label { width: 74px; font-size: 13px; color: var(--ink-soft); flex: none; }
.color-range {
  -webkit-appearance: none; appearance: none; flex: 1; height: 14px;
  border-radius: 7px; outline: none;
}
.color-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 3px solid var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.color-quick { display: flex; flex-wrap: wrap; gap: 8px; }

.font-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.font-chip {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 14px; cursor: pointer; font-family: inherit; min-height: 52px; color: var(--ink);
}
.font-chip[aria-pressed="true"] { border-color: var(--ink); outline: 2px solid var(--ink); }
.font-sample { font-size: 22px; font-weight: 800; }
.font-title { font-size: 13px; color: var(--ink-soft); }

.design-preview[hidden] { display: none; }
.sticky-cta .btn + .btn { margin-top: 8px; }
.style-grid.is-muted, .color-grid.is-muted { opacity: .45; }
.mode-title { font-size: 17px; }

/* --- Карусель --- */
#carousel-text {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: var(--r-sm); padding: 14px;
  font-family: inherit; font-size: 15px; line-height: 1.45; resize: vertical;
}
.carousel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 10px; }
.carousel-slide {
  background: var(--surface); border-radius: var(--r-sm); overflow: hidden;
  display: flex; flex-direction: column; border: 1.5px solid var(--line);
}
.carousel-slide img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: var(--ink); }
.carousel-slide .ph {
  aspect-ratio: 4 / 5; background: var(--surface-2); padding: 12px;
  font-size: 12px; line-height: 1.35; color: var(--ink); overflow: hidden;
}
.carousel-slide .kind { font-size: 11px; font-weight: 700; color: var(--ink-soft); padding: 8px 10px; text-transform: uppercase; letter-spacing: .04em; }

/* Кнопка «Удалить» у ролика: спокойная, красная только по нажатию */
.btn-danger { color: var(--danger); }
/* Корзина: квадрат фиксированной ширины, остальные кнопки в ряду не сжимаются */
.btn-row .btn.btn-icon {
  flex: 0 0 44px; width: 44px; min-width: 44px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-danger:active { background: var(--danger); color: #fff; }

/* Квадрат выбора цвета: насыщенность слева направо, яркость сверху вниз */
.color-square {
  position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 16px;
  touch-action: none; cursor: crosshair; user-select: none;
  background:
    linear-gradient(to top, #000, rgba(0,0,0,0)),
    linear-gradient(to right, #fff, rgba(255,255,255,0)),
    var(--hue, #f00);
}
.color-knob {
  position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border-radius: 50%; border: 3px solid #fff; pointer-events: none;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.4);
}
.swatch-custom { border-color: var(--surface); }

/* Главная кнопка действия над роликом: тот же янтарный, что у полосы и
   ножниц в плашке «Монтирую…» (замер по скриншоту: #F5D55D = --accent) */
.btn-brand { background: var(--accent); color: var(--accent-ink); }
.btn-brand[disabled] { background: var(--surface-2); color: var(--ink-soft); }

/* Превью стиля «Широкий»: тот же облик, что в ролике: Inter Black, растянутый
   по ширине, и тонкие мелкие слова */
.style-card.is-wide .style-thumb .t-word {
  font-family: "InterUI", sans-serif; font-weight: 900; font-size: 22px;
  transform: scaleX(1.38); letter-spacing: -.5px;
}
.style-card.is-wide .style-thumb .t-line { font-weight: 400; color: #fff; }

.agree-link{color:inherit;text-decoration:underline;text-underline-offset:2px}

/* Поддержка: частые вопросы */
#screen-support { padding-bottom: 110px; }
.faq-item { margin: 10px 0; padding: 0; overflow: hidden; }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 600;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--ink-soft); }
.faq-item[open] summary::after { content: "–"; }
.faq-answer { padding: 0 18px 16px; color: var(--ink-soft); white-space: pre-line; line-height: 1.5; }

/* Мини-гайд на экране «Баланс» */
.guide-card { margin-top: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.guide-title { font-weight: 700; }
.guide-note { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
.guide-actions { display: flex; gap: 8px; }
.guide-actions .btn { flex: 1; padding: 10px 12px; min-height: 0; }
#carousel-open[hidden] { display: none; }

/* История операций: свёрнутый блок с раскрытием и кнопкой «Открыть отдельно» */
.history-box { margin-top: 20px; }
.history-box summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 10px; padding: 4px 0 10px;
}
.history-box summary::-webkit-details-marker { display: none; }
.history-box summary h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.history-box summary h2::after { content: "▾"; font-size: 16px; color: var(--ink-soft); transition: transform .2s; }
.history-box[open] summary h2::after { transform: rotate(180deg); }
.history-window {
  background: none; border: 0; padding: 4px 0; font: inherit; font-size: 13px;
  color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
#screen-history { padding-bottom: 40px; }

/* Согласие при первом входе */
.consent-row { margin: 14px 0; align-items: flex-start; }
body.is-consent #tabbar { display: none; }
#screen-consent { padding-bottom: 110px; }
