/* Video Studio (/video-editor and its task pages). The app frame comes from
   .st-work in app.css; this lays out the editor inside it: menus and Export
   along the top, the library, the picture and the settings in a row, then
   the timeline tools and the timeline. On a phone the library and the
   settings become sheets opened from tabs along the bottom. Gold is only
   under the pointer and on press; what is chosen is purple. */

/* ---- Start screen ---- */
.vs-makers { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.vs-maker-btn, .vs-rec-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 0; font: inherit; text-align: left; cursor: pointer; transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 160ms ease; }
.vs-maker-icon, .vs-rec-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; color: var(--tint-text); background: var(--tint); border-radius: 0; }
.vs-maker-text, .vs-rec-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vs-maker-text b, .vs-rec-text b { font-weight: 600; }
.vs-maker-text small, .vs-rec-text small { color: var(--muted); font-size: 0.78rem; line-height: 1.3; }
.vs-new .st-new-preset { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vs-new .st-new-row > .st-field:not(.st-new-bgfield) { flex: 0 0 auto; }
.vs-new .st-new-row > .st-field .input { width: 104px; }

/* ---- The frame ---- */
.vs-work {
  grid-template-rows: auto minmax(0, 1fr) auto minmax(150px, var(--tl-h, 36%));
  grid-template-columns: minmax(0, 1fr);
  font-size: 13px;
  -webkit-user-select: none;
  user-select: none;
}
.vs-work :is(input, textarea) { -webkit-user-select: text; user-select: text; }
.vs-ib { width: 30px; height: 30px; }
.vs-ib:disabled { opacity: 0.35; cursor: default; }
.vs-ib.is-on, .vs-ib[aria-pressed="true"] { color: var(--tint-text); background: var(--tint); }

.vs-top { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 5px 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
.vs-menubar { display: flex; gap: 2px; flex: none; }
.vs-menubtn { flex: none; color: var(--muted); background: none; border: 0; padding: 5px 10px; border-radius: 0; cursor: pointer; transition: background 140ms ease, color 140ms ease; }
.vs-menubtn.is-open { color: var(--text); background: var(--tint); }
.vs-menubtn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.vs-name { flex: 1 1 auto; min-width: 60px; max-width: 360px; margin: 0 auto; padding: 5px 10px; color: var(--text); background: none; border: 1px solid transparent; border-radius: 0; font: inherit; font-weight: 600; text-align: center; outline: none; text-overflow: ellipsis; }
.vs-name:focus-visible { border-color: var(--accent); background: var(--surface-2); box-shadow: var(--focus-ring); }
.vs-top-btns { display: flex; align-items: center; gap: 2px; flex: none; }
.vs-export { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }

.vs-menu { position: absolute; z-index: 40; min-width: 240px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow); }
.vs-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; padding: 6px 10px; color: var(--text); background: none; border: 0; border-radius: 0; font: inherit; text-align: left; cursor: pointer; }
.vs-menu-item:disabled { color: var(--faint); cursor: default; }
.vs-menu-head { margin: 6px 10px 2px; color: var(--accent-strong); font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; }
.vs-menu-item.is-on::after { content: "✓"; color: var(--tint-text); }
.vs-menu-item kbd { color: var(--faint); font-family: var(--mono); font-size: 0.7rem; }
.vs-menu-item:focus-visible { outline: none; background: var(--tint); }

.vs-body { position: relative; display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; min-height: 0; }
.vs-sheet-close { display: none; }

/* ---- Library ---- */
.vs-lib { display: grid; grid-template-columns: 64px minmax(0, 1fr); min-height: 0; background: var(--surface); border-right: 1px solid var(--border); }
.vs-lib-tabs { display: flex; flex-direction: column; gap: 2px; padding: 6px 4px; overflow-y: auto; scrollbar-width: none; border-right: 1px solid var(--border); }
.vs-lib-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px; color: var(--muted); background: none; border: 0; border-radius: 0; font: inherit; font-size: 0.64rem; cursor: pointer; transition: background 140ms ease, color 140ms ease; }
.vs-lib-tab.is-active { color: var(--tint-text); background: var(--tint); }
.vs-lib-tab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.vs-lib-body { min-height: 0; padding: 10px 12px 16px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.vs-lib-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 8px; }
.vs-lib-head:first-child { margin-top: 2px; }
.vs-lib-title { margin: 0; color: var(--accent-strong); font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.vs-lib-head .btn { display: inline-flex; align-items: center; gap: 5px; }
.vs-lib-hint, .vs-insp-hint { margin: 6px 0; color: var(--muted); font-size: 0.78rem; line-height: 1.4; -webkit-user-select: text; user-select: text; }
.vs-lib-hint.is-note { padding: 10px 12px; background: var(--surface-2); border-radius: 0; }
.vs-insp-hint.is-error { color: var(--danger); }
.vs-row-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.vs-row-btns .btn { display: inline-flex; align-items: center; gap: 5px; }

.vs-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vs-tile { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; cursor: grab; }
.vs-tile-pic { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; background: #0b0914; border: 1px solid var(--border); border-radius: 0; transition: border-color 140ms ease; }
.vs-tile-pic canvas { width: 100%; height: 100%; object-fit: cover; }
.vs-tile-pic.is-audio { background: var(--surface-2); }
.vs-tile-pic.is-audio canvas { object-fit: contain; }
.vs-tile-len { position: absolute; top: 5px; left: 5px; padding: 1px 5px; color: #fff; background: rgba(8, 6, 16, 0.72); border-radius: 0; font-family: var(--mono); font-size: 0.62rem; }
.vs-tile-name { overflow: hidden; color: var(--muted); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.vs-tile-add { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; color: #fff; background: var(--accent); border: 0; border-radius: 0; box-shadow: 3px 3px 0 var(--edge); cursor: pointer; transition: background 140ms ease, color 140ms ease, transform 160ms ease; }
.vs-tile-add:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.vs-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 6px; }
.vs-swatch { aspect-ratio: 1; padding: 0; background: var(--c); border: 1px solid var(--border); border-radius: 0; cursor: pointer; transition: box-shadow 140ms ease, transform 160ms ease; }
.vs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vs-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 0; font: inherit; font-size: 0.78rem; cursor: pointer; transition: background 140ms ease, color 140ms ease, border-color 140ms ease; }

.vs-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vs-style { display: grid; place-items: center; min-height: 58px; padding: 6px; background: #0b0914; border: 1px solid var(--border); border-radius: 0; cursor: pointer; transition: border-color 140ms ease, transform 160ms ease; }
.vs-style-face { max-width: 100%; padding: 1px 6px; overflow: hidden; border-radius: 0; font-size: 1rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.vs-stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; }
.vs-sticker { aspect-ratio: 1; padding: 0; background: none; border: 1px solid transparent; border-radius: 0; font-size: 1.4rem; cursor: pointer; transition: background 140ms ease, border-color 140ms ease; }

.vs-looks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vs-look { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 0; color: var(--muted); background: none; border: 0; font: inherit; font-size: 0.7rem; text-align: center; cursor: pointer; }
.vs-look:disabled { cursor: default; opacity: 0.55; }
.vs-look-pic, .vs-tr-pic { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: linear-gradient(135deg, #f0a35e, #8b5cf6 55%, #2a6fd6); border: 2px solid transparent; border-radius: 0; transition: border-color 140ms ease; }
.vs-look-pic canvas { width: 100%; height: 100%; object-fit: cover; }
.vs-look-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-look.is-active { color: var(--tint-text); }
.vs-look.is-active :is(.vs-look-pic, .vs-tr-pic) { border-color: var(--accent-strong); box-shadow: 0 0 0 2px var(--tint); }

/* A transition's tile: two halves, the second coming in over the first. */
.vs-tr-pic { background: #f0a35e; }
.vs-tr-pic i, .vs-tr-pic b { position: absolute; inset: 0; }
.vs-tr-pic i { background: linear-gradient(135deg, #f0a35e, #e86f5e); }
.vs-tr-pic b { background: linear-gradient(135deg, #8b5cf6, #2a6fd6); animation: vs-tr-in 2.4s ease-in-out infinite; }
.vs-tr-pic.is-none { background: repeating-linear-gradient(45deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); }
@keyframes vs-tr-in { 0%, 20% { opacity: 0; } 55%, 100% { opacity: 1; } }
.vs-tr-pic:is(.is-slide-left, .is-push-left) b { animation-name: vs-tr-left; }
.vs-tr-pic:is(.is-slide-right, .is-push-right) b { animation-name: vs-tr-right; }
.vs-tr-pic:is(.is-slide-up, .is-push-up) b { animation-name: vs-tr-up; }
.vs-tr-pic:is(.is-slide-down, .is-push-down) b { animation-name: vs-tr-down; }
.vs-tr-pic:is(.is-wipe-left, .is-wipe-right) b { animation-name: vs-tr-wipe; }
.vs-tr-pic:is(.is-zoom-in, .is-zoom-out, .is-spin) b { animation-name: vs-tr-zoom; }
.vs-tr-pic:is(.is-circle, .is-iris) b { animation-name: vs-tr-circle; }
.vs-tr-pic.is-black i { animation: vs-tr-dark 2.4s ease-in-out infinite; }
.vs-tr-pic.is-white i { animation: vs-tr-light 2.4s ease-in-out infinite; }
@keyframes vs-tr-left { 0%, 20% { transform: translateX(100%); } 55%, 100% { transform: none; } }
@keyframes vs-tr-right { 0%, 20% { transform: translateX(-100%); } 55%, 100% { transform: none; } }
@keyframes vs-tr-up { 0%, 20% { transform: translateY(100%); } 55%, 100% { transform: none; } }
@keyframes vs-tr-down { 0%, 20% { transform: translateY(-100%); } 55%, 100% { transform: none; } }
@keyframes vs-tr-wipe { 0%, 20% { clip-path: inset(0 100% 0 0); } 55%, 100% { clip-path: inset(0 0 0 0); } }
@keyframes vs-tr-zoom { 0%, 20% { transform: scale(0); opacity: 0; } 55%, 100% { transform: none; opacity: 1; } }
@keyframes vs-tr-circle { 0%, 20% { clip-path: circle(0 at 50% 50%); } 55%, 100% { clip-path: circle(75% at 50% 50%); } }
@keyframes vs-tr-dark { 0%, 20% { filter: none; } 38% { filter: brightness(0); } 100% { filter: brightness(0); } }
@keyframes vs-tr-light { 0%, 20% { filter: none; } 38% { filter: brightness(3); } 100% { filter: brightness(3); } }

.vs-fx { margin: 0 0 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 0; overflow: hidden; }
.vs-fx.is-on { background: var(--tint); border-color: var(--tint-border); }
.vs-fx-btn { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 8px 11px; color: var(--text); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; transition: background 140ms ease, color 140ms ease; }
.vs-fx-btn:disabled { color: var(--faint); cursor: default; }
.vs-fx-name { font-weight: 600; }
.vs-fx-line { color: var(--muted); font-size: 0.74rem; }
.vs-fx .vs-slider { padding: 0 11px 9px; }

.vs-rec-card { width: 100%; margin: 0 0 8px; }

/* ---- Viewer ---- */
.vs-viewer { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: #0b0914; }
.vs-stage { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; touch-action: none; }
.vs-canvas { display: block; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 3px 3px 0 var(--edge); }
.vs-app.is-picking .vs-canvas { cursor: crosshair; }
.vs-pool { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.vs-pool video { width: 1px; height: 1px; }
.vs-box { position: absolute; left: 0; top: 0; border: 1.5px solid var(--accent-strong); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); cursor: move; touch-action: none; }
.vs-box[hidden] { display: none; }
.vs-h { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--accent); border-radius: 0; box-shadow: 3px 3px 0 var(--edge); }
.vs-h.is-nw { left: -7px; top: -7px; cursor: nwse-resize; }
.vs-h.is-ne { right: -7px; top: -7px; cursor: nesw-resize; }
.vs-h.is-sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.vs-h.is-se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.vs-h.is-rot { left: 50%; top: -30px; margin-left: -7px; width: 14px; height: 14px; border-radius: 50%; cursor: grab; }
.vs-h.is-rot::after { content: ""; position: absolute; left: 50%; top: 12px; width: 1.5px; height: 14px; margin-left: -0.75px; background: var(--accent-strong); }
.vs-guide { position: absolute; z-index: 2; display: none; background: #ff4fd8; pointer-events: none; }
.vs-guide.is-on { display: block; }
.vs-guide-v { left: 50%; top: 0; bottom: 0; width: 1px; }
.vs-guide-h { top: 50%; left: 0; right: 0; height: 1px; }

.vs-transport { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 5px 10px; background: var(--surface); border-top: 1px solid var(--border); }
.vs-time { font-family: var(--mono); font-size: 0.78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vs-now { color: var(--text); }
.vs-total-sep { margin: 0 5px; color: var(--faint); }
.vs-total { color: var(--muted); }
.vs-transport-btns { display: flex; align-items: center; gap: 2px; }
.vs-transport > .vs-ib:last-child { justify-self: end; }
.vs-play { display: grid; place-items: center; width: 38px; height: 38px; margin: 0 4px; padding: 0; color: var(--fill-text); background: var(--fill); border: 0; border-radius: 50%; cursor: pointer; transition: background 140ms ease, color 140ms ease, transform 160ms ease; }
.vs-play:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.vs-play .vs-i-pause, .vs-app.is-playing .vs-play .vs-i-play { display: none; }
.vs-app.is-playing .vs-play .vs-i-pause { display: block; }

/* ---- Settings ---- */
.vs-insp { min-height: 0; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--border); scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.vs-insp-body { padding: 10px 12px 20px; }
.vs-insp-title { margin: 2px 0 4px; overflow: hidden; color: var(--text); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.vs-insp-kind { color: var(--accent-strong); font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.vs-insp-times { margin-top: 0; font-family: var(--mono); font-size: 0.72rem; }
.vs-sec { margin: 8px 0 0; border-top: 1px solid var(--border); }
.vs-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 2px 8px; color: var(--text); font-weight: 600; cursor: pointer; list-style: none; }
.vs-sec-head::-webkit-details-marker { display: none; }
.vs-sec-head::after { content: ""; width: 7px; height: 7px; margin-right: 4px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); transition: transform 160ms ease; }
.vs-sec:not([open]) > .vs-sec-head::after { transform: rotate(-45deg); }
.vs-sec-head:focus-visible { outline: none; border-radius: 0; box-shadow: var(--focus-ring); }
.vs-sec-body { display: flex; flex-direction: column; gap: 9px; padding: 0 0 12px; }
.vs-fxs-item { display: flex; flex-direction: column; gap: 8px; }
.vs-fxs-head { display: flex; align-items: center; gap: 4px; }
.vs-fxs-name { flex: 1; font-weight: 600; color: var(--text); }
.vs-fxs-head .btn { padding: 4px 6px; }
.vs-fxs-rule { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--border); }

.vs-field { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vs-field.is-block { flex-direction: column; align-items: stretch; gap: 6px; }
.vs-field-label { flex: 0 0 76px; color: var(--muted); font-size: 0.76rem; }
.vs-field.is-block .vs-field-label { flex: none; }
.vs-slider .vs-range { flex: 1 1 auto; width: auto; min-width: 40px; }
.vs-slider.is-wide { flex-wrap: wrap; }
.vs-numwrap { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.vs-num { width: 58px; }
.vs-number .vs-num { width: 76px; }
.vs-choice { align-items: flex-start; }
.vs-choice .vs-field-label { padding-top: 5px; }
.vs-seg { flex: 1 1 auto; flex-wrap: wrap; margin: 0; }
.vs-select { flex: 1 1 auto; min-width: 0; }
.vs-colour { flex: none; width: 40px; height: 28px; padding: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 0; cursor: pointer; }
.vs-colour-field { justify-content: flex-start; }
.vs-check { font-size: 0.8rem; line-height: 1.3; }
.vs-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.vs-pair > .vs-field { flex-direction: column; align-items: stretch; gap: 4px; }
.vs-pair > .vs-field .vs-field-label { flex-basis: auto; }
.vs-pair .vs-numwrap { min-width: 0; }
.vs-pair .vs-num { flex: 1 1 auto; width: 100%; min-width: 0; }
.vs-pair > .vs-check { flex-direction: row; align-items: center; align-self: end; padding-bottom: 6px; }
.vs-text-input { width: 100%; min-height: 64px; padding: 8px 10px; resize: vertical; font: inherit; }
.vs-keys .vs-key-btn { flex: 1 1 auto; justify-content: center; }
.vs-key-btn { display: inline-flex; align-items: center; gap: 6px; }
.vs-key-btn.is-on { color: var(--tint-text); background: var(--tint); border-color: var(--tint-border); }

/* ---- Timeline tools ---- */
.vs-tools { display: flex; align-items: center; gap: 2px; min-width: 0; padding: 4px 8px; background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.vs-tools-gap { flex: 0 0 10px; }
.vs-msg { flex: 1 1 auto; min-width: 0; margin: 0 8px; overflow: hidden; color: var(--muted); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.vs-msg.is-warn { color: var(--gold); }
.vs-msg.is-error { color: var(--danger); }
.vs-msg.is-ok { color: var(--tint-text); }
.vs-zoom { width: 110px; margin: 0 4px; }

/* ---- Timeline ---- */
.vs-tl { min-height: 0; background: var(--bg-deep); }
.vs-tl-scroll { height: 100%; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; overscroll-behavior: contain; }
.vs-tl-grid { position: relative; min-width: 100%; min-height: 100%; padding-bottom: 28px; }
.vs-ruler-row { position: sticky; top: 0; z-index: 6; display: flex; height: 26px; background: var(--surface); border-bottom: 1px solid var(--border); }
.vs-ruler-corner { position: sticky; left: 0; z-index: 1; flex: 0 0 132px; background: var(--surface); border-right: 1px solid var(--border); }
.vs-ruler { display: block; height: 26px; cursor: ew-resize; touch-action: none; }
.vs-rows { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }
.vs-row { display: flex; height: 44px; }
.vs-row.is-main { height: 62px; }
.vs-row.is-audio { height: 50px; }
.vs-head { position: sticky; left: 0; z-index: 4; display: flex; align-items: center; gap: 4px; flex: 0 0 132px; padding: 0 6px 0 8px; color: var(--muted); background: var(--surface); border-right: 1px solid var(--border); font-size: 0.74rem; }
.vs-row.is-main .vs-head { color: var(--text); }
.vs-head-icon { display: grid; place-items: center; flex: none; }
.vs-head-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-hb { display: grid; place-items: center; flex: none; width: 24px; height: 24px; padding: 0; color: var(--faint); background: none; border: 0; border-radius: 0; cursor: pointer; transition: background 140ms ease, color 140ms ease; }
.vs-hb.is-off { color: var(--danger); }
.vs-hb:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.vs-lane { position: relative; flex: none; height: 100%; }
.vs-row.is-main .vs-lane { background: rgba(139, 92, 246, 0.05); }
.vs-row.is-off .vs-lane { opacity: 0.45; }
.vs-row.is-locked .vs-lane { background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 6px, transparent 6px 12px); }
.vs-lane-hint { position: absolute; left: 12px; top: 50%; margin: 0; color: var(--faint); font-size: 0.76rem; transform: translateY(-50%); white-space: nowrap; pointer-events: none; }

.vs-clip { position: absolute; top: 0; bottom: 0; display: flex; align-items: flex-start; overflow: hidden; color: #fff; background: #3b2d73; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 0; cursor: grab; touch-action: none; outline: none; }
.vs-clip.is-video, .vs-clip.is-gif { background: #2c3a6e; }
.vs-clip.is-image { background: #2d5162; }
.vs-clip.is-audio { background: #1f5a4c; }
.vs-clip.is-text { background: #6a3c86; }
.vs-clip.is-color { background: var(--clip-colour); }
.vs-clip.is-afx { background: repeating-linear-gradient(135deg, #1d4a5a 0 8px, #235868 8px 16px); }
.vs-clip.is-adjust { background: repeating-linear-gradient(135deg, #5a4a1c 0 8px, #6b5822 8px 16px); }
.vs-clip.is-muted .vs-strip { opacity: 0.7; }
.vs-clip.is-picked { z-index: 2; border: 2px solid #fff; box-shadow: 0 0 0 2px var(--accent), 3px 3px 0 var(--edge); }
.vs-clip.is-dragging { z-index: 3; opacity: 0.85; cursor: grabbing; box-shadow: 3px 3px 0 var(--edge); }
.vs-strip { position: absolute; left: 0; top: 0; height: 100%; pointer-events: none; }
.vs-clip-label { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 4px; max-width: calc(100% - 8px); margin: 3px 4px; padding: 1px 6px; overflow: hidden; background: rgba(8, 6, 16, 0.55); border-radius: 0; font-size: 0.68rem; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.vs-clip.is-color .vs-clip-label { color: #fff; }
.vs-clip-badges { position: absolute; right: 4px; bottom: 3px; z-index: 1; padding: 0 5px; background: rgba(8, 6, 16, 0.6); border-radius: 0; font-family: var(--mono); font-size: 0.6rem; pointer-events: none; }
.vs-trim { position: absolute; top: 0; bottom: 0; z-index: 2; width: 10px; cursor: ew-resize; touch-action: none; }
.vs-trim.is-l { left: 0; }
.vs-trim.is-r { right: 0; }
.vs-clip.is-picked .vs-trim { background: #fff; }
.vs-clip.is-picked .vs-trim::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2px; height: 14px; margin: -7px 0 0 -1px; background: var(--accent); border-radius: 0; }
.vs-fade { position: absolute; top: 0; bottom: 0; z-index: 1; pointer-events: none; }
.vs-fade.is-in { left: 0; background: linear-gradient(to bottom right, rgba(8, 6, 16, 0.6) 50%, transparent 50%); }
.vs-fade.is-out { right: 0; background: linear-gradient(to bottom left, rgba(8, 6, 16, 0.6) 50%, transparent 50%); }
.vs-fxspan { position: absolute; z-index: 2; height: 3px; background: var(--accent-strong); pointer-events: none; }
.vs-key { position: absolute; bottom: 3px; z-index: 3; width: 9px; height: 9px; margin-left: -4.5px; background: var(--gold); border: 1px solid var(--edge); transform: rotate(45deg); cursor: pointer; }
.vs-clip:not(.is-picked) .vs-key { width: 7px; height: 7px; margin-left: -3.5px; background: var(--text); }
.vs-cut { position: absolute; top: 50%; z-index: 3; display: grid; place-items: center; width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 0; cursor: pointer; transition: background 140ms ease, color 140ms ease, transform 160ms ease; }
.vs-cut.is-on { color: #fff; background: var(--accent); border-color: transparent; }
.vs-cut:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.vs-tr-span { position: absolute; bottom: 0; z-index: 2; height: 4px; background: var(--accent-strong); border-radius: 0; pointer-events: none; }

.vs-playhead { position: absolute; top: 0; bottom: 0; left: 0; z-index: 7; width: 0; pointer-events: none; }
.vs-playhead::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, 0.6); }
.vs-playhead-knob { position: sticky; top: 0; display: block; width: 14px; height: 16px; margin-left: -7px; background: #fff; border-radius: 0; cursor: ew-resize; pointer-events: auto; touch-action: none; }
.vs-drop-mark { position: absolute; top: 26px; bottom: 0; left: 0; z-index: 7; width: 2px; margin-left: -1px; background: var(--accent-strong); pointer-events: none; }
.vs-drop-mark[hidden] { display: none; }
.vs-app.is-dragover .vs-tl { box-shadow: inset 0 0 0 2px var(--accent-strong); }

.vs-tabs { display: none; }

/* ---- Dialogs ---- */
.vs-maker, .vs-ex-form, .vs-rec-setup { display: flex; flex-direction: column; gap: 12px; }
.vs-maker .vs-field-label, .vs-ex-form .vs-field-label, .vs-rec-setup .vs-field-label { flex-basis: 110px; }
.vs-pick { display: flex; align-items: center; gap: 10px; }
.vs-pick-note { color: var(--muted); font-size: 0.8rem; }
.vs-ex-group { display: flex; flex-direction: column; gap: 12px; }
.vs-ex-group[hidden] { display: none; }
.vs-ex-est { margin: 0; color: var(--tint-text); font-family: var(--mono); font-size: 0.78rem; }
.vs-ex .progress { margin: 6px 0 0; }
.vs-ex .progress-line { display: flex; justify-content: space-between; gap: 10px; }
.vs-ex-done { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.vs-ex-result { display: block; width: 100%; max-height: 46vh; background: #000; border-radius: 0; object-fit: contain; }
.vs-keys-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; }
.vs-key-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--border-soft); }
.vs-keys-list { display: inline-flex; gap: 4px; flex: none; }
.vs-key-row kbd { padding: 2px 7px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 0; font-family: var(--mono); font-size: 0.72rem; white-space: nowrap; }
.vs-keys-grid > .vs-insp-hint { grid-column: 1 / -1; }

.vs-rec-bubble { display: flex; flex-direction: column; gap: 10px; padding-left: 26px; }
.vs-rec-bubble[hidden] { display: none; }
.vs-tp-script { width: 100%; min-height: 140px; resize: vertical; font: inherit; }
.vs-rec-stage { position: relative; display: grid; place-items: center; min-height: 160px; overflow: hidden; background: #000; border-radius: 0; }
.vs-rec-preview { display: block; width: 100%; max-height: 52vh; object-fit: contain; }
.vs-rec-preview.is-mirrored { transform: scaleX(-1); }
.vs-rec-voice { margin: 0; padding: 30px 20px; color: var(--muted); text-align: center; }
.vs-rec-count { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #fff; background: rgba(8, 6, 16, 0.5); font-family: var(--display); font-size: 5rem; font-weight: 800; }
.vs-rec-count[hidden] { display: none; }
.vs-rec-meter { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-family: var(--mono); font-size: 0.82rem; }
.vs-rec-dot { width: 10px; height: 10px; background: #ef4f4f; border-radius: 50%; animation: vs-blink 1s steps(2, start) infinite; }
.vs-rec.is-paused .vs-rec-dot { animation: none; background: var(--muted); }
@keyframes vs-blink { to { visibility: hidden; } }
.vs-rec-size { color: var(--muted); }
.vs-tp-roll { position: absolute; inset: 0; overflow: hidden; padding: 0 8%; background: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.65)); }
.vs-tp-roll.is-mirrored { transform: scaleX(-1); }
.vs-tp-text { padding: 45% 0 100%; color: #fff; font-size: var(--tp-size, 40px); font-weight: 600; line-height: 1.35; text-align: center; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8); white-space: pre-wrap; }
.vs-rec-done { text-align: center; }

/* ---- Under the pointer: gold ---- */
@media (hover: hover) {
  :is(.vs-menubtn, .vs-lib-tab, .vs-lib-tab.is-active, .vs-hb, .vs-cut, .vs-cut.is-on, .vs-chip, .vs-tile-add, .vs-fx-btn:not(:disabled), .vs-maker-btn, .vs-rec-card, .vs-play, .vs-tab):hover,
  .vs-menu-item:not(:disabled):hover {
    color: var(--bg);
    background: var(--gold);
    border-color: var(--gold);
  }
  .vs-menu-item:not(:disabled):hover kbd, .vs-menu-item.is-on:hover::after { color: var(--bg); }
  .vs-maker-btn:hover .vs-maker-icon, .vs-rec-card:hover .vs-rec-icon { color: var(--bg); background: rgba(20, 17, 32, 0.15); }
  .vs-maker-btn:hover small, .vs-rec-card:hover small, .vs-fx-btn:not(:disabled):hover .vs-fx-line { color: var(--bg); }
  .vs-tile:hover .vs-tile-pic, .vs-style:hover, .vs-look:not(:disabled):hover :is(.vs-look-pic, .vs-tr-pic) { border-color: var(--gold); }
  .vs-sticker:hover { border-color: var(--gold); background: var(--surface-2); }
  .vs-swatch:hover { box-shadow: 0 0 0 2px var(--gold); transform: scale(1.08); }
  .vs-clip:not(.is-picked):hover { border-color: var(--gold); }
  .vs-name:hover:not(:focus) { border-color: var(--border); }
  .vs-h:hover { background: var(--gold); border-color: var(--gold); }
}
:is(.vs-menubtn, .vs-lib-tab, .vs-hb, .vs-cut, .vs-chip, .vs-tile-add, .vs-maker-btn, .vs-rec-card, .vs-play, .vs-tab, .vs-sticker, .vs-swatch, .vs-style):active { color: var(--bg); background: var(--gold); border-color: var(--gold); transform: scale(0.95); }

/* ---- Phones: the picture, the timeline, and sheets from tabs ---- */
@media (max-width: 760px) {
  /* Export as its icon alone, as in Image Studio, so it fits beside the menus on a phone. */
  .vs-export span { display: none; }
  .vs-export { margin-left: 2px; }
  .vs-makers { grid-template-columns: 1fr; }
  .vs-new .st-new-preset { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vs-new .st-new-row > .st-field .input { width: 100%; }
  .vs-work { grid-template-rows: auto minmax(180px, 1fr) auto minmax(150px, 34%) auto; }
  .vs-top { gap: 4px; padding: 4px 6px; }
  .vs-menubtn { padding: 5px 7px; }
  .vs-menubtn:nth-child(n + 4) { display: none; }
  .vs-name { display: none; }
  .vs-top-btns { margin-left: auto; }
  #vs-help, #vs-max { display: none; }
  .vs-body { position: static; display: block; }
  .vs-viewer { height: 100%; }
  .vs-sheet { position: absolute; left: 0; right: 0; top: 41px; bottom: 56px; z-index: 20; display: none; height: auto; border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: 0 -16px 36px rgba(0, 0, 0, 0.55); }
  .vs-work[data-sheet="lib"] .vs-sheet.is-lib, .vs-work[data-sheet="insp"] .vs-sheet.is-insp { display: grid; }
  .vs-work[data-sheet="insp"] .vs-sheet.is-insp { display: block; }
  .vs-lib { grid-template-columns: minmax(0, 1fr); }
  .vs-lib-tabs { display: none; }
  .vs-work[data-sheet] .vs-sheet-close { position: absolute; right: 8px; top: 49px; z-index: 21; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 50%; cursor: pointer; }
  .vs-lib-body, .vs-insp-body { padding-right: 48px; }
  .vs-tiles, .vs-styles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vs-looks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vs-transport { padding: 3px 8px; }
  .vs-play { width: 34px; height: 34px; }
  .vs-tools { gap: 0; padding: 3px 4px; overflow-x: auto; scrollbar-width: none; }
  .vs-tools::-webkit-scrollbar { display: none; }
  .vs-tools .vs-ib { width: 36px; height: 36px; }
  .vs-msg { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 25; margin: 0; padding: 0; white-space: normal; pointer-events: none; }
  .vs-msg:not(:empty) { padding: 7px 10px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 0; box-shadow: var(--shadow); }
  .vs-tools { position: relative; overflow: visible; }
  .vs-zoom, #vs-zoom-in, #vs-zoom-out { display: none; }
  .vs-head { flex-basis: 132px; }
  .vs-trim { width: 18px; }
  .vs-tabs { display: flex; height: 56px; overflow-x: auto; background: var(--surface); border-top: 1px solid var(--border); scrollbar-width: none; }
  .vs-tabs::-webkit-scrollbar { display: none; }
  .vs-tab { display: flex; flex: 1 0 50px; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; color: var(--muted); background: none; border: 0; font: inherit; font-size: 0.64rem; cursor: pointer; }
  .vs-tab.is-active { color: var(--tint-text); background: var(--tint); }
  .vs-keys-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .vs-work *, .vs-tr-pic * { transition: none !important; animation: none !important; }
}
.vs-rec-mic { display: grid; gap: 8px; }
.vs-rec-mic-more > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.vs-rec-mic-more[open] > summary { margin-bottom: 8px; }
