/* ============================================================================
   Video AI Studio — dedicated stylesheet (the video design/CSS HOME)
   ----------------------------------------------------------------------------
   Loaded AFTER css/studio.css, so every rule here can override the shared studio
   styles for the Video Studio ONLY. The video root gets a `.video-studio` class
   (stamped by js/video-studio/video-studio.js), so SCOPE every rule under
   `.video-studio …`. Because the Image Studio never carries that class, nothing
   in this file can affect it — and css/studio.css is never edited for video work.

   Convention (NOTE: no nested comment tokens in here — CSS comments don't nest, and an inner
   one closed this header early, making the parser EAT the first real rule below):
     .video-studio .cb-studio-…   ( … )   — override a shared studio element
     .video-studio .vs-…          ( … )   — video-only element (prefix `vs-`)

   This file starts with NO visual overrides on purpose (the Video Studio looks
   exactly like the Image Studio until a video-specific design is added here).
   Put all future video styling below — never in css/studio.css.
   ============================================================================ */

/* (Video-specific styles go here, all scoped under `.video-studio`.) */

/* ── UGC Builder mode (js/video-studio/ugc-mode.js) — the vsu-* namespace ─────────────── */
/* IN-PANEL SWITCHER (user, 2026-07-02): the Studio ↔ UGC Builder segmented control lives INSIDE
   the left controls panel, right under the "Video Studio" header — BOTH surfaces render a
   .vsu-switch-slot there (engine accordion + the UGC Builder col), so it never moves. */
.video-studio { display: flex; flex-direction: column; min-height: 0; }
.video-studio .vsu-switch-slot { padding: 12px 18px 0; }   /* 18px = the panel's horizontal rhythm (acc-head/acc-scroll) */
.video-studio .vsu-switch { display: flex; gap: 4px; padding: 4px; background: #F0F1F6; border-radius: 10px; }
.video-studio .vsu-switch__btn { flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 7px; border: none; background: none; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; font-weight: 600; color: #5A6473; cursor: pointer; }
.video-studio .vsu-switch__btn:hover { color: #2A3343; }
.video-studio .vsu-switch__btn.is-on { background: #fff; color: #4038B8; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10); }
.video-studio .vsu-switch__btn svg { flex: 0 0 auto; }
.video-studio .vsu-host { flex: 1 1 auto; min-height: 0; min-width: 0; }
.video-studio .vsu-host--studio { display: flex; flex-direction: column; }

/* The UGC surface = the SAME shell as the Studio (user, 2026-07-02): full-bleed fixed layout,
   left .vstudio-controls--acc panel (engine chrome: header / switcher slot / numbered step
   cards / sticky Generate footer) + a stage on the right where the run + result render.
   Mirrors .vstudio-layout / .vstudio-main from css/video-studio-engine.css. */
.video-studio .vsu-ugc-layout { position: fixed; inset: 0 0 0 var(--sidebar-width, 80px); display: flex; background: var(--bg-secondary, #F7F7FA); z-index: 100; font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
.video-studio .vsu-ugc-layout .vstudio-controls { flex: 0 0 max(365px, var(--vstudio-left-w, 365px)); width: max(365px, var(--vstudio-left-w, 365px)); min-height: 0; }
/* The engine's resize handle rides between the col and the stage (grid track in the Studio,
   a 6px flex track here); drag updates --vstudio-left-w on .vsu-ugc-layout. */
.video-studio .vsu-ugc-layout .vstudio-resize-handle { flex: 0 0 6px; }
.video-studio .vsu-card-content { display: flex; flex-direction: column; gap: 12px; }

/* Sidebar tuning for the vsu building blocks inside the accordion bodies (~300px wide).
   ALIGNMENT SYSTEM (user, 2026-07-02 "buttons need to align"): every input+button tool row is a
   [1fr | auto] grid — inputs stretch, buttons share one 40px height (= .vsu-in) and a common
   min-width, so all row buttons land flush on the card's right edge; full-width actions use
   .vsu-btn-block. Spacing comes from the card's 12px flex gap — element margins are zeroed so
   nothing double-spaces. */
.video-studio .vstudio-acc-body .vsu-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.video-studio .vstudio-acc-body .vsu-grid--fmt { grid-template-columns: 1fr 1fr; }
.video-studio .vsu-card-content > .vsu-grid { margin-top: 0; }
.video-studio .vstudio-acc-body .vsu-toolrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.video-studio .vstudio-acc-body .vsu-toolrow .vsu-in { min-width: 0; }
.video-studio .vstudio-acc-body .vsu-toolrow .btn { height: 40px; min-width: 92px; padding: 0 14px; justify-content: center; border-radius: 9px; }
.video-studio .vstudio-acc-body .vsu-btn-block { width: 100%; height: 40px; justify-content: center; gap: 7px; border-radius: 9px; }
.video-studio .vstudio-acc-body .vsu-tools { gap: 8px; margin-bottom: 0; }
.video-studio .vstudio-acc-body .vsu-note { margin: 0; }
.video-studio .vstudio-acc-body .vsu-sub { margin: 6px 0 -6px; }
/* Group divider inside a step card (Avatar & scene: creator group vs scene group). */
.video-studio .vsu-divider { border-top: 1px dashed #E4E6EC; margin: 8px 0 -4px; }
/* Step guard error — shown above the Back/Continue row when a step refuses to advance. */
.video-studio .vsu-step-err { margin: 0; padding: 9px 12px; border: 1px solid #F0C6A6; background: #FFF8F1; color: #B54708; border-radius: 9px; font-size: 12.5px; font-weight: 600; }
.video-studio .vsu-step-err.is-flash { animation: vsu-shake 0.3s ease; }
@keyframes vsu-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.video-studio .vsu-review-list { display: flex; flex-direction: column; }
.video-studio .vstudio-acc-body .vsu-review { font-size: 12.5px; padding: 7px 0; }
.video-studio .vstudio-acc-body .vsu-review:first-child { padding-top: 0; }
.video-studio .vstudio-acc-body .vsu-review b { flex: 0 0 92px; }
.video-studio .vstudio-acc-body .vsu-review span { min-width: 0; word-break: break-word; }
.video-studio .vstudio-acc-body .vsu-review:last-child { border-bottom: none; padding-bottom: 0; }
/* Empty helper hosts (catalog results, scrape candidates) must not open dead flex-gap holes. */
.video-studio .vsu-card-content > div:empty { display: none; }
/* Drop zones — the product photo grid + the avatar library wrapper light up while files are
   dragged over their open card. */
.video-studio .vsu-grid.is-drop,
.video-studio .vsu-dropzone.is-drop { outline: 2px dashed #5B53E8; outline-offset: 4px; border-radius: 8px; background: rgba(91, 83, 232, 0.05); }
/* DROP CUE — a labeled target painted over the open Product/Avatar card the moment a drag
   starts anywhere over the app (pointer-events:none: the card's drop handlers still fire). */
.video-studio .vsu-dropcue { position: absolute; inset: 6px; z-index: 7; pointer-events: none; border: 2px dashed #5B53E8; border-radius: 12px; background: rgba(91, 83, 232, 0.08); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: #4038B8; text-align: center; padding: 14px; }
.video-studio .vsu-dropcue span { background: #fff; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; box-shadow: 0 2px 6px rgba(16, 24, 40, 0.14); max-width: 90%; }
.video-studio .vsu-dropcue svg { opacity: 0.9; animation: vsu-pulse 1.4s ease-in-out infinite; }

/* Voice step — playable voice rows (▶ sample · name + tags · check when selected). */
/* margin-top 7 (not a `+` sibling rule): the section .vsu-sub above carries -6px bottom margin
   (the acc-body rhythm rule), so every row needs its own top offset to clear it. */
.video-studio .vsu-voice { display: flex; align-items: center; gap: 10px; border: 1px solid #E7E8EC; background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; margin-top: 7px; }
.video-studio .vsu-voice:hover { border-color: #D6D2F7; }
.video-studio .vsu-voice.is-on { border-color: #5B53E8; background: #FBFAFF; box-shadow: 0 0 0 3px rgba(91, 83, 232, 0.10); }
.video-studio .vsu-voice__play { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #DADCE3; background: #F5F6F9; color: #4A5262; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; padding: 0; }
.video-studio .vsu-voice__play:hover { border-color: #5B53E8; color: #4038B8; }
.video-studio .vsu-voice__play.is-playing { background: #5B53E8; border-color: #5B53E8; color: #fff; }
.video-studio .vsu-voice__play:disabled { opacity: 0.4; cursor: default; }
.video-studio .vsu-voice__meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.video-studio .vsu-voice__name { font-size: 13px; font-weight: 600; color: #14171F; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-studio .vsu-voice__tags { font-size: 11px; color: #6B7280; text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-studio .vsu-voice__check { flex: 0 0 auto; color: #5B53E8; display: none; }
.video-studio .vsu-voice.is-on .vsu-voice__check { display: inline-flex; }
.video-studio .vsu-voice__allhead { display: flex; align-items: center; justify-content: space-between; }
/* Section head with a right-aligned action (Spoken script's "Generate with AI"). */
.video-studio .vsu-sub--row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.video-studio .vstudio-acc-body .vsu-btn-sm { height: 26px; min-width: 0; padding: 0 10px; font-size: 11.5px; border-radius: 8px; text-transform: none; letter-spacing: 0; }
/* Live character counter under the spoken-script textarea (amber until the 50-char floor). */
.video-studio .vsu-script-count { font-size: 11px; font-weight: 600; color: #B54708; text-align: right; margin-top: -8px; }
.video-studio .vsu-script-count.is-ok { color: #12805C; }

/* Step-busy overlay — covers the whole step card while its generation runs (spinner +
   pulsing label; blocks interaction; anchored to the card so body redraws are safe). */
.video-studio .vstudio-acc-card { position: relative; }
.video-studio .vstudio-acc-card.is-busy { min-height: 120px; }
.video-studio .vsu-step-overlay { position: absolute; inset: 0; z-index: 6; background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(2px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 14px; }
.video-studio .vsu-step-overlay__t { font-size: 12.5px; font-weight: 600; color: #4038B8; animation: vsu-pulse 1.4s ease-in-out infinite; }
@keyframes vsu-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* Scene-frame step — the composed avatar+product+background preview (stage copy sizes via the
   inline stageMaxW cap, same as the video). */
.video-studio .vsu-frame-img { width: 100%; max-width: 236px; border-radius: 12px; border: 1px solid #E7E8EC; display: block; margin: 2px auto 0; background: #F7F8FA; }
.video-studio .vsu-stage-frame { width: 100%; max-height: 74vh; object-fit: contain; border-radius: 14px; border: 1px solid #E7E8EC; box-shadow: 0 2px 10px rgba(16, 24, 40, 0.08); }
.video-studio .vsu-voice__refresh { border: none; background: none; color: #8A93A1; font-size: 11px; font-weight: 600; cursor: pointer; padding: 0; text-transform: none; letter-spacing: 0; }
.video-studio .vsu-voice__refresh:hover { color: #4038B8; }
/* ElevenLabs LIBRARY rows — same chrome as account voices + an "+ Add" pill (click = add to the
   account and select). The library block sits under the account list in the Voice step. */
.video-studio .vsu-voicelib { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.video-studio .vsu-voicelib .vsu-in { margin: 2px 0 1px; }
.video-studio .vsu-voice__add { flex: 0 0 auto; border: 1px solid #DAD7F6; background: #F4F3FD; color: #4038B8; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.video-studio .vsu-voice__add:hover { background: #ECEAFB; }
.video-studio .vsu-voice__add:disabled { opacity: 0.6; cursor: default; }

/* Engine MULTI-SELECT (Generate step) — checkbox cards; check both to race the engines. */
.video-studio .vsu-englist { display: flex; flex-direction: column; gap: 8px; }
.video-studio .vsu-eng { display: flex; align-items: center; gap: 11px; border: 1px solid #E7E8EC; background: #fff; border-radius: 11px; padding: 10px 12px; cursor: pointer; font: inherit; text-align: left; transition: border-color 0.12s, box-shadow 0.12s; }
.video-studio .vsu-eng:hover { border-color: #D6D2F7; }
.video-studio .vsu-eng.is-on { border-color: #5B53E8; background: #FBFAFF; box-shadow: 0 0 0 3px rgba(91, 83, 232, 0.10); }
.video-studio .vsu-eng__box { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #C9CDD6; background: #fff; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto; }
.video-studio .vsu-eng.is-on .vsu-eng__box { background: #5B53E8; border-color: #5B53E8; }
.video-studio .vsu-eng__meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.video-studio .vsu-eng__name { font-size: 13px; font-weight: 700; color: #14171F; }
.video-studio .vsu-eng__d { font-size: 11.5px; color: #6B7280; }
.video-studio .vsu-eng.is-on .vsu-eng__d { color: #4038B8; }

/* Multi-engine results — one labeled column per finished clip, side by side (wraps). */
.video-studio .vsu-stage-results { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; align-items: flex-start; width: 100%; }
.video-studio .vsu-stage-result { display: flex; flex-direction: column; gap: 9px; align-items: center; min-width: 0; }
.video-studio .vsu-stage-result__tag { font-size: 12px; font-weight: 700; color: #4038B8; background: #F0EFFC; border-radius: 999px; padding: 4px 13px; }
.video-studio .vsu-stage-result__err { border: 1px solid #F0C6A6; background: #FFF8F1; color: #B54708; border-radius: 10px; padding: 10px 14px; font-size: 12.5px; max-width: 300px; }

/* The stage — empty state / progress / finished clip. */
.video-studio .vsu-stage { flex: 1 1 auto; min-width: 0; overflow-y: auto; display: flex; align-items: center; justify-content: center; padding: 28px; }
.video-studio .vsu-stage-inner { width: 100%; max-width: 820px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.video-studio .vsu-stage-h { margin: 0; font-size: 20px; letter-spacing: -0.01em; color: #14171F; }
.video-studio .vsu-stage-p { margin: 0; font-size: 13.5px; color: #6B7280; line-height: 1.55; max-width: 460px; }
.video-studio .vsu-stage-emoji { font-size: 40px; line-height: 1; }
/* The clip + the composed start frame render BIG — the width cap comes inline from the chosen
   video format (stageMaxW: 9:16→460 · 1:1→560 · 16:9→760), both bounded by 74vh. */
.video-studio .vsu-stage-video { width: 100%; max-height: 74vh; border-radius: 14px; border: 1px solid #E7E8EC; background: #000; display: block; }
.video-studio .vsu-stage-acts { justify-content: center; }
/* BUILD BOARD — the idle stage's clickable map of every step's pick, wired the way the render
   works ([Avatar + Product → Frame] ↓ with [Format & script + Voice] ↓ → Final clip). A tile
   click opens that step in the left panel; dashed tiles = still missing. */
.video-studio .vsu-board { display: flex; flex-direction: column; align-items: center; gap: 13px; width: 100%; margin-top: 10px; }
.video-studio .vsu-board__row { display: flex; align-items: stretch; justify-content: center; gap: 12px; flex-wrap: wrap; width: 100%; }
.video-studio .vsu-board__tile { display: flex; align-items: center; gap: 12px; border: 1px solid #E7E8EC; background: #fff; border-radius: 14px; padding: 12px 14px; cursor: pointer; text-align: left; flex: 1 1 220px; min-width: 200px; max-width: 330px; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05); font: inherit; transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s; }
.video-studio .vsu-board__tile:hover { border-color: #5B53E8; box-shadow: 0 4px 14px rgba(91, 83, 232, 0.14); transform: translateY(-1px); }
.video-studio .vsu-board__tile.is-miss { border-style: dashed; background: #FBFBFD; box-shadow: none; }
.video-studio .vsu-board__thumb { width: 72px; height: 96px; border-radius: 10px; object-fit: cover; background: #F0F1F5; flex: 0 0 auto; }
.video-studio .vsu-board__emoji { width: 72px; height: 96px; border-radius: 10px; background: #F3F2FD; display: inline-flex; align-items: center; justify-content: center; font-size: 30px; flex: 0 0 auto; }
.video-studio .vsu-board__meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.video-studio .vsu-board__k { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #6B7280; white-space: nowrap; }
.video-studio .vsu-board__v { font-size: 14.5px; font-weight: 600; color: #14171F; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-studio .vsu-board__tile.is-miss .vsu-board__v { color: #8A93A1; font-weight: 500; }
.video-studio .vsu-board__op { align-self: center; color: #B9BFCC; font-size: 20px; font-weight: 700; display: flex; }
.video-studio .vsu-board__op svg { width: 22px; height: 22px; }
.video-studio .vsu-board__join { display: flex; align-items: center; gap: 8px; color: #8A93A1; font-size: 12.5px; font-weight: 600; }
.video-studio .vsu-board__join svg { width: 16px; height: 16px; }

/* Pipeline strip — Avatar → Product → Start frame → Final clip lineage under the big media. */
.video-studio .vsu-flow { display: flex; align-items: center; justify-content: center; gap: 13px; flex-wrap: wrap; margin-top: 6px; }
.video-studio .vsu-flow__item { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: #8A93A1; font-weight: 600; }
.video-studio .vsu-flow__item.is-on { color: #4038B8; }
.video-studio .vsu-flow__thumb { width: 66px; height: 88px; border-radius: 10px; object-fit: cover; border: 1px solid #E7E8EC; background: #fff; }
.video-studio .vsu-flow__item.is-on .vsu-flow__thumb { border-color: #5B53E8; box-shadow: 0 0 0 2px rgba(91, 83, 232, 0.16); }
.video-studio .vsu-flow__thumb--badge { display: inline-flex; align-items: center; justify-content: center; font-size: 28px; background: #F3F2FD; }
.video-studio .vsu-flow__arrow { color: #C4C9D4; display: flex; margin-bottom: 22px; }
.video-studio .vsu-flow__arrow svg { width: 19px; height: 19px; }
.video-studio .vsu-stage-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #E4E2FB; border-top-color: #5B53E8; animation: vsu-spin 0.9s linear infinite; }
@keyframes vsu-spin { to { transform: rotate(360deg); } }

/* Stack the panel above the stage on narrow viewports (mirrors the engine's own breakpoint). */
@media (max-width: 860px) {
    .video-studio .vsu-ugc-layout { flex-direction: column; }
    .video-studio .vsu-ugc-layout .vstudio-controls { flex: 0 0 auto; width: 100%; max-height: 60vh; border-right: none; border-bottom: 1px solid #E7E8EC; }
    .video-studio .vsu-ugc-layout .vstudio-resize-handle { display: none; }   /* stacked — nothing to drag */
}

.video-studio .vsu-note { margin: 4px 0 10px; font-size: 12px; color: #6B7280; line-height: 1.5; }
.video-studio .vsu-sub { margin: 16px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8A93A1; }
.video-studio .vsu-in { width: 100%; height: 40px; border: 1px solid #E1E3EA; border-radius: 9px; padding: 0 12px; font-size: 13.5px; background: #fff; }
.video-studio .vsu-in:focus { outline: none; border-color: #5B53E8; box-shadow: 0 0 0 3px rgba(91,83,232,.12); }
.video-studio .vsu-ta { height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.5; font-family: inherit; }
.video-studio .vsu-ta--sm { height: 64px; }   /* the Custom-scene / Custom-tone free-text briefs */
.video-studio .vsu-sel { appearance: auto; }
.video-studio .vsu-tools { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.video-studio .vsu-toolrow { display: flex; gap: 8px; }
.video-studio .vsu-toolrow .vsu-in { flex: 1 1 auto; }
.video-studio .vsu-toolrow .btn { flex: 0 0 auto; white-space: nowrap; }

/* Cards — product photos, scrape candidates, the creator library. */
.video-studio .vsu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 10px; }
.video-studio .vsu-card { position: relative; border: 1px solid #E7E8EC; border-radius: 11px; overflow: hidden; background: #F7F8FA; aspect-ratio: 3/4; }
.video-studio .vsu-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-studio .vsu-card--add { display: flex; align-items: center; justify-content: center; color: #5B53E8; font-weight: 600; font-size: 12.5px; cursor: pointer; border-style: dashed; background: #FBFAFF; }
.video-studio .vsu-card--pick { cursor: pointer; }
/* SELECTED avatar is unmistakable (user, 2026-07-02): thick indigo ring + "✓ Selected" badge,
   and once anything is selected the other cards dim until hovered. */
.video-studio .vsu-card--pick.is-on { border: 2px solid #5B53E8; box-shadow: 0 0 0 3px rgba(91, 83, 232, 0.28); }
.video-studio .vsu-card__sel { position: absolute; top: 6px; left: 6px; display: inline-flex; align-items: center; background: #5B53E8; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; padding: 3px 8px; border-radius: 999px; z-index: 2; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.3); }
.video-studio .vsu-card--pick.is-on .vsu-card__pin { top: 32px; }   /* pin drops below the badge */
.video-studio .vsu-grid.has-sel .vsu-card--pick:not(.is-on) { opacity: 0.55; }
.video-studio .vsu-grid.has-sel .vsu-card--pick:not(.is-on):hover { opacity: 1; }
.video-studio .vsu-card__x { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(17,20,28,.55); color: #fff; font-size: 11px; cursor: pointer; }
.video-studio .vsu-card__pin { position: absolute; top: 6px; left: 6px; color: #FFC634; text-shadow: 0 1px 2px rgba(0,0,0,.35); font-size: 14px; }
.video-studio .vsu-card__name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px; font-size: 11.5px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(17,20,28,.72)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-studio .vsu-card__acts { position: absolute; top: 6px; right: 6px; display: none; gap: 4px; }
.video-studio .vsu-card--pick:hover .vsu-card__acts { display: flex; }
.video-studio .vsu-mini { width: 24px; height: 24px; border-radius: 6px; border: none; background: rgba(17,20,28,.55); color: #fff; font-size: 12px; cursor: pointer; }

/* Format presets + scene chips + review rows. */
.video-studio .vsu-grid--fmt { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.video-studio .vsu-fmt { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; text-align: left; border: 1px solid #E7E8EC; background: #fff; border-radius: 12px; padding: 13px 14px; cursor: pointer; }
.video-studio .vsu-fmt.is-on { border-color: #5B53E8; background: #FBFAFF; box-shadow: 0 0 0 3px rgba(91,83,232,.10); }
.video-studio .vsu-fmt__e { font-size: 18px; }
.video-studio .vsu-fmt b { font-size: 13px; }
.video-studio .vsu-fmt__d { font-size: 11.5px; color: #8A93A1; line-height: 1.4; }
.video-studio .vsu-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.video-studio .vsu-chip { border: 1px solid #E1E3EA; background: #fff; border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 600; color: #5A6473; cursor: pointer; }
.video-studio .vsu-chip.is-on { border-color: #5B53E8; background: #5B53E8; color: #fff; }
.video-studio .vsu-review { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #EDEFF2; font-size: 13px; }
.video-studio .vsu-review b { flex: 0 0 130px; color: #5A6473; font-weight: 600; }
.video-studio .vsu-review.is-miss span { color: #B54708; }
/* (.vsu-go / .vsu-nav / .vsu-video removed 2026-07-02 — the sticky .vstudio-footer button,
   the engine's .vstudio-acc-nav and .vsu-stage-video replaced them.) */

/* ── VIDEO EDITOR (video-editor.js) — shared by Video Studio + UGC builder.
   Full-screen overlay: stage (preview + draggable image overlays) on top,
   transport + toolbar, then the two-track timeline (clips / overlays). ── */
.vsed-overlay { position: fixed; inset: 0; z-index: 1200; background: rgba(15, 23, 42, 0.58); display: flex; align-items: center; justify-content: center; padding: 22px; }
.vsed-panel { width: min(980px, 96vw); max-height: 94vh; overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 18px 60px rgba(16, 24, 40, 0.28); display: flex; flex-direction: column; }
.vsed-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; border-bottom: 1px solid #EEF0F3; }
.vsed-title { font-size: 14.5px; font-weight: 700; color: #14171F; }
.vsed-stagewrap { display: flex; justify-content: center; padding: 14px 18px 6px; background: #FBFBFC; }
.vsed-stage { position: relative; max-width: 100%; max-height: 46vh; display: inline-block; border-radius: 12px; overflow: hidden; background: #0B0D12; }
.vsed-video { display: block; max-width: 100%; max-height: 46vh; }
.vsed-ovl { position: absolute; cursor: grab; touch-action: none; }
.vsed-ovl img { display: block; width: 100%; height: auto; pointer-events: none; }
.vsed-ovl.is-sel { outline: 2px solid #5B53E8; outline-offset: 1px; }
.vsed-ovl.is-off { opacity: 0.28; }
.vsed-ovl__grip { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; border-radius: 3px; background: #5B53E8; border: 2px solid #fff; cursor: nwse-resize; }
.vsed-transport { display: flex; align-items: center; gap: 10px; padding: 8px 18px 2px; }
.vsed-btn { border: 1px solid #E2E4E9; background: #fff; border-radius: 9px; padding: 6px 11px; font: inherit; font-size: 12px; font-weight: 600; color: #2A2F3A; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; }
.vsed-btn:hover { border-color: #C9CCFB; background: #F7F7FE; }
.vsed-play { width: 38px; justify-content: center; }
.vsed-clock { font-size: 11.5px; font-variant-numeric: tabular-nums; color: #5A6372; min-width: 110px; }
.vsed-tools { display: flex; gap: 7px; margin-left: auto; flex-wrap: wrap; }
.vsed-tl { position: relative; margin: 10px 18px 4px; border: 1px solid #E7E8EC; border-radius: 12px; background: #FBFBFC; padding: 6px 8px 10px; cursor: crosshair; }
.vsed-ruler { position: relative; height: 16px; }
.vsed-tick { position: absolute; top: 0; font-size: 9.5px; color: #646B78; transform: translateX(-2px); }
.vsed-track { position: relative; height: 44px; margin-top: 6px; border-radius: 9px; background: #F1F2F5; }
.vsed-track--ovls { height: 34px; }
.vsed-clip { position: absolute; top: 3px; bottom: 3px; border-radius: 8px; background: #E4E2FB; border: 1px solid #C9C4F6; overflow: hidden; cursor: pointer; }
.vsed-clip.is-active { background: #D7D3FA; border-color: #5B53E8; }
.vsed-clip__lbl { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 10.5px; font-weight: 700; color: #4038B8; white-space: nowrap; pointer-events: none; }
.vsed-clip__del { position: absolute; right: 3px; top: 3px; width: 16px; height: 16px; border: none; border-radius: 5px; background: rgba(255,255,255,0.85); color: #B4231F; font-size: 12px; line-height: 1; cursor: pointer; z-index: 2; }
/* ◀▶ clip reorder — bottom-left of the block, revealed on hover to keep blocks clean. */
.vsed-clip__ord { position: absolute; left: 3px; bottom: 3px; display: flex; gap: 2px; z-index: 2; opacity: 0; transition: opacity 0.12s ease; }
.vsed-clip:hover .vsed-clip__ord { opacity: 1; }
.vsed-clip__ordbtn { width: 16px; height: 16px; border: none; border-radius: 5px; background: rgba(255,255,255,0.85); color: #2A3140; font-size: 9px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.vsed-clip__ordbtn:hover { background: #fff; color: #5B53E8; }
.vsed-clip__h { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; z-index: 2; touch-action: none; }
.vsed-clip__h--l { left: 0; border-left: 3px solid #5B53E8; border-radius: 8px 0 0 8px; }
.vsed-clip__h--r { right: 0; border-right: 3px solid #5B53E8; border-radius: 0 8px 8px 0; }
.vsed-ovlbar { position: absolute; top: 3px; bottom: 3px; border-radius: 7px; background: #DDF3E8; border: 1px solid #A9E3C6; display: flex; align-items: center; gap: 6px; padding: 0 20px 0 6px; font-size: 10px; font-weight: 700; color: #0B7A53; cursor: grab; overflow: hidden; touch-action: none; }
.vsed-ovlbar.is-sel { border-color: #0F8A5F; box-shadow: 0 0 0 1px #0F8A5F inset; }
.vsed-ovlbar img { width: 22px; height: 22px; object-fit: cover; border-radius: 4px; pointer-events: none; }
.vsed-ovlbar span { pointer-events: none; white-space: nowrap; }
.vsed-playhead { position: absolute; top: 4px; bottom: 6px; width: 2px; background: #E8502F; border-radius: 2px; pointer-events: none; }
.vsed-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px 16px; }
.vsed-hint { font-size: 11px; color: #646B78; }
.vsed-primary { border: none; border-radius: 10px; background: #5B53E8; color: #fff; font: inherit; font-size: 13px; font-weight: 700; padding: 10px 16px; cursor: pointer; }
.vsed-primary:hover { background: #4f46e5; }
.vsed-primary:disabled { opacity: 0.65; cursor: default; }
.vsed-result { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* UGC step gating: locked cards are dimmed and read as not-yet-reachable. */
.vstudio-acc-card.is-locked .vstudio-acc-card-head { opacity: 0.5; cursor: not-allowed; }
.vstudio-acc-card.is-locked .vstudio-acc-num { background: #EDEFF3; color: #6B7280; }

/* v2: overlay inspector (opacity + remove for the selected overlay) */
.vsed-inspector { display: flex; align-items: center; gap: 8px; }
.vsed-opacity { width: 110px; accent-color: #5B53E8; cursor: pointer; }

/* v2: suggested-overlay chips (product images passed by the caller) */
.vsed-sugg { display: flex; align-items: center; gap: 8px; padding: 0 18px 8px; flex-wrap: wrap; }
.vsed-sugg__chip { width: 44px; height: 44px; padding: 0; border: 1px solid #2A3140; border-radius: 8px; background: #141922; cursor: pointer; overflow: hidden; flex: 0 0 auto; }
.vsed-sugg__chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vsed-sugg__chip:hover { border-color: #5B53E8; box-shadow: 0 0 0 1px #5B53E8 inset; }
