:root {
  --bg: #0b0b0f;
  --bg-2: #121218;
  --card: #18181f;
  --card-2: #20202a;
  --line: #2a2a35;
  --text: #f4f4f6;
  --muted: #9a9aa8;
  --dim: #6b6b78;
  --accent: #ff2d55;
  --accent-2: #ff6a3d;
  --accent-soft: rgba(255, 45, 85, .14);
  --gold: #ffcc33;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h1 { font-size: clamp(28px, 5vw, 52px); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px;
  padding: 12px max(16px, calc((100vw - 1200px) / 2)); background: rgba(11, 11, 15, .85);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--grad); font-size: 13px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--card); }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.credits-pill { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.credits-pill b { color: var(--gold); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); font-weight: 700; cursor: pointer; border: 1px solid var(--line); }

.app { max-width: 1200px; margin: 0 auto; padding: 24px 16px 96px; min-height: 70vh; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600;
  cursor: pointer; transition: transform .08s, background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: var(--card-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: transparent; color: white; }
.btn.primary:hover { background: #ff4a6c; }
.btn.grad { background: var(--grad); border-color: transparent; color: white; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.lg { padding: 15px 26px; font-size: 17px; border-radius: 16px; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.pill { border-radius: 99px; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-2); outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 90px; }
.field { margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.spacer { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card);
  cursor: pointer; font-size: 14px; font-weight: 500; user-select: none; transition: all .12s;
}
.chip:hover { border-color: #444452; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: #ff8aa2; }

.segmented { display: inline-flex; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; gap: 4px; flex-wrap: wrap; }
.segmented button { padding: 8px 14px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; color: var(--muted); font-weight: 600; }
.segmented button.on { background: var(--card-2); color: var(--text); }

input[type=range] { width: 100%; accent-color: var(--accent); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.card.flat { background: var(--bg-2); }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; border: 1.5px solid currentColor; font-size: 13px; font-weight: 600; }
.badge.draft { color: var(--text); }
.badge.live { color: var(--ok); }
.tag { display: inline-block; padding: 3px 9px; border-radius: 7px; background: var(--card-2); font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- landing ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 40px 0 56px; }
.hero p.lead { font-size: 18px; color: var(--muted); margin: 18px 0 28px; max-width: 560px; }
.hero-phones { position: relative; height: 520px; }
.phone {
  position: absolute; width: 230px; aspect-ratio: 9/16; border-radius: 26px; overflow: hidden;
  border: 6px solid #1d1d25; box-shadow: var(--shadow); background: var(--card-2);
}
.phone img { width: 100%; height: 100%; object-fit: cover; }
.phone .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 14px; background: linear-gradient(transparent, rgba(0,0,0,.85)); font-weight: 700; font-size: 14px; }
.phone:nth-child(1) { left: 0; top: 40px; transform: rotate(-6deg); }
.phone:nth-child(2) { left: 32%; top: 0; z-index: 2; }
.phone:nth-child(3) { right: 0; top: 60px; transform: rotate(6deg); }
.steps-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin: 8px 0 56px; }
.step-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 14px; }
.step-card .num { width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: #ff8aa2; display: grid; place-items: center; font-weight: 800; margin-bottom: 10px; }
.step-card h4 { font-size: 15px; margin-bottom: 4px; }
.step-card p { font-size: 13px; color: var(--muted); }
.section { margin: 56px 0; }
.section > h2 { margin-bottom: 18px; }
.feature { padding: 22px; }
.feature .ico { font-size: 26px; margin-bottom: 10px; }
.feature p { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* ---------- studio list ---------- */
.series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.series-card { cursor: pointer; }
.series-card .poster {
  position: relative; aspect-ratio: 3/4; border-radius: 16px; overflow: hidden; background: var(--card);
  border: 1px solid var(--line); display: grid; place-items: center;
}
.series-card .poster img { width: 100%; height: 100%; object-fit: cover; }
.series-card .poster .stage { position: absolute; top: 10px; left: 10px; }
.series-card h3 { margin-top: 10px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.series-card .meta { color: var(--muted); font-size: 13px; }
.progress { height: 5px; border-radius: 99px; background: var(--card-2); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: var(--grad); }
.new-card .poster { border: 2px dashed #34343f; background: transparent; color: var(--muted); font-weight: 600; text-align: center; }
.new-card .poster .plus { font-size: 44px; color: var(--accent); line-height: 1; }
.placeholder-icon { width: 56px; height: 56px; opacity: .25; }

/* ---------- wizard ---------- */
.wizard { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.wizard-steps { display: flex; gap: 8px; margin-bottom: 18px; }
.wizard-steps span { flex: 1; height: 4px; border-radius: 99px; background: var(--card-2); }
.wizard-steps span.on { background: var(--grad); }
.idea-card { cursor: pointer; transition: border-color .15s; }
.idea-card:hover, .idea-card.on { border-color: var(--accent); }
.idea-card h4 { margin-bottom: 6px; }
.idea-card p { font-size: 14px; color: var(--muted); }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.style-opt { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; font-weight: 600; font-size: 14px; text-align: center; }
.style-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.summary-box { position: sticky; top: 84px; }
.summary-box dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 14px 0; font-size: 14px; }
.summary-box dt { color: var(--muted); }
.summary-box dd { margin: 0; text-align: right; font-weight: 600; }
.cost-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 16px; }
.cost-total b { font-size: 24px; color: var(--gold); }
.slider-value { font-size: 32px; font-weight: 800; }

/* ---------- series page ---------- */
.series-head { display: grid; grid-template-columns: 150px 1fr; gap: 22px; margin-bottom: 22px; }
.series-head .poster { aspect-ratio: 3/4; border-radius: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; }
.series-head .poster img { width: 100%; height: 100%; object-fit: cover; }
.series-head h1 { font-size: clamp(24px, 4vw, 34px); }
.series-head .count { color: var(--muted); margin: 6px 0 12px; }
.synopsis { color: #c9c9d3; margin-top: 14px; }
.synopsis.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.link-btn { background: none; border: 0; color: var(--text); font-weight: 600; cursor: pointer; padding: 0; }

.pipeline { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 20px; scrollbar-width: none; }
.pipeline a {
  flex: 1 0 auto; min-width: 104px; display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--muted);
}
.pipeline a .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--card-2); flex: none; }
.pipeline a.done { color: var(--text); }
.pipeline a.done .dot { background: var(--ok); color: #062; }
.pipeline a.current { border-color: var(--accent); color: var(--text); }
.pipeline a.current .dot { background: var(--accent); color: white; }

.busy-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid rgba(255, 45, 85, .35); margin-bottom: 18px; font-weight: 500; }
.error-bar { padding: 12px 16px; border-radius: 14px; background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .35); margin-bottom: 18px; font-size: 14px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.2); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.ep { cursor: pointer; }
.ep .tile {
  position: relative; aspect-ratio: 3/4; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; overflow: hidden; transition: border-color .15s, transform .15s;
}
.ep:hover .tile { border-color: #44444f; transform: translateY(-2px); }
.ep .tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep .tile .plus { font-size: 32px; color: var(--dim); }
.ep .tile .status { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 10px 10px; text-align: center; font-size: 13px; font-weight: 600; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.ep .tile .center-label { color: var(--dim); font-size: 13px; text-align: center; padding: 0 8px; }
.ep .name { margin-top: 8px; font-weight: 500; }
.ep .sub { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-script { color: var(--gold); }
.st-video { color: #7dd3fc; }
.st-approved { color: var(--ok); }
.st-busy { color: #ff8aa2; }
.bulk { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.outline-item { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.outline-item .n { width: 40px; height: 40px; border-radius: 12px; background: var(--card-2); display: grid; place-items: center; font-weight: 800; }
.outline-item .input { margin-top: 6px; }

.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.cast-card { overflow: hidden; padding: 0; }
.cast-card .portrait { aspect-ratio: 3/4; background: var(--card-2); display: grid; place-items: center; position: relative; }
.cast-card .portrait img { width: 100%; height: 100%; object-fit: cover; }
.cast-card .portrait .role { position: absolute; left: 12px; bottom: 12px; }
.cast-card .body { padding: 14px; }
.cast-card textarea { min-height: 96px; font-size: 13px; }
.initials { font-size: 54px; font-weight: 800; color: #3a3a46; }

.publish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- episode page ---------- */
.episode-layout { display: grid; grid-template-columns: 340px 1fr; gap: 26px; align-items: start; }
.player { position: sticky; top: 84px; }
.player .screen { aspect-ratio: 9/16; border-radius: 22px; overflow: hidden; background: #000; border: 1px solid var(--line); display: grid; place-items: center; }
.player .screen video, .player .screen img { width: 100%; height: 100%; object-fit: cover; }
.player .screen .empty { color: var(--dim); text-align: center; padding: 24px; }
.storyboard { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.storyboard img { aspect-ratio: 9/16; object-fit: cover; border-radius: 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { padding: 10px 14px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.shot { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); margin-bottom: 12px; }
.shot .thumb { aspect-ratio: 9/16; border-radius: 9px; background: var(--card-2); overflow: hidden; display: grid; place-items: center; color: var(--dim); font-weight: 800; }
.shot .thumb img { width: 100%; height: 100%; object-fit: cover; }
.shot .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot .input { padding: 9px 11px; font-size: 14px; }
.shot textarea.input { min-height: 60px; }
.line-row { display: grid; grid-template-columns: 130px 1fr 120px 34px; gap: 8px; margin-top: 8px; }
.icon-btn { width: 34px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; color: var(--muted); }
.score-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.score { text-align: center; padding: 14px 8px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.score b { display: block; font-size: 28px; }
.score.good b { color: var(--ok); } .score.mid b { color: var(--warn); } .score.low b { color: var(--bad); }
.fixes li { margin-bottom: 6px; color: #d4d4dc; }
.copy-box { white-space: pre-wrap; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 14px; }
.ep-nav { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- watch ---------- */
.watch { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 28px; align-items: start; }
.watch .screen { aspect-ratio: 9/16; border-radius: 22px; overflow: hidden; background: #000; position: relative; }
.watch .screen video { width: 100%; height: 100%; object-fit: cover; }
.lock-screen { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 30px; background: rgba(0,0,0,.75); backdrop-filter: blur(6px); }
.lock-screen .lock { font-size: 44px; margin-bottom: 10px; }
.ep-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.ep-list button { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; position: relative; }
.ep-list button.on { background: var(--accent); border-color: transparent; }
.ep-list button.locked { color: var(--dim); }
.ep-list button.locked::after { content: "🔒"; position: absolute; top: 2px; right: 4px; font-size: 10px; }
.cast-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.cast-row .c { width: 76px; flex: none; text-align: center; font-size: 12px; }
.cast-row img, .cast-row .ph { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; background: var(--card-2); margin-bottom: 6px; }

/* ---------- pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.plan { display: flex; flex-direction: column; gap: 14px; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); position: relative; }
.plan.featured::before { content: "Most popular"; position: absolute; top: -12px; left: 20px; background: var(--grad); padding: 3px 12px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.plan .price { font-size: 40px; font-weight: 800; }
.plan .price small { font-size: 15px; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; flex: 1; }
.plan li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: 8px; }

/* ---------- auth & misc ---------- */
.auth { max-width: 420px; margin: 40px auto; }
.auth h2 { margin-bottom: 6px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .big { font-size: 46px; margin-bottom: 12px; }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #26262f; border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow);
  transition: all .25s; z-index: 50; max-width: calc(100vw - 32px); font-weight: 500;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(248, 113, 113, .6); }
.sticky-cta { position: sticky; bottom: 16px; margin-top: 24px; z-index: 5; }
.sticky-cta .btn { box-shadow: 0 10px 30px rgba(255, 45, 85, .35); }
.sticky-cta .btn:disabled { display: none; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.table td:last-child { text-align: right; font-weight: 600; }
.plus-pos { color: var(--ok); } .minus { color: var(--muted); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 16px; }
  .hero-phones { height: 420px; }
  .phone { width: 180px; }
  .steps-strip { grid-template-columns: repeat(2, 1fr); }
  .wizard, .episode-layout, .watch, .publish-grid { grid-template-columns: 1fr; }
  .summary-box, .player { position: static; }
  .player .screen { max-width: 360px; margin: 0 auto; }
  .plans { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .topbar { gap: 10px; }
  .brand-name { display: none; }
  .nav a { padding: 8px 9px; font-size: 14px; }
  .series-head { grid-template-columns: 110px 1fr; gap: 14px; }
  .ep-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .series-grid { grid-template-columns: repeat(2, 1fr); }
  .shot { grid-template-columns: 1fr; }
  .shot .thumb { width: 74px; }
  .shot .grid { grid-template-columns: 1fr; }
  .line-row { grid-template-columns: 1fr 1fr; }
  .line-row .input:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .credits-pill span { display: none; }
}
