/* Video editor styles: the media bin (left), the viewer over the timeline (centre), the AI assistant (right), Properties. */
#main { display: flex; flex-direction: row; flex: 1; min-width: 0; min-height: 0; background: var(--panel); }
#vi-left, #vi-side { min-height: 0; }
.vi-pane { display: flex; flex-direction: column; min-height: 0; border-bottom: 1px solid var(--line); }
.vi-pane.grow { flex: 1; border-bottom: 0; }
#vi-assist-pane { display: flex; flex-direction: column; min-height: 0; }
#vi-props { flex: 1; min-height: 0; overflow: auto; padding: 0 0 12px; }
#vi-bin { flex: 1; min-height: 0; overflow: auto; }

/* the media bin */
.vi-bin { display: flex; flex-direction: column; gap: 6px; padding: 6px; }
.vi-add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: none; color: var(--text-2); font: inherit; font-size: var(--fs); cursor: pointer; }
.vi-add:hover { border-color: var(--prog); color: var(--prog-strong); }
.vi-add .material-symbols-outlined { font-size: var(--ic); }
.vi-adding { font-size: var(--fs-s); color: var(--prog-strong); }
.vi-media { display: flex; flex-direction: column; gap: 2px; }
.vi-m { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: var(--radius); cursor: grab; outline: none; position: relative; }
.vi-m:hover { background: var(--line-soft); }
.vi-m:focus-visible { box-shadow: inset 0 0 0 2px var(--prog); }
.vi-m.found { box-shadow: inset 0 0 0 2px var(--find-cur); background: color-mix(in srgb, var(--find-cur) 14%, transparent); }
.vi-m-thumb { width: 64px; height: 36px; border-radius: var(--radius-xs); flex: none; background: var(--vp-text); }
.vi-m-text { flex: 1; min-width: 0; }
.vi-m-name { font-size: var(--fs-m); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vi-m-meta, .vi-m-st { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vi-m-st { color: var(--prog-strong); }
.vi-m-kind .material-symbols-outlined { font-size: var(--ic-s); color: var(--muted); }
.vi-sub { margin: 10px 2px 2px; }
.vi-titles { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.vi-title-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text-2); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.vi-title-btn:hover { border-color: var(--prog); color: var(--prog-strong); }
.vi-title-btn .material-symbols-outlined { font-size: 20px; }

/* the centre: viewer over timeline */
#vi-center { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
/* content: the viewer is dark in both themes, as a film is shown */
#vi-viewer { position: relative; flex: 1; min-height: 120px; background: #1b1d22; overflow: hidden; }
/* content */
#vi-view { position: absolute; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,0.08); }
#vi-over { position: absolute; inset: 0; width: 100%; height: 100%; }
#vi-timeline { flex: none; height: 42%; min-height: 150px; display: grid; grid-template-columns: 170px minmax(0, 1fr); grid-template-rows: 26px minmax(0, 1fr) 46px; border-top: 1px solid var(--line); background: var(--tl-bg); user-select: none; -webkit-user-select: none; }
#vi-timeline canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.vi-corner { background: var(--tl-ruler); border-right: 1px solid var(--tl-line); border-bottom: 1px solid var(--tl-line); }
#vi-ruler { cursor: pointer; }
.vi-heads { overflow: hidden; border-right: 1px solid var(--tl-line); background: var(--tl-head); position: relative; }
.vi-heads-in { position: absolute; left: 0; right: 0; top: 0; }
.vi-tl-wrap { position: relative; min-height: 0; overflow: hidden; }
/* the project overview along the bottom (video/overview.js) */
.vi-ov-head { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 4px 8px; font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--tl-line); border-right: 1px solid var(--tl-line); background: var(--tl-head); }
#vi-ov-fit { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 20px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); color: var(--text-2); cursor: pointer; }
#vi-ov-fit:hover { border-color: var(--prog); color: var(--prog-strong); }
#vi-ov-fit .material-symbols-outlined { font-size: var(--ic-s); }
#vi-overview { border-top: 1px solid var(--tl-line); background: var(--tl-row); }
.vi-head { display: flex; align-items: center; gap: 4px; padding: 0 4px 0 8px; border-bottom: 1px solid var(--tl-line); box-sizing: border-box; cursor: pointer; }
.vi-head.on { background: var(--prog-soft); }
.vi-head.audio { background-color: color-mix(in srgb, var(--ok) 6%, var(--tl-head)); }
.vi-head.audio.on { background: color-mix(in srgb, var(--ok) 16%, var(--tl-head)); }
.vi-head-icon .material-symbols-outlined { font-size: var(--ic-s); color: var(--muted); }
.vi-head-name { flex: 1; min-width: 0; font-size: var(--fs-s); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vi-head-btns { display: flex; }
.vi-hb { width: 22px; height: 22px; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.vi-hb:hover { background: var(--hover); color: var(--text); }
.vi-hb.on { color: var(--danger); }
.vi-hb .material-symbols-outlined { font-size: var(--ic-s); }

/* top bar */
.vi-transport { display: inline-flex; align-items: center; gap: 1px; }
.vi-transport .cmd-btn.active { background: var(--prog-soft); color: var(--prog-strong); }
.vi-time { min-width: 66px; padding: 0 8px; font: 500 var(--fs) var(--font-mono); color: var(--text-2); text-align: left; }

/* properties */
.pf-row.vi-keyed { grid-template-columns: 84px minmax(0, 1fr) 24px; gap: 4px 8px; }
.pf-row.vi-keyed .pf-unit { right: 40px; }
@media (max-width: 1150px) { .pf-row.vi-keyed { grid-template-columns: 74px minmax(0, 1fr) 24px; } }
.vi-key { flex: none; width: 24px; height: 24px; margin-left: 2px; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.vi-key:hover { background: var(--line-soft); color: var(--text); }
/* content: a keyframe's gold, as on the timeline */
.vi-key.has { color: #b8860b; }
/* content */
.vi-key.on { color: #d18b00; }
.vi-key .material-symbols-outlined { font-size: var(--ic-s); }
.vi-text-in { width: 100%; resize: vertical; font: inherit; margin-bottom: 4px; }

/* adding and downloading: a progress line over the editor */
.vi-busy { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); padding: 10px 12px; border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--pop-shadow); font-size: var(--fs); }
.vi-busy-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.vi-busy-bar { flex: none; width: 140px; height: 6px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.vi-busy-bar i { display: block; height: 100%; width: 0; background: var(--prog); transition: width 0.2s; }

/* dialogs */
.vi-q, .vi-songs { display: flex; flex-direction: column; gap: 8px; }
.vi-songs { max-height: 50vh; overflow: auto; }
.vi-q-opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: var(--fs); }
.vi-q-opt:has(input:checked) { border-color: var(--prog); background: var(--prog-soft); }
.vi-q-opt.off { opacity: 0.6; cursor: default; }
.vi-q-text { display: flex; flex-direction: column; }
.vi-q-paid { font-size: var(--fs-s); color: var(--prog-strong); }
.dl-opt { display: flex; align-items: center; gap: 8px; font-size: var(--fs); }

@media (max-width: 700px) {
  #vi-timeline { grid-template-columns: 110px minmax(0, 1fr); }
  .vi-head-btns .vi-hb:last-child { display: none; }
}

/* Make a video with AI (video/aivideo.js – in the AI window of three columns, cutout/studio.js) */
.vi-aiv { display: flex; flex-direction: column; gap: 10px; }
.vi-aiv-h { font-weight: 600; font-size: var(--fs); }
.vi-aiv-what { width: 100%; resize: vertical; min-height: 70px; }
.vi-aiv-row { display: flex; flex-direction: column; gap: 4px; }
.vi-aiv-row[hidden] { display: none; }
.vi-aiv-k { font-size: var(--fs-m); color: var(--text-2); }
.vi-aiv-pic { display: flex; gap: 10px; align-items: flex-start; }
.vi-aiv-pic img { width: 112px; height: 72px; object-fit: cover; border-radius: var(--radius-s); background: var(--sunk); flex: none; }
.vi-aiv-picside { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vi-aiv-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.vi-aiv-cost { margin: 0; }
.vi-aiv-res { display: flex; flex-direction: column; gap: 8px; }
/* content: a video is shown on black */
.vi-aiv-video { width: 100%; max-height: 60vh; border-radius: var(--radius); background: #000; }
.vi-aiv-tools { display: flex; flex-wrap: wrap; gap: 6px; }
