/* ═══════════════════════════════════════════════════════════════
   video-studio.css — OpenVexo Video Studio  v4
   Monochromatic cinematic palette — no purple
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[x-cloak] { display: none !important; }

:root {
  /* Dark palette — aligned with chat-workspace */
  --bg:       #161618;   /* chat --bg-page */
  --panel:    #111113;   /* chat --bg-sidebar */
  --panel-b:  #1c1c1f;   /* chat --bg-surface */
  --b:        rgba(255,255,255,.09);
  --b-h:      rgba(255,255,255,.18);
  --b-str:    #3e3e46;
  --sel:      rgba(255,255,255,.06);
  --sel-b:    rgba(255,255,255,.2);
  --t1:       #ffffff;   /* primary — Netflix-white */
  --t2:       #d4d4d8;   /* near-white secondary */
  --t3:       rgba(255,255,255,.66); /* readable tertiary */
  --t4:       rgba(255,255,255,.45); /* subdued but visible */

  /* Netflix-style red accent for studio elements */
  --r1:       #e50914;   /* Netflix-red 100% */
  --r2:       rgba(229,9,20,.85);
  --r3:       rgba(229,9,20,.55);
  --r4:       rgba(229,9,20,.25);
  --r-glow:   rgba(229,9,20,.35);
  --ok:       #ececee;
  --err:      #ef4444;
  --accent:   #60a5fa;   /* chat --accent */
  --left:     320px;
  --right:    260px;
  --hdr:      50px;

  /* Z-index hierarchy (Wave 1.3) — single source of truth */
  --z-side:        365;  /* studio left/right sidebars (Cinema overlay) */
  --z-reel-params: 367;  /* Cinema settings window */
  --z-modal:       389;  /* Storyboard Wizard, Director's Cut */
  --z-reel-draft:  393;  /* Floating AI-draft over dock */
  --z-clap:        394;  /* Cinema clapper drawer */
  --z-dock:        395;  /* Cinema bottom dock */
  --z-min-pill:    396;  /* Minimized window pill (always on top) */
  --z-modal-back:  600;  /* Modal backdrops */
  --z-soul:        700;  /* Soul picker (above all modals) */
  --z-splash:      800;  /* Mode-transition splash */
}
.light {
  --bg:       #f3f3f7;
  --panel:    #eaeaf0;
  --panel-b:  #ffffff;
  --b:        rgba(0,0,0,.08);
  --b-h:      rgba(0,0,0,.15);
  --b-str:    #b9b9c2;
  --sel:      rgba(0,0,0,.04);
  --sel-b:    rgba(0,0,0,.12);
  --t1:       #0a0a0a;
  --t2:       #27272a;
  --t3:       #52525b;
  --t4:       #71717a;
  --err:      #dc2626;
  --accent:   #2563eb;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--t1);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Root ────────────────────────────────────────────────────── */
.vs { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.vs-badge {
  font-size: 7.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: .05em;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.45);
}
/* Messages */
.vs-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.06) transparent;
}.vs-edit-ta {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1.5px solid var(--accent);
  border-radius: 12px 12px 4px 12px;
  padding: 10px 14px;
  color: var(--t1);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  font-family: inherit;
}
.vs-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}
.vs-player video { width: 100%; height: 100%; object-fit: contain; display: block; }
.vs-player-prog {
  height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height .15s;
  user-select: none;
}
.vs-player:hover .vs-player-prog { height: 8px; border-radius: 4px; }
.vs-player-prog-fill { height: 100%; background: #fff; width: 0%; border-radius: inherit; transition: width .1s; }
.vs-player-prog-thumb {
  position: absolute;
  top: 50%; left: 0%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.vs-player:hover .vs-player-prog-thumb { opacity: 1; }
/* Generating card */
.vs-gen-card {
  background: var(--panel);
  border: 1px solid var(--b);
  border-radius: 10px;
  padding: 16px 18px;
  max-width: 300px;
}

.vs-spin {
  width: 12px; height: 12px;
  border: 1.5px solid rgba(255,255,255,.1);
  border-top-color: var(--t2);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.vs-gen-prog-bar {
  height: 1px;
  background: rgba(255,255,255,.1);
  margin: 12px 0 10px;
  overflow: hidden;
}
.vs-gen-prog-fill {
  height: 100%;
  background: var(--t2);
  animation: prog 2.4s ease-in-out infinite;
}
@keyframes prog { 0%,100% { width:30%; } 50% { width:68%; } }

.vs-gen-steps { display: flex; flex-direction: column; gap: 4px; }
.vs-gen-step {
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--t4);
  transition: color .2s;
}
.vs-gen-step.done { color: var(--t2); }
.vs-gen-step.active { color: var(--t2); }.vs-img-zone:has(img) {
  border-style: solid;
  border-color: rgba(248,113,113,.5);
  background: rgba(248,113,113,.07);
}
.vs-pill {
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--b);
  background: none;
  color: var(--t2);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all .12s;
}
.vs-pill:hover { border-color: var(--b-h); color: var(--t1); }
.vs-pill.on { border-color: rgba(255,255,255,.28); color: var(--t1); background: var(--sel); }
/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  :root { --left: 240px; --right: 220px; }
  .vs-msgs { padding: 24px; }
}
@media (max-width: 640px) {  .vs-msgs { padding: 16px 14px; }}
.vs-proj-list {
  flex: 1;
  overflow-y: auto;
  padding: 5px 8px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.06) transparent;
}
.vs-proj-thumb {
  width: 56px;
  height: 34px;
  border-radius: 5px;
  overflow: hidden;
  background: #111;
  border: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vs-proj-title {
  font-size: 11.5px;
  color: var(--t1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.vs-proj-meta {
  font-size: 9px;
  color: var(--t4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}@keyframes vsFadeIn  { from { opacity: 0; } to   { opacity: 1; } }
@keyframes vsFadeOut { from { opacity: 1; } to   { opacity: 0; } }.vs-img-zone--end:not(:has(img)) .vs-frame-label-top {
  color: rgba(248,113,113,.65);
}/* End-frame slot slightly dimmer until filled */
.vs-img-zone--end:not(:has(img)) {
  border-style: dashed;
  opacity: .85;
}.vs-motion-zone:has(img),
.vs-motion-zone:has(video) {
  border-style: solid;
  border-color: rgba(248,113,113,.5);
  background: rgba(248,113,113,.07);
}
/* ── Director's Cut (parallel takes) ─────────────────────────── */
.vs-dc-models {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}
.vs-dc-takes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.vs-dc-take {
  background: #131316;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.vs-dc-take.done { border-color: rgba(74,222,128,.45); }
.vs-dc-take.busy { border-color: rgba(229,9,20,.55); }
.vs-dc-take.err { border-color: rgba(239,68,68,.5); }.vs-dc-take-pct {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255,210,210,.95);
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(229,9,20,.18);
}.vs-sb {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1100px, 95vw);
  height: min(720px, 92vh);
  z-index: var(--z-modal);       /* 389 — top of overlay stack except for Soul picker (z-soul) and splash */
  background: #0a0a0c;
  border: 1px solid rgba(229,9,20,.4);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .18s ease, height .18s ease, transform .18s ease, top .18s ease, left .18s ease;
}
.vs-sb.minimized {
  top: auto;
  left: auto;
  right: 22px;
  bottom: 22px;
  transform: none;
  width: 360px;
  height: 44px;
  z-index: 396;                /* above dock so it stays visible */
}.vs-sb-section { margin-bottom: 18px; }.vs-sb-lbl {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.vs-sb-hint {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--t3);
  letter-spacing: 0;
  text-transform: none;
}
.vs-sb-ta {
  width: 100%;
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
}
.vs-sb-ta:focus { outline: none; border-color: rgba(229,9,20,.55); }@keyframes vs-soul-pulse {
  0%, 100% { opacity: .55; transform: translate(0, 0); }
  50%      { opacity: .9;  transform: translate(8px, 4px); }
}.vs-sb-go {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--r1);
  border: 1px solid rgba(229,9,20,.7);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: filter .12s;
  letter-spacing: .03em;
}
.vs-sb-go:hover:not(:disabled) { background: #b00710; }
.vs-sb-go:disabled { opacity: .4; cursor: not-allowed; }
.vs-sb-aux {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 8px;
  background: rgba(229,9,20,.1);
  border: 1px solid rgba(229,9,20,.4);
  color: rgba(255,210,210,1);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.vs-sb-aux:hover:not(:disabled) { background: rgba(229,9,20,.2); color: #fff; }
.vs-sb-aux:disabled { opacity: .45; cursor: not-allowed; }@keyframes vsModeFade {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}@keyframes vsModeCard {
  0%   { transform: translateY(20px) scale(.92); opacity: 0; }
  25%  { transform: translateY(0)   scale(1);   opacity: 1; }
  75%  { transform: translateY(0)   scale(1);   opacity: 1; }
  100% { transform: translateY(-10px) scale(1.04); opacity: 0; }
}
/* Reel top-bar "В Студию" button */
.vs-reel-back {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: .02em;
}
.vs-reel-back:hover {
  background: rgba(229,9,20,.22);
  border-color: rgba(229,9,20,.55);
}

/* ── Film Reel mode — Netflix-flat cinematic ─────────────────── */
.vs-reel {
  position: fixed;
  inset: 0;
  z-index: 360;
  background: #000;          /* pure black, no gradient */
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease-out;
}
.vs-reel.open { opacity: 1; pointer-events: auto; }
/* In Cinema: sidebars float ABOVE the reel-bg but BELOW the dock so the
   prompt input is always reachable. Backdrop click dismisses sidebar. */
/* In Cinema, sidebars escape their vs-body parent and become fixed overlays.
   This is required because vs-body has no z-index (static), so z-index on
   .vs-left/.vs-right only counts inside vs-body — they can't sit above
   .vs-reel (z:360) without becoming fixed. */
body:has(.vs-reel.open) .vs-left {
  position: fixed !important;
  top: 56px;
  left: 0;
  bottom: 0;
  max-height: calc(100vh - 56px);
  z-index: 365;
  box-shadow: 8px 0 32px rgba(0,0,0,.7);
  border-radius: 0 8px 8px 0;
  overflow: hidden;
  transition: transform .15s ease-out, max-height .25s ease-out;
}
body:has(.vs-reel.open) .vs-right {
  position: fixed !important;
  top: 56px;
  right: 0;
  bottom: 0;
  max-height: calc(100vh - 56px);
  z-index: 365;
  box-shadow: -8px 0 32px rgba(0,0,0,.7);
  border-radius: 8px 0 0 8px;
  overflow: hidden;
  transition: transform .15s ease-out, max-height .25s ease-out;
}
/* Minimized state — collapse body, keep window chrome (32px) */
body:has(.vs-reel.open) .vs-left.minimized {
  max-height: 32px;
  min-height: 32px;
  overflow: hidden;
}
body:has(.vs-reel.open) .vs-right.minimized {
  max-height: 32px;
  min-height: 32px;
  overflow: hidden;
}

/* Window chrome inside studio sidebars while in Cinema */
.vs-reel-winbar {
  display: none;
  align-items: center;
  gap: 11px;
  height: 32px;
  padding: 0 12px;
  background: #131316;
  border-bottom: 1px solid rgba(255,255,255,.08);
  cursor: move;
  user-select: none;
  flex-shrink: 0;
  touch-action: none;       /* let _attachDrag handle the gesture without browser scroll */
}/* Reel backdrop — appears when any sidebar is open in Cinema so click dismisses */
.vs-reel-sidebar-back {
  position: fixed;
  inset: 52px 0 0 0;       /* below top-bar */
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
  z-index: 364;
}
.vs-reel-bg {
  flex: 1;
  overflow-y: auto;
  padding: 60px 24px 180px;
  scroll-behavior: smooth;
}@keyframes vsReelIn {
  0%   { opacity: 0; transform: translateY(8px) scale(.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}.vs-reel-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 100px 20px;
}

.vs-reel-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(0,0,0,.82);          /* flat dark, no gradient */
  border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  z-index: 365;
  pointer-events: auto;
}
.vs-reel-profile {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  margin-right: 8px;
  max-width: 200px;
}
.vs-reel-prof-av {
  width: 24px; height: 24px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(229,9,20,.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vs-reel-prof-av img { width: 100%; height: 100%; object-fit: cover; }
.vs-reel-prof-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vs-reel-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}
.vs-reel-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;             /* flat */
  color: rgba(255,255,255,.78);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  position: relative;
  transition: background .12s, color .12s, border-color .12s;
}
.vs-reel-tool i { font-size: 12px; color: rgba(229,9,20,.85); }
.vs-reel-tool:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  border-color: rgba(255,255,255,.1);
}
.vs-reel-tool-badge {
  display: inline-block;
  padding: 0 5px;
  border-radius: 8px;
  background: rgba(229,9,20,.45);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  min-width: 14px;
  text-align: center;
  margin-left: 2px;
}
.vs-reel-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.vs-reel-count {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 8px;
  background: rgba(229,9,20,.25);
  border: 1px solid rgba(229,9,20,.5);
  color: rgba(255,210,210,1);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}
/* Window-style settings panel — draggable, minimize, close */
.vs-reel-params {
  position: fixed;
  width: 420px;
  max-width: 92vw;
  max-height: calc(100vh - 180px);
  z-index: 367;
  border-radius: 8px;
  background: #0a0a0c;                 /* flat */
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 16px 56px rgba(0,0,0,.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: max-height .25s ease-out, height .25s ease-out;
}
.vs-reel-params.minimized {
  max-height: 32px;
  height: 32px;
}.vs-reel-tlights {
  display: flex;
  gap: 7px;
  align-items: center;
}
.vs-tl {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  background-clip: padding-box;
  position: relative;
}
.vs-tl-close { background: #ff5f57; }
.vs-tl-min   { background: #febc2e; }
.vs-tl-max   { background: #28c840; }
.vs-tl:hover::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
}
.vs-reel-params-title {
  display: flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .06em;
}
/* ── Cinematic generation card ────────────────────────────────── */
.vs-gen-cine-wrap {
  margin: 8px 0 18px;
}
.vs-gen-cine-card {
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 0 24px rgba(229,9,20,.18);
  border: 1px solid rgba(229,9,20,.25);
}
.vs-gen-cine-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  isolation: isolate;
}
.vs-gen-cine-bg {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  transition: filter .6s ease-out, transform .6s ease-out;
}
.vs-gen-cine-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,.15) 2px,
    rgba(0,0,0,.15) 3px
  );
  mix-blend-mode: multiply;
  opacity: .55;
}
.vs-gen-cine-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,.5) 75%, rgba(0,0,0,.85) 100%),
    linear-gradient(180deg, rgba(0,0,0,.4) 0%, transparent 25%, transparent 70%, rgba(0,0,0,.55) 100%);
}
.vs-gen-cine-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
}
.vs-gen-cine-eta {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  backdrop-filter: blur(8px);
}

.vs-gen-cine-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 4;
  padding: 0 24px;
  width: 100%;
}
.vs-gen-cine-spinner {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vs-gen-cine-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--r1);
  border-right-color: rgba(229,9,20,.45);
  animation: vsCineRing 1.4s linear infinite;
  box-shadow: 0 0 28px rgba(229,9,20,.55);
}
@keyframes vsCineRing { to { transform: rotate(360deg); } }
.vs-gen-cine-step {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
  text-shadow: 0 2px 10px rgba(0,0,0,.7);
  margin-bottom: 6px;
}
.vs-gen-cine-prompt {
  font-size: 11.5px;
  color: rgba(255,255,255,.7);
  font-style: italic;
  line-height: 1.4;
  max-height: 38px;
  overflow: hidden;
  text-shadow: 0 1px 6px rgba(0,0,0,.85);
}

.vs-gen-cine-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}
.vs-gen-cine-timeline {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.14);
  overflow: visible;
}
.vs-gen-cine-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--r1), rgba(255,140,0,1));
  box-shadow: 0 0 10px rgba(229,9,20,.6);
  transition: width .35s cubic-bezier(.4,0,.2,1);
}
.vs-gen-cine-playhead {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(229,9,20,.85), 0 0 22px rgba(255,255,255,.45);
  transition: left .35s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
.vs-gen-cine-pills {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.vs-gen-cine-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.55);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  backdrop-filter: blur(6px);
}
.vs-gen-cine-pill.active {
  border-color: rgba(229,9,20,.55);
  background: rgba(229,9,20,.18);
  color: #fff;
}
.vs-gen-cine-pill.done {
  border-color: rgba(74,222,128,.4);
  background: rgba(74,222,128,.12);
  color: rgba(187,247,208,1);
}

/* ── Per-msg progress model-bar ──────────────────────────────── */
.vs-gen-mbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(248,113,113,.18);
  margin-bottom: 4px;
}
.vs-gen-pct {
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(252,165,165,.95);
  background: rgba(248,113,113,.14);
  border: 1px solid rgba(248,113,113,.3);
  padding: 2px 9px;
  border-radius: 5px;
  min-width: 44px;
  text-align: center;
}.vs-story {
  position: fixed;
  top: 0; right: -560px;
  width: 540px;
  max-width: 96vw;
  height: 100vh;
  background: #131316;
  border-left: 1px solid rgba(248,113,113,.25);
  display: flex;
  flex-direction: column;
  z-index: 290;
  transition: right .25s cubic-bezier(.4,0,.2,1);
  box-shadow: -16px 0 40px rgba(0,0,0,.55);
}
.vs-story.open { right: 0; }

/* Cinema mode — lift storyOpen panel above the Cinema overlay (z:360) so
   image generation/editing works from Cinema without kicking back to Studio. */
body:has(.vs-reel.open) .vs-story-backdrop { z-index: 391; }
body:has(.vs-reel.open) .vs-story { z-index: 392; }
/* Cinematic model card (with icon + description) */
.vs-story-model-card {
  display: grid !important;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  padding: 8px 10px !important;
  align-items: center;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.vs-story-model-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(229,9,20,.04));
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.vs-story-model-card:hover::before { opacity: 1; }
.vs-story-model-card.on::before { opacity: 1; background: linear-gradient(135deg, transparent 50%, rgba(229,9,20,.1)); }
.vs-story-ta {
  width: 100%;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--t1);
  font-size: 12.5px;
  resize: vertical;
  font-family: inherit;
}
.vs-story-ta:focus {
  outline: none;
  border-color: rgba(248,113,113,.45);
  background: rgba(0,0,0,.35);
}@keyframes vsShim {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* ── Frames (keyframes library) pane ─────────────────────────── */
.vs-frames-pane { padding: 0; }
.vs-dir-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--t2);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .12s;
  flex-shrink: 0;
  white-space: nowrap;
  position: relative;
}
.vs-dir-pill:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(229,9,20,.5);
}
.vs-dir-pill.on {
  background: rgba(229,9,20,.16);
  border-color: rgba(229,9,20,.7);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(229,9,20,.22) inset;
}
.vs-dir-pill-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,.05);
}
.vs-dir-pill-none {
  padding: 4px 11px;
}
.vs-dir-pill-none i { color: var(--t4); }
.vs-dir-pill-wiz {
  padding: 4px 11px;
  border-style: dashed;
  color: var(--t3);
}
.vs-dir-pill-wiz i { color: rgba(229,9,20,.85); }
.vs-aspect-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--t3);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  flex-shrink: 0;
  padding: 0;
}
.vs-aspect-chip:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(229,9,20,.5);
}
.vs-aspect-chip.on {
  background: rgba(229,9,20,.16);
  border-color: rgba(229,9,20,.7);
  color: #fff;
}
.vs-aspect-chip svg { display: block; }
.vs-reel-clap-drawer {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  width: min(960px, 94vw);
  max-height: 220px;
  padding: 8px;
  border-radius: 10px;
  background: #0a0a0c;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 14px 48px rgba(0,0,0,.85);
  z-index: 394;                    /* sits just below dock (395) */
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}
/* ═══════════════════════════════════════════════════════════════
   Music & SFX studio (Wave 3.3)
   ═══════════════════════════════════════════════════════════════ */
.vs-music-back {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  z-index: 388;                  /* just under panel (389) — backdrop below modal */
  /* No backdrop-filter: Cinema overlay already blurs; double-blur looks fuzzy */
}
.vs-music-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(580px, 92vw);
  z-index: var(--z-modal);       /* 389 — above backdrop */
  background: #0a0a0c;
  border: 1px solid rgba(229,9,20,.4);
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0,0,0,.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.vs-music-hdr {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 38px;
  padding: 0 14px;
  background: #131316;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.vs-music-title {
  display: flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 900;
  color: #fff;
  letter-spacing: .06em;
}
.vs-music-subtitle {
  margin-left: 9px;
  font-size: 10px;
  color: var(--t3);
  font-weight: 500;
  letter-spacing: .01em;
  text-transform: none;
}
.vs-music-body {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vs-music-modes {
  display: flex;
  gap: 6px;
}
.vs-music-mode {
  padding: 6px 14px;
  border-radius: 7px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--t3);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.vs-music-mode:hover { background: rgba(255,255,255,.08); }
.vs-music-mode.on {
  background: rgba(229,9,20,.18);
  border-color: rgba(229,9,20,.65);
  color: #fff;
}

.vs-music-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.vs-music-chip {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: var(--t3);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.vs-music-chip:hover { background: rgba(255,255,255,.08); color: #fff; }
.vs-music-chip.on {
  background: rgba(229,9,20,.16);
  border-color: rgba(229,9,20,.6);
  color: #fff;
}

.vs-music-ta {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  font-size: 12px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.45;
}
.vs-music-ta:focus {
  outline: none;
  border-color: rgba(229,9,20,.6);
  background: rgba(255,255,255,.06);
}

.vs-music-dur {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.vs-music-dur-lbl {
  font-size: 10.5px;
  color: var(--t3);
  margin-right: 4px;
  font-weight: 600;
}
.vs-music-dpill {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--t3);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.vs-music-dpill:hover { background: rgba(255,255,255,.08); color: #fff; }
.vs-music-dpill.on {
  background: rgba(229,9,20,.16);
  border-color: rgba(229,9,20,.6);
  color: #fff;
}

.vs-music-acts {
  display: flex;
  align-items: center;
  gap: 10px;
}
.vs-music-go {
  padding: 9px 18px;
  border-radius: 7px;
  border: none;
  background: rgba(229,9,20,.9);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s;
}
.vs-music-go:hover:not(:disabled) { background: rgba(229,9,20,1); }
.vs-music-go:disabled { opacity: .4; cursor: not-allowed; background: rgba(229,9,20,.6); }
.vs-music-result {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
}
.vs-music-result audio { background: rgba(0,0,0,.4); border-radius: 6px; }
.vs-music-result-acts {
  display: flex;
  gap: 8px;
}
.vs-music-dl, .vs-music-stash {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, border-color .12s;
}
.vs-music-dl:hover, .vs-music-stash:hover {
  background: rgba(229,9,20,.16);
  border-color: rgba(229,9,20,.6);
}
/* ═══════════════════════════════════════════════════════════════
   Overlay transitions — applied via Alpine x-transition:enter/leave
   ═══════════════════════════════════════════════════════════════ */
@keyframes vs-anim-fly-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes vs-anim-fly-out {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 0; transform: translate(-50%, -50%) scale(.96); }
}
@keyframes vs-anim-slide-up {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes vs-anim-slide-down {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(12px); }
}.vs-sb-lbl-primary {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.vs-sb-lbl-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(229,9,20,.85);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.vs-sb-lbl-text {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
}
.vs-sb-lbl-primary .vs-sb-hint {
  flex-basis: 100%;
  margin-left: 30px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--t3);
}@keyframes vs-anim-toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes vs-anim-toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(20px); }
}

/* ── Suppress apprail/root transition during initial mount to prevent flash ── */
[data-no-rail-tx] .sv2-apprail,
[data-no-rail-tx] .sv2-app-shell:has(.sv2-apprail) .sv2-root {
  transition: none !important;
}
