/* VJ control surface. Dark on purpose: it lives in a dark venue.
   Radius system: 6px controls, 10px panels/cards, full pill for chips.
   One accent (lime). Red is reserved for on-air / blackout state. */
@font-face { font-family: 'Geist'; src: url('/vendor/fonts/Geist-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/vendor/fonts/GeistMono-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0b0c0c;
  --panel: #121414;
  --panel-2: #161919;
  --raise: #1c2020;
  --raise-2: #232828;
  --line: #232727;
  --line-2: #2f3434;
  --text: #ebeee9;
  --dim: #a1a8a0;
  --faint: #7f877f;
  --accent: #d4f55a;
  --accent-ink: #12160a;
  --accent-soft: rgba(212, 245, 90, .13);
  --accent-line: rgba(212, 245, 90, .45);
  --live: #ff5a47;
  --live-soft: rgba(255, 90, 71, .16);
  --r: 6px;
  --r-lg: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 13px/1.35 var(--sans); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; overflow: hidden;
  user-select: none; -webkit-user-select: none;
}
input, select, button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ph, .ph-fill { font-size: 16px; line-height: 1; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum' 1; letter-spacing: 0; }
.dim { color: var(--dim); }
.grow { flex: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ───────── app grid ───────── */
.app {
  height: 100vh; display: grid;
  grid-template-rows: 56px minmax(0, 1fr) 228px;
  grid-template-columns: 352px minmax(0, 1fr) 300px;
  grid-template-areas: "top top top" "left rack right" "tl tl tl";
  min-width: 1180px;
}
.top { grid-area: top; }
.left { grid-area: left; }
.rack { grid-area: rack; }
.right { grid-area: right; }
.tl { grid-area: tl; }

/* ───────── buttons & primitives ───────── */
.btn {
  height: 30px; padding: 0 11px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--raise);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease), color .15s;
}
.btn:hover { background: var(--raise-2); border-color: #3b4141; }
a.btn { text-decoration: none; color: var(--text); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #def97a; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { background: var(--raise); color: var(--text); }
.btn.icon { width: 30px; padding: 0; justify-content: center; }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.icon.sm { width: 26px; padding: 0; }
.btn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.btn:disabled { opacity: .4; pointer-events: none; }

.seg { display: inline-flex; padding: 2px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line); gap: 2px; }
.seg button {
  height: 24px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--dim);
  display: inline-flex; align-items: center; gap: 6px; transition: background .15s var(--ease), color .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--raise-2); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.seg.accent button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2);
  background: transparent; color: var(--dim); font-size: 12px; white-space: nowrap;
  transition: background .15s var(--ease), color .15s, border-color .15s;
}
.chip:hover { color: var(--text); border-color: #444a4a; }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

.input {
  height: 30px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel-2);
  padding: 0 10px; outline: none; min-width: 0; transition: border-color .15s;
  user-select: text; -webkit-user-select: text;
}
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--accent-line); }
.num { width: 54px; text-align: right; font-family: var(--mono); }

.switch { position: relative; width: 30px; height: 18px; flex: none; border-radius: 999px; background: var(--line-2); border: 0; padding: 0; transition: background .18s var(--ease); }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #c9cec8; transition: transform .2s var(--ease), background .18s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(12px); background: var(--accent-ink); }

/* range */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(to right, var(--fill-c, #8a918a) 0 var(--fill, 0%), var(--line-2) var(--fill, 0%) 100%); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #f2f4ef; border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.5); transition: transform .12s var(--ease); }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 999px; background: var(--line-2); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--fill-c, #8a918a); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #f2f4ef; border: 0; }
input[type=range].hue::-webkit-slider-runnable-track { background: linear-gradient(to right, hsl(0 85% 60%), hsl(60 85% 60%), hsl(120 85% 55%), hsl(180 85% 55%), hsl(240 85% 65%), hsl(300 85% 62%), hsl(360 85% 60%)); }
input[type=range].hue::-moz-range-track { background: linear-gradient(to right, hsl(0 85% 60%), hsl(60 85% 60%), hsl(120 85% 55%), hsl(180 85% 55%), hsl(240 85% 65%), hsl(300 85% 62%), hsl(360 85% 60%)); }
input[type=range].hue::-moz-range-progress { background: transparent; }

.panel-h { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 44px; flex: none; }
.panel-h h2 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.panel-h .count { font: 11px var(--mono); color: var(--faint); }
.scroll { overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 2px solid var(--panel); }

.empty {
  border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--dim);
  padding: 18px; text-align: center; display: grid; gap: 6px; place-items: center;
}
.empty .ph { font-size: 22px; color: var(--faint); }

/* ───────── top bar ───────── */
.top {
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 14px; letter-spacing: -0.02em; white-space: nowrap; flex: none; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.brand-mark .ph-fill { font-size: 13px; }
.vsep { width: 1px; height: 24px; background: var(--line); }
.bpm { display: flex; align-items: center; gap: 6px; }
.bpm .num { width: 64px; }
.beats { display: flex; gap: 4px; margin-left: 2px; }
.beats i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); transition: background .06s; }
.beats i.on { background: var(--accent); }
.beats i.on.down { background: #fff; }
.tap.flash { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.mini-fader { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 12px; }
.mini-fader input { width: 70px; }
.mini-fader .mono { width: 34px; color: var(--text); font-size: 11px; }
.status { display: flex; align-items: center; gap: 7px; color: var(--dim); font-size: 12px; flex: none; }
.status .led { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status.ok .led { background: var(--accent); }
.status.bad { color: var(--live); }
.status.bad .led { background: var(--live); }
.blackout { font-weight: 650; letter-spacing: .02em; }
.blackout.on { background: var(--live); border-color: var(--live); color: #1a0705; }

/* ───────── left column ───────── */
.left { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.monitor-wrap { padding: 12px 12px 10px; flex: none; }
.monitor {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: #000;
  box-shadow: 0 0 0 1px var(--line-2);
}
.monitor canvas { width: 100%; height: 100%; display: block; }
.monitor.drag-logo { cursor: grab; }
.monitor.dragging { cursor: grabbing; }
.mon-tag {
  position: absolute; top: 8px; left: 8px; height: 20px; padding: 0 8px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px/1 var(--sans); letter-spacing: .04em;
  background: rgba(10,10,10,.6); backdrop-filter: blur(6px); color: #fff;
}
.mon-tag.live { background: var(--live); color: #1a0705; }
.mon-src { position: absolute; top: 6px; right: 6px; }
.mon-src .seg { background: rgba(10,10,10,.6); border-color: rgba(255,255,255,.08); backdrop-filter: blur(6px); }
.mon-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 9px 7px; display: flex; gap: 8px; align-items: flex-end;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); font-size: 11.5px; color: rgba(255,255,255,.88);
  pointer-events: none;
}
.mon-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-info .r { margin-left: auto; color: rgba(255,255,255,.62); }
.mon-hint { position: absolute; inset: auto 0 34px 0; text-align: center; font-size: 11px; color: rgba(255,255,255,.75); pointer-events: none; }

.pads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 12px 12px; flex: none; }
.pad {
  height: 46px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--raise);
  display: grid; place-content: center; gap: 3px; text-align: center; touch-action: none;
  transition: background .08s, border-color .08s, transform .06s;
}
.pad b { font-size: 11.5px; font-weight: 650; letter-spacing: .02em; }
.pad kbd { font: 10px var(--mono); color: var(--faint); }
.pad:hover { background: var(--raise-2); }
.pad.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: scale(.97); }
.pad.on kbd { color: var(--accent-ink); opacity: .7; }

.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; }
.tabs button {
  height: 36px; padding: 0 10px; border: 0; background: transparent; color: var(--dim); position: relative;
  display: inline-flex; align-items: center; gap: 7px; font-weight: 550;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tab-body { flex: 1; min-height: 0; padding: 12px; }
.tab-body > .stack { display: grid; gap: 14px; }

.field { display: grid; gap: 7px; }
.field > label, .lbl { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.field > label .v { margin-left: auto; font: 11px var(--mono); color: var(--text); }
.row { display: flex; align-items: center; gap: 8px; }

.drop {
  border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 14px; display: flex; align-items: center; gap: 12px;
  color: var(--dim); transition: border-color .15s, background .15s; cursor: pointer;
}
.drop .ph { font-size: 22px; color: var(--accent); }
.drop b { color: var(--text); font-weight: 600; display: block; margin-bottom: 2px; }
.drop:hover, .drop.over { border-color: var(--accent-line); background: var(--accent-soft); }
.upbar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.upbar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; background: var(--raise);
  box-shadow: 0 0 0 1px var(--line); cursor: pointer; transition: box-shadow .15s, opacity .2s, transform .15s var(--ease);
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
.tile:hover img { transform: scale(1.04); }
.tile.off { opacity: .38; }
.tile.now { box-shadow: 0 0 0 2px var(--live); }
.tile.pinned { box-shadow: 0 0 0 2px var(--accent); }
.tile.dragging { opacity: .3; }
.tile.drop-before::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); z-index: 2; }
.tile .badge {
  position: absolute; left: 5px; bottom: 5px; height: 18px; padding: 0 6px; border-radius: 999px;
  background: rgba(8,9,9,.72); backdrop-filter: blur(4px); font: 10.5px var(--mono); display: inline-flex; align-items: center; gap: 4px;
}
.tile .badge .ph { font-size: 11px; }
.tile .acts { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; opacity: 0; transition: opacity .15s; }
.tile:hover .acts, .tile:focus-within .acts { opacity: 1; }
.tile .acts button {
  width: 24px; height: 24px; border-radius: 5px; border: 0; background: rgba(8,9,9,.75); backdrop-filter: blur(4px);
  display: grid; place-items: center; color: #e8ece6;
}
.tile .acts button:hover { background: rgba(30,32,32,.95); }
.tile .acts button.on { color: var(--accent); }
.tile .acts .ph { font-size: 13px; }
.tile .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; }
.tile .prog i { display: block; height: 100%; background: var(--live); width: 0; }
.tile .proc {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; text-align: center; font-size: 11px;
  background: repeating-linear-gradient(110deg, var(--raise) 0 12px, var(--raise-2) 12px 24px); background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite; color: var(--dim); padding: 6px;
}
.tile .proc.err { animation: none; background: #2a1513; color: #ffb3a9; }
@keyframes shimmer { to { background-position: -48px 0; } }

.logo-list { display: flex; gap: 6px; flex-wrap: wrap; }
.logo-item {
  width: 64px; height: 44px; border-radius: var(--r); position: relative; cursor: pointer;
  background: repeating-conic-gradient(#202424 0 25%, #171a1a 0 50%) 0 0 / 12px 12px; box-shadow: 0 0 0 1px var(--line-2);
  display: grid; place-items: center; padding: 5px; transition: box-shadow .15s;
}
.logo-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-item.on { box-shadow: 0 0 0 2px var(--accent); }
.logo-item .x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--raise-2); display: none; place-items: center; padding: 0; }
.logo-item .x .ph { font-size: 10px; }
.logo-item:hover .x { display: grid; }
.subhead { font-size: 12px; font-weight: 600; color: var(--text); margin: 4px 0 -4px; }
.hint { font-size: 11.5px; color: var(--faint); line-height: 1.45; }

/* ───────── rack ───────── */
.rack { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, 1fr); min-height: 0; background: var(--bg); }
.chain { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.chain-list { flex: 1; padding: 0 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.lib { display: flex; flex-direction: column; min-height: 0; }
.lib .search { position: relative; flex: 1; max-width: 170px; }
.lib .search .ph { position: absolute; left: 9px; top: 7px; color: var(--faint); font-size: 14px; }
.lib .search input { width: 100%; padding-left: 28px; height: 28px; }
.lib-body { flex: 1; padding: 0 12px 14px; }
.lib-group + .lib-group { margin-top: 14px; }
.lib-group h3 { margin: 0 0 7px; font-size: 11.5px; font-weight: 550; color: var(--dim); }
.lib-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 5px; }
.fx-tile {
  height: 34px; padding: 0 9px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel);
  display: flex; align-items: center; gap: 7px; text-align: left; font-size: 12px; color: var(--text);
  transition: background .12s, border-color .12s, transform .08s;
}
.fx-tile:hover { background: var(--raise); border-color: var(--line-2); }
.fx-tile:active { transform: scale(.97); }
.fx-tile .ph { font-size: 13px; color: var(--faint); margin-left: auto; transition: color .12s; }
.fx-tile.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.fx-tile.on .ph { color: var(--accent); }
.fx-tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  animation: cardIn .22s var(--ease);
}
.card.off { opacity: .55; }
.card.flash { animation: cardFlash .7s var(--ease); }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } }
@keyframes cardFlash { 0% { box-shadow: 0 0 0 2px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.card-h { display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 8px 0 12px; }
.card-h .name { font-weight: 600; font-size: 13px; }
.card-h .grp { font-size: 11px; color: var(--faint); }
.card-b { padding: 0 12px 10px; display: grid; gap: 4px; }
.prm { display: grid; grid-template-columns: 92px minmax(0, 1fr) 40px 24px; align-items: center; gap: 8px; min-height: 26px; }
.prm .pl { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prm .pv { font: 11px var(--mono); text-align: right; color: var(--text); }
.prm .track { position: relative; }
.prm .mark {
  position: absolute; top: 3px; width: 2px; height: 12px; margin-left: -1px; border-radius: 2px; background: var(--accent);
  pointer-events: none; box-shadow: 0 0 6px var(--accent); left: 0;
}
.prm.sel-row { grid-template-columns: 92px minmax(0, 1fr); }
.lfo-btn {
  width: 24px; height: 22px; border-radius: 5px; border: 1px solid transparent; background: transparent; color: var(--faint);
  display: grid; place-items: center; padding: 0; transition: color .12s, background .12s, border-color .12s;
}
.lfo-btn .ph { font-size: 14px; }
.lfo-btn:hover { color: var(--text); background: var(--raise); }
.lfo-btn.on { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.lfo {
  margin: 2px 0 6px 100px; padding: 9px 10px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--line);
  display: grid; gap: 8px; animation: cardIn .18s var(--ease);
}
.lfo .lbl { font-size: 11px; }
.lfo .row .grow { min-width: 0; }

/* ───────── scenes ───────── */
.right { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.save-row { display: flex; gap: 6px; padding: 0 12px 10px; }
.save-row .input { flex: 1; }
.scene-fade { padding: 0 12px 10px; }
.scene-list { flex: 1; padding: 2px 8px 12px; display: flex; flex-direction: column; gap: 3px; }
.scene {
  position: relative; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 6px 0 10px;
  border-radius: var(--r); cursor: pointer; transition: background .12s;
}
.scene:hover { background: var(--raise); }
.scene .sw { width: 4px; height: 24px; border-radius: 4px; flex: none; }
.scene .nm { flex: 1; min-width: 0; }
.scene .nm b { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene .nm small { display: block; color: var(--faint); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene kbd { font: 10.5px var(--mono); color: var(--faint); width: 14px; text-align: center; }
.scene .sacts { display: none; gap: 2px; }
.scene:hover .sacts { display: flex; }
.scene:hover kbd { display: none; }
.scene.air { background: var(--live-soft); }
.scene.air::before { content: ''; position: absolute; left: -4px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--live); }
.scene.edit .nm b { color: var(--accent); }
.scene.dragging { opacity: .35; }
.scene input.input { height: 26px; width: 100%; }

/* ───────── timeline ───────── */
.tl { background: var(--panel); border-top: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.tl-bar { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px; flex: none; }
.tl-time { font: 12px var(--mono); color: var(--dim); white-space: nowrap; }
.tl-time b { color: var(--text); font-weight: 500; }
.play.on { background: var(--live); border-color: var(--live); color: #1a0705; font-weight: 600; }
.inspector { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid var(--line); }
.tl-bar .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.inspector .lbl { font-size: 12px; }
.inspector select.input { height: 28px; padding: 0 6px; max-width: 160px; }
.tl-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; padding: 0 14px 12px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.tl-scroll::-webkit-scrollbar { height: 8px; }
.tl-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }
.ruler { position: relative; height: 20px; }
.ruler span { position: absolute; top: 3px; font: 10px var(--mono); color: var(--faint); transform: translateX(-50%); }
.ruler span::after { content: ''; position: absolute; left: 50%; top: 14px; width: 1px; height: 4px; background: var(--line-2); }
.lane {
  position: relative; height: 112px; border-radius: var(--r-lg); background: var(--bg); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .15s;
}
.lane.over { box-shadow: inset 0 0 0 1px var(--accent-line); background: #10120c; }
.lane .empty { position: absolute; inset: 10px; border-radius: var(--r); }
.clip {
  position: absolute; top: 8px; bottom: 8px; border-radius: var(--r); overflow: hidden; cursor: grab;
  background: var(--raise); box-shadow: inset 0 0 0 1px var(--line-2);
  display: flex; flex-direction: column; justify-content: space-between; padding: 8px 10px 7px 13px;
  transition: box-shadow .15s, opacity .15s;
}
.clip::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.clip .fade-in { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(to right, color-mix(in srgb, var(--c) 30%, transparent), transparent); pointer-events: none; }
.clip b { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
.clip small { font: 11px var(--mono); color: var(--dim); position: relative; white-space: nowrap; }
.clip.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.clip.cur { background: #262a24; }
.clip.dragging { opacity: .3; }
.clip .rs { position: absolute; right: 0; top: 0; bottom: 0; width: 9px; cursor: ew-resize; }
.clip .rs::after { content: ''; position: absolute; right: 3px; top: 50%; width: 3px; height: 22px; margin-top: -11px; border-radius: 3px; background: rgba(255,255,255,.22); transition: background .12s; }
.clip .rs:hover::after { background: var(--accent); }
.ins-mark { position: absolute; top: 4px; bottom: 4px; width: 3px; margin-left: -2px; border-radius: 3px; background: var(--accent); pointer-events: none; }
.playhead { position: absolute; top: -20px; bottom: 0; width: 2px; margin-left: -1px; background: var(--live); pointer-events: none; z-index: 3; }
.playhead::before { content: ''; position: absolute; top: 0; left: -4px; width: 10px; height: 10px; border-radius: 2px; background: var(--live); }

/* ───────── overlays ───────── */
.toasts { position: fixed; left: 50%; bottom: 244px; transform: translateX(-50%); display: grid; gap: 6px; z-index: 20; pointer-events: none; }
.toast {
  padding: 9px 14px; border-radius: var(--r-lg); background: #262b2b; border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0,0,0,.45);
  font-size: 12.5px; animation: toastIn .25s var(--ease); display: flex; gap: 8px; align-items: center;
}
.toast.err { border-color: rgba(255,90,71,.5); }
.toast.err .ph { color: var(--live); }
.toast .ph { color: var(--accent); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .25s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 30; }
.modal { width: 320px; padding: 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); display: grid; gap: 12px; }
.modal h3 { margin: 0; font-size: 15px; }

.drag-ghost { position: fixed; pointer-events: none; z-index: 40; padding: 6px 10px; border-radius: var(--r); background: var(--raise-2); border: 1px solid var(--accent-line); font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
