/* The Sequence screen's own stylesheet.
   In a file of its own rather than in index.html's <style>, because the
   screen is one module (ui/cut-ui.js) and its rules should travel with it;
   the tokens (--surface, --amber, --line...) are the page's, so the two
   cannot drift in colour, only in file. */

.cutRoot{display:flex;flex-direction:column;min-height:0;min-width:0;height:100%;flex:1;position:relative}
.cutTop{display:grid;grid-template-columns:minmax(0,1fr) 276px;min-height:0;flex:1}
.cutMonitor{margin:13px 0 0 13px;min-height:0;min-width:0}
.cutCanvas{width:100%;height:100%;object-fit:contain;display:block;background:#000}
.cutFallback{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#000}
/* The page styles every video inside a monitor as display:block, which beats
   the hidden attribute's display:none. Left alone, this black placeholder
   sat over the canvas and the monitor read as dead while the picture was
   being drawn perfectly well underneath it. */
.screen .cutFallback[hidden]{display:none}
.cutBlank button{margin-top:8px}
.cutDropHint{position:absolute;left:0;right:0;bottom:14px;text-align:center;font-size:12px;color:var(--amber);
  opacity:0;transition:.2s var(--ease);pointer-events:none}
.cutDropHint.on{opacity:1}
.cutMonitor.cutDropping,.cutTl.cutDropping{outline:2px dashed var(--amber);outline-offset:-2px}

/* ---------- the inspector ---------- */
.cutInspector{margin:13px 0 0 13px;border-left:1px solid var(--line);overflow-y:auto;min-height:0;font-size:12.5px;
  padding-left:2px}
.cutInsHead{display:flex;align-items:baseline;gap:8px;padding:6px 12px 8px;border-bottom:1px solid var(--line);position:sticky;top:0;
  background:var(--bg);z-index:2}
.cutInsHead b{font-size:13px}
.cutInsBody{padding:10px 12px 18px;display:grid;gap:10px;grid-auto-rows:max-content}
.cutInsSection{display:grid;gap:8px;padding-top:9px;border-top:1px solid var(--line);position:relative}
.cutInsSection>b{font-size:10.5px;letter-spacing:1px;text-transform:uppercase;color:var(--faint);font-weight:700}
.cutInsBtns{position:absolute;right:0;top:7px;display:flex;gap:4px}
.cutBtnRow{display:flex;gap:6px;flex-wrap:wrap;padding-top:4px}
.cutLink{padding:3px 8px;font-size:11.5px;color:var(--amber)}
.cutSource{font-size:11.5px}
.cutMono{font:11px ui-monospace,monospace;word-break:break-all;color:var(--faint)}
.cutCheck{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--dim)}
.cutCheck input{width:auto;padding:0}
.cutSlider .slider .val{min-width:44px}
.cutOutRow{display:flex;justify-content:space-between;gap:8px;align-items:center;font-size:12px;padding:3px 0;border-bottom:1px dashed var(--line)}
.cutOutRow:last-child{border-bottom:0}
.cutOutText{min-width:0;line-height:1.4}
.cutOutText b{font:600 11px ui-monospace,monospace;color:var(--amber);margin-right:4px}
.cutExportRow{display:flex;justify-content:space-between;gap:8px;font-size:12px;align-items:baseline}
.cutExportRow a{color:var(--amber);text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.cutExportRow a:hover{text-decoration:underline}

/* ---------- the menu bar ----------
   Above the monitor rather than beside the transport, because it is about the
   cut as a whole and the transport is about the moment you are looking at. The
   count on the right is not a command and could not go in a menu. */
.cutMenuBar{display:flex;align-items:center;gap:8px;padding:6px 11px 5px;flex:none;
  border-bottom:1px solid var(--line);min-width:0}
.cutSel{font-size:11px;color:var(--amber);white-space:nowrap}

/* ---------- the transport ---------- */
.cutTransport{display:flex;align-items:center;gap:6px;padding:9px 13px 8px;flex:none;flex-wrap:wrap}
.cutTime{min-width:142px}
.cutSep{width:1px;height:22px;background:var(--line);margin:0 1px;flex:none}
.cutTool{padding:5px 8px;font-size:11.5px;white-space:nowrap}
.cutToggle.on{border-color:var(--amber);color:var(--amber)}
.cutProgress{display:none;align-items:center;gap:8px;font-size:11.5px;color:var(--ok);
  background:rgba(74,222,128,.08);border:1px solid rgba(74,222,128,.3);border-radius:99px;padding:3px 11px;white-space:nowrap}
.cutProgress.on{display:inline-flex}
.cutProgress .bar{width:90px;height:4px;border-radius:99px;background:rgba(255,255,255,.12);overflow:hidden}
.cutProgress .bar i{display:block;height:100%;background:var(--ok);transition:width .4s var(--ease)}
.cutProgress .dim{color:var(--faint)}
.cutProgress .bad{color:var(--bad)}

/* ---------- the timeline ---------- */
.cutTl{flex:none;height:min(38vh,330px);overflow:auto;border-top:1px solid var(--line);background:var(--bg2);
  position:relative;outline:none;overscroll-behavior:contain}
.cutTlInner{position:relative;min-width:100%}
.cutRow{display:flex;position:relative;border-bottom:1px solid var(--line);min-width:100%}
.cutRulerRow{position:sticky;top:0;z-index:8;background:var(--surface)}
.cutHead{position:sticky;left:0;z-index:5;width:136px;flex:none;background:var(--surface);border-right:1px solid var(--line);
  display:flex;flex-direction:column;justify-content:center;gap:4px;padding:4px 8px;min-width:0}
.cutRulerHead{flex-direction:row;align-items:center;gap:4px;justify-content:flex-end}
.cutHeadName{font:600 11px ui-monospace,monospace;color:var(--dim);cursor:text;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cutHead.video .cutHeadName{color:#8fb4e0}
.cutHead.audio .cutHeadName{color:#8fd4a0}
.cutHeadBtns{display:flex;gap:3px;align-items:center}
.cutMini{padding:1px 6px;font-size:10.5px;border-radius:6px;min-width:22px;height:20px;line-height:1}
.cutMini.on{border-color:var(--amber);color:var(--amber);background:rgba(255,171,61,.1)}
.cutMini2{padding:2px 8px;font-size:11px;border-radius:6px;height:22px;line-height:1}
.cutVol{width:44px;height:16px;padding:0;flex:none}
.cutLane{position:relative;flex:none;height:100%;min-width:100%;
  background:repeating-linear-gradient(90deg,transparent 0,transparent 39px,rgba(255,255,255,.025) 39px,rgba(255,255,255,.025) 40px)}
.cutLane.audio{background-color:rgba(74,222,128,.025)}
.cutLane.target{outline:2px dashed var(--amber);outline-offset:-2px;background-color:rgba(255,171,61,.07)}
.cutRow.locked .cutLane{background:repeating-linear-gradient(45deg,transparent,transparent 8px,rgba(255,255,255,.03) 8px,rgba(255,255,255,.03) 16px)}
.cutRow.locked .cutClip{cursor:not-allowed}
.cutRow.muted .cutClip{opacity:.55}
.cutRow.hiddenTrack .cutClip{opacity:.35}
.cutRulerLane{cursor:pointer}
.cutTick{position:absolute;top:0;bottom:0;border-left:1px solid var(--line2);pointer-events:none}
.cutTick span{position:absolute;left:4px;top:5px;font:10px ui-monospace,monospace;color:var(--faint);white-space:nowrap}
.cutTick.minor{border-left-color:var(--line);top:62%}
.cutMarquee{position:absolute;z-index:8;pointer-events:none;border:1px solid var(--amber);
  background:rgba(255,171,61,.10);border-radius:3px}
.cutPlayhead{position:absolute;top:0;bottom:0;width:1px;background:var(--amber);z-index:9;pointer-events:none;
  box-shadow:0 0 6px rgba(255,171,61,.6)}
/* The head is the handle: wide enough to grab, sitting in the ruler, and it
   scrubs exactly as dragging the ruler does. The line itself stays inert so
   it never steals a click from the clip under it. */
.cutPlayhead i{position:absolute;top:0;left:-8px;width:17px;height:18px;pointer-events:auto;cursor:ew-resize;
  background:var(--amber);clip-path:polygon(0 0,100% 0,100% 55%,50% 100%,0 55%);box-shadow:0 2px 8px rgba(0,0,0,.5)}
.cutPlayhead i:hover{background:#ffc46a}
.cutNote{position:absolute;left:13px;bottom:12px;max-width:70%;background:rgba(6,7,9,.72);border:1px solid rgba(255,255,255,.09);
  border-radius:99px;padding:5px 13px;font-size:11.5px;color:var(--dim);backdrop-filter:blur(10px);pointer-events:none}
.cutNote:empty{display:none}

/* ---------- clips ---------- */
.cutClip{position:absolute;top:4px;bottom:4px;border-radius:7px;overflow:hidden;cursor:grab;user-select:none;
  display:flex;align-items:stretch;border:1px solid var(--line2);background:var(--surface2);
  transition:box-shadow .15s var(--ease),border-color .15s var(--ease)}
.cutClip.video{background:linear-gradient(180deg,#22303e,#1a222b)}
.cutClip.audio,.cutClip.video.audioLane{background:linear-gradient(180deg,#1f2e24,#18211b)}
.cutLane.audio .cutClip{background:linear-gradient(180deg,#1f2e24,#18211b)}
.cutClip:hover{border-color:#4b5563}
.cutClip.sel{border-color:var(--amber);box-shadow:0 0 0 1px rgba(255,171,61,.35),0 6px 16px rgba(0,0,0,.5);z-index:2}
.cutClip.dragging{opacity:.85;z-index:3;cursor:grabbing;transition:none}
.cutClip.stale{border-style:dashed;border-color:rgba(255,171,61,.6)}
.cutClip.missing{background:repeating-linear-gradient(45deg,#2a1a1a,#2a1a1a 6px,#1f1414 6px,#1f1414 12px);color:var(--bad)}
.cutClip.muted .cutClipText{opacity:.6}
.cutThumb{width:56px;flex:none;background-size:cover;background-position:center;background-color:#0b0d10;opacity:.92;
  border-right:1px solid rgba(0,0,0,.4)}
.cutClipText{display:flex;flex-direction:column;justify-content:center;gap:2px;padding:0 9px;min-width:0;flex:1;pointer-events:none}
.cutClipName{font:600 11px ui-monospace,monospace;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:.4px}
.cutClip.video .cutClipName{color:#cfe1f5}
.cutLane.audio .cutClipName{color:#c9ecd3}
.cutClipMeta{font:10px ui-monospace,monospace;color:var(--faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cutGrip{position:absolute;top:0;bottom:0;width:9px;cursor:ew-resize;z-index:2}
.cutGrip.l{left:0;border-radius:7px 0 0 7px}
.cutGrip.r{right:0;border-radius:0 7px 7px 0}
.cutClip:hover .cutGrip,.cutClip.sel .cutGrip{background:rgba(255,255,255,.1)}
.cutGrip:hover{background:rgba(255,171,61,.45)!important}
.cutDot{position:absolute;right:13px;top:5px;width:8px;height:8px;border-radius:50%;
  background:linear-gradient(135deg,var(--violet),var(--amber));box-shadow:0 0 6px rgba(139,123,240,.7)}
.cutMuteMark{position:absolute;right:13px;bottom:4px;font:700 9px ui-monospace,monospace;color:var(--bad);
  border:1px solid var(--bad);border-radius:4px;padding:0 3px;line-height:12px}
.cutFade{position:absolute;top:0;bottom:0;pointer-events:none;z-index:1}
.cutFade.in{left:0;background:linear-gradient(90deg,rgba(0,0,0,.6),transparent)}
.cutFade.out{right:0;background:linear-gradient(270deg,rgba(0,0,0,.6),transparent)}

/* ---------- the library popover ---------- */
.cutPopover{position:absolute;z-index:40;width:330px;max-height:62%;background:var(--surface);border:1px solid var(--line2);
  border-radius:12px;box-shadow:var(--shadow);display:flex;flex-direction:column;animation:fade .18s var(--ease)}
.cutPopover[hidden]{display:none}
.cutPopHead{display:flex;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid var(--line)}
.cutPopHead b{font-size:11px;letter-spacing:1px;text-transform:uppercase;color:var(--faint)}
.cutPopHead input{flex:1;padding:4px 8px;font-size:12px;min-width:0}
.cutPopBody{overflow-y:auto;min-height:0;flex:1}
.cutPopFoot{padding:6px 10px;border-top:1px solid var(--line)}
.cutLibGroup{padding:7px 10px 3px;font-size:10.5px;letter-spacing:1px;text-transform:uppercase;color:var(--faint);
  display:flex;justify-content:space-between}
.cutLibRow{display:flex;align-items:center;gap:8px;padding:5px 10px;cursor:grab;border-bottom:1px solid var(--line)}
.cutLibRow:hover{background:var(--surface2)}
.cutLibKind{color:var(--faint);font-size:11px;width:14px;text-align:center;flex:none}
.cutLibName{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}

/* Media elements the monitor plays through. Kept rendered but out of sight:
   a display:none video is one some browsers stop decoding. */
.cutHidden{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none;left:0;top:0}
.cutHidden video,.cutHidden audio{width:1px;height:1px}

/* ---------- the bin's cards, on this screen ---------- */
.card .cutUse{font:10px ui-monospace,monospace;color:var(--amber);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.card .cutUse.warn{color:var(--bad);cursor:help}
.card .cutAdd{position:absolute;right:8px;bottom:7px;padding:1px 7px;font-size:11px;border-radius:6px;opacity:0;
  transition:.15s var(--ease)}
.card:hover .cutAdd{opacity:1}
.card[draggable=true]{cursor:grab}
