/* Nexus Video Engine: the shared full-page layout for video tools (9 Oct 2026, timeline redesigned the same day).
   Same family as the Media Engine (Image Studio) and reuses its shared buttons, loader, toast and "ready" card
   from media-engine/engine.css. Layout:
     top bar · left rail (library) · library drawer · preview · inspector drawer
     full-width timeline: one bar (edit tools · play controls · zoom), track names on the left, time 0 at the left,
     only the playhead moves while playing.
   Phones: preview, the same timeline with icon-only track names, a big-button dock, drawers as bottom sheets. */

.vx *, .vx *::before, .vx *::after { box-sizing: border-box; }
.vx [hidden] { display: none !important; }
.vx svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.vx :is(button, input, textarea, select) { font-family: inherit; }
.vx { --rail: 72px; --lib: 296px; --insp: 312px; --tl: 296px; --lh: 132px;
  --line: rgba(255,255,255,.065); --soft: rgba(255,255,255,.045); --btn: #f4f4f5;
  --acc: #a78bfa; --acc2: #22d3ee; --panel: #0b0b10; --deep: #07070b;
  --c-main: #5b4fd6; --c-over: #0e8c99; --c-text: #9d4edd; --c-music: #15803d; --c-voice: #0284c7;
  position: relative; display: grid;
  grid-template-columns: var(--rail) auto minmax(0, 1fr) auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top top top" "rail lib stage insp" "tl tl tl tl";
  height: calc(100dvh - 64px - var(--nxb-h, 0px)); background: #050508; color: #e4e4e7; font-family: Inter, "Segoe UI", system-ui, sans-serif; overflow: hidden; }

/* ---------- Top bar ---------- */
.vx-top { grid-area: top; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; min-height: 58px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.vx-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vx-id .vx-logo { width: 22px; height: 22px; color: #c4b5fd; }
.vx-title { max-width: 240px; overflow: hidden; padding: 4px 8px; border-radius: 8px; color: #fff; font-size: 14.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; outline: none; cursor: text; transition: background .2s; }
.vx-title:hover { background: rgba(255,255,255,.05); }
.vx-title:focus { background: rgba(255,255,255,.08); box-shadow: 0 0 0 1px rgba(167,139,250,.6); text-overflow: clip; }
.vx-mid { display: flex; align-items: center; justify-content: center; gap: 10px; }
.vx-acts { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.vx-ib { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: none; color: #a1a1aa; cursor: pointer; transition: background .2s, color .2s; }
.vx-ib:hover:not(:disabled) { background: rgba(255,255,255,.07); color: #fff; }
.vx-ib:disabled { opacity: .28; cursor: default; }
.vx-ib.on, .vx-acts .vx-ib[aria-pressed="true"] { color: #fff; background: rgba(255,255,255,.1); }
.vx-tsep { width: 1px; height: 22px; margin: 0 4px; background: var(--line); }
.vx:not(.has-media) #vx-export { opacity: .38; pointer-events: none; }

/* ---------- Left rail ---------- */
.vx-rail { grid-area: rail; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-right: 1px solid var(--line); background: var(--deep); overflow: hidden auto; scrollbar-width: none; }
.vx-rail::-webkit-scrollbar { display: none; }
.vx-rail button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 14px; background: none; color: #8b8b96; font: 600 10.5px Inter, system-ui, sans-serif; cursor: pointer; transition: background .2s, color .2s; }
.vx-rail button svg { width: 21px; height: 21px; }
.vx-rail button:hover { background: rgba(255,255,255,.05); color: #fff; }
.vx-rail button[aria-pressed="true"] { color: #fff; background: rgba(255,255,255,.09); }

/* ---------- Drawers (library left, inspector right) ---------- */
.vx-lib, .vx-insp { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); overflow: hidden; transition: width .3s cubic-bezier(.22,1,.36,1); }
.vx-lib { grid-area: lib; width: var(--lib); border-right: 1px solid var(--line); }
.vx-insp { grid-area: insp; width: var(--insp); border-left: 1px solid var(--line); }
.vx.lib-shut .vx-lib, .vx.insp-shut .vx-insp { width: 0; border: 0; }
@media (min-width: 761px) { .vx-dh { display: none !important; } }
.vx-dh { position: relative; display: flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 48px; border-bottom: 1px solid var(--line); text-align: center; }
.vx-dh > .vx-ib { position: absolute; right: 10px; top: 50%; margin-top: -17px; }
.vx-dh-t { display: grid; justify-items: center; min-width: 0; }
.vx-dh h2 { margin: 0; overflow: hidden; color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.vx-dh small { color: #71717a; font-size: 11.5px; font-weight: 600; }
.vx-dh small:empty { display: none; }
.vx-db { flex: 1; min-height: 0; overflow: hidden auto; scrollbar-width: thin; scrollbar-color: #27272a transparent; }
.vx-pane { padding: 16px; }
.vx-lib .vx-db { width: var(--lib); }
.vx-insp .vx-db { width: var(--insp); }

/* Import buttons, lists, empty notes */
.vx-import { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--btn); color: #0b0b10; font: 700 13px Inter, system-ui, sans-serif; cursor: pointer; transition: transform .15s, background .2s; }
.vx-import:hover { background: #fff; }
.vx-import:active { transform: scale(.98); }
.vx-import svg { width: 17px; height: 17px; stroke-width: 2.4; }
.vx-import.alt { background: var(--soft); color: #e4e4e7; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.vx-import.alt:hover { background: rgba(255,255,255,.08); }
.vx-import.rec { background: #ef4444; color: #fff; box-shadow: none; }
.vx-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vx-pair > * { width: 100%; }
.vx-import + .vx-tiles, .vx-pair + .vx-list { margin-top: 16px; }
.vx-none { grid-column: 1 / -1; margin: 22px 0 0; color: #52525b; font-size: 12.5px; text-align: center; }
.vx-list { display: grid; gap: 6px; }
.vx-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px 8px 8px; border: 0; border-radius: 12px; background: var(--soft); color: #e4e4e7; font: 600 12.5px Inter, system-ui, sans-serif; text-align: left; cursor: pointer; transition: background .2s; }
.vx-item:hover { background: rgba(255,255,255,.08); }
.vx-item > i { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 9px; background: rgba(21,128,61,.22); color: #4ade80; }
.vx-item > i.v { background: rgba(2,132,199,.22); color: #38bdf8; }
.vx-item span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.vx-item small { flex: none; color: #71717a; font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* Inspector sections */
.vx-sec { border-bottom: 1px solid var(--line); }
.vx-sec > summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; list-style: none; cursor: pointer; color: #d4d4d8; font-size: 13px; font-weight: 700; user-select: none; }
.vx-sec > summary::-webkit-details-marker { display: none; }
.vx-sec > summary svg { width: 16px; height: 16px; color: #8b8b96; }
.vx-sec > summary .vx-chev { margin-left: auto; transition: transform .25s; }
.vx-sec[open] > summary .vx-chev { transform: rotate(180deg); }
.vx-sec > summary em { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: rgba(167,139,250,.14); color: #c4b5fd; font-size: 11px; font-style: normal; font-weight: 700; }
.vx-sec > summary em + .vx-chev { margin-left: 8px; }
.vx-sec > summary:hover { color: #fff; }
.vx-sec-b { padding: 0 16px 18px; }
.vx-h3 { margin: 16px 0 8px; color: #71717a; font-size: 11px; font-weight: 700; }
.vx-h3:first-child { margin-top: 0; }
.vx-hint { margin: 10px 0 0; color: #71717a; font-size: 12px; line-height: 1.5; }
.vx-row { display: flex; align-items: center; gap: 8px; }
.vx-row + .vx-row, .vx-slide + .vx-row, .vx-chips + .vx-row, .vx-switch + .vx-row { margin-top: 12px; }

/* Controls */
.vx-slide { display: grid; grid-template-columns: 84px minmax(0, 1fr) 42px; align-items: center; gap: 10px; margin-top: 10px; color: #a1a1aa; font-size: 12.5px; font-weight: 600; }
.vx-slide input { width: 100%; accent-color: #f4f4f5; }
.vx-slide b { color: #e4e4e7; font-size: 12px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.vx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vx-chips button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: var(--soft); color: #d4d4d8; font: 600 12.5px Inter, system-ui, sans-serif; cursor: pointer; transition: background .2s, color .2s; }
.vx-chips button:hover { background: rgba(255,255,255,.09); }
.vx-chips button[aria-pressed="true"] { background: var(--btn); color: #0b0b10; }
.vx-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: #d4d4d8; font-size: 13px; font-weight: 600; cursor: pointer; }
.vx-switch input { position: absolute; opacity: 0; pointer-events: none; }
.vx-switch i { order: 2; flex: none; position: relative; width: 38px; height: 22px; border-radius: 22px; background: rgba(255,255,255,.14); transition: background .2s; }
.vx-switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.vx-switch input:checked + i { background: #22c55e; }
.vx-switch input:checked + i::after { transform: translateX(16px); }
.vx-switch input:focus-visible + i { outline: 2px solid var(--acc2); outline-offset: 2px; }
.vx-btn { display: inline-flex; flex: 1; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--soft); color: #e4e4e7; font: 600 12.5px Inter, system-ui, sans-serif; cursor: pointer; transition: background .2s; }
.vx-btn:hover { background: rgba(255,255,255,.09); color: #fff; }
.vx-btn.wide { width: 100%; }
.vx-btn.primary { background: var(--btn); color: #0b0b10; }
.vx-btn.danger { background: rgba(239,68,68,.12); color: #fca5a5; }
.vx-btn svg { width: 15px; height: 15px; }
.vx-field { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--soft); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); color: #fff; font: 600 14px Inter, system-ui, sans-serif; outline: none; resize: vertical; }
.vx-field:focus { box-shadow: inset 0 0 0 1px rgba(167,139,250,.7); }
.vx-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.vx-colors button, .vx-colors label { position: relative; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); cursor: pointer; overflow: hidden; }
.vx-colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px #0b0b10, 0 0 0 4px #fff; }
.vx-colors label { background: conic-gradient(#ef4444, #f59e0b, #22c55e, #22d3ee, #3b82f6, #a78bfa, #ec4899, #ef4444); }
.vx-colors label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Tile grids (media, text styles, transitions, filters) */
.vx-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vx-tile { position: relative; display: grid; gap: 7px; padding: 0; border: 0; background: none; color: #a1a1aa; font: 600 12px Inter, system-ui, sans-serif; text-align: center; cursor: pointer; }
.vx-tile > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.vx-tile:hover { color: #fff; }
.vx-tile .vx-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px; background: #15151c center / cover no-repeat; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); transition: box-shadow .2s, transform .2s; }
.vx-tile:hover .vx-thumb { box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.vx-tile[aria-pressed="true"] { color: #fff; }
.vx-tile[aria-pressed="true"] .vx-thumb { box-shadow: 0 0 0 2px #fff; }
.vx-tile .vx-thumb img, .vx-tile .vx-thumb canvas { width: 100%; height: 100%; object-fit: cover; }
.vx-tile small { color: #71717a; font-size: 10.5px; font-weight: 600; }
.vx-badge { position: absolute; right: 5px; bottom: 5px; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.72); color: #fff; font: 600 10px Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.vx-add { position: absolute; left: 5px; top: 5px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: rgba(0,0,0,.65); color: #fff; opacity: 0; transition: opacity .2s; }
.vx-tile:hover .vx-add, .vx-tile:focus-visible .vx-add { opacity: 1; }
.vx-add svg { width: 14px; height: 14px; stroke-width: 2.6; }
.vx-tile[draggable="true"] { cursor: grab; }

/* ---------- Stage: preview ---------- */
.vx-stage { grid-area: stage; position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #050508; }
.vx-view { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 20px; }
.vx-screen { position: relative; max-width: 100%; max-height: 100%; aspect-ratio: var(--ar, 16 / 9); background: #000; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 30px 70px -30px rgba(0,0,0,.9); overflow: hidden; container-type: size; }
.vx-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.vx-screen .vx-hit { position: absolute; inset: 0; touch-action: none; }
.vx-screen.picking .vx-hit { cursor: crosshair; }
.vx-box { position: absolute; border: 1.5px solid #fff; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); pointer-events: none; }
.vx-box i { position: absolute; right: -8px; bottom: -8px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.6); pointer-events: auto; cursor: nwse-resize; touch-action: none; }
.vx-empty { position: absolute; inset: 20px; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 30px; border-radius: 20px; text-align: center; cursor: pointer;
  background: rgba(10,10,14,.85) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='20' ry='20' fill='none' stroke='rgba(255,255,255,.16)' stroke-width='3' stroke-dasharray='14 12' stroke-linecap='round'/%3E%3C/svg%3E"); }
.vx-empty:hover, .vx-stage.drag .vx-empty { background-color: rgba(14,12,22,.92); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='20' ry='20' fill='none' stroke='rgba(167,139,250,.6)' stroke-width='3' stroke-dasharray='14 12' stroke-linecap='round'/%3E%3C/svg%3E"); }
.vx-empty > svg { width: 40px; height: 40px; color: #c4b5fd; stroke-width: 1.6; }
.vx-empty b { color: #fafafa; font-size: 18px; font-weight: 700; }
.vx-empty small { color: #52525b; font-size: 12px; }
.vx-empty .mx-primary { height: 44px; margin-top: 4px; padding: 0 22px; font-size: 14px; }

/* ---------- Timeline ---------- */
.vx-tl { grid-area: tl; position: relative; display: flex; flex-direction: column; height: var(--tl); min-height: 0; border-top: 1px solid var(--line); background: var(--deep); transition: height .3s cubic-bezier(.22,1,.36,1); }
.vx-tl-grip { position: absolute; left: 0; right: 0; top: -4px; height: 8px; cursor: ns-resize; z-index: 8; }
/* one bar: edit tools · play controls (centred) · zoom */
.vx-tl-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; min-height: 52px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.vx-tb-l, .vx-tb-c, .vx-tb-r { display: flex; align-items: center; gap: 4px; }
.vx-tb-c { gap: 6px; }
.vx-tool { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px; border: 0; border-radius: 9px; background: none; color: #d4d4d8; font: 600 12.5px Inter, system-ui, sans-serif; white-space: nowrap; cursor: pointer; transition: background .2s, color .2s, opacity .2s; }
.vx-tool:hover:not(:disabled) { background: rgba(255,255,255,.07); color: #fff; }
.vx-tool:disabled { opacity: .3; cursor: default; }
.vx-tool.on { color: #f87171; }
.vx-tool svg { width: 16px; height: 16px; }
.vx-tb-r { justify-content: flex-end; }
.vx-time { min-width: 58px; color: #fff; font: 600 12.5px Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; text-align: right; }
.vx-time.dim { color: #71717a; text-align: left; }
.vx-play { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: #000; cursor: pointer; transition: transform .15s; }
.vx-play:active { transform: scale(.93); }
.vx-play svg { width: 16px; height: 16px; fill: #000; stroke: none; }
.vx-play .i-play { margin-left: 2px; }
.vx-play .i-pause, .vx.playing .vx-play .i-play { display: none; }
.vx.playing .vx-play .i-pause { display: block; }
.vx-tb-r .vx-zoom { width: 96px; accent-color: #f4f4f5; }
.vx-tl { container-type: inline-size; }
.vx-tb-l, .vx-tb-r { min-width: 0; overflow: hidden; }
/* a narrow timeline (big-timeline mode beside open panels) keeps just the essentials */
@container (max-width: 1100px) { .vx-tool span { display: none; } .vx-tool { padding: 0 9px; } }
@container (max-width: 640px) { .vx-tb-r .vx-zoom, .vx-tb-c [data-vx="start"], .vx-tb-c [data-vx="end"] { display: none; } .vx-tl-bar { gap: 6px; padding: 0 6px; } }
@container (max-width: 470px) { .vx-tb-r [data-vx="zoom-in"], .vx-tb-r [data-vx="zoom-out"], .vx-time.dim { display: none; } }
.vx-tb-r .vx-ib svg, .vx-tb-l .vx-ib svg { width: 17px; height: 17px; }

.vx-tl-wrap { position: relative; flex: 1; min-height: 0; }
.vx-tl-scroll { position: absolute; inset: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #2a2a31 transparent; touch-action: pan-x pan-y; overscroll-behavior: contain; }
.vx-tl-inner { position: relative; min-height: 100%; }
.vx-ruler { position: sticky; top: 0; z-index: 5; height: 28px; border-bottom: 1px solid var(--line); background: var(--deep); cursor: pointer; touch-action: none; }
.vx-rc { position: sticky; left: 0; z-index: 1; display: block; width: var(--pad); height: 100%; border-right: 1px solid var(--line); background: var(--panel); }
.vx-ruler > i { position: absolute; bottom: 0; width: 1px; height: 4px; background: #3a3a43; }
.vx-ruler > i.mid { height: 7px; background: #4d4d57; }
.vx-ruler > i.big { height: 12px; background: #8b8b96; }
.vx-ruler > span { position: absolute; top: 3px; margin-left: 5px; color: #b4b4bd; font: 600 10.5px Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vx.zooming, .vx.zooming * { cursor: ns-resize !important; }
.vx-rows { background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 1px, transparent 1px var(--grid, 100px)); background-position: var(--pad) 0; background-repeat: repeat; }
.vx-rows { position: relative; padding: 6px 0 14px; }
.vx-lane { position: relative; height: var(--h, 44px); margin: 0 0 4px; }
.vx-lane::before { content: ""; position: absolute; left: var(--pad); right: 0; top: 0; bottom: 0; background: rgba(255,255,255,.016); transition: background .15s, box-shadow .15s; }
.vx-lane.main::before { background: rgba(255,255,255,.03); }
.vx-lane.drop::before { background: rgba(167,139,250,.1); box-shadow: inset 0 0 0 1px rgba(167,139,250,.5); }
.vx-lane.hid .vx-clip { opacity: .35; }
/* "+ Track" in the corner above the track names, and its menu */
.vx-addtrack { display: inline-flex; align-items: center; gap: 5px; height: 20px; margin: 3px 0 0 8px; padding: 0 8px 0 6px; border: 0; border-radius: 6px; background: rgba(255,255,255,.07); color: #d4d4d8; font: 600 11px Inter, system-ui, sans-serif; cursor: pointer; transition: background .2s, color .2s; }
.vx-addtrack:hover { background: rgba(255,255,255,.14); color: #fff; }
.vx-addtrack svg { width: 12px; height: 12px; stroke-width: 2.6; }
.vx-tmenu { position: absolute; z-index: 30; display: grid; min-width: 168px; padding: 6px; border-radius: 12px; background: #15151c; box-shadow: 0 0 0 1px rgba(255,255,255,.09), 0 18px 40px -10px rgba(0,0,0,.8); }
.vx-tmenu button { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: #e4e4e7; font: 600 13px Inter, system-ui, sans-serif; text-align: left; cursor: pointer; }
.vx-tmenu button:hover { background: rgba(255,255,255,.07); }
.vx-tmenu svg { width: 16px; height: 16px; color: #a1a1aa; }
.vx-cmenu { position: fixed; z-index: 2147483001; min-width: 210px; }
.vx-cmenu, .vx-cmenu * { box-sizing: border-box; font-family: Inter, "Segoe UI", system-ui, sans-serif; }
.vx-cmenu[hidden] { display: none; }
.vx-cmenu svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.vx-cmenu button:disabled { opacity: .35; cursor: default; }
.vx-cmenu button.danger { color: #fca5a5; }
.vx-cmenu button.danger svg { color: #fca5a5; }
.vx-cmenu span { flex: 1; }
.vx-cmenu kbd { color: #71717a; font: 600 11px Inter, system-ui, sans-serif; }
.vx-cmenu hr { height: 1px; margin: 5px 4px; border: 0; background: var(--line); }
/* track names, pinned on the left */
.vx-lh { position: sticky; left: 0; z-index: 4; display: flex; align-items: center; gap: 8px; width: var(--pad); height: 100%; padding: 0 6px 0 12px; border-right: 1px solid var(--line); background: var(--panel); }
.vx-lh-ic { display: grid; place-items: center; color: #6b6b76; }
.vx-lh-ic svg { width: 15px; height: 15px; }
.vx-lane.main .vx-lh-ic { color: #a5a0f0; }
.vx-lane.over .vx-lh-ic { color: #5ec8d2; }
.vx-lane.text .vx-lh-ic { color: #c79bf0; }
.vx-lane.music .vx-lh-ic { color: #4ade80; }
.vx-lh b { flex: 1; min-width: 0; overflow: hidden; color: #a1a1aa; font-size: 11.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.vx-lb { display: grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px; background: none; color: #6b6b76; cursor: pointer; transition: background .2s, color .2s; }
.vx-lb:hover { background: rgba(255,255,255,.07); color: #fff; }
.vx-lb.off { color: #f87171; }
.vx-lb svg { width: 15px; height: 15px; }
.vx-lane-add { position: absolute; left: calc(var(--pad) + 10px); top: 50%; z-index: 1; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border: 0; border-radius: 8px; background: none; color: #52525b; font: 600 11.5px Inter, system-ui, sans-serif; white-space: nowrap; cursor: pointer; transition: background .2s, color .2s; }
.vx-lane-add:hover { background: rgba(255,255,255,.06); color: #fff; }
.vx-lane-add svg { width: 13px; height: 13px; stroke-width: 2.4; }
/* clips */
.vx-clip { position: absolute; top: 0; z-index: 1; height: 100%; overflow: hidden; border-radius: 7px; background: var(--cc, var(--c-main)); color: #fff; cursor: pointer; touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.vx-clip.over { --cc: var(--c-over); }
.vx-clip.text { --cc: var(--c-text); }
.vx-clip.music { --cc: var(--c-music); }
.vx-clip.voice { --cc: var(--c-voice); }
.vx-frames { position: absolute; inset: 0; pointer-events: none; }
.vx-frames i { position: absolute; top: 0; bottom: 0; background-image: var(--sp); background-size: calc(var(--sn) * 100%) 100%; background-repeat: no-repeat; box-shadow: inset -1px 0 rgba(0,0,0,.35); }
.vx-clip .vx-strip { position: absolute; top: 0; bottom: 0; background-repeat: no-repeat; background-size: 100% 100%; opacity: .9; pointer-events: none; }
.vx-clip svg.vx-wave { position: absolute; top: 0; bottom: 0; height: 100%; width: auto; overflow: visible; pointer-events: none; }
.vx-clip svg.vx-wave path { fill: rgba(255,255,255,.5); stroke: none; }
.vx-clip .vx-cl { position: absolute; left: 8px; right: 8px; top: 4px; overflow: hidden; color: #fff; font: 600 11px/1.2 Inter, system-ui, sans-serif; text-shadow: 0 1px 2px rgba(0,0,0,.8); white-space: nowrap; text-overflow: ellipsis; pointer-events: none; }
.vx-clip .vx-cl em { margin-left: 5px; padding: 0 4px; border-radius: 4px; background: rgba(0,0,0,.45); font-style: normal; font-size: 10px; }
.vx-clip.text .vx-cl { top: 50%; transform: translateY(-50%); }
.vx-clip.muted::after { content: ""; position: absolute; right: 7px; bottom: 5px; width: 13px; height: 13px; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M11 5 6 9H2v6h4l5 4zM22 9l-6 6M16 9l6 6'/%3E%3C/svg%3E"); filter: drop-shadow(0 1px 2px rgba(0,0,0,.8)); }
.vx-clip.sel { z-index: 2; box-shadow: inset 0 0 0 2px #fff, 0 6px 18px -6px rgba(0,0,0,.8); touch-action: none; }
.vx-clip .vx-trim { position: absolute; top: 0; bottom: 0; z-index: 2; display: none; width: 12px; background: #fff; cursor: ew-resize; touch-action: none; }
.vx-clip .vx-trim::after { content: ""; position: absolute; left: 5px; top: 32%; bottom: 32%; width: 2px; border-radius: 2px; background: rgba(0,0,0,.4); }
.vx-clip .vx-trim.l { left: 0; border-radius: 7px 0 0 7px; }
.vx-clip .vx-trim.r { right: 0; border-radius: 0 7px 7px 0; }
.vx-clip.sel .vx-trim { display: block; }
.vx-clip.ghost { opacity: .55; }
.vx-fade { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.vx-fade.in { left: 0; background: linear-gradient(90deg, rgba(0,0,0,.55), transparent); }
.vx-fade.out { right: 0; background: linear-gradient(270deg, rgba(0,0,0,.55), transparent); }
.vx-cut { position: absolute; top: 50%; z-index: 3; display: grid; place-items: center; width: 20px; height: 20px; margin: -10px 0 0 -10px; padding: 0; border: 0; border-radius: 6px; background: #1c1c24; color: #a1a1aa; box-shadow: 0 0 0 1px rgba(255,255,255,.2); transform: rotate(45deg); cursor: pointer; transition: background .2s, color .2s; }
.vx-cut svg { width: 11px; height: 11px; transform: rotate(-45deg); stroke-width: 2.6; }
.vx-cut:hover { background: #2a2540; color: #fff; }
.vx-cut.has { background: #fff; color: #0b0b10; }
.vx-cut.sel { box-shadow: 0 0 0 2px var(--acc); }
.vx-ins { position: absolute; top: 0; bottom: 0; z-index: 4; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--acc2); box-shadow: 0 0 10px var(--acc2); pointer-events: none; }
.vx-snapline { position: absolute; top: 28px; bottom: 0; z-index: 4; width: 1px; background: #facc15; pointer-events: none; }
/* the playhead: moves along the timeline, its handle sits on the ruler */
.vx-head { position: absolute; left: -1px; top: 0; bottom: 0; z-index: 6; width: 2px; background: #fff; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.35); will-change: transform; }
.vx-head::before { content: ""; position: absolute; left: -6px; top: 3px; width: 14px; height: 18px; border-radius: 4px 4px 8px 8px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.vx-head.off { opacity: 0; }
.vx.scrubbing, .vx.scrubbing * { cursor: ew-resize !important; }

/* ---------- Phone dock ---------- */
.vx-dock { display: none; }

/* ---------- Export card bits (the card itself is media-engine's .mx-ready) ---------- */
.vx-done-prev { width: 100%; max-height: 46vh; border-radius: 12px; background: #000; }
.vx-prog { display: grid; justify-items: center; gap: 14px; color: #e4e4e7; text-align: center; }
.vx-prog b { font-size: 18px; }
.vx-bar { width: min(320px, 70vw); height: 6px; overflow: hidden; border-radius: 6px; background: rgba(255,255,255,.1); }
.vx-bar i { display: block; width: 0; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--acc2), var(--acc)); transition: width .2s; }
.vx-prog canvas { width: min(320px, 70vw); border-radius: 10px; background: #000; }

/* ---------- Resizable side panels (drag the inner edge) ---------- */
.vx-pgrip { position: absolute; top: 0; bottom: 0; z-index: 9; width: 9px; cursor: ew-resize; touch-action: none; }
.vx-pgrip.r { right: -4px; }
.vx-pgrip.l { left: -4px; }
.vx-pgrip::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 1px; background: transparent; transition: background .2s; }
.vx-pgrip:hover::after, .vx.resizing .vx-pgrip::after { background: var(--acc); }
.vx.lib-shut .vx-lib .vx-pgrip, .vx.insp-shut .vx-insp .vx-pgrip { display: none; }
.vx.resizing { cursor: ew-resize; user-select: none; }
.vx.resizing :is(.vx-lib, .vx-insp, .vx-tl) { transition: none; }

/* ---------- Big timeline (desktop): the preview moves into the right-hand column, the timeline fills the middle ---------- */
.vx-focus-btn[aria-pressed="true"] { background: rgba(255,255,255,.1); color: #fff; }
@media (min-width: 761px) {
  .vx.tl-focus { --side: 400px; grid-template-columns: var(--rail) auto minmax(0, 1fr) var(--side);
    grid-template-rows: auto minmax(180px, 44%) minmax(0, 1fr);
    grid-template-areas: "top top top top" "rail lib tl stage" "rail lib tl insp"; }
  .vx.tl-focus .vx-tl { height: auto; border-top: 0; }
  .vx.tl-focus .vx-tl-grip { display: none; }
  .vx.tl-focus .vx-stage { border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .vx.tl-focus .vx-view { padding: 12px; }
  .vx.tl-focus .vx-empty { inset: 12px; padding: 16px; }
  .vx.tl-focus .vx-empty b { font-size: 15px; }
  .vx.tl-focus .vx-insp, .vx.tl-focus.insp-shut .vx-insp { position: relative; inset: auto; width: auto; box-shadow: none; border-left: 1px solid var(--line); }
  .vx.tl-focus .vx-insp .vx-db { width: auto; }
  .vx.tl-focus.insp-shut .vx-insp { display: none; }
  .vx.tl-focus.insp-shut .vx-stage { grid-row: 2 / 4; }
  .vx.tl-focus .vx-lane { --hk: 1.25; height: calc(var(--h) * 1.25); }
}

/* ---------- Smaller laptops and tablets: the inspector floats over the preview ---------- */
@media (max-width: 1180px) and (min-width: 761px) {
  .vx { --lib: 272px; --insp: 300px; --lh: 116px; }
  .vx-insp { position: absolute; right: 0; top: 58px; bottom: var(--tl); z-index: 20; box-shadow: -20px 0 40px -20px rgba(0,0,0,.8); }
}
@media (max-height: 820px) and (min-width: 761px) { .vx { --tl: 252px; } }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .vx { --tl: 286px; --lh: 46px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "top" "stage" "tl" "dock"; }
  .vx-top { grid-template-columns: minmax(0, 1fr) auto auto; min-height: 52px; padding: 6px 10px; gap: 8px; }
  .vx-title { max-width: 130px; font-size: 14px; }
  .vx-top .vx-hide-m { display: none !important; }
  .vx-top .mx-primary { height: 36px; padding: 0 14px; }
  .vx-rail { display: none; }
  .vx-view { padding: 10px; }
  .vx-tl-grip, .vx-pgrip { display: none !important; }
  .vx-addtrack { margin-left: 6px; padding: 0 5px; }
  .vx-addtrack span { display: none; }
  .vx-tl-bar { grid-template-columns: 1fr auto 1fr; min-height: 48px; padding: 0 8px; }
  .vx-tb-l, .vx-tb-r .vx-zoom, .vx-tb-r [data-vx="zoom-in"], .vx-tb-r [data-vx="zoom-out"] { display: none; }
  .vx-tb-c { grid-column: 2; }
  .vx-time { min-width: 50px; font-size: 12px; }
  .vx-tb-c [data-vx="start"], .vx-tb-c [data-vx="end"] { display: none; }
  .vx-lh { justify-content: center; padding: 0; }
  .vx-lh b, .vx-lb { display: none; }
  .vx-lane-add span { display: none; }
  .vx-lane { height: calc(var(--h) * .8); margin-bottom: 3px; }
  .vx-rows { padding: 4px 0 10px; }
  /* drawers become bottom sheets */
  .vx-lib, .vx-insp { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 2147483000; width: auto !important; max-height: min(64dvh, 560px); border: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -24px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.08); transform: translateY(0); transition: transform .32s cubic-bezier(.22,1,.36,1); padding-bottom: env(safe-area-inset-bottom); }
  .vx.lib-shut .vx-lib, .vx.insp-shut .vx-insp { transform: translateY(105%); width: auto; border: 0; box-shadow: none; }
  .vx-lib .vx-db, .vx-insp .vx-db { width: auto; }
  .vx-dh { min-height: 52px; }
  .vx-dh::before { content: ""; position: absolute; left: 50%; top: 6px; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: rgba(255,255,255,.2); }
  .vx-scrim { position: fixed; inset: 0; z-index: 2147482999; background: rgba(0,0,0,.45); }
  .vx-dock { grid-area: dock; display: flex; gap: 2px; overflow-x: auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--panel); scrollbar-width: none; }
  .vx-dock::-webkit-scrollbar { display: none; }
  .vx-dock button { flex: 1 0 auto; min-width: 62px; display: grid; justify-items: center; gap: 4px; padding: 7px 6px; border: 0; border-radius: 12px; background: none; color: #a1a1aa; font: 600 10.5px Inter, system-ui, sans-serif; cursor: pointer; }
  .vx-dock button svg { width: 21px; height: 21px; }
  .vx-dock button:active { background: rgba(255,255,255,.07); }
  .vx-dock button.danger { color: #fca5a5; }
  .vx-dock button.back { flex: 0 0 auto; min-width: 48px; color: #fff; }
  .vx-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vx-add { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .vx * { transition: none !important; } }
