:root {
  --bg: #0C0C10; --surface: #15151C; --surface2: #1C1C24; --line: rgba(255,255,255,0.08);
  --text: #F4F4F6; --muted: #A3A3B2; --dim: #6E6E7C;
  --lime: #C8FF3D; --lime-soft: rgba(200,255,61,0.12); --violet: #8E7BFF; --violet-soft: rgba(142,123,255,0.16);
  --red: #FF8A8A; --tab-h: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Manrope', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button { font-family: inherit; color: inherit; cursor: pointer; }
a { color: var(--lime); text-decoration: none; }
h1, h2, .display { font-family: 'Unbounded', 'Manrope', sans-serif; letter-spacing: -0.02em; }
.hidden { display: none !important; }
.noscroll { scrollbar-width: none; } .noscroll::-webkit-scrollbar { display: none; }

#app { min-height: 100vh; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px); }
.screen { padding: 0 18px; }
.screen.anim { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.glow { position: fixed; left: -140px; top: -170px; width: 440px; height: 440px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(200,255,61,0.14) 0%, rgba(200,255,61,0) 65%); z-index: 0; }
.screen > * { position: relative; z-index: 1; }

/* шапка */
.top { height: 58px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 800; font-size: 19px; }
.brand i { width: 26px; height: 26px; border-radius: 8px; background: var(--lime); display: inline-flex; align-items: center; justify-content: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--lime));
  color: #0C0C10; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 14px; border: none; }
.pill { height: 32px; padding: 0 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }

.hero { margin: 12px 0 8px; font-weight: 700; font-size: 28px; line-height: 1.1; }
.hero em { font-style: normal; color: var(--lime); }
.lead { margin: 0 0 18px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.h2 { font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 600; font-size: 16px; margin: 26px 0 12px; display: flex; justify-content: space-between; align-items: center; }
.h2 a { font-family: 'Manrope'; font-size: 13px; font-weight: 700; }
.label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 20px 0 10px; display: flex; justify-content: space-between; }
.label a { font-size: 13px; }

/* карточки загрузки */
.uploads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.upcard { height: 200px; padding: 0; border-radius: 22px; border: 1px solid var(--line); background: var(--surface);
  position: relative; overflow: hidden; text-align: left; }
.upcard.ok { border-color: rgba(200,255,61,0.55); }
.upcard.want { border-color: rgba(142,123,255,0.45); }
.upcard .empty { position: absolute; inset: 8px; border-radius: 16px; border: 1.5px dashed rgba(255,255,255,0.16);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; text-align: center; padding: 10px; }
.upcard.want .empty { border-color: rgba(142,123,255,0.55); }
.upcard .ico { width: 48px; height: 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--lime-soft); }
.upcard.want .ico { background: var(--violet-soft); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .6 } 50% { opacity: 1 } }
.upcard .t { font-weight: 800; font-size: 15px; }
.upcard .s { font-size: 12px; color: var(--muted); line-height: 1.35; }
.upcard img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.upcard .shade { position: absolute; left: 0; right: 0; bottom: 0; height: 100px; background: linear-gradient(to top, rgba(12,12,16,0.94), rgba(12,12,16,0)); }
.upcard .meta { position: absolute; left: 12px; right: 12px; bottom: 12px; }
.upcard .kind { font-size: 11px; color: var(--lime); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.upcard .name { font-size: 13.5px; font-weight: 700; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcard .hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
.upcard .dur { position: absolute; top: 10px; left: 10px; height: 22px; padding: 0 8px; border-radius: 11px; background: rgba(12,12,16,0.72);
  font-size: 11px; font-weight: 800; display: flex; align-items: center; }
.upcard .check { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--lime);
  display: flex; align-items: center; justify-content: center; }
.upcard .bar { position: absolute; left: 14px; right: 14px; bottom: 16px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.12); }
.upcard .bar b { display: block; height: 100%; border-radius: 3px; background: var(--lime); transition: width .2s; }
.upcard .busy { position: absolute; inset: 0; background: rgba(12,12,16,0.65); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; font-weight: 800; font-size: 13px; }

/* стили-чипы */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.chip { height: 40px; padding: 0 14px 0 6px; border-radius: 14px; display: flex; align-items: center; gap: 8px; flex: none;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 700; white-space: nowrap; }
.chip.on { background: var(--lime-soft); border-color: var(--lime); }
.chip img, .chip .sw { width: 28px; height: 28px; border-radius: 9px; object-fit: cover; flex: none; background: var(--surface2); }

/* режимы */
.modes { display: flex; flex-direction: column; gap: 8px; }
.mode { width: 100%; min-height: 66px; padding: 12px 14px; border-radius: 18px; display: flex; align-items: center; gap: 12px;
  text-align: left; background: var(--surface); border: 1px solid rgba(255,255,255,0.07); }
.mode.on { background: linear-gradient(180deg, rgba(200,255,61,0.10), rgba(200,255,61,0.03)); border-color: rgba(200,255,61,0.7); }
.mode .mi { width: 40px; height: 40px; border-radius: 13px; background: #1E1E27; color: var(--muted); display: flex; align-items: center; justify-content: center; flex: none; }
.mode.on .mi { background: var(--lime); color: #0C0C10; }
.mode .mt { font-weight: 800; font-size: 15px; display: block; }
.mode .ms { font-size: 12.5px; color: var(--muted); line-height: 1.35; display: block; margin-top: 2px; }
.mode .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.22); margin-left: auto; flex: none;
  display: flex; align-items: center; justify-content: center; }
.mode.on .radio { border-color: var(--lime); }
.mode.on .radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); }

/* главная кнопка */
.cta { width: 100%; height: 62px; border: none; border-radius: 20px; background: var(--lime); color: #0C0C10; display: flex;
  align-items: center; justify-content: center; gap: 10px; font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 700; font-size: 17px;
  box-shadow: 0 12px 34px rgba(200,255,61,0.28); margin-top: 22px; }
.cta:disabled { background: #1C1C24; color: #6E6E7C; box-shadow: none; border: 1px solid rgba(255,255,255,0.06); }
.cta.small { height: 54px; font-size: 15px; margin-top: 14px; }
.sub { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; }

/* недавние */
.strip { display: flex; gap: 10px; overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.mini { width: 118px; flex: none; color: var(--text); text-align: left; background: none; border: none; padding: 0; }
.mini .th { height: 168px; border-radius: 16px; background: var(--surface2) center/cover no-repeat; position: relative; overflow: hidden; }
.mini .th .badge { position: absolute; left: 8px; bottom: 8px; }
.mini .tt { font-size: 12.5px; font-weight: 700; margin-top: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .ts { font-size: 11px; color: var(--muted); }
.badge { height: 22px; padding: 0 8px; border-radius: 8px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 800;
  background: rgba(12,12,16,0.78); color: var(--text); }
.badge.done { background: rgba(200,255,61,0.16); color: var(--lime); }
.badge.work { background: rgba(142,123,255,0.22); color: #CFC7FF; }
.badge.err { background: rgba(255,170,90,0.18); color: #FFC08A; }
.badge.draft { background: rgba(255,255,255,0.1); color: #D6D6DE; }

/* экран монтажа */
.bar-top { height: 56px; display: flex; align-items: center; justify-content: space-between; }
.bar-top .ttl { font-weight: 800; font-size: 15px; max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 44px; height: 44px; border-radius: 14px; border: none; background: transparent; display: flex; align-items: center; justify-content: center; }
.ringwrap { position: relative; height: 250px; display: flex; align-items: center; justify-content: center; }
.ringwrap .halo { position: absolute; width: 240px; height: 240px; border-radius: 50%; animation: halo 3s ease-in-out infinite;
  background: radial-gradient(circle, rgba(200,255,61,0.22) 0%, rgba(200,255,61,0) 62%); }
@keyframes halo { 0%,100% { opacity: .45; transform: scale(1) } 50% { opacity: .9; transform: scale(1.06) } }
.ringwrap .tile { position: absolute; top: 46px; width: 76px; height: 134px; border-radius: 16px; overflow: hidden;
  box-shadow: 0 16px 34px rgba(0,0,0,0.55); background: var(--surface2) center/cover no-repeat; }
.ringwrap .tile.l { left: 4px; transform: rotate(-9deg); } .ringwrap .tile.r { right: 4px; transform: rotate(9deg); }
.ring { position: relative; width: 168px; height: 168px; border-radius: 50%; }
.ring .in { position: absolute; inset: 9px; border-radius: 50%; background: #111117; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .pc { font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 700; font-size: 40px; letter-spacing: -0.03em; }
.ring .pc small { font-size: 20px; color: var(--lime); }
.ring .eta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.headline { text-align: center; font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 600; font-size: 17px; margin-top: 4px; }
.card { margin-top: 16px; background: var(--surface); border: 1px solid rgba(255,255,255,0.07); border-radius: 22px; padding: 6px 16px; }
.card.pad { padding: 16px; }
.step { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.step:last-child { border-bottom: none; }
.step .dot { width: 26px; height: 26px; border-radius: 50%; flex: none; border: 1.5px solid rgba(255,255,255,0.14); display: flex; align-items: center; justify-content: center; }
.step.done .dot { background: var(--lime); border: none; }
.step.now .dot { border-color: rgba(200,255,61,0.4); }
.step.now .dot::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--lime); border-right-color: transparent; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.step .st { font-size: 14.5px; font-weight: 700; color: var(--dim); }
.step.done .st, .step.now .st { color: var(--text); }
.step .sn { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.seen { background: linear-gradient(180deg, rgba(142,123,255,0.14), rgba(142,123,255,0.04)); border: 1px solid rgba(142,123,255,0.3);
  border-radius: 22px; padding: 16px; margin-top: 14px; }
.seen .sh { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: #C9C0FF; }
.seen p { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: #D6D6DE; }
.errbox { margin-top: 18px; border-radius: 22px; padding: 18px; background: rgba(255,138,138,0.08); border: 1px solid rgba(255,138,138,0.35); }
.errbox b { display: block; font-size: 15px; } .errbox p { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* результат */
.player { display: flex; justify-content: center; margin-top: 4px; }
.player video { width: 236px; height: 420px; border-radius: 26px; background: #000; object-fit: cover; box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.stat { background: var(--surface2); border-radius: 16px; padding: 12px; }
.stat b { display: block; font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 700; font-size: 19px; }
.stat b.l { color: var(--lime); }
.stat span { font-size: 12px; color: var(--muted); }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.act { height: 64px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px; font-size: 12px; font-weight: 700; }
.act:disabled { color: var(--dim); }
.stars { display: flex; gap: 6px; margin-top: 12px; }
.stars button { width: 44px; height: 44px; border-radius: 14px; background: var(--surface2); border: none; display: flex; align-items: center; justify-content: center; }

/* списки */
.plist { display: flex; flex-direction: column; gap: 10px; }
.prow { display: flex; gap: 14px; padding: 10px; border-radius: 20px; background: var(--surface); border: 1px solid rgba(255,255,255,0.07); text-align: left; width: 100%; }
.prow .th { width: 66px; height: 116px; border-radius: 14px; flex: none; background: var(--surface2) center/cover no-repeat; }
.prow .pi { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 4px 0; }
.prow .pt { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .pm { font-size: 12px; color: var(--muted); margin-top: 3px; }
.prow .pb { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.prow .pbar { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.1); margin-bottom: 8px; }
.prow .pbar b { display: block; height: 100%; border-radius: 3px; background: var(--lime); }
.emptybox { text-align: center; padding: 50px 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.emptybox b { display: block; color: var(--text); font-size: 16px; margin-bottom: 6px; }
.scard { display: flex; gap: 14px; padding: 12px; border-radius: 22px; background: var(--surface); border: 1px solid rgba(255,255,255,0.07); }
.scard .th { width: 86px; height: 152px; border-radius: 16px; flex: none; background: var(--surface2) center/cover no-repeat; }
.scard .si { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.scard .sn { font-size: 15px; font-weight: 800; }
.scard .ss { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.scard .go { margin-top: auto; height: 38px; border-radius: 12px; border: none; background: var(--lime); color: #0C0C10; font-weight: 800; font-size: 13px; }
.soon { display: flex; gap: 10px; overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.soon div { width: 128px; height: 92px; flex: none; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 800; font-size: 14px; text-align: center; padding: 0 8px; opacity: .55; }

/* профиль */
.me { display: flex; align-items: center; gap: 14px; padding-top: 20px; }
.me .avatar { width: 58px; height: 58px; border-radius: 20px; font-size: 22px; }
.me b { font-family: 'Unbounded', 'Manrope', sans-serif; font-size: 20px; display: block; }
.me span { font-size: 13px; color: var(--muted); }
.beta { margin-top: 20px; border-radius: 24px; padding: 18px; background: linear-gradient(150deg, rgba(200,255,61,0.16), rgba(200,255,61,0.03) 60%), var(--surface);
  border: 1px solid rgba(200,255,61,0.3); }
.beta .k { font-size: 12.5px; font-weight: 800; color: var(--lime); letter-spacing: .04em; text-transform: uppercase; }
.beta .v { font-family: 'Unbounded', 'Manrope', sans-serif; font-weight: 700; font-size: 24px; margin-top: 6px; }
.beta p { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.faq { margin-top: 14px; background: var(--surface); border: 1px solid rgba(255,255,255,0.07); border-radius: 22px; padding: 4px 16px; }
.faq details { border-bottom: 1px solid rgba(255,255,255,0.06); padding: 14px 0; }
.faq details:last-child { border-bottom: none; }
.faq summary { font-weight: 700; font-size: 14px; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* нижнее меню */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-b)); padding: 10px 6px var(--safe-b);
  background: rgba(16,16,22,0.96); backdrop-filter: blur(12px); border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: flex-start; justify-content: space-around; z-index: 50; }
.tab { width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #8C8C9A; font-size: 11px; font-weight: 700;
  background: none; border: none; padding: 0; }
.tab.on { color: var(--lime); }
.tab.plus { width: 56px; height: 56px; margin-top: -24px; border-radius: 20px; background: var(--lime); color: #0C0C10; justify-content: center;
  box-shadow: 0 10px 26px rgba(200,255,61,0.35), 0 0 0 6px var(--bg); }

.toast { position: fixed; left: 16px; right: 16px; top: 14px; z-index: 100; padding: 13px 15px; border-radius: 16px; background: #1C1C24;
  border: 1px solid rgba(200,255,61,0.45); box-shadow: 0 16px 40px rgba(0,0,0,0.6); font-size: 13.5px; font-weight: 700; line-height: 1.4;
  animation: fade .25s ease-out; }
.toast.bad { border-color: rgba(255,138,138,0.5); }
.gate { min-height: 90vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; gap: 10px; }
.gate b { font-family: 'Unbounded', 'Manrope', sans-serif; font-size: 20px; } .gate p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }

/* ---------------- редактор */
.screen.ed { padding: 0 12px; }
#app:has(.screen.ed) { padding-bottom: calc(var(--safe-b) + 16px); }
.ed .bar-top .iconbtn { font-size: 28px; color: var(--text); }
.ed .save { height: 38px; padding: 0 16px; border-radius: 12px; border: none; background: var(--lime); color: #0C0C10; font-weight: 800; font-size: 14px; }
.ed .save:disabled { opacity: .55; }
.pvwrap { display: flex; justify-content: center; }
.pv { position: relative; width: min(100%, calc(52vh * 9 / 16)); aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: #000; }
.pv video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv iframe { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; border: 0; transform-origin: 0 0; pointer-events: none; background: transparent; }
.pv .selbox { position: absolute; display: none; border: 2px solid var(--lime); border-radius: 10px; box-shadow: 0 0 0 9999px rgba(0,0,0,.18); pointer-events: none; }
.pv .pvtap { position: absolute; inset: 0; background: transparent; border: 0; }
.ctrl { display: flex; align-items: center; gap: 12px; margin: 10px 2px 6px; font-weight: 700; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.playb { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--lime); color: #0C0C10; font-size: 14px; font-weight: 900; }
.tl { overflow-x: auto; overflow-y: hidden; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.tlin { position: relative; height: 156px; }
.tl .ruler { position: absolute; left: 0; right: 0; top: 0; height: 22px; border-bottom: 1px solid var(--line); }
.tl .ruler i { position: absolute; top: 0; height: 22px; border-left: 1px solid rgba(255,255,255,.12); font-style: normal; font-size: 10px; color: var(--dim); padding-left: 3px; line-height: 22px; }
.tl .trk { position: absolute; left: 0; right: 0; height: 40px; }
.tl .trk:nth-of-type(2) { top: 26px; } .tl .trk:nth-of-type(3) { top: 70px; } .tl .trk:nth-of-type(4) { top: 114px; }
.tl .trk .tn { position: sticky; left: 4px; top: 0; z-index: 2; font-size: 9px; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }
.tl .blk { position: absolute; top: 10px; height: 28px; border-radius: 8px; border: 1px solid transparent; font-size: 10.5px; font-weight: 700;
  padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.tl .blk.g { background: var(--violet-soft); color: #D6CFFF; border-color: rgba(142,123,255,.35); }
.tl .blk.g.beh { background: rgba(255,184,107,.14); color: #FFD3A3; border-color: rgba(255,184,107,.35); }
.tl .blk.c { background: rgba(255,255,255,.06); color: var(--muted); }
.tl .blk.sel { border-color: var(--lime); color: var(--text); box-shadow: 0 0 0 1px var(--lime); }
.tl .blk.off { opacity: .35; text-decoration: line-through; }
.tl .phd { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--lime); box-shadow: 0 0 8px var(--lime); pointer-events: none; }
.edtabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 8px; }
.edtab { height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; color: var(--muted); }
.edtab.on { background: var(--lime-soft); color: var(--lime); border-color: rgba(200,255,61,.4); }
.edpanel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; min-height: 150px; }
.edpanel .ph { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 14px; }
.edpanel .ph span { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.eb { height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); font-weight: 700; font-size: 13.5px; }
.eb.warn { background: rgba(255,138,138,.12); color: var(--red); border-color: rgba(255,138,138,.35); }
.eb:active { transform: scale(.97); }
.hint { color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; padding: 14px 6px; }
.hint.small { font-size: 11.5px; padding: 10px 0 0; }
.lbl { font-size: 11px; font-weight: 800; color: var(--dim); text-transform: uppercase; letter-spacing: .08em; margin: 14px 2px 8px; }
.lbl span { text-transform: none; letter-spacing: 0; font-weight: 600; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); }
.sw.on { border-color: var(--text); box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.sw.reset { background: var(--surface2); color: var(--muted); font-size: 15px; }
.caped { display: flex; gap: 8px; }
.caped input { flex: 1; min-width: 0; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); padding: 0 12px; font: inherit; font-size: 14px; }
.caped .eb { padding: 0 12px; }
.musl { display: flex; flex-direction: column; gap: 6px; }
.mus { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); text-align: left; }
.mus b { display: block; font-size: 13.5px; } .mus i { display: block; font-style: normal; font-size: 11.5px; color: var(--dim); }
.mus .mr { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--dim); flex: none; display: flex; align-items: center; justify-content: center; font-weight: 900; }
.mus.on { border-color: rgba(200,255,61,.45); background: var(--lime-soft); } .mus.on .mr { border-color: var(--lime); background: var(--lime); }
.mus.add .mr { border-style: dashed; color: var(--lime); border-color: var(--lime); }
.vol { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.vol .eb { width: 42px; } .vol span { font-weight: 800; font-size: 13px; }
.pv video { transform-origin: 50% 38%; will-change: transform; }
.pv .trash { position: absolute; display: none; width: 36px; height: 36px; border-radius: 50%; border: none; background: #FF5A6A; color: #fff;
  align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 6px 16px rgba(0,0,0,.4); z-index: 3; }
.ctrl .zb { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 18px; font-weight: 800; color: var(--text); }
.tl { touch-action: pan-x; }
/* звуки на дорожке, нарезка */
.tl .blk.s { width: 22px; padding: 0; text-align: center; font-size: 12px; background: rgba(61,200,255,.13); border-color: rgba(61,200,255,.35); }
.tl .blk.s.off { text-decoration: none; opacity: .3; filter: grayscale(1); }
.tl .cutz { position: absolute; top: 22px; bottom: 0; pointer-events: none; border-left: 1px solid rgba(255,90,106,.7); border-right: 1px solid rgba(255,90,106,.7);
  background: repeating-linear-gradient(135deg, rgba(255,90,106,.22) 0 6px, rgba(255,90,106,.08) 6px 12px); }
.pv .cutbadge { position: absolute; display: none; left: 50%; top: 50%; transform: translate(-50%,-50%); padding: 8px 14px; border-radius: 12px;
  background: rgba(255,90,106,.92); color: #fff; font-weight: 800; font-size: 14px; pointer-events: none; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kd { height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); font-size: 12.5px; font-weight: 700; color: var(--muted); }
.kd.on { border-color: rgba(200,255,61,.45); background: var(--lime-soft); color: var(--lime); }
.edpanel .tag { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--lime); background: var(--lime-soft); padding: 2px 6px; border-radius: 6px; margin-left: 4px; }
.edpanel .sep { height: 1px; background: var(--line); margin: 14px -12px 0; }
.edpanel .lime { color: var(--lime); }
.eb:disabled { opacity: .4; }
.eb.mark { border-color: rgba(200,255,61,.5); color: var(--lime); }
.eb.wide { width: 100%; margin-top: 10px; }
.trans { max-height: 220px; overflow-y: auto; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); padding: 6px; position: relative; }
.tw { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 5px 4px; border-radius: 8px; }
.tw.now { background: rgba(200,255,61,.07); }
.twt { border: none; background: none; color: var(--dim); font-size: 10.5px; font-weight: 700; margin-right: 4px; font-variant-numeric: tabular-nums; padding: 4px 2px; }
.wd { border: none; background: none; color: var(--text); font-size: 15px; padding: 4px 4px; border-radius: 6px; font-weight: 500; }
.wd.cut { color: #FF8A95; text-decoration: line-through; background: rgba(255,90,106,.14); }
.mcl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mc { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 10px; border-radius: 9px; background: rgba(255,90,106,.14); color: #FF8A95; font-size: 12px; font-weight: 700; }
.mc button { border: none; background: rgba(255,255,255,.08); color: var(--text); width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
/* лента как в CapCut: линия по центру, дорожка видео с кадрами, ✂ 🗑 ↶ */
.tlwrap { position: relative; }
.tlwrap .phc { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 0 10px rgba(255,255,255,.35); pointer-events: none; z-index: 6; }
.tl .tlin { height: 176px; }
.tl .tlc { position: absolute; top: 0; bottom: 0; }
.tl .row { position: absolute; left: 0; right: 0; }
.tl .row.v { top: 26px; height: 52px; } .tl .row.g { top: 84px; height: 28px; } .tl .row.c { top: 116px; height: 24px; } .tl .row.s { top: 146px; height: 26px; }
.tl .row .blk { top: 0; height: 100%; }
.tl .row .blk.c { font-size: 10px; }
.tl .clip { position: absolute; top: 0; height: 52px; padding: 0; border-radius: 9px; overflow: hidden; display: flex; background: #1b1d24;
  border: 2px solid transparent; box-sizing: border-box; }
.tl .clip .th { flex: none; width: 29.25px; height: 100%; background-image: var(--sp); background-size: var(--spw) auto; background-repeat: no-repeat; }
.tl .clip.sel { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime), 0 0 14px rgba(200,255,61,.35); }
.tl .joint { position: absolute; top: 13px; width: 26px; height: 26px; margin-left: -12px; border-radius: 50%; border: 2px solid #0C0C10; padding: 0;
  background: #FF5A6A; color: #fff; font-size: 13px; font-weight: 900; z-index: 3; }
.tbar { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.tbtn { height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-weight: 800; font-size: 14.5px; color: var(--text); }
.tbtn.cut { background: var(--lime); color: #0C0C10; border: none; }
.tbtn:disabled { opacity: .35; }
.tbtn:active { transform: scale(.97); }
.tlhint { font-size: 12.5px; color: var(--muted); margin: 8px 2px 0; line-height: 1.45; min-height: 36px; }
.tlhint b { color: var(--text); }
.edtabs { grid-template-columns: repeat(3, 1fr); }
.ctrl .zb[data-step] { width: 32px; }
/* нижняя панель как в CapCut: инструменты того, что выбрано */
.sheet { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; min-height: 54px; }
.sheet:empty { display: none; }
.sheet .shh { font-weight: 800; font-size: 14px; margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sheet .shh span { color: var(--dim); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet .hint.small { padding: 0; text-align: left; }
.sheet .lbl { margin-top: 10px; }
.tools { display: flex; gap: 4px; overflow-x: auto; margin: 8px -16px 0; padding: 4px 16px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tools::-webkit-scrollbar { display: none; }
.tb { flex: none; min-width: 66px; height: 62px; border-radius: 14px; border: none; background: transparent; color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0 6px; }
.tb i { font-style: normal; font-size: 21px; line-height: 1; font-weight: 800; }
.tb span { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tb:active { background: var(--surface2); }
.tb.red i, .tb.red span { color: #FF8A95; }
.tb.lime i, .tb.lime span { color: var(--lime); }
.tb.dim span { color: var(--dim); }
.tb:disabled { opacity: .35; }
.vrow { display: flex; align-items: center; gap: 10px; }
.vrow input[type=range] { flex: 1; accent-color: var(--lime); height: 28px; }
.vrow b { min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.tl .blk.s em { position: absolute; right: -4px; top: -7px; font-style: normal; font-size: 8.5px; font-weight: 800; background: var(--lime); color: #0C0C10;
  border-radius: 6px; padding: 0 3px; line-height: 13px; }
.tl .blk.s { overflow: visible; }
.tl .clip.thin { background: var(--lime); }
.tl .row.v { cursor: pointer; }
.ctrl #edundo:disabled { opacity: .35; }
/* редактор — один экран, как в CapCut: видео сверху ужимается, лента и инструменты всегда внизу */
#app:has(.screen.ed) { padding-bottom: 0; min-height: 0; }
.screen.ed { display: flex; flex-direction: column; height: var(--tg-viewport-stable-height, 100dvh); overflow: hidden;
  padding-bottom: calc(var(--safe-b) + 2px); }
.screen.ed > * { flex: none; }
.screen.ed .bar-top { margin-bottom: 6px; }
.screen.ed .pvwrap { flex: 1 1 0; min-height: 120px; display: flex; justify-content: center; }
.screen.ed .pv { height: 100%; width: auto; max-width: 100%; aspect-ratio: 9 / 16; }
.screen.ed .ctrl { margin: 8px 0 6px; gap: 6px; }
.screen.ed .ctrl #edtime { white-space: nowrap; font-size: 12.5px; }
.screen.ed .ctrl .zb { width: 34px; height: 34px; }
.screen.ed .playb { width: 38px; height: 38px; flex: none; }
.screen.ed .sheet { margin-top: 8px; max-height: 30vh; overflow-y: auto; }
.screen.ed .tools { margin-top: 4px; padding-bottom: 4px; }
.pv iframe.behindf { opacity: .72; }
/* правки внутри вставки: надписи, фото, цвет */
.sheet .etx { width: 100%; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface2); color: var(--text);
  padding: 0 12px; font: inherit; font-size: 14px; margin-bottom: 6px; box-sizing: border-box; }
.phrow { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.phrow img, .phrow .phfill { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--line); display: block; }
.phrow .phb { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1; }
.phrow .phb .eb { height: 38px; font-size: 12.5px; }
/* приближение ролика в окне редактора (только просмотр) */
.pv .pvz { position: absolute; inset: 0; transform-origin: 0 0; }
.pv .zreset { position: absolute; right: 8px; bottom: 8px; display: none; z-index: 5; height: 30px; padding: 0 10px; border-radius: 10px; border: none;
  background: rgba(12,12,16,.78); color: #fff; font-weight: 800; font-size: 12px; backdrop-filter: blur(6px); }
/* холст: ролик целиком увеличивается внутри своей области, края обрезаются по ней */
.screen.ed .pvwrap { position: relative; overflow: hidden; }
.screen.ed .pv { transform-origin: 0 0; will-change: transform; }
.screen.ed .pvwrap > .zreset { position: absolute; right: 8px; bottom: 8px; }
.zreset { position: absolute; right: 8px; bottom: 8px; display: none; z-index: 5; height: 30px; padding: 0 10px; border-radius: 10px; border: none;
  background: rgba(12,12,16,.8); color: #fff; font-weight: 800; font-size: 12px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* «в разработке» и готовые стили (оформление) */
.mode.dev { opacity: .5; }
.devtag { flex: none; margin-left: auto; font: 700 10.5px Manrope, sans-serif; letter-spacing: .3px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 20px; padding: 4px 9px; white-space: nowrap; vertical-align: middle; }
.h2 .devtag { margin-left: 8px; }
.looks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lcard { display: flex; flex-direction: column; text-align: left; padding: 0 0 12px; border-radius: 18px; overflow: hidden;
  background: var(--surface); border: 1.5px solid var(--line); color: inherit; font: inherit; }
.lcard.on { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(200,255,61,.12); }
.lcard .th { position: relative; aspect-ratio: 3 / 4; background-size: cover; background-position: center; }
.lcard .chk { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--lime);
  display: none; align-items: center; justify-content: center; }
.lcard.on .chk { display: flex; }
.lcard .lt { font: 800 15px Unbounded, sans-serif; margin: 10px 12px 0; }
.lcard .ls { font-size: 12px; line-height: 1.35; color: var(--muted); margin: 5px 12px 0; flex: 1; }
.lcard .lb { margin: 10px 12px 0; text-align: center; font-weight: 800; font-size: 13px; padding: 8px; border-radius: 12px;
  background: rgba(255,255,255,.07); }
.lcard.on .lb { background: var(--lime); color: #0C0C10; }

/* пробный ролик и значки стилей */
.trial { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; padding: 14px 16px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(200,255,61,.16), rgba(200,255,61,.05)); border: 1px solid rgba(200,255,61,.35); }
.trial b { font-size: 14.5px; }
.trial span { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.trial.used { background: var(--surface); border-color: var(--line); }
.ltag { display: inline-block; vertical-align: middle; margin-left: 6px; font: 800 10.5px Manrope, sans-serif; padding: 3px 8px;
  border-radius: 20px; white-space: nowrap; }
.ltag.free { background: var(--lime); color: #0C0C10; }
.ltag.prem { background: rgba(142,123,255,.2); color: #C9BEFF; border: 1px solid rgba(142,123,255,.4); }
.mode .ltag.prem { margin-left: auto; flex: none; }
.lcard .th .ltag { position: absolute; left: 8px; bottom: 8px; margin: 0; }

/* баланс и оплата */
button.trial { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.bal { padding: 18px; border-radius: 20px; background: linear-gradient(135deg, rgba(200,255,61,.14), rgba(142,123,255,.08));
  border: 1px solid rgba(200,255,61,.28); margin-top: 14px; }
.bal .k { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.bal .v { font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 38px; margin: 4px 0; }
.bal .v span { font-size: 15px; color: var(--muted); font-weight: 600; }
.bal .s { font-size: 13px; color: var(--muted); }
.histbtn { margin-top: 12px; background: rgba(255,255,255,.07); border: 0; border-radius: 12px; padding: 9px 14px; font-weight: 700; font-size: 13px; }
.ops { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.op { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.op b { display: block; font-weight: 700; }
.op span { color: var(--muted); font-size: 11.5px; }
.op .plus { color: var(--lime); font-weight: 800; }
.op .minus { color: #FF8A95; font-weight: 800; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pack { position: relative; text-align: left; padding: 22px 10px 12px; border-radius: 16px; background: var(--surface);
  border: 1.5px solid var(--line); color: inherit; font: inherit; display: flex; flex-direction: column; gap: 4px; }
.pack.on { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(200,255,61,.12); }
.pack .hit { position: absolute; top: -9px; left: 8px; right: 8px; text-align: center; font-size: 10px; font-weight: 800; background: var(--lime);
  color: #0C0C10; border-radius: 10px; padding: 3px 0; }
.pack .pn { font-weight: 800; font-size: 14px; }
.pack .pt { font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 19px; }
.pack .pt span { display: block; font-family: 'Manrope', sans-serif; font-size: 11px; color: var(--muted); font-weight: 600; }
.pack .pa { font-size: 10.5px; line-height: 1.35; color: var(--muted); flex: 1; }
.pack .pp { font-weight: 800; font-size: 14px; margin-top: 6px; }
.field { width: 100%; box-sizing: border-box; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-size: 15px; }
.agree { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 4px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.agree input { width: 20px; height: 20px; accent-color: #C8FF3D; flex: none; margin: 0; }
.agree a { cursor: pointer; }

/* наборы шрифтов субтитров и их кнопки */
.fchips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 4px; }
.fchip { flex: none; height: 44px; padding: 0 16px; border-radius: 14px; background: var(--surface2); border: 1.5px solid var(--line);
  color: var(--text); font-size: 18px; line-height: 1; white-space: nowrap; }
.fchip.on { border-color: var(--lime); background: rgba(200,255,61,.10); color: var(--lime); }
.fchip.sm { font-size: 13.5px; font-weight: 800; height: 38px; font-family: 'Manrope', sans-serif; }
.cchip { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px 0 8px; border-radius: 14px;
  background: var(--surface2); border: 1.5px solid var(--line); color: var(--text); font-weight: 800; font-size: 13px; }
.cchip.on { border-color: var(--lime); }
.cchip i { width: 20px; height: 20px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255,255,255,.2); }

/* субтитры до монтажа: живой пример + выбор */
.capbox { display: flex; flex-direction: column; gap: 4px; }
.capprev { position: relative; width: 80%; max-width: 320px; margin: 0 auto 6px; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden;
  background: #000; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.capprev video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.capprev iframe { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; border: 0; transform-origin: 0 0; pointer-events: none; background: transparent; }
.capprev .cpnote { position: absolute; left: 8px; top: 8px; font-size: 10.5px; font-weight: 800; color: #fff; background: rgba(0,0,0,.45);
  padding: 3px 8px; border-radius: 8px; }
.toggles { display: flex; flex-direction: column; gap: 8px; }
.tog { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: 14px; }
.tog i { width: 40px; height: 24px; border-radius: 12px; background: var(--surface2); position: relative; flex: none; }
.tog i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #6E6E7C; transition: .2s; }
.tog.on i { background: var(--lime); }
.tog.on i::after { left: 19px; background: #0C0C10; }

.upcard .delup { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: rgba(12,12,16,.78);
  color: #fff; font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.18); z-index: 3; }

.tog span small { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.tog span { text-align: left; }

/* шрифты плитками и компактная панель субтитров в редакторе */
.ftile { flex: none; width: 62px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 5px; border-radius: 14px;
  background: var(--surface2); border: 1.5px solid var(--line); color: var(--text); }
.ftile b { font-size: 24px; line-height: 1.15; height: 30px; display: flex; align-items: center; }
.ftile span { font: 700 10px 'Manrope', sans-serif; color: var(--muted); white-space: nowrap; }
.ftile.on { border-color: var(--lime); color: var(--lime); }
.ftile.on span { color: var(--lime); }
.ctabs { display: flex; gap: 4px; background: var(--surface2); border-radius: 12px; padding: 3px; margin-bottom: 8px; }
.ctab { flex: 1; height: 30px; border-radius: 9px; background: transparent; border: 0; color: var(--muted); font: 800 12.5px 'Manrope', sans-serif; }
.ctab.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.crow { align-items: center; min-height: 52px; }
.crow .sw { flex: none; }

/* лента свёрнута до строки субтитров, пока открыта панель (видео крупнее) */
.tl.mini .tlin { height: 52px; }
.tl.mini .row.v, .tl.mini .row.g, .tl.mini .row.s { display: none; }
.tl.mini .row.c { top: 26px; }
