/* PocketMix Studio (pro DAW shell). Design A "studio": warm tinted darks, 4/8 spacing, flat buttons with a lip.
   Orange (--accent) is used ONLY for the one lit / press-here state: the playing Play button and the first-run "add a track" button.
   Fonts C: A2Z display, Pretendard body, JetBrains Mono for numbers only (webfont URLs, no font files in the repo). Text is 12px or larger everywhere. */
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap");
@font-face { font-family: "AtoZ"; font-weight: 800; font-display: swap; src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2601-6@1.0/%EC%97%90%EC%9D%B4%ED%88%AC%EC%A7%80%EC%B2%B4-8ExtraBold.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 400; font-display: swap; src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Regular.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 700; font-display: swap; src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Bold.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #100d0a; --panel: #14110d; --card: #191511; --card-2: #211c16; --card-3: #2a241d;
  --line: #2e2820; --line-2: #453d32; --ctl: #7b7163;
  --text: #f3f0ea; --muted: #c2b9ab; --faint: #a1978a;
  --accent: #f2823d; --accent-lip: #a8531c; --on-accent: #17100a;
  --focus: #f3f0ea;
  --roll-white: #1b1713; --roll-black: #14110e;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --font: "Pretendard", ui-sans-serif, system-ui, "Apple SD Gothic Neo", "Hiragino Sans", "PingFang SC", "Noto Sans CJK KR", sans-serif;
  --mono: "JetBrains Mono", "Pretendard", ui-monospace, "SF Mono", monospace;
  --display: "AtoZ", "Pretendard", ui-sans-serif, system-ui, sans-serif;
  --radius: 6px; --lip: 0 2px 0 #0b0907;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body.pro { background: var(--bg); color: var(--text); font: 400 13px/1.45 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: var(--sp-2); top: -48px; z-index: 50; background: var(--card-3); color: var(--text); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); }
.skip:focus { top: var(--sp-2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono, .lcd, .bpm-in, .db, kbd, .tick, .knob-val, output { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- shell grid ---------- */
.studio { --browser-w: 220px; --inspector-w: 240px; --editor-h: 340px; --sl: 6px; --sr: 6px; --sh: 6px;
  height: 100vh; display: grid; grid-template-columns: var(--browser-w) var(--sl) minmax(0, 1fr) var(--sr) var(--inspector-w); grid-template-rows: 52px minmax(0, 1fr) var(--sh) var(--editor-h);
  grid-template-areas: "tp tp tp tp tp" "br sl ct sr in" "br sl sh sr in" "br sl ed sr in"; }
.studio[data-browser="false"] { --sl: 0px; } .studio[data-inspector="false"] { --sr: 0px; } .studio[data-editor="false"] { --sh: 0px; }
.transport { grid-area: tp; } .browser { grid-area: br; } #split-l { grid-area: sl; } .center { grid-area: ct; } #split-h { grid-area: sh; } .editor { grid-area: ed; } #split-r { grid-area: sr; } .inspector { grid-area: in; }
.studio[data-browser="false"] .browser, .studio[data-inspector="false"] .inspector, .studio[data-editor="false"] .editor, .studio[data-browser="false"] #split-l, .studio[data-inspector="false"] #split-r, .studio[data-editor="false"] #split-h { display: none; }
.splitter { position: relative; background: var(--line); touch-action: none; }
.splitter.v { width: 6px; height: 100%; cursor: col-resize; } .splitter.h { height: 6px; width: 100%; cursor: row-resize; }
.splitter:hover, .splitter.drag { background: var(--line-2); }
.splitter::after { content: ""; position: absolute; inset: 0; background: var(--ctl); opacity: 0; transition: opacity .12s; margin: auto; }
.splitter.v::after { width: 2px; height: 28px; } .splitter.h::after { height: 2px; width: 28px; }
.splitter:hover::after, .splitter:focus-visible::after { opacity: 1; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1); min-height: 32px; padding: 0 var(--sp-3); background: var(--card-3); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--lip); cursor: pointer; color: var(--text); white-space: nowrap; }
.btn:hover:not(:disabled) { background: #332c23; }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.tiny { min-height: 28px; padding: 0 var(--sp-2); font-size: 12px; }
.btn.icon { min-width: 28px; padding: 0; }
.btn[aria-pressed="true"], .mini-btn[aria-pressed="true"], .tbtn[aria-pressed="true"] { background: var(--card); box-shadow: inset 0 2px 0 var(--text); border-color: var(--ctl); }
.btn.danger { color: var(--muted); }
.btn.press-here { background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 0 3px 0 var(--accent-lip); font-weight: 700; min-height: 40px; padding: 0 var(--sp-4); }
.btn.press-here:hover { background: #f7924f; }
.mini-btn { width: 28px; height: 28px; min-height: 28px; padding: 0; background: var(--card-3); border: 1px solid var(--line-2); border-radius: 4px; cursor: pointer; font: 700 12px var(--mono); color: var(--muted); }
.mini-btn:hover { color: var(--text); }
.tbtn { width: 40px; height: 36px; display: inline-grid; place-items: center; background: var(--card-3); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--lip); cursor: pointer; color: var(--text); }
.tbtn:disabled { opacity: .45; cursor: default; }
.tbtn .ico { display: grid; width: 16px; height: 16px; } .tbtn svg { width: 16px; height: 16px; fill: currentColor; }
.tbtn.lit { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 2px 0 var(--accent-lip); }
.field { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--muted); font-size: 12px; }
.field.col { flex-direction: column; align-items: stretch; gap: var(--sp-1); }
select, input[type="text"], input[type="search"], input[type="number"] { background: var(--card); border: 1px solid var(--ctl); border-radius: var(--radius); min-height: 28px; padding: 0 var(--sp-2); color: var(--text); }
.spacer { flex: 1; }

/* ---------- transport ---------- */
.transport { display: flex; align-items: center; gap: var(--sp-4); padding: 0 var(--sp-4); background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: var(--sp-2); font: 800 15px var(--display); color: var(--text); text-decoration: none; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text); }
.tgroup { display: inline-flex; gap: var(--sp-1); align-items: center; }
.lcd { display: flex; flex-direction: column; justify-content: center; min-width: 108px; height: 38px; padding: 0 var(--sp-3); background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: inset 0 2px 6px #0008; }
.lcd-pos { font-size: 16px; font-weight: 500; line-height: 1.1; } .lcd-time { font-size: 12px; color: var(--faint); line-height: 1.1; }
.bpm { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--muted); font-size: 12px; }
.bpm-in { width: 64px; text-align: center; } .sig { font-family: var(--mono); color: var(--faint); }

/* ---------- side panels ---------- */
.panel { display: flex; flex-direction: column; min-width: 0; background: var(--panel); overflow: hidden; }
.browser { border-right: 1px solid var(--line); } .inspector { border-left: 1px solid var(--line); }
.panel-title { margin: 0; padding: var(--sp-3) var(--sp-3) var(--sp-2); font: 700 12px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.panel-body { flex: 1; overflow: auto; padding: 0 var(--sp-3) var(--sp-4); }
.tabs { display: flex; gap: var(--sp-1); margin-bottom: var(--sp-2); }
.tab { flex: 1; min-height: 28px; padding: 0 var(--sp-2); background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.search { width: 100%; margin-bottom: var(--sp-2); }
.blist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.bitem { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); min-height: 36px; padding: 0 var(--sp-3); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; text-align: left; }
.bitem:hover { background: var(--card-2); border-color: var(--line-2); }
.bhint { color: var(--faint); font-size: 12px; } .bnone { color: var(--faint); padding: var(--sp-3); }
.insp-sec { padding: var(--sp-3) 0; border-top: 1px solid var(--line); } .insp-sec:first-child { border-top: 0; }
.insp-sec h3 { margin: 0 0 var(--sp-2); font: 700 12px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.insp-sec > * + * { margin-top: var(--sp-2); }
.insp-empty { color: var(--faint); }
.insp-knobs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
.swatches { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.swatch { width: 24px; height: 24px; border-radius: 50%; background: var(--tc); border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { border-color: var(--text); outline: 2px solid var(--bg); outline-offset: -4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-1) var(--sp-3); margin: 0; } .kv dt { color: var(--faint); } .kv dd { margin: 0; font-family: var(--mono); }
.fx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); } .fx-none { color: var(--faint); }
.fx-slot { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.fx-head { display: flex; align-items: center; gap: var(--sp-1); padding: var(--sp-1); } .fx-head.off .fx-name { color: var(--faint); text-decoration: line-through; }
.fx-name { flex: 1; text-align: left; min-height: 28px; background: none; border: 0; cursor: pointer; padding: 0 var(--sp-2); }
.fx-params { display: grid; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3) var(--sp-3); }
.param { display: grid; grid-template-columns: 1fr; gap: 2px; color: var(--muted); font-size: 12px; } .param output { color: var(--text); justify-self: end; margin-top: -18px; }
input[type="range"] { width: 100%; accent-color: var(--text); height: 20px; background: transparent; }

/* ---------- arrangement ---------- */
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.arr-bar { position: relative; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row-h { display: inline-flex; gap: 2px; }
.menu { position: absolute; left: var(--sp-3); top: 100%; z-index: 20; min-width: 180px; padding: var(--sp-1); background: var(--card-3); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 12px 32px #000a; display: grid; }
.menu-item { min-height: 32px; padding: 0 var(--sp-3); background: none; border: 0; text-align: left; cursor: pointer; border-radius: 4px; } .menu-item:hover { background: var(--card); }
.arr-scroll { flex: 1; overflow: auto; position: relative; min-height: 0; }
.arr-grid { --head-w: 188px; display: grid; grid-template-columns: var(--head-w) auto; grid-template-rows: 38px auto; min-width: max-content; min-height: 100%; align-content: start; }
.arr-corner { position: sticky; left: 0; top: 0; z-index: 6; background: var(--panel); border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: flex; align-items: center; padding: 0 var(--sp-3); }
.arr-corner-t { font: 400 12px var(--mono); color: var(--faint); }
.arr-ruler { position: sticky; top: 0; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line-2); }
.ruler-nums { position: relative; height: 24px; cursor: pointer; touch-action: none; } .roll-ruler { position: sticky; top: 0; z-index: 4; height: 22px; background: var(--panel); border-bottom: 1px solid var(--line-2); cursor: pointer; touch-action: none; }
.tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line-2); padding-left: 4px; font-size: 12px; color: var(--muted); line-height: 24px; }
.tick.beat { border-left-color: var(--line); top: 14px; padding: 0; }
.roll-ruler .tick { line-height: 22px; }
.brace-strip { position: relative; height: 14px; cursor: ew-resize; touch-action: none; }
.brace { position: absolute; top: 3px; height: 8px; background: var(--card-3); border: 1px solid var(--ctl); border-radius: 3px; opacity: .8; }
.brace.on { background: var(--muted); border-color: var(--text); opacity: 1; }
.brace-h { position: absolute; top: -1px; bottom: -1px; width: 3px; background: var(--text); opacity: 0; } .brace.on .brace-h { opacity: .8; } .brace-l { left: -1px; } .brace-r { right: -1px; }
.playhead { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--text); pointer-events: none; z-index: 4; }
.playhead-flag { position: absolute; left: 0; top: 0; width: 12px; height: 24px; margin-left: -6px; pointer-events: none; z-index: 4; background: linear-gradient(var(--text), var(--text)) center / 2px 100% no-repeat; }
.playhead-flag::before { content: ""; position: absolute; top: 0; left: 0; border: 6px solid transparent; border-top: 8px solid var(--text); border-bottom: 0; }
.arr-heads { position: sticky; left: 0; z-index: 3; background: var(--panel); border-right: 1px solid var(--line-2); }
.head { display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-2) 0 0; border-bottom: 1px solid var(--line); cursor: default; background: var(--panel); }
.head.active { background: var(--card-2); }
.head-color { align-self: stretch; width: 6px; background: var(--tc); }
.head-main { flex: 1; min-width: 0; display: grid; } .head-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .head-inst { color: var(--faint); font-size: 12px; }
.head-btns { display: flex; gap: 2px; }
.arr-lanes { position: relative; outline: none; touch-action: none;
  background-image: linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px), linear-gradient(90deg, var(--line) calc(var(--grid-vis, 1) * 1px), transparent 1px);
  background-size: var(--bar-px) 100%, calc(var(--ppb) * 1px) 100%; }
.lane-row { position: absolute; left: 0; right: 0; border-bottom: 1px solid var(--line); pointer-events: none; }
.clip { position: absolute; border-radius: 4px; overflow: hidden; background: color-mix(in oklab, var(--tc) 38%, var(--card)); border: 1px solid color-mix(in oklab, var(--tc) 70%, var(--card)); cursor: grab; user-select: none; }
.clip.sel { border: 2px solid var(--text); background: color-mix(in oklab, var(--tc) 52%, var(--card)); }
.clip-title { position: relative; display: block; padding: 1px 6px; font-size: 12px; line-height: 16px; font-weight: 700; color: var(--text); background: color-mix(in oklab, var(--tc) 70%, var(--card)); color: #14110d; white-space: nowrap; overflow: hidden; }
.clip-loop { margin-right: 4px; }
.clip-art { display: block; margin: 0 2px; fill: var(--text); opacity: .9; pointer-events: none; }
.clip-grip { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: ew-resize; }
.cycle-shade { position: absolute; top: 0; bottom: 0; background: color-mix(in oklab, var(--text) 5%, transparent); border-left: 1px dashed var(--ctl); border-right: 1px dashed var(--ctl); pointer-events: none; } .cycle-shade.on { background: color-mix(in oklab, var(--text) 9%, transparent); }
.select-box { position: absolute; border: 1px solid var(--text); background: color-mix(in oklab, var(--text) 10%, transparent); pointer-events: none; z-index: 3; }
.arr-empty { position: sticky; left: 0; width: min(520px, 100%); padding: var(--sp-5) var(--sp-5); display: grid; gap: var(--sp-3); justify-items: start; color: var(--muted); }
.arr-empty p { margin: 0; font-size: 14px; }

/* ---------- editor (piano roll + mixer) ---------- */
.editor { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-top: 1px solid var(--line-2); }
.editor-tabs { display: flex; align-items: center; gap: var(--sp-1); padding: 0 var(--sp-2); border-bottom: 1px solid var(--line); } .editor-tabs .tab { flex: 0 0 auto; padding: 0 var(--sp-4); min-height: 32px; } .editor-tabs .btn { margin-left: auto; }
.editor-body { flex: 1; min-height: 0; position: relative; }
.roll, .mixer { position: absolute; inset: 0; display: none; flex-direction: column; min-height: 0; }
.studio[data-tab="roll"] .roll, .studio[data-tab="mixer"] .mixer { display: flex; }
.roll-tools { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); border-bottom: 1px solid var(--line); flex-wrap: wrap; } .roll-title { font-weight: 700; margin-right: var(--sp-2); }
.roll-scroll { flex: 1; overflow: auto; min-height: 0; position: relative; }
.roll-content { display: grid; grid-template-columns: var(--keys-w, 64px) var(--roll-w, 1000px); grid-template-rows: var(--ruler-h, 22px) var(--roll-h, 400px) var(--vel-h, 72px); min-width: max-content; }
.roll-corner { position: sticky; left: 0; top: 0; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
.roll-keys { position: sticky; left: 0; z-index: 3; background: var(--card); border-right: 1px solid var(--line-2); }
.rkey { box-sizing: border-box; border-bottom: 1px solid var(--line); font: 400 12px/15px var(--mono); color: var(--faint); padding-left: var(--sp-2); background: var(--card-2); } .rkey.black { background: var(--bg); } .rkey.c { color: var(--text); }
.roll-grid { position: relative; outline: none; touch-action: none; background-image: linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px), var(--stripes); background-size: var(--bar-px) 100%, calc(var(--ppb) * 1px) 100%, 100% calc(12 * var(--row-h)); }
.roll-empty { margin: var(--sp-5); color: var(--muted); font-size: 14px; }
.roll.no-clip .roll-scroll { display: none; }
.note { position: absolute; border-radius: 3px; background: color-mix(in oklab, var(--tc) calc(var(--v) * 100%), var(--card)); border: 1px solid color-mix(in oklab, var(--tc) 60%, #000); cursor: grab; }
.note.sel { border: 2px solid var(--text); } .note::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 5px; cursor: ew-resize; }
.shade { position: absolute; top: 0; bottom: 0; background: #0009; pointer-events: none; z-index: 1; }
.roll-vel-lab { position: sticky; left: 0; bottom: 0; z-index: 4; background: var(--panel); border-top: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: var(--sp-2); font-size: 12px; color: var(--faint); }
.roll-vel { position: sticky; bottom: 0; z-index: 3; background: var(--card); border-top: 1px solid var(--line-2); touch-action: none; }
.vbar { position: absolute; bottom: 0; width: 6px; margin-left: 0; background: color-mix(in oklab, var(--tc) 70%, var(--card)); cursor: ns-resize; border-radius: 2px 2px 0 0; } .vbar.sel { background: var(--text); }

/* ---------- mixer ---------- */
.mixer { overflow: auto; }
.mix-row { display: flex; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); min-height: 100%; align-items: stretch; }
.mix-gap { flex: 0 0 var(--sp-4); } .mix-empty { color: var(--faint); margin: var(--sp-3); }
.strip { flex: 0 0 136px; display: flex; flex-direction: column; gap: 6px; padding: var(--sp-2); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.strip.active { border-color: var(--ctl); background: var(--card-2); }
.strip-name { display: flex; align-items: center; gap: 6px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .strip-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--tc, var(--faint)); }
.strip-fx { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; min-height: 24px; font-size: 12px; align-content: start; } .strip-fx li { padding: 1px 6px; background: var(--card-3); border-radius: 3px; } .strip-fx li.off { color: var(--faint); text-decoration: line-through; } .strip-fx li.none { background: none; color: var(--faint); padding-left: 0; }
.strip > * { flex-shrink: 0; }
.strip-knobs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.strip-knobs .knob-val { font-size: 12px; }
.strip-fader { flex: 1 0 auto; min-height: 84px; display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); }
.strip-btns { display: flex; justify-content: center; gap: var(--sp-1); }
.db { font-size: 12px; color: var(--muted); }
.knob { display: grid; justify-items: center; gap: 2px; cursor: ns-resize; border-radius: var(--radius); padding: 2px; touch-action: none; user-select: none; }
.knob-dial { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--card-3); border: 1px solid var(--ctl); box-shadow: var(--lip); }
.knob-tick { position: absolute; left: 50%; top: 3px; width: 2px; height: 10px; margin-left: -1px; background: var(--text); border-radius: 1px; transform-origin: 1px 12px; transform: rotate(var(--turn, 0deg)); }
.knob-lab { font-size: 12px; color: var(--faint); } .knob-val { font-size: 12px; color: var(--muted); }
.fader { position: relative; flex: 1; width: 40px; min-height: 64px; cursor: ns-resize; touch-action: none; border-radius: var(--radius); }
.fader.ghost { cursor: default; }
.fader-rail { position: absolute; left: 50%; top: 4px; bottom: 4px; width: 4px; margin-left: -2px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 2px; }
.fader-cap { position: absolute; left: 4px; right: 4px; height: 14px; background: var(--card-3); border: 1px solid var(--ctl); border-radius: 3px; box-shadow: var(--lip); }
.fader-cap::after { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 2px; margin-top: -1px; background: var(--text); }

/* ---------- cheat sheet, toast ---------- */
.cheat-wrap { position: fixed; inset: 0; z-index: 40; background: #000a; display: grid; place-items: center; padding: var(--sp-4); }
.cheat { width: min(920px, 100%); max-height: 100%; overflow: auto; background: var(--card); border: 1px solid var(--line-2); border-radius: 10px; padding: var(--sp-4) var(--sp-5) var(--sp-5); box-shadow: 0 24px 64px #000c; }
.cheat-head { display: flex; justify-content: space-between; align-items: center; } .cheat h2 { margin: 0; font: 800 20px var(--display); }
.cheat-note { color: var(--muted); margin: var(--sp-2) 0 var(--sp-4); }
.cheat-cols { columns: 3 240px; column-gap: var(--sp-5); } .cheat section { break-inside: avoid; margin-bottom: var(--sp-4); }
.cheat h3 { margin: 0 0 var(--sp-2); font: 700 12px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.cheat dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: var(--sp-1) var(--sp-3); align-items: center; } .cheat dt { color: var(--text); } .cheat dd { margin: 0; display: flex; gap: var(--sp-1); justify-content: flex-end; }
kbd { background: var(--card-3); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 6px; font-size: 12px; line-height: 20px; }
.toast { position: fixed; left: 50%; bottom: var(--sp-5); transform: translateX(-50%); z-index: 60; background: var(--card-3); border: 1px solid var(--ctl); border-radius: var(--radius); padding: 0 var(--sp-4); line-height: 36px; pointer-events: none; }
.toast:empty { display: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
/* Phones and narrow windows (<1024px): no cramped desktop layout, a short friendly note and a way back instead */
.phone-note { display: none; }
@media (max-width: 1023px) {
  body.pro { overflow: auto; }
  .studio { display: none; }
  .phone-note { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: var(--sp-3); min-height: 100vh; padding: var(--sp-4) 16px; max-width: 480px; margin: 0 auto; }
  .phone-note[hidden] { display: none; }
  .phone-note h1 { margin: 0; font: 700 22px/1.3 var(--font); }
  .phone-note p { margin: 0; color: var(--muted, var(--text)); font-size: 16px; line-height: 1.6; }
  .phone-note a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; font-size: 16px; text-decoration: none; }
}

/* ---------- drum groups ---------- */
.head.indent { padding-left: var(--sp-3); } .head.indent .head-color { width: 4px; }
.head.folder { background: var(--card-2); } .head.folder.active { background: var(--card-3); }
.fold { width: 24px; height: 28px; background: none; border: 0; color: var(--text); cursor: pointer; font-size: 14px; padding: 0; }
.glane { position: absolute; left: 0; border-radius: 4px; background: color-mix(in oklab, var(--tc) 14%, var(--card)); border: 1px dashed color-mix(in oklab, var(--tc) 55%, var(--card)); pointer-events: none; overflow: hidden; }
.glane.sel { border: 2px solid var(--text); } .group-art { fill: var(--muted); opacity: .95; display: block; }
.strip.group { background: var(--card-2); border-color: var(--line-2); } .strip.member { margin-left: -2px; }
.drums { position: absolute; inset: 0; display: none; flex-direction: column; min-height: 0; }
.studio[data-tab="roll"][data-mode="drums"] .drums:not([hidden]) { display: flex; } .studio[data-tab="roll"][data-mode="drums"] .roll { display: none; }
.drum-hint { color: var(--faint); font-size: 12px; }
.drum-scroll { flex: 1; overflow: auto; min-height: 0; position: relative; }
.drum-grid { position: relative; display: grid; grid-template-columns: 112px calc(var(--steps) * var(--cell-w)); grid-auto-rows: 40px; grid-template-rows: 24px; min-width: max-content; }
.drum-corner { position: sticky; left: 0; top: 0; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); }
.drum-ruler { position: sticky; top: 0; z-index: 4; background: var(--panel); border-bottom: 1px solid var(--line-2); cursor: pointer; touch-action: none; }
.drum-bar { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line-2); padding-left: 4px; font: 400 12px/24px var(--mono); color: var(--muted); }
.drum-label { position: sticky; left: 0; z-index: 3; display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-3); background: var(--card); border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line); font-weight: 700; }
.drum-label em { color: var(--faint); font-style: normal; }
.drum-row { display: flex; border-bottom: 1px solid var(--line); }
.cell { flex: 0 0 var(--cell-w); height: 100%; padding: 0; background: var(--card); border: 0; border-left: 1px solid var(--line); cursor: pointer; position: relative; }
.cell.beat { border-left-color: var(--line-2); } .cell.bar { border-left: 2px solid var(--ctl); }
.cell:hover { background: var(--card-2); }
.cell.on { background: var(--text); box-shadow: inset 0 0 0 4px var(--card); } .cell.on.ghost { background: var(--muted); box-shadow: inset 0 0 0 8px var(--card); }
.drum-grid .playhead { top: 0; bottom: 0; left: 112px; }
