:root {
  --bg: #14161a; --panel: #1d2026; --panel2: #262a32; --line: #343944; --text: #e8eaee; --muted: #8b93a1;
  --accent: #4dabf7; --ok: #51cf66; --err: #ff6b6b; --warn: #fcc419;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, sans-serif; }
h1, h2, h3 { margin: 0 0 .5rem; font-weight: 600; }
button, input, select { font: inherit; color: inherit; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: .4rem .7rem; }
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: #0b1220; border-color: var(--accent); font-weight: 600; }
button.danger { color: var(--err); }
button.link { background: none; border: none; color: var(--accent); padding: 0; text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }
.card { max-width: 380px; margin: 12vh auto; padding: 1.5rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.card form { display: grid; gap: .8rem; }
.card label { display: grid; gap: .25rem; color: var(--muted); }
.sub, .muted { color: var(--muted); }
.msg { min-height: 1.2em; margin: 0; }
.msg.error { color: var(--err); } .msg.ok { color: var(--ok); }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .spacer { flex: 1; }
.page { max-width: 900px; margin: 1.5rem auto; padding: 0 1rem; display: grid; gap: 1.5rem; }
.rooms { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.row { display: flex; gap: .5rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); }
td.actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.notice { padding: .7rem 1rem; background: var(--panel2); border: 1px solid var(--warn); border-radius: 8px; }
.notice code { font-size: 1.1em; user-select: all; }
.status-pending { color: var(--warn); } .status-approved { color: var(--ok); } .status-disabled { color: var(--err); }

/* room */
.room { display: grid; grid-template-rows: auto 1fr auto; height: 100vh; }
.room-main { display: grid; grid-template-columns: 260px 1fr; min-height: 0; }
.tracks { background: var(--panel); border-right: 1px solid var(--line); overflow: auto; padding: .6rem; display: grid; gap: .5rem; align-content: start; }
.track { padding: .5rem; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; display: grid; gap: .35rem; cursor: pointer; }
.track.selected { border-color: var(--accent); }
.track .line { display: flex; gap: .35rem; align-items: center; }
.track .line > input[type=text] { flex: 1; min-width: 0; }
.track input[type=range] { width: 100%; padding: 0; }
.track .tag { font-size: 11px; padding: 0 .35rem; border-radius: 4px; color: #0b1220; }
.roll-wrap { display: grid; grid-template-rows: 1fr; min-width: 0; min-height: 0; }
.roll { position: relative; overflow: auto; min-height: 0; background: #101216; }
.roll canvas { display: block; }
.synth-panel { display: flex; flex-wrap: wrap; gap: .8rem; padding: .6rem 1rem; background: var(--panel); border-top: 1px solid var(--line); }
.knob { display: grid; gap: .15rem; min-width: 90px; font-size: 12px; color: var(--muted); }
.keyboard { display: flex; height: 70px; background: var(--panel); border-top: 1px solid var(--line); user-select: none; touch-action: none; }
.keyboard .key { flex: 1; border: 1px solid #000; background: #f1f3f5; border-radius: 0 0 4px 4px; position: relative; }
.keyboard .key.black { background: #222; flex: 0 0 0; width: 0; z-index: 1; }
.keyboard .key.black::after { content: ""; position: absolute; left: -9px; width: 18px; top: 0; height: 42px; background: #222; border-radius: 0 0 3px 3px; }
.keyboard .key.down { background: var(--accent); }
.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: #000b; z-index: 10; }
.overlay .card { margin: 0; text-align: center; }
.status { font-size: 12px; color: var(--muted); }
.status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--err); margin-right: .3rem; }
.status.open .dot { background: var(--ok); }

.kb-wrap { display: flex; background: var(--panel); border-top: 1px solid var(--line); }
.kb-wrap .keyboard { flex: 1; border-top: none; }
.kb-controls { display: grid; place-items: center; gap: .2rem; padding: .3rem .6rem; color: var(--muted); }
.transport { display: flex; align-items: center; gap: .8rem; padding: .5rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.transport input[type=number] { width: 5rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: 0 .5rem; border-radius: 999px; background: var(--panel2); font-size: 12px; }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--warn); padding: .5rem 1rem; border-radius: 8px; z-index: 5; }

/* keep the track panel inside its column: long synth names must not widen it */
.tracks { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
.tracks .row { min-width: 0; }
.tracks select, .tracks input[type=text] { min-width: 0; width: 100%; text-overflow: ellipsis; }
.tracks .row select { flex: 1; }
.track { min-width: 0; }
.track .line { min-width: 0; }
.track .line > select { flex: 1; }
.transport .spacer { flex: 1; }
.transport .status { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* grouped synth panel (the wave synth has ~38 controls) */
.synth-panel { overflow: auto; align-items: flex-start; align-content: flex-start; min-height: 0; border-top: none; }
.synth-panel[hidden], .roll[hidden] { display: none; }
.tabs { display: flex; align-items: center; gap: .3rem; padding: .35rem .6rem 0; background: var(--panel); border-bottom: 1px solid var(--line); }
.tab { border-radius: 6px 6px 0 0; border-bottom: none; padding: .35rem 1rem; }
.tab.active { background: var(--accent); color: #0b1220; border-color: var(--accent); font-weight: 600; }
.tab-hint { margin-left: .8rem; font-size: 12px; }
.synth-group { display: flex; flex-wrap: wrap; gap: .5rem .8rem; padding: .4rem .6rem; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; max-width: 100%; }
.synth-group h4 { width: 100%; margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.synth-group .knob { min-width: 84px; }
.synth-group .knob input[type=range] { width: 90px; padding: 0; }

/* floating sound window */
.window { position: fixed; z-index: 8; width: min(1020px, 94vw); height: min(700px, 84vh); min-width: 320px; min-height: 160px; display: flex; flex-direction: column; resize: both; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 40px #000a; }
.window[hidden] { display: none; }
.window-bar { display: flex; align-items: center; justify-content: space-between; padding: .4rem .6rem; background: var(--panel2); border-bottom: 1px solid var(--line); cursor: move; user-select: none; touch-action: none; font-weight: 600; }
.window-close { padding: 0 .5rem; line-height: 1.4; }
.window .synth-panel { flex: 1; min-height: 0; border-top: none; background: transparent; }

/* window tabs, effects panel */
.window-tabs { padding-top: .3rem; }
.fx-panel { flex: 1; min-height: 0; overflow: auto; padding: .6rem 1rem; display: grid; gap: .6rem; align-content: start; }
.fx-panel[hidden], .synth-panel[hidden] { display: none; }
.fx-add { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.fx-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; }
.fx-card.bypassed { opacity: .6; }
.fx-head { display: flex; align-items: center; gap: .3rem; padding: .4rem .6rem; border-bottom: 1px solid var(--line); }
.fx-head .spacer { flex: 1; }
.fx-body { display: flex; flex-wrap: wrap; gap: .5rem; padding: .5rem .6rem; }
.fx-body .synth-group { background: transparent; border: none; padding: 0; }

/* room body hosts either the editor or the mixer */
.room-body { min-height: 0; display: grid; }
.room-body > * { min-height: 0; min-width: 0; }
.room-main[hidden], .mixer[hidden] { display: none; }

/* mixer */
.mixer { display: flex; gap: .6rem; padding: .8rem; overflow: auto; background: #101216; align-items: stretch; }
.strip { flex: 0 0 148px; display: flex; flex-direction: column; gap: .5rem; padding: .5rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-height: 0; }
.strip.selected { border-color: var(--accent); }
.strip.master { flex-basis: 120px; margin-left: auto; background: var(--panel2); }
.strip-head { display: grid; gap: .1rem; text-align: left; border-top: 4px solid var(--accent); padding: .4rem .5rem; }
.strip-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.master-head { border-top-color: var(--warn); }
.strip-spacer { flex: 1; }
.inserts { display: grid; gap: .25rem; align-content: start; min-height: 3.2rem; max-height: 11rem; overflow: auto; }
.insert { display: flex; gap: .2rem; }
.insert.bypassed .insert-name { opacity: .5; text-decoration: line-through; }
.insert-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; padding: .2rem .4rem; font-size: 12px; }
.insert-power { padding: .2rem .45rem; font-size: 10px; color: var(--ok); }
.insert-power[aria-pressed=false] { color: var(--muted); }
.insert-add { font-size: 12px; padding: .2rem .3rem; width: 100%; }
.pan-row { display: grid; grid-template-columns: auto 1fr auto; gap: .3rem; align-items: center; font-size: 12px; }
.pan-row input { width: 100%; padding: 0; min-width: 0; }
.pan-text { min-width: 2.2rem; text-align: right; }
.strip-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: .25rem; }
.strip-buttons button { padding: .3rem 0; }
.fader-block { display: grid; justify-items: center; gap: .3rem; flex: 1; min-height: 0; }
.fader-row { display: flex; gap: .6rem; align-items: stretch; height: 100%; min-height: 160px; }
.fader { writing-mode: vertical-lr; direction: rtl; width: 32px; padding: 0; height: 100%; }
.meter { position: relative; width: 12px; background: #0b0d10; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.meter-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(to top, #2f9e44 0%, #51cf66 60%, #fcc419 80%, #ff6b6b 100%); background-size: 100% 100%; }
.meter.clip { border-color: var(--err); }
.db { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.strip-foot { display: grid; gap: .3rem; }
.strip-foot select { font-size: 12px; padding: .2rem; }
.mixer-empty { margin: auto; }
.view-toggle[aria-pressed=true] { font-weight: 600; }
.kb-wrap[hidden] { display: none; }

/* drum machine pads */
.synth-top { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; width: 100%; }
.pad-grid { display: grid; grid-template-columns: repeat(4, 84px); gap: .4rem; }
.pad { display: grid; gap: .1rem; height: 58px; padding: .3rem; text-align: center; align-content: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; }
.pad .pad-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pad .pad-note { font-size: 10px; }
.pad.active { background: var(--accent); border-color: var(--accent); color: #0b1220; }
.pad.active .pad-note { color: #0b1220; }
.kit-pad { height: auto; padding: .5rem .8rem; align-self: flex-end; }
.synth-group[hidden] { display: none; }

/* pad strips (drum machine) */
.strip-group { display: flex; gap: .4rem; padding: .4rem; background: #161a20; border: 1px solid var(--line); border-radius: 12px; flex: none; }
.strip.pad-strip { flex: 0 0 116px; padding: .4rem; background: var(--panel2); border-style: dashed; }
.strip.pad-strip.split { border-style: solid; border-color: #4b5565; }
.pad-strip .strip-head { padding: .3rem .4rem; border-top-width: 3px; }
.pad-strip .strip-buttons button { font-size: 12px; }
.pad-strip .fader { width: 26px; }

/* wavetable synth editor */
.sx-top { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; width: 100%; margin-bottom: .5rem; }
.sx-top h4, .sx-card h3 { margin: 0 0 .3rem; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sx-preset { display: grid; gap: .2rem; }
.sx-macros { display: flex; gap: .6rem; }
.sx-tabs { display: flex; gap: .3rem; align-items: center; width: 100%; padding-top: .2rem; border-bottom: 1px solid var(--line); margin-bottom: .6rem; }
.sx-audition { margin-left: auto; margin-bottom: .2rem; }
.sx-page { display: flex; flex-wrap: wrap; gap: .7rem; width: 100%; align-items: flex-start; }
.sx-page[hidden] { display: none; }
.sx-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; max-width: 100%; }
.sx-osc { width: 100%; max-width: 520px; }
.sx-wide { max-width: 100%; }
.sx-card .synth-group { background: transparent; border: none; padding: 0; }
.sx-card .sx-body { display: block; }
.sx-display { display: block; background: #0f1115; border: 1px solid var(--line); border-radius: 6px; margin-bottom: .5rem; max-width: 100%; }
.sx-matrix-page { display: block; }
.sx-hint { margin: 0 0 .5rem; font-size: 12px; }
.sx-matrix { width: 100%; border-collapse: collapse; }
.sx-matrix th, .sx-matrix td { padding: .2rem .4rem; border-bottom: 1px solid var(--line); text-align: left; }
.sx-matrix tr.active td { background: #1c2a3a; }
.sx-matrix select { width: 100%; font-size: 12px; padding: .15rem .3rem; }
.sx-amount { display: flex; gap: .5rem; align-items: center; min-width: 190px; }
.sx-amount input { flex: 1; padding: 0; }
.sx-amt { min-width: 2.8rem; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }

/* compact grids inside the wavetable synth cards */
.sx-card { flex: 0 0 auto; }
.sx-card .sx-body .synth-group { display: grid; grid-template-columns: repeat(3, 96px); gap: .45rem .8rem; }
.sx-card .knob { min-width: 0; }
.sx-card .knob input[type=range], .sx-card .knob select { width: 100%; min-width: 0; }
.sx-card .knob > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-osc { width: 456px; max-width: 100%; }
.sx-osc .sx-body .synth-group { grid-template-columns: repeat(4, 96px); }
.sx-wide { width: 340px; }

/* live modulation */
.mod-wrap { position: relative; }
.mod-bar { position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; pointer-events: none; }
.mod-bar[hidden] { display: none; }
.mod-bar i { position: absolute; top: 0; height: 4px; background: #ffa94d; border-radius: 2px; box-shadow: 0 0 4px #ffa94d88; }
.sx-live { display: inline-block; position: relative; width: 54px; height: 6px; margin-left: .6rem; vertical-align: middle; background: #0f1115; border: 1px solid var(--line); border-radius: 3px; }
.sx-live i { position: absolute; top: 0; bottom: 0; background: #ffa94d; }
.sx-lfo-edit { display: grid; gap: .3rem; margin-bottom: .5rem; }
.sx-lfo-edit .sx-display { margin-bottom: 0; cursor: crosshair; touch-action: none; }
.sx-shape-load { font-size: 12px; padding: .15rem .3rem; justify-self: start; }

/* wavetable editor */
.wt { display: grid; grid-template-columns: 270px 1fr; gap: 1rem; width: 100%; align-items: start; }
.wt-list { display: grid; gap: .4rem; }
.wt-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.wt-item { display: flex; align-items: center; gap: .35rem; padding: .35rem .5rem; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; }
.wt-item.active { border-color: var(--accent); }
.wt-item .spacer { flex: 1; }
.wt-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 90px; }
.wt-editor { display: grid; gap: .5rem; min-width: 0; }
.wt-editor[hidden] { display: none; }
.wt-head { display: flex; gap: .5rem; }
.wt-head input { flex: 1; min-width: 0; }
.wt-main { width: 100%; max-width: 560px; height: auto; aspect-ratio: 560 / 200; background: #0f1115; border: 1px solid var(--line); border-radius: 6px; cursor: crosshair; touch-action: none; }
.wt-spec { background: #0f1115; border: 1px solid var(--line); border-radius: 6px; }
.wt-specwrap { display: grid; gap: .2rem; }
.wt-strip { display: flex; gap: .3rem; flex-wrap: wrap; }
.wt-thumb { background: #0f1115; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.wt-thumb.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wt-tools { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.wt-tools button { padding: .2rem .5rem; font-size: 12px; }
.sx-table-pick { display: flex; gap: .4rem; align-items: center; margin-bottom: .5rem; }
.sx-table-pick select { flex: 1; min-width: 0; }
.sx-wt-page { display: block; }
.wt { grid-template-columns: 340px minmax(0, 1fr); }
.wt-list { min-width: 0; }
.wt-item { flex-wrap: wrap; }
.wt-item strong { max-width: 130px; }

/* ===== MPC-style room layout: toolbar, view tabs, shortcuts, views, function bar ===== */
.room { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; height: 100vh; }
.toolbar { display: flex; align-items: center; gap: .9rem; padding: .4rem .8rem; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tb-group { display: flex; align-items: center; gap: .4rem; }
.tb-room strong { font-size: 15px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-bpm { display: flex; align-items: center; gap: .3rem; }
.tb-bpm input { width: 4.2rem; }
.tb-position { font: 600 20px ui-monospace, SFMono-Regular, Menlo, monospace; padding: .1rem .6rem; background: #0b0d10; border: 1px solid var(--line); border-radius: 6px; color: #a5d8ff; letter-spacing: .04em; }
.tb-rec.on { background: var(--err); border-color: var(--err); color: #1a0b0b; font-weight: 700; animation: recpulse 1.2s ease-in-out infinite; }
@keyframes recpulse { 50% { opacity: .65; } }
.tb-spacer { flex: 1; }
.tb-midi select { max-width: 140px; }
.tb-midi-text { min-width: 4.5rem; font-variant-numeric: tabular-nums; }
.led { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #3a4150; }
.led.lit { background: #ffa94d; box-shadow: 0 0 8px #ffa94d; }
.tb-net .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--err); }
.tb-net .dot.ok { background: var(--ok); }
.tb-net-text { font-size: 12px; min-width: 3.5rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tb-users { display: flex; gap: .3rem; }

.view-tabs { display: flex; gap: .3rem; padding: .35rem .8rem 0; background: var(--panel); border-bottom: 1px solid var(--line); }
.view-tabs .tab { padding: .4rem 1.4rem; font-weight: 600; }

.room-body2 { display: grid; grid-template-columns: 112px minmax(0, 1fr); min-height: 0; }
.views { min-width: 0; min-height: 0; display: grid; }
.views > * { min-height: 0; min-width: 0; }
.views > [hidden] { display: none; }

.shortcuts { background: var(--panel); border-right: 1px solid var(--line); padding: .5rem; display: flex; flex-direction: column; gap: .4rem; position: relative; overflow: auto; }
.shortcuts h4 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sc-slots { display: grid; gap: .35rem; }
.sc-slot { position: relative; min-height: 46px; border: 1px dashed var(--line); border-radius: 8px; display: grid; }
.sc-slot:not(.empty) { border-style: solid; background: var(--panel2); cursor: grab; }
.sc-slot.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sc-slot.over { background: #4dabf722; border-color: var(--accent); }
.sc-run { display: grid; justify-items: center; align-content: center; gap: 0; padding: .3rem .2rem; background: none; border: none; }
.sc-icon { font-size: 16px; line-height: 1; }
.sc-label { font-size: 11px; }
.sc-clear { position: absolute; top: 1px; right: 1px; padding: 0 .3rem; font-size: 11px; line-height: 1.2; background: none; border: none; color: var(--muted); opacity: 0; }
.sc-slot:hover .sc-clear { opacity: 1; }
.sc-empty { align-self: center; justify-self: center; font-size: 10px; color: var(--muted); }
.sc-menu-btn { font-size: 12px; padding: .3rem .4rem; }
.sc-palette { position: absolute; left: .5rem; right: .5rem; top: 100%; z-index: 20; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: .3rem; box-shadow: 0 8px 24px #000a; }
.sc-palette[hidden] { display: none; }
.sc-item { display: flex; gap: .4rem; align-items: center; padding: .3rem .4rem; border-radius: 6px; cursor: grab; font-size: 12px; }
.sc-item:hover { background: var(--panel); }

.fn-bar { display: flex; align-items: center; gap: .9rem; padding: .4rem .8rem; background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap; }
.fn-group { display: flex; align-items: center; gap: .3rem; }
.fn-spacer { flex: 1; }
.fn-track { min-width: 90px; max-width: 160px; text-align: center; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-rec.on { background: var(--err); border-color: var(--err); color: #1a0b0b; font-weight: 700; }
.fn-bar select { max-width: 150px; }

/* track / arrangement view */
.tv { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.tv-add { display: flex; gap: .6rem; align-items: center; padding: .5rem .8rem; border-bottom: 1px solid var(--line); }
.tv-scroll { overflow: auto; min-height: 0; background: #101216; }
.tv-grid { display: grid; grid-template-columns: 380px minmax(300px, 1fr); min-width: 700px; }
.tv-controls { border-right: 1px solid var(--line); background: var(--panel); }
.tv-canvas-wrap { min-width: 0; }
.tv-timeline { display: block; cursor: pointer; }
.tv-empty { padding: 1rem; }
.tv-row { display: grid; gap: .25rem; align-content: center; padding: .25rem .5rem; border-left: 4px solid var(--accent); border-bottom: 1px solid #262a32; cursor: pointer; }
.tv-row.selected { background: #4dabf714; }
.tv-line { display: flex; gap: .25rem; align-items: center; }
.tv-line input[type=text] { flex: 1; min-width: 0; padding: .15rem .4rem; }
.tv-line select { padding: .15rem .3rem; font-size: 12px; max-width: 150px; }
.tv-line button { padding: .15rem .45rem; font-size: 12px; }
.tv-line input[type=range] { flex: 1; min-width: 50px; padding: 0; }

/* sequence view */
.seq { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.seq-bar { display: flex; align-items: center; gap: 1rem; padding: .4rem .8rem; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seq-field { display: flex; align-items: center; gap: .35rem; }
.seq-field input[type=number] { width: 4.5rem; }
.seq-swing { display: flex; align-items: center; gap: .4rem; }
.seq-swing input { width: 110px; padding: 0; }
.seq-val { min-width: 2.4rem; font-variant-numeric: tabular-nums; }
.seq-info { margin-left: auto; font-size: 12px; }
.seq .roll-wrap { display: grid; grid-template-rows: 1fr; min-height: 0; min-width: 0; }

/* sound view */
.sound-view { display: flex; flex-direction: column; min-height: 0; padding: .6rem .8rem; gap: .4rem; overflow: hidden; }
.sound-title { margin: 0; }
.sound-note { display: grid; gap: .5rem; justify-items: start; }
.sound-note[hidden] { display: none; }
.sound-host { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sound-host .synth-panel, .sound-host .fx-panel { flex: 1; min-height: 0; overflow: auto; }
.window-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.window-buttons { display: flex; gap: .3rem; }
.toast { top: 118px; bottom: auto; }
.tv-grid { grid-template-columns: 430px minmax(300px, 1fr); }
.toast { top: auto; bottom: 150px; left: auto; right: 14px; transform: none; max-width: 420px; }
.toolbar { gap: .55rem; }
.tb-room strong { max-width: 110px; }
.tb-midi select { max-width: 110px; }
.tb-net-text { min-width: 2.8rem; }

/* send buses */
.send-rows { display: grid; gap: .2rem; }
.send-row { display: grid; grid-template-columns: 3.2rem 1fr; gap: .3rem; align-items: center; font-size: 11px; }
.send-row input { width: 100%; padding: 0; min-width: 0; }
.bus-strip { background: #1f1b14; border-color: #5a4a2a; }
.add-strip { flex: 0 0 150px; justify-content: center; align-items: stretch; background: transparent; border-style: dashed; }
.add-strip p { font-size: 12px; margin: 0; }
.fn-send { display: flex; align-items: center; gap: .3rem; }
.fn-send input { width: 80px; padding: 0; }

/* arrangement */
.tv-sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 .3rem; }
.tv-mode { display: flex; }
.tv-mode button:first-child { border-radius: 6px 0 0 6px; }
.tv-mode button:last-child { border-radius: 0 6px 6px 0; margin-left: -1px; }
.tv-songlen { display: flex; align-items: center; gap: .3rem; }
.tv-songlen input { width: 4rem; }
.tv-hint { font-size: 12px; flex: 1 1 260px; }
.tv-add { flex-wrap: wrap; }
.tv-timeline:focus { outline: none; }
.tb-mode.primary { font-weight: 600; }
.seq-pattern { display: flex; align-items: center; gap: .3rem; }
.seq-patbtns { display: flex; gap: .2rem; }
.seq-patbtns button { padding: .15rem .45rem; font-size: 12px; }
