:root {
  --bg: #111318; --desk: #0c0e12; --panel: #1b1e25; --panel-2: #232731; --raise: #2b303c; --line: #353b49;
  --text: #e7e9ee; --dim: #9aa2b1; --accent: #5b8cff; --accent-ink: #fff; --hot: #e2457f; --ok: #3ecf8e; --warn: #f2b84b; --err: #ff6b6b;
  --led: #b9ff66; --well: #0d0f13; --radius: 8px; --shadow: 0 14px 40px rgba(0, 0, 0, .55);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef0f4; --desk: #dfe3ea; --panel: #fff; --panel-2: #f4f6f9; --raise: #e7eaf0; --line: #cfd5df;
    --text: #1a1d24; --dim: #5b6474; --accent: #2f62e0; --hot: #c22a66; --led: #1c7a2f; --well: #f0f2f6;
    --shadow: 0 14px 40px rgba(30, 40, 60, .25); color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--desk); color: var(--text); font: 13px/1.4 var(--font); display: flex; flex-direction: column; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { background: var(--raise); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=text], input[type=search], input[type=number], select { background: var(--well); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; min-width: 0; }
select { padding-right: 4px; }
.hint { color: var(--dim); font-size: 12px; margin: 4px 0; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

/* ---------- top bar */
#top { display: flex; align-items: center; gap: 14px; height: 40px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.brand { font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.brand span, #connect h1 span { color: var(--hot); }
.menubar { display: flex; gap: 2px; }
.menubar button { background: none; border: 0; padding: 5px 10px; border-radius: 5px; }
.menubar button:hover, .menubar button.open { background: var(--raise); }
.conn { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--dim); white-space: nowrap; }
#led { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
#led.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
body:not(.online) #menubar, body:not(.online) .conn, body:not(.online) #desk { display: none; }
body.online #connect { display: none; }

/* ---------- connect screen */
#connect { flex: 1; display: grid; place-items: center; padding: 24px 16px; overflow: auto; background: radial-gradient(900px 500px at 50% 0, color-mix(in srgb, var(--accent) 14%, transparent), transparent), var(--bg); }
.connect-card { width: min(720px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
#connect h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: -.01em; }
.lead { margin: 0 0 22px; color: var(--dim); font-size: 15px; }
.connect-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.choice { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
button.big { width: 100%; padding: 12px; font-size: 15px; font-weight: 600; }
.note { min-height: 20px; margin: 16px 0 0; color: var(--warn); }

/* ---------- desk + windows */
#desk { position: relative; flex: 1; overflow: hidden; background: radial-gradient(1200px 600px at 70% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent), var(--desk); }
.win { position: absolute; display: flex; flex-direction: column; min-width: 280px; min-height: 120px; max-width: 100%; max-height: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); resize: both; overflow: hidden; }
.win.active { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.win-bar { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; flex: none; }
.win-title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
.win.active .win-title { color: var(--text); }
.win-close { border: 0; background: none; width: 24px; height: 24px; padding: 0; font-size: 17px; line-height: 1; border-radius: 5px; }
.win-close:hover { background: var(--err); color: #fff; }
.win-body { flex: 1; overflow: auto; display: flex; flex-direction: column; min-height: 0; }
.busy { position: absolute; right: 12px; bottom: 10px; background: var(--raise); border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; color: var(--dim); font-size: 12px; pointer-events: none; }

/* ---------- dialogs, menus, toasts */
dialog.dlg { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); max-width: calc(100vw - 24px); }
dialog.dlg::backdrop { background: rgba(0, 0, 0, .45); }
.dlg h2 { margin: 0 0 12px; font-size: 15px; }
.dlg-body { display: flex; flex-direction: column; gap: 10px; }
.dlg-body p { margin: 0; }
.dlg-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dlg progress { width: 100%; height: 8px; accent-color: var(--accent); }
.progress-text { margin: 0 0 8px; min-height: 18px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { color: var(--dim); font-size: 12px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.check, .radio { display: flex; align-items: center; gap: 8px; }
.radios, .checks { display: flex; flex-direction: column; gap: 6px; }
.checks { align-items: flex-start; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }
.keygrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keygrid input { width: 100%; }

.menu { position: fixed; z-index: 9999; min-width: 190px; max-height: min(70vh, 520px); overflow-y: auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px; box-shadow: var(--shadow); }
.menu.submenu { position: absolute; left: calc(100% - 4px); overflow-y: auto; }
.menu:has(> .submenu) { overflow: visible; }
.menu.submenu.left { left: auto; right: calc(100% - 4px); }
.menu-item { display: grid; grid-template-columns: 16px 1fr auto; gap: 6px; width: 100%; text-align: left; background: none; border: 0; border-radius: 5px; padding: 5px 8px; white-space: nowrap; }
.menu-item:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.menu-item .key { color: var(--dim); padding-left: 16px; }
.menu-item:hover:not(:disabled) .key { color: inherit; }
.menu .sep { height: 1px; background: var(--line); margin: 4px 6px; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 8px 12px; max-width: 420px; box-shadow: var(--shadow); }
.toast.error { border-left-color: var(--err); }

/* ---------- browser */
.toolbar, .strip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; flex-wrap: wrap; }
.toolbar { border-bottom: 1px solid var(--line); flex-wrap: nowrap; }
.crumbs { flex: 1; display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; color: var(--dim); }
.crumbs button { background: none; border: 0; padding: 3px 6px; white-space: nowrap; }
.crumbs button:last-of-type { color: var(--text); font-weight: 600; }
.filter { width: 150px; }
.split { flex: 1; display: grid; grid-template-columns: 230px 1fr; min-height: 0; }
.tree { overflow: auto; border-right: 1px solid var(--line); padding: 6px 0; background: var(--panel-2); }
.tree-row { display: flex; align-items: center; gap: 6px; padding: 4px 8px; cursor: default; white-space: nowrap; }
.tree-row:hover { background: var(--raise); }
.tree-row.sel { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.tree-row.drop, .list-rows.drop, .sample-pick.drop, .pad.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.twist { width: 12px; color: var(--dim); cursor: pointer; }
.icon { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; font-size: 11px; font-weight: 700; background: var(--raise); color: var(--dim); flex: none; }
.icon.program { background: color-mix(in srgb, var(--accent) 30%, var(--raise)); color: var(--text); }
.icon.multi { background: color-mix(in srgb, var(--hot) 30%, var(--raise)); color: var(--text); }
.icon.sample { background: color-mix(in srgb, var(--ok) 28%, var(--raise)); color: var(--text); }
.icon.midi { background: color-mix(in srgb, var(--warn) 30%, var(--raise)); color: var(--text); }
.list { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.list-head { display: grid; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.list-head button { background: none; border: 0; border-radius: 0; text-align: left; padding: 6px 10px; color: var(--dim); font-size: 12px; font-weight: 600; white-space: nowrap; }
.list-rows { flex: 1; overflow: auto; outline-offset: -2px; }
.row { display: grid; align-items: center; cursor: default; user-select: none; }
.row:nth-child(even) { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.row:hover { background: var(--raise); }
.row.sel { background: color-mix(in srgb, var(--accent) 32%, transparent); }
.cell { display: flex; align-items: center; gap: 8px; padding: 5px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell:not(:first-child) { color: var(--dim); }
.tag { font-size: 10px; border: 1px solid var(--warn); color: var(--warn); border-radius: 10px; padding: 0 6px; }
.empty { padding: 28px; text-align: center; color: var(--dim); }
.statusbar { border-top: 1px solid var(--line); padding: 5px 10px; color: var(--dim); font-size: 12px; background: var(--panel-2); flex: none; }

/* ---------- controls */
.group { border: 1px solid var(--line); border-radius: var(--radius); margin: 0; padding: 6px 10px 10px; background: var(--panel-2); min-width: 0; }
.group legend { padding: 1px 9px; border-radius: 10px; background: var(--hot); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.group-body { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.k-label { display: block; font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; text-align: center; }
.knob { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 1px; cursor: ns-resize; user-select: none; touch-action: none; border-radius: 6px; min-width: 44px; }
.k-track { fill: none; stroke: var(--line); stroke-width: 3; stroke-linecap: round; }
.k-fill { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.k-cap { fill: var(--raise); stroke: var(--line); }
.k-tick { stroke: var(--text); stroke-width: 2; stroke-linecap: round; }
.k-val, .n-val, .f-val { font: 11px var(--mono); color: var(--led); background: var(--well); border-radius: 4px; padding: 1px 5px; min-width: 38px; text-align: center; white-space: nowrap; }
.knob.drag .k-fill, .knob:focus-visible .k-fill { stroke: var(--hot); }
.numbox { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; cursor: ns-resize; user-select: none; touch-action: none; }
.numbox .n-val { font-size: 12px; padding: 4px 8px; min-width: 48px; border: 1px solid var(--line); }
input.inline { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); width: 64px; z-index: 3; text-align: center; font: 12px var(--mono); padding: 3px; }
.na { opacity: .35; pointer-events: none; }
.readonly { cursor: default; }
.selbox { display: inline-flex; flex-direction: column; gap: 2px; }
.selbox select { max-width: 150px; font-size: 12px; padding: 4px 6px; }
.seg { display: inline-flex; flex-direction: column; gap: 2px; align-items: center; }
.seg-btns { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg.vertical .seg-btns { flex-direction: column; }
.seg-btns button { border: 0; border-radius: 0; background: var(--well); padding: 3px 8px; font-size: 11px; color: var(--dim); }
.seg-btns button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
.toggle { font-size: 11px; padding: 4px 9px; background: var(--well); color: var(--dim); }
.toggle[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.toggle.mute[aria-pressed=true] { background: var(--warn); border-color: var(--warn); color: #201400; }
.toggle.solo[aria-pressed=true] { background: var(--ok); border-color: var(--ok); color: #00210f; }
.tune { display: inline-flex; gap: 6px; }
.stack { display: inline-flex; flex-direction: column; gap: 5px; align-items: stretch; }
.fader { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; cursor: ns-resize; user-select: none; touch-action: none; }
.f-rail { position: relative; width: 6px; height: 140px; background: var(--well); border: 1px solid var(--line); border-radius: 4px; }
.f-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); border-radius: 3px; opacity: .7; }
.f-thumb { position: absolute; left: -9px; width: 22px; height: 14px; background: var(--text); border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.item-name { font-weight: 700; font-size: 14px; background: var(--well); color: var(--led); font-family: var(--mono); padding: 6px 12px; }

/* ---------- program editor */
.win.program .strip { align-items: stretch; border-bottom: 1px solid var(--line); gap: 6px; padding: 6px 10px; flex: none; }
.win.program .strip .group { padding: 2px 8px 6px; }
.win.program .strip .group-body { gap: 8px; flex-wrap: nowrap; }
.keyspan { position: relative; padding: 8px 12px 18px; border-bottom: 1px solid var(--line); background: var(--panel-2); flex: none; }
.span-keys { display: flex; height: 18px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.span-keys i { flex: 1; background: #e9ecf2; border-right: 1px solid #b9c0cc; }
.span-keys i.black { background: #1b1e25; border-color: #1b1e25; }
.span-lanes { max-height: 96px; overflow-y: auto; margin-top: 4px; }
.span-lane { position: relative; height: 14px; margin-top: 2px; background: color-mix(in srgb, var(--line) 35%, transparent); border-radius: 3px; }
.span-bar { position: absolute; top: 0; bottom: 0; min-width: 5px; background: color-mix(in srgb, var(--accent) 55%, var(--panel)); border-radius: 3px; cursor: ew-resize; font-size: 9px; line-height: 14px; text-align: center; color: #fff; overflow: hidden; touch-action: none; }
.span-bar.sel { background: var(--hot); }
.span-labels { position: absolute; left: 12px; right: 12px; bottom: 2px; height: 12px; font-size: 9px; color: var(--dim); pointer-events: none; }
.span-labels span { position: absolute; }
.kg-bar { display: flex; align-items: flex-end; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); flex: none; }
.kg-title { font-weight: 600; color: var(--dim); padding-bottom: 5px; }
.kg-tabs { flex: 1; display: flex; gap: 3px; overflow-x: auto; padding-bottom: 2px; }
.kg-tabs button { min-width: 30px; padding: 4px 6px; background: var(--well); color: var(--dim); }
.kg-tabs button[aria-selected=true] { background: var(--hot); border-color: var(--hot); color: #fff; }
.kg-tabs .add { color: var(--accent); font-weight: 700; }
.menu-btn { padding: 4px 10px; }
.view-tabs { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); flex: none; }
.view-tabs button { border-bottom: 0; border-radius: 6px 6px 0 0; background: none; color: var(--dim); padding: 6px 14px; }
.view-tabs button[aria-selected=true] { background: var(--panel-2); color: var(--text); font-weight: 600; border-color: var(--line); }
.view-tabs .right { margin-left: auto; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; }
.views { flex: 1; overflow: auto; min-height: 250px; }
.view { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.view.cols { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
table { border-collapse: collapse; }
table.zones th, table.zones td, table.mods th, table.mods td { padding: 5px 8px; text-align: center; border-bottom: 1px solid var(--line); }
table.zones thead th, table.mods thead th { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--dim); font-weight: 600; }
table.zones tbody th { color: var(--hot); font-size: 15px; }
.sample-pick { width: 170px; text-align: left; background: var(--well); color: var(--led); font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sample-pick.empty { color: var(--dim); }
td.vel { white-space: nowrap; }
td.vel > * { vertical-align: middle; }
.vel-bar { display: inline-block; position: relative; width: 70px; height: 8px; margin: 0 6px; background: var(--well); border: 1px solid var(--line); border-radius: 4px; }
.vel-bar i { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }
.triple { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.triple-row { display: flex; align-items: flex-end; gap: 12px; }
.env-graph { width: 250px; height: 90px; background: var(--well); border: 1px solid var(--line); border-radius: 6px; flex-basis: 100%; }
.env-graph path { fill: none; stroke: var(--led); stroke-width: 2; vector-effect: non-scaling-stroke; }
.env-knobs { display: flex; gap: 8px; flex-wrap: wrap; flex-basis: 100%; }
.view.cols .group { flex: 1 1 280px; }
table.mods { width: 100%; max-width: 640px; }
table.mods select { width: 100%; }
table.mods tr.unused td { opacity: .55; }

/* ---------- multi editor */
.multi-head { border-bottom: 1px solid var(--line); align-items: flex-end; }
.strips { flex: 1; display: flex; gap: 6px; padding: 10px; overflow: auto; align-items: flex-start; }
.mstrip { flex: none; width: 104px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.mstrip.blank { opacity: .7; }
.mstrip .sample-pick { width: 100%; text-align: center; padding: 4px; }
.s-num { font-weight: 700; color: var(--hot); }
.s-row { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.s-label { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.s-pair { display: flex; gap: 4px; justify-content: center; }
.mstrip select { width: 90px; font-size: 11px; padding: 3px 4px; }
.mstrip .numbox .n-val { min-width: 40px; padding: 3px 5px; font-size: 11px; }

/* ---------- sample, fx, pads */
.props { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0; padding: 4px 12px 8px; }
.props dt { color: var(--dim); }
.props dd { margin: 0; font-family: var(--mono); }
canvas.wave { display: block; width: calc(100% - 24px); height: 120px; margin: 4px 12px; background: var(--well); border: 1px solid var(--line); border-radius: 6px; color: var(--led); }
.win.sample .hint { padding: 0 12px; }
.fx-body { padding: 12px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.fx-body .strip { padding: 0; }
.pad-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 12px; }
.pad { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pad.blank { opacity: .75; }
.pad-head { display: flex; justify-content: space-between; align-items: flex-end; }
.pad select { width: 100%; font-size: 11px; }
.pad-zones { display: flex; flex-direction: column; gap: 2px; font: 11px var(--mono); color: var(--led); min-height: 30px; overflow: hidden; }
.pad-zones .none { color: var(--dim); font-family: var(--font); }

/* ---------- front panel */
.fp-top { display: flex; gap: 16px; padding: 14px; align-items: center; flex-wrap: wrap; justify-content: center; }
.fp-screen { flex: 1 1 380px; }
.fp-screen { flex: 1; min-width: 0; }
canvas.lcd { display: block; width: 100%; aspect-ratio: 248 / 60; image-rendering: pixelated; border: 6px solid #2a2f3a; border-radius: 6px; background: #bed696; cursor: crosshair; }
.fp-fkeys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; }
.fp-key { font-size: 11px; font-weight: 600; padding: 6px 4px; }
.fp-key:active { background: var(--accent); color: var(--accent-ink); }
.fp-nav { display: grid; grid-template-areas: ". up ." "left wheel right" ". down ."; gap: 4px; align-items: center; justify-items: center; }
.fp-nav .up { grid-area: up; } .fp-nav .down { grid-area: down; } .fp-nav .left { grid-area: left; } .fp-nav .right { grid-area: right; }
.fp-wheel { grid-area: wheel; width: 84px; height: 84px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--raise), var(--well)); border: 1px solid var(--line); cursor: ns-resize; touch-action: none; display: grid; place-items: center; }
.fp-wheel i { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 50% 14%, var(--accent) 0 5px, transparent 6px); }
.fp-bottom { display: flex; gap: 16px; padding: 0 14px 10px; align-items: flex-end; flex-wrap: wrap; }
.fp-qlinks { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel-2); }
.fp-modes { flex: 1 1 320px; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.results { min-height: 120px; }
.win.prefs .win-body { padding: 12px; gap: 12px; }

@media (max-width: 720px) {
  .split { grid-template-columns: 150px 1fr; }
  #top { gap: 6px; padding: 0 6px; }
  #device { display: none; }
}
@media (prefers-reduced-motion: no-preference) { .toast { animation: rise .18s ease-out; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- pad audition, keyboard audition, MIDI editor */
.pad-hit { font-weight: 700; padding: 8px 12px; background: var(--raise); }
.pad-hit.on, .pad-hit:active { background: var(--hot); border-color: var(--hot); color: #fff; }
.span-keys i { cursor: pointer; touch-action: none; }
.span-keys i.on { background: var(--hot); }
.roll-scroll { flex: 1; overflow: auto; min-height: 220px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--well); }
canvas.roll { display: block; cursor: crosshair; touch-action: none; }
.roll-scroll { position: relative; }
.playhead { position: absolute; top: 0; width: 2px; height: 1152px; background: var(--hot); pointer-events: none; }
.sep-v { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.fp-key.on { background: var(--hot); border-color: var(--hot); color: #fff; }
.keylog { flex: 1; min-height: 140px; overflow: auto; margin: 0 12px 12px; padding: 8px; background: var(--well); border: 1px solid var(--line); border-radius: 6px; font: 11px/1.5 var(--mono); white-space: pre; }
.rawnote { margin: 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 6px; color: var(--dim); font-size: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rawnote code { font-family: var(--mono); color: var(--text); word-break: break-all; user-select: all; }
