:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --line: #2a2a2a;
  --text: #f4f4f4;
  --muted: #8d8d8d;
  --accent: #e80000;
  --ok: #3fb950;
  --warn: #e3a008;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { margin: 0; font-weight: 650; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.muted { color: var(--muted); }
button { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
button:hover { border-color: #444; }
button.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }
textarea { width: 100%; min-height: 260px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: 13px/1.5 ui-monospace, Menlo, monospace; }

.top { display: flex; align-items: center; gap: 18px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 750; letter-spacing: .02em; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.picker { flex: 1; position: relative; min-width: 0; }
.pick-btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: min(420px, 90vw); max-height: 70vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.6); }
.pick-pop input { width: 100%; margin-bottom: 10px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
.local { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }

main { flex: 1; display: grid; grid-template-columns: 1fr 300px; min-height: 0; }
main > * { overflow-y: auto; padding: 16px; }
.panel { border-left: 1px solid var(--line); background: var(--surface); }

.slot { display: block; width: 100%; text-align: left; background: var(--surface); margin-bottom: 8px; padding: 10px 12px; }
.slot.active { border-color: var(--accent); }
.slot .t { font-weight: 600; margin-bottom: 4px; }
.slot .m { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.slot .warn { color: var(--warn); font-size: 12px; margin-top: 4px; }

.tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); text-transform: uppercase; }
.tag.tofu { color: #6cb6ff; } .tag.mofu { color: #d2a8ff; } .tag.bofu { color: #ff7b72; }
.tag.cta { color: var(--accent); border-color: var(--accent); }

.start { max-width: 620px; margin: 10vh auto; text-align: center; }
.start h1 { font-size: 22px; margin-bottom: 16px; }
.drop.big { padding: 56px 22px; margin-bottom: 14px; }
.drop.big p { margin: 0 0 14px; }
.slot .tag.quick { color: var(--muted); }
.empty { max-width: 460px; margin: 15vh auto; text-align: center; color: var(--muted); }
.empty h1 { color: var(--text); font-size: 20px; margin-bottom: 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.card-head h3 { font-size: 15px; }

.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); transition: .15s; }
.drop.over { border-color: var(--accent); color: var(--text); background: #1a0a0a; }
.progress { height: 4px; background: var(--line); border-radius: 2px; margin-top: 10px; overflow: hidden; display: none; }
.progress > div { height: 100%; background: var(--accent); width: 0; }

.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.clip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; }
.clip.sel { border-color: var(--accent); }
.clip img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; display: block; background: #000; }
.clip .ci { padding: 6px 8px; font-size: 12px; }
.clip .cn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player { margin-top: 14px; display: none; }
.player video { width: 100%; max-height: 52vh; background: #000; border-radius: 8px; }

.beats { display: flex; flex-direction: column; gap: 8px; }
.beat { display: grid; grid-template-columns: 70px 1fr; gap: 10px; background: var(--surface-2); border-radius: 8px; padding: 10px; }
.beat .bt { font: 12px ui-monospace, Menlo, monospace; color: var(--muted); }
.beat .bn { font-weight: 600; margin-bottom: 4px; }
.beat .sp { white-space: pre-wrap; line-height: 1.45; }
.beat .os { margin-top: 6px; font-size: 12px; color: var(--accent); }
.beat .br { margin-top: 2px; font-size: 12px; color: var(--muted); }
.note { font-size: 12px; color: var(--warn); margin-bottom: 10px; }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 13px; margin-bottom: 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.kw { font-weight: 750; color: var(--accent); letter-spacing: .05em; }
.win { background: var(--surface-2); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.win a { color: var(--text); font-weight: 600; text-decoration: none; }
.win a:hover { text-decoration: underline; }
.win .wm { font-size: 12px; color: var(--muted); margin: 4px 0; }
.win .wn { font-size: 12px; line-height: 1.45; color: #c8c8c8; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.chip { font-size: 11px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.folder { font: 11px ui-monospace, Menlo, monospace; color: var(--muted); word-break: break-all; }

/* ── step 2: cut ─────────────────────────────────────────────── */
.small { font-size: 12px; }
.bad { color: #ff7b72; }
.ok { color: var(--ok); }
button:disabled { opacity: .4; cursor: default; }
button.link { background: none; border: none; padding: 0; color: var(--text); text-align: left; text-decoration: underline dotted; }
.queue { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.spin { width: 10px; height: 10px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.save { font-size: 12px; color: var(--muted); }

.clips { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.clip { position: relative; }
.clip .prep { position: absolute; top: 6px; left: 6px; right: 6px; font-size: 11px; background: rgba(0,0,0,.75); border-radius: 6px; padding: 3px 6px; color: var(--warn); }
.used { color: var(--accent); }

.cut-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; }
.viewer { background: #000; border-radius: 8px; display: flex; justify-content: center; position: relative; }
.viewer video { max-width: 100%; height: 46vh; display: block; cursor: pointer; }
.nov { color: var(--muted); padding: 60px 0; }
.nov-note { position: absolute; bottom: 8px; left: 8px; right: 8px; font-size: 12px; color: var(--warn); background: rgba(0,0,0,.7); padding: 4px 8px; border-radius: 6px; }
.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.tc { font: 13px ui-monospace, Menlo, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
#tcNow { color: var(--text); font-weight: 700; }
.editing { font-size: 12px; color: var(--warn); }
.timeline { user-select: none; }
.tl { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: crosshair; touch-action: none; }
.tl .strip { height: 64px; background-size: 100% 100%; background-color: #000; }
.tl .wave { height: 40px; background-size: 100% 100%; background-color: #0d0d0d; border-top: 1px solid var(--line); }
.tl .strip span, .tl .wave span { font-size: 11px; color: var(--muted); padding: 6px; display: inline-block; }
.tl .sil { position: absolute; bottom: 0; height: 40px; background: repeating-linear-gradient(45deg, rgba(227,160,8,.35) 0 4px, transparent 4px 8px); pointer-events: none; }
.tl .used-range { position: absolute; top: 0; height: 64px; background: rgba(232,0,0,.22); border-left: 1px solid var(--accent); border-right: 1px solid var(--accent); font-size: 11px; font-weight: 700; padding: 2px 4px; pointer-events: none; }
.tl .marked { position: absolute; top: 0; bottom: 0; outline: 2px solid #fff; background: rgba(255,255,255,.12); pointer-events: none; }
.tl .h { position: absolute; top: 0; bottom: 0; width: 12px; background: #fff; pointer-events: auto; cursor: ew-resize; }
.tl .hin { left: -6px; border-radius: 4px 0 0 4px; }
.tl .hout { right: -6px; border-radius: 0 4px 4px 0; }
.tl .ph { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); pointer-events: none; }
.tl-scale { display: flex; justify-content: space-between; font: 11px ui-monospace, Menlo, monospace; color: var(--muted); margin-top: 4px; }
.keys { font-size: 11px; color: var(--muted); margin: 8px 0 0; }

.beat-col h2 { display: flex; justify-content: space-between; }
.count { color: var(--text); }
.bk { border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 8px; background: var(--surface-2); }
.bk.missing { border-style: dashed; }
.bk-head { display: flex; gap: 6px; align-items: baseline; }
.ck { width: 14px; color: var(--muted); }
.bk.has .ck { color: var(--ok); }
.bk-name { flex: 1; font-weight: 600; font-size: 13px; }
.bk-len { font: 11px ui-monospace, Menlo, monospace; color: var(--muted); }
.bk-len.off { color: var(--warn); }
.rg { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 6px 0 0 20px; flex-wrap: wrap; }
.rg.ed { outline: 1px solid var(--warn); border-radius: 4px; }
.rg-btns { margin-left: auto; display: flex; gap: 2px; }
.rg-btns button, .rg > button { padding: 1px 6px; font-size: 11px; }
.rg select { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.add { margin: 8px 0 0 20px; font-size: 12px; padding: 4px 10px; }

#deadAir { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.da-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.da-head h2 { margin: 0; }
.da { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; }
.da button { padding: 3px 10px; font-size: 12px; }

.build-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bar { display: inline-block; width: 120px; height: 4px; background: var(--line); border-radius: 2px; vertical-align: middle; margin-left: 6px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); }
.rc { display: grid; grid-template-columns: 160px 1fr; gap: 14px; margin-top: 14px; font-size: 13px; }
.rc video { width: 160px; border-radius: 8px; background: #000; }
.bm { margin-top: 8px; border-collapse: collapse; font-size: 12px; }
.bm td { padding: 3px 10px 3px 0; border-bottom: 1px solid var(--line); }
.bm a { color: var(--text); }
.tcell { font-family: ui-monospace, Menlo, monospace; color: var(--muted); }

/* ── remote prep: login + downloads ─────────────────────────── */
.login { max-width: 320px; margin: 18vh auto; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.login .brand { margin-bottom: 8px; }
.login label { font-size: 12px; color: var(--muted); }
.login input { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.dl { color: var(--text); font-size: 12px; margin-left: 8px; text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.dl:hover { border-color: #555; }

/* animations (step 5) */
.anim-help, .anim-hint { margin: 0 0 10px; font-size: 12px; }
.anim-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.anim-row { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--surface-2); }
.anim-row.open { border-color: var(--accent); }
.anim-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.anim-line button { padding: 4px 9px; }
.anim-sum { flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anim-prob { font-size: 12px; margin-top: 6px; }
.anim-form { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.anim-times { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.anim-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.anim-form input, .anim-form select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.anim-times input { width: 92px; font-family: ui-monospace, Menlo, monospace; }
.anim-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }

/* ── copilot dock (step 6) ── */
.co-btn { margin-left: auto; }
.co-btn.on { border-color: var(--accent); color: var(--accent); }
.copilot { position: fixed; right: 16px; bottom: 16px; z-index: 30; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 90px));
  display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.6); }
.copilot[hidden] { display: none; }
.co-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.co-status { flex: 1; font-size: 12px; color: var(--muted); }
.co-voice { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.co-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.co-hint { font-size: 12px; margin: 0; }
.co-msg { max-width: 88%; padding: 8px 11px; border-radius: 12px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.co-msg.me { align-self: flex-end; background: var(--surface-2); }
.co-msg.ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.co-msg.sys { align-self: center; max-width: 100%; font-size: 12px; color: var(--muted); padding: 2px 6px; }
.co-msg.sys.ok { color: var(--ok); }
.co-msg.sys.bad { color: var(--warn); }
.co-msg pre { white-space: pre-wrap; font-size: 11px; max-height: 220px; overflow: auto; background: var(--surface); padding: 8px; border-radius: 8px; color: var(--text); text-align: left; }
.co-compose { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.co-compose input { flex: 1; min-width: 0; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
.co-mic { touch-action: none; user-select: none; -webkit-user-select: none; }
.co-mic.live { background: var(--accent); border-color: var(--accent); }
.co-note { margin: 0; padding: 0 12px 8px; font-size: 11px; color: var(--muted); }
