:root { --bg:#14161a; --panel:#1d2026; --line:#2c313a; --text:#e6e8eb; --muted:#8b93a1; --accent:#4f8cff; --bad:#ff6b6b; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:14px/1.4 system-ui,sans-serif; }
header { padding:12px 20px; border-bottom:1px solid var(--line); }
h1 { margin:0; font-size:18px; } h2 { margin:0 0 10px; font-size:14px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); } h3 { margin:16px 0 6px; font-size:13px; color:var(--muted); }
main { display:grid; gap:12px; padding:12px; grid-template-columns:300px 1fr 300px; grid-template-areas:"lib ed set" "tl tl tl"; }
#library { grid-area:lib; } #editor { grid-area:ed; } #settings { grid-area:set; } #timeline { grid-area:tl; }
@media (max-width:1000px){ main { grid-template-columns:1fr; grid-template-areas:"ed" "tl" "lib" "set"; } }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:12px; min-width:0; }
.row { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:8px 0; }
.muted { color:var(--muted); font-size:12px; } .list { list-style:none; margin:0; padding:0; max-height:340px; overflow:auto; }
.list li { display:flex; gap:6px; align-items:center; padding:5px 4px; border-bottom:1px solid var(--line); }
.list li .grow { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:default; }
.list li.dir .grow { cursor:pointer; color:var(--accent); }
button, .btn, select, input { background:#262a32; color:var(--text); border:1px solid var(--line); border-radius:5px; padding:5px 9px; font:inherit; }
button, .btn { cursor:pointer; } button:hover, .btn:hover { border-color:var(--accent); }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; width:100%; margin-top:10px; padding:8px; }
button.small { padding:2px 7px; }
#settings label { display:flex; flex-direction:column; gap:3px; margin-bottom:8px; } #settings label.check { flex-direction:row; align-items:center; gap:6px; }
#settings input[type=checkbox] { width:auto; }
#previewBox { position:relative; background:#000; border-radius:6px; min-height:240px; display:flex; align-items:center; justify-content:center; }
#player { width:100%; max-height:420px; display:none; } #previewMsg { position:absolute; padding:20px; text-align:center; }
#trim input { width:90px; }
#clips { list-style:none; margin:0; padding:0; display:flex; gap:10px; overflow-x:auto; padding-bottom:8px; }
.clip { flex:0 0 190px; background:#242830; border:2px solid var(--line); border-radius:8px; padding:8px; display:flex; flex-direction:column; gap:6px; }
.clip.selected { border-color:var(--accent); } .clip.dragover { border-color:#ffd166; }
.clip .title { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.clip .tr { display:flex; gap:4px; } .clip .tr select { flex:1; min-width:0; } .clip .tr input { width:56px; }
.clip .actions { display:flex; gap:4px; justify-content:space-between; }
.tag { font-size:11px; color:#ffd166; }
progress { width:100%; } .err { color:var(--bad); white-space:pre-wrap; }
a { color:var(--accent); }

/* ---------- modes + multi-view ---------- */
header { display:flex; gap:20px; align-items:center; flex-wrap:wrap; }
#modes { display:flex; gap:6px; }
#modes button.active { background:var(--accent); border-color:var(--accent); color:#fff; }
[hidden] { display:none !important; }

#stageWrap { display:flex; justify-content:center; background:#0b0c0e; border-radius:6px; padding:8px; }
#stage { position:relative; background:#000; overflow:hidden; }
#stage .cell { position:absolute; background:#111; overflow:hidden; }
#stage .cell video { width:100%; height:100%; display:block; }
#stage .cell .badge { position:absolute; left:4px; top:4px; background:#000a; padding:1px 6px; border-radius:3px; font-size:11px; pointer-events:none; }
#stage.crop .cell video { object-fit:cover; } #stage.pad .cell video { object-fit:contain; }

#mvScroll { overflow-x:auto; border:1px solid var(--line); border-radius:6px; }
#lanes { position:relative; min-width:100%; }
.lane { display:flex; border-bottom:1px solid var(--line); min-height:74px; }
.lane.ruler { min-height:26px; }
.laneHead { position:sticky; left:0; z-index:3; flex:0 0 300px; width:300px; background:var(--panel); border-right:1px solid var(--line);
  padding:4px 8px; display:flex; flex-direction:column; gap:3px; font-size:12px; }
.laneHead .lname { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.laneHead .lctl { display:flex; gap:4px; align-items:center; flex-wrap:wrap; }
.laneHead input[type=number] { width:62px; padding:1px 4px; } .laneHead input[type=range] { width:70px; padding:0; }
.laneTrack { position:relative; flex:0 0 auto; background:repeating-linear-gradient(90deg,#1a1d22 0 1px,transparent 1px 100%); }
.ruler .laneTrack { cursor:pointer; background:#171a1f; }
.tick { position:absolute; top:0; height:100%; border-left:1px solid #3a404a; padding-left:3px; font-size:10px; color:var(--muted); pointer-events:none; }
.bar { position:absolute; top:8px; bottom:8px; background:#2f5fb8; border:1px solid #6b9bff; border-radius:5px; cursor:grab; overflow:hidden; display:flex; align-items:center; user-select:none; touch-action:none; }
.bar:active { cursor:grabbing; } .lane[data-slot="1"] .bar { background:#2f8f6a; border-color:#6bffb8; } .lane[data-slot="2"] .bar { background:#a8742c; border-color:#ffc56b; } .lane[data-slot="3"] .bar { background:#8c3fa8; border-color:#e08cff; }
.bar .lbl { flex:1; padding:0 10px; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; pointer-events:none; }
.bar .h { position:absolute; top:0; bottom:0; width:8px; cursor:ew-resize; background:#fff4; } .bar .h.l { left:0; } .bar .h.r { right:0; }
.bar .flag { position:absolute; top:0; bottom:0; width:2px; background:#ffd166; pointer-events:none; }
#playhead { position:absolute; top:0; bottom:0; width:2px; background:#ff5d5d; z-index:2; pointer-events:none; }
.emptyLane { color:var(--muted); font-size:12px; padding:26px 12px; }

.laneHead .timeBoxes label { display:flex; gap:3px; align-items:center; color:var(--muted); }
.laneHead .timeBoxes input { width:62px; padding:1px 4px; font-variant-numeric:tabular-nums; }
.bar .hold { position:absolute; top:0; bottom:0; right:0; background:repeating-linear-gradient(135deg,#0006 0 6px,#0003 6px 12px); border-left:2px dashed #fff9; pointer-events:none; }
#snapGuide { position:absolute; top:0; bottom:0; width:0; border-left:2px dashed #ffd166; z-index:2; pointer-events:none; }
