/* Монтажка — светлая дизайн-система: Inter, плотный трекинг, крупные скругления, один акцент. */
:root {
  --bg: #FFFFFF;
  --surface: #F4F4F6;          /* секции и поля */
  --surface-2: #ECECF0;        /* нажатые/вложенные */
  --ink: #18181B;
  --ink-2: #3F3F46;
  --muted: #8B8B94;
  --line: #E6E6EB;
  --accent: #2EC4B6;           /* бирюзовый — основной: кнопки, выбор, переключатели */
  --accent-ink: #0F2524;       /* на светлой бирюзе читается тёмный текст, белый — нет */
  --accent-deep: #0E8F86;      /* бирюзовый для текста и обводок на белом */
  --accent-soft: #E3F7F5;
  --coral: #FF6F61;            /* коралловый — акценты, заливки, декор */
  --coral-deep: #E04A3B;       /* коралловый для текста на белом (контраст) */
  --coral-soft: #FFEDEA;
  --font-display: "Russo One", Inter, sans-serif;   /* крупный, рубленый, с резкими краями */
  --font-hand: Caveat, "Segoe Print", cursive;      /* тонкий рукописный */
  --dark: #18181B;             /* вторичная кнопка */
  --danger: #F0443A;
  --danger-soft: #FFF0EF;
  --ok: #19A974;
  --ok-soft: #E8F7F1;
  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 15px;
  --r-sm: 11px;
  --shadow: 0 8px 40px rgba(24, 24, 27, .07);
  --track: -0.025em;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: var(--track);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- шапка */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -0.03em; }
.logo { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.title { margin-left: auto; color: var(--muted); font-size: 14px; font-weight: 500; }
.icon-btn { border: 0; background: var(--surface); width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: var(--ink); }
.tg .topbar { display: none; }                          /* в Telegram есть своя шапка */

main { max-width: 520px; margin: 0 auto; padding: 8px 16px 172px; }
.tg main { padding-top: 14px; }

h1 { font-size: 32px; line-height: 1.08; letter-spacing: -0.045em; font-weight: 650; margin: 14px 0 12px; }
h1 .accent { color: var(--accent); }
h2 { font-size: 20px; line-height: 1.2; letter-spacing: -0.035em; font-weight: 650; margin: 28px 0 12px; }
.lead { color: var(--ink-2); font-size: 16px; line-height: 1.5; margin: 0 0 22px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.4; }
.label { font-size: 13px; font-weight: 500; color: var(--muted); margin: 18px 0 9px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.row > span { font-weight: 500; }

/* ---------- кнопки */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px;
  border: 0; border-radius: var(--r-md); padding: 0 20px; font-size: 16px; font-weight: 600; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); transition: transform .08s, opacity .15s;
}
.btn:active { transform: scale(.985); }
.btn.secondary { background: var(--dark); color: #fff; }
.btn.ghost { background: var(--surface); color: var(--ink); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-row { display: grid; gap: 8px; }
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, #fff 72%, rgba(255, 255, 255, 0));
}
.bottom-bar .inner { max-width: 520px; margin: 0 auto; display: grid; gap: 8px; }

/* ---------- главная */
.hero { padding: 10px 2px 4px; }
.pill-stats { display: inline-flex; gap: 14px; padding: 9px 14px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin: 6px 0 12px; }
.pill-stats b { color: var(--accent); font-weight: 650; }
.upload {
  display: block; position: relative; border-radius: var(--r-xl); background: var(--surface); padding: 22px 20px 20px; cursor: pointer;
  border: 2px dashed transparent; transition: border-color .15s, background .15s;
}
.upload.over { border-color: var(--accent); background: var(--accent-soft); }
.upload .ico { width: 52px; height: 52px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; margin-bottom: 14px; }
.upload .big { font-size: 19px; font-weight: 650; letter-spacing: -0.035em; }
.upload .hint { margin-top: 4px; }
.upload .progress { margin-top: 16px; background: #fff; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.step { background: var(--surface); border-radius: var(--r-lg); padding: 14px; min-height: 104px; display: flex; flex-direction: column; gap: 8px; }
.step b { font-size: 13px; color: var(--accent); font-weight: 650; }
.step div { font-size: 14px; line-height: 1.35; font-weight: 500; }
.projects { display: grid; gap: 8px; }
.project { display: flex; align-items: center; gap: 12px; background: var(--surface); padding: 10px; border-radius: var(--r-lg); text-decoration: none; }
.project .thumb { width: 44px; height: 64px; border-radius: 10px; background: #D9D9DE center / cover no-repeat; flex: 0 0 44px; }
.project .meta { flex: 1; min-width: 0; display: grid; gap: 3px; }
.project .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project .sub { font-size: 12.5px; color: var(--muted); }
.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #fff; color: var(--ink-2); white-space: nowrap; }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.error { background: var(--danger-soft); color: var(--danger); }
.badge.busy { background: var(--accent-soft); color: var(--accent); }

/* ---------- секции настроек */
.section { background: var(--surface); border-radius: var(--r-xl); padding: 18px 16px; margin: 10px 0; }
.section > h3 { margin: 0 0 4px; font-size: 18px; font-weight: 650; letter-spacing: -0.035em; }
details.section > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 18px; font-weight: 650; letter-spacing: -0.035em; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform .15s; }
details.section[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
details.section[open] > summary { margin-bottom: 6px; }
.sub-card { background: #fff; border-radius: var(--r-lg); padding: 4px 14px; margin-top: 10px; }
.sub-card .row + .row { border-top: 1px solid var(--line); }

/* превью */
.preview-wrap { display: flex; justify-content: center; margin: 4px 0 6px; }
.preview { width: min(48vw, 210px); aspect-ratio: 9 / 16; border-radius: 22px; background: #111; box-shadow: 0 14px 40px rgba(24, 24, 27, .18); position: relative; overflow: hidden; }
.preview img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s; }
.preview .tag { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: rgba(0, 0, 0, .5); color: #fff; backdrop-filter: blur(6px); }
.preview.loading img { opacity: .55; }
.status-line { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); margin: 10px 0 4px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* плитки вариантов (анимация, стиль) */
.scroller { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.scroller::-webkit-scrollbar { display: none; }
.opt {
  flex: 0 0 auto; width: 94px; border: 0; background: #fff; border-radius: 16px; padding: 6px 6px 9px; display: grid; gap: 7px; justify-items: center;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); scroll-snap-align: start; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .12s;
}
.opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); color: var(--ink); font-weight: 650; }
.opt .sw { width: 100%; height: 58px; border-radius: 11px; background: #1B1B1F; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px; overflow: hidden; letter-spacing: -0.02em; }
.opt .sw.anim { font-size: 11.5px; line-height: 1.15; text-align: center; font-weight: 750; text-transform: lowercase; }
.opt .sw.anim em { font-style: normal; color: #FFD60A; }

/* образцы стилей «Aa» */
.sw.st-plain span { color: #fff; }
.sw.st-outline span { color: #fff; -webkit-text-stroke: 1.6px #000; paint-order: stroke fill; }
.sw.st-outline { background: #6F6F78; }
.sw.st-box span { background: #fff; color: #111; padding: 1px 7px; border-radius: 6px; }
.sw.st-shadow { background: #6F6F78; }
.sw.st-shadow span { text-shadow: 3px 3px 5px rgba(0, 0, 0, .85); }
.sw.st-glow span { color: #fff; text-shadow: 0 0 8px #FFD60A, 0 0 18px #FFD60A; }
.sw.st-gradient span { background: linear-gradient(#fff 50%, #FFD60A 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sw.st-uneven span { display: inline-block; transform: rotate(-7deg) scaleY(1.12); }
.sw.st-shaky span { display: inline-block; animation: shake .25s steps(2) infinite; }
@keyframes shake { 50% { transform: translate(1px, -1px) rotate(1.5deg); } }
@media (prefers-reduced-motion: reduce) { .sw.st-shaky span, .spinner { animation: none; } }

/* чипы и сегменты */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 0; background: #fff; padding: 9px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 13px; padding: 3px; gap: 2px; }
.section .seg { background: #fff; }
.seg button { border: 0; background: transparent; min-height: 38px; padding: 6px 4px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* переключатель */
.switch { position: relative; width: 50px; height: 30px; flex: 0 0 50px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #D6D6DC; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; }
select, textarea, .input { width: 100%; border: 0; background: #fff; border-radius: var(--r-md); padding: 13px 14px; font-size: 15px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
textarea::placeholder { color: var(--muted); }
.palette { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.dot { width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.dot[aria-pressed="true"] { outline: 2.5px solid var(--accent); outline-offset: 2.5px; }
.palette input[type=color] { width: 34px; height: 34px; border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; }

/* ---------- прогресс */
.big-progress { background: var(--surface); border-radius: var(--r-xl); padding: 22px 18px; margin-top: 8px; }
.big-progress .pct { font-size: 44px; font-weight: 700; letter-spacing: -0.05em; line-height: 1; }
.big-progress h2 { margin: 10px 0 0; font-size: 18px; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 16px 0 10px; }
.progress > div { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .4s; }
.stage-list { display: grid; gap: 2px; margin-top: 14px; background: #fff; border-radius: var(--r-lg); padding: 6px 14px; }
.stage { display: flex; gap: 12px; align-items: center; color: var(--muted); min-height: 42px; font-weight: 500; }
.stage + .stage { border-top: 1px solid var(--line); }
.stage.on { color: var(--ink); font-weight: 600; }
.stage.ok { color: var(--ink-2); }
.stage i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 20px; display: grid; place-items: center; }
.stage.on i { border-color: var(--accent); border-top-color: transparent; animation: spin 1s linear infinite; }
.stage.ok i { background: var(--ok); border-color: var(--ok); }
.stage.ok i::after { content: ""; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }

/* ---------- проверка */
.player { width: 100%; max-height: 48vh; border-radius: var(--r-lg); background: #000; display: block; }
.units { display: grid; gap: 8px; }
.unit { background: var(--surface); border-radius: var(--r-lg); padding: 12px 14px; transition: box-shadow .15s; }
.unit.cut { background: var(--danger-soft); }
.unit.cut .txt { text-decoration: line-through; text-decoration-color: rgba(240, 68, 58, .5); color: var(--muted); }
.unit .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.unit .txt { margin: 6px 0 2px; font-size: 15px; line-height: 1.45; cursor: pointer; }
.unit .acts { display: flex; gap: 6px; }
.unit .acts button { border: 0; background: #fff; border-radius: 10px; min-width: 34px; height: 32px; padding: 0 10px; font-size: 13px; font-weight: 600; }
.unit .reason { color: var(--danger); font-weight: 600; font-size: 12.5px; margin-top: 2px; }
.unit .acts { flex: 0 0 auto; }
.unit.playing { box-shadow: inset 0 0 0 2px var(--accent); }
.unit textarea { margin-top: 8px; }
.sumline { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 500; margin: 10px 2px; }
.sumline b { color: var(--ink); }

/* ---------- результат */
.result-video { width: min(100%, 340px); aspect-ratio: 9 / 16; border-radius: var(--r-xl); background: #000; display: block; margin: 6px auto 0; box-shadow: 0 14px 40px rgba(24, 24, 27, .18); }
.note { font-size: 13px; color: var(--muted); text-align: center; margin: 12px 0; }
.error-box { background: var(--danger-soft); color: var(--danger); padding: 14px 16px; border-radius: var(--r-lg); font-weight: 500; }

.toast {
  position: fixed; left: 50%; bottom: 170px; transform: translateX(-50%) translateY(16px); opacity: 0; pointer-events: none; z-index: 20;
  background: var(--dark); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; transition: opacity .2s, transform .2s; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* результат: ролик по высоте экрана, кнопки под ним — ничего не перекрывает видео */
.result-video { width: auto; height: min(60vh, 600px); max-width: 100%; }
.result-actions { margin-top: 14px; }

/* цвета из видео и пипетка */
.from-video { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; background: #fff; border-radius: var(--r-md); }
.fv-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fv-dots { flex: 1 1 auto; gap: 7px; }
.fv-dots .dot { width: 28px; height: 28px; }
.pick-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--surface); color: var(--ink); border-radius: 999px; padding: 8px 12px; font-size: 13.5px; font-weight: 600; margin-left: auto; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(15, 15, 18, .48); display: flex; align-items: flex-end; justify-content: center; animation: fadein .15s ease-out; }
.sheet { width: 100%; max-width: 520px; max-height: 94vh; overflow: auto; background: #fff; border-radius: 24px 24px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); animation: slideup .2s ease-out; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 17px; letter-spacing: -0.03em; }
.pick-stage { position: relative; margin: 0 auto; width: min(100%, calc(52vh * 9 / 16)); aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #111; }
.pick-stage img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: crosshair; touch-action: manipulation; }
.pk-mark { position: absolute; width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .35); transform: translate(-50%, -50%); pointer-events: none; }
.pk-wait { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .25); }
.pk-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 12px; }
.pk-steps .chip { background: var(--surface); }
.pk-result { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pk-swatch { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); flex: 0 0 34px; }
@keyframes fadein { from { opacity: 0; } }
@keyframes slideup { from { transform: translateY(40px); opacity: .6; } }

/* образцы шрифтов */
.font-opt { width: 168px; padding: 6px 6px 9px; }
.font-img { display: block; width: 100%; aspect-ratio: 360 / 132; border-radius: 11px; background: #1B1B1F; object-fit: cover; }
.font-img.same { display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 600; }
.font-name { font-size: 12.5px; line-height: 1.25; text-align: center; }

/* шапка проекта: название и даты */
.proj-head { margin: 4px 0 12px; }
.proj-name-wrap { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.proj-name { flex: 1; min-width: 0; border: 0; background: transparent; padding: 4px 0; font-size: 22px; font-weight: 650; letter-spacing: -0.035em; color: var(--ink); border-bottom: 2px solid transparent; border-radius: 0; }
.proj-name:focus { outline: none; border-bottom-color: var(--accent); }
.proj-dates { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }

/* плитки-превью из ролика */
.opt.pic { width: 96px; }
.opt-pic, .dyn { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 11px; overflow: hidden; background: #1B1B1F; position: relative; }
.opt-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.opt-pic::before { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: rgba(255,255,255,.7); animation: spin 1s linear infinite; }
.opt-pic img { position: relative; z-index: 1; }

/* динамика кадра: миниатюра ролика «наезжает» */
.dyn > span { position: absolute; inset: 0; background: center / cover no-repeat; transform-origin: 50% 35%; }
.dyn-jump > span { animation: dyn-jump 2.4s steps(1) infinite; }
.dyn-whip > span { animation: dyn-whip 2.4s infinite; }
@keyframes dyn-jump { 0%, 49% { transform: scale(1); } 50%, 100% { transform: scale(1.18); } }
@keyframes dyn-whip {
  0%, 44% { transform: scale(1); filter: none; }
  47% { transform: scale(1.08) translateX(-10%); filter: blur(3px); }
  50%, 94% { transform: scale(1.18); filter: none; }
  97% { transform: scale(1.08) translateX(10%); filter: blur(3px); }
  100% { transform: scale(1); filter: none; }
}

/* мини-схемы анимаций титров (цикл 3 с) */
.demo { display: block; position: relative; width: 100%; height: 100%; display: grid; place-items: center; text-transform: lowercase; }
.demo i { font-style: normal; }
.demo .a { color: #FFD60A; }
.demo.small { font-size: 9.5px; }
.d-pop { animation: d-pop 3s infinite; }
@keyframes d-pop { 0% { transform: scale(.4); opacity: 0; } 8% { transform: scale(1.12); opacity: 1; } 14%, 80% { transform: scale(1); opacity: 1; } 90%, 100% { opacity: 0; } }
.d-seq { display: block; }
.d-seq i { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; opacity: 0; animation: d-seq 3s infinite; }
.d-seq i:nth-child(2) { animation-delay: 1s; }
.d-seq i:nth-child(3) { animation-delay: 2s; }
.d-seq.pop i { animation-name: d-seq-pop; }
@keyframes d-seq { 0%, 32% { opacity: 1; } 33%, 100% { opacity: 0; } }
@keyframes d-seq-pop { 0% { opacity: 1; transform: scale(.5); } 5% { transform: scale(1.15); } 9%, 32% { opacity: 1; transform: scale(1); } 33%, 100% { opacity: 0; } }
.d-kar i { animation: d-kar 3s infinite; }
.d-kar i:nth-child(2) { animation-delay: .9s; }
.d-kar i:nth-child(3) { animation-delay: 1.6s; }
@keyframes d-kar { 0%, 22% { color: #FFD60A; } 23%, 100% { color: #fff; } }
.d-stack { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.d-stack i { opacity: 0; animation: d-stack 3s infinite; }
.d-stack i:nth-child(2) { animation-delay: .6s; }
.d-stack i:nth-child(3) { animation-delay: 1.2s; }
.d-stack.ladder i:nth-child(1) { transform: translateX(-12px); }
.d-stack.ladder i:nth-child(3) { transform: translateX(12px); }
@keyframes d-stack { 0% { opacity: 0; } 4%, 70% { opacity: 1; } 78%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .dyn > span, .d-pop, .d-seq i, .d-kar i, .d-stack i { animation: none !important; opacity: 1; }
  .d-seq i:not(:first-child) { opacity: 0; }
}

/* стиль/подложка титра — широкая плитка с полосой текста крупно */
.opt.pic.wide { width: 150px; }
.opt.pic.wide .opt-pic { aspect-ratio: 270 / 170; }

/* ===== Бирюза + коралл, Russo One + Caveat ===== */
/* крупный рубленый шрифт — заголовки и крупные цифры (у Russo One одно начертание — без искусственного жирного) */
h1, h2, details.section > summary, .section > h3, .brand, .upload .big, .big-progress .pct, .sheet-head b, .proj-name {
  font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em;
}
h1 { font-size: 31px; line-height: 1.12; }
h2 { font-size: 19px; }
details.section > summary { font-size: 17px; }
.proj-name { font-size: 21px; }
.big-progress .pct { font-size: 46px; letter-spacing: -0.02em; }

/* тонкий рукописный — акценты */
.hand, h1 .accent {
  font-family: var(--font-hand); font-weight: 500; letter-spacing: 0; color: var(--coral-deep);
}
h1 .accent { display: inline-block; font-size: 1.32em; line-height: 1; transform: rotate(-2.5deg); margin-top: 2px; }
.step b { font-family: var(--font-hand); font-size: 24px; font-weight: 500; letter-spacing: 0; color: var(--coral-deep); line-height: 1; }
.fv-label { font-family: var(--font-hand); font-size: 18px; font-weight: 500; letter-spacing: 0; color: var(--coral-deep); }
.hero-note { font-family: var(--font-hand); font-size: 21px; color: var(--accent-deep); letter-spacing: 0; margin: -10px 0 18px; transform: rotate(-1deg); display: inline-block; }

/* бирюза: на светлой — тёмный текст; бирюзовый текст на белом — глубокий оттенок */
.logo { background: var(--accent); color: var(--accent-ink); }
.upload .ico { background: var(--coral); color: #fff; }
.upload.over { border-color: var(--accent); background: var(--accent-soft); }
.pill-stats b { color: var(--accent-deep); }
.badge.busy { background: var(--coral-soft); color: var(--coral-deep); }
.badge.done { background: var(--accent-soft); color: var(--accent-deep); }
.opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent-deep); }
.dot[aria-pressed="true"] { outline-color: var(--accent-deep); }
.proj-name:focus { border-bottom-color: var(--accent); }
:focus-visible { outline-color: var(--accent-deep); }
.unit.playing { box-shadow: inset 0 0 0 2px var(--accent-deep); }
.stage.on i { border-color: var(--coral); border-top-color: transparent; }
.stage.ok i { background: var(--accent-deep); border-color: var(--accent-deep); }
.progress > div { background: linear-gradient(90deg, var(--accent), var(--coral)); }
.spinner { border-top-color: var(--coral); }
.status-line { color: var(--muted); }
.preview .tag { background: rgba(15, 37, 36, .62); }
.btn { box-shadow: 0 6px 20px rgba(46, 196, 182, .28); }
.btn.secondary, .btn.ghost { box-shadow: none; }
.btn:disabled { box-shadow: none; }
.pick-btn svg { color: var(--coral-deep); }



/* ===== Редактор ===== */
main.ed-mode { max-width: 560px; padding: 4px 0 24px; }
.ed-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 8px; }
.ed-back { font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.ed-export { width: auto; min-height: 40px; padding: 0 20px; font-size: 14.5px; background: var(--coral); color: #fff; box-shadow: none; }
.ed-stage { display: flex; justify-content: center; }
.ed-pv { position: relative; width: min(46vw, 200px, 30vh * 9 / 16 * 1.6); aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 10px 30px rgba(24,24,27,.18); }
.ed-pv > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.pv-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pv-ov { position: absolute; object-fit: cover; border-radius: 8%; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.pv-caps, .pv-hook, .pv-text { position: absolute; left: 0; right: 0; text-align: center; transform: translateY(-50%); line-height: 1.12; letter-spacing: -0.01em; padding: 0 3%; }
.pv-hook, .pv-text { text-transform: none; }
.pv-hook { text-shadow: 0 2px 6px rgba(0,0,0,.7); }
.pv-text { text-shadow: 0 2px 6px rgba(0,0,0,.7); }
.pv-row { line-height: 1.15; }
.pv-row span.shk { display: inline-block; animation: tile-shk .2s steps(2) infinite; }
@keyframes tile-shk { 0% { transform: translate(0,0); } 50% { transform: translate(1px,-1px); } 100% { transform: translate(-1px,1px); } }
.ed-transport { display: flex; align-items: center; gap: 8px; padding: 10px 16px 6px; }
.ed-transport .icon-btn { background: transparent; box-shadow: none; font-size: 22px; color: var(--ink-2); }
.ed-transport .icon-btn:disabled { opacity: .3; }
.ed-play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); display: grid; place-items: center; margin-left: 8px; }
.ed-play i { width: 0; height: 0; border-left: 14px solid var(--accent-ink); border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 3px; }
.ed-play.on i { width: 14px; height: 16px; border: 0; margin: 0; background: linear-gradient(90deg, var(--accent-ink) 35%, transparent 35% 65%, var(--accent-ink) 65%); }
.ed-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14.5px; margin-right: auto; margin-left: 8px; }
.ed-tl { position: relative; display: grid; grid-template-columns: 52px 1fr; background: var(--surface); border-radius: 18px; margin: 0 8px; overflow: hidden; }
.ed-icons .ic, .tl-row { height: 54px; }
.ed-icons .ic.ruler, .tl-row.ruler { height: 26px; }
.ed-icons .ic.r-clips, .tl-row.r-clips { height: 64px; }
.ed-icons .ic.r-cap, .tl-row.r-cap { height: 44px; }
.ed-icons .ic.r-hook, .tl-row.r-hook { height: 38px; }
.ed-icons .ic { display: flex; align-items: center; gap: 2px; padding-left: 6px; color: var(--ink-2); }
.ed-icons .ic b { font-size: 18px; width: 22px; text-align: center; }
.ed-icons .ic button { border: 0; background: transparent; color: var(--coral-deep); font-size: 22px; font-weight: 600; line-height: 1; padding: 4px; }
.ed-scroll { overflow-x: auto; scrollbar-width: none; position: relative; }
.ed-scroll::-webkit-scrollbar { display: none; }
.ed-inner { position: relative; min-height: 100%; }
.tl-row { position: relative; border-top: 1px solid rgba(0,0,0,.04); }
.tl-row.ruler { border-top: 0; font-size: 11.5px; color: var(--muted); }
.tl-row .rl { position: absolute; top: 5px; transform: translateX(-50%); }
.tl-clip { position: absolute; top: 4px; bottom: 4px; border-radius: 9px; background-color: #3b3b44; background-repeat: no-repeat; border: 0; padding: 0; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.tl-clip.sel { box-shadow: 0 0 0 2px var(--ink); }
.tl-clip .zl { position: absolute; left: 4px; right: 4px; bottom: 3px; display: flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--ink); background: rgba(255,255,255,.88); padding: 1px 6px; border-radius: 7px; white-space: nowrap; overflow: hidden; }
.tl-clip .zl:empty { display: none; }
.tl-trans { position: absolute; top: 16px; width: 24px; height: 24px; margin-left: -12px; border-radius: 8px; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; z-index: 3; opacity: .85; }
.tl-trans.on { background: var(--coral); opacity: 1; }
.tl-cap, .tl-hook, .tl-ov, .tl-tx { position: absolute; top: 6px; bottom: 6px; border: 0; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px var(--line); padding: 0 8px; font-size: 12.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; letter-spacing: 0; }
.tl-hook { display: flex; align-items: center; gap: 5px; background: var(--coral-soft); color: var(--coral-deep); box-shadow: none; font-weight: 600; }
.tl-hook.off { opacity: .55; }
.tl-ov { padding: 0; display: grid; place-items: center; background: var(--accent-soft); }
.tl-ov img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.tl-tx { background: var(--accent-soft); color: var(--accent-deep); display: flex; align-items: center; gap: 5px; font-weight: 600; }
.tl-tx b { font-family: var(--font-display); }
.tl-empty { position: absolute; top: 18px; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.tl-sfx { position: absolute; top: 12px; width: 18px; height: 30px; margin-left: -9px; border-radius: 9px; border: 0; background: var(--coral); }
.tl-sfx.auto { background: #C7C7CE; pointer-events: none; }
.ed-playhead { position: absolute; top: 0; bottom: 0; left: calc(52px + (100% - 52px) / 2); width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; z-index: 5; }
.ed-tools { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 8px 8px 0; }
.ed-tools button { border: 0; background: transparent; display: grid; justify-items: center; gap: 2px; font-size: 11.5px; font-weight: 500; color: var(--ink-2); padding: 8px 0; }
.ed-tools button b { font-size: 20px; font-family: var(--font-display); font-weight: 400; color: var(--ink); }
.ed-note { text-align: center; margin: 6px 16px 0; }
.ed-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ed-opt { border: 1.5px solid var(--line); background: #fff; border-radius: 16px; padding: 12px 6px; display: grid; justify-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; }
.ed-opt[aria-pressed="true"] { border-color: var(--coral); background: var(--coral-soft); font-weight: 650; }
.zi { display: block; width: 36px; height: 54px; border-radius: 8px; background: var(--surface); position: relative; overflow: hidden; }
.zi b { position: absolute; left: 50%; bottom: 0; width: 18px; height: 26px; margin-left: -9px; background: #9A9AA3; border-radius: 9px 9px 0 0; }
.zi b::before { content: ""; position: absolute; left: 3px; top: -11px; width: 12px; height: 12px; border-radius: 50%; background: #9A9AA3; }
.zi.in b, .zi.close b { transform: scale(1.35); transform-origin: 50% 100%; }
.zi.out b { transform: scale(.8); transform-origin: 50% 100%; }
.ed-opt[aria-pressed="true"] .zi b, .ed-opt[aria-pressed="true"] .zi b::before { background: var(--coral); }
.btn.danger, .btn.ghost.danger { color: var(--danger); }
.ed-time { white-space: nowrap; font-size: 13.5px; }
.ed-transport { gap: 4px; }
.ed-play { margin-left: 4px; }

.ed-h { margin: 14px 0 6px; font-size: 13px; font-weight: 650; color: var(--muted, #6b7280); }
.ed-rng { display: grid; grid-template-columns: 108px 1fr 44px; align-items: center; gap: 8px; font-size: 13px; margin: 4px 0; }
.ed-rng input[type=range] { width: 100%; accent-color: var(--accent); }
.ed-rng output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted, #6b7280); }
