:root {
  --bg: #0a0c0f; --panel: #111419; --panel2: #151920; --fill: #1b2028; --fill2: #232a34; --fill3: #2c3440;
  --line: #1d232b; --text: #d9e0e8; --dim: #8b97a6; --faint: #566170; --ghost: #3a434f;
  --accent: #ff4d8d; --ok: #4fd1a5; --warn: #f5a524; --bad: #ff5a5a; --agent: #ff4d8d; --info: #33c3f0;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 11px/1.35 var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
body { display: grid; grid-template-rows: 46px 1fr 24px; min-width: 1180px; }
button, select, input { font: inherit; color: inherit; }
button { background: var(--fill); border: 0; border-radius: 5px; padding: 4px 9px; cursor: pointer; white-space: nowrap; }
button:hover { background: var(--fill2); }
button.on { background: var(--text); color: var(--bg); }
button.ghost { background: transparent; color: var(--dim); padding: 3px 6px; }
button.ghost:hover { color: var(--text); background: var(--fill); }
button.primary { background: var(--accent); color: #fff; font-weight: 600; }
select { background: var(--fill); border: 0; border-radius: 5px; padding: 3px 5px; cursor: pointer; }
input[type=text], input[type=number] { background: var(--fill); border: 0; border-radius: 5px; padding: 4px 6px; outline: none; }
input:focus { background: var(--fill2); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); } .faint { color: var(--faint); }
.label { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.panel { background: var(--panel); overflow: hidden; position: relative; }
.hidden { display: none !important; }

/* ---------- top bar */
#top { display: flex; align-items: center; gap: 14px; padding: 0 12px; background: var(--panel); }
.logo { font-weight: 800; letter-spacing: .12em; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.logo i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.tgroup { display: flex; align-items: center; gap: 6px; }
.seg { display: flex; background: var(--fill); border-radius: 6px; padding: 2px; }
.seg button { background: transparent; padding: 3px 9px; border-radius: 4px; color: var(--dim); font-weight: 600; }
.seg button.on { background: var(--fill3); color: var(--text); }
.play { width: 34px; height: 28px; font-size: 13px; padding: 0; background: var(--fill2); }
.play.on { background: var(--ok); color: #03140d; }
.field { display: flex; flex-direction: column; gap: 1px; }
.field .label { font-size: 8.5px; }
.drag { cursor: ns-resize; user-select: none; font-family: var(--mono); font-size: 13px; font-weight: 600; min-width: 34px; }
.pos { font-family: var(--mono); font-size: 18px; font-weight: 600; letter-spacing: .02em; min-width: 94px; }
.spacer { flex: 1; }
.mmeter { display: grid; grid-template-columns: 120px auto; gap: 2px 8px; align-items: center; }
.hbar { height: 5px; background: var(--fill); border-radius: 3px; overflow: hidden; position: relative; }
.hbar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--ok) 70%, var(--warn) 88%, var(--bad)); border-radius: 3px; }
.stat { display: flex; align-items: center; gap: 5px; color: var(--dim); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.agent { background: var(--agent); }

/* ---------- layout */
#main { display: grid; grid-template-columns: 236px 1fr 336px; gap: 1px; min-height: 0; }
#center { display: grid; grid-template-rows: minmax(150px, auto) 1fr 244px; gap: 1px; min-height: 0; min-width: 0; }
#right { display: grid; grid-template-rows: 1fr 300px; gap: 1px; min-height: 0; }
#side { background: var(--panel); overflow-y: auto; padding: 10px 10px 14px; display: flex; flex-direction: column; gap: 16px; }
#rack { overflow-y: auto; max-height: 42vh; }
#status { display: flex; justify-content: space-between; align-items: center; padding: 0 12px; background: var(--panel); color: var(--dim); gap: 20px; }
#hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
#keys { color: var(--faint); white-space: nowrap; }

/* ---------- sidebar */
.sec h3 { margin: 0 0 7px; display: flex; align-items: center; justify-content: space-between; }
.flow { display: flex; flex-direction: column; gap: 1px; }
.flow .row { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 5px; cursor: pointer; }
.flow .row:hover { background: var(--fill); }
.flow .row.next { background: var(--fill); }
.flow .num { color: var(--faint); font-family: var(--mono); font-size: 10px; }
.flow .row.done .name { color: var(--dim); }
.next-hint { margin-top: 6px; padding: 7px 8px; background: rgba(255, 77, 141, .08); border-radius: 6px; color: var(--text); line-height: 1.45; }
.next-hint b { color: var(--accent); font-weight: 600; }
.list .item { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 5px; cursor: pointer; }
.list .item:hover { background: var(--fill); }
.list .item.sel { background: var(--fill2); }
.chip { width: 8px; height: 8px; border-radius: 2px; }
.btnrow { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.inst-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.inst-grid button { text-align: left; display: flex; align-items: center; gap: 6px; background: var(--panel2); padding: 5px 7px; }
.inst-grid button:hover { background: var(--fill2); }
.feed { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; }
.feed .e { display: grid; grid-template-columns: 7px 1fr auto; gap: 6px; align-items: baseline; padding: 2px 0; }
.feed .e .dot { transform: translateY(-1px); }
.feed .e span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 10px; }
.feed .t { color: var(--faint); font-family: var(--mono); font-size: 9.5px; }
.cli { font-family: var(--mono); font-size: 10px; background: var(--panel2); padding: 7px 8px; border-radius: 6px; color: var(--dim); line-height: 1.6; }
.cli b { color: var(--text); font-weight: 500; }

/* ---------- panel headers */
.ph { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--panel); position: sticky; top: 0; z-index: 3; min-height: 32px; }
.ph .title { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 10px; color: var(--dim); }
.ph .sub { color: var(--faint); }

/* ---------- channel rack */
.rack-rows { padding: 0 6px 6px; }
.rrow { display: grid; grid-template-columns: 4px 14px 118px 52px 1fr 30px; align-items: center; gap: 6px; height: 27px; border-radius: 5px; padding-right: 6px; }
.rrow:hover { background: var(--panel2); }
.rrow.sel { background: var(--fill); }
.rrow .sw { height: 19px; border-radius: 2px; }
.rrow .nm { display: flex; align-items: center; min-width: 0; cursor: pointer; font-weight: 500; padding: 3px 0; }
.rrow .nm .nt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .nm small { color: var(--faint); font-weight: 400; margin-left: 4px; }
.rrow.muted .nm, .rrow.muted .steps { opacity: .35; }
.mute { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); cursor: pointer; }
.mute.off { background: var(--ghost); }
.minivol { height: 17px; background: var(--fill); border-radius: 3px; position: relative; cursor: ew-resize; overflow: hidden; }
.minivol i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--fill3); }
.minivol span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 9.5px; color: var(--dim); }
.steps { display: flex; gap: 2px; height: 21px; user-select: none; }
.steps .grp { display: flex; gap: 2px; flex: 1; }
.steps .grp + .grp { margin-left: 3px; }
.st { flex: 1; border-radius: 3px; background: var(--fill); position: relative; cursor: pointer; min-width: 5px; }
.steps .grp.alt .st { background: var(--fill2); }
.st i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 3px; }
.st.play { outline: 1px solid rgba(255, 255, 255, .55); outline-offset: -1px; }
.mini { height: 21px; width: 100%; display: block; cursor: pointer; border-radius: 3px; background: var(--panel2); }
.rmeter { height: 21px; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.rmeter i { width: 4px; background: var(--ok); border-radius: 1px; height: 0; transition: height .05s linear; }
.rmeter b { width: 5px; height: 5px; border-radius: 50%; background: var(--ghost); align-self: center; }
.ruler-steps { display: grid; grid-template-columns: 4px 14px 118px 52px 1fr 30px; gap: 6px; padding: 0 12px 2px 6px; color: var(--faint); font-family: var(--mono); font-size: 9px; }
.ruler-steps .nums { display: flex; }
.ruler-steps .nums span { flex: 1; }

/* ---------- piano roll / playlist canvases */
.canvwrap { position: absolute; left: 0; right: 0; bottom: 0; top: 36px; }
.canvwrap canvas { display: block; width: 100%; height: 100%; }
.toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow: hidden; }
.toolbar .sep { width: 1px; height: 16px; background: var(--line); margin: 0 3px; }
.tab { background: transparent; color: var(--faint); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 10px; padding: 4px 8px; }
.tab.on { color: var(--text); background: var(--fill); }

/* ---------- mixer */
.mixer { display: flex; gap: 2px; padding: 6px 8px; height: 100%; overflow: auto hidden; }
.strip { width: 76px; flex: none; background: var(--panel2); border-radius: 6px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; }
.strip.sel { background: var(--fill); }
.strip .snm { font-weight: 600; font-size: 10px; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip .fz { display: flex; gap: 4px; height: 62px; align-items: stretch; }
.vmeter { width: 6px; background: var(--fill); border-radius: 3px; position: relative; overflow: hidden; }
.vmeter i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, var(--ok) 65%, var(--warn) 85%, var(--bad)); }
.fader { width: 18px; background: var(--fill); border-radius: 4px; position: relative; cursor: ns-resize; }
.fader i { position: absolute; left: 2px; right: 2px; height: 8px; background: var(--text); border-radius: 2px; }
.strip .db { font-family: var(--mono); font-size: 9.5px; color: var(--dim); }
.ms { display: flex; gap: 3px; }
.ms button { padding: 1px 5px; font-size: 9px; font-weight: 700; background: var(--fill); color: var(--faint); }
.ms button.on.m { background: var(--warn); color: #1a1000; }
.ms button.on.s { background: var(--info); color: #001018; }
.strip .knobs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2px; }

/* ---------- knobs */
.knob { display: flex; flex-direction: column; align-items: center; width: 70px; padding: 3px 0 4px; border-radius: 6px; cursor: ns-resize; user-select: none; }
.knob:hover { background: var(--panel2); }
.knob svg { width: 34px; height: 34px; overflow: visible; }
.knob .trk { stroke: var(--fill2); }
.knob .kl { font-size: 9.5px; color: var(--dim); margin-top: -1px; white-space: nowrap; }
.knob .kv { font-family: var(--mono); font-size: 10px; color: var(--text); white-space: nowrap; }
.knob.sm { width: 34px; padding: 1px 0; }
.knob.sm svg { width: 22px; height: 22px; }
.knob.sm .kl { font-size: 8.5px; } .knob.sm .kv { display: none; }
.knob { position: relative; }
.knob.changed .kv { color: var(--accent); }
.knob .kr { position: absolute; top: 0; right: 4px; width: 15px; height: 15px; border-radius: 50%; display: none; align-items: center; justify-content: center; font-size: 11px; line-height: 1; color: var(--accent); background: rgba(255, 77, 141, .12); cursor: pointer; }
.knob.changed .kr { display: flex; }
.knob .kr:hover { background: var(--accent); color: #fff; }
.knob.sm .kr { top: -2px; right: -1px; width: 12px; height: 12px; font-size: 9px; }
.pgroup .label button { padding: 0 6px; font-size: 9.5px; letter-spacing: 0; text-transform: none; }

/* ---------- inspector */
#inspector { overflow-y: auto; }
.insp-head { padding: 10px 12px 6px; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; }
.insp-head .big { font-size: 15px; font-weight: 700; cursor: text; }
.insp-head .blurb { grid-column: 1 / -1; color: var(--dim); line-height: 1.45; }
.pgroup { padding: 4px 8px 2px; }
.pgroup .label { padding: 0 4px 2px; display: flex; justify-content: space-between; }
.knobrow { display: flex; flex-wrap: wrap; }
.curve { display: block; width: calc(100% - 16px); margin: 2px 8px 6px; height: 74px; background: var(--panel2); border-radius: 6px; }
.insp-empty { padding: 20px; color: var(--dim); }

/* ---------- analyzer */
#analyzer { display: grid; grid-template-rows: 32px 1fr 64px; }
#analyzer canvas { width: 100%; height: 100%; display: block; }
.an-bottom { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 0 10px 8px; }
.an-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 10px; align-content: center; }
.an-stats div { display: flex; justify-content: space-between; gap: 4px; }
.an-stats b { font-family: var(--mono); font-weight: 500; }

/* ---------- report drawer */
.report { position: fixed; right: 16px; top: 58px; bottom: 36px; width: 440px; background: var(--panel2); border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); z-index: 50; overflow-y: auto; padding: 14px 16px; }
.report h2 { margin: 0 0 4px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.report .kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.report .kv div { background: var(--fill); padding: 7px 8px; border-radius: 6px; }
.report .kv b { display: block; font-family: var(--mono); font-size: 15px; margin-top: 2px; }
.report .band { display: grid; grid-template-columns: 70px 1fr 48px 60px; gap: 8px; align-items: center; margin: 3px 0; }
.report .bandbar { height: 8px; background: var(--fill); border-radius: 4px; position: relative; }
.report .bandbar .tg { position: absolute; top: -2px; bottom: -2px; background: rgba(79, 209, 165, .16); border-radius: 3px; }
.report .bandbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--text); }
.report .sug { padding: 8px 10px; border-radius: 6px; background: var(--fill); margin: 6px 0; line-height: 1.45; }
.report .sug .fix { font-family: var(--mono); font-size: 10px; color: var(--dim); margin-top: 4px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.report table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 10px; }
.report td, .report th { padding: 3px 4px; text-align: right; }
.report th { color: var(--faint); font-weight: 500; }
.report td:first-child, .report th:first-child { text-align: left; }

/* ---------- overlays */
.start { position: fixed; inset: 0; background: rgba(5, 6, 8, .72); display: flex; align-items: center; justify-content: center; z-index: 100; cursor: pointer; backdrop-filter: blur(3px); }
.start div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.start b { font-size: 28px; letter-spacing: .2em; }
.start span { color: var(--dim); }
#toast { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%); background: var(--fill2); padding: 7px 14px; border-radius: 7px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; }
#toast.show { opacity: 1; }
#toast.err { background: #4a1620; }
.menu { position: fixed; background: var(--fill); border-radius: 8px; padding: 4px; z-index: 80; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); min-width: 180px; }
.menu div { padding: 6px 10px; border-radius: 5px; cursor: pointer; }
.menu div:hover { background: var(--fill2); }
.menu small { display: block; color: var(--dim); }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: var(--fill2); border-radius: 4px; } ::-webkit-scrollbar-track { background: transparent; }

/* ---------- swap browser */
.swap { position: fixed; z-index: 90; background: var(--panel2); border-radius: 10px; box-shadow: 0 24px 70px rgba(0, 0, 0, .65); display: flex; flex-direction: column; max-height: 440px; }
.swap-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px 8px; }
.swap-head b { font-size: 12.5px; }
.swap-head input { width: 210px; }
.swap-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 4px 10px; padding: 0 12px; overflow-y: auto; min-height: 0; }
.swap-col .label { position: sticky; top: 0; background: var(--panel2); padding: 4px 0; }
.swap-type { display: flex; align-items: center; gap: 6px; font-weight: 600; margin: 8px 0 2px; color: var(--dim); }
.swap-row { padding: 3px 8px 3px 20px; border-radius: 5px; cursor: pointer; }
.swap-row:hover { background: var(--fill); }
.swap-row.focus { background: var(--fill2); }
.swap-row.on { color: var(--accent); font-weight: 600; }
.swap-row.on::before { content: '●'; font-size: 7px; margin-left: -12px; margin-right: 6px; vertical-align: 2px; }
.swap-info { padding: 8px 12px 0; color: var(--dim); min-height: 28px; line-height: 1.4; }
.swap-foot { display: flex; align-items: center; gap: 6px; padding: 8px 12px 10px; }
.swapbtn { background: var(--fill); color: var(--text); font-weight: 600; }
.swapbtn:hover { background: var(--accent); color: #fff; }
.nm .sw-ic { visibility: hidden; margin-left: 4px; padding: 0 5px; font-size: 11px; background: var(--fill2); border-radius: 4px; color: var(--dim); }
.rrow:hover .nm .sw-ic, .rrow.sel .nm .sw-ic { visibility: visible; }
.nm .sw-ic:hover { background: var(--accent); color: #fff; }
.rrow.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
#rack.drop-new { box-shadow: inset 0 0 0 2px var(--ok); }

/* Project navigation is always visible, separate from the music transport. */
body { grid-template-rows: 46px 58px 1fr 24px; }
.logo { font-size: 13px; letter-spacing: -.025em; font-weight: 650; white-space: nowrap; gap: 8px; }
.logo img { display: block; }
.brand-light { color: var(--dim); font-weight: 450; }
#projectbar { display: flex; gap: 14px; align-items: center; padding: 0 16px; background: #101319; border-top: 1px solid var(--line); border-bottom: 1px solid #2b2530; }
.library-button { display: flex; gap: 9px; align-items: center; font-size: 12px; font-weight: 600; padding: 9px 12px; background: #27212d; color: #ffb6d1; }
.shortcut { font: 10px var(--mono); color: #a18b98; margin-left: 12px; }
.project-divider { width: 1px; height: 27px; background: var(--line); }
.current-project { display: grid; grid-template-columns: minmax(120px, 300px) 16px; column-gap: 12px; text-align: left; background: transparent; padding: 4px 8px; }
.current-project .label { grid-column: 1; font-size: 8px; color: var(--dim); }
.project-title { grid-column: 1; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.current-project > .dim { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.save-state { font-size: 10px; color: var(--ok); }
.save-warning { color: var(--warn); }
.new-project { padding: 8px 12px; border: 1px solid #3a303d; background: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.project-dialog { width: min(660px, calc(100vw - 48px)); max-height: 85vh; padding: 0; border: 1px solid #36313e; border-radius: 14px; background: #12161c; color: var(--text); box-shadow: 0 28px 100px #0009; }
.project-dialog::backdrop { background: #05070bb8; backdrop-filter: blur(5px); }
.library-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 26px 28px 18px; }
.library-header .label { color: #be8ca1; }
.library-header h1 { font-size: 25px; letter-spacing: -.035em; font-weight: 600; margin: 6px 0; }
.library-header p { color: var(--dim); margin: 0; font-size: 12px; }
.library-content { padding: 0 28px 16px; }
.library-tools { display: flex; gap: 12px; padding: 6px 0 18px; }
.library-tools input { flex: 1; min-width: 0; padding: 10px 12px; background: #1b2028; border: 1px solid #2e3440; border-radius: 7px; }
.library-tools button { padding: 10px 14px; }
.project-list { max-height: 42vh; overflow-y: auto; display: grid; gap: 8px; }
.project-card { display: flex; gap: 14px; align-items: center; width: 100%; padding: 15px; border: 1px solid #252c36; background: #181d25; text-align: left; white-space: normal; border-radius: 8px; }
.project-card.is-current { border-color: #705066; background: #231e29; }
.project-art { color: #e19bb6; font-size: 22px; width: 28px; text-align: center; }
.project-info { display: grid; gap: 5px; flex: 1; min-width: 0; }
.project-info strong { font-size: 14px; font-weight: 550; overflow-wrap: anywhere; }
.project-info small { font-size: 10px; }
.project-card-end { display: grid; gap: 8px; text-align: right; color: #e3b9ca; }
.library-footer { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding: 15px 28px; color: var(--dim); font-size: 11px; }
.library-error { color: var(--bad); margin: 0 28px 14px; }
.library-error:empty { display: none; }
.new-project-form { display: grid; gap: 12px; padding-bottom: 8px; }
.new-project-form h2 { font-size: 20px; margin: 2px 0 8px; font-weight: 550; }
.new-project-form label { color: var(--dim); }
.new-project-form input, .new-project-form select { padding: 11px; font-size: 13px; }
.new-project-form .primary { justify-self: end; padding: 10px 18px; margin-top: 8px; }
.back-library { justify-self: start; }
.template-description { color: var(--dim); margin: 0; min-height: 30px; }
.empty-projects { text-align: center; padding: 30px; color: var(--dim); }
.start b { font-size: 28px; letter-spacing: -.035em; font-weight: 550; }
@media (max-width: 1350px) { #top { gap: 9px; } .mmeter { grid-template-columns: 70px auto; } #top .pos { font-size: 15px; min-width: 72px; } .save-state { margin-left: 0; } }
@media (max-height: 850px) {
  #center { grid-template-rows: minmax(120px, 30vh) minmax(180px, 1fr) minmax(140px, 24vh); }
  #rack { max-height: none; }
  #right { grid-template-rows: 1fr minmax(160px, 24vh); }
}
/* Keep the toolbar above, rather than on top of, the piano-roll canvas. */
#roll .toolbar { height: 36px; min-height: 36px; white-space: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
#roll .toolbar > * { flex-shrink: 0; }
#roll .toolbar > b { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
