:root {
  color-scheme: dark;
  --bg: #0b0a10;
  --panel: #121118;
  --panel-2: #181620;
  --line: #2a2733;
  --line-strong: #3b3647;
  --text: #f7f4fa;
  --muted: #9c96a7;
  --violet: #a985ff;
  --violet-2: #7c4dff;
  --violet-soft: rgba(169, 133, 255, .13);
  --cyan: #65e8d7;
  --danger: #ff7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, .35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 1180px; height: 100%; overflow: hidden; background: var(--bg); }
body { margin: 0; height: 100vh; overflow: hidden; color: var(--text); background: radial-gradient(circle at 76% 0%, rgba(124,77,255,.11), transparent 29rem), var(--bg); }
button, input { font: inherit; }
button { color: inherit; }

.topbar { height: 58px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(11,10,16,.9); backdrop-filter: blur(18px); position: relative; z-index: 20; }
.brand { color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -.03em; font-size: 1.18rem; display: flex; gap: 12px; align-items: center; }
.brand-mark { width: 28px; height: 28px; display: flex; gap: 2px; align-items: center; justify-content: center; color: var(--violet); }
.brand-mark i { width: 3px; border-radius: 3px; background: currentColor; box-shadow: 0 0 14px rgba(169,133,255,.45); }
.brand-mark i:nth-child(1), .brand-mark i:nth-child(5) { height: 8px; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(4) { height: 17px; }
.brand-mark i:nth-child(3) { height: 25px; }
.top-actions, .privacy { display: flex; align-items: center; gap: 11px; }
.global-history { display:flex; gap:4px; }.global-history button{width:30px;height:30px;border:1px solid var(--line-strong);border-radius:6px;background:#191720;color:var(--text);cursor:pointer}.global-history button:disabled{opacity:.3;cursor:not-allowed}
.clip-rename-input { width:100%; min-width:0; height:28px; padding:0 7px; border:1px solid var(--cyan); border-radius:5px; outline:none; background:#0e0c13; color:var(--text); font:inherit; box-shadow:0 0 0 2px rgba(101,232,215,.12); }
.effect-scope{display:flex;align-items:center;gap:10px;margin:0 0 18px;padding:11px;border:1px solid var(--line);border-radius:8px;background:#121019;cursor:pointer}.effect-scope input{width:34px;height:18px;accent-color:var(--cyan)}.effect-scope span,.effect-scope b,.effect-scope small{display:block}.effect-scope b{font-size:.76rem}.effect-scope small{margin-top:3px;color:var(--muted);font-size:.64rem}
.track-zoom-control { position:absolute; right:255px; bottom:10px; z-index:30; }.track-zoom-control summary{height:34px;padding:0 9px;display:flex;align-items:center;list-style:none;border:1px solid var(--line-strong);border-radius:6px;background:#191720;color:var(--muted);font-size:.65rem;cursor:pointer}.track-zoom-control summary::-webkit-details-marker{display:none}.track-zoom-control[open] summary{color:var(--cyan)}.track-zoom-control>div{position:absolute;right:0;bottom:41px;width:210px;padding:12px;display:grid;gap:9px;border:1px solid var(--line-strong);border-radius:8px;background:#211d2b;box-shadow:0 14px 35px #0009}.track-zoom-control label{display:grid;grid-template-columns:1fr 62px 12px;align-items:center;gap:4px;color:var(--muted);font-size:.68rem}.track-zoom-control input{width:62px;height:28px;border:1px solid var(--line);border-radius:5px;background:#100d16;color:var(--text)}.track-zoom-control button{height:30px;border:0;border-radius:5px;background:var(--violet);color:#130d1d;font-weight:700;cursor:pointer}.format-select{right:148px}
.privacy { color: var(--muted); font-size: .82rem; }
.lock { color: var(--cyan); font-size: 1rem; transform: rotate(-35deg); }
.icon-button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--muted); font-size: 1.05rem; transition: .2s; }
.icon-button:hover { color: var(--text); border-color: var(--line-strong); background: var(--panel-2); }
.fullscreen-button { height: 36px; padding: 0 12px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); cursor: pointer; font-size: .72rem; }
.fullscreen-button:hover { color: var(--text); border-color: var(--violet); background: var(--violet-soft); }
.fullscreen-button span { color: var(--violet); font-size: 1rem; }
.fullscreen-button b { font-weight: 650; }

.workspace { width: calc(100% - 32px); height: calc(100vh - 58px); margin: 0 auto; padding: 10px 0 12px; display: grid; grid-template-rows: 58px minmax(0,1fr); gap: 10px; }
.upload-card { border: 1px dashed var(--line-strong); border-radius: 11px; min-height: 0; padding: 9px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; background: linear-gradient(90deg, rgba(169,133,255,.07), transparent 35%), var(--panel); cursor: pointer; outline: none; transition: border-color .2s, background .2s, transform .2s; }
.upload-card:hover, .upload-card:focus-visible, .upload-card.dragging { border-color: var(--violet); background-color: var(--panel-2); transform: translateY(-1px); }
.upload-icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(169,133,255,.35); border-radius: 9px; color: var(--violet); background: var(--violet-soft); font-size: 1.3rem; }
.upload-card strong, .upload-card span { display: block; }
.upload-card strong { font-size: .98rem; margin-bottom: 5px; }
.upload-card span { color: var(--muted); font-size: .78rem; }
.primary-button { border: 0; border-radius: 9px; background: var(--violet); color: #100b19; font-weight: 800; cursor: pointer; box-shadow: 0 8px 24px rgba(124,77,255,.24); }
.primary-button.compact { padding: 11px 17px; }

.editor-grid { --trim-height: 1fr; min-height: 0; height: 100%; display: grid; grid-template-columns: 275px minmax(720px,1fr); grid-template-rows: minmax(340px,var(--trim-height)) 10px minmax(180px,1fr); column-gap: 10px; row-gap: 0; margin: 0; align-items: stretch; }
.panel { min-height: 0; height: 100%; border: 1px solid var(--line); border-radius: 11px; background: rgba(18,17,24,.94); box-shadow: var(--shadow); overflow: hidden; }
.clips-panel, .trim-panel, .merge-panel { display: flex; flex-direction: column; }
.clips-panel { grid-column: 1; grid-row: 1 / 4; }
.trim-panel { grid-column: 2; grid-row: 1; }
.panel-resizer { grid-column: 2; grid-row: 2; position: relative; cursor: row-resize; touch-action: none; display: grid; place-items: center; }
.panel-resizer::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 2px; border-radius: 2px; background: var(--line); transition: .15s; }
.panel-resizer span { position: relative; z-index: 1; width: 54px; height: 7px; border: 1px solid var(--line-strong); border-radius: 5px; background: #211e29; }
.panel-resizer:hover::before, .panel-resizer.dragging::before, .panel-resizer:focus-visible::before { background: var(--violet); }
.merge-panel { grid-column: 2; grid-row: 3; }
.panel-heading { min-height: 60px; padding: 14px 16px; display: flex; flex: 0 0 auto; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-heading > div { display: flex; align-items: center; gap: 10px; }
.panel h2 { margin: 0; font-size: .95rem; letter-spacing: -.01em; }
.step { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--violet); font-size: .69rem; }
.count, .duration-chip { color: var(--muted); font-size: .72rem; border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; }
.duration-chip { color: var(--cyan); border-color: rgba(101,232,215,.2); background: rgba(101,232,215,.06); }

.empty-state, .trim-empty { min-height: 0; flex: 1; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.trim-empty { display: none !important; }
.empty-state strong, .trim-empty strong { color: var(--text); font-size: .9rem; margin: 10px 0 7px; }
.empty-state span, .trim-empty span { max-width: 250px; font-size: .78rem; line-height: 1.55; }
.empty-wave { color: var(--violet); font-size: 1.5rem; letter-spacing: -4px; opacity: .75; }
.trim-empty-icon { font-size: 2rem !important; color: var(--violet); opacity: .8; }

.clip-list { min-height: 0; flex: 1; padding: 10px; display: grid; align-content: start; gap: 7px; max-height: none; overflow: auto; }
.clip-list:empty { flex: 0; padding: 0; }
.clip-item { padding: 12px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 10px; background: #17151d; cursor: pointer; transition: .18s; }
.clip-item:hover { background: #1d1a25; }
.clip-item.active { border-color: rgba(169,133,255,.45); background: var(--violet-soft); }
.drag-grip { color: #6f687b; cursor: grab; font-size: 1rem; letter-spacing: -3px; }
.clip-item:active .drag-grip { cursor: grabbing; color: var(--violet); }
.clip-check { appearance: none; width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 5px; display: grid; place-items: center; cursor: pointer; }
.clip-check:checked { background: var(--violet); border-color: var(--violet); }
.clip-check:checked::after { content: "✓"; color: #130d1e; font-size: .72rem; font-weight: 900; }
.clip-info { min-width: 0; }
.clip-info strong, .clip-info span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-info strong { font-size: .82rem; margin-bottom: 5px; }
.clip-info span { color: var(--muted); font-size: .69rem; }
.clip-menu { border: 0; background: transparent; color: var(--muted); padding: 5px; cursor: pointer; font-size: 1rem; }
.clip-menu:hover { color: var(--danger); }
.clip-actions { display: flex; align-items: center; gap: 2px; }
.clip-add { width: 25px; height: 25px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--violet); cursor: pointer; }
.clip-add:hover { border-color: var(--violet); background: var(--violet-soft); }

.trim-editor:not([hidden]) { min-height: 0; flex: 1; padding: 14px 16px 12px; display: flex; flex-direction: column; }
.now-editing { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; }
.now-editing span { color: var(--muted); font-size: .68rem; }
.now-editing strong { display: block; margin-top: 4px; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.edit-toolbar { min-height: 42px; flex: 0 0 auto; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tool-group, .zoom-tools { display: flex; align-items: center; gap: 6px; }
.tool-button, .zoom-tools button { height: 34px; border: 1px solid var(--line-strong); border-radius: 7px; background: #191720; color: var(--muted); cursor: pointer; font-size: .7rem; transition: .18s; }
.tool-button { flex-shrink: 0; padding: 0 10px; }
.tool-button:hover:not(:disabled), .zoom-tools button:hover:not(:disabled) { color: var(--text); border-color: var(--violet); background: var(--violet-soft); }
.tool-button.accent { color: var(--text); border-color: rgba(169,133,255,.45); }
.tool-button.accent span { color: var(--violet); margin-right: 4px; }
.tool-button:disabled { opacity: .35; cursor: not-allowed; }
.boundary-rule { height: 34px; display: inline-flex; align-items: center; padding: 0 10px; border-left: 1px solid var(--line); color: var(--cyan); font-size: .66rem; white-space: nowrap; }
.zoom-tools button { width: 32px; padding: 0; font-size: 1rem; }
.zoom-tools input { width: 82px; accent-color: var(--violet); cursor: pointer; }
.zoom-tools > span { min-width: 42px; text-align: right; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .64rem; }
.timeline-scroll { min-height: 120px; flex: 1; overflow-x: auto; overflow-y: hidden; padding: 0 1px 4px; scrollbar-color: var(--line-strong) transparent; scrollbar-width: auto; }
.timeline-content { width: 100%; min-width: 100%; height: 100%; display: grid; grid-template-rows: 25px minmax(0,1fr); transition: width .18s ease; }
.time-ruler { position: relative; height: 25px; border-bottom: 1px solid var(--line); color: #777181; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .58rem; overflow: hidden; }
.ruler-mark { position: absolute; bottom: 0; height: 9px; border-left: 1px solid #4b4655; }
.ruler-mark span { position: absolute; left: 4px; bottom: 9px; white-space: nowrap; }
.wave-shell { min-height: 0; height: auto; position: relative; border: 1px solid var(--line); border-radius: 0 0 10px 10px; overflow: hidden; cursor: crosshair; touch-action: none; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(12.5% - 1px), rgba(255,255,255,.04) 12.5%); }
#waveform { width: 100%; height: 100%; display: block; pointer-events: none; }
.clip-boundary { position: absolute; z-index: 2; top: 0; bottom: 0; width: 2px; background: var(--violet); box-shadow: 0 0 12px rgba(169,133,255,.65); pointer-events: none; }
.clip-boundary::before { content: ""; position: absolute; top: 0; width: 9px; height: 17px; background: var(--violet); }
.clip-boundary-start::before { left: 0; border-radius: 0 0 5px 0; }
.clip-boundary-end::before { right: 0; border-radius: 0 0 0 5px; }
.playhead { position: absolute; display: none; z-index: 4; top: 0; bottom: 0; width: 18px; margin-left: -9px; border: 0; outline: none; cursor: ew-resize; touch-action: none; }
.playhead::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.playhead::after { content: ""; position: absolute; left: 4px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 3px rgba(101,232,215,.17); }
.playhead:focus-visible::after { box-shadow: 0 0 0 4px rgba(101,232,215,.35); }
.playhead-time { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); z-index: 6; padding: 3px 6px; border: 1px solid rgba(101,232,215,.35); border-radius: 4px; background: rgba(8,7,12,.9); color: var(--cyan); font: .58rem ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; pointer-events: none; }
.range-wrap { position: relative; height: 46px; margin: 1px 1px 0; touch-action: none; }
.range-track { position: absolute; left: 8px; right: 8px; top: 20px; height: 6px; border-radius: 5px; background: #282431; overflow: hidden; }
.range-fill { height: 100%; background: linear-gradient(90deg, var(--violet-2), var(--violet)); }
.trim-handle { position: absolute; z-index: 3; top: 9px; width: 20px; height: 29px; margin-left: -10px; padding: 0; border: 2px solid var(--violet-2); border-radius: 7px; background: var(--text); cursor: ew-resize; touch-action: none; box-shadow: 0 3px 14px rgba(0,0,0,.45); }
.trim-handle span { position: absolute; left: 6px; top: 7px; width: 4px; height: 11px; border-left: 1px solid #6d5a91; border-right: 1px solid #6d5a91; }
.trim-handle:hover, .trim-handle:focus-visible, .trim-handle.dragging { border-color: var(--cyan); outline: none; transform: scale(1.08); }
.trim-handle-start { left: 0%; }
.trim-handle-end { left: 100%; }
.range-overlay { position: absolute; inset: 0; z-index: 5; width: auto; height: auto; margin: 0; pointer-events: none; }
.range-overlay .range-track { display: none; }
.range-overlay .trim-handle { top: 0; bottom: 0; width: 22px; height: 100%; margin-left: -11px; border: 0; border-left: 3px solid var(--violet); border-right: 3px solid var(--violet); border-radius: 0; background: rgba(169,133,255,.11); box-shadow: 0 0 14px rgba(124,77,255,.24); pointer-events: auto; }
.range-overlay .trim-handle:hover, .range-overlay .trim-handle:focus-visible, .range-overlay .trim-handle.dragging { border-color: var(--cyan); background: rgba(101,232,215,.14); transform: none; }
.range-overlay .trim-handle span { left: 5px; top: 50%; width: 6px; height: 24px; margin-top: -12px; border-left: 2px solid var(--text); border-right: 2px solid var(--text); opacity: .9; }
.range-overlay .trim-handle b { position: absolute; top: 8px; padding: 3px 6px; border-radius: 4px; background: var(--violet-2); color: white; font-size: .58rem; font-weight: 700; white-space: nowrap; pointer-events: none; }
.range-overlay .trim-handle-start b { left: 16px; }
.range-overlay .trim-handle-end b { right: 16px; }
.range-overlay .trim-handle-start { margin-left: 0; }
.range-overlay .trim-handle-end { margin-left: -22px; }
.time-controls { flex: 0 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 14px; margin-top: 7px; }
.time-controls label span { display: block; color: var(--muted); font-size: .67rem; margin-bottom: 6px; }
.time-controls input { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--text); background: #0e0d13; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; text-align: center; }
.time-controls input:focus { border-color: var(--violet); }
.play-button { height: 42px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel-2); padding: 0 16px; display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: .76rem; }
.play-button:hover { border-color: var(--violet); }
.play-button span { color: var(--violet); }
.play-button kbd { margin-left: 6px; padding: 2px 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); background: #0e0d13; font-size: .58rem; font-family: inherit; }
.transport-controls { margin: 0 0 8px; }
.hint { text-align: center; color: var(--muted); font-size: .66rem; margin: 13px 0 0; }

.merge-panel { padding-bottom: 10px; }
.merge-panel .panel-heading { min-height: 44px; padding-block: 8px; }
.track-workspace { min-height: 0; flex: 1; margin: 8px 10px; display: grid; grid-template-rows: 28px minmax(0,1fr); position: relative; border: 1px solid var(--line); border-radius: 8px; background: #0d0c12; overflow: hidden; }
.track-workspace.dragging { border-color: var(--violet); box-shadow: inset 0 0 0 2px rgba(169,133,255,.14); }
.track-ruler { display: grid; grid-template-columns: 76px minmax(0,1fr); border-bottom: 1px solid var(--line); color: var(--muted); font: .58rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.track-ruler > span { display: grid; place-items: center; border-right: 1px solid var(--line); background: #17151d; }
.track-ruler > div { position: relative; background: repeating-linear-gradient(90deg,transparent 0,transparent calc(12.5% - 1px),rgba(255,255,255,.07) 12.5%); }
.track-ruler > div span { position: absolute; top: 6px; transform: translateX(4px); color: #777181; white-space: nowrap; }
.track-ruler > div span:last-child { transform: translateX(calc(-100% - 4px)); }
.track-scroll { min-height: 0; overflow: auto; scrollbar-color: var(--line-strong) transparent; scrollbar-width: auto; }
.track-stack { min-height: 100%; min-width: 100%; }
.track-row { height: 78px; display: grid; grid-template-columns: 76px minmax(0,1fr); border-bottom: 1px solid var(--line); }
.track-label { padding: 9px 8px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; background: #17151d; cursor:grab; user-select:none; }
.track-label.dragging { opacity:.45; cursor:grabbing; }
.track-label span, .track-label small { display: block; }
.track-label span { color: var(--violet); font-size: .72rem; font-weight: 800; }
.track-label small { margin-top: 4px; color: var(--muted); font-size: .57rem; line-height: 1.35; }
.track-playhead { display: block; position: absolute; z-index: 9; top: 0; bottom: 0; width: 20px; margin-left: -10px; background: transparent; cursor: ew-resize; touch-action: none; }
.track-playhead::before { content: ""; position: absolute; top: 0; bottom: 0; left: 9px; width: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.track-playhead::after { content: ""; position: absolute; top: 0; left: 5px; width: 10px; height: 8px; border-radius: 0 0 5px 5px; background: var(--cyan); }
.track-playhead span { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 3px 6px; border: 1px solid rgba(101,232,215,.35); border-radius: 4px; background: rgba(8,7,12,.92); color: var(--cyan); font: .58rem ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; pointer-events: none; }
.queue-list { min-width: 0; min-height: 0; position: relative; padding: 5px; overflow: hidden; background: repeating-linear-gradient(90deg,transparent 0,transparent calc(12.5% - 1px),rgba(255,255,255,.035) 12.5%); cursor: crosshair; }
.queue-list.dragging { background-color: rgba(169,133,255,.08); box-shadow: inset 0 0 0 2px rgba(169,133,255,.3); }
.queue-list:empty { padding: 0; }
.queue-item { position: absolute; top: 5px; bottom: 5px; min-width: 128px; display: grid; grid-template-rows: minmax(0,1fr) auto; gap: 4px; align-items: center; padding: 6px 12px; border-radius: 6px; background: linear-gradient(135deg,rgba(124,77,255,.38),rgba(169,133,255,.14)); border: 1px solid rgba(169,133,255,.52); cursor:default; overflow: hidden; touch-action: none; user-select: none; }
.track-row:nth-child(even) .queue-item { background: linear-gradient(135deg,rgba(101,232,215,.24),rgba(58,175,185,.1)); border-color: rgba(101,232,215,.46); }
.queue-item:active { cursor: grabbing; }
.queue-item.dragging { z-index: 8; border-color: var(--cyan); box-shadow: 0 6px 22px rgba(0,0,0,.45); }
.clip-resizer { position: absolute; z-index: 6; top: 3px; bottom: 3px; width: 13px; border: 1px solid rgba(255,255,255,.24); border-radius: 4px; padding: 0; background: rgba(15,12,21,.78); cursor: ew-resize; touch-action: none; }
.clip-resizer::after { content:""; position:absolute; left:4px; top:50%; width:3px; height:16px; transform:translateY(-50%); border-left:1px solid rgba(255,255,255,.6); border-right:1px solid rgba(255,255,255,.6); }
.clip-resizer:hover, .clip-resizer.dragging { background: var(--cyan); }
.clip-resizer.left { left: 0; }
.clip-resizer.right { right: 0; }
.queue-item.snapped { box-shadow:0 0 0 2px var(--cyan),0 0 18px rgba(101,232,215,.28); }
.queue-item.resizing { box-shadow:0 0 0 1px var(--violet),0 0 16px rgba(169,133,255,.22); }
.queue-number { display: none; }
.queue-copy { min-width: 0; }
.queue-copy strong, .queue-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-copy strong { font-size: .74rem; }
.queue-copy span { color: var(--muted); font-size: .64rem; margin-top: 3px; }
.queue-actions { display: flex; gap: 2px; }
.queue-actions button { min-width: 22px; height: 20px; padding: 0 4px; border: 1px solid rgba(255,255,255,.1); border-radius: 4px; background: rgba(9,8,13,.38); color: var(--muted); font-size: .56rem; cursor: pointer; }
.queue-actions button:hover:not(:disabled) { color: var(--violet); }
.queue-actions button.active { color: var(--cyan); border-color: rgba(101,232,215,.45); background: rgba(101,232,215,.1); }
.queue-actions .blend-button { flex: 1; width: auto; }
.queue-actions button:disabled { opacity: .25; cursor: default; }
.queue-actions .fade-range { width:84px; height:20px; margin:0 2px; accent-color:var(--cyan); cursor:ew-resize; }
.queue-item:has(.queue-actions button.active:first-child) { opacity:.62; }
.queue-empty { position: absolute; left: 76px; right: 0; top: 28px; bottom: 0; padding: 14px; color: var(--muted); text-align: center; font-size: .72rem; pointer-events: none; }
.queue-empty:not([hidden]) { display: grid; place-items: center; }
.track-footer { position: relative; z-index: 20; flex: 0 0 54px; min-height: 54px; padding: 0 10px; display: flex; align-items: center; justify-content: center; gap: 8px; pointer-events: auto; }
.merge-summary { position: absolute; left: 10px; min-width: 150px; padding: 0; border: 0; display: flex; gap: 10px; align-items: center; }
.merge-summary span { color: var(--muted); font-size: .73rem; }
.merge-summary strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--cyan); font-size: .83rem; }
.track-preview-button { position: relative; z-index: 100; height: 42px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 8px; background: #191720; color: var(--text); cursor: pointer; pointer-events: auto !important; }
.track-preview-button span { color: var(--cyan); margin-right: 7px; }
.track-preview-button:disabled { opacity: .35; cursor: not-allowed; }
.follow-playhead{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:.7rem;white-space:nowrap;cursor:pointer}.follow-playhead input{accent-color:var(--cyan);cursor:pointer}
.merge-button { position: absolute; right: 10px; width: auto; min-height: 42px; margin: 0; padding: 7px 14px; border: 0; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; background: linear-gradient(135deg, #b799ff, #8b61ff); color: #130d1d; box-shadow: 0 8px 20px rgba(124,77,255,.2); }
.format-select { position: absolute; right: 148px; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .68rem; }
.format-select select { height: 34px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 7px; background: #191720; color: var(--text); }
.merge-button:disabled { cursor: not-allowed; filter: grayscale(.7); opacity: .35; box-shadow: none; }
.merge-button > span:first-child { font-size: 1.2rem; }
.merge-button b, .merge-button small { display: block; text-align: left; }
.merge-button b { font-size: .82rem; }
.merge-button small { font-size: .61rem; margin-top: 3px; opacity: .7; }
.progress { margin: 6px 10px 0; height: 3px; border-radius: 3px; overflow: hidden; background: #292530; }
.progress span { display: block; width: 35%; height: 100%; background: var(--cyan); animation: progress 1.1s ease-in-out infinite; }
.history-tools { display:flex; gap:4px; margin-left:8px; }
.history-tools button { width:26px; height:24px; border:1px solid var(--line); border-radius:5px; background:#191720; color:var(--text); cursor:pointer; }
.history-tools button:disabled { opacity:.3; cursor:not-allowed; }
.history-tools #exportProject { width:auto; padding:0 8px; font-size:.68rem; }
.fade-number{width:48px;box-sizing:border-box;padding:3px 4px;border:1px solid var(--line-strong);border-radius:4px;background:#111018;color:var(--text);font:11px ui-monospace,monospace;text-align:right}.fade-number:focus{border-color:var(--cyan);outline:none}
.timeline-scroll::-webkit-scrollbar,.track-scroll::-webkit-scrollbar{width:14px;height:14px}.timeline-scroll::-webkit-scrollbar-track,.track-scroll::-webkit-scrollbar-track{background:#100e16;border-radius:8px}.timeline-scroll::-webkit-scrollbar-thumb,.track-scroll::-webkit-scrollbar-thumb{background:#4c405f;border:3px solid #100e16;border-radius:8px}.timeline-scroll::-webkit-scrollbar-thumb:hover,.track-scroll::-webkit-scrollbar-thumb:hover{background:#745d9b}
.queue-item { min-width:0 !important; }
.queue-actions button { font-size:.72rem; line-height:1; }
.add-track-row .track-lane { display:grid; place-items:center; cursor:copy; }
.add-track-row .track-lane>span { color:rgba(169,133,255,.42); font-size:.68rem; letter-spacing:.04em; pointer-events:none; }
.queue-item.selected { outline:2px solid var(--cyan); outline-offset:-2px; }
.track-context-menu { position:fixed; z-index:999; display:none; min-width:110px; padding:4px; background:#211d2b; border:1px solid var(--line-strong); border-radius:7px; box-shadow:0 10px 26px #0008; }
.track-context-menu.open { display:block; }
.track-context-menu button { width:100%; border:0; border-radius:5px; padding:7px 10px; background:transparent; color:var(--text); text-align:left; cursor:pointer; }
.track-context-menu button:hover { background:#3a304f; color:var(--cyan); }
.effect-modal { position:fixed; inset:0; z-index:1200; display:grid; place-items:center; background:rgba(5,4,8,.68); backdrop-filter:blur(7px); }.effect-modal[hidden]{display:none!important}.effect-dialog{width:390px; padding:20px; border:1px solid var(--line-strong); border-radius:13px; background:#191520; box-shadow:0 24px 80px #000b;color:var(--text)}.effect-dialog header{display:flex;justify-content:space-between;align-items:flex-start}.effect-dialog header span{color:var(--cyan);font-size:.65rem;letter-spacing:.12em}.effect-dialog h3{margin:5px 0 20px;font-size:1.05rem}.effect-dialog header button{border:0;background:transparent;color:var(--muted);font-size:1.3rem;cursor:pointer}.effect-field{margin:14px 0}.effect-field>label{display:block;margin-bottom:8px;color:var(--muted);font-size:.75rem}.effect-field>div{display:grid;grid-template-columns:1fr 82px;gap:12px;align-items:center}.effect-field input{accent-color:var(--cyan)}.effect-field output{display:none}.effect-field .effect-number{grid-column:2;width:82px;box-sizing:border-box;padding:6px 7px;border:1px solid var(--line-strong);border-radius:6px;background:#100d16;color:var(--text);font: .75rem ui-monospace,monospace;text-align:right;accent-color:auto}.effect-presets{display:flex;align-items:center;gap:6px;margin:18px 0}.effect-presets>span{margin-right:auto;color:var(--muted);font-size:.7rem}.effect-presets button,.effect-dialog footer button{padding:7px 9px;border:1px solid var(--line-strong);border-radius:6px;background:#211c2b;color:var(--text);cursor:pointer}.effect-dialog footer{display:flex;justify-content:flex-end;gap:8px;padding-top:14px;border-top:1px solid var(--line)}#effectApply{border:0;background:var(--violet);color:#120d19;font-weight:700}
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(285%); } }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 18px); z-index: 50; padding: 11px 15px; border: 1px solid var(--line-strong); border-radius: 9px; background: #211e29; color: var(--text); font-size: .78rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-height: 760px) {
  .workspace { grid-template-rows: 52px minmax(0,1fr); padding-top: 8px; gap: 8px; }
  .upload-card span { display: none; }
  .upload-card { padding-block: 7px; }
  .upload-icon { width: 34px; height: 34px; }
  .panel-heading { min-height: 52px; padding-block: 10px; }
  .trim-editor:not([hidden]) { padding-top: 10px; }
  .now-editing { margin-bottom: 10px; }
  .edit-toolbar { min-height: 36px; margin-bottom: 6px; }
  .hint { display: none; }
  .editor-grid { --trim-height: 300px; grid-template-rows: minmax(300px,var(--trim-height)) 10px minmax(180px,1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.project-home { position:fixed; inset:0; z-index:1000; min-height:100vh; display:block; background:#0e0b14; color:var(--text); pointer-events:auto; overflow:auto; }
.project-home[hidden] { display:none !important; }
.trim-empty:not([hidden]) { min-height:180px; display:grid !important; place-content:center; gap:7px; padding:20px; text-align:center; color:var(--muted); }.trim-empty strong{color:var(--text);font-size:.85rem}.trim-empty span{font-size:.7rem}
.home-button { height:32px; padding:0 10px; border:1px solid var(--line-strong); border-radius:6px; background:#191720; color:var(--text); cursor:pointer; }
.project-card { width:100%; min-height:100vh; box-sizing:border-box; padding:clamp(60px,12vh,140px) clamp(28px,10vw,180px); border:0; border-radius:0; background:linear-gradient(120deg,#171220,#0e0b14 60%); box-shadow:none; text-align:left; }
.project-card h1 { margin:14px 0 8px; }.project-card p { color:var(--muted); }.project-card label { display:block; margin:26px 0 18px; text-align:left; color:var(--muted); font-size:.8rem; }.project-card input { width:100%; box-sizing:border-box; margin-top:8px; padding:11px; border:1px solid var(--line-strong); border-radius:7px; background:#0f0c15; color:var(--text); }.project-actions { display:flex; gap:10px; }.project-actions button { position:relative; z-index:2; flex:1; padding:12px; border:0; border-radius:8px; background:#8b61ff; color:white; cursor:pointer; pointer-events:auto; }
.project-card label,.project-card input { max-width:420px; }
.project-home { isolation:isolate; background:#09070e; }
.project-home::before { content:""; position:absolute; inset:0; z-index:-3; background:radial-gradient(circle at 22% 30%,rgba(126,83,255,.2),transparent 34%),radial-gradient(circle at 78% 72%,rgba(61,215,202,.1),transparent 30%),linear-gradient(135deg,#100b19,#08070d 64%); }
.project-home::after { content:""; position:absolute; inset:0; z-index:-1; opacity:.32; background-image:linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px); background-size:48px 48px; mask-image:linear-gradient(to bottom,#000,transparent 86%); }
.home-ambient { position:absolute; z-index:-2; width:min(48vw,720px); aspect-ratio:1; right:-5vw; top:50%; transform:translateY(-50%); border-radius:50%; background:conic-gradient(from 210deg,transparent 0 20%,rgba(139,97,255,.34),rgba(101,232,215,.2),transparent 68%); filter:blur(.2px) drop-shadow(0 0 55px rgba(139,97,255,.24)); animation:ambientTurn 18s linear infinite; }
.home-ambient::before,.home-ambient::after { content:""; position:absolute; border-radius:50%; inset:12%; border:1px solid rgba(169,133,255,.32); background:radial-gradient(circle at 38% 36%,rgba(169,133,255,.18),transparent 52%); animation:ambientPulse 4.8s ease-in-out infinite; }
.home-ambient::after { inset:27%; border-color:rgba(101,232,215,.28); animation-delay:-2.4s; }
.home-ambient i { display:none; }
@keyframes ambientTurn { to{transform:translateY(-50%) rotate(360deg)} }
@keyframes ambientPulse { 0%,100%{transform:scale(.92);opacity:.45}50%{transform:scale(1.06);opacity:1} }
.home-header { height:72px; box-sizing:border-box; padding:0 clamp(28px,6vw,96px); display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid rgba(255,255,255,.07); color:var(--muted); font-size:.78rem; }
.project-logo { display:flex; flex-direction:row; align-items:center; gap:12px; white-space:nowrap; writing-mode:horizontal-tb; color:var(--text); font-size:1.05rem; letter-spacing:.08em; }
.logo-wave { height:24px; display:flex; align-items:center; gap:3px; }.logo-wave i { width:3px; border-radius:3px; background:linear-gradient(#a985ff,#65e8d7); }.logo-wave i:nth-child(1),.logo-wave i:nth-child(5){height:8px}.logo-wave i:nth-child(2),.logo-wave i:nth-child(4){height:16px}.logo-wave i:nth-child(3){height:24px}
.project-card { min-height:calc(100vh - 118px); padding:clamp(80px,14vh,150px) clamp(28px,9vw,150px); background:transparent; display:block; }
.project-card .home-kicker { color:var(--cyan); font:600 .72rem/1 ui-monospace,monospace; letter-spacing:.22em; }
.project-card h1 { margin:18px 0 12px; font-size:clamp(2.8rem,5vw,5.4rem); line-height:.98; letter-spacing:-.05em; }
.project-card p { max-width:480px; margin:0 0 40px; font-size:1rem; line-height:1.7; }
.home-content { display:flex; align-items:flex-start; gap:22px; max-width:960px; }
.project-form { flex:0 0 410px; width:min(410px,100%); padding:24px; border:1px solid rgba(255,255,255,.1); border-radius:14px; background:rgba(19,15,27,.72); box-shadow:0 22px 70px rgba(0,0,0,.3); backdrop-filter:blur(18px); }
.project-card label { margin:0 0 8px; font-size:.78rem; }.project-card input { max-width:none; height:44px; margin:0 0 14px; padding:0 13px; font-size:.92rem; }
.project-actions { max-width:none; gap:8px; }.project-actions button { min-height:42px; display:flex; align-items:center; justify-content:center; gap:7px; font-weight:650; }.project-actions button.secondary { border:1px solid var(--line-strong); background:#201a2b; color:var(--text); }
.home-footer { position:absolute; left:clamp(28px,6vw,96px); right:clamp(28px,6vw,96px); bottom:20px; display:flex; gap:18px; color:var(--muted); font-size:.72rem; }.home-footer span:first-child { color:var(--cyan); }
.file-menu { position:relative; }.file-menu summary { height:32px; padding:0 11px; display:flex; align-items:center; list-style:none; border:1px solid var(--line-strong); border-radius:6px; background:#191720; color:var(--text); cursor:pointer; font-size:.75rem; }.file-menu summary::-webkit-details-marker{display:none}.file-menu[open] summary{color:var(--cyan)}
.file-menu-popover { position:absolute; top:39px; right:0; z-index:100; width:150px; padding:5px; border:1px solid var(--line-strong); border-radius:8px; background:#211d2b; box-shadow:0 14px 35px #0009; }.file-menu-popover button { width:100%; padding:8px 10px; border:0; border-radius:5px; background:transparent; color:var(--text); text-align:left; cursor:pointer; }.file-menu-popover button:hover{background:#342b45;color:var(--cyan)}
.recent-projects { flex:1; min-width:320px; padding:20px; border:1px solid rgba(255,255,255,.08); border-radius:14px; background:rgba(13,11,19,.58); backdrop-filter:blur(16px); }
.recent-projects header { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:12px; }.recent-projects h2 { margin:0; font-size:.95rem; }.recent-projects header span { color:var(--muted); font-size:.68rem; }
.recent-project-list { display:grid; gap:6px; }.recent-project { display:flex; align-items:center; gap:6px; border:1px solid transparent; border-radius:8px; background:rgba(255,255,255,.025); }.recent-project:hover { border-color:rgba(169,133,255,.25); }.recent-open { min-width:0; flex:1; padding:9px 11px; border:0; background:transparent; color:var(--text); text-align:left; cursor:pointer; }.recent-open strong,.recent-open span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.recent-open strong { font-size:.78rem; }.recent-open span { margin-top:3px; color:var(--muted); font-size:.64rem; }.recent-delete { margin-right:7px; padding:5px 7px; border:0; border-radius:5px; background:transparent; color:var(--muted); cursor:pointer; }.recent-delete:hover { background:rgba(255,91,122,.12); color:#ff7892; }.recent-empty { padding:26px 10px; color:var(--muted); text-align:center; font-size:.75rem; }
@media (max-width:900px){.home-content{flex-direction:column}.project-form,.recent-projects{box-sizing:border-box;width:min(520px,100%);min-width:0;flex:none}}
.history-tools #exportProject { width:auto; padding:0 8px; font-size:.68rem; }
