/* Index: one fixed 1332 x 692 frame, scaled to fit the page. DumBox look: light frame, white knobs,
   black hardware keys, black screens. The web page scales it to fit. */
:root { color-scheme: light; --ink: #2a2b2d; --mute: #7d7e82; --line: #d6d7d3; --key: #1e1f21; --keyhi: #2a2b2e; --lit: #f6f6f2; --amber: #f0cf7a; --deep: #d9a520; }
* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; height: 100%; overflow: hidden; user-select: none; -webkit-user-select: none; }
body { background: radial-gradient(120% 80% at 50% 0%, #e4e5e2, #d3d4d1); color: var(--ink); font: 11.5px/1.25 "Instrument Sans", system-ui, sans-serif; display: flex; justify-content: center; align-items: flex-start; }
#wrap { transform-origin: top center; margin-top: 8px; width: max-content; flex: none; }
/* fixed frame: the page scales it to fit; the modulation list scrolls inside it */
#stage { position: relative; width: 1332px; padding: 4px; display: flex; flex-direction: column; gap: 4px; }
.grow { flex: 1; }
h1 { margin: 0 14px 0 4px; font: 800 26px/1 "Sofia Sans Condensed", sans-serif; color: #1e1f21; }
h3 { font: 600 11px "Instrument Sans", sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin: 0; white-space: nowrap; }

/* black hardware keys */
button, select.key, select#presetSel { position: relative; font: 500 11.5px "Instrument Sans", sans-serif; color: #b9bab6; background: linear-gradient(180deg, var(--keyhi), var(--key)); border: 0; border-radius: 5px; padding: 3px 7px; min-height: 22px; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 0 rgba(255,255,255,.7), 0 2px 4px rgba(0,0,0,.28); }
button:hover, select.key:hover { color: #fff; }
button.on { color: #fff; }
button.on::before { content: ""; position: absolute; bottom: 2px; left: 28%; right: 28%; height: 2px; border-radius: 1px; background: var(--lit); box-shadow: 0 0 6px rgba(255,255,255,.8); }
button:focus-visible, select:focus-visible, .knob:focus-visible { outline: 2px solid #6d6e71; outline-offset: 1px; }
select.key { appearance: none; -webkit-appearance: none; padding-right: 16px; background-image: linear-gradient(45deg, transparent 50%, #b9bab6 50%), linear-gradient(135deg, #b9bab6 50%, transparent 50%), linear-gradient(180deg, var(--keyhi), var(--key)); background-position: right 8px top 50%, right 4px top 50%, 0 0; background-size: 4px 4px, 4px 4px, 100% 100%; background-repeat: no-repeat; }
select.key.wide { flex: 1; }
select option { color: #000; background: #fff; }
button.pw { width: 22px; height: 20px; min-height: 0; padding: 0; }
button.pw { display: grid; place-items: center; color: #5a5b5f; }
button.pw svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
button.pw.on { color: var(--lit); }
button.pw.on svg { filter: drop-shadow(0 0 3px rgba(255,255,255,.8)); }
button.pw.on::before { display: none; }
button.sm { padding: 2px 6px; }
.seg { display: flex; gap: 2px; }
.seg button { padding: 3px 6px; }

/* header */
header { height: 36px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 4px; }
header .big { height: 30px; min-width: 36px; }
header > :not(.grow) { flex-shrink: 0; } header #presetSel { flex-shrink: 1; min-width: 0; }
#presetSel { width: 330px; height: 30px; appearance: none; -webkit-appearance: none; text-align: center; text-align-last: center; background: #151617; color: #f2f2ee; border-radius: 6px; box-shadow: inset 0 1px 3px rgba(0,0,0,.6), 0 1px 0 #fff; font: 700 19px "Sofia Sans Condensed", sans-serif; letter-spacing: .02em; }
header select.key, header #hiq { height: 30px; }
#version { color: var(--mute); font-size: 11px; margin-left: 4px; }

/* bands and sections */
.band { flex: none; display: flex; background: linear-gradient(180deg, #f1f1ef, #e7e7e4); border: 1px solid #d2d3cf; border-radius: 10px; box-shadow: 0 1px 0 #fff inset, 0 10px 24px -14px rgba(0,0,0,.25); position: relative; }
#bandB .sec { padding: 4px; }
.lflds .fv { font-size: 11.5px; }
.sec { padding: 4px 4px 4px; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--line); flex: 1 1 auto; }
.sec:first-child { border-left: 0; }
.hd { display: flex; align-items: center; gap: 4px; min-height: 22px; }
.hd h3 { margin-right: 4px; }
.two { display: flex; }
.two > * { flex: 1; }
.hint { color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl { font-size: 10.5px; color: var(--mute); white-space: nowrap; }
canvas.scr { display: block; background: #151617; border-radius: 8px; box-shadow: inset 0 1px 3px rgba(0,0,0,.6), 0 1px 0 #fff; touch-action: none; }

/* knobs: CSS disc + dot (three.js draws over them when WebGL works); amber ring = modulation depth */
.kn { width: 44px; display: flex; flex-direction: column; align-items: center; }
.knob { --s: 32px; width: var(--s); height: var(--s); position: relative; cursor: ns-resize; touch-action: none; border-radius: 50%; }
.kn.big { width: 56px; } .kn.big .knob { --s: 46px; }
.knob::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #fff, #e6e6e3 60%, #cfd0cc); box-shadow: 0 3px 6px rgba(0,0,0,.22), 0 1px 1px rgba(0,0,0,.2); }
.knob::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #6d6e71; transform: rotate(calc(-135deg + var(--v, 0) * 270deg)) translateY(calc(var(--s) * -.26)); }
body.gl .knob::before, body.gl .knob::after { visibility: hidden; }
.ring { position: absolute; inset: -3px; pointer-events: none; }
.ring svg { width: 100%; height: 100%; overflow: visible; }
.ring circle { fill: none; stroke: var(--deep); stroke-width: 2.2; }
.kl { font-size: 10.5px; line-height: 12px; color: var(--mute); white-space: nowrap; margin-top: 1px; }
.kv { font-size: 10.5px; line-height: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* number fields */
.fld { display: flex; flex-direction: column; align-items: center; cursor: ns-resize; touch-action: none; }
.fv { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; border-bottom: 2px solid transparent; }
.fld .fv { display: inline-flex; flex-direction: column; align-items: center; }
.fld .fv > .gh { height: 0; overflow: hidden; visibility: hidden; }
.fld.modded .fv { border-bottom-color: var(--deep); }
.fld.dim { opacity: .4; }
.fld[hidden] { display: none; }
.fcol { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }

/* vertical faders */
.vf { width: 30px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.vf .fv { font-size: 11px; }
.vtrack { position: relative; width: 6px; flex: 1; margin: 6px 0; background: #1c1d1f; border-radius: 3px; box-shadow: 0 1px 0 #fff; cursor: ns-resize; touch-action: none; }
.vtrack::after { content: ""; position: absolute; left: -12px; right: -12px; top: -6px; bottom: -6px; }
.vmod { position: absolute; left: 9px; width: 3px; background: var(--deep); border-radius: 1px; }
.fcap { position: absolute; left: -8px; width: 22px; height: 12px; margin-bottom: -6px; bottom: calc(var(--v, 0) * 100%); background: linear-gradient(180deg, #4a4b4e, #232426); border-radius: 3px; box-shadow: 0 2px 4px rgba(0,0,0,.35); }
.fcap::after { content: ""; position: absolute; left: 3px; right: 3px; top: 5px; height: 1px; background: #d8d8d4; }

/* oscillators */
.osc .body { display: flex; gap: 6px; height: 116px; }
.osc .flds { display: flex; justify-content: space-between; align-items: flex-end; }
/* filters */
.flt .fhd { display: flex; align-items: center; gap: 2px; padding-right: 0; }
.flt .fhd h3 { margin: 0 2px 0 1px; }
.flt .circ select[hidden] { display: none; }
.fctl { display: flex; align-items: flex-end; justify-content: space-around; }
.flt .grow { flex: 1; }
.fstrip { display: flex; align-items: center; gap: 8px; flex: 1; min-height: 0; }
.fstrip + .fstrip { border-top: 1px solid var(--line); padding-top: 4px; }
.fsw { width: 100px; flex: none; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.fsw > select.key, .fsw .circ select.key { width: 100px; }
.fstrip .fctl { flex: 1; justify-content: space-around; align-items: center; }
.fctl.off { opacity: .45; }
/* a section or filter strip that is switched off: everything but its on switch greys out */
.is-off > :not(.hd, .fsw, .panel), .is-off > .panel > *, .is-off :is(.hd, .fsw, .fhd) > :not(.fhd, .pw) { opacity: .4; }
/* sub */

.sub .hd { align-self: flex-start; }
/* envelopes, LFOs */
.eflds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.waves { display: flex; justify-content: space-between; }
.waves button { width: 30px; height: 18px; min-height: 0; padding: 0; display: grid; place-items: center; }
.waves svg { width: 18px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.waves button.on::before { bottom: 1px; }
.lflds { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 2px; }
.lflds .fl { white-space: nowrap; }
.rate2 { display: grid; } .rate2 > * { grid-area: 1 / 1; }
/* modulation */
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 3px 7px; cursor: grab; }
.chip.used { color: var(--amber); }
body.dragging, body.dragging * { cursor: copy !important; }
.routes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; align-content: start; overflow-y: auto; flex: 1; }
.route { display: flex; align-items: center; gap: 6px; height: 22px; border-bottom: 1px solid var(--line); }
.route b { width: 70px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route .arr { color: #8b8c8f; }
.route .tg { width: 104px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route .bar { flex: 1; height: 8px; background: #1c1d1f; border-radius: 4px; position: relative; box-shadow: 0 1px 0 #fff; cursor: ew-resize; touch-action: none; }
.route .bar i { position: absolute; top: 2px; bottom: 2px; background: var(--amber); border-radius: 2px; }
.route .amt { width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.route .x { min-height: 0; padding: 0 5px; background: transparent; color: #8b8c8f; box-shadow: none; }
.knobs { display: flex; justify-content: space-between; }
.bfl { justify-content: space-around; align-items: center; }
.vcol { display: flex; flex-direction: column; border-left: 1px solid var(--line); flex: 1 1 auto; }
.vcol > .sec { border-left: 0; }
.vcol > .sec + .sec { padding-top: 0; }
.reverb .seg button { padding: 0 5px; }
.voice .hd select { max-width: 92px; }

/* grid overlay */
#grid { position: absolute; left: 8px; right: 8px; top: 48px; bottom: 8px; z-index: 3; background: #ececea; border: 1px solid #d2d3cf; border-radius: 10px; box-shadow: 0 1px 0 #fff inset, 0 18px 40px -10px rgba(0,0,0,.45); padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
#grid[hidden] { display: none; }
.gtables { display: flex; gap: 28px; flex: 1; min-height: 0; overflow: auto; justify-content: center; }
.gtables table { border-collapse: separate; border-spacing: 1px; font-size: 10.5px; }
.gtables th.src { height: 50px; vertical-align: bottom; font-weight: 500; color: var(--mute); }
.gtables th.src span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.gtables td { padding: 0; }
.gtables td.name { line-height: 13px; padding-right: 6px; width: 104px; white-space: nowrap; color: var(--mute); }
.gtables td.cell { width: 29px; height: 13px; line-height: 13px; padding: 0; background: #dcddd9; text-align: center; font-size: 10px; font-weight: 600; color: var(--amber); cursor: ns-resize; touch-action: none; font-variant-numeric: tabular-nums; }
.gtables td.cell.v { background: #1e1f21; }

.bpm { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--mute); }
.bpm input { width: 56px; font: 600 12px "Instrument Sans", sans-serif; background: #f7f7f5; border: 1px solid #cfd0cc; border-radius: 5px; padding: 3px 4px; color: var(--ink); }

#start { position: fixed; inset: 0; background: rgba(217,218,215,.8); display: grid; place-items: center; z-index: 10; }
#start button { font-size: 18px; padding: 14px 26px; }
dialog { background: #ececea; color: var(--ink); border: 1px solid #d2d3cf; border-radius: 12px; max-width: min(640px, 94vw); max-height: 88dvh; }
dialog table { border-collapse: collapse; font-size: 12px; }
dialog td, dialog th { padding: 2px 8px 2px 0; text-align: left; vertical-align: top; }
dialog menu { display: flex; gap: 8px; justify-content: flex-end; padding: 0; margin: 10px 0 0; }
.note { color: var(--mute); font-size: 12px; }
.gl3d { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
body.gl .fcap { background: transparent; box-shadow: none; }
body.gl .fcap::after { display: none; }
.tchip { background: none; box-shadow: none; padding: 1px 4px; margin-left: -4px; min-height: 0; font: 600 11px "Instrument Sans", sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); cursor: grab; border-radius: 4px; }
.tchip:hover { color: var(--ink); background: rgba(255,255,255,.6); }
.tchip.used { color: var(--deep); }
.tchip.on { color: var(--ink); background: #fff; }
.tchip.on::before { background: var(--deep); box-shadow: none; bottom: 0; }
.chip.on { background: linear-gradient(180deg, #3a3b3f, #2a2b2e); }

.sec.drop, .osc.drop { outline: 2px dashed var(--deep); outline-offset: -3px; }

/* phone view (portrait): Random, a small keyboard and Save (body.phone) */
#phone { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 14px calc(12px + env(safe-area-inset-bottom)); box-sizing: border-box; }
#phone[hidden] { display: none; }
body.phone #wrap { display: none; }
.ph-top, .ph-row, .ph-oct { display: flex; align-items: center; gap: 10px; }
#phone .big, #phone select { height: 44px; font-size: 15px; }
#phMine { max-width: 60%; }
.ph-name { text-align: center; font: 800 34px/1.1 "Sofia Sans Condensed", sans-serif; color: #1e1f21; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 38px; margin-top: 8px; }
.ph-rand { color: #fff; height: 96px; font-size: 28px; font-weight: 700; }
.ph-save { height: 60px; font-size: 20px; }
.ph-row .rmod { flex: 1; } .rmod.ph input { flex: 1; width: auto; }
.ph-oct { margin-top: auto; } .ph-oct .big { width: 64px; font-size: 22px; }
#phKeys { flex: none; height: min(340px, 38vh); position: relative; touch-action: none; }
#phKeys i { position: absolute; top: 0; bottom: 0; background: linear-gradient(#fbfbf9, #e9e9e6); border: 1px solid #b9bab6; border-radius: 0 0 8px 8px; box-sizing: border-box; }
#phKeys i.b { bottom: 40%; background: linear-gradient(#2a2b2e, #151617); border-color: #000; z-index: 1; border-radius: 0 0 5px 5px; }
#phKeys i.on { background: var(--amber); }
.rmod { display: flex; align-items: center; gap: 4px; color: var(--mute); }
.rmod input { width: 70px; accent-color: #f0cf7a; }
.rmod.ph { font-size: 15px; } .rmod.ph input { height: 44px; }

.ph-tick { display: flex; align-items: center; gap: 6px; font-size: 15px; white-space: nowrap; }
.ph-tick input { width: 22px; height: 22px; accent-color: #6d6e71; }
select.menu { width: 44px; text-align: center; text-align-last: center; }
header select.menu { height: 30px; }

/* preset browser (browser.js) */
dialog.browser { width: min(860px, 94vw); max-width: none; height: min(620px, 88dvh); padding: 0; display: none; flex-direction: column; overflow: hidden; }
dialog.browser[open] { display: flex; }
dialog.browser::backdrop { background: rgba(0,0,0,.35); }
.bw-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #d2d3cf; }
.bw-top h3 { margin: 0; font-size: 15px; }
.bw-q { flex: 1; min-width: 0; font: 13px "Instrument Sans", sans-serif; padding: 6px 9px; border: 1px solid #c9cac6; border-radius: 6px; background: #fff; }
.bw-body { flex: 1; display: flex; min-height: 0; }
.bw-side { width: 170px; flex: none; overflow-y: auto; padding: 8px; border-right: 1px solid #d2d3cf; display: flex; flex-direction: column; gap: 2px; }
.bw-side-sel { display: none; }
.bw-side button, .bw-row button.bw-star { all: unset; cursor: pointer; }
.bw-side .bw-src, .bw-side .bw-tag { padding: 5px 8px; border-radius: 5px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-src:hover, .bw-tag:hover { background: #dcddd9; }
.bw-src.on, .bw-tag.on { background: #2b2c2a; color: #fff; }
.bw-src.add { color: #777; }
.bw-tagh { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #888; margin: 12px 8px 4px; }
.bw-list { flex: 1; overflow-y: auto; outline: none; }
.bw-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 120px 140px; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; font-size: 13px; border-bottom: 1px solid #e0e1dd; cursor: pointer; }
.bw-row:hover { background: #e2e3df; }
.bw-row.sel { background: #d4d6d0; }
.bw-row.cur .bw-name { font-weight: 600; }
.bw-row button.bw-star { text-align: center; font-size: 16px; color: #b08a00; }
.bw-row button.bw-star:disabled { color: transparent; cursor: default; }
.bw-name, .bw-folder, .bw-tags { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bw-folder, .bw-tags { color: #777; font-size: 12px; }
.bw-empty { padding: 20px; color: #888; font-size: 13px; }
.bw-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid #d2d3cf; }
.bw-acts .grow { flex: 1; }
.bw-acts .bw-sep { width: 8px; }
.bw-acts button:disabled, .bw-acts option:disabled { opacity: .4; cursor: default; }
@media (max-width: 640px) {
  dialog.browser { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; margin: 0; }
  .bw-side { display: none; }
  .bw-side-sel { display: block; position: absolute; }
  .bw-body { flex-direction: column; }
  .bw-side-sel { position: static; margin: 6px 12px; height: 34px; font-size: 14px; }
  .bw-row { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 10px 12px 10px 4px; font-size: 15px; }
  .bw-row .bw-tags { display: none; }
  .bw-row button.bw-star { font-size: 20px; }
  .bw-acts { gap: 6px; }
  .bw-acts button, .bw-acts select { min-height: 34px; font-size: 13px; }
  .bw-acts .grow, .bw-acts .bw-sep { display: none; }
}
.ph-name { cursor: pointer; }
.flt .fhd > *, .flt .circ > * { flex: none; }
.flt .fhd select.key { font-size: 11px; padding-left: 5px; padding-right: 13px; background-position: right 6px top 50%, right 2px top 50%, 0 0; }

/* black panels: each synth section's controls sit on one dark panel, values in light text */
.panel { flex: 1; display: flex; flex-direction: column; gap: 6px; background: #151617; border-radius: 8px; padding: 6px 8px 7px; color: #ecece8; box-shadow: inset 0 1px 3px rgba(0,0,0,.6), 0 1px 0 #fff; }
.panel .fl, .panel .kl { color: #8b8c8f; }
.panel canvas.scr { box-shadow: none; border-radius: 4px; }
.panel .vtrack { background: #34353a; box-shadow: none; }
.panel .fstrip + .fstrip, .panel .fctl + .fctl { border-color: #2c2d31; }
.panel { --key: #2a2b2f; --keyhi: #36373c; }
.panel button, .panel select.key { box-shadow: none; }
.panel > canvas.scr { align-self: center; }
.sub .panel { align-items: center; }
/* modulation list on its black panel */
.panel .route { border-bottom-color: #2c2d31; }
.panel .route .bar { background: #34353a; box-shadow: none; }
.panel .route b, .panel .route .amt { color: #ecece8; }
#bandC { flex: none; }
#bandC > .sec { flex: 1 1 0; }
#bandC > .voice { flex-grow: .62; }
#bandC > .chorus { flex-grow: .9; }
#bandC > .reverb { flex-grow: 1.15; }
.chorus .hd select { max-width: 86px; }
.chorus .hd select.dim { opacity: .4; }
#modPage { position: absolute; left: 8px; right: 8px; top: 48px; bottom: 8px; z-index: 3; background: #ececea; border: 1px solid #d2d3cf; border-radius: 10px; box-shadow: 0 1px 0 #fff inset, 0 18px 40px -10px rgba(0,0,0,.45); padding: 6px; display: flex; flex-direction: column; }
#modPage[hidden] { display: none; }
#modPage > .sec { flex: 1; min-height: 0; border: 0; }
#modPage > .sec > .panel { flex: 1; min-height: 0; }
#modClose { position: absolute; right: 10px; top: 8px; }
#modPage .mod .hd { padding-right: 64px; }
#grid { z-index: 4; }
#bandC .sec, #bandC .panel { min-height: 0; }
.mod .routes { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a3b40 transparent; }
.osc canvas.scr { cursor: ns-resize; }
.dk-tick { font-size: 11.5px; color: var(--mute); gap: 4px; } .dk-tick input { width: 14px; height: 14px; }

/* right-click modulation popup: one row of the grid */
.modpop { position: fixed; z-index: 20; background: #ececea; border: 1px solid #d2d3cf; border-radius: 8px; box-shadow: 0 1px 0 #fff inset, 0 12px 30px -8px rgba(0,0,0,.45); padding: 6px 8px 8px; }
.modpop .mp-hd { font: 600 11px "Instrument Sans", sans-serif; color: var(--ink); margin-bottom: 2px; }
.modpop .mp-hd span { color: var(--mute); font-weight: 500; }
.modpop table { border-collapse: separate; border-spacing: 1px; font-size: 10.5px; }
.modpop th.src { height: 58px; vertical-align: bottom; font-weight: 500; color: var(--mute); }
.modpop th.src span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.modpop td.cell { width: 29px; height: 20px; background: #dcddd9; text-align: center; font-size: 10px; font-weight: 600; color: var(--amber); cursor: ns-resize; touch-action: none; font-variant-numeric: tabular-nums; }
.modpop td.cell.v { background: #1e1f21; }

/* Live-style spacing: black panels sit a hairline apart, with almost no grey between them */
.band { padding: 3px; gap: 3px; }
.sec, #bandB .sec { padding: 0; gap: 3px; border-left: 0; }
.panel { border-radius: 4px; }
.sec > .hd { padding: 0 2px; }

/* right-click wavetable chooser: all tables at once */
.tpop { position: fixed; z-index: 20; width: min(960px, calc(100vw - 8px)); max-height: calc(100vh - 8px); display: flex; flex-direction: column; gap: 6px; background: #ececea; border: 1px solid #d2d3cf; border-radius: 8px; box-shadow: 0 1px 0 #fff inset, 0 12px 30px -8px rgba(0,0,0,.45); padding: 8px 10px; }
.tpop .tp-hd { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.tpop .tp-body { overflow-y: auto; min-height: 0; columns: 4 200px; column-gap: 14px; }
.tpop .tp-grp { break-inside: avoid; margin-bottom: 8px; }
.tpop h4 { margin: 0 0 3px; font: 600 10.5px "Instrument Sans", sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.tpop .tp-list { display: flex; flex-wrap: wrap; gap: 2px; }
.tpop .tp-list button { all: unset; cursor: pointer; font-size: 11px; padding: 2px 6px; border-radius: 4px; background: #dcddd9; color: var(--ink); white-space: nowrap; }
.tpop .tp-list button:hover { background: #cfd0cc; }
.tpop .tp-list button.on { background: #1e1f21; color: var(--amber); }
.tpop .tp-foot { display: flex; gap: 6px; }

/* a control that modulation is moving right now */
.fld.live .fv, .vf.live .fv { color: var(--amber); }
