:root{
  color-scheme:dark;--bg:#090b10;--surface:#10141b;--surface-2:#151a22;--surface-3:#1a2029;
  --line:#252d39;--line-strong:#344050;--text:#f3f6fa;--muted:#8a96a6;--teal:#49dfcf;
  --teal-soft:rgba(73,223,207,.13);--violet:#9b86ff;--danger:#ff8b7e;--radius:20px;
  --shadow:0 26px 70px rgba(0,0,0,.34);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif
}
*{box-sizing:border-box}
html,body{min-height:100%;margin:0;background:var(--bg);color:var(--text)}
body{overflow-x:hidden}
#layerVideos{position:fixed;left:-10000px;bottom:0;width:2px;height:2px;overflow:hidden;opacity:.001;pointer-events:none}
#layerVideos video,#layerVideos audio{display:block;width:1px;height:1px}
button,input,select{font:inherit}
button,a,input,select{-webkit-tap-highlight-color:transparent}
button{color:inherit}
.app{width:min(1580px,100%);min-height:100vh;margin:0 auto;padding:18px}
.embedded .app{padding:0}
.embedded .topbar{display:none}
.embedded .workspace{min-height:100vh}
.embedded .preview-card{border-radius:0 0 0 18px}
.embedded .controls{border-radius:0 0 18px 0}
.topbar{
  display:flex;min-height:64px;align-items:center;justify-content:space-between;gap:18px;
  margin-bottom:14px;padding:10px 14px 10px 18px;border:1px solid var(--line);
  border-radius:18px;background:linear-gradient(120deg,rgba(21,26,34,.96),rgba(12,16,22,.96));
  box-shadow:0 14px 36px rgba(0,0,0,.18)
}
.brand,.brand-mark,.top-status,.status-dot,.step-title,.value-row,.transport,.file-meta,.export-note,.result-head{display:flex;align-items:center}
.brand{gap:12px}
.brand-mark{
  width:40px;height:40px;justify-content:center;border-radius:12px;
  background:linear-gradient(135deg,var(--teal),#7ce6da);color:#06120f;
  box-shadow:0 10px 28px rgba(73,223,207,.18)
}
.brand-mark svg{width:21px}
.brand strong{display:block;font-size:1rem;letter-spacing:-.02em}
.brand small{display:block;margin-top:3px;color:var(--muted);font-size:.76rem}
.top-status{gap:9px;color:#aeb7c4;font-size:.78rem}
.status-dot{width:9px;height:9px;justify-content:center;border-radius:50%;background:#586271;box-shadow:0 0 0 5px rgba(88,98,113,.09)}
.status-dot.ready{background:var(--teal);box-shadow:0 0 0 5px rgba(73,223,207,.09)}
.workspace{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:14px;min-height:calc(100vh - 114px)}
.preview-card,.controls{
  min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:var(--radius);
  background:var(--surface);box-shadow:var(--shadow)
}
.preview-card{display:grid;grid-template-rows:auto minmax(340px,1fr) auto auto}
.preview-head{
  display:flex;min-height:60px;align-items:center;justify-content:space-between;gap:16px;
  padding:12px 16px;border-bottom:1px solid var(--line);background:#11161d
}
.file-meta{min-width:0;gap:11px}
.file-icon{display:grid;width:36px;height:36px;flex:none;place-items:center;border-radius:11px;background:var(--teal-soft);color:var(--teal)}
.file-icon svg{width:18px}
.file-copy{min-width:0}
.file-copy strong{display:block;overflow:hidden;font-size:.86rem;text-overflow:ellipsis;white-space:nowrap}
.file-copy small{display:block;margin-top:3px;color:var(--muted);font-size:.72rem}
.replace-btn,.ghost-btn,.primary-btn,.mode-btn,.play-btn,.download-btn{
  border:1px solid var(--line-strong);border-radius:11px;background:var(--surface-3);
  cursor:pointer;transition:border-color .16s ease,background .16s ease,transform .16s ease
}
.replace-btn,.ghost-btn{min-height:38px;padding:0 13px;color:#bdc6d2;font-size:.78rem;font-weight:700}
.replace-btn:hover,.ghost-btn:hover{border-color:#526173;background:#202733;color:#fff}
button:active,.download-btn:active{transform:translateY(1px)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid rgba(73,223,207,.28);outline-offset:2px}
.stage{
  position:relative;display:grid;min-height:0;place-items:center;overflow:hidden;padding:22px;
  background:radial-gradient(circle at 50% 42%,rgba(73,223,207,.07),transparent 36%),
    linear-gradient(45deg,rgba(255,255,255,.015) 25%,transparent 25%,transparent 75%,rgba(255,255,255,.015) 75%),#0a0e13;
  background-size:auto,24px 24px
}
.dropzone{
  display:grid;width:min(600px,calc(100% - 32px));min-height:270px;place-items:center;padding:36px;
  border:1px dashed #394555;border-radius:22px;background:rgba(15,20,27,.82);text-align:center;
  transition:border-color .18s ease,background .18s ease,transform .18s ease
}
.dropzone.drag{border-color:var(--teal);background:rgba(73,223,207,.08);transform:scale(1.01)}
.upload-orb{
  display:grid;width:64px;height:64px;place-items:center;margin:0 auto 18px;border-radius:20px;
  background:linear-gradient(145deg,rgba(73,223,207,.18),rgba(155,134,255,.13));color:var(--teal);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.05)
}
.upload-orb svg{width:28px}
.dropzone strong{display:block;font-size:1.05rem}
.dropzone p{max-width:410px;margin:8px auto 20px;color:var(--muted);font-size:.83rem;line-height:1.55}
.primary-btn{
  min-height:46px;padding:0 18px;border-color:rgba(73,223,207,.45);
  background:linear-gradient(135deg,var(--teal),#72e4d7);color:#061511;font-weight:850
}
.primary-btn:hover{filter:brightness(1.06)}
.primary-btn:disabled{cursor:not-allowed;filter:none;opacity:.42}
.canvas-shell{position:relative;display:none;width:100%;height:100%;max-width:100%;max-height:100%;align-items:center;justify-content:center;line-height:0;touch-action:none;-webkit-user-select:none;user-select:none}
.stage.has-video .dropzone{display:none}
.stage.has-video .canvas-shell{display:flex}
#previewCanvas{
  display:block;width:auto;height:auto;max-width:100%;max-height:100%;
  border-radius:14px;background:#000;box-shadow:0 24px 70px rgba(0,0,0,.56)
}
.region-help{
  position:absolute;left:12px;bottom:12px;display:none;max-width:min(225px,calc(100% - 24px));
  padding:8px 11px;border:1px solid rgba(73,223,207,.28);border-radius:9px;background:rgba(7,11,16,.84);
  color:#d5e6e4;font-size:.7rem;line-height:1.35;text-align:left;backdrop-filter:blur(12px);pointer-events:none
}
.canvas-shell.region-on .region-help{display:block}
.trim-editor{padding:13px 16px 12px;border-top:1px solid var(--line);background:#0e1319}
.trim-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 14px;margin-bottom:10px}
.trim-head>div:first-child{display:flex;min-width:0;flex-direction:column;gap:2px}
.trim-head strong{font-size:.78rem}
.trim-head small{color:var(--muted);font-size:.66rem}
.trim-readout{display:flex;flex-wrap:wrap;flex:none;align-items:center;gap:6px;font:750 .68rem ui-monospace,SFMono-Regular,Consolas,monospace;color:#cbd3dd}
.trim-readout i{color:#606b79;font-style:normal}
.trim-readout b{margin-left:4px;padding:4px 7px;border:1px solid rgba(73,223,207,.22);border-radius:7px;background:var(--teal-soft);color:var(--teal);font-size:.66rem}
.trim-readout button{min-height:27px;margin-left:3px;border:1px solid var(--line-strong);border-radius:7px;background:#1b222c;color:#9da8b6;cursor:pointer;font-size:.64rem;font-weight:750}
.trim-readout button:disabled{cursor:not-allowed;opacity:.4}
.trim-ruler{position:relative;height:50px;touch-action:none;-webkit-user-select:none;user-select:none}
.trim-track{position:absolute;inset:0 9px;overflow:hidden;border:1px solid #2d3744;border-radius:9px;background:repeating-linear-gradient(90deg,rgba(255,255,255,.035) 0,rgba(255,255,255,.035) 2px,transparent 2px,transparent 18px),linear-gradient(180deg,#151b23,#0c1117)}
.trim-track::before{position:absolute;z-index:0;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.025),transparent 55%);content:'';pointer-events:none}
.trim-shade{position:absolute;z-index:1;top:0;bottom:0;background:rgba(2,5,8,.7);pointer-events:none}
.trim-shade-start{left:0;width:0}
.trim-shade-end{left:0;width:100%}
.trim-selection{position:absolute;z-index:2;top:3px;bottom:3px;left:0;width:0;padding:0;border:1px solid rgba(73,223,207,.9);border-radius:6px;background:linear-gradient(90deg,rgba(73,223,207,.2),rgba(155,134,255,.15));box-shadow:inset 0 0 0 1px rgba(255,255,255,.055),0 0 18px rgba(73,223,207,.08);pointer-events:none}
.trim-selection.movable{cursor:grab;pointer-events:auto;touch-action:none;user-select:none}
.trim-selection.movable:hover{background:linear-gradient(90deg,rgba(73,223,207,.28),rgba(155,134,255,.2));box-shadow:inset 0 0 0 1px rgba(255,255,255,.1),0 0 16px rgba(73,223,207,.16)}
.trim-selection.dragging{z-index:8;cursor:grabbing;opacity:.88;box-shadow:0 8px 18px rgba(0,0,0,.52),inset 0 0 0 1px rgba(255,255,255,.13)}
.trim-playhead{position:absolute;z-index:4;top:0;bottom:0;left:0;width:2px;background:#fff;box-shadow:0 0 0 1px rgba(8,12,16,.55),0 0 8px rgba(255,255,255,.25);pointer-events:none}
.trim-playhead::before{position:absolute;top:0;left:50%;width:7px;height:7px;border-radius:2px;background:#fff;content:'';transform:translate(-50%,-1px)}
.trim-range{position:absolute;z-index:3;inset:0;width:100%;height:50px;margin:0;appearance:none;background:transparent;pointer-events:none}
.trim-range::-webkit-slider-runnable-track{height:50px;background:transparent}
.trim-range::-webkit-slider-thumb{width:18px;height:50px;margin:0;appearance:none;border:2px solid #07110f;background:repeating-linear-gradient(90deg,transparent 0 5px,rgba(7,17,15,.3) 5px 7px),linear-gradient(180deg,#75f0e2,#35cbbb);box-shadow:0 3px 12px rgba(0,0,0,.48);cursor:ew-resize;pointer-events:auto}
.trim-start::-webkit-slider-thumb{border-radius:8px 3px 3px 8px}
.trim-end::-webkit-slider-thumb{border-radius:3px 8px 8px 3px}
.trim-range::-moz-range-track{height:50px;background:transparent}
.trim-range::-moz-range-thumb{width:16px;height:46px;border:2px solid #07110f;border-radius:5px;background:#52dfcf;box-shadow:0 3px 12px rgba(0,0,0,.48);cursor:ew-resize;pointer-events:auto}
.trim-range:focus-visible{outline:none}
.trim-range:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 3px rgba(73,223,207,.28),0 3px 12px rgba(0,0,0,.48)}
.trim-range:focus-visible::-moz-range-thumb{box-shadow:0 0 0 3px rgba(73,223,207,.28),0 3px 12px rgba(0,0,0,.48)}
.trim-range:disabled::-webkit-slider-thumb{background:#414c59}
.trim-range:disabled::-moz-range-thumb{background:#414c59}
.trim-scale{display:flex;justify-content:space-between;gap:10px;margin-top:5px;color:#697585;font-size:.61rem}
.timeline-stack{display:flex;flex-direction:column;gap:6px}
.timeline-lane{display:grid;grid-template-columns:76px minmax(0,1fr);gap:8px;align-items:stretch;min-width:0;transition:transform .18s ease,opacity .18s ease}
.video-lane{order:1}.audio-lane{order:2}.timeline-stack.detached .audio-lane{order:0}
.lane-label{display:flex;min-width:0;align-items:center;justify-content:center;flex-direction:column;border:1px solid var(--line);border-radius:8px;background:#121922;color:#8c98a8;line-height:1.05}
.lane-label strong{font-size:.72rem;letter-spacing:.08em}.lane-label small{max-width:68px;margin-top:4px;overflow:hidden;color:#8693a4;font-size:.7rem;text-overflow:ellipsis;white-space:nowrap}
.audio-label{flex-direction:row;gap:7px;justify-content:flex-start;padding:0 7px}.audio-label>span{display:flex;min-width:0;flex-direction:column}.audio-label strong{color:#77ecdf}
.audio-toggle{display:grid;width:25px;height:25px;flex:none;place-items:center;padding:0;border:1px solid rgba(73,223,207,.28);border-radius:7px;background:rgba(73,223,207,.09);color:#66e7d9;cursor:pointer;font:850 .6rem ui-monospace,SFMono-Regular,Consolas,monospace}
.audio-toggle:hover{border-color:rgba(73,223,207,.58);background:rgba(73,223,207,.15)}.audio-toggle:disabled{cursor:not-allowed;opacity:.36}.audio-toggle.is-muted{border-color:rgba(255,139,126,.3);background:rgba(255,139,126,.08);color:#ff9d92}
.video-film{position:absolute;z-index:0;inset:5px 7px;border-radius:5px;background:repeating-linear-gradient(90deg,rgba(118,236,222,.16) 0,rgba(118,236,222,.16) 28px,rgba(255,255,255,.04) 28px,rgba(255,255,255,.04) 30px),linear-gradient(180deg,rgba(85,205,194,.08),rgba(128,115,220,.08));pointer-events:none}
.waveform-track{position:relative;height:44px;min-width:0;overflow:hidden;border:1px solid #2c3a46;border-radius:9px;background:linear-gradient(180deg,#101c22,#0b1218);cursor:pointer;touch-action:none;-webkit-user-select:none;user-select:none}
.waveform-track::before{position:absolute;z-index:0;inset:50% 0 auto;height:1px;background:rgba(137,240,228,.12);content:'';pointer-events:none}
.waveform-bars{position:absolute;z-index:1;inset:5px 7px;display:flex;align-items:center;gap:1px;pointer-events:none}
.waveform-bars i{min-width:1px;height:var(--wave-height,6px);flex:1;border-radius:2px;background:linear-gradient(180deg,#7af2e4,#37bcaf);box-shadow:0 0 5px rgba(73,223,207,.12);opacity:.92;transform-origin:center}
.waveform-track.empty .waveform-bars i{background:#33434d;box-shadow:none;opacity:.42}.waveform-track.loading .waveform-bars i{animation:waveform-loading 1s ease-in-out infinite}.waveform-track.loading .waveform-bars i:nth-child(3n){animation-delay:-.34s}.waveform-track.loading .waveform-bars i:nth-child(4n){animation-delay:-.62s}
.audio-selection{position:absolute;z-index:2;top:2px;bottom:2px;left:0;width:0;border:1px solid rgba(73,223,207,.58);border-radius:6px;background:rgba(73,223,207,.045);pointer-events:none}
.audio-shade{position:absolute;z-index:3;top:0;bottom:0;background:rgba(2,5,8,.72);pointer-events:none}.audio-shade-start{left:0;width:0}.audio-shade-end{left:0;width:100%}
.audio-playhead{position:absolute;z-index:4;top:0;bottom:0;left:0;width:2px;background:#fff;box-shadow:0 0 0 1px rgba(8,12,16,.55),0 0 8px rgba(255,255,255,.25);pointer-events:none}.audio-playhead::before{position:absolute;top:0;left:50%;width:7px;height:7px;border-radius:2px;background:#fff;content:'';transform:translate(-50%,-1px)}
.timeline-stack.detached .audio-lane .lane-label,.timeline-stack.detached .waveform-track{border-color:rgba(155,134,255,.42);box-shadow:0 0 0 1px rgba(155,134,255,.06)}.timeline-stack.detached .audio-label strong{color:#c3b8ff}.timeline-stack.detached .audio-toggle{border-color:rgba(155,134,255,.35);background:rgba(155,134,255,.1);color:#c7bdff}
.trim-readout #audioDetachBtn.on{border-color:rgba(155,134,255,.42);background:rgba(155,134,255,.11);color:#c7bdff}
@keyframes waveform-loading{0%,100%{transform:scaleY(.42);opacity:.35}50%{transform:scaleY(1);opacity:.78}}
/* Linked sound is drawn over the video; detaching reveals its own editable lane. */
.timeline-stack .audio-lane{display:none}
.timeline-stack.detached .audio-lane{display:grid}
.audio-offset{padding:4px 7px;border:1px solid rgba(155,134,255,.35);border-radius:7px;background:rgba(155,134,255,.1);color:#c9bfff;font-size:.65rem;white-space:nowrap}
.trim-readout .audio-toggle{display:inline-flex;width:auto;min-height:27px;align-items:center;justify-content:center;padding:0 8px;border-color:rgba(73,223,207,.28);background:rgba(73,223,207,.08);color:#75eade;font:750 .64rem ui-monospace,SFMono-Regular,Consolas,monospace}
.trim-readout .audio-toggle.is-muted{border-color:rgba(255,139,126,.3);background:rgba(255,139,126,.08);color:#ff9d92}
.video-film{bottom:5px}
.attached-waveform{display:block}
.attached-waveform i{height:min(var(--wave-height,6px),15px);min-width:1px;flex:1;border-radius:2px;background:#70e5d8;opacity:.8}
.attached-waveform.empty i{background:#41545b;opacity:.25}
.source-mute-ranges,.source-volume-envelope{position:absolute;z-index:5;inset:0;overflow:hidden;border-radius:8px;pointer-events:none}
.source-mute-ranges.detached{z-index:5;top:2px;bottom:2px}
.source-mute-range{position:absolute;top:0;bottom:0;border-right:1px solid rgba(255,122,112,.72);border-left:1px solid rgba(255,122,112,.72);background:repeating-linear-gradient(135deg,rgba(255,98,91,.2) 0 6px,rgba(255,98,91,.09) 6px 12px);box-shadow:inset 0 -3px 0 rgba(255,127,116,.72)}
.source-volume-point{position:absolute;z-index:2;width:11px;height:11px;padding:0;border:2px solid #d9fff9;border-radius:50%;background:#49dfcf;box-shadow:0 0 0 2px #102027,0 2px 7px #0008;pointer-events:auto;transform:translate(-50%,-50%)}
.source-volume-point::after{position:absolute;top:50%;right:100%;width:9999px;border-top:1px solid rgba(73,223,207,.42);content:'';pointer-events:none}
.timeline-stack.detached .attached-waveform{display:none}
.timeline-stack.detached .video-film{bottom:5px}
.sound-tracks:empty{display:none}
.sound-tracks{display:flex;flex-direction:column;gap:5px;margin-top:5px}
.sound-lane{min-height:42px}
.sound-lane .lane-label{padding:0 6px}.sound-lane .lane-label strong{font-size:.66rem}.sound-lane .lane-label small{max-width:70px;font-size:.56rem}
.sound-lane.voice .lane-label{border-color:rgba(155,134,255,.43);background:rgba(155,134,255,.09)}.sound-lane.voice .lane-label strong{color:#c7bdff}
.sound-lane.music .lane-label{border-color:rgba(255,184,92,.38);background:rgba(255,184,92,.075)}.sound-lane.music .lane-label strong{color:#ffd092}
.sound-track{position:relative;height:42px;min-width:0;margin:0 9px;overflow:hidden;border:1px solid #2f3a49;border-radius:9px;background:repeating-linear-gradient(135deg,#0d141b 0 8px,#101921 8px 16px)}
.sound-clip{position:absolute;top:2px;bottom:2px;min-width:5px;overflow:hidden;padding:0;border:1px solid rgba(169,153,244,.68);border-radius:7px;background:linear-gradient(180deg,rgba(112,97,198,.65),rgba(55,55,106,.72));color:#f2efff;cursor:grab;touch-action:none;user-select:none}
.sound-clip.music{border-color:rgba(255,197,116,.65);background:linear-gradient(180deg,rgba(174,117,47,.68),rgba(87,64,43,.75));color:#fff1d8}
.sound-clip.selected{z-index:3;border-color:#fff;box-shadow:0 0 0 2px rgba(73,223,207,.35),0 4px 12px #0008}.sound-clip.dragging{cursor:grabbing;opacity:.86}
.sound-clip-wave{position:absolute;inset:6px 4px;display:flex;align-items:center;gap:1px;pointer-events:none}.sound-clip-wave i{min-width:1px;flex:1;border-radius:2px;background:rgba(226,220,255,.78)}.sound-clip.music .sound-clip-wave i{background:rgba(255,225,175,.78)}
.sound-clip-name{position:absolute;z-index:2;top:2px;left:5px;max-width:calc(100% - 10px);overflow:hidden;padding:1px 4px;border-radius:4px;background:rgba(10,13,23,.7);font-size:.54rem;font-weight:850;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}
.sound-fade-overlay{position:absolute;z-index:1;top:0;bottom:0;background:linear-gradient(90deg,rgba(6,9,15,.8),transparent);pointer-events:none}.sound-fade-overlay.end{right:0;transform:scaleX(-1)}
.waveform-track{height:38px;margin:0 9px;cursor:grab}
.timeline-stack:not(.detached) .audio-clip{border-color:rgba(73,223,207,.48);background:linear-gradient(180deg,rgba(73,223,207,.12),rgba(73,223,207,.035))}
.timeline-stack:not(.detached) .audio-clip-grip{display:none}
.waveform-track.dragging{cursor:grabbing}.waveform-track:focus-visible{outline:3px solid rgba(155,134,255,.42);outline-offset:2px}
.audio-clip{position:absolute;z-index:1;top:2px;bottom:2px;left:0;width:100%;min-width:30px;overflow:hidden;border:1px solid rgba(155,134,255,.6);border-radius:6px;background:linear-gradient(180deg,rgba(118,105,205,.16),rgba(73,223,207,.08));box-shadow:inset 0 0 0 1px rgba(255,255,255,.04);pointer-events:none}
.audio-clip-grip{position:absolute;z-index:2;top:50%;left:1px;transform:translateY(-50%);color:#d8d1ff;font-size:.8rem;font-weight:850;line-height:1;letter-spacing:-.18em}
.audio-clip .waveform-bars{inset:4px 5px 4px 13px}
.timeline-stack.detached .waveform-bars i{background:linear-gradient(180deg,#d0c6ff,#8b7dec);box-shadow:0 0 5px rgba(155,134,255,.18)}
.timeline-stack.detached .audio-selection{border-color:rgba(155,134,255,.48);background:rgba(155,134,255,.025)}
.timeline-stack.detached .audio-label{justify-content:center}
.timeline-stack.detached .audio-label strong{font-size:.75rem}
.transport{min-height:58px;gap:12px;padding:10px 16px;border-top:1px solid var(--line);background:#11161d}
.play-btn{
  display:grid;width:38px;height:38px;flex:none;place-items:center;border-color:rgba(73,223,207,.35);
  border-radius:50%;background:var(--teal-soft);color:var(--teal);font-size:.9rem
}
.time{width:128px;color:#dbe2eb;font:700 .76rem ui-monospace,SFMono-Regular,Consolas,monospace}
.seek{width:100%;accent-color:var(--teal)}
.gif-label{flex:none;padding:6px 9px;border:1px solid rgba(155,134,255,.28);border-radius:8px;background:rgba(155,134,255,.1);color:#c9bfff;font-size:.7rem;font-weight:800}
.controls{padding:5px 18px 18px;overflow:auto}
.control-section{padding:18px 0;border-bottom:1px solid var(--line)}
.control-section:last-child{border-bottom:0}
.step-title{gap:10px;margin-bottom:13px}
.step-title b{display:grid;width:26px;height:26px;flex:none;place-items:center;border:1px solid var(--line-strong);border-radius:8px;background:#171d26;color:var(--teal);font-size:.75rem}
.step-title strong{font-size:.9rem}
.step-title small{display:block;margin-top:2px;color:var(--muted);font-size:.7rem;font-weight:500}
.control-section.tool-accordion{padding:9px 0}
.tool-accordion-toggle{display:grid;width:100%;min-height:58px;grid-template-columns:38px minmax(0,1fr) auto 20px;align-items:center;gap:10px;padding:8px 9px;border:1px solid transparent;border-radius:13px;background:transparent;color:#eef3f8;cursor:pointer;text-align:left;transition:border-color .18s ease,background .18s ease,box-shadow .18s ease}
.tool-accordion-toggle:hover{border-color:#334150;background:#171e27}
.tool-accordion-toggle[aria-expanded="true"]{border-color:rgba(73,223,207,.23);background:linear-gradient(135deg,rgba(73,223,207,.09),rgba(155,134,255,.055));box-shadow:inset 0 0 0 1px rgba(255,255,255,.015)}
.tool-accordion-icon{display:grid;width:38px;height:38px;place-items:center;border:1px solid rgba(155,134,255,.3);border-radius:11px;background:linear-gradient(145deg,rgba(155,134,255,.16),rgba(155,134,255,.06));color:#b7a8ff;box-shadow:inset 0 1px 0 rgba(255,255,255,.05)}
.tool-accordion-icon svg{width:21px;height:21px}
.export-tool-toggle .tool-accordion-icon{border-color:rgba(73,223,207,.28);background:linear-gradient(145deg,rgba(73,223,207,.15),rgba(73,223,207,.045));color:#62e8d9}
.sound-tool-toggle .tool-accordion-icon{border-color:rgba(255,184,92,.3);background:linear-gradient(145deg,rgba(255,184,92,.16),rgba(255,184,92,.05));color:#ffc06f}
.tool-accordion-copy{min-width:0}
.tool-accordion-copy strong{display:block;font-size:.86rem;letter-spacing:-.01em}
.tool-accordion-copy small{display:block;overflow:hidden;margin-top:3px;color:#7f8b9a;font-size:.66rem;font-weight:550;text-overflow:ellipsis;white-space:nowrap}
.tool-accordion-state{padding:4px 7px;border:1px solid #313b48;border-radius:7px;background:#151b23;color:#98a4b3;font:800 .62rem ui-monospace,SFMono-Regular,Consolas,monospace;white-space:nowrap}
.tool-accordion-toggle[aria-expanded="true"] .tool-accordion-state{border-color:rgba(73,223,207,.28);background:rgba(73,223,207,.08);color:#72e8da}
.blur-tool-toggle[aria-expanded="true"] .tool-accordion-state{border-color:rgba(155,134,255,.34);background:rgba(155,134,255,.1);color:#c5baff}
.sound-tool-toggle[aria-expanded="true"]{border-color:rgba(255,184,92,.27);background:linear-gradient(135deg,rgba(255,184,92,.08),rgba(155,134,255,.045))}
.sound-tool-toggle[aria-expanded="true"] .tool-accordion-state{border-color:rgba(255,184,92,.32);background:rgba(255,184,92,.09);color:#ffd39b}
.sound-tool-toggle[aria-expanded="true"] .tool-accordion-chevron{color:#ffc06f}
.tool-accordion-chevron{width:18px;height:18px;color:#657282;transition:transform .18s ease,color .18s ease}
.tool-accordion-toggle:hover .tool-accordion-chevron{color:#c4cdd8}
.tool-accordion-toggle[aria-expanded="true"] .tool-accordion-chevron{color:#78e6d9;transform:rotate(180deg)}
.tool-accordion-body{padding:12px 4px 8px}
.tool-accordion-body[hidden]{display:none}
.sound-studio{display:grid;gap:9px}
.sound-card{padding:10px;border:1px solid #283240;border-radius:12px;background:linear-gradient(145deg,rgba(25,32,42,.96),rgba(17,23,31,.96))}
.sound-card-head{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.sound-card-head>span:last-child{min-width:0}
.sound-card-head strong{display:block;color:#edf2f7;font-size:.76rem}
.sound-card-head small{display:block;overflow:hidden;margin-top:2px;color:#778495;font-size:.61rem;text-overflow:ellipsis;white-space:nowrap}
.sound-card-icon{display:grid;width:27px;height:27px;flex:none;place-items:center;border:1px solid rgba(155,134,255,.3);border-radius:8px;background:rgba(155,134,255,.1);color:#c6bbff;font-size:.78rem;font-weight:900}
.sound-card-icon.music{border-color:rgba(255,184,92,.28);background:rgba(255,184,92,.09);color:#ffc371}.sound-card-icon.source{border-color:rgba(73,223,207,.26);background:rgba(73,223,207,.08);color:#71e9da}.sound-card-icon.selected{color:#8cf4e7}
.sound-range-readout{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px;color:#8f9baa;font-size:.65rem}
.sound-range-readout output{overflow:hidden;color:#d7ddea;font:800 .64rem ui-monospace,SFMono-Regular,Consolas,monospace;text-overflow:ellipsis;white-space:nowrap}
.sound-range-actions{display:grid;grid-template-columns:1fr 1fr 1.25fr;gap:5px;margin-bottom:7px}
.sound-range-actions button,.sound-point-actions button,.sound-clip-actions button{min-width:0;min-height:31px;padding:4px 6px;border:1px solid #354151;border-radius:8px;background:#1a222c;color:#b7c1ce;cursor:pointer;font-size:.64rem;font-weight:800}
.sound-range-actions button:hover:not(:disabled),.sound-point-actions button:hover:not(:disabled),.sound-clip-actions button:hover:not(:disabled){border-color:#607084;background:#222c38;color:#fff}
.sound-range-actions button:disabled,.sound-point-actions button:disabled{cursor:not-allowed;opacity:.38}
.sound-range-actions .sound-danger-soft{border-color:rgba(255,139,126,.28);background:rgba(255,139,126,.07);color:#ffaaa0}
.sound-action-grid{display:grid;grid-template-columns:1.35fr 1fr;gap:6px}
.sound-action-grid button,.sound-wide-action{display:flex;min-width:0;min-height:38px;align-items:center;justify-content:center;gap:6px;padding:6px 8px;border:1px solid #354151;border-radius:9px;background:#1a222c;color:#c5ced9;cursor:pointer;font-size:.66rem;font-weight:820;line-height:1.25}
.sound-action-grid button svg,.sound-wide-action svg{width:16px;height:16px;flex:none}
.sound-action-grid .sound-primary-action{border-color:rgba(155,134,255,.4);background:rgba(155,134,255,.11);color:#d5ceff}
.sound-action-grid .sound-primary-action.recording{border-color:rgba(255,94,91,.52);background:rgba(255,94,91,.14);color:#ffb1ad;animation:record-pulse 1.1s ease-in-out infinite}
.sound-action-grid button:hover:not(:disabled),.sound-wide-action:hover:not(:disabled){border-color:#657488;background:#222d39;color:white}
.sound-action-grid button:disabled,.sound-wide-action:disabled{cursor:not-allowed;opacity:.4}
.sound-help{margin:7px 0 0;color:#748092;font-size:.61rem;line-height:1.42}
.sound-wide-action{width:100%;border-color:rgba(255,184,92,.26);background:rgba(255,184,92,.065);color:#ffd096}
.sound-switch{display:flex;align-items:center;gap:8px;margin-top:9px;color:#9ba6b4;font-size:.64rem;cursor:pointer}
.sound-switch input{position:absolute;opacity:0;pointer-events:none}.sound-switch span{position:relative;width:30px;height:17px;flex:none;border:1px solid #3b4654;border-radius:20px;background:#171d25;transition:.18s}.sound-switch span::after{position:absolute;top:2px;left:2px;width:11px;height:11px;border-radius:50%;background:#758191;content:'';transition:.18s}.sound-switch input:checked+span{border-color:rgba(73,223,207,.42);background:rgba(73,223,207,.13)}.sound-switch input:checked+span::after{left:15px;background:#65e8d9}
.sound-point-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-top:7px}
.sound-muted-list{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.sound-muted-list[hidden]{display:none}
.sound-muted-chip{display:flex;align-items:center;gap:5px;min-height:25px;padding:3px 5px 3px 7px;border:1px solid rgba(255,139,126,.25);border-radius:7px;background:rgba(255,139,126,.07);color:#ffb0a7;font:750 .59rem ui-monospace,SFMono-Regular,Consolas,monospace}
.sound-muted-chip button{display:grid;width:17px;height:17px;place-items:center;padding:0;border:0;border-radius:5px;background:rgba(255,139,126,.11);color:#ffb0a7;cursor:pointer}
.sound-clip-inspector{border-color:rgba(73,223,207,.25);background:linear-gradient(145deg,rgba(73,223,207,.065),rgba(17,23,31,.96))}.sound-clip-inspector[hidden]{display:none}
.ai-edge-controls{display:grid;gap:6px;margin-top:9px;padding:8px;border:1px solid rgba(255,197,116,.28);border-radius:9px;background:rgba(255,197,116,.055)}.ai-edge-controls[hidden]{display:none}.ai-edge-controls>span{display:flex;align-items:baseline;justify-content:space-between;gap:8px}.ai-edge-controls strong{color:#ffe1a8;font-size:.63rem}.ai-edge-controls small{color:#8795a4;font-size:.54rem}.ai-edge-controls>div{display:grid;grid-template-columns:1fr 1fr;gap:5px}.ai-edge-controls button{min-height:29px;padding:4px 7px;border:1px solid rgba(255,197,116,.32);border-radius:7px;background:rgba(255,197,116,.08);color:#ffe7b8;cursor:pointer;font-size:.59rem;font-weight:850}.ai-edge-controls button:hover:not(:disabled){border-color:#ffd184;background:rgba(255,197,116,.15);color:#fff}.ai-edge-controls button:disabled{cursor:not-allowed;opacity:.38}
.sound-fade-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}.sound-fade-grid label{display:grid;gap:4px;color:#8f9baa;font-size:.61rem}.sound-fade-grid output{color:#c4ccd7;font:750 .59rem ui-monospace,SFMono-Regular,Consolas,monospace}.sound-fade-grid input{width:100%;accent-color:#9b86ff}
.sound-clip-actions{display:grid;grid-template-columns:1.45fr 1fr 32px;gap:5px;margin-top:9px}.sound-clip-actions .sound-delete{padding:0;border-color:rgba(255,139,126,.28);color:#ff9e94;font-size:1rem}
.sound-status{min-height:30px;margin:0;padding:7px 9px;border:1px solid rgba(73,223,207,.13);border-radius:9px;background:rgba(73,223,207,.035);color:#7f8c9b;font-size:.62rem;line-height:1.35}
@keyframes record-pulse{50%{box-shadow:0 0 0 4px rgba(255,94,91,.08)}}
.wide{width:100%}
.seg{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.mode-btn{min-height:42px;padding:5px 7px;color:#929dab;font-size:.73rem;font-weight:750}
.mode-btn:hover{color:#dbe4ee}
.mode-btn.on{border-color:rgba(73,223,207,.5);background:var(--teal-soft);color:var(--teal)}
.blur-options{display:none;margin-top:16px}
.blur-options.open{display:block}
.value-row{justify-content:space-between;margin-bottom:8px;color:#aeb8c6;font-size:.76rem}
.value-row output{color:var(--teal);font:800 .78rem ui-monospace,SFMono-Regular,Consolas,monospace}
.range{width:100%;accent-color:var(--teal)}
.hint{margin:10px 0 0;color:var(--muted);font-size:.72rem;line-height:1.5}
.select-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.select-field{display:grid;gap:6px;color:var(--muted);font-size:.68rem}
.select-field select{width:100%;height:40px;border:1px solid var(--line-strong);border-radius:10px;background:#181e27;color:#e8edf3;padding:0 9px}
.quality-card{margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:12px;background:linear-gradient(135deg,rgba(73,223,207,.06),rgba(155,134,255,.045))}
.quality-card .value-row{margin-bottom:7px}
.quality-scale{display:flex;justify-content:space-between;margin-top:5px;color:#687384;font-size:.64rem}
.max-quality-btn{width:100%;min-height:38px;margin-top:8px;border:1px solid rgba(155,134,255,.38);border-radius:10px;background:rgba(155,134,255,.1);color:#d2caff;cursor:pointer;font-size:.75rem;font-weight:800;transition:border-color .16s ease,background .16s ease}
.max-quality-btn:hover{border-color:rgba(155,134,255,.7);background:rgba(155,134,255,.17)}
.max-quality-btn.on{border-color:rgba(73,223,207,.48);background:rgba(73,223,207,.11);color:var(--teal)}
.size-estimate{display:grid;grid-template-columns:1fr auto;gap:3px 10px;margin-top:10px;padding:11px 12px;border:1px solid rgba(73,223,207,.18);border-radius:11px;background:rgba(73,223,207,.055)}
.size-estimate>span{align-self:center;color:#aeb8c6;font-size:.72rem}
.size-estimate>strong{color:var(--teal);font:850 .94rem ui-monospace,SFMono-Regular,Consolas,monospace;text-align:right}
.size-estimate>small{grid-column:1/-1;color:#748091;font-size:.65rem;line-height:1.4}
.size-estimate.exact{border-color:rgba(73,223,207,.4);background:rgba(73,223,207,.1)}
.size-estimate.heavy{border-color:rgba(255,188,100,.34);background:rgba(255,188,100,.07)}
.size-estimate.heavy>strong{color:#ffc073}
.export-note{align-items:flex-start;gap:8px;margin:12px 0;padding:10px;border-radius:10px;background:rgba(155,134,255,.08);color:#aeb6c5;font-size:.7rem;line-height:1.45}
.export-note svg{width:15px;flex:none;margin-top:1px;color:var(--violet)}
.export-btn{width:100%;margin-top:12px}
.cancel-btn{display:none;margin-top:8px}
.progress{display:none;margin-top:13px}
.progress.open{display:block}
.progress-track{height:7px;overflow:hidden;border-radius:99px;background:#242c37}
.progress-fill{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--teal),var(--violet));transition:width .16s ease}
.progress-copy{display:flex;justify-content:space-between;gap:8px;margin-top:7px;color:var(--muted);font-size:.68rem}
.error{display:none;margin-top:12px;padding:10px;border:1px solid rgba(255,139,126,.3);border-radius:10px;background:rgba(255,139,126,.08);color:#ffb0a7;font-size:.72rem;line-height:1.45}
.error.open{display:block}
.result{display:none;margin-top:14px;padding:12px;border:1px solid rgba(73,223,207,.24);border-radius:13px;background:rgba(73,223,207,.06)}
.result.open{display:block}
.result-head{justify-content:space-between;gap:8px;margin-bottom:10px}
.result-head strong{font-size:.78rem}
.result-head span{color:var(--muted);font-size:.68rem}
.result img{display:block;width:100%;max-height:220px;object-fit:contain;border-radius:9px;background:#06080b}
.download-btn{display:flex;min-height:42px;align-items:center;justify-content:center;margin-top:10px;border-color:rgba(73,223,207,.4);background:var(--teal-soft);color:var(--teal);font-size:.78rem;font-weight:850;text-decoration:none}
.privacy{margin:12px 0 0;color:#687384;font-size:.67rem;text-align:center}
#sourceVideo,#detachedAudio,#fileInput,#voiceInput,#musicInput{position:fixed;width:1px;height:1px;opacity:0;pointer-events:none}
@media(max-width:700px){
  .app{padding:10px}.embedded .app{padding:0}.workspace{grid-template-columns:1fr;min-height:auto}.embedded .workspace{min-height:100vh}
  .preview-card{min-height:620px}.controls{overflow:visible}
}
@media(max-width:620px){
  .topbar{min-height:56px;margin-bottom:10px}.brand small,.top-status span:last-child{display:none}.workspace{gap:10px}
  .preview-card{grid-template-rows:auto minmax(360px,58vh) auto auto;min-height:0}.preview-head{min-height:54px;padding:8px 10px}
  .file-icon{display:none}.stage{padding:10px}.transport{padding:8px 10px}
  .time{width:110px;font-size:.68rem}.gif-label{display:none}.controls{padding:4px 14px 14px}
  .trim-editor{padding:11px 10px}.trim-head{align-items:flex-start;flex-direction:column;gap:8px}.trim-readout{width:100%;justify-content:space-between}.trim-readout button{margin-left:auto}.trim-head small{font-size:.62rem}.trim-scale span:nth-child(2){display:none}
}

@media(max-width:620px){
  .timeline-lane{grid-template-columns:60px minmax(0,1fr);gap:6px}.lane-label small{max-width:52px}.audio-label{gap:4px;padding:0 4px}.audio-toggle{width:23px;height:23px}.trim-readout{flex-wrap:wrap;justify-content:flex-start!important}.trim-readout #audioDetachBtn{margin-left:auto}.trim-readout #trimReset{margin-left:0}.waveform-bars{gap:0}
}

/* Frame-accurate working timeline. The ruler, thumbnails and waveform share one time axis. */
.preview-card{grid-template-rows:auto minmax(340px,1fr) auto}
.trim-editor{padding-bottom:15px}
.trim-head{margin-bottom:9px}
.trim-editor .transport{min-height:46px;margin:0 -16px 10px;padding:6px 16px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:#111820}
.trim-editor .play-btn{width:32px;height:32px}
.timeline-ruler-row{display:grid;grid-template-columns:76px minmax(0,1fr);gap:8px;align-items:center;margin-bottom:3px}
.ruler-label{color:#728093;font-size:.65rem;font-weight:800;letter-spacing:.11em;text-align:center}
.timeline-ruler{position:relative;height:32px;margin:0 9px;cursor:crosshair;touch-action:none;outline:none}
.timeline-ruler:focus-visible{border-radius:3px;box-shadow:0 0 0 2px rgba(73,223,207,.5)}
.ruler-ticks{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.ruler-tick{position:absolute;bottom:0;height:23px;border-left:1px solid #455462;color:#9ba8b6;white-space:nowrap}
.ruler-tick small{position:absolute;top:0;left:5px;font:700 .65rem ui-monospace,SFMono-Regular,Consolas,monospace}
.ruler-tick.edge-end small{right:2px;left:auto;transform:translateX(0)}
.ruler-tick.minor{height:7px;border-color:#38434f}
.ruler-playhead{position:absolute;z-index:2;top:0;bottom:0;left:0;width:2px;background:#f4fbfc;box-shadow:0 0 6px rgba(255,255,255,.4);pointer-events:none}
.ruler-playhead::before{position:absolute;top:0;left:50%;width:8px;height:8px;background:#f4fbfc;clip-path:polygon(0 0,100% 0,50% 100%);content:'';transform:translateX(-50%)}
.trim-ruler,.trim-range,.trim-range::-webkit-slider-runnable-track,.trim-range::-webkit-slider-thumb{height:78px}
.trim-track{background:#0b1117}
.trim-track::before{z-index:1;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.035),transparent 40%)}
.video-film{inset:5px 6px 24px;background:repeating-linear-gradient(90deg,#203039 0 50px,#18242b 50px 52px);opacity:.65}
.video-frames{position:absolute;z-index:0;top:4px;right:5px;bottom:25px;left:5px;display:flex;overflow:hidden;border-radius:5px;pointer-events:none}
.video-frames img{display:block;width:0;min-width:0;flex:1 1 0;object-fit:cover;object-position:center;border-right:1px solid rgba(7,13,18,.75);background:linear-gradient(135deg,#18242b,#10181f);filter:brightness(.93) saturate(.9)}
.video-frames img:last-child{border-right:0}
.trim-track.has-frames .video-film{opacity:0}
.attached-waveform{right:5px;bottom:3px;left:5px;height:19px;border-top:1px solid rgba(95,218,206,.25);background:linear-gradient(180deg,rgba(42,111,108,.25),rgba(34,83,83,.35))}
.attached-waveform i{height:var(--wave-mini-height,3px);border-radius:1px;opacity:.95}
.trim-selection{top:2px;bottom:2px;background:rgba(73,223,207,.065);box-shadow:inset 0 0 0 1px rgba(255,255,255,.045),0 0 16px rgba(73,223,207,.08)}
.timeline-stack.detached .video-frames{bottom:5px}
.timeline-stack.detached .video-film{bottom:5px}
.waveform-bars i{height:var(--wave-height,3px);background:linear-gradient(180deg,#9cf8ee,#39bfb3)}
.waveform-track.empty .waveform-bars i,.attached-waveform.empty i{height:2px;background:#4e6570;opacity:.4}
.ruler-label{font-size:.72rem}
.ruler-tick small{font-size:.72rem}
.trim-range::-moz-range-track{height:78px}
.trim-range::-moz-range-thumb{height:74px}
#thumbnailVideo{position:fixed;width:1px;height:1px;opacity:0;pointer-events:none}
@media(max-width:620px){
  .preview-card{grid-template-rows:auto minmax(360px,58vh) auto}
  .trim-editor .transport{margin-right:-10px;margin-left:-10px;padding-right:10px;padding-left:10px;gap:8px}
  .timeline-ruler-row{grid-template-columns:60px minmax(0,1fr);gap:6px}
  .ruler-label{font-size:.6rem}
  .trim-ruler,.trim-range,.trim-range::-webkit-slider-runnable-track,.trim-range::-webkit-slider-thumb{height:70px}
  .trim-range::-moz-range-track{height:70px}
  .trim-range::-moz-range-thumb{height:66px}
}

/* Unified zoomable timeline: one ruler, one playhead and a readable linked audio lane. */
.selection-caption{display:inline-flex;align-items:center;gap:5px;color:#8998aa;font-family:Inter,ui-sans-serif,system-ui,sans-serif;font-size:.74rem;font-weight:650}
.selection-caption b{margin:0}
.trim-editor .transport{justify-content:flex-start;flex-wrap:wrap;min-height:50px}
.trim-editor .time{width:auto;min-width:122px;font-size:.82rem}
.timeline-zoom-controls{display:flex;align-items:center;gap:4px;margin-left:auto}
.timeline-zoom-controls button{display:grid;min-width:31px;height:30px;place-items:center;padding:0 8px;border:1px solid #34414f;border-radius:7px;background:#19232c;color:#d9e6ed;cursor:pointer;font-size:1.07rem;font-weight:700}
.timeline-zoom-controls button:hover:not(:disabled){border-color:#60dacc;background:#20343b}
.timeline-zoom-controls button:disabled{cursor:not-allowed;opacity:.36}
.timeline-zoom-controls button:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.timeline-zoom-controls .zoom-fit{margin-left:4px;font-size:.68rem;font-weight:750;white-space:nowrap}
.montage-entry{display:flex;align-items:center;gap:11px;padding:8px 0 12px;color:#91a2b0;font-size:.72rem;line-height:1.35}
.clip-segments{position:absolute;z-index:5;inset:2px 0;pointer-events:none}
.clip-segment{position:absolute;top:0;height:100%;min-width:2px;padding:0;border:1px solid rgba(216,237,239,.62);border-right-width:2px;border-radius:5px;background:rgba(5,16,22,.08);color:#eafffa;cursor:pointer;pointer-events:auto;touch-action:manipulation}
.clip-segment:hover{border-color:#d0fff7;background:rgba(73,223,207,.11)}
.clip-segment.selected{border-color:#58e6d6;box-shadow:inset 0 0 0 1px rgba(73,223,207,.25),0 0 10px rgba(73,223,207,.12)}
.clip-segment.dragging{z-index:8;cursor:grabbing;opacity:.82;box-shadow:0 8px 20px rgba(0,0,0,.65)}
.clip-segment span{position:absolute;top:4px;left:6px;display:grid;place-items:center;min-width:20px;height:19px;padding:0 4px;border-radius:5px;background:rgba(7,19,24,.84);color:#cefff7;font:800 .65rem ui-monospace,SFMono-Regular,Consolas,monospace}
.timeline-stack.has-cuts .trim-shade{background:rgba(2,5,8,.38)}
.montage-split-btn{min-width:112px;min-height:34px;padding:6px 12px;border:1px solid rgba(87,222,207,.45);border-radius:8px;background:rgba(31,119,113,.18);color:#a7f7eb;font-weight:800;cursor:pointer;white-space:nowrap}
.montage-split-btn:hover:not(:disabled){border-color:#68e8db;background:rgba(47,163,152,.28);color:#e8fffb}
.montage-split-btn:disabled{cursor:not-allowed;opacity:.42}
.montage-split-btn:focus-visible{outline:2px solid #6debdc;outline-offset:2px}
@media(max-width:620px){.montage-entry{align-items:flex-start;flex-direction:column;gap:6px}}
.zoom-text{min-width:46px;color:#93dcd4;font:750 .7rem ui-monospace,SFMono-Regular,Consolas,monospace;text-align:center}
.timeline-area{position:relative}
.timeline-global-playhead{position:absolute;z-index:8;top:2px;bottom:0;width:2px;background:#f3fbfc;box-shadow:0 0 0 1px rgba(3,9,13,.6),0 0 10px rgba(243,251,252,.28);pointer-events:none}
.timeline-global-playhead::before{position:absolute;top:0;left:50%;width:10px;height:9px;background:#f3fbfc;clip-path:polygon(0 0,100% 0,50% 100%);content:'';transform:translateX(-50%)}
.timeline-global-playhead[hidden]{display:none}
.timeline-stack:not(.detached) .audio-lane{display:none}
.timeline-stack.detached .audio-lane{display:grid}
.timeline-stack .blur-lane[hidden]{display:none}
.blur-lane{order:0}
.timeline-stack.detached .audio-lane{order:-1}
.blur-label{border-color:rgba(155,134,255,.35);background:#1b1a29}
.blur-label strong{color:#c7bdff}
.blur-track{position:relative;min-width:0;height:38px;margin:0 9px;overflow:visible;border:1px solid rgba(155,134,255,.35);border-radius:9px;background:linear-gradient(180deg,rgba(155,134,255,.12),rgba(155,134,255,.035));cursor:crosshair;touch-action:none}
.blur-track::before{position:absolute;top:50%;right:0;left:0;border-top:1px dashed rgba(186,170,255,.28);content:'';pointer-events:none}
.blur-track-selection{position:absolute;top:2px;bottom:2px;border:1px solid rgba(155,134,255,.32);border-radius:6px;background:rgba(155,134,255,.09);pointer-events:none}
.blur-ranges{position:absolute;z-index:2;inset:3px 0;pointer-events:none}
.blur-range{position:absolute;top:0;bottom:0;min-width:5px;overflow:hidden;padding:0 7px;border:1px solid rgba(184,168,255,.65);border-radius:6px;background:linear-gradient(180deg,rgba(151,129,241,.65),rgba(91,77,179,.48));color:#f4f1ff;cursor:pointer;font:850 .6rem ui-monospace,SFMono-Regular,Consolas,monospace;pointer-events:auto;white-space:nowrap}
.blur-range:hover{border-color:#e2d9ff;background:linear-gradient(180deg,rgba(178,158,255,.72),rgba(111,93,203,.56))}
.blur-range.active{z-index:2;border-color:#fff;box-shadow:0 0 0 2px rgba(155,134,255,.34),0 4px 12px rgba(0,0,0,.38)}
.blur-range.full{background:linear-gradient(180deg,rgba(105,210,220,.62),rgba(47,129,151,.48));border-color:rgba(155,239,245,.72)}
.blur-range.disabled{opacity:.42}
.blur-markers{position:absolute;inset:0;pointer-events:none}
.blur-marker{position:absolute;z-index:3;top:50%;display:grid;width:18px;height:18px;place-items:center;padding:0;border:2px solid #eee9ff;border-radius:4px;background:#8c77e7;box-shadow:0 0 0 2px #151625,0 2px 8px rgba(0,0,0,.45);cursor:grab;pointer-events:auto;touch-action:none;transform:translate(-50%,-50%) rotate(45deg)}
.blur-marker::after{width:4px;height:4px;border-radius:1px;background:#fff;content:''}
.blur-marker:hover,.blur-marker.active{background:#c1b4ff;box-shadow:0 0 0 3px rgba(155,134,255,.33),0 2px 8px rgba(0,0,0,.5)}
.blur-marker.dragging{cursor:grabbing}
.field-heading{display:block;margin:14px 0 7px;color:#aeb8c6;font-size:.875rem}
.shape-seg{grid-template-columns:1.3fr 1fr .8fr}
.shape-seg .mode-btn{min-height:42px;padding:4px;font-size:.875rem}
.motion-field{margin-top:14px;font-size:.875rem}
.keyframe-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:12px}
.keyframe-actions button{min-height:40px;padding:5px;border:1px solid rgba(155,134,255,.38);border-radius:9px;background:rgba(155,134,255,.1);color:#d2caff;cursor:pointer;font-size:.875rem;font-weight:750}
.keyframe-actions button:hover:not(:disabled){background:rgba(155,134,255,.18)}
.keyframe-actions button:disabled{cursor:not-allowed;opacity:.42}
.region-controls{display:block}
.blur-range-panel{margin-bottom:13px;padding:9px;border:1px solid rgba(155,134,255,.22);border-radius:9px;background:rgba(155,134,255,.055)}
.blur-range-panel .value-row{margin:0 0 7px}
.blur-range-panel .value-row span{color:#d4cff5;font-size:.76rem;font-weight:780}
.blur-range-panel .value-row output{max-width:58%;overflow:hidden;color:#aaa0e8;text-overflow:ellipsis;white-space:nowrap}
.blur-range-actions{display:grid;grid-template-columns:1.25fr 1fr 1fr 34px;gap:5px}
.blur-range-actions button{min-width:0;min-height:32px;padding:4px 6px;border:1px solid rgba(155,134,255,.36);border-radius:7px;background:rgba(155,134,255,.1);color:#d9d2ff;cursor:pointer;font-size:.67rem;font-weight:800}
.blur-range-actions button:hover:not(:disabled){border-color:#b7a9ff;background:rgba(155,134,255,.18)}
.blur-range-actions button:disabled{cursor:not-allowed;opacity:.38}
.blur-range-actions #deleteBlurRange{padding:0;color:#ffaaa8;font-size:0}
.blur-range-actions #deleteBlurRange::before{font-size:.86rem;content:'×'}
.blur-range-panel .hint{margin:7px 0 0;color:#7f8aa0;font-size:.65rem;line-height:1.35}
.result video{display:block;width:100%;max-height:220px;border-radius:9px;background:#06080b}
.result video[hidden],.result img[hidden]{display:none}
.quality-card[hidden],.max-quality-btn[hidden],.region-controls[hidden]{display:none}
.video-film,.timeline-stack.detached .video-film{bottom:5px}
.video-frames,.timeline-stack.detached .video-frames{bottom:5px}
.trim-track{overflow:visible}
.trim-ruler{touch-action:pan-y}
.trim-handle{position:absolute;z-index:9;top:2px;width:22px;height:calc(100% - 4px);display:flex;align-items:center;justify-content:center;padding:0;border:2px solid #081817;background:linear-gradient(180deg,#83f5e7,#3ccebf);box-shadow:0 2px 9px rgba(0,0,0,.6),0 0 0 1px rgba(146,250,237,.38);cursor:ew-resize;touch-action:none;transform:translateX(-50%)}
.trim-handle.trim-start{border-radius:8px 4px 4px 8px}
.trim-handle.trim-end{border-radius:4px 8px 8px 4px}
.trim-handle:hover,.trim-handle.dragging,.trim-handle:focus-visible{background:linear-gradient(180deg,#b2fff4,#5deada);box-shadow:0 0 0 3px rgba(73,223,207,.22),0 3px 12px rgba(0,0,0,.6);outline:none}
.trim-handle[hidden]{display:none}
.trim-handle-grip{display:block;width:4px;height:30px;border-left:1px solid rgba(6,37,33,.7);border-right:1px solid rgba(6,37,33,.7)}
.trim-handle-tooltip{position:absolute;top:-31px;min-width:56px;padding:5px 6px;border:1px solid rgba(73,223,207,.5);border-radius:6px;background:#102b2d;color:#e7fffa;font:800 .68rem ui-monospace,SFMono-Regular,Consolas,monospace;opacity:0;pointer-events:none;white-space:nowrap;transition:opacity .12s ease}
.trim-start .trim-handle-tooltip{left:0}.trim-end .trim-handle-tooltip{right:0}
.trim-handle:hover .trim-handle-tooltip,.trim-handle.dragging .trim-handle-tooltip,.trim-handle:focus-visible .trim-handle-tooltip{opacity:1}
.waveform-track{height:40px;background:linear-gradient(180deg,#102427,#0b171b)}
.audio-clip{top:2px;right:0;bottom:2px;left:0!important;width:auto;min-width:0;border:0;background:linear-gradient(180deg,rgba(71,219,204,.12),rgba(43,150,144,.09));box-shadow:none}
.audio-clip-grip{display:none}
.timeline-stack.detached .audio-clip-grip{display:block}
.audio-clip .waveform-bars{inset:2px 0}
.waveform-bars i{height:var(--wave-height,2px);min-width:1px;border-radius:2px}
.timeline-stack:not(.detached) .waveform-track{cursor:default}
.timeline-stack.detached .waveform-track{cursor:grab}
.timeline-stack.detached .waveform-track.dragging{cursor:grabbing}
.attached-waveform{position:absolute;z-index:1;right:5px;bottom:5px;left:5px;display:block;height:28px;overflow:hidden;border-top:1px solid rgba(119,243,229,.45);border-radius:0 0 5px 5px;background:rgba(4,26,29,.3);pointer-events:none}
.attached-waveform[hidden],.timeline-stack.detached .attached-waveform{display:none}
.attached-waveform-bars{position:absolute;inset:2px 2px 1px;display:flex;align-items:center;gap:1px;overflow:hidden}
.attached-waveform-bars i{min-width:1px;height:var(--wave-height,2px);flex:1;border-radius:2px;background:#8df7e8;box-shadow:0 0 4px rgba(43,236,216,.4);opacity:.9}
@media(max-width:620px){.attached-waveform{height:24px}.attached-waveform-bars i{opacity:.95}}
@media(max-width:620px){
  .trim-editor .transport{gap:7px}
  .timeline-zoom-controls{width:100%;justify-content:flex-end;margin-left:0}
  .timeline-zoom-controls button{min-width:30px;height:30px}
  .trim-editor .time{font-size:.76rem}
  .trim-handle{width:22px}
  .blur-track{height:36px}
}

/* Keep the preview and timeline in one viewport, with independent panel scrolling. */
.preview-actions{display:flex;min-width:0;align-items:center;gap:10px}
.preview-play-btn{display:inline-flex;min-height:38px;align-items:center;gap:7px;padding:0 12px;border:1px solid rgba(73,223,207,.4);border-radius:10px;background:rgba(73,223,207,.11);color:#8df6e9;cursor:pointer;font-size:.76rem;font-weight:800;white-space:nowrap}
.preview-play-btn:hover:not(:disabled){background:rgba(73,223,207,.2)}
.preview-play-btn:disabled{cursor:not-allowed;opacity:.42}
.preview-size-control{display:flex;min-width:225px;align-items:center;gap:9px;padding:6px 9px;border:1px solid #303c49;border-radius:10px;background:#19222a;color:#aebbc7;font-size:.7rem;font-weight:700;white-space:nowrap}
.preview-size-control input{width:92px;min-width:50px;margin:0;accent-color:var(--teal);cursor:pointer}
.preview-size-control output{min-width:34px;color:#8df6e9;font:800 .68rem ui-monospace,SFMono-Regular,Consolas,monospace;text-align:right}
.preview-head .file-meta{flex:1}
@media(min-width:701px){
  .workspace{height:calc(100vh - 114px);height:calc(100dvh - 114px);min-height:560px}
  .embedded .workspace{height:100vh;height:100dvh;min-height:0}
  .preview-card{height:100%;min-height:0;grid-template-rows:auto minmax(160px,var(--preview-stage-share,45%)) minmax(0,1fr)}
  .stage{min-height:0}
  .trim-editor{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
  .trim-editor .transport{min-height:43px;margin-bottom:5px;padding-top:4px;padding-bottom:4px}
  .montage-entry{padding:4px 0 7px}
  .controls{height:100%;min-height:0}
}
@media(max-width:1080px){
  .preview-head{flex-wrap:wrap}
  .preview-actions{width:100%;justify-content:space-between}
  .preview-size-control{flex:1;max-width:290px}
}
@media(max-width:700px){
  .workspace,.embedded .workspace{height:auto;min-height:0}
  .preview-card{min-height:0;grid-template-rows:auto minmax(220px,var(--preview-mobile-height,45svh)) auto}
  .region-help{display:none!important}
  .preview-head{flex-wrap:wrap}
  .preview-actions{width:100%;gap:6px}
  .preview-play-btn{padding:0 9px}
  .preview-size-control{min-width:0;flex:1;padding:5px 7px}
  .preview-size-control span{display:none}
  .preview-size-control input{width:100%}
  .preview-head .replace-btn{padding:0 8px}
}

/* One compact editing desk: playback, clip actions, zoom and the timeline stay together. */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.clip-edit-actions{display:flex;min-width:0;align-items:center;gap:5px}
.clip-edit-actions button{min-height:32px;padding:4px 9px;border:1px solid #354550;border-radius:8px;background:#1b2931;color:#d4e4e9;cursor:pointer;font-size:.76rem;font-weight:750;white-space:nowrap}
.clip-edit-actions button:hover:not(:disabled){border-color:#66ddce;background:#263b40;color:#fff}
.clip-edit-actions button:disabled{cursor:not-allowed;opacity:.36}
.clip-edit-actions #splitInMontageBtn{border-color:rgba(73,223,207,.5);background:rgba(73,223,207,.13);color:#9cf4e8}
.clip-edit-actions #cutClipBtn:hover:not(:disabled){border-color:rgba(255,139,126,.65);background:rgba(255,139,126,.13);color:#ffd4ce}
.history-actions{display:flex;align-items:center;gap:4px;margin-left:3px;padding-left:7px;border-left:1px solid #2d3b45}
.history-actions button{display:grid;width:30px;min-width:30px;height:30px;place-items:center;padding:0;border:1px solid #34434f;border-radius:8px;background:#18232c;color:#b9cbd3;cursor:pointer}
.history-actions button:hover:not(:disabled){border-color:#68dccf;background:#24383e;color:#fff}
.history-actions button:disabled{cursor:not-allowed;opacity:.3}
.history-actions button:focus-visible{outline:2px solid #74e9dd;outline-offset:2px}
.history-actions svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.history-actions .delete-selected-action{border-color:rgba(255,132,121,.3);color:#f0a29b}
.history-actions .delete-selected-action:hover:not(:disabled){border-color:#ff897e;background:rgba(157,54,51,.28);color:#ffd8d4}
.clip-sequence{display:flex;min-width:0;align-items:center;gap:9px;margin:0 0 4px;padding:4px 7px;border:1px solid #273842;border-radius:9px;background:#101d25}
.clip-sequence[hidden]{display:none}
.clip-sequence.montage-active .clip-sequence-list{display:none}
.clip-sequence.montage-active .sequence-actions{margin-left:auto}
.sequence-title{flex:none;color:#8399a7;font-size:.66rem;font-weight:800;letter-spacing:.08em}
.clip-sequence-list{position:relative;display:flex;min-width:0;flex:1;gap:5px;overflow-x:auto;scrollbar-width:thin;scrollbar-color:#3c5c62 transparent}
.sequence-clip{display:inline-flex;min-width:30px;min-height:27px;flex-basis:0;align-items:center;gap:6px;overflow:hidden;padding:2px 8px 2px 4px;border:1px solid #354852;border-radius:7px;background:#18252e;color:#b8ccd4;cursor:pointer;font-size:.7rem;white-space:nowrap}
.sequence-clip b{display:grid;width:19px;height:19px;place-items:center;border-radius:5px;background:#2c4249;color:#d8f8f3;font-size:.66rem}
.sequence-clip:hover{border-color:#65d9cd;background:#233b40}
.sequence-clip.selected{border-color:#60e0d2;background:rgba(73,223,207,.16);color:#e8fffa;box-shadow:inset 0 0 0 1px rgba(73,223,207,.15)}
.sequence-clip.selected b{background:#48d3c5;color:#09201e}
.sequence-clip:focus-visible,.clip-edit-actions button:focus-visible{outline:2px solid #74e9dd;outline-offset:2px}
.sequence-clip{cursor:grab}
.sequence-clip.dragging{opacity:.45;cursor:grabbing}
.sequence-actions{display:flex;flex:none;align-items:center;gap:4px}
.sequence-actions button{min-height:27px;padding:2px 7px;border:1px solid #34515a;border-radius:7px;background:#192b32;color:#b7eee7;font-size:.68rem;font-weight:800;cursor:pointer;white-space:nowrap}
.sequence-actions button:hover:not(:disabled){border-color:#70e9dd;background:#264149}
.sequence-actions button:disabled{opacity:.36;cursor:not-allowed}
.sequence-actions button:focus-visible{outline:2px solid #74e9dd;outline-offset:2px}
.unused-segments{position:absolute;z-index:4;inset:1px 0;pointer-events:none}
.unused-segment{position:absolute;top:0;bottom:0;display:grid;place-items:center;overflow:hidden;border:1px dashed rgba(159,177,190,.35);background:repeating-linear-gradient(135deg,rgba(14,20,26,.94) 0 7px,rgba(21,29,36,.94) 7px 14px);color:#8496a0;font-size:.56rem;font-weight:850;letter-spacing:.08em;white-space:nowrap}
.montage-playhead,.layer-output-playhead{position:absolute;z-index:3;top:0;bottom:0;width:2px;background:#fff;box-shadow:0 0 5px rgba(255,255,255,.65);pointer-events:none}
.video-layers{display:flex;flex-direction:column;gap:6px;margin-bottom:5px}
.video-layer-group{padding:5px 0 6px;border:1px solid #304650;border-radius:10px;background:#101a21}
.video-layer-group.selected{border-color:#56899a;background:#13212a}
.layer-toolbar{display:flex;min-height:29px;align-items:center;justify-content:space-between;gap:8px;padding:0 9px 5px 8px}
.layer-toolbar>strong{flex:none;color:#b6e7f2;font-size:.68rem;letter-spacing:.045em}
.layer-toolbar-actions{display:flex;min-width:0;flex-wrap:wrap;justify-content:flex-end;gap:4px}
.layer-toolbar-actions button{min-height:24px;padding:2px 7px;border:1px solid #3d5963;border-radius:6px;background:#1b3038;color:#d8f3f6;cursor:pointer;font-size:.63rem;font-weight:750;white-space:nowrap}
.layer-toolbar-actions button:hover:not(:disabled){border-color:#79d8e4;background:#284751}
.layer-toolbar-actions button:disabled{opacity:.38;cursor:not-allowed}
.layer-toolbar-actions .remove-layer{min-width:24px;padding:0;color:#e6a5a5;font-size:1rem;line-height:1}
.layer-toolbar-actions .remove-layer:hover{border-color:#e77e7e;background:#6e3035}
.video-layer{min-height:0;margin-bottom:3px}
.video-layer .layer-label{display:flex;width:100%;height:100%;flex-direction:column;align-items:flex-start;justify-content:center;padding:4px 6px;border:1px solid #37586a;border-radius:8px;background:#172732;color:#bce7fa;cursor:pointer;text-align:left}
.video-layer.selected .layer-label{border-color:#70cced;background:#203848}
.video-layer .layer-label strong{font-size:.65rem}
.video-layer .layer-label small{color:#87aabd;font-size:.57rem}
.video-layer-track{position:relative;min-width:0;height:77px;margin:0 9px;border:1px solid #344e5a;border-radius:8px;background:repeating-linear-gradient(135deg,#101d25 0 9px,#15252e 9px 18px)}
.video-layer.selected .video-layer-track{border-color:#75c6e4}
.layer-scale{position:absolute;right:7px;bottom:3px;color:#7896a1;font-size:.55rem;pointer-events:none}
.layer-clip{position:absolute;z-index:1;top:2px;bottom:2px;min-width:7px;overflow:hidden;padding:0;border:1px solid #6caec2;border-radius:5px;background:#2a6175;color:white;cursor:grab;touch-action:none;user-select:none}
.layer-clip.selected{border:2px solid #a3edff;box-shadow:inset 0 0 0 1px rgba(255,255,255,.4)}
.layer-clip.dragging{z-index:6;cursor:grabbing;opacity:.82;box-shadow:0 7px 18px #02080bbb}
.layer-frames{position:absolute;inset:0 0 15px;display:flex;pointer-events:none}
.layer-frames img{display:block;width:0;min-width:0;flex:1;object-fit:cover;border-right:1px solid #08131b88;background:#2a5664}
.layer-wave{position:absolute;right:0;bottom:0;left:0;display:flex;height:17px;align-items:center;justify-content:space-around;overflow:hidden;border-top:1px solid #acece540;background:#103438c9;pointer-events:none}
.layer-wave i{width:2px;max-width:4px;border-radius:1px;background:#86f1de}
.layer-clip-badge{position:absolute;z-index:2;top:4px;left:5px;display:grid;min-width:18px;height:18px;place-items:center;padding:0 4px;border-radius:4px;background:#0a2028db;color:white;font-size:.6rem;font-weight:850;pointer-events:none}
.layer-audio-track{height:39px;background:#13232c}
.layer-audio-row .layer-label{color:#c3b9ff;border-color:#655888;background:#27213c}
.layer-audio-row.selected .layer-label{border-color:#b4a4ff;background:#332b53}
.layer-audio-clip{background:linear-gradient(180deg,#403973,#252b55);border-color:#a99af2}
.layer-audio-clip.selected{border-color:#d7ccff}
.layer-audio-clip .layer-wave{inset:1px 0;height:auto;border:0;background:#3b3372a8}
.layer-audio-clip .layer-wave i{background:#d6c7ff}
.layer-audio-clip .layer-clip-badge{background:#302957e6}
.layer-trim-handle{position:absolute;z-index:8;top:0;bottom:0;width:12px;transform:translateX(-50%);border:1px solid #164c51;border-radius:5px;background:#65e8df;box-shadow:0 2px 7px #0009;cursor:ew-resize;touch-action:none}
.layer-trim-handle::after{position:absolute;top:50%;left:4px;width:2px;height:18px;transform:translateY(-50%);background:#146b6a;content:''}
.layer-trim-handle.end{background:#91eeff}
.layer-trim-tip{position:absolute;bottom:calc(100% + 4px);left:50%;display:none;transform:translateX(-50%);padding:2px 4px;border-radius:4px;background:#e5fffd;color:#123037;font-size:.58rem;font-weight:850;white-space:nowrap}
.layer-trim-handle:hover .layer-trim-tip,.layer-trim-handle:focus .layer-trim-tip,.layer-trim-handle:active .layer-trim-tip{display:block}
.layer-clip:focus-visible,.video-layer .layer-label:focus-visible,.layer-trim-handle:focus-visible,.layer-toolbar button:focus-visible{outline:2px solid #8bdfff;outline-offset:2px}
.output-lane[hidden]{display:none}
.output-lane{min-height:70px;margin-bottom:5px}
.timeline-stack.montage-mode .video-lane{display:none}
.output-label{border-color:rgba(85,220,206,.48);background:#173032}
.output-label strong{color:#abfff2;font-size:.67rem}
.output-label small{color:#89c4bb;font-size:.56rem}
.output-track{position:relative;min-width:0;height:78px;margin:0 9px;border:1px solid #406b69;border-radius:9px;background:#0b1519}
.output-clip{position:absolute;top:0;bottom:0;display:block;min-width:2px;min-height:0;overflow:hidden;padding:0;border:1px solid #5faaa3;border-right-color:#132b2d;background:#1e4645;color:#e9fffb;cursor:grab;touch-action:none;user-select:none}
.output-clip:first-child{border-radius:7px 0 0 7px}
.output-clip.selected{z-index:1;border:2px solid #70eddf;box-shadow:inset 0 0 0 1px rgba(255,255,255,.4)}
.output-clip.dragging{z-index:5;cursor:grabbing;opacity:.85;box-shadow:0 8px 18px rgba(0,0,0,.55)}
.output-gap{position:absolute;top:0;bottom:0;display:grid;place-items:center;overflow:hidden;border:1px dashed rgba(159,177,190,.32);background:repeating-linear-gradient(135deg,#101920 0 7px,#18242b 7px 14px);color:#8fa2ac;font-size:.58rem;font-weight:850;letter-spacing:.09em;pointer-events:auto;white-space:nowrap}
.output-gap.tail{border-color:rgba(101,144,151,.17);background:repeating-linear-gradient(135deg,#0b1519 0 9px,#0e1b20 9px 18px);color:#58737d}
.output-clip:focus-visible{outline:2px solid white;outline-offset:-3px}
.clip-segment{cursor:grab;touch-action:pan-y}
.output-frames{position:absolute;inset:0 0 16px;display:flex;pointer-events:none}
.output-frames img{display:block;width:0;min-width:0;flex:1;object-fit:cover;border-right:1px solid rgba(2,9,11,.45);background:linear-gradient(135deg,#376066,#213e48)}
.output-clip-number{position:absolute;z-index:2;top:4px;left:5px;display:grid;min-width:20px;height:20px;place-items:center;padding:0 5px;border-radius:5px;background:rgba(4,24,27,.82);font-size:.65rem;font-weight:900;pointer-events:none}
.output-wave{position:absolute;right:0;bottom:0;left:0;display:flex;height:17px;align-items:center;justify-content:space-around;overflow:hidden;border-top:1px solid rgba(121,240,225,.22);background:rgba(4,43,43,.73);pointer-events:none}
.output-wave i{width:2px;max-width:4px;border-radius:1px;background:#7cf3e5}
.output-drop-marker{position:absolute;z-index:8;top:-7px;bottom:-7px;width:3px;border-radius:2px;background:#fff5b1;box-shadow:0 0 0 2px rgba(10,30,30,.7),0 0 12px #fff5b1;pointer-events:none}
.output-drop-marker[hidden]{display:none}
.output-track .trim-handle{z-index:9}
.video-lane .lane-label strong{font-size:.56rem;letter-spacing:.015em}
@media(min-width:701px){
  .preview-card,.preview-card.has-video-layer,.preview-card.has-montage-output{grid-template-rows:auto clamp(180px,var(--preview-stage-share,48%),calc(100% - 270px)) 6px minmax(205px,1fr)}
  .preview-head{min-height:52px;padding:7px 12px}
  .preview-head .file-icon{width:32px;height:32px;border-radius:9px}
  .preview-head .file-copy strong{font-size:.82rem}
  .preview-head .file-copy small{margin-top:1px;font-size:.67rem}
  .preview-head .preview-play-btn{display:none}
  .preview-head .replace-btn{min-height:34px;padding:0 10px;font-size:.72rem}
  .preview-size-control{min-width:205px;padding:4px 8px}
  .stage{padding:8px}
  .trim-editor{display:flex;min-height:0;flex-direction:column;overflow:hidden;padding:4px 10px 0}
  .trim-head{min-height:30px;flex-wrap:nowrap;gap:6px 10px;margin-bottom:2px}
  .trim-head .timeline-heading{max-width:150px;flex-direction:row;align-items:center}
  .trim-head .timeline-heading small{display:none}
  .trim-head strong{font-size:.72rem;white-space:nowrap}
  .trim-readout{min-width:0;gap:4px;margin-left:auto}
  .trim-readout button{min-height:28px;margin-left:0;padding:0;font-size:0}
  .trim-readout .compact-tool{display:grid;width:29px;min-width:29px;height:29px;place-items:center;padding:0}
  .compact-tool svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .compact-tool .sound-muted{display:none}
  .compact-tool.is-muted .sound-wave{display:none}
  .compact-tool.is-muted .sound-muted{display:block}
  .trim-readout .audio-toggle{width:29px;min-width:29px;height:29px;padding:0}
  .trim-editor .transport{min-height:38px;margin:0 -10px 3px;padding:3px 10px;gap:4px 6px}
  .trim-editor .play-btn{width:30px;height:30px}
  .trim-editor .time{min-width:105px;font-size:.78rem}
  .clip-edit-actions .icon-action{width:30px;min-width:30px;height:30px;min-height:30px}
  .timeline-zoom-controls button{min-width:29px;height:29px}
  .timeline-zoom-controls .zoom-fit{max-width:34px;overflow:hidden;margin-left:2px;padding:0;color:transparent;font-size:0}
  .timeline-zoom-controls .zoom-fit::before{color:#d9e6ed;font-size:.78rem;content:'↔'}
  .clip-sequence{display:none!important}
  .timeline-ruler-row{margin-bottom:0}
  .timeline-scroll{min-height:82px;flex:1;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:0 0 14px;scrollbar-gutter:stable;scrollbar-color:#3c5961 transparent}
  .timeline-ruler-row{position:sticky;z-index:12;top:0;padding-top:3px;background:#0e1319}
}
@media(min-width:701px) and (max-width:1120px){
  .preview-card,.preview-card.has-video-layer,.preview-card.has-montage-output{grid-template-rows:auto clamp(170px,var(--preview-stage-share,48%),calc(100% - 262px)) 6px minmax(200px,1fr)}
  .trim-head .timeline-heading{max-width:100px}
  .selection-caption{font-size:.68rem}
  .trim-editor .transport{justify-content:space-between}
}
@media(max-width:700px){
  .pane-divider{display:none}
  .trim-editor{overflow:visible;padding:9px 10px}
  .trim-editor .transport{margin-bottom:5px}
  .clip-edit-actions{order:3;flex:1;justify-content:flex-start}
  .history-actions{order:3;margin-left:auto}
  .clip-sequence{margin-bottom:5px}
  .clip-sequence{flex-wrap:wrap}
  .sequence-actions{width:100%;justify-content:flex-end}
}

/* Keep the image fitted to its pane; layers scroll instead of shrinking the picture. */
.pane-divider{position:relative;z-index:14;display:grid;place-items:center;border-top:1px solid #23313a;border-bottom:1px solid #23313a;background:#15232a;cursor:row-resize;touch-action:none}
.pane-divider span{width:46px;height:3px;border-radius:3px;background:#669c9a;box-shadow:0 0 0 3px #20343b}
.pane-divider:hover,.pane-divider:focus-visible{background:#245057;outline:none}
.pane-divider:hover span,.pane-divider:focus-visible span{background:#8cf4e6}
.timeline-scroll{min-width:0}
.clip-edit-actions{gap:4px}
.clip-edit-actions .active-track-label{display:inline-flex;max-width:116px;min-width:52px;align-items:center;overflow:hidden;margin-right:3px;color:#8caeb5;font-size:.62rem;font-weight:800;letter-spacing:.045em;text-overflow:ellipsis;white-space:nowrap}
.clip-edit-actions .icon-action{display:grid;width:32px;min-width:32px;height:32px;min-height:32px;place-items:center;padding:0;border-radius:8px}
.icon-action svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.clip-sequence{min-height:32px}
.clip-sequence .sequence-actions button[hidden]{display:none}
.clip-sequence #moveClipLeftBtn,.clip-sequence #moveClipRightBtn{display:none}
.clip-sequence.montage-active{display:none!important}
.layer-toolbar{min-height:26px;padding-bottom:3px}
.layer-toolbar-actions{flex-wrap:nowrap}
.layer-toolbar-actions button{display:grid;width:25px;min-width:25px;height:25px;min-height:25px;place-items:center;padding:0;font-size:.9rem}
.video-layer-track{height:68px}
.layer-audio-track{height:34px}
@media(min-width:701px){
  .stage:not(.has-video) .dropzone{min-height:0;max-height:100%;overflow-y:auto;padding:12px 18px;border-radius:14px}
  .stage:not(.has-video) .upload-orb{width:43px;height:43px;margin-bottom:7px;border-radius:13px}
  .stage:not(.has-video) .upload-orb svg{width:23px}
  .stage:not(.has-video) .dropzone strong{font-size:.88rem}
  .stage:not(.has-video) .dropzone p{margin:4px auto 10px;font-size:.7rem;line-height:1.3}
  .stage:not(.has-video) .primary-btn{min-height:34px}
}
@media(max-width:700px){.pane-divider{display:none}}

/* Sound workbench: actions stay beside the timeline; the sidebar is only for precise settings. */
.sound-quickbar{display:flex;min-height:42px;align-items:center;gap:8px;margin:0 0 4px;padding:4px 6px;border:1px solid #293942;border-radius:9px;background:linear-gradient(90deg,rgba(255,184,92,.055),rgba(16,27,34,.96) 24%,rgba(16,27,34,.96));transition:border-color .18s ease,background .18s ease}
.sound-quickbar.is-selecting{border-color:rgba(255,193,108,.55);background:linear-gradient(90deg,rgba(255,184,92,.14),rgba(22,31,39,.98) 32%);box-shadow:inset 0 0 0 1px rgba(255,220,167,.04)}
.sound-quickbar.has-selection{border-color:rgba(73,223,207,.34)}
.sound-quickbar-intro{display:flex;min-width:178px;align-items:center;gap:7px;padding-right:8px;border-right:1px solid #2b3943}
.sound-quickbar-intro>span:last-child{min-width:0}
.sound-quickbar-intro strong{display:block;color:#edf5f6;font-size:.7rem;line-height:1.1}
.sound-quickbar-intro small{display:block;max-width:150px;overflow:hidden;margin-top:2px;color:#83939f;font-size:.59rem;font-weight:650;text-overflow:ellipsis;white-space:nowrap}
.sound-quickbar-mark{display:grid;width:27px;height:27px;flex:none;place-items:center;border:1px solid rgba(255,184,92,.33);border-radius:8px;background:rgba(255,184,92,.09);color:#ffc77f}
.sound-quickbar-mark svg{width:16px;height:16px}
.sound-quick-actions{display:flex;min-width:0;flex:1;align-items:center;gap:4px;overflow-x:auto;scrollbar-width:none}
.sound-quick-actions::-webkit-scrollbar{display:none}
.sound-quick-actions button{display:inline-flex;min-width:31px;height:31px;flex:none;align-items:center;justify-content:center;gap:5px;padding:0 8px;border:1px solid #34444e;border-radius:7px;background:#19262e;color:#c9d8dc;cursor:pointer;font-size:.63rem;font-weight:800;white-space:nowrap;transition:border-color .15s ease,background .15s ease,color .15s ease,transform .15s ease}
.sound-quick-actions button svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.sound-quick-actions button:hover:not(:disabled){border-color:#66dfd1;background:#244047;color:#f5fffd;transform:translateY(-1px)}
.sound-quick-actions button:disabled{cursor:not-allowed;opacity:.34}
.sound-quick-actions #soundSelectBtn{border-color:rgba(255,184,92,.34);color:#ffd49a}
.sound-quick-actions .sound-ai-action{border-color:rgba(120,113,255,.48);background:linear-gradient(135deg,rgba(120,113,255,.17),rgba(73,223,207,.08));color:#e1dcff}
.sound-quick-actions .sound-ai-action:hover:not(:disabled){border-color:#a99cff;background:linear-gradient(135deg,rgba(120,113,255,.27),rgba(73,223,207,.13));color:#fff}
.sound-quick-actions .sound-ai-action.loading svg{animation:ai-spark 1.05s ease-in-out infinite}
.sound-quick-actions .sound-voices-action{border-color:rgba(92,190,255,.38);background:rgba(61,142,202,.09);color:#bfe5ff}.sound-quick-actions .sound-voices-action.on{border-color:rgba(102,211,255,.7);background:rgba(61,161,216,.17);color:#e7f8ff}.sound-quick-actions .sound-voices-action b{display:grid;min-width:16px;height:16px;place-items:center;padding:0 4px;border-radius:9px;background:rgba(116,213,255,.15);font-size:.52rem}.sound-quick-actions .sound-voices-action b[hidden]{display:none}
.sound-quick-actions #soundSelectBtn.on{border-color:#ffd092;background:rgba(255,184,92,.16);color:#fff2dd;box-shadow:0 0 0 2px rgba(255,184,92,.08)}
.sound-quick-actions #soundMuteSelectionBtn:not(:disabled){border-color:rgba(255,133,119,.34);color:#ffc0b8}
.sound-quick-actions #soundMuteSelectionBtn.done{border-color:rgba(73,223,207,.55);background:rgba(73,223,207,.13);color:#bffbf3;box-shadow:inset 0 0 0 1px rgba(73,223,207,.08)}
.sound-quick-actions .sound-record-action:not(:disabled){border-color:rgba(155,134,255,.42);background:rgba(155,134,255,.1);color:#d9d2ff}
.sound-quick-actions .sound-record-action.recording{border-color:rgba(255,94,91,.62);background:rgba(255,94,91,.16);color:#ffb9b5;animation:record-pulse 1.1s ease-in-out infinite}
.sound-quick-actions .sound-compare-action.on{border-color:rgba(255,184,92,.52);background:rgba(255,184,92,.13);color:#ffe1b7}
.sound-quick-actions .sound-music-action{margin-left:3px;border-color:rgba(255,184,92,.32);color:#ffd092}
.sound-quick-actions .sound-clear-action{width:28px;padding:0;color:#9eabb5;font-size:1rem}
.sound-quick-actions button[hidden]{display:none}
.sound-quickbar.awaiting-replacement #soundRecordQuickBtn,.sound-quickbar.awaiting-replacement #soundUploadQuickBtn{border-color:rgba(73,223,207,.7);background:rgba(73,223,207,.13);color:#d7fffa;box-shadow:0 0 0 2px rgba(73,223,207,.08)}
.ai-voice-manager{margin:0 0 5px;padding:7px;border:1px solid rgba(92,190,255,.34);border-radius:10px;background:linear-gradient(135deg,rgba(39,91,128,.2),rgba(15,25,32,.97) 50%);box-shadow:inset 0 1px 0 rgba(255,255,255,.025)}
.ai-voice-manager[hidden]{display:none}.ai-voice-manager-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.ai-voice-manager-title{display:flex;min-width:0;align-items:center;gap:7px}.ai-voice-manager-title>i{display:grid;width:27px;height:27px;flex:none;place-items:center;border:1px solid rgba(102,202,255,.4);border-radius:8px;background:rgba(69,162,215,.12);color:#9edcff}.ai-voice-manager-title svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.ai-voice-manager-title>span{min-width:0}.ai-voice-manager-title strong{display:block;color:#effaff;font-size:.68rem}.ai-voice-manager-title small{display:block;overflow:hidden;max-width:520px;margin-top:1px;color:#8498a5;font-size:.57rem;text-overflow:ellipsis;white-space:nowrap}.ai-voice-manager-actions{display:flex;gap:4px}.ai-voice-manager-actions button{display:grid;width:27px;height:27px;place-items:center;padding:0;border:1px solid #344650;border-radius:7px;background:#17232b;color:#9fb0ba;cursor:pointer;font-size:.95rem}.ai-voice-manager-actions button:hover:not(:disabled){border-color:#6bcdf5;color:#ecfbff}.ai-voice-manager-actions button:disabled{cursor:wait;opacity:.45}
.ai-voice-list{display:grid;gap:5px;max-height:145px;overflow-y:auto;margin-top:7px;scrollbar-color:#465c68 transparent}.ai-voice-empty{padding:11px;border:1px dashed #354954;border-radius:8px;color:#82949f;font-size:.61rem;text-align:center}.ai-voice-row{display:grid;grid-template-columns:minmax(130px,1fr) auto auto auto;align-items:center;gap:6px;min-height:37px;padding:5px 6px;border:1px solid #30434e;border-radius:8px;background:rgba(16,29,37,.84)}.ai-voice-row.current{border-color:rgba(73,223,207,.52);background:rgba(73,223,207,.08)}.ai-voice-row.saved{box-shadow:inset 3px 0 0 rgba(112,210,255,.48)}.ai-voice-copy{min-width:0}.ai-voice-copy strong{display:block;overflow:hidden;color:#e4eef2;font-size:.63rem;text-overflow:ellipsis;white-space:nowrap}.ai-voice-copy small{display:block;margin-top:2px;color:#788b96;font-size:.53rem}.ai-voice-use,.ai-voice-save,.ai-voice-delete{min-height:27px;padding:0 8px;border:1px solid #3a505b;border-radius:7px;background:#1a2a33;color:#bfd1d9;cursor:pointer;font-size:.57rem;font-weight:850}.ai-voice-use:hover:not(:disabled){border-color:#58dccc;color:#eafffc}.ai-voice-use:disabled{border-color:rgba(73,223,207,.34);background:rgba(73,223,207,.1);color:#9ce9df;cursor:default}.ai-voice-save{border-color:rgba(105,190,239,.38);color:#bfe8ff}.ai-voice-save:hover:not(:disabled){border-color:#74cfff;background:rgba(74,170,224,.12);color:#f1fbff}.ai-voice-save.saved{border-color:rgba(112,210,255,.48);background:rgba(74,170,224,.1)}.ai-voice-delete{width:28px;padding:0;border-color:rgba(255,125,137,.3);color:#ff9eaa;font-size:.9rem}.ai-voice-delete:hover:not(:disabled){border-color:rgba(255,125,137,.68);background:rgba(255,93,108,.1)}.ai-voice-row button:disabled{opacity:.55}.ai-voice-help{margin:6px 1px 0;color:#72848e;font-size:.56rem;line-height:1.35}
.ai-replace-composer{display:grid;grid-template-columns:31px minmax(180px,1fr) auto;align-items:center;gap:7px;margin:0 0 5px;padding:6px 7px;border:1px solid rgba(73,223,207,.38);border-radius:10px;background:linear-gradient(105deg,rgba(73,223,207,.1),rgba(21,28,48,.96) 44%,rgba(15,24,31,.98));box-shadow:inset 0 1px 0 rgba(255,255,255,.025)}
.ai-replace-composer[hidden]{display:none}.ai-replace-icon{display:grid;width:29px;height:29px;place-items:center;border:1px solid rgba(73,223,207,.4);border-radius:8px;background:rgba(73,223,207,.1);color:#75f3e5}.ai-replace-icon svg{width:18px;height:18px}.ai-replace-field{display:flex;min-width:0;align-items:center;gap:8px}.ai-replace-field>span{flex:none;color:#a9bac2;font-size:.61rem;font-weight:800}.ai-replace-field input{width:100%;height:30px;padding:0 10px;border:1px solid #3b4c58;border-radius:8px;outline:none;background:#0d171e;color:#f3fbfc;font:800 .68rem inherit}.ai-replace-field input::placeholder{color:#61717c}.ai-replace-field input:focus{border-color:#52dfcf;box-shadow:0 0 0 2px rgba(73,223,207,.11)}
.ai-replace-button{display:inline-flex;min-height:30px;align-items:center;gap:6px;padding:0 11px;border:1px solid rgba(73,223,207,.53);border-radius:8px;background:rgba(73,223,207,.13);color:#d9fffb;cursor:pointer;font-size:.63rem;font-weight:900}.ai-replace-button svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.7}.ai-replace-button:hover:not(:disabled){border-color:#6ff6e7;background:rgba(73,223,207,.2)}.ai-replace-button:disabled{cursor:not-allowed;opacity:.42}.ai-replace-progress{display:flex;grid-column:2/4;align-items:center;gap:7px;min-width:0;color:#cfe9eb;font-size:.6rem;font-weight:750}.ai-replace-progress[hidden]{display:none}.ai-replace-spinner{width:13px;height:13px;flex:none;border:2px solid rgba(111,246,231,.22);border-top-color:#6ff6e7;border-radius:50%;animation:ai-replace-spin .8s linear infinite}.ai-replace-percent{margin-left:auto;color:#6fe8da;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.ai-replace-note{grid-column:2/4;color:#71818c;font-size:.54rem;line-height:1.3}.ai-replace-composer.busy .ai-replace-field,.ai-replace-composer.busy .ai-replace-button{display:none}.ai-replace-composer.done{border-color:rgba(95,225,163,.5);background:linear-gradient(105deg,rgba(70,204,151,.12),rgba(15,24,31,.98) 50%)}@keyframes ai-replace-spin{to{transform:rotate(360deg)}}
.ai-replace-composer.error{border-color:rgba(255,116,126,.55);background:linear-gradient(105deg,rgba(255,92,108,.11),rgba(15,24,31,.98) 52%)}.ai-replace-composer.error .ai-replace-progress{color:#ffbdc3}.ai-replace-composer.error .ai-replace-spinner{display:none}.ai-replace-composer.error .ai-replace-button{border-color:rgba(255,160,169,.48);color:#ffd9dd}
.sound-next-step{display:flex;min-height:35px;align-items:center;gap:8px;margin:0 0 5px;padding:5px 9px;border:1px solid #2a3a44;border-radius:9px;background:rgba(15,24,31,.92);color:#dce7ea}
.sound-next-step[hidden]{display:none}.sound-next-step.active{border-color:rgba(73,223,207,.46);background:linear-gradient(90deg,rgba(73,223,207,.11),rgba(15,24,31,.96) 54%)}.sound-next-step.complete{border-color:rgba(98,226,165,.38);background:linear-gradient(90deg,rgba(70,204,151,.1),rgba(15,24,31,.96) 54%)}
.sound-next-step-badge{display:grid;width:24px;height:24px;flex:none;place-items:center;border:1px solid rgba(255,195,111,.48);border-radius:7px;background:rgba(255,184,92,.11);color:#ffd596;font-size:.7rem;font-weight:900}.sound-next-step.complete .sound-next-step-badge{border-color:rgba(91,225,165,.5);background:rgba(63,196,141,.13);color:#aef4d2}
.sound-next-step>span:last-child{min-width:0}.sound-next-step strong{display:block;font-size:.67rem;line-height:1.12}.sound-next-step small{display:block;overflow:hidden;margin-top:2px;color:#8fa0aa;font-size:.58rem;font-weight:650;text-overflow:ellipsis;white-space:nowrap}
.ai-transcript{margin:0 0 5px;padding:7px;border:1px solid rgba(144,132,255,.34);border-radius:10px;background:linear-gradient(135deg,rgba(38,34,70,.42),rgba(15,25,32,.96) 48%);box-shadow:inset 0 1px 0 rgba(255,255,255,.025)}
.ai-transcript[hidden]{display:none}.ai-transcript-head{display:flex;align-items:center;gap:7px}.ai-transcript-title{display:flex;min-width:160px;align-items:center;gap:7px;color:#d9d4ff}.ai-transcript-title>i{display:grid;width:25px;height:25px;flex:none;place-items:center;border:1px solid rgba(161,148,255,.42);border-radius:7px;background:rgba(125,108,255,.14);font-style:normal}.ai-transcript-title>span{min-width:0}.ai-transcript-title strong{display:block;color:#f3f1ff;font-size:.68rem}.ai-transcript-title small{display:block;max-width:280px;overflow:hidden;margin-top:1px;color:#8f9baa;font-size:.57rem;text-overflow:ellipsis;white-space:nowrap}
.ai-transcript-search{min-width:120px;max-width:230px;flex:1}.ai-transcript-search input{width:100%;height:27px;padding:0 9px;border:1px solid #354451;border-radius:7px;outline:none;background:#101820;color:#eef4f7;font:700 .62rem inherit}.ai-transcript-search input::placeholder{color:#74828e}.ai-transcript-search input:focus{border-color:#8f83ff;box-shadow:0 0 0 2px rgba(143,131,255,.12)}
.ai-transcript-close{display:grid;width:27px;height:27px;flex:none;place-items:center;padding:0;border:1px solid #34424d;border-radius:7px;background:#172129;color:#95a2ad;cursor:pointer;font-size:1rem}.ai-transcript-close:hover{border-color:#667582;color:#fff}
.ai-transcript-words{display:flex;max-height:76px;flex-wrap:wrap;gap:4px;overflow-y:auto;margin-top:7px;padding:1px;scrollbar-color:#495866 transparent}.ai-word{display:inline-flex;min-height:25px;align-items:center;gap:5px;padding:3px 7px;border:1px solid #33434e;border-radius:7px;background:#16232b;color:#cbd7dc;cursor:pointer;font-size:.61rem;font-weight:800;transition:.14s}.ai-word time{color:#72828e;font:700 .52rem ui-monospace,SFMono-Regular,Consolas,monospace}.ai-word:hover,.ai-word:focus-visible{border-color:#8f83ff;background:#27294a;color:#fff;outline:none;transform:translateY(-1px)}.ai-word.selected{border-color:#60e2d3;background:rgba(73,223,207,.15);color:#eafffc;box-shadow:0 0 0 1px rgba(73,223,207,.12)}.ai-word.is-match{border-color:rgba(255,196,111,.55);background:rgba(255,184,92,.1);color:#ffe2b8}.ai-word[hidden]{display:none}
.ai-word:disabled{cursor:not-allowed;opacity:.35;transform:none}
.ai-transcript-help{margin:6px 1px 0;color:#71808c;font-size:.57rem;line-height:1.35}.ai-transcript-empty{width:100%;padding:8px;color:#84929d;font-size:.61rem;text-align:center}.ai-transcript-fix{display:inline-flex;min-height:28px;align-items:center;justify-content:center;margin:2px auto 4px;padding:0 10px;border:1px solid rgba(255,184,92,.48);border-radius:7px;background:rgba(255,184,92,.1);color:#ffe0ad;font-size:.59rem;font-weight:850;text-decoration:none}.ai-transcript-fix:hover{border-color:#ffd18f;background:rgba(255,184,92,.16);color:#fff4df}
@keyframes ai-spark{0%,100%{opacity:.65;transform:scale(.92) rotate(-4deg)}50%{opacity:1;transform:scale(1.08) rotate(4deg)}}
.sound-sidebar-guide{display:flex;align-items:flex-start;gap:8px;padding:9px;border:1px solid rgba(255,184,92,.2);border-radius:10px;background:rgba(255,184,92,.055)}
.sound-sidebar-guide>span:last-child{min-width:0}
.sound-sidebar-guide strong{display:block;color:#eef4f7;font-size:.72rem;line-height:1.25}
.sound-sidebar-guide small{display:block;margin-top:3px;color:#82909d;font-size:.62rem;line-height:1.4}
.sound-legacy-hooks{display:none!important}
.sound-studio>.sound-clip-inspector{order:0}.sound-studio>.sound-sidebar-guide{order:1}.sound-studio>.sound-card:not(.sound-clip-inspector){order:2}.sound-studio>.sound-status{order:3}
.sound-range-selection{position:absolute;z-index:8;top:0;bottom:0;min-width:3px;border:1px solid #fff1c9;border-radius:4px;background:linear-gradient(180deg,rgba(255,197,116,.34),rgba(73,223,207,.25));box-shadow:0 0 0 1px rgba(6,20,23,.72),0 0 11px rgba(255,196,111,.26);pointer-events:auto}
.sound-range-selection[hidden]{display:none}
.sound-range-selection.detached{z-index:8;top:2px;bottom:2px}
.sound-range-selection.output{z-index:10;top:auto;bottom:0;height:20px}
.sound-range-handle{position:absolute;z-index:2;top:50%;width:9px;height:24px;padding:0;border:1px solid #fff5dd;border-radius:4px;background:#ffc16f;box-shadow:0 2px 7px #0009;cursor:ew-resize;touch-action:none;transform:translate(-50%,-50%)}
.sound-range-handle.start{left:0}.sound-range-handle.end{left:100%}
.sound-range-handle::after{position:absolute;top:6px;bottom:6px;left:3px;border-left:1px solid rgba(77,47,9,.65);content:''}
.sound-range-handle:hover,.sound-range-handle:focus-visible{background:#ffe0ad;outline:2px solid rgba(255,255,255,.7);outline-offset:1px}
.timeline-area.sound-range-mode .attached-waveform{z-index:8;border-color:rgba(255,203,131,.78);background:rgba(46,35,22,.68);cursor:crosshair;pointer-events:auto}
.timeline-area.has-sound-range .attached-waveform{z-index:8;pointer-events:none}
.timeline-area.sound-range-mode .waveform-track{border-color:rgba(255,203,131,.72);cursor:crosshair;box-shadow:inset 0 0 0 1px rgba(255,184,92,.12)}
.timeline-area.sound-range-mode .output-track{border-color:rgba(255,203,131,.72);cursor:crosshair;box-shadow:inset 0 0 0 1px rgba(255,184,92,.12)}
.timeline-area.sound-range-mode .output-clip{pointer-events:none}
.timeline-area.sound-range-mode .attached-waveform-bars i,.timeline-area.sound-range-mode .waveform-bars i{background:#ffd092;box-shadow:0 0 4px rgba(255,184,92,.34)}
.source-mute-range{background:repeating-linear-gradient(135deg,rgba(255,101,91,.16) 0 5px,rgba(255,101,91,.28) 5px 10px);border-right:1px solid rgba(255,154,145,.6);border-left:1px solid rgba(255,154,145,.6)}
.sound-clip.replacement{border-color:rgba(73,223,207,.72);background:linear-gradient(180deg,rgba(91,87,184,.7),rgba(40,86,100,.78));box-shadow:inset 0 -2px 0 rgba(73,223,207,.62)}
.sound-clip.trimming{z-index:6;cursor:ew-resize;box-shadow:0 0 0 2px rgba(73,223,207,.42),0 6px 16px #0009}
.sound-trim-handle{position:absolute;z-index:8;top:0;bottom:0;width:12px;padding:0;border:1px solid rgba(159,255,244,.72);background:linear-gradient(180deg,#6ce8da,#2aaea4);color:#071716;cursor:ew-resize;touch-action:none;opacity:.88}.sound-trim-handle.start{left:0;border-radius:6px 2px 2px 6px}.sound-trim-handle.end{right:0;border-radius:2px 6px 6px 2px}.sound-trim-handle:hover,.sound-trim-handle:focus-visible{opacity:1;box-shadow:0 0 0 2px rgba(73,223,207,.3)}
.sound-trim-grip{position:absolute;top:50%;left:50%;width:3px;height:15px;border-right:1px solid rgba(3,27,25,.62);border-left:1px solid rgba(3,27,25,.62);transform:translate(-50%,-50%)}
.sound-trim-tip{position:absolute;top:2px;left:0;display:none;padding:3px 5px;border:1px solid #40535d;border-radius:5px;background:#091118;color:#eafffc;font:750 .55rem ui-monospace,monospace;white-space:nowrap}.sound-trim-handle.end .sound-trim-tip{right:0;left:auto}.sound-trim-handle:hover .sound-trim-tip,.sound-trim-handle:focus-visible .sound-trim-tip,.sound-clip.trimming .sound-trim-tip{display:block}
.sound-clip-name{left:15px;max-width:calc(100% - 30px)}

@media(min-width:701px) and (max-width:1180px){
  .sound-quickbar-intro{min-width:118px}.sound-quickbar-intro small{max-width:92px}
  .sound-quick-actions button span{display:none}.sound-quick-actions button{width:31px;padding:0}
  .ai-transcript-title{min-width:128px}.ai-transcript-title small{max-width:170px}
  .ai-replace-composer{grid-template-columns:29px minmax(140px,1fr) auto}.ai-replace-field>span{display:none}.ai-replace-note{display:none}
}
@media(max-width:700px){
  .sound-quickbar{align-items:flex-start;flex-direction:column;padding:6px}
  .sound-quickbar-intro{width:100%;min-width:0;padding:0 0 5px;border-right:0;border-bottom:1px solid #2b3943}
  .sound-quickbar-intro small{max-width:none}
  .sound-quick-actions{width:100%}
  .sound-quick-actions button{height:34px}
  .ai-transcript-head{align-items:stretch;flex-wrap:wrap}.ai-transcript-title{width:calc(100% - 34px);min-width:0}.ai-transcript-search{order:3;width:100%;max-width:none}.ai-transcript-words{max-height:105px}
  .ai-voice-row{grid-template-columns:minmax(100px,1fr) auto auto auto}.ai-voice-help{display:none}
  .ai-replace-composer{grid-template-columns:29px 1fr}.ai-replace-field{grid-column:2}.ai-replace-button{grid-column:1/3;justify-content:center}.ai-replace-progress,.ai-replace-note{grid-column:1/3}
}

/* Full editor workspace: compact preview and inspector above a full-width timeline. */
.focus-layout-btn{display:inline-flex;min-height:34px;align-items:center;gap:6px;padding:0 10px;border:1px solid rgba(155,134,255,.32);border-radius:9px;background:rgba(155,134,255,.075);color:#c9c0ff;cursor:pointer;font-size:.68rem;font-weight:800;white-space:nowrap;transition:border-color .16s ease,background .16s ease,color .16s ease}
.focus-layout-btn svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.focus-layout-btn:hover:not(:disabled){border-color:rgba(155,134,255,.7);background:rgba(155,134,255,.15);color:#f0edff}
.focus-layout-btn[aria-pressed="true"]{border-color:rgba(73,223,207,.58);background:rgba(73,223,207,.13);color:#a8f8ee}
.focus-layout-btn:disabled{cursor:not-allowed;opacity:.34}
.controls{padding:0 10px 14px}
.inspector-masthead{position:sticky;z-index:20;top:0;display:flex;min-height:54px;align-items:center;gap:9px;margin:0 -10px;padding:8px 11px;border-bottom:1px solid #293640;background:linear-gradient(180deg,rgba(20,28,36,.98),rgba(14,20,27,.97));backdrop-filter:blur(12px)}
.inspector-masthead-icon{display:grid;width:32px;height:32px;flex:none;place-items:center;border:1px solid rgba(73,223,207,.3);border-radius:9px;background:rgba(73,223,207,.09);color:#6ce9da}
.inspector-masthead-icon svg{width:18px;height:18px}
.inspector-masthead strong{display:block;color:#edf7f8;font-size:.75rem}
.inspector-masthead small{display:block;margin-top:2px;color:#788793;font-size:.58rem}
.source-control-section{display:none}
.context-inspector{display:grid;gap:7px;padding:10px 0 2px}
.context-inspector:not(:has(> :not([hidden]))){display:none}
.context-inspector>.ai-voice-manager,.context-inspector>.ai-replace-composer,.context-inspector>.ai-replacement-list-panel,.context-inspector>.ai-transcript{width:100%;min-width:0;margin:0}
.context-inspector .ai-replace-composer{grid-template-columns:31px minmax(0,1fr);align-items:start;padding:8px}
.context-inspector .ai-replace-field{grid-column:2;display:grid;gap:5px}
.context-inspector .ai-replace-field>span{white-space:normal}
.context-inspector .ai-replace-button{grid-column:1/3;justify-content:center}
.context-inspector .ai-replace-progress,.context-inspector .ai-replace-note{grid-column:1/3}
.context-inspector .ai-transcript-head{align-items:stretch;flex-wrap:wrap}
.context-inspector .ai-transcript-title{width:calc(100% - 34px);min-width:0}
.context-inspector .ai-transcript-title small{max-width:205px}
.context-inspector .ai-transcript-search{order:3;width:100%;max-width:none}
.context-inspector .ai-transcript-words{max-height:150px}
.context-inspector .ai-voice-list{max-height:220px}
.context-inspector .ai-voice-row{grid-template-columns:minmax(82px,1fr) auto auto auto;gap:4px}
.context-inspector .ai-voice-use,.context-inspector .ai-voice-save{padding:0 6px;font-size:.53rem}
.context-inspector .ai-voice-help{line-height:1.45}
.context-inspector .ai-replacement-list-head{align-items:flex-start;flex-direction:column;gap:4px}
.context-inspector .ai-replacement-list-head>span:first-child{flex-wrap:wrap}
.context-inspector .ai-replacement-row{grid-template-columns:25px minmax(0,1fr) 26px;grid-template-rows:auto auto;gap:5px}
.context-inspector .ai-replacement-number{grid-column:1;grid-row:1}
.context-inspector .ai-replacement-copy{grid-column:2;grid-row:1}
.context-inspector .ai-replacement-show{grid-column:2;grid-row:2;justify-self:start}
.context-inspector .ai-replacement-row>button:not(.ai-replacement-show):not(.ai-replacement-delete){grid-column:2;grid-row:2;justify-self:end}
.context-inspector .ai-replacement-delete{grid-column:3;grid-row:1}
.control-section.tool-accordion{padding:7px 0}
.tool-accordion-toggle{min-height:52px;padding:7px}
.export-tool-toggle{border-color:rgba(73,223,207,.22);background:linear-gradient(135deg,rgba(73,223,207,.08),rgba(18,27,34,.8));box-shadow:inset 0 1px 0 rgba(255,255,255,.025)}
.export-tool-toggle:hover{border-color:rgba(73,223,207,.48);background:linear-gradient(135deg,rgba(73,223,207,.14),rgba(18,27,34,.92))}

@media(min-width:701px){
  .app{width:100%;max-width:none;padding:10px}
  .embedded .app{padding:0}
  .workspace.timeline-wide-layout{grid-template-columns:minmax(0,1fr) 340px;grid-template-rows:minmax(250px,var(--top-pane-share,40%)) minmax(280px,1fr);gap:10px;height:calc(100vh - 94px);height:calc(100dvh - 94px);min-height:620px}
  .embedded .workspace.timeline-wide-layout{height:100vh;height:100dvh;min-height:0}
  .workspace.timeline-wide-layout>.preview-card{grid-column:1;grid-row:1;height:auto;min-height:0;grid-template-rows:auto minmax(0,1fr) 6px!important;border-radius:14px}
  .workspace.timeline-wide-layout>.controls{grid-column:2;grid-row:1;height:auto;min-height:0;border-radius:14px}
  .workspace.timeline-wide-layout>.trim-editor{display:flex;grid-column:1/-1;grid-row:2;min-width:0;min-height:0;flex-direction:column;overflow:hidden;padding:5px 10px 0;border:1px solid var(--line);border-radius:14px;background:#0e1319;box-shadow:var(--shadow)}
  .workspace.timeline-wide-layout>.trim-editor .timeline-scroll{min-height:120px;flex:1}
  .workspace.timeline-wide-layout.inspector-collapsed{grid-template-columns:minmax(0,1fr)}
  .workspace.timeline-wide-layout.inspector-collapsed>.preview-card{grid-column:1}
  .workspace.timeline-wide-layout.inspector-collapsed>.controls{display:none}
  .workspace.timeline-wide-layout.inspector-collapsed>.trim-editor{grid-column:1}
  .workspace.timeline-wide-layout:not(.has-source){grid-template-columns:1fr;grid-template-rows:1fr}
  .workspace.timeline-wide-layout:not(.has-source)>.preview-card{grid-column:1;grid-row:1;height:100%;grid-template-rows:auto minmax(0,1fr)!important;border-radius:16px}
  .workspace.timeline-wide-layout:not(.has-source)>.controls,
  .workspace.timeline-wide-layout:not(.has-source)>.trim-editor,
  .workspace.timeline-wide-layout:not(.has-source) .pane-divider,
  .workspace.timeline-wide-layout:not(.has-source) .focus-layout-btn,
  .workspace.timeline-wide-layout:not(.has-source) .preview-size-control{display:none}
  .workspace.timeline-wide-layout:not(.has-source) .preview-head{border-bottom-color:rgba(44,56,67,.55)}
  .workspace.timeline-wide-layout:not(.has-source) .stage{min-height:0}
}
@media(max-width:700px){
  .focus-layout-btn{display:none}
  .workspace.timeline-wide-layout{display:flex;flex-direction:column}
  .workspace.timeline-wide-layout>.preview-card{order:1}
  .workspace.timeline-wide-layout>.trim-editor{order:2;margin-top:8px;border:1px solid var(--line);border-radius:12px}
  .workspace.timeline-wide-layout>.controls{order:3;margin-top:8px}
  .workspace.timeline-wide-layout:not(.has-source)>.trim-editor,
  .workspace.timeline-wide-layout:not(.has-source)>.controls{display:none}
}
