/* Студия — тёмный десктопный интерфейс */
:root {
  --bg: #0a0a0c;
  --side: #0d0d10;
  --s1: #121216;
  --s2: #16161b;
  --s3: #1d1d23;
  --s4: #26262e;
  --line: #1f1f25;
  --line2: #2c2c35;
  --text: #ededf0;
  --text2: #c9c9d1;
  --muted: #8c8c97;
  --accent: #c8f560;
  --accent-ink: #0a0a0c;
  --danger: #ff6b6b;
  --r: 14px;
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
  --logo: 'Unbounded', var(--font);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #26262e; border-radius: 10px; border: 2px solid var(--bg); }

/* ---------- каркас ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; flex: 0 0 248px;
  display: flex; flex-direction: column; gap: 2px; padding: 18px 14px;
  background: var(--side); border-right: 1px solid var(--line); overflow-y: auto; flex-basis: 256px;
}
.main { flex: 1; min-width: 0; position: relative; }

.logo { font-family: var(--logo); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; padding: 4px 10px 18px; display: block; }
.logo span { color: var(--accent); }
.side .new {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin-bottom: 14px;
  border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 800; border: 0;
  transition: transform .15s var(--ease), box-shadow .2s;
}
.side .new:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(200, 245, 96, .18); }
.side .new:active { transform: scale(.98); }
.side h6 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: 10px;
  color: var(--text2); font-weight: 500; background: transparent; border: 0; width: 100%; text-align: left; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav:hover { background: var(--s2); color: var(--text); }
.nav.on { background: var(--s3); color: var(--text); font-weight: 600; }
.nav svg { flex: none; }
.nav .count { margin-left: auto; color: var(--muted); font-size: 12px; }
.nav .badge { margin-left: auto; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); }

.wallet { margin-top: auto; padding: 14px; border-radius: var(--r); background: var(--s1); border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 10px; }
.wallet .row { display: flex; justify-content: space-between; align-items: baseline; }
.wallet .num { font-weight: 800; font-size: 18px; transition: color .3s; }
.wallet .num.flash { color: var(--accent); }
.wallet small { color: var(--muted); font-size: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; margin-top: 8px; border-radius: 12px; transition: background .15s; }
.user-chip:hover { background: var(--s2); }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--s4); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.user-chip .who { min-width: 0; }
.user-chip b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { color: var(--muted); font-size: 12px; }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--s3); color: var(--text); font-weight: 700; white-space: nowrap;
  transition: background .15s, transform .15s var(--ease), border-color .15s, opacity .15s;
}
.btn:hover { background: var(--s4); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: #d6ff7a; }
.btn.white { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--s2); }
.btn.lg { min-height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 40px; padding: 0; }
.btn.danger { color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 10px;
  background: var(--s1); border: 1px solid var(--line2); outline: none;
  transition: border-color .15s, background .15s;
}
.textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { border-color: #4a4a57; background: var(--s2); }
.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% - 16px) 17px, calc(100% - 11px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px;
  border-radius: 9px; border: 1px solid var(--line2); background: var(--s3); color: var(--text);
  font-weight: 600; font-size: 13px; transition: background .15s, border-color .15s, transform .1s;
}
.chip:hover { background: var(--s4); }
.chip.on { border-color: var(--accent); background: rgba(200, 245, 96, .1); color: var(--accent); }
.chip .dot { width: 9px; height: 9px; border-radius: 3px; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--s1); border: 1px solid var(--line2); }
.seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text2); font-weight: 600; font-size: 13px; transition: background .15s, color .15s; }
.seg button.on { background: var(--s4); color: var(--text); }
.seg button .c { color: var(--muted); font-weight: 500; margin-left: 4px; }

/* ---------- страницы ---------- */
.page { padding: 28px 36px 60px; max-width: 1400px; margin: 0 auto; animation: pagein .35s var(--ease); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 800; margin: 0 0 14px; }
.sub { color: var(--muted); margin: 4px 0 0; }
.muted { color: var(--muted); }

/* главный ввод на стартовой */
.hero { padding: 48px 0 36px; text-align: center; }
.hero h1 { font-size: 40px; letter-spacing: -0.03em; }
.hero p { color: var(--muted); font-size: 16px; margin: 10px 0 28px; }
.hero { padding-top: 36px; }
.tools-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.composer {
  max-width: 860px; margin: 0 auto; padding: 14px; border-radius: 18px; text-align: left;
  background: var(--s2); border: 1px solid var(--line2); box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; gap: 12px; transition: border-color .2s, box-shadow .2s;
}
.composer:focus-within { border-color: #3d3d48; box-shadow: 0 24px 70px rgba(0, 0, 0, .55), 0 0 0 4px rgba(200, 245, 96, .06); }
.composer textarea { width: 100%; min-height: 56px; max-height: 220px; resize: none; border: 0; outline: none; background: transparent; font-size: 16px; line-height: 1.5; padding: 6px 4px; }
.composer .bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.composer .bar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.composer .cost { color: var(--text2); font-weight: 600; white-space: nowrap; }
.attach {
  flex: none; width: 52px; height: 52px; border-radius: 12px; border: 1px dashed #3a3a45; background: transparent;
  display: grid; place-items: center; color: var(--muted); overflow: hidden; transition: border-color .15s, color .15s;
}
.attach:hover { border-color: var(--accent); color: var(--accent); }
.attach img { width: 100%; height: 100%; object-fit: cover; }
.examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.examples button { border: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 4px 8px; border-radius: 8px; transition: color .15s, background .15s; }
.examples button:hover { color: var(--text); background: var(--s2); }

/* карточки выбора на главной: 2 крупные + ряд маленьких */
#launch { max-width: 1040px; margin: 0 auto 22px; text-align: left; }
.launch-big { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.launch-small { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.lcard {
  position: relative; overflow: hidden; border-radius: 20px; border: 1px solid var(--line2); background: var(--s1);
  color: var(--text); text-align: left; padding: 0; cursor: pointer;
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s;
}
.lcard:hover { transform: translateY(-3px); box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
.lcard.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200, 245, 96, .15), 0 18px 50px rgba(0, 0, 0, .5); }
.lcard.big { height: 300px; display: flex; align-items: flex-end; }
.lcard.big video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform .6s var(--ease); }
.lcard.big:hover video { transform: scale(1.07); }
.lcard .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,10,12,0) 25%, rgba(10,10,12,.55) 60%, rgba(10,10,12,.95)); }
.lcard.big .body { position: relative; padding: 22px 24px; width: 100%; }
.lcard .ttl { display: flex; align-items: center; gap: 10px; }
.lcard .ttl b { font-family: Unbounded, Manrope, sans-serif; font-size: 26px; letter-spacing: -0.02em; }
.lcard .ttl .badge { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: var(--accent); color: #0a0a0c; }
.lcard.big p { margin: 8px 0 12px; color: var(--text2); font-size: 15px; max-width: 420px; }
.lcard .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lcard .tags span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.08); backdrop-filter: blur(6px); color: var(--text2); }
.lcard .go { position: absolute; top: 18px; right: 18px; display: inline-flex; gap: 6px; align-items: center; font-weight: 700; font-size: 13px;
  padding: 8px 14px; border-radius: 999px; background: rgba(10,10,12,.55); backdrop-filter: blur(8px); opacity: 0; transform: translateY(-4px); transition: .2s; }
.lcard:hover .go, .lcard.on .go { opacity: 1; transform: none; }
.lcard.on .go { background: var(--accent); color: #0a0a0c; }
.lcard.small { display: flex; align-items: center; gap: 14px; padding: 12px; height: 96px; }
.lcard.small .thumb { flex: none; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--s3); display: grid; place-items: center; color: var(--muted); }
.lcard.small .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.lcard.small:hover .thumb img { transform: scale(1.08); }
.lcard.small .body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lcard.small b { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.lcard.small small { color: var(--muted); font-size: 13px; line-height: 1.35; }
@media (max-width: 860px) {
  .launch-big, .launch-small { grid-template-columns: 1fr; }
  .lcard.big { height: 220px; }
}

/* тарифы в кабинете */
.pay-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 16px; background: var(--s2); border: 1px solid var(--line2); }
.plan.popular { border-color: var(--accent); background: linear-gradient(180deg, rgba(200,245,96,.08), var(--s2) 60%); }
.plan.current { box-shadow: 0 0 0 2px rgba(200,245,96,.35) inset; }
.plan .ribbon { position: absolute; top: -10px; left: 20px; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 6px; background: var(--accent); color: #0a0a0c; }
.plan .name { font-weight: 700; color: var(--text2); }
.plan .price { font-family: Unbounded, Manrope, sans-serif; font-size: 28px; letter-spacing: -0.02em; }
.plan .price small { font-family: Manrope, sans-serif; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.plan .cr b { color: var(--accent); }
.plan .btn { margin-top: auto; }
.extra { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .plans { grid-template-columns: 1fr; } }

/* сетка проектов */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pcard {
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--s1); border: 1px solid var(--line);
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s;
}
.pcard:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: 0 16px 40px rgba(0, 0, 0, .4); }
.pcard .cover { position: relative; aspect-ratio: 4 / 5; background: var(--s2); overflow: hidden; display: grid; place-items: center; color: var(--muted); }
.pcard .cover video, .pcard .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.pcard:hover .cover video, .pcard:hover .cover img { transform: scale(1.04); }
.pcard .tag { position: absolute; left: 10px; top: 10px; z-index: 1; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 7px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(6px); }
.pcard .live { position: absolute; right: 10px; top: 10px; z-index: 1; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 7px; background: rgba(0, 0, 0, .6); }
.pcard .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; }
.pcard .info { padding: 12px 14px; }
.pcard b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard small { color: var(--muted); font-size: 12px; }
.empty { border: 1px dashed var(--line2); border-radius: 16px; padding: 40px; text-align: center; color: var(--muted); }

/* ---------- экран проекта ---------- */
.project { display: flex; min-height: 100vh; }
.feed-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ptop { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: rgba(10, 10, 12, .85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.ptop .title { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptop .kind { color: var(--muted); font-size: 13px; }
.feed { flex: 1; padding: 24px 28px 260px; display: flex; flex-direction: column; gap: 22px; max-width: 980px; width: 100%; margin: 0 auto; }
.step { animation: rise .45s var(--ease) both; }
.step .head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.step .label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--s3); color: var(--text2); }
.step .label.video { background: rgba(200, 245, 96, .12); color: var(--accent); }
.step .prompt { color: var(--text); font-weight: 600; }
.step .meta { color: var(--muted); font-size: 12px; margin-left: auto; }
.frames { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.frame { position: relative; border-radius: 12px; overflow: hidden; background: var(--s2); border: 2px solid transparent; aspect-ratio: var(--ar, 9 / 16); transition: border-color .2s, transform .25s var(--ease); }
.frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame:hover { transform: translateY(-2px); border-color: var(--line2); }
.frame.picked { border-color: var(--accent); }
.frame .over { position: absolute; inset: auto 8px 8px 8px; display: flex; flex-direction: column; gap: 6px; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s var(--ease); }
.frame:hover .over, .frame:focus-within .over { opacity: 1; transform: none; }
.frame .over .btn { width: 100%; }
.player { position: relative; border-radius: 16px; overflow: hidden; background: #000; border: 1px solid var(--line); display: flex; justify-content: center; max-height: 640px; }
.player video, .player img { display: block; max-width: 100%; max-height: 640px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pending { border-radius: 16px; border: 1px solid var(--line2); background: var(--s1); padding: 18px; display: flex; gap: 16px; align-items: center; }
.pending .sk { display: grid; grid-template-columns: repeat(4, 46px); gap: 6px; }
.pending .sk i, .skel { display: block; height: 70px; border-radius: 8px; background: linear-gradient(90deg, var(--s2) 0%, var(--s4) 50%, var(--s2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.pending .sk.one { grid-template-columns: 46px; }
.bar-ind { height: 4px; border-radius: 4px; background: var(--s3); overflow: hidden; margin-top: 10px; width: 260px; max-width: 100%; }
.bar-ind i { display: block; height: 100%; width: 35%; border-radius: 4px; background: var(--accent); animation: slide 1.3s ease-in-out infinite; }
.failed { border-radius: 14px; border: 1px solid #3a2525; background: #1a1112; padding: 14px 16px; color: #ffb3b3; }

.dock { position: fixed; bottom: 0; z-index: 6; padding: 0 28px 22px; pointer-events: none; }
.dock .composer { pointer-events: auto; max-width: 900px; }

.memory { flex: 0 0 330px; border-left: 1px solid var(--line); background: var(--side); padding: 20px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.memory h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.memory .hint { color: var(--muted); font-size: 12px; margin: -8px 0 0; }
.memory .styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.memory .styles .chip { justify-content: flex-start; }
.scenes { display: flex; flex-direction: column; gap: 6px; }
.scenes div { padding: 8px 10px; border-radius: 9px; background: var(--s2); font-size: 13px; color: var(--text2); }
.saved { color: var(--accent); font-size: 12px; font-weight: 700; opacity: 0; transition: opacity .3s; }
.saved.show { opacity: 1; }

/* ---------- кабинет ---------- */
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.card { background: var(--s1); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.card + .card { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 14px; border-radius: 12px; background: var(--s2); }
.stat b { display: block; font-size: 22px; font-weight: 800; }
.stat small { color: var(--muted); }
.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pack { text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--line2); background: var(--s2); display: flex; flex-direction: column; gap: 4px; transition: border-color .2s, transform .2s var(--ease), background .2s; }
.pack:hover { transform: translateY(-2px); border-color: #45454f; }
.pack.popular { border-color: var(--accent); }
.pack .name { font-weight: 800; }
.pack .cr { font-size: 24px; font-weight: 800; }
.pack .price { margin-top: 8px; font-weight: 700; color: var(--accent); }
.pack small { color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line2); }
.table td { padding: 9px 6px; border-bottom: 1px solid var(--line); }
.plus { color: var(--accent); font-weight: 700; }
.minus { color: var(--text2); }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--s2); border: 1px solid var(--line2); color: var(--text2); }
.notice.warn { border-color: #4a3b1a; background: #1c170c; color: #ffd98a; }
.error-msg { color: var(--danger); font-weight: 600; font-size: 13px; min-height: 18px; }

/* ---------- всплывающие окна и уведомления ---------- */
.overlay { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .2s ease; }
.dialog { width: 100%; max-width: 440px; background: var(--s1); border: 1px solid var(--line2); border-radius: 18px; padding: 24px; animation: pop .3s var(--ease); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; border-radius: 12px; background: var(--s3); border: 1px solid var(--line2); box-shadow: 0 12px 30px rgba(0, 0, 0, .4); display: flex; gap: 10px; align-items: center; animation: toastin .35s var(--ease); }
.toast.ok svg { color: var(--accent); }
.toast.err svg { color: var(--danger); }
.toast.out { animation: toastout .3s ease forwards; }

/* ---------- анимации ---------- */
@keyframes pagein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(310%); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.8); } }
@keyframes toastin { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateX(30px); } }
.rise { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- узкие экраны ---------- */
@media (max-width: 1100px) {
  .memory { display: none; }
  .memory.open { display: flex; position: fixed; right: 0; top: 0; z-index: 20; box-shadow: -20px 0 50px rgba(0, 0, 0, .5); }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { position: static; height: auto; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
  .side h6, .side .navs, .user-chip { display: none; }
  .side .logo { padding: 6px; }
  .side .new { margin: 0 0 0 auto; padding: 0 14px; }
  .wallet { margin: 0; padding: 8px 10px; flex-direction: row; align-items: center; }
  .wallet .btn { display: none; }
  .page { padding: 20px 16px 40px; }
  .hero h1 { font-size: 28px; }
  .frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dock { left: 0 !important; right: 0 !important; padding: 0 10px 10px; }
  .feed { padding: 16px 14px 300px; }
  .packs, .stats { grid-template-columns: 1fr; }
}

/* меню выбора */
.menu-pop { position: fixed; z-index: 50; min-width: 200px; padding: 6px; border-radius: 12px; background: var(--s3); border: 1px solid var(--line2); box-shadow: 0 18px 40px rgba(0, 0, 0, .5); display: flex; flex-direction: column; animation: pop .18s var(--ease); }
.menu-pop button { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; font-weight: 600; }
.menu-pop button:hover { background: var(--s4); }
.menu-pop button.on { color: var(--accent); }
.voice-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--s1); border: 1px solid var(--line2); animation: rise .25s var(--ease); }
.voice-row input { flex: 1; border: 0; outline: none; background: transparent; }

/* ---------- редактор ---------- */
.ed { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; }
.ed-top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.ed-top .title { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-top .kind { color: var(--muted); font-size: 12px; }
.ed-body { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; min-height: 0; }
.ed-lib { border-right: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.lib-list { overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.lib-item { padding: 0; border: 0; background: transparent; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.lib-item .th { position: relative; border-radius: 10px; overflow: hidden; background: var(--s2); border: 1px solid var(--line2); transition: border-color .15s, transform .2s var(--ease); }
.lib-item .th video, .lib-item .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-item .add { position: absolute; right: 6px; bottom: 6px; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; opacity: 0; transform: scale(.8); transition: opacity .15s, transform .15s; }
.lib-item:hover .th { border-color: var(--accent); transform: translateY(-2px); }
.lib-item:hover .add { opacity: 1; transform: none; }
.lib-item .cap { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-stage { display: grid; place-items: center; padding: 20px; min-height: 0; background: #070708; }
.stage { position: relative; height: 100%; max-height: 100%; max-width: 100%; background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.stage video, .stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); font-size: 13px; }
.ov { position: absolute; left: 4%; right: 4%; text-align: center; margin: 0 auto; width: fit-content; max-width: 92%; padding: .4em .7em; border-radius: .4em; background: rgba(10, 10, 12, .72); color: #fff; font-weight: 800; font-size: clamp(12px, 3.6cqh, 26px); line-height: 1.25; animation: pop .25s var(--ease); }
.stage { container-type: size; }
.ov { font-size: 6cqmin; padding: .4em .6em; }
.ov[data-pos="top"] { top: 8%; }
.ov[data-pos="center"] { top: 50%; transform: translateY(-50%); }
.ov[data-pos="bottom"] { bottom: 8%; }
.ed-insp { border-left: 1px solid var(--line); background: var(--side); padding: 16px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.ed-insp h2 { margin: 0; }
.ed-insp input[type=range] { width: 100%; accent-color: var(--accent); }
.toggle { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.renders { display: flex; flex-direction: column; gap: 8px; }
.render { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border-radius: 10px; background: var(--s2); border: 1px solid var(--line2); animation: rise .3s var(--ease); }
.render b { display: block; font-size: 13px; }
.render small { font-size: 12px; }
.render .bar-ind i { transition: width .4s var(--ease); }
.ed-tl { border-top: 1px solid var(--line); background: var(--side); padding: 12px 20px 14px; overflow-x: auto; }
.tl-row { display: flex; gap: 6px; min-height: 92px; align-items: stretch; }
.tl-empty { color: var(--muted); font-size: 13px; display: grid; place-items: center; width: 100%; border: 1px dashed var(--line2); border-radius: 10px; }
.clip { position: relative; flex: none; height: 92px; border-radius: 10px; overflow: hidden; background: var(--s2); border: 2px solid var(--line2); cursor: grab; transition: border-color .15s, transform .15s var(--ease), opacity .15s; animation: rise .3s var(--ease); }
.clip video, .clip img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.clip.sel { border-color: var(--accent); }
.clip.dragging { opacity: .4; }
.clip.over { transform: translateX(6px); border-color: var(--text2); }
.clip-meta { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 4px 6px; font-size: 11px; font-weight: 700; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); }
.clip-meta b { background: rgba(0, 0, 0, .6); border-radius: 5px; padding: 0 5px; }
.mute-tag { color: #ffb3b3; }
.tl-music { margin-top: 8px; min-height: 30px; }
.music-bar { height: 30px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 8px; background: rgba(200, 245, 96, .1); border: 1px solid rgba(200, 245, 96, .3); color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; }
@media (max-width: 1100px) { .ed-body { grid-template-columns: 200px minmax(0, 1fr) 260px; } }

/* документы и согласия */
.main { display: flex; flex-direction: column; }
#app { flex: 1; }
.site-foot { border-top: 1px solid var(--line); padding: 18px 36px 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; font-size: 12.5px; color: var(--muted); }
.site-foot .links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot a { color: var(--muted); text-decoration: none; } .site-foot a:hover { color: var(--text); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text2); line-height: 1.45; cursor: pointer; }
.check input { flex: none; width: 17px; height: 17px; margin-top: 1px; accent-color: var(--accent); }
.check a, .consent-row a, .legal-note a { color: var(--accent); }
.check.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.consent-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text2); padding: 10px 12px; border-radius: 10px; background: rgba(200,245,96,.06); border: 1px solid rgba(200,245,96,.18); }
.consent-row input { flex: none; width: 17px; height: 17px; margin-top: 1px; accent-color: var(--accent); }
.legal-note { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0 0; }

/* мои шаблоны */
.bar-ind.fix i { animation: none; transition: width .4s var(--ease); }
.upl { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: stretch; }
.drop { display: grid; place-items: center; min-height: 240px; border: 1.5px dashed var(--line2); border-radius: 16px; background: var(--s2); cursor: pointer; transition: border-color .15s, background .15s; overflow: hidden; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(200,245,96,.05); }
.drop-in { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); padding: 16px; }
.drop-in b { color: var(--text); }
.drop-in video { max-height: 200px; max-width: 100%; border-radius: 10px; }
.upl-side { justify-content: center; }
.upl-go { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.tcard { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--s1); border: 1px solid var(--line); transition: transform .25s var(--ease), border-color .2s, box-shadow .25s; }
.tcard:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.tcard .cover { position: relative; aspect-ratio: 4 / 5; background: var(--s2); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.tcard .cover img { width: 100%; height: 100%; object-fit: cover; }
.tcard .tag { position: absolute; left: 10px; bottom: 10px; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 7px; background: rgba(0,0,0,.65); backdrop-filter: blur(6px); }
.tcard .tag.err { color: #ffb3b3; top: 10px; bottom: auto; }
.tcard .live { position: absolute; right: 10px; top: 10px; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 7px; background: rgba(0,0,0,.65); }
.tcard .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; }
.tcard .info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.tcard .info small { color: var(--muted); font-size: 12.5px; }
.analyzing { display: flex; gap: 20px; align-items: center; max-width: 720px; margin: 40px auto; }
.analyzing img { width: 120px; border-radius: 12px; flex: none; }
.tpl-top { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.tpl-thumb { width: 140px; border-radius: 12px; float: left; margin: 0 16px 8px 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; clear: both; }
.facts small, .char small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.facts b { font-weight: 600; font-size: 14px; }
.chars { display: flex; gap: 10px; flex-wrap: wrap; }
.char { flex: 1 1 180px; padding: 10px 12px; border-radius: 12px; background: var(--s2); border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--text2); }
.char b { color: var(--text); }
.est { display: flex; justify-content: space-between; gap: 12px; padding: 14px; border-radius: 12px; background: var(--s2); border: 1px solid var(--line2); }
.est.best { border-color: var(--accent); background: linear-gradient(180deg, rgba(200,245,96,.07), var(--s2)); }
.est small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.est-r { text-align: right; white-space: nowrap; }
.est-r b { font-size: 17px; }
.acts { display: flex; gap: 4px; }
.act { min-width: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--c) 14%, var(--s2)); border-top: 3px solid var(--c); }
.act b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act small { color: var(--muted); font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shots { display: flex; flex-direction: column; }
.shot { display: grid; grid-template-columns: 34px 64px 86px 1fr; gap: 12px; align-items: start; padding: 12px 4px; border-top: 1px solid var(--line); }
.shot:first-child { border-top: 0; }
.shot .sn { font-weight: 800; color: var(--muted); }
.shot .st { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.shot .st small { display: block; color: var(--muted); font-weight: 500; }
.kind { justify-self: start; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--s3); color: var(--text2); }
.kind.video { background: rgba(200,245,96,.14); color: var(--accent); }
.sd { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13.5px; }
.sd small { color: var(--muted); }
.sd q { color: var(--text2); font-style: italic; }
.sd code { font: 12px/1.45 ui-monospace, monospace; color: var(--muted); background: var(--s2); padding: 6px 8px; border-radius: 8px; white-space: pre-wrap; }
@media (max-width: 1000px) { .upl, .tpl-top { grid-template-columns: 1fr; } .acts { flex-direction: column; } .act { flex: auto !important; } }

/* раскадровка в проекте */
.board { margin: 0 0 18px; border-radius: 16px; border: 1px solid var(--line2); background: var(--s1); }
.board-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; flex-wrap: wrap; }
.board-head h3 { margin: 0; font-size: 15px; }
.board-head .muted { font-size: 13px; }
.board-head .right { margin-left: auto; display: flex; gap: 8px; }
.board-list { max-height: 420px; overflow-y: auto; border-top: 1px solid var(--line); }
.brow { display: grid; grid-template-columns: 28px 54px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.brow:first-child { border-top: 0; }
.brow .bp { min-width: 0; }
.brow .bp span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.brow .bp q { display: block; color: var(--muted); font-style: italic; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow .bb { display: flex; gap: 6px; }
.brow.done { opacity: .55; }

/* партнёрская программа */
.pt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pt-join { display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; align-items: end; margin-top: 16px; }
.pt-join .check { grid-column: 1 / -1; }
.pt-link, .pt-pay { display: flex; gap: 8px; margin-top: 14px; }
.pt-link .input, .pt-pay .input { flex: 1; }
.pt-stats { grid-template-columns: repeat(6, 1fr) !important; margin-top: 14px; }
@media (max-width: 1000px) { .pt-stats { grid-template-columns: repeat(3, 1fr) !important; } .pt-join { grid-template-columns: 1fr; } }
