:root {
  --bg: #16181d;
  --panel: #1d2027;
  --line: #2c313c;
  --text: #c9ced8;
  --dim: #7d8494;
  --accent: #5aa9ff;
  --variant: #ffb454;
  --rec: #ff5c5c;
  font: 12px/1.4 system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
button, select, input, textarea { font: inherit; color: var(--text); background: #262a33; border: 1px solid var(--line); border-radius: 4px; }
button.tb, a.tb { padding: 3px 8px; cursor: pointer; white-space: nowrap; color: var(--text); background: #262a33; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.tb:hover { border-color: var(--accent); }
button.tb.on { background: #24384f; border-color: var(--accent); color: #fff; }
button.tb.rec { background: #4a2020; border-color: var(--rec); color: var(--rec); }
button.tb.sm { padding: 1px 5px; font-size: 11px; }
.dim { color: var(--dim); }

#transport { height: 38px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
#transport .pos { font: 600 14px ui-monospace, monospace; min-width: 56px; text-align: center; }
#transport .info { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
#transport .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
#transport .params { width: 150px; padding: 3px 6px; }
#transport .status { color: var(--variant); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }

#main { display: grid; grid-template-columns: 1fr clamp(220px, var(--side-w, 340px), calc(100% - 480px)); height: calc(100% - 38px); }
#side { position: relative; background: var(--panel); overflow: hidden; display: flex; flex-direction: column; border-left: 1px solid var(--line); min-height: 0; }
#chat, #browser { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
#chat[hidden], #browser[hidden] { display: none; }
.sidetabs { display: flex; border-bottom: 1px solid var(--line); }
.sidetabs .tab { flex: 1; border: none; border-radius: 0; background: transparent; padding: 8px 0; color: var(--dim); cursor: pointer; font-weight: 600; border-bottom: 2px solid transparent; }
.sidetabs .tab.on { color: var(--text); border-bottom-color: var(--accent); }
.sidetabs .tab:hover { color: var(--text); }
#center { display: grid; grid-template-rows: 1fr 32px clamp(90px, var(--bottom-h, 260px), calc(100% - 222px)); min-width: 0; }
#arrange-wrap, #roll-wrap { position: relative; overflow: hidden; min-height: 0; }
#roll-wrap { border-top: 1px solid var(--line); }
/* pane dividers (web/lib/split.js) */
.split { position: absolute; z-index: 20; touch-action: none; }
.split[data-split="side"] { left: 0; top: 0; bottom: 0; width: 5px; cursor: col-resize; }
.split[data-split="bottom"] { left: 0; right: 0; top: 0; height: 5px; cursor: row-resize; }
.split:hover, .split.on { background: var(--accent); opacity: 0.6; }
#arrange-wrap canvas { position: absolute; left: 0; top: 0; }
#center > #trackview, #center > #arrange-wrap, #center > #mixview { grid-row: 1; grid-column: 1; }
#trackview { display: flex; min-height: 0; overflow: hidden; background: var(--bg); }
#trackview[hidden], #arrange-wrap[hidden], #mixview[hidden] { display: none; }
#mixview { position: relative; overflow: hidden; min-height: 0; background: #15171c; }
.mix-canvas { position: absolute; left: 0; top: 0; outline: none; touch-action: none; }
.mix-hint { position: absolute; left: 10px; bottom: 6px; font-size: 10px; pointer-events: none; }
.tv-panel { width: 236px; flex: none; background: #1b1e25; border-right: 1px solid var(--line); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.tv-wrap { flex: 1; min-width: 0; position: relative; }
.tv-canvas { position: absolute; inset: 0; outline: none; display: block; }
.tv-back { align-self: flex-start; }
.tv-name { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.tv-name strong { cursor: text; }
.tv-btns, .tv-mix { display: flex; gap: 4px; }
.tv-mix .dragnum { flex: 1; }
.tv-sec { margin-top: 8px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.tv-lane { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.tv-lane .tv-dot { color: #ff6b6b; font-size: 8px; }
.tv-lane.off .tv-dot { color: var(--dim); }
.tv-lane .tv-lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-dev { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 6px; font-size: 11px; text-align: left; background: #20232a; border: 1px solid var(--line); border-radius: 4px; color: var(--text); cursor: pointer; }
.tv-dev:hover { border-color: #4a5468; }
.tv-dev .tv-dot { color: var(--dim); }
.tv-dev .tv-lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-dev .tv-count { color: #ff9b9b; font-size: 10px; }
.tv-dev.on { background: #3a2226; border-color: #ff6b6b; }
.tv-dev.on .tv-dot { color: #ff6b6b; }
.autobtn.on { background: #3a2226; border-color: #ff6b6b; color: #ffb0b0; }
.tv-panel .small { font-size: 10px; line-height: 1.4; }
.tv-help { margin-top: auto; }

.mixhead, .panelhead { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.mixhead strong { margin-right: auto; }
.mixlist { overflow-y: auto; }
.mixrow { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.mixtop { display: flex; gap: 4px; align-items: center; }
.mixtop .mixname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mixsliders { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 4px; align-items: center; }
.mixsliders input { width: 100%; min-width: 0; }
.mixrow select { width: 100%; }

.chatlog { flex: 1 1 50%; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.msg { white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: #24384f; padding: 6px 9px; border-radius: 8px; max-width: 90%; }
.msg.tool { color: var(--dim); font: 11px ui-monospace, monospace; }
.msg.tool.err, .msg.error { color: var(--rec); }
.msg.info { color: var(--variant); }
#chat textarea { margin: 0 10px; resize: none; padding: 6px; }
#chat textarea.busy { opacity: 0.6; }
.cost { padding: 4px 10px; font-size: 11px; }
.cards { flex: 1 1 50%; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.card { border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: #1a1d23; }
.card.on { border-color: var(--variant); }
.card .why { color: var(--dim); margin: 4px 0 6px; font-size: 11px; }
.card .chords { font-weight: 600; margin-top: 4px; }
.card .btns { display: flex; gap: 6px; }

.perf { position: fixed; right: 350px; bottom: 270px; background: rgba(0, 0, 0, 0.75); color: #9ef0a8; font: 11px ui-monospace, monospace; padding: 6px 8px; border-radius: 4px; white-space: pre; pointer-events: none; z-index: 10; }

dialog.export { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; width: 560px; max-width: 90vw; padding: 16px 20px; }
dialog.export::backdrop { background: rgba(0, 0, 0, 0.5); }
dialog.export h3 { margin: 0 0 10px; }
dialog.export .opt { display: block; margin: 4px 0; }
dialog.export .btns { display: flex; gap: 8px; margin: 12px 0; }
dialog.export a.tb { text-decoration: none; display: inline-block; }
dialog.export .small { font-size: 11px; margin-top: 8px; }
dialog.export .path { word-break: break-all; }
dialog.export .files { max-height: 160px; overflow-y: auto; margin: 6px 0; padding-left: 18px; font: 11px ui-monospace, monospace; color: var(--dim); }
dialog.export .warn { color: var(--variant); margin: 4px 0; }
dialog.export .midi-buttons { width: 100%; border-collapse: collapse; margin-top: 6px; }
dialog.export .midi-buttons td { padding: 3px 4px; vertical-align: middle; }
dialog.export .midi-buttons td:last-child { text-align: right; white-space: nowrap; }
dialog.export .row { display: flex; gap: 16px; flex-wrap: wrap; margin: 6px 0; }
dialog.export select { margin-left: 4px; }
dialog.export hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

#cliptools { display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--panel); border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
#cliptools .target { min-width: 0; max-width: 300px; overflow: hidden; text-overflow: ellipsis; margin-right: 6px; }
#cliptools .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
#cliptools .num { width: 62px; padding: 2px 4px; }
#cliptools select { padding: 1px 2px; }
.toasts { position: fixed; top: 46px; right: 350px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; z-index: 50; pointer-events: none; }
.toast { pointer-events: auto; cursor: pointer; padding: 8px 14px; border-radius: 6px; background: #24384f; border: 1px solid var(--accent); color: #fff; max-width: 440px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); }
.toast.error { background: #4a2020; border-color: var(--rec); }
.toast.ok { background: #1f3a2c; border-color: #3fb37f; }

#transport .meter { width: 70px; height: 8px; background: #11131a; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; display: none; }
#transport .meter .bar { display: block; height: 100%; width: 0; background: #3fb37f; transition: width 60ms linear; }
#transport .meter.hot .bar { background: var(--rec); }
.mixinput { display: flex; align-items: center; gap: 4px; }
.mixinput select { flex: 1; }

#cliptools .tabs { display: flex; gap: 2px; margin-right: 6px; }
#devices { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.devcard.mixer { flex-basis: 150px; border-color: #3a4a6a; }
.devcard.mixer .mixrow { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 6px; margin: 6px 0; font-size: 11px; }
.devcard.mixer .mixrow.auto .pl { color: #ff8a8a; }
#devices[hidden] { display: none; }
.devhead { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.devhead .small { font-size: 11px; }
.devcards { flex: 1; display: flex; gap: 8px; padding: 8px 10px; overflow-x: auto; overflow-y: hidden; align-items: flex-start; }
.devcards .empty { padding: 20px; }
.devcard { flex: 0 0 210px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; max-height: 100%; overflow-y: auto; }
.devcard.off { opacity: 0.5; }
.devtitle { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.devtitle .grow { flex: 1; }
.power.on { color: #3fb37f; border-color: #3fb37f; background: #1f3a2c; }
/* a setting that doesn't apply now (e.g. a delay time while sync is on); a synced time shown read-only */
.prm.idle { opacity: 0.45; }
.prm .syncv { font: 11px ui-monospace, monospace; padding: 4px 6px; text-align: center; color: var(--dim); }
.prm { display: grid; grid-template-columns: 64px 1fr 58px; align-items: center; gap: 4px; font-size: 11px; margin: 2px 0; }
.prm select { grid-column: 2 / 4; font-size: 11px; }
.prm .pl { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prm .pv { text-align: right; font: 10px ui-monospace, monospace; }
.prm input[type="range"] { width: 100%; min-width: 0; }
.devmeter { font: 10px ui-monospace, monospace; margin: 2px 0 4px; position: relative; padding-left: 2px; }
.devmeter::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: var(--gr, 0); background: #ffb454; }

/* Track headers (mixer per lane) */
#trackheads { position: absolute; left: 0; top: 102px; width: 236px; bottom: 0; overflow: hidden; z-index: 2; background: #1b1e25; border-right: 1px solid var(--line); }
.th-inner { will-change: transform; }
/* the Automation view's rows in the header column */
.th-lane { display: flex; align-items: center; gap: 4px; padding: 0 6px 0 22px; border-bottom: 1px solid var(--line); background: #15171c; font-size: 11px; }
.th-lane .th-lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ff9b9b; }
.th-lane.off .th-lname { color: var(--dim); text-decoration: line-through; }
.th-masterrow { display: flex; align-items: center; gap: 6px; padding: 0 6px; border-bottom: 1px solid var(--line); background: #1d2027; font-weight: 600; }
.th-addlane { max-width: 80px; font-size: 11px; }
.th-row { box-sizing: border-box; padding: 5px 8px 4px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; position: relative; cursor: default; user-select: none; background: #1d2027; }
.th-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.th-row.sel { background: #242c3b; }
.th-row.sel::before { background: var(--accent); }
.th-row.armed::before { background: var(--rec); }
.th-row::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 3px; background: var(--tc, transparent); }
.th-row.in-group { padding-left: 18px; }
.th-row.in-group .th-top::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--gc-in, #3a3f4b); }
.th-group { box-sizing: border-box; display: flex; align-items: center; gap: 5px; padding: 0 6px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--gc); background: color-mix(in srgb, var(--gc) 16%, #1b1e25); user-select: none; font-size: 12px; }
.th-group.sel { background: color-mix(in srgb, var(--gc) 28%, #242c3b); }
.th-group .th-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.th-fold { background: none; border: 0; color: var(--text); cursor: pointer; width: 16px; padding: 0; font-size: 11px; }
.th-swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid #0006; padding: 0; cursor: pointer; flex: none; background: var(--gc, #8b93a5); }
.th-swatch.t { background: var(--tc, transparent); border: 1px dashed #5a6070; }
.th-row:not(.own-color) .th-swatch.t { opacity: 0.55; }
.th-row.own-color .th-swatch.t { border-style: solid; }
.th-gmenu { padding: 0 5px; }
.colorpick { position: fixed; z-index: 1000; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 8px; box-shadow: 0 6px 24px #0008; width: 196px; }
.colorpick .sw { display: grid; grid-template-columns: repeat(8, 20px); gap: 4px; margin-bottom: 8px; }
.colorpick .sw button { width: 20px; height: 20px; border-radius: 4px; border: 1px solid #0006; padding: 0; cursor: pointer; }
.colorpick .sw button.cur { outline: 2px solid #fff; outline-offset: 1px; }
.colorpick .row { display: flex; gap: 6px; align-items: center; }
.colorpick input[type=color] { width: 32px; height: 24px; padding: 0; border: 0; background: none; }
.colorpick input.hex { width: 74px; font: 12px ui-monospace, monospace; }
.colorpick .err { color: var(--rec); font-size: 11px; min-height: 13px; }
.th-row.dragging { z-index: 3; opacity: 0.85; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
.th-top, .th-bot { display: flex; align-items: center; gap: 4px; }
.th-type { width: 16px; text-align: center; font-size: 12px; color: var(--dim); }
.th-type.audio { color: #6fd3c4; }
.th-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.th-row.sel .th-name { color: #fff; }
.th-rename { flex: 1; min-width: 0; padding: 0 4px; font-size: 12px; }
.th-row button.tb.sm { width: 22px; padding: 1px 0; text-align: center; }
.th-row button.on.mute { background: #4a4020; border-color: #e0b84a; color: #ffd76a; }
.th-row button.on.solo { background: #20384a; border-color: var(--accent); }
.th-meter { flex: 1; height: 6px; background: #11131a; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.th-meter .lvl { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3fb37f 0%, #3fb37f 75%, #e0c050 92%, #ff5c5c 100%); background-size: 160px 100%; }
.th-meter.in { border-color: #7a3a3a; }
.th-meter.hot .lvl { background: var(--rec); }

/* Drag-number boxes */
.dragnum { display: inline-block; min-width: 38px; padding: 0 4px; height: 18px; line-height: 16px; text-align: center; font: 11px ui-monospace, monospace; background: #262a33; border: 1px solid var(--line); border-radius: 3px; cursor: ns-resize; user-select: none; touch-action: none; }
.dragnum:hover, .dragnum:focus { border-color: var(--accent); outline: none; }
.dragnum.drag { background: #24384f; border-color: var(--accent); color: #fff; }
.dragnum-edit { width: 34px; height: 14px; padding: 0; border: none; background: transparent; text-align: center; font: 11px ui-monospace, monospace; outline: none; }

/* Context menus */
.ctxmenu { position: fixed; z-index: 100; min-width: 210px; background: #22262f; border: 1px solid #3a404d; border-radius: 6px; padding: 4px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55); }
.ctxmenu .item { display: grid; grid-template-columns: 16px 1fr auto; gap: 6px; width: 100%; text-align: left; border: none; background: transparent; padding: 4px 8px; border-radius: 4px; cursor: pointer; }
.ctxmenu .item:hover, .ctxmenu .item:focus { background: #2f4a6b; outline: none; }
.ctxmenu .item:disabled { color: #5b616e; cursor: default; background: transparent; }
.ctxmenu .hint { color: var(--dim); font-size: 11px; }
.ctxmenu .chk { color: var(--accent); }
.ctxmenu .sep { height: 1px; background: var(--line); margin: 4px 6px; }
.ctxmenu .hdr { padding: 3px 8px; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }

dialog.help table { border-collapse: collapse; margin: 6px 0 12px; }
dialog.help td { padding: 3px 12px 3px 0; vertical-align: top; }
dialog.help td:first-child { font: 11px ui-monospace, monospace; color: var(--accent); white-space: nowrap; }
.devcard.inst select { width: 100%; }

/* Browser */
.bhead { padding: 8px 10px 6px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line); }
.bsearch { width: 100%; padding: 5px 8px; }
.bchips { display: flex; gap: 4px; flex-wrap: wrap; }
.blist { flex: 1; overflow-y: auto; padding: 4px 0; outline: none; }
.bgroup { position: sticky; top: 0; background: var(--panel); padding: 6px 12px 2px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dim); z-index: 1; }
.bitem { display: flex; align-items: center; gap: 8px; padding: 3px 12px; cursor: grab; user-select: none; }
.bitem:hover { background: #262b35; }
.bitem.active { background: #24384f; }
.bitem .bicon { width: 16px; text-align: center; color: var(--dim); font-size: 11px; }
.bitem.effect .bicon { color: #c79bff; }
.bitem.instrument .bicon { color: #6fd3a0; }
.bitem .bname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bitem .bfav { color: #4a505c; cursor: pointer; font-size: 12px; visibility: hidden; }
.bitem:hover .bfav, .bitem .bfav.on { visibility: visible; }
.bitem .bfav.on { color: #ffcf4a; }
.btarget { padding: 4px 12px; border-top: 1px solid var(--line); font-size: 11px; }
.bhint { padding: 2px 12px 8px; font-size: 10px; line-height: 1.35; }
.blist .empty { padding: 16px 12px; }
body.dragging-item #trackheads { outline: 1px dashed #3d6ea8; outline-offset: -1px; }
.th-row.drop { background: #24384f; box-shadow: inset 0 0 0 1px var(--accent); }
#devices.drop { box-shadow: inset 0 0 0 2px var(--accent); }

/* Instrument rack card */
.devcard.rack { flex-basis: 250px; border-color: #3a5a48; }
.rack .layer { border-top: 1px solid var(--line); padding: 5px 0 3px; display: flex; flex-direction: column; gap: 4px; }
.rack .layer.main { border-top: none; flex-direction: row; align-items: center; gap: 4px; }
.rack .layer.off { opacity: 0.5; }
.rack .lrow { display: flex; align-items: center; gap: 4px; }
.rack .lrow.small { padding-left: 26px; }
.rack select.inst { flex: 1; min-width: 0; font-size: 11px; }
.rack .dragnum { min-width: 0; font-size: 10px; padding: 0 3px; }
.rack .dragnum.key { width: 34px; }

.bplugins { padding: 6px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.bplugins[hidden] { display: none; }
.bplugdir { display: flex; align-items: center; gap: 6px; }
.bplugdir code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.bplug.err { color: var(--rec); }
.bplugins .small { font-size: 10px; line-height: 1.35; }
.devcard.missing { border-color: #6a3a3a; }
.devcard .small { font-size: 11px; }

.th-auto { flex: 1; min-width: 0; font-size: 11px; padding: 0 2px; height: 20px; color: #ffb0b0; }
#transport button.tb.on.auto { background: #4a2430; border-color: #ff6b6b; color: #ffb0b0; }

.prm.auto .pl { color: #ff8a8a; }
.prm.auto .pl::before { content: "● "; font-size: 8px; vertical-align: 1px; }
.ctxform { padding: 6px 10px 8px; min-width: 220px; }
.ctxform .frow { display: grid; grid-template-columns: 1fr 110px; align-items: center; gap: 8px; margin: 4px 0; }
.ctxform .frow.chk { grid-template-columns: 1fr auto; }
.ctxform .frow input.num, .ctxform .frow select { width: 100%; padding: 2px 4px; }
.ctxform .fbtns { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }

#songbox { position: absolute; left: 0; top: 0; width: 150px; height: 102px; z-index: 2; padding: 5px 8px; display: flex; flex-direction: column; gap: 4px; background: #1b1e25; }
#songbox > div { display: flex; align-items: center; gap: 4px; }
#songbox .dragnum.bpm { min-width: 44px; font-size: 12px; height: 20px; line-height: 18px; color: #ffd76a; }
#songbox .meterbtn { font: 12px ui-monospace, monospace; margin-left: auto; }
#songbox .keysel { width: 100%; font-size: 11px; }

.devcard.wide { flex-basis: 400px; }
.ceq-wrap { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
.ceq { border-radius: 4px; cursor: crosshair; touch-action: none; }
.ceq-read { font: 10px ui-monospace, monospace; min-height: 13px; }

.tv-tune { display: flex; flex-direction: column; gap: 6px; }
.tv-tune .tv-btns { flex-wrap: wrap; align-items: center; }
.tv-lbl { margin-right: 2px; }
.tv-slider { display: grid; grid-template-columns: 52px 1fr 48px; align-items: center; gap: 6px; font-size: 11px; color: var(--dim, #8b93a1); }
.tv-slider input { width: 100%; min-width: 0; accent-color: #ffb454; }
.tv-slider input:disabled { opacity: 0.35; }
.tv-slider output { text-align: right; font-variant-numeric: tabular-nums; color: #d7dbe2; }
.tv-check { font-size: 11px; color: #d7dbe2; display: flex; align-items: center; gap: 4px; }

/* An app, not a document: ⌘A and drags never select page text (chat, inputs and toasts stay selectable). */
body { user-select: none; -webkit-user-select: none; }
input, textarea, .msg, .toast, .help-body { user-select: text; -webkit-user-select: text; }
.binst { padding: 6px 12px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.binst[hidden] { display: none; }
.binst .small { flex-basis: 100%; font-size: 10px; line-height: 1.35; }
#browser.drop { box-shadow: inset 0 0 0 2px var(--accent); }
.th-type.bus { color: #c79bff; }
.th-noarm { display: inline-block; width: 22px; }

/* Fader-style value boxes: the fill shows where the value sits (bottom = min). */
.dragnum { position: relative; overflow: hidden; vertical-align: middle; }
.dn-fill { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(90,169,255,0.24); pointer-events: none; }
.dragnum.drag .dn-fill { background: rgba(90,169,255,0.4); }
.dn-text { position: relative; }
/* Pan: a bar along the bottom from the centre towards the panned side; a centre mark. */
.dn-pan { position: absolute; bottom: 0; height: 3px; background: #5aa9ff; pointer-events: none; }
.dragnum.pan-ind::after { content: ""; position: absolute; left: calc(50% - 0.5px); bottom: 0; width: 1px; height: 5px; background: #c3cad6; pointer-events: none; }
.dragnum.pan-ind { box-shadow: inset 0 -3px 0 #1b1e25; }
.dragnum.big { height: 26px; line-height: 24px; }
/* Effect parameters as fader tiles. */
.prms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.prm.tile { display: flex; flex-direction: column; gap: 2px; width: 60px; margin: 0; }
.prm.tile .pl { font-size: 10px; text-align: center; }
.prm.tile.auto .pl { color: #ff8a8a; }
.prm.tile .dragnum { display: block; height: 30px; line-height: 28px; min-width: 0; padding: 0 2px; font-size: 10px; }
.prm.tile.auto .dragnum { border-color: #a04848; }
.dragnum.big { min-width: 74px; }

/* Fixed widths: the box never resizes as the value's text changes. */
.dragnum { box-sizing: border-box; white-space: nowrap; }
.dragnum.vol { width: 46px; min-width: 0; padding: 0 2px; }
.dragnum.vol.unit { width: 68px; }
.dragnum.pan { width: 42px; min-width: 0; padding: 0 2px; }
/* A small label above a control (volume, pan), like the effect tiles. */
.ctl { display: flex; flex-direction: column; align-items: stretch; gap: 1px; }
.ctl .cl { font-size: 9px; line-height: 9px; color: var(--dim); text-align: center; }
.th-bot { align-items: flex-end; }
.th-bot .th-meter { margin-bottom: 6px; }
.th-row { padding-top: 4px; padding-bottom: 3px; }
.tv-mix .ctl { flex: 1; }
.tv-mix .dragnum { width: 100%; }
.prm.tile .dragnum.vol, .prm.tile .dragnum.pan { width: 100%; }
.prm.tile.mixtile { width: 72px; }
.devcard.mixer { flex-basis: 176px; }

/* Projects dialog */
dialog.projects { width: 620px; }
.pdlg .pcur { margin-bottom: 10px; }
.pdlg .pcur .err { color: var(--rec); }
.pdlg .pbtns { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.pdlg .pbtns.end { justify-content: flex-end; }
.pdlg .plist { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; max-height: 300px; overflow-y: auto; }
.pdlg .prow { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: #20232a; border: 1px solid var(--line); border-radius: 4px; }
.pdlg .prow.cur { border-color: var(--accent); }
.pdlg .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdlg .tb.danger { color: #ff9b9b; }
dialog.history { width: 640px; }
.hdlg .hlist { display: flex; flex-direction: column; gap: 3px; margin: 10px 0; max-height: 60vh; overflow-y: auto; }
.hdlg .hrow { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: #20232a; border: 1px solid var(--line); border-radius: 4px; }
.hdlg .hrow.now { border-color: var(--accent); }
.hdlg .hrow.undone .hwhat, .hdlg .hrow.meta .hwhat { opacity: 0.6; }
.hdlg .hrow.start { background: none; border-style: dashed; }
.hdlg .hwho { flex: 0 0 64px; font-size: 11px; color: var(--dim); }
.hdlg .hwho.llm { color: var(--variant); }
.hdlg .hwhat { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hdlg .hsub { margin: 4px 0 0; padding-left: 16px; font-size: 11px; }
.hdlg .linkish { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 11px; padding: 0; }
.hdlg .hrow .tb.sm { flex: none; }
#transport .tb.unsaved { border-color: var(--rec); color: #ff9b9b; }
.banner { position: fixed; left: 50%; top: 44px; transform: translateX(-50%); z-index: 50; max-width: 760px; display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; background: #3a2226; border: 1px solid #ff6b6b; border-radius: 6px; color: #ffd6d6; font-size: 12px; line-height: 1.45; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); }
input.secname { position: absolute; z-index: 5; box-sizing: border-box; font: 11px system-ui, sans-serif; padding: 0 4px; border: 1px solid var(--accent); border-radius: 3px; background: #1d2433; color: var(--text); }

/* In-page prompt/confirm (views/ask.js) */
dialog.askdlg { width: 420px; }
dialog.askdlg .askq { margin: 0 0 8px; white-space: pre-line; }
dialog.askdlg input.askin { width: 100%; box-sizing: border-box; margin: 4px 0 12px; padding: 6px 8px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; font: inherit; }
.pdlg code.pfolder { font-size: 11px; word-break: break-all; color: var(--text); }
/* native plugins (VST3) */
.devcard.plugin .prow { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.devcard.rack .layer.plugin { border-left: 3px solid var(--accent, #6e56cf); padding-left: 6px; margin-bottom: 4px; }
.bvst3 { margin-bottom: 8px; }
.bvst3 .bfolder { display: flex; align-items: center; gap: 4px; font-size: 11px; padding: 1px 0; }
.bvst3 .bfolder code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bvst3 .bfolder.err code { color: var(--err, #e5484d); }
.banner.info { background: #1d2a3a; border-color: var(--accent); color: #d6e6ff; }
.banner.info a { color: var(--accent); }
/* project tabs (web/views/tabs.js) */
#tabs { height: 30px; display: flex; align-items: stretch; gap: 1px; padding: 0 6px; background: var(--bg); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
#tabs .ptab { display: flex; align-items: center; gap: 6px; max-width: 220px; padding: 0 6px 0 12px; color: var(--dim); font-size: 12px; cursor: default; border-bottom: 2px solid transparent; white-space: nowrap; }
#tabs .ptab span { overflow: hidden; text-overflow: ellipsis; }
#tabs .ptab:hover { color: var(--text); background: var(--panel); }
#tabs .ptab.on { color: var(--text); background: var(--panel); border-bottom-color: var(--accent); }
#tabs .ptab.unsaved span { font-style: italic; }
#tabs .x, #tabs .add { border: 0; background: none; color: var(--dim); font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 3px; cursor: pointer; }
#tabs .x { visibility: hidden; }
#tabs .ptab:hover .x, #tabs .ptab.on .x { visibility: visible; }
#tabs .x:hover, #tabs .add:hover { color: var(--text); background: var(--line); }
#tabs .add { align-self: center; margin-left: 4px; }
body.tabbed #main { height: calc(100% - 38px - 31px); }

/* hints (views/hints.js): a quiet card in the corner, and a ring for "Show me" */
.hint { position: fixed; left: 16px; bottom: 16px; z-index: 60; width: 320px; max-width: calc(100vw - 32px); padding: 12px 14px 10px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); font-size: 12px; line-height: 1.45; color: var(--text); opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; }
.hint.in { opacity: 1; transform: none; }
.hint p { margin: 0 18px 8px 0; }
.hint .row { display: flex; gap: 6px; align-items: center; }
.hint .off { margin-left: auto; background: none; border: 0; color: var(--dim); font-size: 11px; cursor: pointer; padding: 2px; }
.hint .off:hover { color: var(--text); text-decoration: underline; }
.hint .x { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: var(--dim); font-size: 15px; cursor: pointer; }
.hint-glow { animation: hint-glow 1.1s ease-in-out 4; outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes hint-glow { 50% { outline-color: transparent; box-shadow: 0 0 0 6px rgba(90, 169, 255, 0.25); } }
.hint-settings { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin: 12px 0; padding-top: 10px; border-top: 1px solid var(--line); }
