/* The tokens every stylesheet draws from.
   Surfaces, darkest first: the page, a well (focused fields, steppers), the editors' stage, plots and timelines, panels,
   raised panels (popovers, menus), raised chips (tabs) and their hover.
   Text, strongest first: text, values (-2), controls' words and glyphs (-3), secondary numbers (-4), small-caps labels,
   muted, faint (axis and key hints).
   White overlays for fills and lines on any surface, faintest first. Hues: the accent, mint and rose, and the sand of a
   pressed mute; their alphas are written in place as color-mix(in srgb, var(--hue) N%, transparent). */
:root{color-scheme:dark;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text);font-size:13px;
  --bg:#0e0d0c;--sunken:#100f0d;--stage:#131210;--surface-1:#141311;--panel:#1b1917;--panel-raised:#201d19;--surface-2:#24221f;--raised-hover:#2c2925;
  --text:#f6f4e9;--text-2:#e6dfd1;--text-3:#ddd7ca;--text-4:#c4bfb2;--label:#bdb7aa;--muted:#a8a397;--faint:#8b8578;
  --fill-1:#ffffff06;--fill-2:#ffffff0a;--fill-3:#ffffff10;--line:#ffffff14;--edge:#ffffff1a;--edge-2:#ffffff20;--edge-3:#ffffff26;--edge-strong:#ffffff30;
  --accent:#f5a847;--mint:#4adbad;--rose:#ed596b;--rose-soft:#f3a3ad;--record-ink:#ff9b94;--record-edge:#8d4946;--sand:#d6c794;--sand-hover:#e3d6a6;
  --selected-bg:color-mix(in srgb,var(--accent) 8%,transparent);--selected-edge:color-mix(in srgb,var(--accent) 40%,transparent);
  /* A text field whose edge is all that shows where it is: an edge of 3:1 or more on every surface a field sits on. */
  --field-edge:#726e66;
  /* A disabled control, wherever it is. */
  --disabled:.38;
  /* Focus: one amber ring; on a lane's colour (pads, grips, a block's own controls) a light ring over a dark halo. */
  --focus-ring:2px solid var(--accent);--focus-ring-on-colour:2px solid var(--text);--focus-halo:inset 0 0 0 3px color-mix(in srgb,var(--bg) 80%,transparent);
  --mono:ui-monospace,SFMono-Regular,Menlo,monospace;--gutter:18px;--control:34px}
*{box-sizing:border-box}html{scroll-padding-top:var(--bar-scroll-padding,84px)}
/* The hidden attribute always hides, whatever display a component's own rule gives it. */
[hidden]:not([hidden=until-found]){display:none!important}
/* Reduced motion, once for the page: every animation and transition ends at once. The few rules that still name
   reduced motion keep a still state the page needs (an opening tray that never starts, a take still marked as cued). */
@media (prefers-reduced-motion:reduce){*,::before,::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
/* Native caret reveals must not scroll the page while typing in the pinned bar.
   Explicit musical navigation supplies its own clearance in revealInPage(). */
html:has(#bar :is(input,textarea):focus){scroll-padding-top:0px}body{margin:0;padding:var(--gutter)}main{max-width:1280px;margin:auto}
h1{margin:0}h2{font-size:14px;font-weight:600;margin:0 0 12px}p{line-height:1.6}
/* The small-caps label: one size, weight, tracking and colour for every group, section and row label (and the
   editors' kickers, which keep their mono face). Track names in their lane's colour are names, not labels. */
.block-editor h3,.section-editor h3,.block-editor-group-title,.deck-group-title,.instrument .instrument-subhead,.instrument-scope,.keypad-title,.clip-editor .clip-editor-strip-label,.clip-editor .clip-editor-step-title,.section-editor .section-editor-kicker,.clip-editor .clip-editor-kicker{font-size:10px;font-weight:500;letter-spacing:.4px;text-transform:uppercase;color:var(--label)}
button,select,input,textarea{font:inherit}button,select,input[type=number],input[type=text]{color:inherit;background:var(--fill-2);border:1px solid var(--edge);border-radius:8px;padding:7px 10px;box-shadow:none}button{cursor:pointer;white-space:nowrap;transition:background .14s,border-color .14s,color .14s}button:hover{background:var(--fill-3);border-color:var(--edge-strong)}button:active{background:var(--edge)}button:disabled{opacity:var(--disabled);cursor:default}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:var(--focus-ring);outline-offset:2px}label{color:var(--muted)}input[type=range]{accent-color:var(--accent)}
/* Placeholders read 4.5:1 or more on every field fill (the browser's own grey did not on a panel). */
::placeholder{color:var(--faint);opacity:1}
.import-label{display:inline-flex;align-items:center;gap:10px;cursor:pointer;font-size:11px;color:var(--muted)}
.import-button{display:inline-block;padding:5px 10px;border:1px solid var(--edge);border-radius:8px;background:var(--fill-2);color:var(--text);font-size:11px;transition:background .14s,border-color .14s}
.import-label:hover .import-button{background:var(--fill-3);border-color:var(--edge-strong)}
.import-label:focus-within .import-button{outline:var(--focus-ring);outline-offset:2px}
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.dropping{outline:2px dashed var(--accent);outline-offset:8px}

/* The pinned bar (UI pass 2026-11-17): the controls in one row with the gear at its right end; the command field
   across the row under it with its chevron under the gear; then the feedback line, the status at its right end under
   them. Groups of controls wrap whole on narrower windows.
   The body's gutter is folded into the bar so it meets the viewport's top and sides; its background and bottom edge
   run the full width as ink overflow (border-image), which never scrolls sideways. */
#bar{position:sticky;top:0;z-index:20;margin:calc(-1 * var(--gutter)) calc(-1 * var(--gutter)) 14px;padding:8px var(--gutter) 0;background:var(--bg);border-image:linear-gradient(0deg,var(--surface-2) 1px,var(--bg) 0) fill 0//0 100vmax}
.bar-controls{--group-gap:12px;display:flex;flex-wrap:wrap;align-items:center;gap:6px var(--group-gap);min-width:0}
.bar-brand{display:flex;align-items:center;gap:7px;flex:none;margin-right:-4px;font:600 16px/1 ui-rounded,"SF Pro Rounded",-apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:-.01em;white-space:nowrap}.brand-mark{width:22px;height:28px;display:flex;align-items:center;justify-content:center;flex:none;overflow:hidden}.brand-mark img{display:block;width:36px;height:36px;max-width:none;flex:none;mix-blend-mode:lighten}
.bar-group{flex:none;display:flex;align-items:center;gap:6px;min-width:0}
.bar-group>button,#settings,#command-toggle,#transport-reverb{flex:none;width:var(--control);height:var(--control);padding:0;display:grid;place-items:center;color:var(--text-3)}.bar-controls svg{width:17px;height:17px;display:block}
#play{background:var(--fill-3);border-color:var(--edge-strong);color:var(--text)}#play[aria-pressed=true]{background:var(--accent);color:var(--bg);border-color:color-mix(in srgb,var(--accent) 80%,transparent)}
#transport-reverb[aria-expanded=true],#settings[aria-expanded=true]{border-color:color-mix(in srgb,var(--accent) 50%,transparent);color:var(--accent)}
/* The status at a glance, beside the gear: grey while all is well, amber while audio or an edit gets ready, rose for
   trouble (the words show on the feedback line under it). */
.status-dot{order:2;flex:none;width:6px;height:6px;margin-left:auto;border-radius:50%;background:color-mix(in srgb,var(--muted) 44%,transparent)}#settings{order:2}
.status-dot[data-state=connected]{background:var(--text-4)}.status-dot:is([data-state=pending],[data-state=preparing]){background:var(--accent)}.status-dot:is([data-state=reopen],[data-state=error]){background:var(--rose)}
/* With a keyboard active, its timing and chord chips join the first row: the wordmark and the tempo's and loop's
   units make room for them, and the command field's tucked chevron gets the wordmark's room too. The chord chip shows
   from the start (a dash until the first chord), so playing never moves the bar; while a take records, its time takes
   the count-in's place. The row never wraps mid-take or mid-phrase. */
@media (width >= 600px){
  /* The wordmark steps out of sight, not out of the page: it stays the heading's text (the mark is decorative). */
  #bar:is(:has(#midi-timing:not([hidden])),:has(#command-panel[hidden])) .bar-wordmark{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  #bar:has(#midi-timing:not([hidden])) :is(.transport-tempo,.transport-loop) .transport-unit{display:none}
  #bar:has(#midi-timing:not([hidden])) #midi-chord[hidden]{display:inline-flex!important;color:var(--muted);font-weight:500;background:transparent}
  #bar:has(#midi-timing:not([hidden])) #midi-chord:empty::before{content:'—'}
}
#bar:has(#record-time:not([hidden])) #count-in{display:none}
/* Between the narrow layout and room for the song controls on the first row, the dot and the gear end the first row
   (transport and history) and the song controls and tools share the next, the loop's and volume's units set aside. */
@media (600px <= width < 900px){
  .song-meta,.bar-tools{order:3}
  .transport-loop .transport-unit,.transport-volume .transport-unit{display:none}
}
/* The song view's control (project-view.ts): "Song" and a chevron that turns while the open view shows. */
#project-toggle{width:auto;padding:0 7px 0 10px;display:inline-flex;align-items:center;gap:3px;font-size:12px;color:var(--text-3)}#project-toggle svg{width:14px;height:14px;transition:transform .16s}
#project-toggle[aria-expanded=true]{border-color:color-mix(in srgb,var(--accent) 50%,transparent);color:var(--accent)}#project-toggle[aria-expanded=true] svg{transform:rotate(180deg)}

/* The song controls (transport.ts): tempo field, loop stepper, master volume and the output meter, the reverb button. */
.transport-field{flex:none;display:inline-flex;align-items:center;gap:5px;height:var(--control);padding:0 8px;background:var(--fill-1);border:1px solid var(--edge);border-radius:8px;font:11px var(--mono);color:var(--text-4);font-variant-numeric:tabular-nums}.transport-unit{color:var(--muted);font-size:10px}
.transport-tempo{cursor:text}.transport-tempo input{width:5ch;padding:0;border:0;border-radius:0;background:transparent;font:13px var(--mono);text-align:right;appearance:textfield}.transport-tempo input::-webkit-inner-spin-button,.transport-tempo input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.transport-tempo input:focus-visible{outline:none}.transport-tempo:focus-within{outline:var(--focus-ring);outline-offset:2px}
.transport-loop button{width:22px;height:22px;padding:0;border:0;border-radius:6px;background:transparent;font-size:15px;line-height:1;color:inherit}.transport-loop button:hover{background:var(--line)}.transport-loop button[aria-disabled=true]{opacity:var(--disabled);cursor:default;background:transparent}.transport-loop output{min-width:2ch;text-align:center;font-size:13px;color:var(--text)}
.transport-volume input{width:76px;margin:0}.transport-volume output{min-width:3ch;text-align:right}.song-meta[aria-busy=true] .transport-field{border-color:color-mix(in srgb,var(--accent) 31%,transparent)}
.transport-meter{flex:none;width:36px;height:6px;border-radius:3px;background:var(--line);overflow:hidden}.transport-meter-fill{display:block;height:100%;background:var(--mint);transform:scaleX(0);transform-origin:left center}.transport-meter-hot .transport-meter-fill{background:var(--rose)}

/* The command field: its own row under the controls, the entry (⌘K inside it until it has focus, Run, ?) and the
   chevron that tucks it away. Tucked, the chevron joins the first row. Model and effort are behind the gear. */
.command-panel{order:5;flex:1 1 calc(100% - var(--control) - var(--group-gap));min-width:0}.command-entry{display:flex;align-items:center;gap:6px;min-height:var(--control);padding:2px 3px 2px 9px;background:var(--fill-1);border:1px solid var(--edge);border-radius:8px;min-width:0;transition:border-color .14s,background .14s}.command-entry:focus-within{background:var(--sunken);border-color:color-mix(in srgb,var(--accent) 65%,transparent)}.command-panel[data-state=sent] .command-entry{border-color:color-mix(in srgb,var(--accent) 40%,transparent)}
#command-toggle{order:6;align-self:flex-start;color:var(--muted)}#command-toggle:hover{color:var(--text)}#command-toggle svg{transition:transform .16s}#command-toggle[aria-expanded=false] svg{transform:rotate(180deg)}
.bar-controls:has(>#command-panel[hidden])>#command-toggle{order:1;align-self:center;margin-left:auto}.bar-controls:has(>#command-panel[hidden])>.status-dot{margin-left:0}
.command-key{flex:none;font:500 10px/1 var(--mono);color:var(--faint);border:1px solid var(--edge-2);border-radius:4px;padding:3px 4px}.command-entry:focus-within .command-key{visibility:hidden}
.command-entry textarea{flex:1;width:100%;min-width:0;resize:none;max-height:180px;padding:4px 2px;background:transparent;border:0;border-radius:0;font:12.5px/20px var(--mono);overflow:auto}.command-entry textarea:focus-visible{outline:none}
.command-entry button{flex:none;height:28px;padding:0 9px;font-size:12px;border-radius:6px}.command-entry #command-send{background:color-mix(in srgb,var(--accent) 13%,transparent);border-color:color-mix(in srgb,var(--accent) 40%,transparent);color:var(--accent);font-weight:600}.command-entry #command-send:hover{background:color-mix(in srgb,var(--accent) 22%,transparent)}.bar-controls .command-send-icon{display:none}
.command-entry:has(textarea[rows]:not([rows="1"])){align-items:flex-start}
/* While the field has the keyboard (or the pointer is on this strip): where "this" points and the field's keys, in a
   strip under the bar over the page, so the bar never changes height under a press and the feedback line stays in
   sight. Suggestions and results open under it; all three are placed against the bar (#bar is their containing
   block), as wide as the field. */
.command-panel{--command-context:52px;--command-left:var(--gutter);--command-right:calc(var(--gutter) + var(--control) + var(--group-gap))}
.command-context{display:none;position:absolute;left:var(--command-left);right:var(--command-right);top:calc(100% + 4px);z-index:31;box-sizing:border-box;height:var(--command-context);padding:4px 10px 5px;background:var(--panel-raised);border:1px solid var(--edge-2);border-radius:8px;box-shadow:0 12px 30px #000a}
.command-panel:focus-within>.command-context,.command-context:hover{display:block}
.command-panel:has(>#command-guide:not([hidden]))>.command-context{display:none}
.command-panel:focus-within>.command-popup{top:calc(100% + 8px + var(--command-context))}
.command-context>p{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.command-target-label{height:18px;font:11px/18px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--text-3)}
.command-hint{display:flex;align-items:center;height:22px;font:10px/18px var(--mono);color:var(--muted)}.command-hint-keys{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.command-hint button{flex:none;font:inherit;padding:0 6px;min-height:20px;margin-left:8px;border-radius:5px}
.command-guide{position:absolute;right:var(--command-right);top:calc(100% + 6px);z-index:90;width:min(620px,calc(100% - 32px));max-height:65vh;overflow:auto;padding:18px;background:var(--panel-raised);border:1px solid var(--edge);border-radius:12px;box-shadow:0 18px 44px #000b;font-size:12px;line-height:1.55}.command-guide p{margin:0 0 12px;color:var(--muted)}.command-guide .command-guide-title{font-size:16px;color:var(--text)}.command-guide code{font:11px/1.6 var(--mono);color:var(--text);overflow-wrap:anywhere}.command-guide dl{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px 14px;margin:14px 0}.command-guide dd{margin:0;color:var(--muted)}.command-examples{display:grid;gap:6px}.command-examples button{text-align:left;display:grid;gap:3px;white-space:normal;padding:9px 11px;line-height:1.5}.command-examples span{font-size:11px;color:var(--muted)}
/* The feedback line: the latest result in one line (or a running, failed or cancelled command's status, never both),
   and at its right end the storage flag (web build) and the status. */
.bar-feedback{display:flex;align-items:center;gap:12px;min-height:18px;padding:1px 0;font-size:10.5px;line-height:16px;color:var(--muted)}.bar-feedback>p{margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:16px}
.bar-flag{flex:0 1 auto;color:var(--accent);font-size:10px}
#result,#command-status{flex:1 1 0}#result{color:var(--muted)}#result[data-tone=ok]{color:var(--text-3)}#result[data-tone=refused]{color:var(--rose)}#bar:has(#command-status:not([hidden])) #result{display:none}
#command-status[data-state=sent]{color:var(--accent)}#command-status[data-state=failed]{color:var(--rose)}.bar-feedback:has(#command-status[data-state=failed]:not([hidden])){align-items:flex-start}.bar-feedback #command-status[data-state=failed]{white-space:normal;overflow-wrap:anywhere}
.bar-feedback:has(#apply-command-variation:not([hidden])){min-height:36px;flex-wrap:wrap}.bar-feedback:has(#apply-command-variation:not([hidden])) #result{flex:1 1 200px;white-space:normal;overflow:visible}#apply-command-variation{min-height:32px;padding:4px 9px;font-size:11px;color:var(--accent)}
/* The status in words, under the gear's dot: only when there is something to say (audio getting ready; trouble in
   rose, taking the line from the last result when it needs it). While all is well, or an edit is getting ready, the
   dot says it alone. */
#status{flex:0 1 auto;margin-left:auto;font-family:var(--mono);font-size:10px;color:var(--text-3)}
#status:is([data-state=connected],[data-state=preparing]){display:none}
#status[data-state=reopen],#status[data-state=error]{color:var(--rose)}


/* The bar's popovers (native: light dismiss, Escape and the top layer), placed under their buttons by popover.ts. */
.bar-popover{margin:0;padding:12px 14px;max-width:calc(100% - 16px);background:var(--panel-raised);color:var(--text);border:1px solid var(--edge-2);border-radius:12px;box-shadow:0 18px 44px #000000b3;font-size:12px;max-height:calc(100dvh - 16px);overflow:auto;overscroll-behavior:contain}/* Hidden until popover.ts has placed it the first time, so it never shows a frame at the browser's centred default. */.bar-popover:not([style*=fixed]){visibility:hidden}
.bar-popover-title{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 10px;font-size:11px;font-weight:600;line-height:1.4}.bar-popover-title span{font-weight:400;color:var(--muted);font-size:10px;text-align:right}
.transport-reverb-panel{width:236px}.transport-reverb-row{display:grid;grid-template-columns:42px 1fr 3ch;align-items:center;gap:10px;height:30px;font-size:11px}.transport-reverb-row input{width:100%;margin:0}.transport-reverb-row output{font:11px var(--mono);color:var(--text);text-align:right}
.settings-panel{width:280px}.settings-grid{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:6px 12px;font-size:11px}.settings-grid select{width:100%;min-width:0;padding:5px 8px;font-size:12px}.settings-actions{display:flex;justify-content:flex-end;margin-top:8px}.settings-actions button{padding:4px 10px;font-size:11px}
.settings-note{margin:8px 0 0;font-size:10px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}.settings-section{margin-top:12px;padding-top:10px;border-top:1px solid var(--line)}.settings-check{display:flex;align-items:center;gap:8px;color:var(--text);cursor:pointer}.settings-check input{margin:0;accent-color:var(--accent)}.settings-hints{display:grid;grid-template-columns:auto 1fr;gap:2px 10px;margin:10px 0 0;font-size:10px;line-height:1.5;color:var(--muted)}
.settings-hints dt{font-family:var(--mono);color:var(--text-4);white-space:nowrap}
.settings-hints dd{margin:0}

/* Under the lanes: Variations (only while a candidate exists), then Samples and Notation & details in one row. */
.song-panel{padding:0;margin-top:0;overflow:hidden}#candidate-preview{margin-top:18px}.section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
#song-lanes{overflow:visible}
.conversation-panel{padding:12px 0}.conversation-panel:has(#candidates:empty){display:none}.conversation-panel li{list-style:none;padding:12px 0;border-top:1px solid var(--edge);line-height:2}.conversation-panel ul{padding:0;margin:0}.conversation-panel li span{display:block}.conversation-panel li button{padding:5px 9px;font-size:12px}
.disclosures{display:flex;flex-wrap:wrap;align-items:flex-start;gap:0 22px;margin-top:16px;padding-top:8px;border-top:1px solid var(--edge)}.disclosures>details{min-width:0;padding:4px 0}.disclosures>details[open]{flex-basis:100%;padding-bottom:12px}.disclosures summary{cursor:pointer;color:var(--muted);font-size:11px}.disclosures summary:hover{color:var(--text-3)}#inspector{padding-top:16px}
#audio,#history-summary{height:1.5em;line-height:1.5em;margin:10px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;color:var(--muted);font-family:var(--mono)}
.advanced section{margin-top:14px}.advanced h2{font-size:12px}.advanced textarea{display:block;width:100%;background:var(--panel);color:inherit;border:1px solid var(--field-edge);border-radius:8px;padding:10px;margin:8px 0;font-family:var(--mono)}#blocks{display:flex;flex-wrap:wrap;gap:8px 14px}#blocks label{font-size:11px}
.instrument-inspector section{background:var(--panel)}

#lanes .lane-block.command-target{border-color:color-mix(in srgb,var(--text) 85%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--text) 50%,transparent)}
#lanes .lane-row.command-target .lane-label{background:var(--fill-3)}

.slice-selection{position:absolute;top:0;bottom:0;z-index:3;border:2px solid var(--accent);pointer-events:none;padding:3px;font-size:9px;color:var(--accent);overflow:hidden;white-space:nowrap}

/* Recording onto the song (SONG-ARRANGEMENT-PLAN.md D7): with an audio track armed, Record is the audio take's; the
   bar shows the elapsed time beside it and its meter reads the input in rose while a take records. */
#record[data-audio=armed]{color:color-mix(in srgb,var(--rose) 80%,transparent)}
#record[data-state=pre-roll]{color:var(--rose);border-color:color-mix(in srgb,var(--rose) 50%,transparent);animation:record-on 2s ease-in-out infinite}
.record-time{flex:none;min-width:40px;color:var(--rose);font:500 10.5px/1 var(--mono);font-variant-numeric:tabular-nums;white-space:nowrap}
.record-time[data-state=pre-roll]{color:var(--muted)}
.transport-meter[data-source=input] .transport-meter-fill{background:var(--rose)}

#count-in,#metronome{font:600 10px var(--mono)}#count-in[aria-pressed=true],#metronome[aria-pressed=true]{color:var(--text);border-color:#ffffff80;background:var(--edge)}
#count-in[data-counting=true]{color:var(--rose);border-color:var(--rose)}

/* Command workflow: reference, results and completion share a bounded panel under the field. */
.command-popup { position: absolute; top: calc(100% + 4px); left: var(--command-left); right: var(--command-right); max-height: min(360px, 50vh); overflow: auto; padding: 8px; background: var(--panel); border: 1px solid var(--edge); border-radius: 8px; box-shadow: 0 8px 24px #0002; z-index: 30; }
.command-popup button, .workflow-reference button { display: block; width: 100%; text-align: left; padding: 7px 9px; background: transparent; border: 0; border-radius: 4px; color: inherit; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; cursor: pointer; }
.command-popup button:hover, .command-popup button:focus-visible, .workflow-reference button:hover { background: var(--fill-3); }
.workflow-reference { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; margin-bottom: 12px; }
/* Each reference entry shows its command, then what it does (product pass 2026-11-10). */
.workflow-reference button { display: grid; gap: 1px; }
.workflow-reference button code { font: 11px/1.45 var(--mono); color: var(--text); overflow-wrap: anywhere; }
.workflow-reference button span { font-size: 11px; line-height: 1.4; color: var(--muted); }

/* Below 600 px the groups give up their edges: the controls flow in two or three rows (the wordmark, the loop's
   "beats" and the volume's "Vol" go), then the command field with Run as an icon, then the feedback line. */
@media (width < 600px){
  :root{--gutter:10px;--control:32px}
  .bar-controls{--group-gap:4px;gap:6px var(--group-gap)}.bar-brand{margin-right:2px}.bar-wordmark{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .bar-group{display:contents}
  .bar-group>button,#settings,#command-toggle,#transport-reverb{width:30px}#project-toggle{width:auto;padding:0 5px 0 8px;font-size:11.5px}.transport-field{padding:0 6px}.transport-loop button{width:20px}
  .transport-loop .transport-unit,.transport-volume .transport-unit{display:none}
  .transport-volume input{width:64px}.transport-meter{width:24px}
  .command-panel{--command-right:calc(var(--gutter) + 34px)}.command-entry{padding-left:7px}.command-key,.command-send-text{display:none}.bar-controls .command-send-icon{display:block}.command-entry #command-send{width:28px;padding:0;display:grid;place-items:center}.command-entry textarea{font-size:12px}
  .command-guide{position:fixed;left:10px;right:10px;top:calc(var(--bar-height,120px) + 8px);width:auto;max-height:calc(100dvh - var(--bar-height,120px) - 24px);padding:14px}.command-guide dl{grid-template-columns:1fr;gap:3px}.command-guide dd{margin-bottom:7px}
  .workflow-reference { grid-template-columns: 1fr; }
  .command-popup { max-height: min(360px, 45dvh); }
}

/* Before the song is ready (boot-status.ts): the controls stay inert and dimmed, one line says what is happening. */
[data-boot-inert]{opacity:.5}
.boot-status{display:flex;align-items:center;gap:8px;margin:6px 0 12px;font-size:11px;color:var(--muted)}
.boot-status:not([data-state=error])::before{content:'';flex:none;width:6px;height:6px;border-radius:50%;background:var(--accent);opacity:.7;animation:boot-pulse 1.4s ease-in-out infinite}
@keyframes boot-pulse{50%{opacity:.2}}
.boot-status[data-state=error]{font-size:12px;color:var(--rose)}
.boot-status button{min-height:28px;padding:4px 10px;font-size:12px}

.lanes{position:relative;min-width:0}.lanes button,.lanes select{font:inherit}
.lanes .lane-scroll{overflow:auto;background:transparent;container-type:inline-size}
.lanes.lane-fit .lane-scroll{overflow:visible}
.lanes .lane-grid{min-width:690px;position:relative;display:grid;gap:6px}.lanes.lane-fit .lane-grid{min-width:380px}
@media (width <= 440px){.lanes.lane-fit .lane-grid{min-width:100%}}
.lanes .lane-ruler,.lanes .lane-row{display:grid;grid-template-columns:1fr}
/* The ruler: beat numbers, the snap select in its left corner and Collapse all in its right, both kept in view when wide lanes scroll. */
.lanes .lane-ruler{height:20px;align-items:center;color:var(--muted);font-family:var(--mono);font-size:9px}.lanes .lane-ruler>*{grid-area:1/1;min-width:0}
.lanes .lane-ticks{position:relative;height:100%;color:var(--faint)}.lanes .lane-marker{position:absolute;top:50%;transform:translateY(-50%);font-variant-numeric:tabular-nums}
.lanes .lane-ruler-start,.lanes .lane-ruler-end{position:sticky;z-index:1;display:flex;align-items:center;height:100%}.lanes .lane-ruler-start{justify-self:start;left:0}.lanes .lane-ruler-end{justify-self:end;right:0}.lanes .lane-ruler-start:empty,.lanes .lane-ruler-end:empty{display:none}
.lanes .lane-ruler-start::after{content:'';position:absolute;right:6px;top:50%;margin-top:-1px;border:3px solid transparent;border-top-color:currentColor;border-bottom:0;pointer-events:none;opacity:.8}
.lanes .lane-snap,.lanes .lane-collapse-all{height:24px;margin:0;border:1px solid var(--line);border-radius:12px;background:var(--bg);color:var(--muted);font:600 10px/22px var(--mono);letter-spacing:.2px;box-shadow:none}
.lanes .lane-snap{appearance:none;-webkit-appearance:none;max-width:none;padding:0 8px;cursor:pointer}.lanes .lane-snap-field{display:inline-flex;align-items:center;gap:5px;margin-left:auto;color:var(--muted);font:10px var(--mono)}.lanes .lane-collapse-all{display:grid;place-items:center;width:26px;padding:0}.lanes .lane-collapse-all svg{width:14px;height:14px}
.lanes .lane-snap:hover,.lanes .lane-collapse-all:hover{color:var(--text);border-color:#ffffff38;background:var(--panel)}.lanes .lane-snap:focus-visible,.lanes .lane-collapse-all:focus-visible{outline:var(--focus-ring);outline-offset:1px}
.lanes .lane-row{position:relative;isolation:isolate}
.lanes .lane-title{position:absolute;left:8px;top:6px;z-index:6;max-width:calc(100% - 50px);display:flex;align-items:center;gap:5px;padding:3px 4px 3px 7px;border-radius:20px;background:#000000b3;backdrop-filter:blur(8px);font-size:10px;color:var(--lane-color);font-family:var(--mono)}
.lanes .lane-title strong{font-weight:700;text-transform:uppercase;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.2px}.lanes .lane-title strong::before{content:'';display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--lane-color);margin-right:6px}
.lanes .lane-add{position:absolute;right:8px;top:6px;z-index:6;width:24px;height:24px;padding:0;border:0;background:#000000b3;color:var(--lane-color);font-size:14px;display:grid;place-items:center;border-radius:50%;box-shadow:none}.lanes .lane-add:hover{background:#000000cc}
.lanes .lane-timeline{position:relative;min-height:76px;touch-action:none;border:1px solid var(--edge);border-radius:8px;background-color:var(--surface-1);background-image:repeating-linear-gradient(90deg,transparent 0,transparent calc(var(--beat) - 1px),var(--fill-3) calc(var(--beat) - 1px),var(--fill-3) var(--beat)),repeating-linear-gradient(90deg,transparent 0,transparent calc(var(--beat) * 4 - 1px),var(--line) calc(var(--beat) * 4 - 1px),var(--line) calc(var(--beat) * 4))}
.lanes .lane-block{position:absolute;top:9px;height:58px;border:1px solid var(--edge-strong);border-radius:7px;background:color-mix(in srgb,var(--lane-color) 90%,var(--surface-1));box-sizing:border-box;overflow:hidden;padding:0}
.lanes .lane-block.selected,.lanes .slicing{border-color:color-mix(in srgb,var(--text) 85%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--text) 50%,transparent)}
.lanes .lane-block.group-invalid{border-color:var(--rose);box-shadow:0 0 0 1px var(--rose),0 0 10px color-mix(in srgb,var(--rose) 33%,transparent)}
.lanes .block-grip{position:absolute;inset:auto 8px 0 0;height:11px;padding:0 5px;background:transparent;border:0;border-radius:0;text-align:center;color:#00000070;font-size:10px;cursor:grab;touch-action:none;overflow:hidden;white-space:nowrap;z-index:2;opacity:0}.lanes .lane-block:hover .block-grip,.lanes .selected .block-grip,.lanes .block-grip:focus-visible{opacity:1}
.lanes .block-resize{position:absolute;right:0;top:0;width:7px;height:100%;padding:0;border:0;border-radius:0;background:#00000018;color:transparent;cursor:ew-resize;touch-action:none;z-index:3}
.lanes .slice-cell,.lanes .preview-pad{position:absolute;top:0;bottom:0;padding:0;border:0;border-left:1px solid #00000042;border-radius:0;background:transparent;box-shadow:none;color:transparent;min-width:0;overflow:hidden;touch-action:none;cursor:ns-resize;transition:none}
.lanes .slice-cell:hover{background:var(--fill-2)}.lanes .slice-cell.rest,.lanes .preview-pad.rest{border:3px solid transparent;border-left-width:2px;border-right-width:2px;border-radius:6px;background:#00000080;background-clip:padding-box;box-shadow:none;color:transparent}.lanes .slice-cell.rest:hover{background-color:#00000070}
.lanes .slice-cell.chosen{outline:1.5px solid color-mix(in srgb,var(--text) 90%,transparent);outline-offset:-3px;border-radius:5px;background-color:color-mix(in srgb,var(--text) 10%,transparent)}.lanes .slice-cell.rest.chosen{background-color:#00000080}
.lanes .slice-cell.playing{background-color:color-mix(in srgb,var(--accent) 20%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 50%,transparent)}
/* One playhead per timeline (its left set by Lanes.setPlayhead), never across an editor open under a lane. */
.lanes .lane-head{pointer-events:none;position:absolute;top:0;bottom:0;width:2px;background:color-mix(in srgb,var(--rose) 94%,transparent);z-index:7;box-shadow:0 0 6px color-mix(in srgb,var(--rose) 19%,transparent)}
.lanes .lane-muted .lane-block{opacity:.45}.lanes .lane-help{color:var(--muted);font-size:10px;margin:0 0 12px;opacity:.8}
/* The empty song: one quiet line in a dashed timeline-sized frame, before the add-lane row. */
.lanes .lane-empty{display:flex;align-items:center;justify-content:center;min-height:76px;margin:0;border:1px dashed var(--edge-2);border-radius:8px;color:var(--muted);font-size:11px;text-align:center;padding:0 16px}
.lanes .block-curves{display:none;position:absolute;bottom:0;left:0;width:calc(100% - 7px);height:10px;pointer-events:none;z-index:1}.lanes .block-curves[data-curved]{display:block}.lanes .block-curves polyline{fill:none;stroke:var(--text);stroke-width:1;stroke-opacity:.5;vector-effect:non-scaling-stroke}.lanes .block-curves .curve-lpf{stroke-opacity:1}
/* A drawn synth curve reads over the effects' lines: a touch heavier and nearly opaque (SYNTH-CURVES-PLAN.md §4). */
.lanes .block-curves .curve-synth{stroke-width:1.25;stroke-opacity:.9}
.lanes .lane-marquee{position:absolute;border:1px solid var(--accent);background:color-mix(in srgb,var(--accent) 13%,transparent);pointer-events:none;z-index:8;box-sizing:border-box}
.lanes .slice-count{position:absolute;top:0;right:10px;z-index:8;background:var(--accent);color:var(--bg);padding:3px 7px;font-size:10px;font-family:var(--mono);font-weight:700;border-radius:0 0 5px 5px;pointer-events:none}
.lanes .slice-preview{position:absolute;inset:0;z-index:4;pointer-events:none}.lanes .previewing .slice-cell{visibility:hidden}

.lanes .lane-label,.lanes .lane-mute{border:0;background:transparent;box-shadow:none;color:inherit;min-width:0;padding:3px 0;line-height:16px;border-radius:12px}.lanes .lane-label{display:flex;flex:1;min-width:0;padding:3px 4px;margin-left:-4px}.lanes .lane-label strong{display:block;min-width:0}.lanes .lane-mute{flex:none;width:22px;height:22px;display:grid;place-items:center;color:var(--muted)}.lanes .lane-mute[aria-pressed=true]{color:var(--surface-1);background:var(--sand)}.lanes .lane-mute[aria-pressed=true]:hover{background:var(--sand-hover)}.lanes .lane-mute svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.lanes .lane-label.lane-focused{color:var(--lane-color)}.lanes .lane-label[aria-expanded=true]{background:color-mix(in srgb,var(--lane-color) 14%,transparent)}.lanes .lane-label:focus-visible,.lanes .lane-mute:focus-visible,.lanes .lane-add:focus-visible{outline:var(--focus-ring);outline-offset:-2px}.lanes .lane-muted .lane-label{color:color-mix(in srgb,var(--lane-color) 50%,var(--muted))}.lanes .lane-muted .lane-title strong::before{background:currentColor}

/* Pad labels: what each pad plays; hidden where a pad is too narrow to read. */
.lanes .slice-cell{container-type:inline-size}.lanes .pad-label{position:absolute;left:2px;right:2px;top:50%;transform:translateY(-50%);font:600 10px/12px var(--mono);color:var(--bg);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}.lanes .pad-label:empty,.lanes .pad-narrow .pad-label{display:none}@container (width <= 20px){.lanes .pad-label{display:none}}
/* The add-lane row after the last lane: light, one line of small dashed pills. */
.lanes .lane-add-row{display:flex;flex-wrap:wrap;align-items:center;gap:5px;padding:1px 0 2px}.lanes .lane-add-caption{color:var(--muted);font:10px var(--mono);margin-right:2px;opacity:.75}.lanes .lane-add-kind{font-size:10.5px;line-height:14px;padding:4px 10px;border:1px dashed var(--edge-2);border-radius:12px;background:transparent;color:var(--muted)}.lanes .lane-add-kind:hover{color:var(--text);border-color:#ffffff45;background:var(--fill-2)}.lanes .lane-add-kind[aria-disabled=true]{opacity:var(--disabled);cursor:progress}
/* A lane's editor slot: a second grid row under its timeline, empty and not shown until a block editor is mounted. In
   wide lanes it stays the visible width and in view while the lanes scroll sideways. */
.lanes .lane-editor-slot{min-width:0;padding-top:6px;position:sticky;left:0;width:100cqw;max-width:100%}.lanes .lane-editor-slot:empty,.lanes .lane-editor-slot:not(:has(:not([hidden]))){display:none}.lanes .lane-editor-holder{display:none}
/* Move controls own their gesture; the pads above them always subdivide. */
.lanes .block-move-edge{position:absolute;left:0;top:27px;bottom:11px;width:8px;z-index:5;padding:0;border:0;border-radius:0;background:#00000022;box-shadow:inset 2px 0 #ffffff55;cursor:grab;touch-action:none}
.lanes .block-grip{opacity:.65;background:#00000012;z-index:5;color:var(--bg)}
.lanes .block-grip:active,.lanes .block-move-edge:active{cursor:grabbing}
.lanes .note-onset::after{content:'';position:absolute;left:3px;top:29px;bottom:15px;width:3px;border-radius:2px;background:color-mix(in srgb,var(--bg) 65%,transparent);pointer-events:none}
.lanes .note-hold{border-left-color:transparent}
.lanes .note-hold::before{content:'';position:absolute;left:0;right:0;top:50%;height:2px;background:color-mix(in srgb,var(--bg) 40%,transparent);pointer-events:none}
.lanes .note-muted{background-image:repeating-linear-gradient(135deg,transparent 0,transparent 5px,var(--fill-2) 5px,var(--fill-2) 6px)!important}
.lanes .note-rest::after{content:'·';position:absolute;inset:28px 0 13px;color:#ffffff55;font:16px var(--mono);pointer-events:none}
.lanes .note-related{box-shadow:inset 0 -13px color-mix(in srgb,var(--text) 20%,transparent)!important}
/* A focused pad of a related note keeps its focus halo (the ring reads on the lane colour only over it) and the band. */
.lanes .note-related:focus-visible{box-shadow:var(--focus-halo),inset 0 -13px color-mix(in srgb,var(--text) 20%,transparent)!important}
.lanes .note-muted .pad-label{color:color-mix(in srgb,var(--text) 48%,transparent)}

/* A full-width, quiet boundary above each open editor. Native button semantics
   and a stable node keep keyboard/pointer focus across song redraws. */
.lanes .lane-editor-slot{padding-top:0}
.lanes .lane-collapse-ribbon{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-height:32px;margin:0 0 4px;padding:4px 12px;border:0;border-bottom:1px solid var(--fill-3);border-radius:0 0 7px 7px;background:linear-gradient(var(--fill-1),var(--fill-2));color:var(--muted);font:500 10px/16px var(--mono);letter-spacing:.1px;box-shadow:none;touch-action:pan-x pan-y;cursor:pointer}
.lanes .lane-collapse-ribbon svg{width:14px;height:14px;flex:none}
.lanes .lane-collapse-ribbon:hover{background:var(--fill-3);color:var(--text)}
.lanes .lane-collapse-ribbon:focus-visible{outline:var(--focus-ring);outline-offset:-2px;color:var(--text)}
.lanes .lane-note-clip{position:absolute;inset:0 8px 11px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;min-width:0;padding:3px 8px;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--bg);font:600 10px/13px var(--mono);cursor:pointer}
.lanes .lane-note-clip small{font:500 9px/12px var(--mono)}
.lanes .lane-note-clip:hover{background:var(--fill-2)}
@media(pointer:coarse){.lanes .lane-collapse-ribbon{min-height:44px}}

/* Saved native notes sit above the existing curve strip; the button retains all hit handling. */
.lanes .lane-native{container-type:inline-size}
.lanes .lane-note-clip{flex-direction:row;justify-content:center;align-items:flex-start;gap:6px;padding:2px 4px;overflow:hidden;white-space:nowrap}
.lanes .lane-note-clip>span,.lanes .lane-note-clip>small{overflow:hidden;text-overflow:ellipsis;line-height:14px}
.lanes .clip-note-preview{position:absolute;left:1px;bottom:2px;width:calc(100% - 2px);height:22px;pointer-events:none;overflow:hidden}
.lanes .clip-note-preview rect{fill:color-mix(in srgb,var(--bg) 77%,transparent);vector-effect:non-scaling-stroke}
.lanes .clip-note-preview rect.muted{fill:none;stroke:color-mix(in srgb,var(--bg) 60%,transparent);stroke-width:.7;stroke-dasharray:2 1}
@container (width <= 105px){.lanes .lane-note-clip>span{display:none}}

/* Focus inside a block: the block clips what lies outside it, so its controls' rings sit inside them, light over a dark
   edge so they read on every lane colour. */
.lanes .slice-cell:focus-visible,.lanes .block-grip:focus-visible,.lanes .block-resize:focus-visible,.lanes .block-move-edge:focus-visible,.lanes .lane-note-clip:focus-visible{outline:var(--focus-ring-on-colour);outline-offset:-2px;box-shadow:var(--focus-halo)}

.instrument-inspector{display:grid;gap:16px}.instrument-inspector section{border:1px solid var(--edge);border-radius:12px;padding:14px;min-width:0}.instrument-inspector h3{margin:0 0 12px;font-size:14px}.instrument-inspector label{display:flex;align-items:center;gap:10px;margin:8px 0;font-size:12px}.instrument-inspector label>span:first-child{min-width:88px}.instrument-inspector input[type=range]{min-width:60px;flex:1}.instrument-inspector output{min-width:56px;text-align:right;font-variant-numeric:tabular-nums}.instrument-inspector canvas{display:block;width:100%;height:128px;margin:12px 0 6px;background:var(--bg);border:1px solid var(--edge);border-radius:6px;touch-action:none}.instrument-inspector p{font-size:12px;color:var(--muted);line-height:1.5}.instrument-inspector select{max-width:100%}.instrument-inspector .inspector-row{display:flex;gap:8px;flex-wrap:wrap}.instrument-inspector button{font-size:12px}
.sampler-form{display:flex;flex-wrap:wrap;align-items:end;gap:8px 14px;margin:12px 0}.sampler-form label{flex:1 1 150px;min-width:0;flex-direction:column;align-items:stretch;margin:0}.sampler-form input{width:100%;min-width:0;box-sizing:border-box}.sampler-form button{align-self:end}.instrument-inspector h4{margin:20px 0 10px;font-size:13px}.instrument-inspector input[type=number],.instrument-inspector input[type=text],.instrument-inspector select{background:var(--panel);color:inherit;border:1px solid var(--field-edge);border-radius:5px;padding:6px}.instrument-inspector :is(button,input,select,summary):focus-visible{outline:var(--focus-ring);outline-offset:3px}.sampler-slices{max-height:210px;overflow:auto;padding:4px 4px 4px 28px}.sampler-slices li{margin:4px 0}.sampler-slices button{width:100%;text-align:left}.sampler-pads{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:16px 0}.sampler-pads button{min-height:64px;white-space:normal;overflow-wrap:anywhere;line-height:1.4}.instrument-inspector button[aria-pressed=true]{color:var(--text);border-color:var(--selected-edge);background:var(--selected-bg)}.sampler-proposals{max-height:220px;overflow:auto;display:flex;flex-wrap:wrap;gap:4px 14px;border:1px solid var(--edge)}.sampler-proposals label{min-width:120px}.instrument-inspector [data-sampler-status]:empty{display:none}
/* The baseline: where the sample comes from in one row, its facts in one muted line; precision tools wait in disclosures. */
.sampler-choose{display:flex;flex-wrap:wrap;gap:0 18px}.sampler-choose label{margin:4px 0}.instrument-inspector .sampler-choose label>span:first-child{min-width:0}
.instrument-inspector .sampler-meta{margin:6px 0 10px;font-size:11px}
.instrument-inspector .sampler-wave-status{margin:0 0 6px;font-size:11px}
.sampler-frames{color:var(--muted);font-size:10px;font-variant-numeric:tabular-nums}
.sampler-remove-row{align-items:center;margin:2px 0 4px}.instrument-inspector .sampler-remove[aria-disabled=true]{opacity:var(--disabled);cursor:default}.sampler-why{color:var(--muted);font-size:11px}
.sampler-more{margin-top:12px;border-top:1px solid var(--edge);padding-top:10px}.sampler-more>summary{width:fit-content;cursor:pointer;font-size:12px;color:var(--text)}.sampler-more[open]>summary{margin-bottom:6px}
@media (width <= 480px){.instrument-inspector section{padding:10px}.sampler-pads{gap:4px}.sampler-pads button{font-size:11px;padding:5px}.instrument-inspector label{flex-wrap:wrap}.sampler-form button{width:100%}}

.track-panel{position:fixed;z-index:100;width:264px;max-width:calc(100% - 16px);max-height:calc(100vh - 16px);overflow:auto;overscroll-behavior:contain;box-sizing:border-box;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--panel-raised);color:var(--text);box-shadow:0 8px 24px #0007;font-size:12px}.track-panel-header{display:flex;align-items:center;gap:8px;justify-content:space-between}.track-panel-title{flex:1;min-width:0}.track-panel h3{margin:0;font-size:13px;overflow-wrap:anywhere;color:var(--track-color)}.track-panel h3.renamable{cursor:text}.track-panel-header button{flex:none;padding:0;width:24px;height:24px;font-size:18px;border:0;background:transparent;color:var(--muted)}.track-panel-header .track-panel-rename{width:auto;height:22px;padding:0 8px;font-size:10px;border:1px solid var(--line);border-radius:5px}.track-panel-header .track-panel-rename:hover{color:var(--text);border-color:var(--edge-strong)}.track-panel-name-input{display:block;width:100%;min-width:0;padding:3px 6px;font-size:13px;font-weight:600;color:var(--track-color);border-color:var(--selected-edge);border-radius:6px}.track-panel-name-input[aria-busy=true]{cursor:progress;opacity:.7}.track-panel-sounds{margin-top:12px}.track-panel-sounds>span{display:block;color:var(--muted);font-size:10px;margin-bottom:7px}.track-panel>button{font-size:11px;margin-top:12px;width:100%;text-align:left;background:transparent;border-color:var(--fill-3)}.track-panel button[aria-pressed=true]{color:var(--surface-1);background:var(--sand);border-color:var(--sand)}.track-panel button[aria-pressed=true]:hover{background:var(--sand-hover);border-color:var(--sand-hover)}.track-panel :focus-visible{outline:var(--focus-ring);outline-offset:2px}
.track-panel-delete{display:flex;gap:6px;margin-top:8px}.track-panel-delete button{flex:1;min-width:0;font-size:11px;text-align:left;background:transparent;border-color:var(--fill-3);color:var(--muted)}.track-panel-delete button:hover{color:var(--text)}.track-panel-delete .track-panel-delete-confirm{color:var(--rose);border-color:color-mix(in srgb,var(--rose) 50%,transparent)}.track-panel-delete .track-panel-delete-confirm[aria-disabled=true]{opacity:var(--disabled);cursor:progress}.track-panel-delete .track-panel-delete-keep{flex:none;text-align:center}
.sound-picker{display:grid;gap:9px;min-width:0}.sound-choices{display:grid;grid-template-columns:repeat(var(--sound-columns,3),minmax(0,1fr));gap:5px;min-width:0}.sound-row{display:grid;gap:5px;min-width:0}.sound-row-label{color:var(--muted);font-size:10px}.sound-row-choices{display:grid;grid-template-columns:repeat(auto-fill,minmax(34px,1fr));gap:4px;min-width:0}.sound-picker button{min-width:0;padding:8px 5px;font-size:11px;overflow:hidden;text-overflow:ellipsis;background:var(--fill-1);border-color:var(--fill-3);border-radius:6px;transition:background .1s,border-color .1s}.sound-choices[data-columns="6"] button{padding:7px 1px;font-size:10.5px}.sound-row-choices button{padding:5px 1px;font-size:10px}.sound-picker button:hover{background:var(--fill-2);border-color:var(--edge-3)}.sound-picker button[aria-checked=true]{color:var(--text);background:var(--selected-bg);border-color:var(--selected-edge)}.sound-picker button:focus-visible{outline:var(--focus-ring);outline-offset:2px}.sound-picker[aria-busy=true]{cursor:progress}.sound-picker[aria-busy=true] button{cursor:progress}
.track-panel-duplicate{width:100%;text-align:left;margin-top:6px}
.track-panel-name-rule{margin:4px 0 0;color:var(--muted);font-size:11px;line-height:15px}.track-panel-name-rule[data-invalid]{color:var(--rose)}
.track-panel-name-input[aria-invalid=true]{border-color:color-mix(in srgb,var(--rose) 70%,transparent)}
.track-panel-move{display:flex;gap:6px;margin-top:6px}.track-panel-move button{flex:1;min-width:0;font-size:11px;text-align:left;background:transparent;border-color:var(--fill-3)}

/* Retained Instrument controls inside the deck: existing sliders and displays keep their grid and gestures.
   Groups and narrow subviews are stacked by deck.css. Only the selected group's controls are reachable. */
.instrument-hint{font-size:11px;line-height:16px;color:var(--muted);margin:0}
.instrument-envelope-notice{font-size:12px;line-height:1.5;color:var(--muted);padding:8px;border-left:2px solid var(--accent)}

/* the panel */
.instrument{display:flex;flex-direction:column;min-width:0}

/* the scope card: the plots' frame, the scale at the top left, the readout at the top right */
.scope-display{position:relative;min-width:0;margin:0 0 8px}
.scope-display-canvas{display:block;width:100%;height:72px;background:var(--surface-1);border:0;border-radius:6px;box-shadow:inset 0 0 0 1px var(--edge-2)}
.scope-display-range{position:absolute;top:5px;left:8px;color:var(--faint);font:10px/16px var(--mono);font-variant-numeric:tabular-nums;pointer-events:none}
.instrument .scope-display-readout{position:absolute;top:5px;right:6px;display:flex;gap:10px;margin:0;padding:0 4px;border-radius:4px;background:color-mix(in srgb,var(--surface-1) 85%,transparent);color:var(--text-2);font:11px/16px var(--mono);font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none}
.scope-display-state,.scope-display-muted{color:var(--muted)}
.scope-display-channels{display:inline-flex;gap:4px}

/* the top row: the switch, the preset row, the output trim and lane-scope kicker */
.instrument-top{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;min-width:0;margin:0 0 8px}
.instrument-scope{flex:none;order:1;margin:0;line-height:24px;white-space:nowrap}
.instrument-presets{display:flex;align-items:center;gap:2px;min-width:0;flex:0 1 auto}
.instrument .instrument-preset{height:28px;min-width:0;max-width:220px;padding:0 6px;border-radius:6px;font-size:12px;background:var(--fill-1);text-overflow:ellipsis}
.instrument .instrument-preset option{background:var(--panel-raised);color:var(--text)}
.instrument .instrument-tool{height:28px;padding:0 8px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--text-3);font-size:12px;line-height:26px}
.instrument .instrument-tool:hover{background:var(--fill-3);border-color:transparent}
.instrument .instrument-tool[aria-disabled=true]{opacity:var(--disabled);cursor:default;background:transparent}
.instrument .instrument-more{width:28px;padding:0;font-size:15px;letter-spacing:1px}
.instrument-trim{flex:1 1 240px;min-width:200px;max-width:380px;margin-left:auto}

/* a switch: a pill and its word (the Curve synth and the LFO) */
.instrument .instrument-switch{display:inline-flex;align-items:center;gap:8px;height:28px;padding:0 11px 0 7px;border:1px solid var(--edge);border-radius:14px;background:var(--fill-1);color:var(--text-3);font-size:12px}
.instrument .instrument-switch:hover{background:var(--fill-3);border-color:var(--edge-strong)}
.instrument .instrument-switch[aria-checked=true]{color:var(--text);border-color:color-mix(in srgb,var(--accent) 40%,transparent)}
.instrument .instrument-switch[aria-disabled=true]{opacity:var(--disabled);cursor:default;background:var(--fill-1);border-color:var(--edge)}
.instrument-switch-pill{position:relative;flex:none;width:26px;height:14px;border-radius:7px;background:var(--edge-2);transition:background .15s}
.instrument-switch-knob{position:absolute;top:2px;left:2px;width:10px;height:10px;border-radius:50%;background:var(--text-3);transition:transform .15s,background .15s}
.instrument-switch[aria-checked=true] .instrument-switch-pill{background:var(--accent)}
.instrument-switch[aria-checked=true] .instrument-switch-knob{transform:translateX(12px);background:var(--bg)}

/* Save as… and Rename: one inline name field */
.instrument-naming{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:0 0 8px}
.instrument .instrument-name-field{width:220px;max-width:100%;height:28px;padding:0 8px;border-radius:6px;font-size:12px;border-color:var(--field-edge)}
.instrument .instrument-name-go{color:var(--accent);background:color-mix(in srgb,var(--accent) 9%,transparent);border-color:color-mix(in srgb,var(--accent) 33%,transparent)}
.instrument .instrument-name-go:hover{background:color-mix(in srgb,var(--accent) 18%,transparent);border-color:color-mix(in srgb,var(--accent) 50%,transparent)}
.instrument .instrument-name-close{width:28px;padding:0;font-size:15px;color:var(--muted)}
.instrument-name-note{flex-basis:100%;font-size:10px;line-height:16px;color:var(--rose)}
.instrument-name-note:empty{display:none}
/* With the synth off, what the lane plays; after a preset load that had to change, what changed. */
.instrument .instrument-off-note{margin:0 0 8px}
.instrument .instrument-preset-note{margin:0 0 8px}

/* Musical disable state belongs to the group body, independently of deck selection. */
.instrument-off .instrument-section{opacity:.45}
.instrument-section{min-width:0;padding:0 0 8px}
.instrument-rows,.instrument-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px;min-width:0}
.instrument-rows{align-items:center}
.instrument-columns{row-gap:8px}
.instrument-column{display:flex;flex-direction:column;min-width:0}
.instrument .instrument-subhead{height:24px;margin:0;line-height:24px}
.instrument-row{display:grid;grid-template-columns:96px minmax(0,1fr);align-items:center;gap:0 8px;height:32px;min-width:0}
.instrument-segments{display:inline-flex;justify-self:start;gap:2px;padding:2px;border:1px solid var(--edge);border-radius:7px;background:var(--fill-1)}
.instrument .instrument-segment{display:grid;place-items:center;width:32px;height:22px;padding:0;border:0;border-radius:5px;background:transparent;color:var(--muted)}
.instrument .instrument-segment:hover{background:var(--fill-2);color:var(--text-2)}
.instrument .instrument-segment[aria-checked=true]{background:var(--edge);color:var(--text)}
.instrument .instrument-segment[aria-disabled=true]{cursor:default}
/* An option closed to this lane (Mono and Legato on a chord lane) while the synth is on; off, the section dims instead. */
.instrument:not(.instrument-off) .instrument-segment[aria-disabled=true]{opacity:var(--disabled)}
.instrument .instrument-segment[aria-disabled=true]:not([aria-checked=true]):hover{background:transparent;color:var(--muted)}
/* A worded segment (Clean · Ladder, Reset · Free, Poly · Mono · Legato, the sub's −1 · −2): the drawn ones' box, sized to its word. */
.instrument .instrument-segment-text{width:auto;min-width:32px;padding:0 8px;font-size:11px;line-height:22px;white-space:nowrap}
/* The deck carries these retained kind/timing controls in its group head. */
.instrument-head-tools{display:flex;align-items:center;height:26px}
.instrument .instrument-head-tools .instrument-segment{height:20px;line-height:20px}
/* Under Sync, the Rate row: a slider's grid, a compact note-value picker where its track was, the rate it runs at
   (derived, so muted) where its value was. */
.instrument-pick{display:grid;grid-template-columns:96px minmax(0,1fr) 64px;align-items:center;gap:0 8px;height:24px;min-width:0}
.instrument .instrument-cycle{justify-self:start;width:88px;height:22px;padding:0 4px 0 7px;border-radius:6px;background:var(--fill-1);font-size:11px;font-variant-numeric:tabular-nums}
.instrument .instrument-cycle:hover{background:var(--fill-2);border-color:var(--edge-strong)}
.instrument .instrument-cycle option{background:var(--panel-raised);color:var(--text)}
.instrument .instrument-pick-value{color:var(--muted);cursor:default}
/* A control's hint on the grid (Count's cost, what Restart does over the loop): beside it in two columns, under it in
   one, starting at the control column. */
.instrument-row-hint{display:flex;align-items:center;min-height:24px;padding-left:104px}
.instrument-glyph{display:block;flex:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.instrument-blend-end{display:inline-flex;align-items:center;gap:3px;color:var(--muted);font:10px/16px var(--mono)}
/* An envelope's stage curves: a quiet disclosure in the label column, its three rows under it once opened. */
.instrument-curves{display:flex;flex-direction:column;min-width:0}
.instrument .instrument-disclosure{display:inline-flex;align-self:flex-start;align-items:center;gap:4px;height:24px;margin:0;padding:0 4px 0 0;border:0;border-radius:4px;background:transparent;color:var(--muted);font-size:11px;line-height:24px}
.instrument .instrument-disclosure:hover{background:transparent;color:var(--text-4)}
.instrument-disclosure-chevron{display:block;flex:none;width:10px;height:10px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:transform .12s}
.instrument-disclosure[aria-expanded=true] .instrument-disclosure-chevron{transform:rotate(90deg)}
.instrument-lfo-head{display:flex;align-items:center;gap:8px;height:32px;margin:0 0 4px}
.instrument-lfo-tools{display:flex;align-items:center;flex-wrap:wrap;gap:0 8px}
.instrument .instrument-lfo-tools .instrument-tool{margin-left:-8px}
.instrument .instrument-lfo-tools .instrument-hint{font-size:10px}

/* ValueSlider: the name, a 4-px track with its fill (from 0 for ranges that cross it) and thumb, the value */
.value-slider{position:relative;display:grid;grid-template-columns:96px minmax(0,1fr) 64px;align-items:center;gap:0 8px;height:24px;min-width:0}
.value-slider-name{min-width:0;overflow:hidden;color:var(--muted);font-size:11px;white-space:nowrap;text-overflow:ellipsis}
.value-slider-span{display:flex;align-items:center;gap:6px;min-width:0}
.value-slider-span .value-slider-track{flex:1 1 auto;min-width:0}
.value-slider-end{display:flex;flex:none}
.value-slider-track{position:relative;height:18px;border-radius:4px;cursor:ew-resize;touch-action:none}
.value-slider-track::before{content:'';position:absolute;top:50%;left:0;right:0;height:4px;margin-top:-2px;border-radius:2px;background:var(--line);transition:background .12s}
.value-slider-fill{position:absolute;top:50%;height:4px;margin-top:-2px;border-radius:2px;background:var(--accent);opacity:.82;transition:opacity .12s}
.value-slider-thumb{position:absolute;top:50%;width:10px;height:10px;margin:-5px 0 0 -5px;border-radius:50%;background:var(--text);box-shadow:0 0 0 2px var(--panel),0 1px 3px #0009;transition:transform .12s,box-shadow .12s}
.value-slider-easing .value-slider-fill{transition:left .12s ease-out,width .12s ease-out,opacity .12s}
.value-slider-easing .value-slider-thumb{transition:left .12s ease-out,transform .12s,box-shadow .12s}
/* A preset/Undo may ease the shown controls; retained hidden controls land on their current values immediately. */
.instrument .deck-panel:not(.deck-shown) .value-slider-fill,.instrument .deck-panel:not(.deck-shown) .value-slider-thumb,.instrument .deck-sub-hidden .value-slider-fill,.instrument .deck-sub-hidden .value-slider-thumb{transition:none}
.value-slider:hover .value-slider-track::before{background:var(--edge-2)}
.value-slider:hover .value-slider-fill,.value-slider-active .value-slider-fill{opacity:1}
.value-slider:hover .value-slider-thumb,.value-slider-active .value-slider-thumb{transform:scale(1.2)}
.value-slider:hover .value-slider-name{color:var(--text-4)}
.value-slider-value{overflow:hidden;color:var(--text-2);font-family:var(--mono);font-size:11px;font-variant-numeric:tabular-nums;text-align:right;white-space:nowrap;cursor:text;user-select:none}
.value-slider-active .value-slider-value{color:var(--track-color,var(--accent))}
.value-slider-value.value-slider-refused{animation:value-slider-refused .7s ease-out}
@keyframes value-slider-refused{0%,35%{color:var(--rose)}100%{color:var(--text-2)}}
.value-slider .value-slider-field{grid-column:3;width:100%;min-width:0;height:20px;padding:0 4px;border-radius:4px;background:var(--sunken);font-family:var(--mono);font-size:11px;text-align:right}
.value-slider .value-slider-field[aria-invalid=true]{border-color:var(--rose)}
.value-slider-note{position:absolute;top:100%;right:0;z-index:3;padding:2px 6px;border-radius:4px;background:#2b1d1f;color:var(--rose-soft);font-size:10px;line-height:16px;white-space:nowrap}
.value-slider-off{opacity:var(--disabled)}
.value-slider-off .value-slider-track,.value-slider-off .value-slider-value{cursor:default}
.instrument-off .instrument-section .value-slider-off,.instrument-off .instrument-section [aria-disabled=true]{opacity:1}

/* the displays: the filter's response over the live spectrum, the envelopes, the LFO curve; one frame for all (no
   border, an inset edge, the same grid), lines and handles in the lane's colour */
.instrument-graph{position:relative;min-width:0;margin:0 0 8px}
/* No border: the viewBox is the element's own box, so pointer offsets are drawing coordinates; the edge is an inset shadow. */
.instrument-plot{display:block;width:100%;height:120px;overflow:hidden;background:var(--surface-1);border:0;border-radius:6px;box-shadow:inset 0 0 0 1px var(--edge-2);touch-action:none;user-select:none;-webkit-user-select:none}
.instrument-envelope .instrument-plot,.instrument-lfo .instrument-plot{height:96px}
.instrument-filter .instrument-plot,.instrument-lfo .instrument-plot{cursor:crosshair}
.instrument-graph-active .instrument-plot{cursor:grabbing}
.instrument-graph-off .instrument-plot{cursor:default}
.instrument-gridline{stroke:var(--fill-3);stroke-width:1}
.instrument-zero{stroke:var(--edge-3)}
.instrument-noteoff{stroke:var(--edge-strong);stroke-dasharray:3 3}
.instrument-axis{fill:var(--faint);font:9px var(--mono)}
.instrument-spectrum{fill:var(--track-color,var(--accent));fill-opacity:.18;stroke:none}
.instrument-spectrum-edge{fill:none;stroke:var(--track-color,var(--accent));stroke-width:1;stroke-opacity:.7;stroke-linejoin:round}
.instrument-spectrum-hold{fill:none;stroke:var(--muted);stroke-width:1;stroke-opacity:.5;stroke-linejoin:round}
.instrument-curve{fill:none;stroke:var(--track-color,var(--accent));stroke-width:1.75;stroke-linejoin:round;stroke-linecap:round}
.instrument-area{fill:var(--track-color,var(--accent));fill-opacity:.09;stroke:none}
.instrument-ghost{fill:none;stroke:var(--track-color,var(--accent));stroke-width:1.25;stroke-dasharray:4 3;opacity:.5}
/* A handle: a 10-px disc in the lane colour with a 2-px ring of the panel's colour (the stroke, painted under the fill), 12 px under the pointer. */
.instrument-handle{r:5px;fill:var(--track-color,var(--accent));stroke:var(--panel);stroke-width:4;paint-order:stroke;cursor:grab;transition:r .12s}
.instrument-handle:hover,.instrument-handle.instrument-hot,.instrument-graph-active .instrument-handle:focus{r:6px}
.instrument-handle:focus{outline:none}
.instrument-handle:focus-visible{stroke:var(--text)}
.instrument-graph-off .instrument-handle{cursor:default}
.instrument-graph-off .instrument-handle:hover{r:5px}
/* A stage's bend point shows only while the pointer is over its display or a handle in it has focus. */
.instrument-bend{fill:var(--panel);stroke:var(--track-color,var(--accent));stroke-width:1.25;opacity:0;transition:opacity .12s,fill .12s}
.instrument-graph:hover .instrument-bend,.instrument-graph:focus-within .instrument-bend{opacity:.85}
.instrument-bend.instrument-hot{opacity:1;fill:var(--track-color,var(--accent))}
.instrument-bend-flat,.instrument-graph-off .instrument-bend{display:none}
/* While a handle moves, its values in the plot's top corner away from it. */
.instrument .instrument-readout{position:absolute;top:6px;right:8px;margin:0;padding:0 6px;border-radius:4px;background:color-mix(in srgb,var(--surface-1) 90%,transparent);box-shadow:inset 0 0 0 1px var(--line);color:var(--text-2);font:10px/18px var(--mono);font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none}
.instrument .instrument-readout-left{right:auto;left:8px}
.instrument .instrument-caption{margin:4px 0 0;color:var(--muted);font-family:var(--mono);font-size:10px;line-height:16px}

/* The Draw tab's way in (SYNTH-CURVES-PLAN.md §4 "The Instrument tab's part"): a small curve glyph at the end of a
   drawable slider's name, in the lane colour when the selected block holds a curve on it (a click opens the Draw tab
   there), dim under the pointer otherwise. Absolutely placed, so the slider's three columns stay as they are. The drum
   controls carry the same glyph; theirs can be unavailable (no block, or a sound the selected blocks don't play). */
:is(.instrument,.drum-instrument) .instrument-curve-glyph{position:absolute;left:76px;top:3px;width:18px;height:18px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--track-color,var(--accent));opacity:0;display:grid;place-items:center;cursor:pointer;transition:opacity .12s,background .12s}
:is(.instrument,.drum-instrument) .instrument-curve-glyph svg{width:14px;height:14px;display:block;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
:is(.instrument,.drum-instrument) .instrument-curve-glyph[data-state=drawn]{opacity:1}
:is(.instrument,.drum-instrument) .value-slider:hover .instrument-curve-glyph[data-state=none],:is(.instrument,.drum-instrument) .instrument-curve-glyph[data-state=none]:focus-visible{opacity:.45}
:is(.instrument,.drum-instrument) .instrument-curve-glyph:hover{opacity:1;background:var(--fill-3)}
:is(.instrument,.drum-instrument) .value-slider:has(.instrument-curve-glyph) .value-slider-name{padding-right:22px}
.drum-instrument .value-slider .instrument-curve-glyph:disabled{opacity:0;cursor:default;background:transparent}
.drum-instrument .value-slider:hover .instrument-curve-glyph:disabled{opacity:.2}
.drum-instrument .value-slider .instrument-curve-glyph[data-state=drawn]:disabled{opacity:.5}

@media (width < 760px){
  .instrument-rows,.instrument-columns{grid-template-columns:minmax(0,1fr)}
  .instrument-columns{row-gap:8px}
  .instrument-scope{order:0}
  .instrument [data-instrument-group=env] .instrument-column>.instrument-subhead{display:none}
  .scope-display-canvas{height:56px}
}
/* A phone: the top row on two lines (the switch and the presets, then the trim), the preset picker taking what is left. */
@media (width < 600px){
  .instrument-top{gap:8px}
  .instrument-presets{flex:1 1 0}
  .instrument .instrument-preset{flex:1 1 auto;max-width:none}
  .instrument-trim{flex:1 1 100%;min-width:0;max-width:none;margin-left:0}
}
@media (width < 600px){.instrument-scope{display:none}}
/* Reduced motion keeps a refused value's rose, held still for a moment instead of fading. */
@media(prefers-reduced-motion:reduce){.value-slider-value.value-slider-refused{animation-duration:1.2s!important;animation-timing-function:steps(1,end)}}

/* The strip yields its space to editing in short windows; a visible Filter can still own the analyser. */
@media (height <= 720px){.instrument .scope-display{display:none}}

/* Static drum instruments: the synth tab's rows (ValueSlider on its grid, the curve glyph in the name), each with a
   quiet reset; a head with the sound picker (an edited sound says so in it), Reset sound and what the controls reach;
   a status line only while there is something to say. */
.drum-instrument{container-type:inline-size;min-width:0;padding:2px 0 0;color:var(--text)}
.drum-instrument-head{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;min-height:28px;margin:0 0 10px}
.drum-instrument-head label{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:11px}
/* A fixed width: an "· edited" mark appearing in an option never moves the head. */
.drum-instrument .drum-instrument-sound{width:156px;height:28px;min-width:0;max-width:100%;padding:0 6px;border-radius:6px;background:var(--fill-1);font-size:12px;text-overflow:ellipsis}
.drum-instrument .drum-instrument-sound option{background:var(--panel-raised);color:var(--text)}
.drum-instrument .drum-instrument-reset{height:28px;padding:0 8px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--text-3);font-size:12px;line-height:26px}
.drum-instrument .drum-instrument-reset:hover{background:var(--fill-3);border-color:transparent}
.drum-instrument .drum-instrument-reset:disabled{opacity:var(--disabled);background:transparent;cursor:default}
.drum-instrument-scope{flex:1 1 auto;min-width:0;margin:0;color:var(--muted);font-size:11px;line-height:16px;text-align:right;overflow-wrap:anywhere}
.drum-instrument-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 24px;min-width:0}
.drum-instrument-control{display:grid;grid-template-columns:minmax(0,1fr) 24px;align-items:center;gap:0 4px;min-width:0}
.drum-instrument .drum-control-reset{width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--muted);font-size:13px;line-height:1}
.drum-instrument .drum-control-reset:hover{background:var(--fill-3)}
.drum-instrument .drum-control-reset:disabled{opacity:var(--disabled);background:transparent;cursor:default}
.drum-instrument-status{margin:10px 0 0;color:var(--muted);font-size:11px;line-height:16px}
.drum-instrument-status:empty{display:none}
/* Two columns only where each track keeps room to drag (the synth tab's rows go to one column below 760 px). */
@container (width <= 699px){.drum-instrument-controls{grid-template-columns:minmax(0,1fr)}}
@container (width <= 559px){.drum-instrument-scope{flex-basis:100%;text-align:left}}

.block-editor{--track-color:var(--accent);margin:6px 0 2px;min-width:0;max-width:100%;padding:8px 12px 0;background:var(--panel);border:1px solid var(--edge);border-radius:10px;font-size:12px;box-shadow:0 10px 28px #00000038}
.block-editor p{margin:0}
.block-editor-tool[aria-disabled=true],.block-editor-wide[aria-disabled=true]{opacity:var(--disabled);cursor:default}
/* the header: the block, its toolbar, collapse */
.block-editor-head{display:flex;align-items:center;flex-wrap:wrap;gap:2px 10px;min-width:0;margin:-8px -12px 0;padding:8px 12px 0;border-radius:10px 10px 0 0}
/* Only the heading collapses the editor (a near-miss on the toolbar never does): it alone shows the hover. */
.block-editor-head:has(.block-editor-heading:hover){background:var(--fill-1)}
.block-editor-head:has(.block-editor-heading:hover) .block-editor-close{color:var(--text)}
.block-editor-tools{cursor:default}
.block-editor-heading{display:flex;align-items:baseline;gap:8px;min-width:0;flex:0 1 auto;cursor:pointer}
.block-editor-track{margin:0;font-size:13px;font-weight:600;color:var(--track-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:18ch}
.block-editor-place{font-family:var(--mono);font-size:11px;color:var(--text-4);white-space:nowrap}
.block-editor-count{font-size:11px;color:var(--muted);white-space:nowrap}
.block-editor-tools{display:flex;align-items:center;flex-wrap:wrap;gap:2px;flex:1 1 auto;min-width:0}
.block-editor .block-editor-tool{display:inline-flex;align-items:center;gap:5px;height:28px;min-width:28px;padding:0 7px;border:0;border-radius:6px;background:transparent;color:var(--text-3);font-size:12px;line-height:28px;cursor:pointer}
.block-editor-icon{flex:none;width:15px;height:15px;display:block}
.block-editor-tool-text{white-space:nowrap}
.block-editor .block-editor-tool:hover{background:var(--fill-3)}
.block-editor .block-editor-tool[aria-disabled=true]:hover{background:transparent}
.block-editor-sep{flex:none;width:1px;height:14px;margin:0 4px;background:var(--edge)}
/* Divide: a native select, invisible over its icon-and-word face, keeps the keyboard and the change event. */
.block-editor-divide-wrap{position:relative}
.block-editor-divide-wrap:has(> select[aria-disabled=true]){opacity:var(--disabled)}
.block-editor-divide-wrap:focus-within{outline:var(--focus-ring);outline-offset:1px}
.block-editor .block-editor-divide{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;opacity:0;cursor:pointer;appearance:none;-webkit-appearance:none}
.block-editor-divide option{background:var(--panel-raised);color:var(--text)}
.block-editor-close{flex:none;margin-left:auto;width:28px;height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--muted);font-size:18px;line-height:1}
/* the ⋯ menu (a native popover in the top layer) */
/* the ⋯ menu and the block sound picker share the panel look */
.block-editor-menu,.block-editor-popover{margin:0;background:var(--panel-raised);color:#f1ece0;border:1px solid var(--edge-2);border-radius:10px;box-shadow:0 14px 36px #00000090}
.block-editor-menu{min-width:176px;padding:4px}
.block-editor-popover{width:min(400px,calc(100% - 16px));max-height:calc(100dvh - 16px);overflow:auto;overscroll-behavior:contain;padding:8px 12px 12px}
.block-editor-blocksound .block-editor-caption{margin:2px 0 8px}
.block-editor-blocksound .keypad-row{grid-template-columns:52px minmax(0,1fr)}
.block-editor-blocksound .block-editor-wide{margin-top:10px}
.block-editor-menu .block-editor-menu-item{display:block;width:100%;padding:7px 10px;border:0;border-radius:6px;background:transparent;text-align:left;font-size:12px;color:inherit}
.block-editor-menu .block-editor-menu-item:hover{background:var(--fill-3)}
.block-editor-menu .block-editor-menu-item:focus-visible{background:var(--fill-3);outline-offset:-2px}
.block-editor-menu .block-editor-menu-item[aria-disabled=true]{opacity:var(--disabled);cursor:default;background:transparent}
.block-editor-menu .block-editor-danger{color:var(--rose)}
.block-editor-menu-sep{height:1px;margin:4px 6px;border:0;background:var(--line)}
.block-editor-menu .block-editor-narrow-only{display:none}
/* tabs */
.block-editor-tabs{display:flex;gap:2px;margin:6px 0 10px;border-bottom:1px solid var(--fill-3);min-width:0}
.block-editor-tab{margin-bottom:-1px;padding:6px 10px;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--muted);font-size:12px}
.block-editor-tab:hover{background:transparent;color:var(--text-2)}
.block-editor-tab[aria-selected=true]{color:var(--text);border-bottom-color:var(--accent);font-weight:600}
.block-editor-panel{min-width:0}
.block-editor h3{margin:12px 0 4px}
/* Plain retained Effects panels; disclosure headings below remain for Draw Tools and standalone widgets. */
.block-editor-group{margin:0}
.block-editor-group-head{display:flex;align-items:center;gap:8px;height:28px;margin:0 -6px;padding:0 6px;border-radius:6px;cursor:pointer;list-style:none;min-width:0;user-select:none}
.block-editor-group-head::-webkit-details-marker{display:none}
.block-editor-group-head:hover{background:var(--fill-1)}
.block-editor-group-head:focus-visible{outline:var(--focus-ring);outline-offset:-2px}
.block-editor-group-head::before{content:'';flex:none;width:6px;height:6px;margin:0 2px 1px 1px;border-right:1.5px solid var(--label);border-bottom:1.5px solid var(--label);transform:rotate(-45deg);transition:transform .15s}
.block-editor-group[open]>.block-editor-group-head::before{transform:rotate(45deg);margin-bottom:3px}
.block-editor-group-title{flex:none}
.block-editor-group-note{min-width:0;font-size:10px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.block-editor-group-note:empty{display:none}
.block-editor-group>.block-editor-rows{padding:2px 0 8px}
.block-editor-group>.block-editor-wide{margin:0 0 8px}
/* keys: the target line, the plays disclosure, the block keypad behind it */
.block-editor-keyline{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:2px 12px;margin:0 0 8px;min-width:0}
.block-editor .block-editor-target{min-width:0;color:var(--text-2);font-size:12px;line-height:28px;overflow-wrap:anywhere}
.block-editor-pad-scope{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:0 0 14px}
.block-editor-pad-scope-label{color:var(--muted);font-size:11px;margin-right:4px}
.block-editor .block-editor-pad-scope-button{min-height:30px;padding:4px 11px;border:1px solid var(--edge);border-radius:7px;background:var(--fill-1);color:var(--muted);font-size:12px}
.block-editor .block-editor-pad-scope-button[aria-pressed=true]{color:var(--text);border-color:var(--selected-edge);background:var(--selected-bg)}
.block-editor-pad-range{display:inline-flex;align-items:center;gap:10px;margin-left:6px}
.block-editor-pad-range label{display:flex;align-items:center;gap:5px;color:var(--muted);font-size:11px}
.block-editor-pad-range input{width:58px;min-width:0;height:30px;padding:3px 5px;border:1px solid var(--field-edge);border-radius:6px;background:var(--fill-1);color:var(--text);font:12px var(--mono);box-sizing:border-box}
.block-editor-plays{display:inline-flex;align-items:center;gap:6px;height:28px;margin-left:auto;padding:0 6px 0 8px;border:0;border-radius:6px;background:transparent;color:var(--muted);font-size:11px}
.block-editor-plays[aria-expanded=true]{color:var(--text-2);background:var(--fill-2)}
.block-editor-chevron{display:block;width:10px;height:10px;opacity:.85;transition:transform .15s}
.block-editor-plays[aria-expanded=true] .block-editor-chevron{transform:rotate(180deg)}
.block-editor .block-editor-caption{margin-top:6px}
.block-editor-wide{margin-top:8px;padding:5px 10px;font-size:11px}
.block-editor .block-editor-wide[aria-disabled=true]:hover{background:var(--fill-2);border-color:var(--edge)}
/* the keypad */
.keypad{display:grid;gap:6px;min-width:0;margin:0}
.keypad[aria-busy=true],.keypad[aria-busy=true] button{cursor:progress}
.keypad-row{display:grid;grid-template-columns:56px minmax(0,1fr);gap:8px;align-items:start;min-width:0}
.keypad-title{padding-top:8px}
.keypad-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(40px,1fr));gap:3px;min-width:0}
.keypad-cell .keypad-grid{grid-template-columns:repeat(auto-fill,minmax(100px,1fr))}
/* Words longer than a note name (Spread, a sample's name) take two of the row's cells, so every row keeps one grid. */
.keypad-chordVoicing button,.keypad-sample button{grid-column:span 2}
.keypad button{min-width:0;height:28px;padding:0 4px;font-size:11px;overflow:hidden;text-overflow:ellipsis;background:var(--fill-1);border-color:var(--fill-3);border-radius:6px;transition:background .1s,border-color .1s}
.keypad button:hover{background:var(--fill-2);border-color:var(--edge-3)}
.keypad button[aria-checked=true]{color:var(--text);background:var(--selected-bg);border-color:var(--selected-edge)}
.keypad button:focus-visible{outline:var(--focus-ring);outline-offset:1px}
/* ranges */
.block-editor-rows{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(300px,100%),1fr));gap:0 24px;min-width:0}
.block-editor-shape .block-editor-rows{grid-template-columns:repeat(auto-fit,minmax(min(400px,100%),1fr))}
.block-editor-range{display:flex;align-items:center;gap:8px;min-width:0;min-height:28px;margin:1px 0}
.block-editor-label{flex:none;width:88px;display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
.block-editor-name{max-width:100%;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.block-editor-range input[type=range]{flex:1;min-width:60px;margin:0}
.block-editor-range output{flex:none;min-width:58px;text-align:right;font-family:var(--mono);font-size:11px;font-variant-numeric:tabular-nums;color:var(--text-2)}
.block-editor .block-editor-reset{flex:none;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;font-size:13px;line-height:1;color:var(--muted)}
.block-editor .block-editor-reset[aria-disabled=true]{opacity:var(--disabled);background:transparent}
.block-editor-curve{padding:0 4px;border-radius:3px;font-size:9px;line-height:14px;color:var(--text-4);background:var(--fill-1);border:1px solid var(--edge)}
/* EQ: one small upright range per band */
/* the curve surface */
.curve-surface{min-width:0}
.curve-axis{display:flex;align-items:center;gap:10px;margin:0 0 8px;color:var(--muted)}
.curve-axis select{max-width:100%;min-width:0;font-size:12px;padding:5px 8px}
.curve-canvas{display:block;width:100%;height:112px;background:var(--surface-1) linear-gradient(0deg,transparent 0,transparent calc(25% - 1px),var(--fill-2) calc(25% - 1px),var(--fill-2) 25%,transparent 25%,transparent calc(50% - 1px),var(--fill-3) calc(50% - 1px),var(--fill-3) 50%,transparent 50%,transparent calc(75% - 1px),var(--fill-2) calc(75% - 1px),var(--fill-2) 75%,transparent 75%);border:1px solid var(--edge-3);border-radius:6px;touch-action:none;cursor:crosshair}
.block-editor .curve-scale{margin:6px 0 8px;font-family:var(--mono);font-size:10px;color:var(--muted)}
@media (width < 760px){
  .block-editor-tool-text{display:none}
  .block-editor .block-editor-tool{padding:0 6px}
}
@media (width <= 440px){
  .block-editor{padding:8px 10px 0}
  .block-editor>.deck-rail{margin-inline:-10px}
  .block-editor .block-editor-wide-only,.block-editor-sep{display:none}
  .block-editor-menu .block-editor-narrow-only{display:block}
  .block-editor .block-editor-tool{min-width:26px;padding:0 6px}
  .block-editor-tab{flex:1 1 auto;padding:6px 4px}
  .keypad-row{grid-template-columns:minmax(0,1fr);gap:0}
  .keypad-title{display:none}
  .block-editor-blocksound .keypad-row{grid-template-columns:minmax(0,1fr)}
  .keypad-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .keypad-cell .keypad-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .block-editor-label{width:76px}
  .block-editor-range output{flex:0 0 62px;min-width:0;font-size:10px;overflow:hidden;text-overflow:ellipsis}
}
.eq-surface { min-width: 0; }
.eq-surface svg { display: block; width: 100%; max-height: 300px; touch-action: none; overflow: visible; }
.eq-surface svg line { stroke: currentColor; opacity: .12; }
.eq-surface svg text { fill: currentColor; font-size: 10px; opacity: .65; }
.eq-response { fill: none; stroke: var(--track-color, #a6b8d7); stroke-width: 2; }
.eq-ghost { stroke-dasharray: 4 4; opacity: .4; }
.eq-surface circle { fill: var(--surface, #222); stroke: var(--track-color, #a6b8d7); stroke-width: 2; cursor: move; }
/* The chosen band wears amber; keyboard focus a near-white ring, so the two never read alike. */
.eq-surface circle.selected { fill: var(--track-color, #a6b8d7); stroke: var(--accent); }
.eq-surface circle:focus { outline: none; }
.eq-surface circle:focus-visible { stroke: var(--text); stroke-width: 2.5; }
.eq-surface circle.eq-hit { fill: transparent; stroke: none; }
.eq-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.eq-tools button, .eq-tools select { font: inherit; color: inherit; background: transparent; border: 1px solid var(--edge); border-radius: 5px; padding: 5px 8px; }
.eq-tools [aria-pressed="true"] { color: var(--text); background: var(--selected-bg); border-color: var(--selected-edge); }
.eq-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.eq-controls label { display: grid; grid-template-columns: 1fr auto; gap: 5px; font-size: 12px; }
.eq-controls input { grid-column: 1 / -1; grid-row: 2; width: 100%; margin: 0; accent-color: var(--track-color); }
.eq-controls output { font-variant-numeric: tabular-nums; }
.eq-note { font-size: 11px; opacity: .65; margin: 12px 0 0; }
@media (width <= 540px) { .eq-controls { grid-template-columns: 1fr; gap: 8px; } .eq-tools { gap: 5px; } }

.value-readout { border: 0; background: transparent; color: inherit; font: inherit; padding: 4px 0; text-align: inherit; cursor: ns-resize; touch-action: none; width: 100%; }
/* "mixed": the targets hold different values; quieter than the value it follows. */
.value-note { color: var(--muted); }
.value-slider-mixed .value-slider-value { color: var(--muted); }
.value-readout:focus-visible, .value-input:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
/* The typed value: the inline field style (a well, the edge, a 6 px corner), rose when refused. Scoped to its control so
   it outranks the page's input[type=text] rule, which drew it until now. */
.value-control .value-input { box-sizing: border-box; min-width: 0; width: 100%; color: inherit; background: var(--sunken); border: 1px solid var(--edge); border-radius: 6px; font: inherit; padding: 3px; text-align: right; }
.value-control .value-input[aria-invalid="true"] { border-color: var(--rose); }
.eq-controls .value-input { grid-column: auto; grid-row: auto; }
.eq-disclosure { color: inherit; font: inherit; font-weight: inherit; border: 0; background: transparent; padding: 0; cursor: pointer; }
.eq-disclosure::before { content: '▾'; display: inline-block; margin-right: 7px; }
.eq-disclosure[aria-expanded="false"]::before { content: '▸'; }

/* The Draw tab's synth-curve editor (SYNTH-CURVES-PLAN.md §4; synth-curve-editor.ts), on the instrument displays'
   pieces (instrument.css: the plot's frame, grid, trace, area, handles, bend points, readout) and the block editor's
   type scale. One trace in the lane colour; amber only for focus and selection; the grid in beats; numbers where they
   say something; the tools behind one disclosure. */
.curve-editor{display:flex;flex-direction:column;min-width:0}
.curve-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;min-width:0;margin:0 0 8px}
.curve-pick{display:flex;align-items:center;gap:8px;min-width:0;color:var(--muted);font-size:11px}
.block-editor .curve-pick select{height:28px;min-width:0;max-width:240px;padding:0 6px;border-radius:6px;font-size:12px;background:var(--fill-1);text-overflow:ellipsis}
.curve-pick select option,.curve-pick select optgroup{background:var(--panel-raised);color:var(--text)}
.curve-chips{display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}
.curve-chips-label{font-size:10px;color:var(--muted);margin-right:2px}
.block-editor .curve-chip{height:22px;padding:0 8px;border:1px solid var(--edge);border-radius:11px;background:var(--fill-1);color:var(--text-4);font-size:10px;line-height:20px}
.block-editor .curve-chip:hover{background:var(--fill-2);border-color:var(--edge-strong);color:var(--text)}
.block-editor .curve-chip[aria-pressed=true]{color:var(--text);background:var(--selected-bg);border-color:var(--selected-edge)}
.block-editor .curve-chip-inert{opacity:.65}
.curve-head-tools{display:flex;align-items:center;gap:10px;margin-left:auto}
.curve-snap-field{display:inline-flex;align-items:center;gap:5px;color:var(--muted);font:10px var(--mono)}
.block-editor .curve-snap{height:24px;margin:0;padding:0 8px;border:1px solid var(--line);border-radius:12px;background:var(--bg);color:var(--muted);font:600 10px/22px var(--mono);letter-spacing:.2px;appearance:none;-webkit-appearance:none;cursor:pointer}
.block-editor .curve-snap:hover{color:var(--text);border-color:#ffffff38;background:var(--panel)}
.curve-snap option{background:var(--panel-raised);color:var(--text)}
.curve-effects{min-width:0}
.curve-graph{margin:0 0 6px}
.curve-plot{height:176px;cursor:crosshair}
.block-editor .curve-expand{height:28px;padding:0 9px;border-radius:6px;font-size:11px;white-space:nowrap}
.curve-editor-expanded .curve-plot,.curve-editor-expanded .curve-surface .curve-canvas{height:clamp(352px,55vh,720px)}
.curve-graph-off .curve-plot{cursor:default}
.curve-graph-active .curve-plot{cursor:grabbing}
.curve-graph-active.curve-graph-draw .curve-plot{cursor:crosshair}
.curve-graph-active.curve-graph-level .curve-plot{cursor:ns-resize}
.curve-graph-inert .instrument-curve,.curve-graph-inert .instrument-area,.curve-graph-inert .curve-clip,.curve-graph-inert .curve-point,.curve-graph-inert .curve-rail-handle rect{opacity:.6}
.curve-beatline{stroke:var(--fill-3);stroke-width:1}
.curve-snaptick{stroke:var(--edge-2);stroke-width:1}
.curve-onset{fill:var(--faint)}
.curve-patch{stroke:#ffffff40;stroke-width:1;stroke-dasharray:3 3}
.curve-patch-label{fill:var(--faint);font:9px var(--mono)}
.curve-clip{fill:none;stroke:var(--track-color,var(--accent));stroke-width:1.75;stroke-dasharray:2 3;stroke-linecap:round}
.curve-stroke{fill:none;stroke:var(--track-color,var(--accent));stroke-width:1.75;stroke-linejoin:round;stroke-linecap:round}
/* The selection box (⌘-drag, Ctrl elsewhere), as the Note editor's and the lanes' marquee. */
.curve-marquee{fill:color-mix(in srgb,var(--accent) 15%,transparent);stroke:var(--accent);stroke-width:1;shape-rendering:crispEdges;pointer-events:none}
.curve-point{r:5px;fill:var(--track-color,var(--accent));stroke:var(--panel);stroke-width:4;paint-order:stroke;cursor:grab;transition:r .12s}
.curve-point:hover,.curve-point.instrument-hot{r:6px}
.curve-point:focus{outline:none}
/* Selection wears amber; keyboard focus a near-white ring, so the two never read alike (focus shows on a chosen point too). */
.curve-point.curve-point-selected{stroke:var(--accent)}
.curve-point:focus-visible{stroke:var(--text)}
.curve-point.curve-point-pinned{fill:var(--panel);stroke:var(--track-color,var(--accent));stroke-width:1.75;paint-order:normal}
.curve-point.curve-point-pinned.curve-point-selected{stroke:var(--accent)}
.curve-point.curve-point-pinned:focus-visible{stroke:var(--text)}
.curve-bend{cursor:ns-resize}
.curve-graph.curve-graph-drawing .curve-point,.curve-graph.curve-graph-drawing .instrument-bend,.curve-graph.curve-graph-drawing:hover .instrument-bend,.curve-graph.curve-graph-drawing .curve-rail-handle{opacity:0;pointer-events:none;transition:opacity .08s}
/* Focus from a pointer gesture draws no ring on the plot (the keyboard's does); points and the rail handle say focus with their amber stroke. */
.curve-plot.curve-plot-pointer-focus:focus-visible,.curve-plot:focus:not(:focus-visible){outline:none}
.curve-rail-handle:focus{outline:none}
.curve-rail-edge{stroke:var(--fill-3);stroke-width:1}
.curve-rail-track{stroke:var(--line);stroke-width:1}
.curve-rail-zero{stroke:var(--faint);stroke-width:1}
.curve-rail-handle{cursor:ns-resize}
.curve-rail-handle rect{fill:var(--track-color,var(--accent));stroke:var(--panel);stroke-width:2;transition:filter .12s}
.curve-rail-handle line{stroke:var(--surface-1);stroke-opacity:.55;stroke-width:1}
.curve-rail-handle:hover rect,.curve-rail-handle.instrument-hot rect{filter:brightness(1.12)}
.curve-rail-handle:focus-visible rect{stroke:var(--text)}
.curve-playhead{stroke:color-mix(in srgb,var(--rose) 94%,transparent);stroke-width:1;pointer-events:none}
/* A value's words on the plot sit on a halo of the plot's ground, clear of the lines and the trace behind them. */
.curve-axis-label{paint-order:stroke;stroke:var(--surface-1);stroke-width:3px;stroke-linejoin:round}
.curve-plot-frame{position:relative}
.curve-canvas-playhead{position:absolute;top:1px;bottom:1px;width:1px;margin-left:-.5px;background:color-mix(in srgb,var(--rose) 94%,transparent);pointer-events:none}
.curve-rest-overlay{position:absolute;inset:1px;pointer-events:none;overflow:hidden}
.curve-rest-band{position:absolute;top:0;bottom:0;box-sizing:border-box;border-inline:1px solid var(--fill-3);background:#c1c2bb1a}
.curve-rest-band.curve-rest-selected{border-color:var(--edge-3);background:#c1c2bb24}
@media (pointer:fine){
  .curve-point{r:3px;stroke-width:2}
  .curve-point:hover,.curve-point.instrument-hot,.curve-point.curve-point-selected,.curve-point:focus-visible{r:5px}
  /* A chosen point wears a full 2-px amber ring (a focused one a white ring), so several read at a glance among the small unchosen ones. */
  .curve-point.curve-point-selected:not(.curve-point-pinned),.curve-point:focus-visible:not(.curve-point-pinned){stroke-width:4}
}
.curve-editor .instrument-readout{position:absolute;top:6px;right:8px;margin:0;padding:0 6px;border-radius:4px;background:color-mix(in srgb,var(--surface-1) 90%,transparent);box-shadow:inset 0 0 0 1px var(--line);color:var(--text-2);font:10px/18px var(--mono);font-variant-numeric:tabular-nums;white-space:nowrap;pointer-events:none}
.curve-editor .instrument-readout-left{right:auto;left:8px}
.curve-editor .instrument-readout-clips{color:var(--muted)}
.block-editor .curve-field{position:absolute;top:6px;right:8px;width:112px;height:20px;padding:0 4px;border-radius:4px;background:var(--sunken);font-family:var(--mono);font-size:11px;text-align:right}
.block-editor .curve-field[aria-invalid=true]{border-color:var(--rose)}
.block-editor .curve-hint{margin:0 0 6px;min-height:16px}
.block-editor .curve-effects-note{margin:6px 0}
/* During a gesture the hint's notes step aside but stay in the accessibility tree with their text, so the live region announces nothing when they return. */
.curve-hint-notes.curve-hint-quiet{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.curve-tools-rows{display:flex;flex-direction:column;gap:6px;padding:4px 0 8px}
.curve-tools-row{display:flex;flex-wrap:wrap;align-items:center;gap:4px;min-width:0}
.curve-tools-row .block-editor-sep{margin:0 6px}
.block-editor .curve-tool{height:28px;padding:0 9px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--text-3);font-size:12px;line-height:26px}
.block-editor .curve-tool:hover{background:var(--fill-3);border-color:transparent}
.block-editor .curve-tool[aria-disabled=true]{opacity:var(--disabled);cursor:default;background:transparent}
.curve-depth{flex:1 1 260px;max-width:420px;min-width:220px}
@media (width < 760px){
  .curve-plot{height:150px}
}
@media (width < 600px){
  .block-editor .curve-pick select{max-width:100%;flex:1 1 auto}
  .curve-pick{flex:1 1 100%}
  .curve-head-tools{margin-left:0;flex:1 1 100%;justify-content:space-between}
  .curve-depth{min-width:0;flex-basis:100%;max-width:none}
  /* The Drawn chips keep their line from the start, so the plot does not drop a line when the first curve lands (the
     Timing tab's and the sample pitch editor's single-curve editors never show chips). */
  .curve-head .curve-chips{flex:1 1 100%;min-height:22px}
  .curve-head .curve-chips[hidden]{display:flex!important;visibility:hidden}
  :is(.motion-curve-editor,.sample-pitch-editor) .curve-head .curve-chips[hidden]{display:none!important}
}
@media(pointer:coarse){
  .block-editor .curve-tool,.block-editor .curve-chip,.block-editor .curve-pick select,.block-editor .curve-snap{min-height:44px;height:44px;line-height:42px}
  .block-editor .curve-chip{border-radius:22px;padding:0 12px}
  .curve-head .curve-chips{min-height:44px}
  .curve-editor .instrument-bend{opacity:.85}
  .curve-point{r:6px}
  .curve-editor .block-editor-group-head{height:44px}
  .curve-editor .curve-depth{height:44px}
}

.block-tab-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-bottom:8px}
.block-tab-scope{flex-basis:100%;margin:5px 0 9px;font:400 11px/1.5 var(--mono);color:var(--muted);overflow-wrap:anywhere}
.block-tab-actions .block-editor-wide{width:auto;max-width:100%;white-space:normal}

/* Group bodies keep every existing row; the deck owns their visibility and shared height. */
.block-editor .deck-panel>.block-editor-group>.block-editor-rows,.section-editor .deck-panel>.block-editor-group>.block-editor-rows{padding-top:2px}
.section-editor:has(>.deck-rail){padding-bottom:0}

.block-editor[data-empty-instrument=true] .block-editor-tools{display:none}

/* Draw workbench: one quiet row of shape icons (the count of a repeating shape at its end, only for one), then the
   adjustments, only once there is a curve to adjust. */
.curve-toolbar{container-type:inline-size;min-width:0;margin:0 0 8px}
.curve-preset-controls{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;min-width:0}
.curve-control-label{color:var(--muted);font-size:10px;line-height:14px}
.curve-shape-palette{display:flex;flex-wrap:wrap;gap:2px;min-width:0}
:is(.block-editor,.clip-editor,.section-editor) .curve-shape{display:inline-flex;align-items:center;justify-content:center;width:34px;height:28px;min-width:0;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--muted);transition:color .12s,background .12s,border-color .12s}
.curve-shape svg{flex:none;width:24px;height:12px;overflow:visible}
.curve-shape svg path{fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
:is(.block-editor,.clip-editor,.section-editor) .curve-shape:hover:not(:disabled){background:var(--fill-2);border-color:transparent;color:var(--text)}
:is(.block-editor,.clip-editor,.section-editor) .curve-shape[aria-pressed=true]{color:var(--track-color,var(--accent));background:color-mix(in srgb,var(--track-color,var(--accent)) 12%,transparent);border-color:color-mix(in srgb,var(--track-color,var(--accent)) 55%,transparent)}
:is(.block-editor,.clip-editor,.section-editor) .curve-shape:focus-visible,:is(.block-editor,.clip-editor,.section-editor) .curve-toolbar-action:focus-visible,:is(.block-editor,.clip-editor,.section-editor) .curve-cycle-step:focus-visible,.curve-cycle-input:focus-visible{outline:var(--focus-ring);outline-offset:2px}
.curve-cycle-field{display:flex;align-items:center;gap:6px;min-width:0}
.curve-cycle-stepper{display:grid;grid-template-columns:24px 36px 24px;height:28px;box-sizing:border-box;min-width:0;border:1px solid var(--edge);border-radius:6px;background:var(--sunken)}
:is(.block-editor,.clip-editor,.section-editor) .curve-cycle-input{width:100%;min-width:0;height:26px;box-sizing:border-box;padding:2px;border:0;border-inline:1px solid var(--fill-2);border-radius:0;background:transparent;color:var(--text);font:12px var(--mono);font-variant-numeric:tabular-nums;text-align:center;appearance:textfield;-moz-appearance:textfield}
.curve-cycle-input::-webkit-inner-spin-button,.curve-cycle-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.curve-cycle-input{cursor:ns-resize;touch-action:none}
.curve-cycle-input:focus{background:var(--fill-1)}
.curve-scrubbing .curve-cycle-stepper{border-color:var(--track-color,var(--accent))}
.curve-scrubbing .curve-cycle-input{color:var(--track-color,var(--accent))}
:is(.block-editor,.clip-editor,.section-editor) .curve-cycle-step{padding:0;min-width:0;height:26px;border:0;border-radius:5px;background:transparent;color:var(--text);font:14px var(--mono)}
:is(.block-editor,.clip-editor,.section-editor) .curve-cycle-step:hover:not(:disabled){background:var(--fill-3)}
/* The count's hint speaks only when it must: a count it cannot take, or what a shape's limit did. */
.curve-cycle-hint{color:var(--muted);font-size:10px;line-height:14px}
.curve-cycle-hint:empty{display:none}
.curve-cycle-field:has([aria-invalid=true]) .curve-cycle-hint{color:var(--rose-soft)}
.curve-cycle-field:has(input:disabled) .curve-cycle-stepper{opacity:var(--disabled)}
:is(.block-editor,.clip-editor,.section-editor) .curve-cycle-step:disabled{color:var(--muted);opacity:var(--disabled);cursor:default}
.curve-adjustments{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding:8px 0 0}
.curve-transform-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;align-items:center;min-width:0}
.curve-transform-controls>.value-slider{display:grid;grid-template-columns:36px minmax(30px,1fr) 72px;min-width:0;max-width:none;width:100%;gap:7px;height:28px}
.curve-transform-controls .value-slider-name{width:auto;font-size:11px}
.curve-transform-controls .value-slider-value{font-variant-numeric:tabular-nums;font-size:11px}
.curve-transform-controls .value-slider-fill{background:var(--track-color,var(--accent))}
.curve-toolbar-actions{display:flex;align-items:center;gap:4px;min-height:28px}
:is(.block-editor,.clip-editor,.section-editor) .curve-toolbar-action{padding:4px 8px;min-height:28px;border:1px solid var(--fill-2);border-radius:5px;background:transparent;color:var(--muted);font-size:10px;white-space:nowrap}
:is(.block-editor,.clip-editor,.section-editor) .curve-toolbar-action:hover:not(:disabled){background:var(--fill-2);color:var(--text);border-color:var(--edge-3)}
:is(.block-editor,.clip-editor,.section-editor) .curve-toolbar-action:disabled,:is(.block-editor,.clip-editor,.section-editor) .curve-shape:disabled{opacity:var(--disabled);cursor:default}
.curve-surface .curve-canvas{height:180px;box-sizing:border-box;border-color:var(--line);border-radius:5px}
/* Compact widths keep the adjustments on one line (Reset and Clear curve beside the two sliders, which give up track),
   so the band the toolbar keeps for them before there is a curve stays one row high; on the narrowest the actions go
   under the sliders, which stay side by side. */
@container (width <= 760px){
  .curve-adjustments{gap:10px}
  .curve-transform-controls{gap:12px}
  .curve-transform-controls>.value-slider{grid-template-columns:36px minmax(24px,1fr) 56px}
}
/* Narrower than the nine shapes and a repeating shape's count (460 px), the count wraps under the shapes: its line is
   kept from the start, so the plot stays put when the first curve lands. */
@container (width < 461px){
  .curve-preset-controls .curve-cycle-field[hidden]{display:flex!important;visibility:hidden}
}
@container (width <= 420px){
  .curve-adjustments{grid-template-columns:minmax(0,1fr);gap:6px}
  .curve-toolbar-actions{justify-content:flex-end}
  .curve-transform-controls{gap:8px}
  .curve-transform-controls>.value-slider{grid-template-columns:36px minmax(20px,1fr) 48px;gap:6px}
}
@media(pointer:coarse){:is(.block-editor,.clip-editor,.section-editor) .curve-toolbar-action,:is(.block-editor,.clip-editor,.section-editor) .curve-cycle-step,:is(.block-editor,.clip-editor,.section-editor) .curve-cycle-input,:is(.block-editor,.clip-editor,.section-editor) .curve-shape{min-height:44px}:is(.block-editor,.clip-editor,.section-editor) .curve-shape{width:44px}.curve-cycle-stepper{height:auto;grid-template-columns:44px 44px 44px}.curve-transform-controls>.value-slider{height:44px}}
.draw-context-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin:0 0 14px;padding-bottom:10px;border-bottom:1px solid var(--fill-2)}
.draw-context-bar>div{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.block-editor .draw-context-bar p{margin:0;font-family:inherit;font-size:11px;color:var(--muted)}
.block-editor .draw-context-bar button{min-height:28px;padding:4px 8px;font-size:11px;margin:0;border:1px solid var(--fill-3);background:transparent}
.curve-cycle-stepper:has([aria-invalid=true]){border-color:var(--rose)}
.block-editor .draw-context-bar p{flex-basis:auto}
.draw-context-bar .block-tab-actions{margin:0}
.effects-clipboard{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;min-width:0}
.effects-clipboard button{flex:none;min-height:32px;font-size:11px}
.effects-clipboard-note{flex:1 1 180px;min-width:0;color:var(--muted);font-size:11px;line-height:1.5;overflow-wrap:anywhere}

.curve-span-control label{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:11px}
.curve-span-control input{width:calc(9ch + 16px);font-variant-numeric:tabular-nums}
.curve-span-control select,.curve-span-control input{min-height:28px}
.curve-time-ruler{display:grid;grid-template-columns:1fr 2fr 2fr 2fr 1fr;text-align:center;font:10px var(--mono,monospace);color:var(--muted)}
.curve-time-ruler span:first-child{text-align:left}.curve-time-ruler span:last-child{text-align:right}
.curve-time-ruler[hidden]{display:none}

.motion-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 12px; }
.motion-heading h3,.motion-title { margin:0 0 5px; font-size:12px; font-weight:600; letter-spacing:.04em; }
.motion-description { color:var(--muted); font-size:11px; line-height:1.55; margin:4px 0; }
.motion-heading .value-slider { flex:0 0 300px; grid-template-columns:40px minmax(90px,1fr) 64px; }
.motion-presets { display:flex; flex-wrap:wrap; gap:6px; margin:12px 0 8px; }
.motion-button { font:inherit; font-size:11px; color:var(--text); border:1px solid var(--edge-2); background:var(--fill-1); border-radius:5px; padding:6px 9px; cursor:pointer; }
.motion-button:hover { background:var(--fill-3); border-color:#ffffff40; }
.motion-button:focus-visible,.motion-exact:focus-visible,.rest-strip:focus-visible { outline:var(--focus-ring); outline-offset:3px; }
.motion-curve-editor { margin-top:12px; }
.motion-curve-editor .curve-head { justify-content:flex-end; }
.rest-editor { padding:0; margin:0 0 10px; }
.rest-editor .motion-heading { justify-content:flex-start; gap:10px; margin:4px 32px 2px 8px; min-height:26px; }
.rest-editor .motion-heading h3 { margin:0; font-size:11px; font-weight:500; letter-spacing:0; text-transform:none; color:var(--muted); }
.rest-editor .motion-heading>div { margin-right:auto; }
.rest-strip { position:relative; height:32px; margin:0 32px 0 8px; border:0; border-bottom:1px solid var(--fill-3); background:transparent; touch-action:none; overflow:hidden; cursor:crosshair; }
.rest-editor[data-curve=fx] .motion-heading,.rest-editor[data-curve=fx] .rest-strip { margin-inline:1px; }
.rest-grid { position:absolute; top:12px; bottom:12px; width:1px; background:var(--fill-1); pointer-events:none; }
.rest-grid-beat { top:0; bottom:0; font-size:0; background:var(--fill-2); }
.rest-grid-end { right:3px; width:auto; text-indent:0; background:none; }
.rest-span { position:absolute; top:0; bottom:0; padding:0; border:0; background:transparent; cursor:grab; }
.rest-span::before { content:''; position:absolute; inset:11px 0; border-radius:1px; background:#74777466; }
.rest-span:hover::before { background:#8d908d88; }
.rest-span[aria-pressed=true]::before { background:#a6aaa699; }
.rest-span:focus-visible { outline:var(--focus-ring); outline-offset:-2px; }
.rest-edge { position:absolute; top:0; bottom:0; width:7px; cursor:ew-resize; }
.rest-edge-start { left:0; }
.rest-edge-end { right:0; }
.rest-edge::after { content:''; position:absolute; width:1px; height:14px; top:50%; left:50%; transform:translate(-50%,-50%); background:#c7c9c9; opacity:0; }
.rest-span:hover .rest-edge::after,.rest-span[aria-pressed=true] .rest-edge::after { opacity:.55; }
.rest-editor .motion-button { border-color:transparent; background:transparent; color:var(--muted); padding:4px 6px; }
.rest-editor .motion-button:hover { color:var(--text); background:var(--fill-1); }
.rest-mixed { margin:4px 32px 0 8px; }
.rest-editor[data-curve=fx] .rest-mixed { margin-inline:1px; }
.rest-details { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:6px 32px 4px 8px; font-size:11px; }
.motion-exact { width:80px; box-sizing:border-box; color:inherit; border:1px solid var(--field-edge); border-radius:4px; padding:5px 7px; background:var(--fill-1); font:11px ui-monospace,monospace; }
.lane-block[data-swing]::after { content:''; position:absolute; inset:0; pointer-events:none; border-radius:inherit; background:linear-gradient(90deg,transparent 55%,var(--lane-color,#d9b767)); opacity:var(--swing-strength,.2); }
@media (width < 600px) { .motion-heading { align-items:flex-start; flex-wrap:wrap; gap:8px; } .motion-heading .value-slider { flex:1 1 180px; } .motion-exact { width:65px; } }

.sample-pitch-editor { padding: 4px 0 8px; }
.sample-pitch-editor .motion-heading > .value-slider { min-width: 220px; grid-template-columns: 68px minmax(90px, 1fr) minmax(64px, auto); }
.sample-pitch-formants { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; cursor: pointer; }
.sample-pitch-formants input { accent-color: var(--track-color, #367e92); }
.sample-pitch-draw > summary { padding: 10px 0; cursor: pointer; font-size: 12px; font-weight: 600; }
.sample-pitch-draw > summary:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

.sample-draw-choice { display:flex; align-items:center; gap:8px; font-size:11px; color:var(--muted); }
.sample-draw-choice select { font:inherit; color:var(--text); background:var(--panel); border:1px solid var(--edge); border-radius:5px; padding:5px 8px; }

/* A short opening settle, inspired by David's requested mechanical feeling.
   Layout and controls appear immediately; existing hidden/cancel/focus behavior
   owns closing. Kept editor nodes do not replay this on ordinary refreshes. */
@keyframes lane-tray-open{
  0%{transform:translateY(-5px);opacity:.96}
  70%{transform:translateY(1px);opacity:1}
  100%{transform:translateY(0);opacity:1}
}
.lanes .lane-editor-slot>.block-editor:not([hidden]){animation:lane-tray-open 200ms cubic-bezier(.2,.8,.3,1)}
@media(prefers-reduced-motion:reduce){.lanes .lane-editor-slot>.block-editor:not([hidden]){animation:none}}

.eq-surface .eq-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
.eq-surface .eq-controls label{min-width:0;grid-template-columns:minmax(0,1fr) 72px}
.eq-surface .eq-controls .value-control{width:72px}
.eq-surface .eq-width{fill:color-mix(in srgb,var(--accent) 5%,transparent);pointer-events:none}
.eq-surface .eq-selected-response{fill:none;stroke:color-mix(in srgb,var(--accent) 50%,transparent);stroke-width:1.2;stroke-dasharray:4 3;pointer-events:none;vector-effect:non-scaling-stroke}
.eq-surface .eq-width-line{fill:none;stroke:color-mix(in srgb,var(--accent) 44%,transparent);stroke-width:1;pointer-events:none;vector-effect:non-scaling-stroke}
.eq-surface .eq-note{line-height:1.5}
.eq-band-gains{margin:0 0 16px;border-block:1px solid var(--edge);padding:9px 0}
.eq-band-gains>summary{cursor:pointer;font-size:12px;padding:3px 0}
.eq-band-sliders{display:grid;grid-template-columns:repeat(var(--eq-band-count),minmax(68px,1fr));gap:4px;overflow-x:auto;padding:12px 2px 4px}
.eq-band-gain{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;border-radius:5px;padding:4px}
.eq-band-gain.selected{background:var(--fill-3)}
.eq-gain-select{font:inherit;font-size:10px;white-space:nowrap;color:inherit;background:transparent;border:0;padding:4px 0;cursor:pointer}
.eq-gain-select[aria-pressed="true"]{color:var(--track-color);font-weight:600}
.eq-band-gain>input[type="range"]{writing-mode:vertical-lr;direction:rtl;width:24px;height:128px;margin:0;accent-color:var(--track-color)}
.eq-band-gain .value-control{min-width:0;width:100%;font-size:11px;text-align:center;font-variant-numeric:tabular-nums}
.eq-band-gain .value-readout{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.eq-surface[data-eq-mode="graphic"] circle{cursor:ns-resize}
.eq-surface[data-eq-mode="mixed"] circle{cursor:default}
.eq-surface input:disabled,.eq-surface button:disabled{opacity:var(--disabled);cursor:default}
@media (width <= 660px){.eq-surface .eq-controls{grid-template-columns:1fr}}

/* The plot and the band bank share one retained footprint inside the deck. */
.deck-panel .eq-views{min-width:0;margin:0 0 10px}
.deck-panel .eq-views>div[data-sub=curve]{min-width:0}
.deck-panel .eq-views .eq-band-gains{margin:0;border:0;padding:0;min-width:0}
.deck-panel .eq-views .eq-band-gains>summary{display:none}
.deck-panel .eq-surface svg{max-height:220px;aspect-ratio:580/220;height:auto}
.deck-panel .eq-band-sliders{padding-top:2px}
/* Selected-band controls follow the deck's one-line name / range / value grid. */
.deck-panel .eq-controls{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px}
.deck-panel .eq-controls label{grid-template-columns:96px minmax(0,1fr) 64px;align-items:center;gap:0 4px;height:24px;font-size:11px}
.deck-panel .eq-controls label>input[type=range]{grid-column:2;grid-row:1;min-width:0;height:20px;width:100%;margin:0}
.deck-panel .eq-controls label>.value-control{grid-column:3;grid-row:1;min-width:0;width:64px;height:24px;line-height:24px;text-align:right}
.deck-panel .eq-controls .value-readout{height:24px;padding:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.deck-panel .eq-controls .value-input{height:24px;line-height:18px;width:100%;padding:2px;font-size:11px}
@media (width < 600px){.deck-panel .eq-controls{grid-template-columns:minmax(0,1fr)}}
.deck-panel .eq-note{position:relative;margin-top:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Moving tools to the group head keeps their styles and cancellation owners. */
.deck-panel[data-group=eq]>.deck-group-head{height:auto;min-height:28px;flex-wrap:wrap;gap:4px 10px}
.deck-panel[data-group=eq] .eq-tools{gap:2px;margin-bottom:0;min-width:0;flex-wrap:nowrap}
.deck-panel[data-group=eq] .eq-tools select,.deck-panel[data-group=eq] .eq-tools>button{height:28px;min-width:28px;padding:0 7px;font-size:11px}
.deck-panel[data-group=eq] .eq-tools .block-editor-tool{display:inline-flex;align-items:center;gap:4px;border:0;border-radius:6px;background:transparent;color:var(--text-3);line-height:28px}
.deck-panel[data-group=eq] .eq-tools .block-editor-tool:hover{background:var(--fill-3)}
.deck-panel[data-group=eq] .eq-tools :disabled{opacity:var(--disabled);cursor:default}
.deck-panel[data-group=eq] .eq-tools .block-editor-icon{display:block;flex:none;width:15px;height:15px}
.eq-reset-glyph{font-size:17px;line-height:1}
@media (width < 760px){
  .deck-panel[data-group=eq] .eq-tools .block-editor-tool-text{display:none}
  .deck-panel[data-group=eq] .eq-tools .block-editor-tool{padding:0;width:28px;justify-content:center}
  /* Native overlay scrollbars can claim the bottom 15px without reserving layout. */
  .deck-panel .eq-band-sliders{padding-bottom:19px}
  .deck-panel .eq-band-gain{gap:4px}
  .deck-panel .eq-band-gain>input[type=range]{height:80px}
  .deck-panel .eq-gain-select{height:20px;padding:0;line-height:20px}
  .deck-panel .eq-band-gain .value-control{height:14px;line-height:14px}
  .deck-panel .eq-band-gain .value-readout{height:14px;line-height:14px;padding:0}
  .deck-panel .eq-band-gain .value-input{height:14px;line-height:12px;padding:0}
}

.note-editor{color:var(--text);padding:0;background:transparent;border:0;border-radius:0;min-width:0}
.note-editor-header,.note-editor-actions,.note-editor-details{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.note-editor-title{display:none}.note-editor-selection{font-size:12px;color:var(--muted);flex:1}
.note-editor-snap-label,.note-editor-field{font-size:12px;color:var(--muted)}
.note-editor-action,.note-editor-snap,.note-editor-exact{background:var(--panel-raised);color:var(--text);border:1px solid var(--edge);border-radius:5px;padding:6px 9px;font:inherit}
.note-editor-action,.note-editor-snap{font-size:12px}.note-editor-action:disabled,.note-editor-exact:disabled,.note-editor-snap:disabled{opacity:var(--disabled)}
.note-editor-actions{margin-top:10px}.note-editor-help,.note-editor-pad-notice,.note-editor-status{font-size:12px;color:var(--muted);line-height:1.5}
.note-editor-pad-notice{margin:8px 0 0}
.note-editor-status{min-height:18px;margin:8px 0 0}.note-editor-details{margin-top:10px}.note-editor-field{display:flex;flex-direction:column;gap:4px}.note-editor-exact{box-sizing:border-box;width:145px;font-size:12px;border-color:var(--field-edge)}
.note-editor-grid{overflow:auto;max-height:360px;border:1px solid var(--edge);border-radius:6px;overscroll-behavior:contain}
.note-editor-grid:focus-visible,.note-editor-action:focus-visible,.note-editor-snap:focus-visible,.note-editor-exact:focus-visible{outline:var(--focus-ring);outline-offset:2px}
.note-editor-canvas{position:relative;touch-action:pan-x pan-y;user-select:none;background:repeating-linear-gradient(to right,transparent 0,transparent calc(var(--note-step,18px) - 1px),var(--fill-2) calc(var(--note-step,18px) - 1px),var(--fill-2) var(--note-step,18px));background-position:56px 0;background-size:var(--note-span) 100%;background-repeat:no-repeat}
.note-editor-row{position:absolute;left:0;width:calc(56px + var(--note-span));height:22px;border-top:1px solid var(--fill-2);pointer-events:none}.note-editor-row.black{background:#0002}
.note-editor-pitch{position:sticky;left:0;display:block;width:56px;height:21px;background:var(--surface-2);font-size:10px;padding-left:5px;z-index:7;box-sizing:border-box;color:var(--muted);pointer-events:auto}.note-editor-row.black .note-editor-pitch{background:var(--surface-1)}
/* Connect the extra rows of a pitch: a rail in the sticky keyboard and a quiet shared band across the grid. */
.note-editor-row.stacked{background:var(--fill-1)}
.note-editor-row.stacked.black{background:var(--fill-2)}
.note-editor-row.stacked:not(.stack-start){border-top-color:transparent}
.note-editor-row.stacked .note-editor-pitch{color:var(--text-3);background:#302d2a}
.note-editor-row.stacked.black .note-editor-pitch{background:var(--surface-2)}
.note-editor-row.stacked .note-editor-pitch::after{content:'';position:absolute;right:5px;top:-1px;bottom:-1px;width:5px;border-right:1px solid color-mix(in srgb,var(--text-3) 60%,transparent);pointer-events:none}
.note-editor-row.stack-start .note-editor-pitch::after{top:5px;border-top:1px solid color-mix(in srgb,var(--text-3) 60%,transparent);border-radius:0 3px 0 0}
.note-editor-row.stack-end .note-editor-pitch::after{bottom:5px;border-bottom:1px solid color-mix(in srgb,var(--text-3) 60%,transparent);border-radius:0 0 3px 0}
.note-editor-ruler{position:sticky;top:0;height:28px;z-index:8;background:var(--panel-raised);border-bottom:1px solid var(--edge);box-sizing:border-box}
.note-editor-beat-label{position:absolute;top:0;bottom:0;font-size:10px;line-height:27px;padding-left:4px;color:var(--muted);border-left:1px solid var(--edge)}
.note-editor-corner{position:sticky;left:0;display:block;width:56px;height:27px;background:var(--panel-raised);color:var(--muted);font-size:10px;line-height:27px;padding-left:5px;box-sizing:border-box;z-index:9}
.note-editor-head{pointer-events:none;position:absolute;top:28px;bottom:0;width:2px;background:color-mix(in srgb,var(--rose) 94%,transparent);z-index:6;box-shadow:0 0 6px color-mix(in srgb,var(--rose) 19%,transparent)}
.note-editor-note.playing{border-color:color-mix(in srgb,var(--accent) 80%,transparent);box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 50%,transparent),0 0 10px color-mix(in srgb,var(--accent) 33%,transparent)}
.note-editor-beat{position:absolute;top:28px;bottom:0;border-left:1px solid var(--edge);pointer-events:none}
.note-editor-note{position:absolute;height:20px;min-height:0;min-width:0;box-sizing:border-box;border:1px solid var(--edge-strong);background:color-mix(in srgb,var(--track-color,#7c6798) 72%,var(--surface-1));color:var(--bg);font-weight:600;border-radius:3px;padding:0 5px;text-align:left;font-size:10px;overflow:hidden;white-space:nowrap;cursor:grab;z-index:4;touch-action:none}
/* The velocity bar: a 2px line along the note's foot, as wide as the note's velocity (1 spans the note). */
.note-editor-note::after{content:'';position:absolute;left:0;bottom:0;height:2px;width:calc(var(--note-velocity,1) * 100%);background:color-mix(in srgb,var(--bg) 60%,transparent);pointer-events:none}
.note-editor-note.muted::after{display:none}
.note-editor-note:active{cursor:grabbing}.note-editor-note.selected{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent);background:color-mix(in srgb,var(--track-color,#7c6798) 86%,var(--text))}
.note-editor-note:focus-visible{outline:var(--focus-ring);outline-offset:2px;z-index:5}.note-editor-note.muted{background:color-mix(in srgb,var(--track-color,#7c6798) 28%,var(--surface-1));color:color-mix(in srgb,var(--text) 48%,transparent);border-style:dashed}.note-editor-note.continuation{border-left-style:dashed}
.note-editor-resize{position:absolute;right:0;top:0;bottom:0;width:min(7px,30%);box-sizing:border-box;border-left:1px solid #ffffff35;background:var(--fill-3);cursor:ew-resize}
.note-editor-cursor{position:absolute;height:22px;pointer-events:none;border:1px solid var(--accent);opacity:.5;box-sizing:border-box;z-index:2}
.note-editor-drawing{position:absolute;height:20px;box-sizing:border-box;border:1px dashed var(--accent);border-radius:3px;background:color-mix(in srgb,var(--accent) 33%,transparent);pointer-events:none;z-index:3}
.note-editor-group-preview{position:absolute;height:20px;box-sizing:border-box;border:1px dashed var(--accent);border-radius:3px;background:color-mix(in srgb,var(--accent) 33%,transparent);pointer-events:none;z-index:6}
.note-editor-marquee{position:absolute;box-sizing:border-box;border:1px solid var(--accent);background:color-mix(in srgb,var(--accent) 15%,transparent);pointer-events:none;z-index:6}
.note-editor[aria-busy=true] .note-editor-note{cursor:progress;opacity:.8}
.note-editor-pad-note{position:absolute;height:20px;box-sizing:border-box;border:1px dashed #c3afea88;border-radius:3px;color:var(--muted);font-size:10px;padding:0 5px;overflow:hidden;white-space:nowrap;pointer-events:none}
.note-editor-grid:focus-visible .note-editor-cursor{opacity:1;border-width:2px;background:color-mix(in srgb,var(--accent) 9%,transparent)}
.note-editor-snap-label{color:var(--text);font-weight:650}
@media (width < 600px){.note-editor{padding:0}.note-editor-grid{max-height:280px}.note-editor-header{gap:8px}.note-editor-selection{flex-basis:65%}.note-editor-details{align-items:end}.note-editor-exact{width:130px}.note-editor-snap{max-width:140px}}

.note-editor-hint{font-size:11px;color:var(--muted);margin:7px 0;line-height:1.4}
.note-editor[data-mode=entry] .note-editor-hint{color:var(--accent)}
.note-editor-help-details{font-size:12px;color:var(--muted);margin-top:10px}
.note-editor-help-details summary{cursor:pointer;width:fit-content}
.note-editor-help-details summary:focus-visible{outline:var(--focus-ring);outline-offset:3px}
.note-editor-extend-left{position:absolute;left:0;top:0;bottom:0;width:min(7px,30%);background:var(--fill-2);border-right:1px solid var(--edge-3);box-sizing:border-box}
/* Roll · Staff: one segmented control in the Note header; the staff takes the grid's place. */
.note-editor-view{display:inline-flex;gap:0;padding:2px;border:1px solid var(--edge);border-radius:7px;background:var(--fill-1)}
.note-editor-view-choice{margin:0;padding:4px 10px;border:0;border-radius:5px;background:transparent;color:var(--muted);font:inherit;font-size:12px;line-height:1.2}
.note-editor-view-choice[aria-checked=true]{background:var(--panel-raised);color:var(--text);font-weight:600;box-shadow:0 1px 2px #0006}
.note-editor-view-choice:focus-visible{outline:var(--focus-ring);outline-offset:1px}
.note-editor-staff{min-height:120px;max-height:360px;overflow:auto;border:1px solid var(--edge);border-radius:6px;padding:8px 6px;background:var(--fill-1)}
/* Held keys previewed at the cursor before step entry writes them. */
.note-editor-take-preview{position:absolute;height:20px;box-sizing:border-box;border:1px dashed var(--track-color,#c3afea);border-radius:3px;background:color-mix(in srgb,var(--track-color,#c3afea) 32%,transparent);color:var(--text);font-size:10px;padding:0 5px;overflow:hidden;white-space:nowrap;pointer-events:none;z-index:3;opacity:.8}.note-editor-take-preview.held{border-style:solid;border-right-color:transparent}
.note-editor-step-preview{position:absolute;height:20px;box-sizing:border-box;border:1px dashed var(--accent);border-radius:3px;background:color-mix(in srgb,var(--accent) 20%,transparent);color:var(--accent);font-size:10px;padding:0 5px;overflow:hidden;white-space:nowrap;pointer-events:none;z-index:3}

/* Staff view (staff-view.ts). Bravura 1.392, SIL OFL 1.1 (provenance/bravura.json); the build replaces ./bravura-5c25278c208ca455.woff2. */
@font-face{font-family:Bravura;src:url("./bravura-5c25278c208ca455.woff2") format("woff2");font-display:block}
.staff-view{display:block;overflow:auto;scrollbar-gutter:stable}
.staff-view svg{display:block;width:100%}
.staff-view text{pointer-events:none}
.staff-line{stroke:var(--muted);opacity:.6}
.staff-stroke{stroke:var(--text);fill:none}
.staff-fill,.staff-tie{fill:var(--text)}.staff-tie{stroke:var(--text);stroke-linejoin:round}
.staff-rest{fill:var(--text)}.staff-dim{opacity:.4}
.staff-head{fill:var(--text);cursor:pointer}.staff-head:focus-visible{outline:none}
.staff-head.selected{fill:var(--track-color,var(--accent))}
.staff-head.muted{opacity:.4}
.staff-hit{fill:transparent;pointer-events:all}
.staff-head:focus-visible .staff-hit{stroke:var(--accent);stroke-width:.14}
.staff-cursor{stroke:var(--accent);fill:none}
.staff-ghost{fill:none;stroke:var(--accent);stroke-width:.1}.staff-ghost-mark{fill:var(--accent)}
.staff-label{fill:var(--text)}
.staff-approx{fill:var(--muted)}

/* The keyboard in the pinned bar (midi-panel.ts): the indicator, the live chord chip, Record, the timing chip beside it
   (LOOP-INSTRUMENT-PLAN.md §3), and the Keyboard popover. */
/* Size and icon come from .bar-group>button (app.css), including its narrow-width rule. */
#midi svg,#record svg{width:17px;height:17px;display:block}#record[aria-disabled=true]{opacity:var(--disabled);cursor:default}
#midi[data-state=unsupported],#midi[data-state=prompt],#midi[data-state=denied]{color:var(--faint)}#midi[data-state=connected]{color:var(--mint)}
#midi[data-state=playing]{color:var(--accent);border-color:color-mix(in srgb,var(--accent) 50%,transparent);animation:midi-held 1.2s ease-in-out infinite}#midi[aria-expanded=true]{border-color:color-mix(in srgb,var(--accent) 50%,transparent)}
@keyframes midi-held{50%{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 15%,transparent)}}
#midi-chord{flex:none;display:inline-flex;align-items:center;justify-content:center;height:22px;width:5.5em;box-sizing:border-box;padding:0 6px;border:1px solid var(--edge);border-radius:11px;background:var(--fill-2);font-size:12px;font-weight:600;line-height:1;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
#midi-chord[data-held=false]{color:var(--muted);font-weight:500;background:transparent}
/* The timing chip: a 22-px pill like the chord chip, a button underneath (the id outranks .bar-group>button's size). */
#midi-timing{flex:none;display:inline-flex;align-items:center;justify-content:center;width:auto;min-width:3.6em;height:22px;box-sizing:border-box;padding:0 7px;border:1px solid var(--edge);border-radius:11px;background:var(--fill-2);font-size:11px;font-weight:600;line-height:1;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
#midi-timing:hover{background:var(--line);border-color:var(--edge-strong);color:var(--text)}#midi-timing:active{background:var(--edge)}
#midi-timing[data-timing=grid]{color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,transparent);border-color:color-mix(in srgb,var(--accent) 40%,transparent)}#midi-timing[data-timing=grid]:hover{background:color-mix(in srgb,var(--accent) 18%,transparent);border-color:color-mix(in srgb,var(--accent) 65%,transparent)}
#record:not(:disabled):hover,#record[aria-pressed=true]{color:var(--rose)}#record[aria-pressed=true]{border-color:color-mix(in srgb,var(--rose) 50%,transparent)}
#record[data-state=recording]{background:color-mix(in srgb,var(--rose) 12%,transparent);animation:record-on 1s ease-in-out infinite}@keyframes record-on{50%{color:color-mix(in srgb,var(--rose) 45%,transparent)}}

.midi-panel{width:268px}.midi-panel .bar-popover-title span{max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.midi-connect{display:flex;margin:0 0 8px}.midi-connect:has(button[hidden]){display:none}.midi-connect button{padding:4px 10px;font-size:11px;background:color-mix(in srgb,var(--accent) 13%,transparent);border-color:color-mix(in srgb,var(--accent) 40%,transparent);color:var(--accent);font-weight:600}.midi-connect button:hover{background:color-mix(in srgb,var(--accent) 22%,transparent)}
.midi-inputs{display:grid;gap:2px;margin:0 0 8px}
.midi-check{display:flex;align-items:center;gap:8px;min-height:24px;font-size:11px;cursor:pointer;min-width:0}.midi-check span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.midi-check input{flex:none;margin:0;accent-color:var(--accent)}.midi-check[data-disconnected=true]{color:var(--muted)}
/* The lane picker (SAMPLER-SONG-PLAN.md D12–D13): shown with song tracks; a compact select on the switches' row height. */
.midi-lane{margin:0 0 8px}
.midi-lane-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:26px;font-size:11px}
#midi-lane{flex:1;min-width:0;max-width:176px;padding:3px 6px;font-size:11px;border-radius:6px}#midi-lane:disabled{opacity:var(--disabled);cursor:default}
.midi-section{padding-top:8px;border-top:1px solid var(--line)}
.midi-switch{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:26px;font-size:11px;cursor:pointer}.midi-switch:has(input:disabled){color:var(--muted);cursor:default}
.midi-switch input{appearance:none;flex:none;position:relative;width:28px;height:16px;margin:0;border:1px solid var(--edge);border-radius:8px;background:var(--line);cursor:pointer;transition:background .14s,border-color .14s}
.midi-switch input::before{content:'';position:absolute;top:2px;left:2px;width:10px;height:10px;border-radius:50%;background:var(--text-3);transition:transform .14s,background .14s}
.midi-switch input:checked{background:color-mix(in srgb,var(--accent) 35%,transparent);border-color:color-mix(in srgb,var(--accent) 65%,transparent)}.midi-switch input:checked::before{transform:translateX(12px);background:var(--accent)}.midi-switch input:disabled{opacity:var(--disabled);cursor:default}
.midi-switch input:focus-visible{outline:var(--focus-ring);outline-offset:2px}
.midi-hint{margin:0 0 6px;font-size:10px;line-height:1.5;color:var(--muted)}
/* Where to allow MIDI while the browser blocks it for the page (the connect row is hidden then). */
#midi-blocked{margin:0 0 8px;color:var(--text)}
.midi-help{margin:6px 0 0;padding-top:8px;border-top:1px solid var(--line);font-size:10px;line-height:1.5;color:var(--muted)}
@media (width < 600px){#midi-chord,#midi-timing{display:none}}

.audio-input-panel{width:330px;max-width:calc(100% - 32px);max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box}
.audio-input-panel .input-help{font-size:11px;line-height:1.5;color:var(--muted);margin:6px 0 10px}
.input-field{display:grid;gap:5px;font-size:11px;margin:10px 0}.input-field select{width:100%;min-width:0;padding:6px}
.input-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.input-actions button{font-size:11px;padding:6px 9px}.input-actions a{font-size:11px;color:var(--accent)}
.input-level{display:flex;align-items:center;gap:10px;font-size:11px;margin:12px 0;font-variant-numeric:tabular-nums}.input-level meter{flex:1;min-width:0;height:13px}.input-level span{min-width:105px;text-align:right}.input-level [data-clipped=true]{color:var(--rose)}
.input-monitor{display:flex;align-items:center;gap:6px;font-size:12px}.input-monitor input{accent-color:var(--accent)}
#audio-input-time{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}#audio-input-preview{width:100%;height:36px}
#audio-input-status{font-size:12px;line-height:1.5;margin:12px 0}#audio-input-record[aria-pressed=true],#audio-input[data-state=recording]{color:var(--rose);border-color:var(--rose)}#audio-input[data-state=connected]{color:var(--mint)}#audio-input svg{width:17px;height:17px;display:block}
/* Recording onto the song (SONG-ARRANGEMENT-PLAN.md D7): pre-roll, compensation and Measure latency, under the take. */
.input-song{border-top:1px solid var(--edge);margin-top:12px;padding-top:10px}
.input-song-title{margin:0 0 4px;font-size:11px;font-weight:600;color:var(--text)}
.input-song-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:6px 0;font-size:11px}
.input-stepper{display:inline-flex;align-items:center;gap:3px}.input-stepper button{width:24px;height:22px;padding:0;font-size:12px;line-height:1}
.input-stepper output{min-width:58px;text-align:center;font-variant-numeric:tabular-nums}
.input-compensation{font-variant-numeric:tabular-nums;color:var(--muted)}

/* A kept take (a failed save) comes first, in the accent colour, until it is placed, added, downloaded or discarded. */
#audio-input-take{margin:8px 0 4px;padding:10px;border:1px solid color-mix(in srgb,var(--accent) 45%,transparent);border-radius:8px;background:color-mix(in srgb,var(--accent) 7%,transparent);font-size:11px}
.input-take-title{margin:0 0 8px;font-size:11px;font-weight:600;color:var(--accent)}
#audio-input-take:not([hidden]) + #audio-input-status{color:var(--text)}
/* Where Record puts the take: the selected block, and the button that records into it. */
.input-destination{margin-top:12px;padding-top:10px;border-top:1px solid var(--edge)}
.input-destination .input-help{margin:0 0 8px}
.input-destination button{min-height:30px}
#audio-input-block-record{color:var(--record-ink);border-color:var(--record-edge);font-weight:600}
#audio-input-sample-mode{margin:10px 0}
#audio-input-sample-mode summary{cursor:pointer;color:var(--muted);font-size:11px}
#audio-input-song-hint:empty,#audio-input-measure-status:empty{display:none}

#export-open,#new-project-open{width:auto;padding-inline:12px;font-size:11px;font-weight:600}
/* The dialogs are the page's own: its font, its 34 px controls, a 12 px corner and 8 px fields, the page's text on amber. */
#new-project-dialog{box-sizing:border-box;width:min(520px,calc(100% - 32px));padding:28px;border:1px solid var(--edge);border-radius:12px;background:var(--bg);color:var(--text);box-shadow:0 24px 90px #0009;font-size:13px;line-height:1.5}
#new-project-dialog::backdrop{background:#0009;backdrop-filter:blur(4px)}
#new-project-dialog h2{margin:0;font-size:21px;font-weight:600;letter-spacing:-.03em}
#new-project-dialog p{color:var(--muted)}
#new-project-status:empty{display:none}
/* Keep a copy or open another project on the left; Cancel and the confirmation stay together on the right. */
.new-project-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;margin-top:20px}
.new-project-other,.new-project-decide{display:flex;flex-wrap:wrap;gap:8px}
.new-project-decide{margin-left:auto}
.new-project-actions button{min-height:var(--control);padding:6px 12px}
#new-project-confirm{background:var(--accent);color:var(--bg);border:0;font-weight:600}
#new-project-dialog :focus-visible{outline:var(--focus-ring);outline-offset:3px}
#export-dialog{box-sizing:border-box;width:min(620px,calc(100% - 32px));max-height:calc(100vh - 40px);padding:28px;border:1px solid var(--edge);border-radius:12px;background:var(--bg);color:var(--text);box-shadow:0 24px 90px #0009;font-size:13px;line-height:1.5}
#export-dialog::backdrop{background:#0009;backdrop-filter:blur(4px)}
.export-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.export-eyebrow{margin:0 0 6px;color:var(--accent);font-size:10px;letter-spacing:.16em;font-weight:600}.export-heading h2{margin:0;font-size:21px;letter-spacing:-.03em;font-weight:600}
#export-close{font-size:22px;line-height:1;padding:5px 9px}.export-intro{margin:14px 0 22px;color:var(--muted)}
#export-fields{margin:0;padding:0;border:0;min-width:0}.export-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}.export-grid label{display:flex;flex-direction:column;gap:7px;color:var(--muted);font-size:11px;font-weight:500}
#export-dialog select,#export-dialog input:not([type=file]){box-sizing:border-box;width:100%;height:var(--control);padding:0 10px;border:1px solid var(--field-edge);border-radius:8px;background:var(--panel);color:var(--text);font-size:13px}#export-dialog button{min-height:var(--control)}#export-dialog :focus-visible{outline:var(--focus-ring);outline-offset:3px}
.export-help{color:var(--muted);font-size:11px;line-height:1.65;margin:12px 0}.export-help:empty{display:none}.export-estimate{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums;margin:18px 0 12px}.export-estimate:empty{display:none}
#export-start{width:100%;height:var(--control);background:var(--accent);color:var(--bg);border:0;font-size:13px;font-weight:600}#export-progress-wrap{display:flex;gap:12px;align-items:center;margin-top:16px}#export-progress{width:100%;accent-color:var(--accent)}
#export-status{margin:16px 0 0;font-size:12px;overflow-wrap:anywhere}#export-status:empty{display:none}#export-notes{padding-left:18px;font-size:11px;line-height:1.6;color:var(--muted)}#export-notes:empty{display:none}#export-notes li+li{margin-top:6px}#export-downloads{display:flex;flex-wrap:wrap;gap:10px 18px;margin-top:12px}#export-downloads a{color:var(--accent);font-size:12px;text-underline-offset:3px}.export-keep{border-top:1px solid var(--edge);margin-top:24px;padding-top:16px}.export-project summary{cursor:pointer;color:var(--muted);font-size:12px}#export-project-summary{font-size:12px}#export-file{max-width:100%;font-size:12px}
/* Where the song is kept: a quiet line, its warning in the text colour while this browser may clear it. */
.export-storage{margin:0 0 12px;font-size:11px;line-height:1.65;color:var(--text)}.export-storage[data-kept=true]{color:var(--muted)}
@media (width <= 520px){#export-dialog{padding:20px}.export-grid{grid-template-columns:1fr;gap:12px}#new-project-dialog{padding:20px}}

/* The storage notice under the bar (web.ts): why this tab isn't saving, with what helps. Rose for trouble, quiet for a
   note; compact buttons beside the text, wrapping under it on narrow windows. */
#web-storage-status{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin:0 0 14px;padding:8px 8px 8px 14px;border:1px solid color-mix(in srgb,var(--rose) 40%,transparent);border-radius:10px;background:color-mix(in srgb,var(--rose) 6%,transparent);color:var(--text);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
#web-storage-status[data-tone=note]{border-color:var(--edge);background:var(--panel)}
#web-storage-message{flex:1 1 360px;min-width:0;margin:0;line-height:1.5}
#web-storage-status[data-tone=trouble] #web-storage-message::before{content:'';display:inline-block;width:6px;height:6px;margin:0 8px 1px 0;border-radius:50%;background:var(--rose)}
.storage-actions{display:flex;flex-wrap:wrap;gap:6px}
.storage-actions button{min-height:28px;padding:3px 10px;border-radius:7px;font-size:11px;font-weight:600}
.storage-actions button[data-action=confirm-erase]{color:var(--rose);border-color:color-mix(in srgb,var(--rose) 50%,transparent)}
.storage-actions button[data-action=confirm-erase]:hover{background:color-mix(in srgb,var(--rose) 12%,transparent);border-color:var(--rose)}
#web-storage-status:focus{outline:none}#web-storage-status:focus-visible{outline:var(--focus-ring);outline-offset:2px}

/* "Not saving", pinned in the bar's feedback line before the connection status: rose, the status line's size. */
.bar-feedback .bar-flag{flex:none;margin:0 0 0 auto;overflow:visible}
.bar-feedback .bar-flag:not([hidden])~#status{margin-left:0}
.bar-flag button{display:inline-flex;align-items:center;gap:6px;height:16px;min-height:0;padding:0 5px;border:0;border-radius:4px;background:transparent;color:var(--rose);font:600 10px/16px var(--mono);letter-spacing:.02em}
.bar-flag button::before{content:'';width:6px;height:6px;border-radius:50%;background:var(--rose)}
.bar-flag button:hover{background:color-mix(in srgb,var(--rose) 12%,transparent)}
.bar-flag button:focus-visible{outline:var(--focus-ring);outline-offset:1px}

/* The command field's suggestions are a listbox (command-panel.ts): the option the arrow keys reach reads as chosen. */
#command-completions [role=option][aria-selected=true]{background:var(--line);box-shadow:inset 2px 0 0 var(--accent)}

/* The project view (project-view.ts): one calm strip between the bar and the lanes. A ruler in song beats over the
   arrangement's section blocks, the song playhead, the cycle bracket and "+"; the open view adds one row per lane with
   each occurrence's miniature. Heights: ruler 18, blocks 32, padding 6 (56 in all). */
#project{position:relative;margin:-4px 0 12px;min-width:0;isolation:isolate}
#project[data-view=strip]{position:sticky;top:var(--bar-height,84px);z-index:19;background:var(--bg);box-shadow:0 6px 0 var(--bg)}
/* An inline-size container, so the clip editor's slot (project-editor-slot) is as wide as the view in CSS units, whatever the song's width. */
.project .project-scroll{overflow-x:auto;overflow-y:hidden;padding:3px 0;scrollbar-width:thin;scrollbar-color:var(--edge-3) transparent;overscroll-behavior-x:contain;container-type:inline-size}
.project .project-canvas{position:relative;min-width:100%;--head:0px;--beat-px:40px}
/* The view's sideways scrollbar is the redraw's to decide (project-view.ts, ACCEPTANCE-2.md N3): none while it fits (a
   canvas a few px too wide for a frame shows none), always one while it is wider than the view. */
.project[data-sideways=fits] .project-scroll{overflow-x:hidden}
.project[data-sideways=scrolls] .project-scroll{overflow-x:scroll}
.project .project-row{display:flex;align-items:stretch;min-width:0}
.project .project-head{flex:none;width:var(--head);position:sticky;left:0;z-index:7;background:var(--bg);overflow:hidden;white-space:nowrap}
.project[data-view=strip] .project-head{display:none}

/* The ruler: numbers every 4 beats (every beat when wide), a faint tick per beat, the cycle as an amber bar. */
.project .project-ruler{position:relative;flex:1 0 auto;height:18px;cursor:pointer;touch-action:pan-x;color:var(--muted);font:9px/12px var(--mono)}
.project .project-marks{position:absolute;left:0;top:0;bottom:0;background-image:repeating-linear-gradient(90deg,var(--line) 0 1px,transparent 1px var(--beat-px));background-size:100% 4px;background-repeat:no-repeat;background-position:0 100%;pointer-events:none}
.project .project-mark{position:absolute;top:1px;padding-left:3px;border-left:1px solid var(--edge-3);font-variant-numeric:tabular-nums;opacity:.8}
.project .project-ruler:hover .project-mark{opacity:1}
.project .project-cycle{position:absolute;bottom:1px;height:6px;min-width:0;padding:0;border:0;border-radius:3px;background:color-mix(in srgb,var(--accent) 65%,transparent);box-shadow:none;cursor:pointer;z-index:2}
.project .project-cycle:hover{background:var(--accent);height:8px}.project .project-cycle:focus-visible{outline:var(--focus-ring);outline-offset:2px}
.project .project-ruler[data-cycling] .project-cycle{background:color-mix(in srgb,var(--accent) 50%,transparent)}
.project .project-cycle-shade{position:absolute;top:18px;height:32px;background:color-mix(in srgb,var(--accent) 4%,transparent);border-left:1px solid color-mix(in srgb,var(--accent) 31%,transparent);border-right:1px solid color-mix(in srgb,var(--accent) 31%,transparent);pointer-events:none;z-index:1}
.project[data-view=open] .project-cycle-shade{bottom:0;height:auto}

/* The arrangement: one block per placement, its width repeat × length, faint ticks per repeat, a stable hue per section. */
.project .project-lane{position:relative;flex:1 0 auto;height:32px}
.project .project-block{--hue:var(--accent);position:absolute;top:2px;height:28px;box-sizing:border-box;border:1px solid color-mix(in srgb,var(--hue) 30%,transparent);border-radius:7px;background:color-mix(in srgb,var(--hue) 15%,var(--surface-1));overflow:hidden;transition:background .14s,border-color .14s,box-shadow .14s}
.project .project-block[data-repeated]::before{content:'';position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(90deg,transparent 0 calc(var(--rep) - 1px),color-mix(in srgb,var(--hue) 32%,transparent) calc(var(--rep) - 1px) var(--rep))}
.project .project-block:hover{background:color-mix(in srgb,var(--hue) 21%,var(--surface-1));border-color:color-mix(in srgb,var(--hue) 46%,transparent)}
.project .project-block[data-focused]{background:color-mix(in srgb,var(--hue) 27%,var(--surface-1));border-color:color-mix(in srgb,var(--hue) 82%,var(--text))}
.project .project-block[data-selected]{box-shadow:0 0 0 1px color-mix(in srgb,var(--hue) 55%,transparent)}
.project .project-block[data-dragging]{z-index:5;opacity:.92;box-shadow:0 8px 20px #000000a0,0 0 0 1px color-mix(in srgb,var(--hue) 70%,transparent);transition:none}
.project .project-block-main{position:absolute;inset:0;width:100%;height:100%;display:flex;align-items:center;gap:6px;min-width:0;padding:0 26px 0 9px;border:0;border-radius:inherit;background:transparent;box-shadow:none;color:color-mix(in srgb,var(--hue) 62%,var(--text));font:600 10.5px/1 var(--mono);letter-spacing:.2px;text-align:left;cursor:grab;touch-action:pan-x;white-space:nowrap;overflow:hidden}
.project .project-block-main:hover{background:transparent;border:0}.project .project-block-main:active{cursor:grabbing;background:transparent}
.project .project-block-main:focus-visible{outline:var(--focus-ring);outline-offset:-3px}
.project .project-block-name{min-width:0;overflow:hidden;text-overflow:ellipsis}
.project .project-block-repeat{flex:none;color:var(--muted);font-weight:500}
.project .project-block-more{position:absolute;right:7px;top:4px;width:20px;height:20px;padding:0;border:0;border-radius:6px;background:transparent;box-shadow:none;color:var(--muted);font-size:13px;line-height:18px;opacity:0;z-index:2}
.project .project-block:hover .project-block-more,.project .project-block[data-focused] .project-block-more,.project .project-block-more:focus-visible,.project .project-block-more[aria-expanded=true]{opacity:1}
.project .project-block-more:hover{background:#00000040;color:var(--text)}
.project .project-block-edge{position:absolute;right:0;top:0;bottom:0;width:7px;cursor:ew-resize;touch-action:pan-x;z-index:3}
.project .project-block-edge:hover,.project .project-block[data-dragging] .project-block-edge{background:color-mix(in srgb,var(--hue) 34%,transparent)}
.project .project-block[data-narrow] .project-block-main{padding:0 18px 0 6px;gap:4px}.project .project-block[data-narrow] .project-block-more{right:1px;width:16px}
.project .project-block[data-tight] .project-block-main{padding:0 6px;justify-content:center}.project .project-block[data-tight] .project-block-more{display:none}
/* The sounding occurrence is lit; the playhead runs in song time; while stopped a small mark shows where Play starts. */
.project .project-lit{--hue:var(--accent);position:absolute;top:20px;height:28px;border-radius:6px;background:color-mix(in srgb,var(--hue) 20%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--hue) 34%,transparent);pointer-events:none;z-index:2}
.project .project-playhead{position:absolute;left:0;top:0;bottom:0;width:2px;margin-left:-1px;background:color-mix(in srgb,var(--rose) 94%,transparent);box-shadow:0 0 6px color-mix(in srgb,var(--rose) 19%,transparent);pointer-events:none;z-index:6;will-change:transform}
.project .project-start{position:absolute;left:0;top:0;width:0;height:0;margin-left:-4px;border:4px solid transparent;border-top:6px solid var(--text-4);border-bottom:0;pointer-events:none;z-index:6}
.project .project-add{position:absolute;top:4px;width:24px;height:24px;padding:0;display:grid;place-items:center;border:1px dashed #ffffff2b;border-radius:12px;background:transparent;box-shadow:none;color:var(--muted);font-size:14px;line-height:1}
.project .project-add:hover{color:var(--text);border-color:#ffffff55;background:var(--fill-2)}.project .project-add[aria-disabled=true]{opacity:var(--disabled);cursor:progress}
/* Sections out of the song (a last placement removed) wait in the "+" menu: a small dot on "+" says so. */
.project .project-add[data-unplaced]::after{content:'';position:absolute;top:-1px;right:-1px;width:6px;height:6px;border-radius:50%;background:var(--accent)}
.project-unplaced{margin-top:4px;padding-top:4px;border-top:1px solid var(--line)}
.project-unplaced-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px}.project-unplaced-row .project-danger{width:auto}
/* With sections out of the song the "+" menu grows to hold "Place X" and "Delete X" side by side; a long name is cut. */
.project-menu.project-add-menu{width:auto;min-width:180px;max-width:min(320px,calc(100% - 16px))}
.project-unplaced-row .project-menu-item{min-width:0;max-width:150px;overflow:hidden;text-overflow:ellipsis}

/* The open view: one row per lane, its header pinned on the left, each occurrence a miniature in the lane's colour. */
.project .project-song-head{display:flex;align-items:center;padding:0 10px 0 2px;color:var(--muted);font:10px var(--mono)}
.project .project-track-row{height:22px}
.project .project-track{position:relative;flex:1 0 auto;border-top:1px solid var(--fill-2)}
.project .project-track-head{display:flex;align-items:center;gap:6px;padding:0 8px 0 2px;color:var(--lane-color);font:700 9.5px var(--mono);letter-spacing:.2px;text-transform:uppercase;border-top:1px solid var(--fill-2)}
.project .project-track-head::before{content:'';flex:none;width:6px;height:6px;border-radius:50%;background:var(--lane-color)}
.project .project-track-name{min-width:0;overflow:hidden;text-overflow:ellipsis}
.project .project-track-muted .project-track-head{color:color-mix(in srgb,var(--lane-color) 50%,var(--muted))}.project .project-track-muted .project-track-head::before{background:currentColor}
.project .project-mini{position:absolute;top:3px;height:16px;border-radius:3px;fill:var(--lane-color);opacity:.55;cursor:pointer;background:repeating-linear-gradient(90deg,transparent 0 calc(var(--rep) - 1px),var(--line) calc(var(--rep) - 1px) var(--rep)),color-mix(in srgb,var(--lane-color) 9%,transparent)}
.project .project-mini[data-focused]{opacity:.95}.project .project-mini:hover{opacity:1;outline:1px solid color-mix(in srgb,var(--lane-color) 60%,transparent)}
.project .project-mini[data-muted]{opacity:.18;background:repeating-linear-gradient(135deg,transparent 0 4px,var(--line) 4px 5px)}
.project .project-track-muted .project-mini{opacity:.3}
.project .project-focus-line{display:flex;align-items:center;width:100%;margin-top:6px;padding:7px 10px;border:1px solid var(--edge);border-radius:8px;background:var(--fill-1);color:var(--muted);font:500 10.5px var(--mono);text-align:left}
.project .project-focus-line:hover{color:var(--text)}
#instrument:has(#project[data-view=open]) #song-lanes{display:none}

/* Audio tracks (0.9.0): in the strip, a thin line of every clip under the sections; in the open view, one 40 px row per
   audio track under the lanes' rows: a header (name, mute, gain, record arm), the clips as waveforms in the track's hue,
   the sounding one lit, the take being recorded growing in rose, "+ Audio track" after the last. */
.project .project-summary-row{height:0}
.project[data-audio][data-view=strip] .project-summary-row{height:8px}
.project .project-audio-summary{position:relative;flex:1 0 auto;height:8px;pointer-events:none}
.project .project-audio-bit{--hue:#e58b94;position:absolute;height:2px;margin-top:1px;border-radius:1px;background:color-mix(in srgb,var(--hue) 72%,transparent)}
.project .project-audio-bit[data-muted]{opacity:.35}
/* 0.15.0: the strip's thin summary of the song tracks' blocks, under the section blocks and above the clips': one bar per block at its song beats in its track's colour, a muted track's dimmed. The open view has the rows instead. */
.project .project-songtrack-summary-row{height:0}
.project[data-songtracks][data-view=strip] .project-songtrack-summary-row{height:8px}
.project .project-songtrack-summary{position:relative;flex:1 0 auto;height:8px;pointer-events:none}
.project .project-songtrack-bit{--hue:#c78feb;position:absolute;height:2px;margin-top:1px;border-radius:1px;background:color-mix(in srgb,var(--hue) 72%,transparent)}
.project .project-songtrack-bit[data-muted]{opacity:.35}
.project .project-audio-rows{display:block}
.project .project-audio-row{height:40px}
.project .project-audio-head{display:grid;grid-template-rows:17px 18px;align-content:center;gap:1px;padding:0 6px 0 2px;border-top:1px solid var(--fill-2);color:color-mix(in srgb,var(--hue) 78%,var(--text))}
.project .project-audio-title{position:relative;display:flex;align-items:center;min-width:0}
.project .project-audio-name{flex:1 1 auto;min-width:0;padding:0 2px;border:0;background:transparent;box-shadow:none;color:inherit;font:700 9.5px/17px var(--mono);letter-spacing:.2px;text-transform:uppercase;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:text}
.project .project-audio-name:hover{background:transparent;color:var(--text)}
.project .project-audio-rename{width:100%;min-width:0;height:17px;padding:0 4px;font:600 10px var(--mono)}
.project .project-audio-more{position:relative;flex:none;width:16px;height:16px;padding:0;border:0;border-radius:4px;background:transparent;box-shadow:none;color:var(--muted);font-size:11px;line-height:14px;opacity:0}
.project .project-audio-head:hover .project-audio-more,.project .project-audio-more:focus-visible{opacity:1}.project .project-audio-more:hover{color:var(--text);background:var(--fill-3)}
.project .project-audio-controls{display:flex;align-items:center;gap:6px}
.project .project-audio-mute,.project .project-audio-arm{position:relative;flex:none;width:18px;height:16px;padding:0;display:grid;place-items:center;border:1px solid var(--edge);border-radius:4px;background:transparent;box-shadow:none;color:var(--muted);font:700 9px/1 var(--mono)}
.project .project-audio-mute:hover,.project .project-audio-arm:hover{color:var(--text);border-color:#ffffff40;background:var(--fill-2)}
.project .project-audio-mute[aria-pressed=true]{color:var(--surface-1);background:var(--sand);border-color:var(--sand)}
.project .project-audio-arm svg{width:10px;height:10px;display:block}
.project .project-audio-arm[aria-pressed=true]{color:var(--rose);border-color:color-mix(in srgb,var(--rose) 60%,transparent);background:color-mix(in srgb,var(--rose) 12%,transparent)}
.project .project-audio-row[data-armed] .project-audio-arm[aria-pressed=true]{animation:project-armed 1.6s ease-in-out infinite}
@keyframes project-armed{50%{background:color-mix(in srgb,var(--rose) 4%,transparent)}}
.project .project-audio-gain{position:relative;flex:1 1 auto;min-width:0;height:16px;padding:0 3px;border-radius:4px;color:var(--muted);font:500 9px/16px var(--mono);font-variant-numeric:tabular-nums;text-align:center;cursor:ns-resize;user-select:none;touch-action:none}
.project .project-audio-gain::after{content:' dB';opacity:.8}
.project .project-audio-gain:hover,.project .project-audio-gain[data-dragging]{color:var(--text);background:var(--fill-2)}.project .project-audio-gain:focus-visible{outline:var(--focus-ring);outline-offset:0}
.project .project-audio-row[data-muted] .project-audio-body{opacity:.45}
.project .project-audio-body{position:relative;isolation:isolate;flex:1 0 auto;border-top:1px solid var(--fill-2);background:repeating-linear-gradient(90deg,transparent 0 calc(var(--beat-px) * 4 - 1px),var(--fill-1) calc(var(--beat-px) * 4 - 1px) calc(var(--beat-px) * 4))}
.project .project-audio-row[data-armed] .project-audio-body{background-color:color-mix(in srgb,var(--rose) 3%,transparent)}
.project .project-clip{--hue:#e58b94;position:absolute;top:3px;height:34px;box-sizing:border-box;border:1px solid color-mix(in srgb,var(--hue) 32%,transparent);border-radius:5px;background:color-mix(in srgb,var(--hue) 13%,var(--surface-1));overflow:hidden;cursor:grab;touch-action:pan-x;transition:background .12s,border-color .12s}
.project .project-clip:hover{border-color:color-mix(in srgb,var(--hue) 55%,transparent)}
.project .project-clip:focus-visible{outline:var(--focus-ring);outline-offset:-2px}
.project .project-clip[data-sounding]{background:color-mix(in srgb,var(--hue) 22%,var(--surface-1));border-color:color-mix(in srgb,var(--hue) 62%,transparent)}
.project .project-clip[data-selected]{border-color:color-mix(in srgb,var(--hue) 88%,var(--text));box-shadow:0 0 0 1px color-mix(in srgb,var(--hue) 50%,transparent)}
.project .project-clip[data-dragging]{z-index:130!important;opacity:.9;cursor:grabbing;box-shadow:0 6px 16px #00000090;transition:none}
.project .project-clip-wave{position:absolute;left:0;top:2px;width:100%;height:calc(100% - 4px);fill:color-mix(in srgb,var(--hue) 70%,var(--text));opacity:.72;pointer-events:none}
.project .project-clip[data-sounding] .project-clip-wave{opacity:.95}
/* The head line: the label and, on a clip with effects, the fx mark beside it (the clip's end stays the boxes' marks'). */
.project .project-clip-head{position:absolute;left:5px;top:2px;z-index:3;display:flex;align-items:center;gap:4px;max-width:calc(100% - 10px);min-width:0;pointer-events:none}
.project .project-clip-label{min-width:0;overflow:hidden;color:color-mix(in srgb,var(--hue) 50%,var(--text));font:600 9px/11px var(--mono);white-space:nowrap;text-overflow:ellipsis;text-shadow:0 0 3px var(--surface-1)}
.project .project-clip-fade{position:absolute;top:0;bottom:0;pointer-events:none}
.project .project-clip-fade-in{left:0;background:linear-gradient(to bottom right,#0000008a calc(50% - .6px),color-mix(in srgb,var(--hue) 70%,var(--text)) 50%,transparent calc(50% + .6px))}
.project .project-clip-fade-out{right:0;background:linear-gradient(to bottom left,#0000008a calc(50% - .6px),color-mix(in srgb,var(--hue) 70%,var(--text)) 50%,transparent calc(50% + .6px))}
.project .project-clip-edge{position:absolute;top:0;bottom:0;width:6px;cursor:ew-resize;z-index:2}
.project .project-clip-edge[data-edge=start]{left:0}.project .project-clip-edge[data-edge=end]{right:0}
.project .project-clip-edge:hover{background:color-mix(in srgb,var(--hue) 40%,transparent)}
.project .project-clip[data-past-end]{background-image:linear-gradient(90deg,transparent calc(100% - 2px),var(--edge-2) 0)}
.project .project-clip-take{--hue:var(--rose);border:1px dashed color-mix(in srgb,var(--rose) 69%,transparent);background:color-mix(in srgb,var(--rose) 10%,transparent);cursor:default;z-index:129}
.project .project-clip-take .project-clip-label{color:var(--rose-soft)}
/* "+ Track ▾" after the last row (0.15.0, SAMPLER-SONG-PLAN.md D12): Drum · Chord · Bass · Melody · Sample · Audio. */
.project .project-add-row{height:26px}
.project .project-add-row .project-head{display:flex;align-items:center;border-top:1px solid var(--fill-2)}
.project .project-track-add{position:relative;height:20px;padding:0 8px;border:1px dashed var(--edge-3);border-radius:10px;background:transparent;box-shadow:none;color:var(--muted);font:500 9.5px var(--mono);white-space:nowrap}
.project .project-track-add:hover,.project .project-track-add[aria-expanded=true]{color:var(--text);border-color:#ffffff50;background:var(--fill-2)}
.project .project-track-add-chevron{opacity:.7}
.project-menu.project-track-menu{width:156px}.project-track-menu .project-menu-item:disabled{cursor:default}
/* The ruler's corner in the open view: − + zoom and ⋯ (Zoom to fit, Keep the playhead in view), pinned with the heads. */
.project .project-corner{display:flex;align-items:center;justify-content:flex-end;gap:4px;padding-right:6px}
.project .project-zoom{position:relative;width:20px;height:16px;padding:0;display:grid;place-items:center;border:1px solid var(--line);border-radius:4px;background:var(--bg);box-shadow:none;color:var(--muted);font:600 11px/1 var(--mono)}
.project .project-zoom:hover:not(:disabled),.project .project-zoom[aria-expanded=true]{color:var(--text);border-color:#ffffff38;background:var(--panel)}
.project .project-zoom:disabled{opacity:var(--disabled);cursor:default}
.project .project-zoom:focus-visible{outline:var(--focus-ring);outline-offset:1px}
.project .project-zoom-more{font-size:10px;letter-spacing:-.5px}
.project-menu.project-zoom-menu{width:212px}
.project-menu-check{position:relative;padding-left:26px!important}
.project-menu-check::before{content:'';position:absolute;left:9px;top:50%;width:9px;height:9px;margin-top:-5px;border:1px solid #ffffff40;border-radius:3px}
.project-menu-check[aria-checked=true]::before{background:var(--accent);border-color:var(--accent);box-shadow:inset 0 0 0 2px var(--bg)}

/* The block menu and "+": native popovers, one control per action (each one edit). */
.project-menu{width:216px;padding:6px}.project-add-menu{width:180px}
.project-menu .project-menu-title{margin:2px 8px 6px}
.project-menu-item,.project-mute-details>summary{display:block;width:100%;padding:6px 8px;border:0;border-radius:6px;background:transparent;box-shadow:none;color:var(--text);font-size:12px;text-align:left;cursor:pointer}
.project-menu-item:hover,.project-mute-details>summary:hover{background:var(--fill-3)}.project-menu-item:disabled{opacity:var(--disabled)}
.project-menu-item.project-danger{color:var(--rose)}
.project-menu-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:3px 4px 3px 8px;font-size:12px;color:var(--text)}
.project-stepper{display:inline-flex;align-items:center;gap:2px}
.project-step{width:26px;height:24px;padding:0;border-radius:6px;font-size:13px;line-height:1}
.project-count{min-width:3ch;text-align:center;font:12px var(--mono);color:var(--text)}
.project-rename{display:block;width:calc(100% - 8px);margin:2px 4px 4px;padding:5px 8px;font-size:12px}
.project-menu hr{border:0;border-top:1px solid var(--line);margin:5px 4px}
.project-mute-details>summary{list-style:none}.project-mute-details>summary::-webkit-details-marker{display:none}
.project-mutes{display:grid;gap:1px;padding:2px 4px 4px 12px;max-height:220px;overflow:auto}
.project-mute{display:flex;align-items:center;gap:8px;padding:3px 4px;border-radius:5px;color:var(--lane-color);font:600 10px var(--mono);text-transform:uppercase;cursor:pointer}
.project-mute:hover{background:var(--fill-2)}.project-mute input{margin:0;accent-color:var(--accent)}
.project-menu-note{margin:2px 4px;color:var(--muted);font-size:11px}

/* 600 and 390: the strip scrolls sideways with its ruler, the headers stay pinned, miniatures become plain blocks, and
   ⋯ shows on every block (it holds every block action). */
@media (width < 600px){
  #project{margin-top:-6px}
  .project .project-track-head{font-size:9px;padding-right:4px}
  .project .project-mini path{display:none}
  .project .project-mini{background:color-mix(in srgb,var(--lane-color) 38%,transparent);opacity:.5}
  .project .project-block-more{opacity:1}
  .project .project-audio-head{padding-right:3px}
  .project .project-audio-name{font-size:9px}
  .project .project-audio-gain{padding:0 1px;font-size:9px}.project .project-audio-gain::after{content:none}
  .project .project-audio-mute,.project .project-audio-arm{width:16px}.project .project-audio-controls{gap:4px}
  .project .project-audio-more{opacity:1}
  .project .project-track-add{padding:0 6px;font-size:9px}
  .project .project-corner{padding-right:3px}.project .project-zoom{width:19px}
}
@media(pointer:coarse){.project .project-block-more{opacity:1}.project .project-cycle{height:10px}.project .project-block-edge{width:12px}}

/* In a song, the focused section's name in the lanes' ruler corner (lanes.ts setSection), in its hue. */
.lanes .lane-section{display:inline-flex;align-items:center;gap:5px;height:18px;margin-right:4px;padding:0 8px;border-radius:9px;background:color-mix(in srgb,var(--section-hue,var(--accent)) 16%,var(--bg));color:color-mix(in srgb,var(--section-hue,var(--accent)) 70%,var(--text));font:600 9.5px/18px var(--mono);letter-spacing:.2px;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis;border:0;box-shadow:none;cursor:pointer}
.lanes .lane-section:hover{background:color-mix(in srgb,var(--section-hue,var(--accent)) 26%,var(--bg));border:0;color:var(--text)}
.lanes .lane-section[aria-expanded=true]{background:color-mix(in srgb,var(--section-hue,var(--accent)) 30%,var(--bg));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--section-hue,var(--accent)) 55%,transparent);color:var(--text)}
.lanes .lane-section::before{content:'';flex:none;width:6px;height:6px;border-radius:50%;background:var(--section-hue,var(--accent))}

/* Section effects (SECTION-EFFECTS-PLAN.md §3). A strip block whose section has effects carries a small "fx" mark (it
   opens the section editor) and a faint line of each curve drawn on it, every pass. The section editor (section-editor.ts)
   sits under the strip, above the lanes, with the lane editor's look (block-editor.css's pieces) in the section's hue;
   it holds controls only while open. */
.project .project-block-fx{position:absolute;right:28px;top:6px;height:16px;min-width:0;padding:0 4px;border:1px solid color-mix(in srgb,var(--hue) 42%,transparent);border-radius:4px;background:color-mix(in srgb,var(--hue) 18%,var(--surface-1));box-shadow:none;color:color-mix(in srgb,var(--hue) 72%,var(--text));font:600 9px/14px var(--mono);letter-spacing:.3px;z-index:2}
.project .project-block-fx:hover{background:color-mix(in srgb,var(--hue) 32%,var(--surface-1));border-color:color-mix(in srgb,var(--hue) 70%,transparent);color:var(--text)}
.project .project-block-fx:focus-visible{outline:var(--focus-ring);outline-offset:1px}
.project .project-block[data-fx] .project-block-main{padding-right:52px}
/* A block under FX_MARK_MIN_PX keeps its centre for its own button: the mark folds into ⋯, shown with a dot in the hue. */
.project .project-block[data-fx-folded] .project-block-more{opacity:1}
.project .project-block[data-fx-folded] .project-block-more::after{content:'';position:absolute;top:1px;right:1px;width:5px;height:5px;border-radius:50%;background:var(--hue);pointer-events:none}
/* A coarse pointer's mark is at least 24 px each way (the block's centre still clear: FX_MARK_MIN_PX allows for it). */
@media(pointer:coarse){.project .project-block-fx{top:2px;height:24px;min-width:28px;line-height:22px}.project .project-block[data-fx] .project-block-main{padding-right:60px}}
.project .project-block-line{position:absolute;left:0;top:4px;width:100%;height:calc(100% - 8px);overflow:visible;pointer-events:none}
.project .project-block-line path{fill:none;stroke:color-mix(in srgb,var(--hue) 72%,var(--text));stroke-width:1;stroke-linejoin:round;opacity:.42;vector-effect:non-scaling-stroke}
.section-editor{--track-color:var(--accent);margin:-6px 0 12px;min-width:0;max-width:100%;padding:8px 12px 12px;background:var(--panel);border:1px solid color-mix(in srgb,var(--track-color) 24%,var(--edge));border-radius:10px;font-size:12px;box-shadow:0 10px 28px #00000038}
.section-editor:not([hidden]){animation:lane-tray-open 200ms cubic-bezier(.2,.8,.3,1)}
.section-editor p{margin:0}
.section-editor h3{margin:12px 0 4px}
.section-editor .section-editor-head{cursor:default;padding-bottom:2px}.section-editor .section-editor-head:hover{background:transparent}
.section-editor .section-editor-kicker{font-family:var(--mono)}
.section-editor .block-editor-close:hover{color:var(--text);background:var(--fill-3)}
.section-editor .block-editor-reset{flex:none;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;font-size:13px;line-height:1;color:var(--muted)}
.section-editor .block-editor-reset[aria-disabled=true]{opacity:var(--disabled);background:transparent}
.section-editor .block-editor-wide[aria-disabled=true]:hover{background:var(--fill-2);border-color:var(--edge)}
.section-editor .block-editor-wide{width:auto}
.section-editor .curve-scale{margin:6px 0 8px;font-family:var(--mono);font-size:10px;color:var(--muted)}
.section-editor .eq-head-note{margin-left:8px;font-weight:400;letter-spacing:0;text-transform:none}
@media (width < 600px){.section-editor{margin-top:-8px}}
@media (width <= 440px){.section-editor{padding:8px 10px 10px}}
@media(prefers-reduced-motion:reduce){.section-editor:not([hidden]){animation:none}}

/* Recording blocks: an empty block keeps its span dashed until a take fills it; the drawn span is a ghost. */
.project .project-clip[data-empty],.project .project-recording-ghost{border:1px dashed color-mix(in srgb,var(--hue,#ed817b) 60%,transparent);background:color-mix(in srgb,var(--hue,#ed817b) 8%,var(--surface-1))}
.project .project-clip[data-empty] .project-clip-head{top:50%;transform:translateY(-50%)}.project .project-clip[data-empty] .project-clip-label{opacity:.85;font-weight:500}
.project .project-clip[data-empty][data-selected]{border-style:solid;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--hue,#ed817b) 70%,transparent)}
.project .project-clip[data-empty][data-take=cued]{border-style:solid;border-color:var(--rose);animation:project-cued 1s ease-in-out infinite alternate}
.project .project-clip[data-empty][data-take=cued] .project-clip-label,.project .project-clip[data-empty][data-take=saving] .project-clip-label{color:var(--rose-soft);opacity:1}
.project .project-clip[data-empty][data-take=recording]{border-style:solid;border-color:color-mix(in srgb,var(--rose) 50%,transparent);background:color-mix(in srgb,var(--rose) 5%,transparent)}
.project .project-clip[data-empty][data-take=unsaved]{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 10%,var(--surface-1))}
.project .project-clip[data-empty][data-take=unsaved] .project-clip-label{color:var(--accent);opacity:1}
@keyframes project-cued{from{background:color-mix(in srgb,var(--rose) 3%,transparent)}to{background:color-mix(in srgb,var(--rose) 14%,transparent)}}
@media(prefers-reduced-motion:reduce){.project .project-clip[data-empty][data-take=cued]{animation:none;background:color-mix(in srgb,var(--rose) 10%,transparent)}}
.project .project-audio-body{cursor:crosshair}
.project .project-audio-body:focus-visible{outline:var(--focus-ring);outline-offset:-2px}
/* Past the song's end a lane can't be drawn on: it is shaded from there. */
.project .project-audio-body::after{content:'';position:absolute;top:0;bottom:0;left:var(--song-px,100%);right:0;background:repeating-linear-gradient(135deg,#00000040 0 6px,transparent 6px 12px);pointer-events:none}
.project .project-recording-ghost{pointer-events:none;z-index:131}
.project .project-recording-hint{position:sticky;left:10px;display:inline-block;margin:12px 10px 0;font-size:11px;line-height:16px;color:var(--muted);white-space:nowrap;pointer-events:none;user-select:none}
/* The editor's empty-block side (clip-editor.ts, the Clip tab). */
.clip-editor .project-record-side{display:grid;gap:6px;padding:0 0 6px}
.clip-editor .project-record-input select{max-width:240px;min-width:0;flex:1 1 auto}
.clip-editor .project-record-off{color:var(--muted);font-size:11px}
.clip-editor .project-record-block{display:block;width:100%;max-width:320px;min-height:32px;padding:5px 12px;font-weight:600;color:var(--record-ink);border-color:var(--record-edge)}
.clip-editor .project-record-block[data-mode=connect]{color:var(--text);border-color:var(--edge)}
.clip-editor .project-record-note{margin:0;font-size:11px;line-height:15px;color:var(--muted)}
.clip-editor .project-record-unsaved{margin:0;font-size:11px;line-height:15px;color:var(--accent)}
.clip-editor .project-input-settings{justify-self:start;padding:3px 0;border:0;background:none;font-size:11px;color:var(--muted);text-decoration:underline;text-underline-offset:2px}
.clip-editor .project-input-settings:hover{color:var(--text);background:none}

/* Sampler clips (0.14.0, SAMPLER-SONG-PLAN.md D5, D6). A clip with effects carries an fx mark (it opens the editor's
   Effects) and a faint line per drawn curve; a chopped clip draws its steps as boxes over the waveform, each from the
   slice it plays (a rest empty, a reversed one mirrored with ‹, ×N for a repeat, the rate where not 1×), the chosen
   step outlined; a held press shows the slice count and a preview of equal boxes. The clip editor sits in a row of
   its own under the clip's row, as wide as the view and pinned at its left, with the lane editor's look in the
   track's hue; it holds controls only while open. */
.project .project-clip-fx{flex:none;height:13px;padding:0 3px;border:1px solid color-mix(in srgb,var(--hue) 42%,transparent);border-radius:3px;background:color-mix(in srgb,var(--hue) 18%,var(--surface-1));color:color-mix(in srgb,var(--hue) 72%,var(--text));font:600 9px/11px var(--mono);letter-spacing:.3px;pointer-events:auto;cursor:pointer}
.project .project-clip-fx:hover{background:color-mix(in srgb,var(--hue) 32%,var(--surface-1));border-color:color-mix(in srgb,var(--hue) 70%,transparent);color:var(--text)}
/* The clip clips its head: the mark's ring sits inside it. */
.project .project-clip-fx:focus-visible{outline-offset:-2px}
.project .project-clip-line{position:absolute;left:0;top:3px;width:100%;height:calc(100% - 6px);overflow:visible;pointer-events:none;z-index:2}
.project .project-clip-line:not([data-drawn]){display:none}
.project .project-clip-line path{fill:none;stroke:color-mix(in srgb,var(--hue) 72%,var(--text));stroke-width:1;stroke-linejoin:round;opacity:.5;vector-effect:non-scaling-stroke}
.project .project-chop{position:absolute;inset:0;z-index:1}
.project .project-clip[data-chopped] .project-clip-wave{display:none}
.project .project-chop-step{position:absolute;top:0;bottom:0;box-sizing:border-box;border-left:1px solid #00000070;overflow:hidden;container-type:inline-size}
.project .project-chop-step:first-child{border-left:0}
.project .project-chop-step[data-moved]{background:color-mix(in srgb,var(--hue) 9%,transparent)}
.project .project-chop-step[data-rest]{background:repeating-linear-gradient(135deg,transparent 0 4px,#00000040 4px 5px),#00000055}
.project .project-chop-step[data-chosen]{box-shadow:inset 0 0 0 1.5px color-mix(in srgb,var(--text) 90%,transparent);border-radius:3px;z-index:1}
.project .project-chop-step[data-over]{background:color-mix(in srgb,var(--hue) 34%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--hue) 80%,var(--text))}
.project .project-chop-wave{position:absolute;left:0;top:2px;width:100%;height:calc(100% - 4px);fill:color-mix(in srgb,var(--hue) 70%,var(--text));opacity:.72;pointer-events:none}
.project .project-chop-step[data-reverse] .project-chop-wave{transform:scaleX(-1)}
.project .project-chop-step[data-rest] .project-chop-wave{display:none}
.project .project-clip[data-sounding] .project-chop-wave{opacity:.95}
.project .project-chop-mark{position:absolute;right:2px;bottom:1px;max-width:calc(100% - 4px);overflow:hidden;color:color-mix(in srgb,var(--hue) 55%,var(--text));font:600 9px/10px var(--mono);white-space:nowrap;pointer-events:none;text-shadow:0 0 3px var(--surface-1)}
.project .project-chop-mark:empty{display:none}
/* A box too narrow for words keeps its wave and its states only. */
@container (width <= 22px){.project .project-chop-mark{display:none}}
.project .project-slice-count{position:absolute;top:0;right:8px;z-index:8;padding:2px 6px;border-radius:0 0 5px 5px;background:var(--accent);color:var(--bg);font:700 9px/12px var(--mono);white-space:nowrap;pointer-events:none}
.project .project-chop-preview{position:absolute;inset:0;display:flex;z-index:4;pointer-events:none}
.project .project-chop-preview>span{flex:1 1 0;min-width:0;border-left:1px solid color-mix(in srgb,var(--text) 75%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--text) 15%,transparent)}
.project .project-chop-preview>span:first-child{border-left:0}
.project .project-clip[data-slicing]{border-color:color-mix(in srgb,var(--text) 85%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--text) 50%,transparent)}
.project .project-clip[data-slicing] .project-chop-preview:not([hidden])~*{visibility:hidden}
.project .project-editor-row{display:flex;min-width:0}
.project .project-editor-slot{position:sticky;left:0;flex:none;width:100cqw;max-width:100%;min-width:0;padding:4px 0 10px;z-index:8}
.clip-editor{--track-color:var(--accent);margin:0;min-width:0;max-width:100%;padding:8px 12px 12px;background:var(--panel);border:1px solid color-mix(in srgb,var(--track-color) 24%,var(--edge));border-radius:10px;font-size:12px;box-shadow:0 10px 28px #00000038;text-align:left;white-space:normal;cursor:default}
.clip-editor:not([hidden]){animation:lane-tray-open 200ms cubic-bezier(.2,.8,.3,1)}
.clip-editor p{margin:0}
.clip-editor:has(>.deck-rail){padding-bottom:0}
.clip-editor .clip-editor-head{cursor:default;padding-bottom:2px}.clip-editor .clip-editor-head:hover{background:transparent}
.clip-editor .clip-editor-kicker{font-family:var(--mono)}
.clip-editor .block-editor-close:hover{color:var(--text);background:var(--fill-3)}
.clip-editor .block-editor-reset{flex:none;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;font-size:13px;line-height:1;color:var(--muted)}
.clip-editor .block-editor-reset[aria-disabled=true]{opacity:var(--disabled);background:transparent}
.clip-editor .block-editor-wide{width:auto;margin-top:0}
.clip-editor .block-editor-wide[aria-disabled=true]{opacity:var(--disabled);cursor:default}
.clip-editor .block-editor-wide[aria-disabled=true]:hover{background:var(--fill-2);border-color:var(--edge)}
.clip-editor .curve-scale{margin:6px 0 8px;font-family:var(--mono);font-size:10px;color:var(--muted)}
.clip-editor .eq-head-note{margin-left:8px;font-weight:400;letter-spacing:0;text-transform:none}
.clip-editor .deck-panel>.block-editor-group>.block-editor-rows{padding-top:2px}
.clip-editor .block-tab-scope{margin-top:8px}
/* The Clip tab: ▶, the sliders on the deck's grid, the clip's track and its actions in one row. */
.clip-editor .clip-editor-tools{display:flex;align-items:center;gap:4px;margin:0 0 8px}
.clip-editor .block-editor-tool{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 9px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--text-3);font-size:12px;line-height:26px;cursor:pointer}
.clip-editor .block-editor-tool:hover{background:var(--fill-3);border-color:transparent}
.clip-editor .clip-editor-play-glyph{font-size:10px;color:var(--track-color)}
.clip-editor .clip-editor-sliders{display:grid;gap:4px;max-width:520px;margin:0 0 10px}
.clip-editor .clip-editor-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px}
.clip-editor .clip-editor-field{display:inline-flex;align-items:center;gap:8px;min-width:0;color:var(--muted);font-size:11px}
.clip-editor .clip-editor-field select{min-width:0;max-width:180px;padding:4px 8px;font-size:11px}
.clip-editor .clip-editor-delete{color:var(--rose);margin-left:auto}
.clip-editor .clip-editor-delete[aria-disabled=true]{opacity:var(--disabled);cursor:default}
/* The Chop tab: the count and the two resets; two strips of boxes that scroll sideways when narrow; the chosen step's row. */
.clip-editor .clip-editor-chop-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin:0 0 8px}
.clip-editor .clip-editor-stepper{display:inline-flex;align-items:center;gap:2px}
.clip-editor .clip-editor-step-button{width:26px;height:24px;padding:0;border-radius:6px;font-size:13px;line-height:1}
.clip-editor .clip-editor-step-button[aria-disabled=true]{opacity:var(--disabled);cursor:default}
.clip-editor .clip-editor-count{min-width:3ch;text-align:center;font:12px var(--mono);color:var(--text)}
.clip-editor .clip-editor-strip-label{margin:0 0 3px}
.clip-editor .clip-editor-strip{display:flex;gap:3px;min-width:0;margin:0 0 10px;padding:2px 2px 6px;overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--edge-3) transparent}
.clip-editor .clip-slice,.clip-editor .clip-step{--hue:var(--track-color);position:relative;flex:1 0 36px;max-width:72px;height:40px;min-width:0;padding:0;border:1px solid color-mix(in srgb,var(--hue) 32%,transparent);border-radius:5px;background:color-mix(in srgb,var(--hue) 13%,var(--surface-1));overflow:hidden;cursor:pointer;transition:background .12s,border-color .12s,box-shadow .12s}
.clip-editor .clip-slice:hover,.clip-editor .clip-step:hover{border-color:color-mix(in srgb,var(--hue) 60%,transparent);background:color-mix(in srgb,var(--hue) 19%,var(--surface-1))}
.clip-editor .clip-slice[aria-pressed=true]{border-color:color-mix(in srgb,var(--hue) 90%,var(--text));box-shadow:0 0 0 1px color-mix(in srgb,var(--hue) 50%,transparent);background:color-mix(in srgb,var(--hue) 26%,var(--surface-1))}
.clip-editor .clip-step[aria-selected=true]{border-color:color-mix(in srgb,var(--text) 90%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--text) 50%,transparent)}
.clip-editor .clip-step[data-rest]{background:repeating-linear-gradient(135deg,transparent 0 4px,#00000040 4px 5px),var(--bg)}
.clip-editor .clip-step[data-moved]{background:color-mix(in srgb,var(--hue) 20%,var(--surface-1))}
.clip-editor .clip-step[data-painting]{border-color:color-mix(in srgb,var(--hue) 90%,var(--text));background:color-mix(in srgb,var(--hue) 30%,var(--surface-1))}
.clip-editor .clip-slice:focus-visible,.clip-editor .clip-step:focus-visible{outline:var(--focus-ring);outline-offset:-2px}
.clip-editor .clip-editor-wave{position:absolute;left:0;top:3px;width:100%;height:calc(100% - 6px);fill:color-mix(in srgb,var(--hue) 70%,var(--text));opacity:.72;pointer-events:none}
.clip-editor .clip-step[data-reverse] .clip-editor-wave{transform:scaleX(-1)}
.clip-editor .clip-step[data-rest] .clip-editor-wave{display:none}
.clip-editor .clip-editor-n{position:absolute;left:4px;top:2px;color:color-mix(in srgb,var(--hue) 60%,var(--text));font:600 9px/11px var(--mono);text-shadow:0 0 3px var(--surface-1);pointer-events:none}
.clip-editor .clip-editor-marks{position:absolute;right:3px;bottom:2px;color:color-mix(in srgb,var(--hue) 55%,var(--text));font:600 9px/10px var(--mono);white-space:nowrap;text-shadow:0 0 3px var(--surface-1);pointer-events:none}
.clip-editor .clip-editor-marks:empty{display:none}
.clip-editor .clip-editor-step-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;min-width:0;padding:8px 0 0;border-top:1px solid var(--fill-3)}
.clip-editor .clip-editor-step-title{flex:none;min-width:84px;font-family:var(--mono)}
.clip-editor .clip-editor-step-row .value-slider{flex:1 1 260px;max-width:360px}
.clip-editor .clip-editor-toggle{height:26px;padding:0 10px;border-radius:6px;font-size:11px}
.clip-editor .clip-editor-toggle[aria-pressed=true]{color:var(--text);background:var(--selected-bg);border-color:var(--selected-edge)}
.clip-editor .clip-editor-toggle[aria-disabled=true],.clip-editor .value-slider-off{opacity:var(--disabled);cursor:default}
@media (width < 600px){
  .clip-editor{padding:8px 10px 10px}
  .clip-editor>.deck-rail{margin-inline:-10px}
  .clip-editor .clip-editor-field select{max-width:140px}
  .clip-editor .clip-editor-step-row .value-slider{flex-basis:100%;max-width:none}
}
@media(pointer:coarse){.clip-editor .clip-slice,.clip-editor .clip-step{height:44px;flex-basis:44px}.clip-editor .clip-editor-step-button,.clip-editor .clip-editor-toggle{height:34px}}
@media(prefers-reduced-motion:reduce){.clip-editor:not([hidden]){animation:none}}

/* Song tracks (0.15.0, SAMPLER-SONG-PLAN.md D12): one 40 px row per song track under the roster's miniatures and above
   the audio rows. Its head (the kind's colour, the name, ⋯, M and the kind) is pinned on the left as the audio heads
   are; its blocks are the lanes' blocks at the open view's scale: pads in the track's colour with their onset, hold,
   rest and muted states (lanes.ts padStateClass), a Note block as a flat mini piano roll, a sample block with its
   region's name, the fx mark and the curve strip; the block editor sits in a row of its own under the row it edits. */
.project .project-songtracks{display:block}
.project .project-songtrack-row{height:40px}
.project .project-songtrack-head{display:grid;grid-template-rows:17px 18px;align-content:center;gap:1px;padding:0 6px 0 2px;border-top:1px solid var(--fill-2);color:var(--lane-color)}
.project .project-songtrack-title{position:relative;display:flex;align-items:center;gap:4px;min-width:0}
.project .project-songtrack-title::before{content:'';flex:none;width:6px;height:6px;margin-left:2px;border-radius:50%;background:var(--lane-color)}
.project .project-songtrack-name{flex:1 1 auto;min-width:0;padding:0 2px;border:0;background:transparent;box-shadow:none;color:inherit;font:700 9.5px/17px var(--mono);letter-spacing:.2px;text-transform:uppercase;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:text}
.project .project-songtrack-name:hover{background:transparent;color:var(--text)}
.project .project-songtrack-name:focus-visible{outline:var(--focus-ring);outline-offset:0;border-radius:3px}
.project .project-songtrack-rename{width:100%;min-width:0;height:17px;padding:0 4px;font:600 10px var(--mono)}
.project .project-songtrack-more{position:relative;flex:none;width:16px;height:16px;padding:0;border:0;border-radius:4px;background:transparent;box-shadow:none;color:var(--muted);font-size:11px;line-height:14px;opacity:0}
.project .project-songtrack-head:hover .project-songtrack-more,.project .project-songtrack-more:focus-visible,.project .project-songtrack-row[data-editing] .project-songtrack-more{opacity:1}.project .project-songtrack-more:hover{color:var(--text);background:var(--fill-3)}
.project .project-songtrack-controls{display:flex;align-items:center;gap:6px;min-width:0;padding-left:12px}
.project .project-songtrack-mute{position:relative;flex:none;width:18px;height:16px;padding:0;display:grid;place-items:center;border:1px solid var(--edge);border-radius:4px;background:transparent;box-shadow:none;color:var(--muted);font:700 9px/1 var(--mono)}
.project .project-songtrack-mute:hover{color:var(--text);border-color:#ffffff40;background:var(--fill-2)}
.project .project-songtrack-mute[aria-pressed=true]{color:var(--surface-1);background:var(--sand);border-color:var(--sand)}
.project .project-songtrack-kind{min-width:0;overflow:hidden;color:var(--muted);font:500 9px/16px var(--mono);letter-spacing:.3px;text-transform:uppercase;text-overflow:ellipsis}
.project .project-songtrack-row[data-editing] .project-songtrack-head{background:color-mix(in srgb,var(--lane-color) 8%,var(--bg))}
.project .project-songtrack-row[data-muted] .project-songtrack-body{opacity:.45}
.project .project-songtrack-row[data-muted] .project-songtrack-title{color:color-mix(in srgb,var(--lane-color) 50%,var(--muted))}.project .project-songtrack-row[data-muted] .project-songtrack-title::before{background:currentColor}
.project .project-songtrack-body{position:relative;isolation:isolate;flex:1 0 auto;border-top:1px solid var(--fill-2);cursor:crosshair;background:repeating-linear-gradient(90deg,transparent 0 calc(var(--beat-px) * 4 - 1px),var(--fill-1) calc(var(--beat-px) * 4 - 1px) calc(var(--beat-px) * 4))}
.project .project-songtrack-body:focus-visible{outline:var(--focus-ring);outline-offset:-2px}
/* Past the song's end a row draws nothing new: shaded from there, as an audio lane is (a block left there is cut there). */
.project .project-songtrack-body::after{content:'';position:absolute;top:0;bottom:0;left:var(--song-px,100%);right:0;background:repeating-linear-gradient(135deg,#00000040 0 6px,transparent 6px 12px);pointer-events:none}
.project .project-songtrack-hint{position:sticky;left:10px;display:inline-block;margin:12px 10px 0;font-size:11px;line-height:16px;color:var(--muted);white-space:nowrap;pointer-events:none;user-select:none}
.project .project-songtrack-block{position:absolute;top:3px;height:34px;box-sizing:border-box;border:1px solid var(--edge-strong);border-radius:5px;background:color-mix(in srgb,var(--lane-color) 90%,var(--surface-1));overflow:hidden;cursor:grab;touch-action:pan-x;transition:border-color .12s,box-shadow .12s}
.project .project-songtrack-block:hover{border-color:#ffffff60}
/* A block in its lane's colour takes the ring just outside it, on the row's dark ground (the row leaves 3 px). */
.project .project-songtrack-block:focus-visible{outline:var(--focus-ring);outline-offset:1px}
.project .project-songtrack-block[data-selected]{border-color:color-mix(in srgb,var(--text) 85%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--text) 50%,transparent)}
.project .project-songtrack-block[data-sounding]{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 69%,transparent),0 0 8px color-mix(in srgb,var(--accent) 20%,transparent)}
.project .project-songtrack-block[data-selected][data-sounding]{box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--text) 69%,transparent),0 0 8px color-mix(in srgb,var(--accent) 25%,transparent)}
.project .project-songtrack-block[data-dragging]{z-index:5;opacity:.9;cursor:grabbing;box-shadow:0 6px 16px #00000090;transition:none}
.project .project-songtrack-block[data-invalid]{border-color:var(--rose);box-shadow:0 0 0 1px var(--rose),0 0 10px color-mix(in srgb,var(--rose) 33%,transparent)}
.project .project-songtrack-block[data-past-end]{background-image:linear-gradient(90deg,transparent calc(100% - 2px),var(--edge-strong) 0)}
.project .project-songtrack-cells{position:absolute;inset:0}
.project .project-songtrack-cell{position:absolute;top:0;bottom:0;box-sizing:border-box;border-left:1px solid #00000042;container-type:inline-size}
.project .project-songtrack-cell:first-child{border-left-color:transparent}
.project .project-songtrack-cell.rest{border:3px solid transparent;border-left-width:1px;border-right-width:1px;border-radius:4px;background:#00000080;background-clip:padding-box}
.project .project-songtrack-cell.note-onset::after{content:'';position:absolute;left:2px;top:66%;bottom:5px;width:2px;border-radius:1px;background:color-mix(in srgb,var(--bg) 65%,transparent);pointer-events:none}
.project .project-songtrack-cell.note-hold{border-left-color:transparent}
.project .project-songtrack-cell.note-hold::before{content:'';position:absolute;left:0;right:0;top:50%;height:2px;margin-top:-1px;background:color-mix(in srgb,var(--bg) 36%,transparent);pointer-events:none}
.project .project-songtrack-cell.note-muted{background-image:repeating-linear-gradient(135deg,transparent 0 4px,var(--fill-3) 4px 5px)}
.project .project-songtrack-cell.note-rest::after{content:'·';position:absolute;inset:0;display:grid;place-items:center;color:#ffffff50;font:13px/1 var(--mono);pointer-events:none}
.project .project-songtrack-cell[data-chosen]{outline:1.5px solid color-mix(in srgb,var(--text) 90%,transparent);outline-offset:-3px;border-radius:4px;background-color:color-mix(in srgb,var(--text) 10%,transparent)}
.project .project-songtrack-label{position:absolute;left:4px;right:2px;top:12px;font:600 9px/11px var(--mono);color:var(--bg);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
.project .project-songtrack-label:empty{display:none}
.project .project-songtrack-cell.note-muted .project-songtrack-label{color:color-mix(in srgb,var(--text) 48%,transparent)}
@container (width <= 26px){.project .project-songtrack-label{display:none}}
/* A Note block: its notes as the lanes' flat preview, under its count. A sample block names its region at its head instead of on each pad. */
.project .project-songtrack-notes .clip-note-preview{position:absolute;left:1px;top:12px;width:calc(100% - 2px);height:calc(100% - 15px);pointer-events:none;overflow:hidden}
.project .project-songtrack-notes .clip-note-preview rect{fill:color-mix(in srgb,var(--bg) 77%,transparent)}
.project .project-songtrack-notes .clip-note-preview rect.muted{fill:none;stroke:color-mix(in srgb,var(--bg) 60%,transparent);stroke-width:.7;stroke-dasharray:2 1;vector-effect:non-scaling-stroke}
.project .project-songtrack-block[data-kind=sample] .project-songtrack-label{display:none}
.project .project-songtrack-blockhead{position:absolute;left:4px;top:1px;z-index:3;display:flex;align-items:center;gap:4px;max-width:calc(100% - 12px);min-width:0;pointer-events:none}
.project .project-songtrack-words{min-width:0;overflow:hidden;color:var(--bg);font:600 9px/11px var(--mono);white-space:nowrap;text-overflow:ellipsis}
.project .project-songtrack-words:empty{display:none}
.project .project-songtrack-fx{flex:none;height:12px;padding:0 3px;border:1px solid color-mix(in srgb,var(--bg) 35%,transparent);border-radius:3px;background:color-mix(in srgb,var(--bg) 18%,transparent);color:var(--bg);font:700 9px/10px var(--mono);letter-spacing:.3px;pointer-events:auto;cursor:pointer}
.project .project-songtrack-fx:hover{background:color-mix(in srgb,var(--bg) 33%,transparent);color:var(--text)}
/* Inside a block in its lane's colour, too small for the halo ring: a dark ring inside its edge, its word still clear. */
.project .project-songtrack-fx:focus-visible{outline:2px solid var(--bg);outline-offset:-2px}
.project .project-songtrack-block[data-tight] .project-songtrack-blockhead{display:none}
.project .project-songtrack-curves{display:none;position:absolute;bottom:0;left:0;width:calc(100% - 6px);height:9px;pointer-events:none;z-index:2}
.project .project-songtrack-curves[data-curved]{display:block}
.project .project-songtrack-curves polyline{fill:none;stroke:var(--text);stroke-width:1;stroke-opacity:.5;vector-effect:non-scaling-stroke}
.project .project-songtrack-curves .curve-lpf{stroke-opacity:.95}.project .project-songtrack-curves .curve-synth{stroke-width:1.25;stroke-opacity:.9}
.project .project-songtrack-edge{position:absolute;right:0;top:0;bottom:0;width:6px;background:#00000018;cursor:ew-resize;z-index:4}
.project .project-songtrack-edge:hover,.project .project-songtrack-block[data-dragging] .project-songtrack-edge{background:#00000040}
/* Hold-and-slide: the count badge and the pads it would make (the lanes' preview); drawing: a ghost cut every 16 beats. */
.project .project-songtrack-count{position:absolute;top:0;right:8px;z-index:8;padding:2px 6px;border-radius:0 0 5px 5px;background:var(--accent);color:var(--bg);font:700 9px/12px var(--mono);white-space:nowrap;pointer-events:none}
.project .project-songtrack-preview{position:absolute;inset:0;z-index:5;pointer-events:none}
.project .project-songtrack-preview>span{position:absolute;top:0;bottom:0;box-sizing:border-box;border-left:1px solid color-mix(in srgb,var(--bg) 50%,transparent);background:color-mix(in srgb,var(--lane-color) 78%,var(--text))}
.project .project-songtrack-preview>span:first-child{border-left-color:transparent}
.project .project-songtrack-preview>span.rest{background:#00000099}
.project .project-songtrack-block[data-slicing]{border-color:color-mix(in srgb,var(--text) 85%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--text) 50%,transparent);cursor:ns-resize}
.project .project-songtrack-block[data-previewing] .project-songtrack-cells{visibility:hidden}
.project .project-songtrack-ghost{position:absolute;top:3px;height:34px;box-sizing:border-box;border:1px dashed color-mix(in srgb,var(--lane-color) 75%,transparent);border-radius:5px;background:color-mix(in srgb,var(--lane-color) 18%,transparent);pointer-events:none;z-index:6}
.project .project-songtrack-ghost[data-cut]{background:repeating-linear-gradient(90deg,transparent 0 calc(var(--cut) - 1px),color-mix(in srgb,var(--text) 63%,transparent) calc(var(--cut) - 1px) var(--cut)),color-mix(in srgb,var(--lane-color) 18%,transparent)}
/* The block editor under the row it edits: the clip editor's slot, as wide as the view and pinned at its left. */
.project .project-songtrack-editor-row .block-editor{margin:0;text-align:left;white-space:normal;cursor:default;border-color:color-mix(in srgb,var(--track-color) 24%,var(--edge))}
.project .project-songtrack-holder{display:none}
@media(pointer:coarse){.project .project-songtrack-edge{width:12px}.project .project-zoom{width:28px;height:22px}}
/* The quiet boundary above a song track's open editor, as the lanes put one above theirs: it collapses the editor. */
.project .project-songtrack-ribbon{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;min-height:28px;margin:0 0 4px;padding:4px 12px;border:0;border-bottom:1px solid var(--fill-3);border-radius:0 0 7px 7px;background:linear-gradient(var(--fill-1),var(--fill-2));color:var(--muted);font:500 10px/16px var(--mono);letter-spacing:.1px;box-shadow:none;touch-action:pan-x pan-y;cursor:pointer}
.project .project-songtrack-ribbon svg{width:14px;height:14px;flex:none}
.project .project-songtrack-ribbon:hover{background:var(--fill-3);color:var(--text)}
.project .project-songtrack-ribbon:focus-visible{outline:var(--focus-ring);outline-offset:-2px;color:var(--text)}
@media(pointer:coarse){.project .project-songtrack-ribbon{min-height:44px}}
/* 600 and 390: the heads stay 76 px and pinned; the name is smaller and ⋯ always shows (it holds every action). */
@media (width < 600px){
  .project .project-songtrack-head{padding-right:3px}
  .project .project-songtrack-name{font-size:9px}
  .project .project-songtrack-more{opacity:1}
  .project .project-songtrack-controls{padding-left:4px}
  .project .project-songtrack-kind{font-size:9px}
  .project .project-songtrack-hint{font-size:10px;margin-left:8px}
}

/* Hit areas (UI pass 2026-11-17): the heads' small controls keep their drawn size and take presses beyond it through an
   inset ::after (::before on the gain, whose ::after is its unit), each only as far as no other control is drawn: a head's
   two rows meet halfway across the 2 px between them (the ⋯ stops at its row, M, the gain and the arm reach 1 px up),
   the ⋯ leaves the name its full width, and the head (overflow hidden, the next row's head over it) bounds the rest. A
   coarse pointer gets the width the head holds, and the ⋯ buttons always show. */
.project .project-audio-mute::after,.project .project-audio-arm::after,.project .project-songtrack-mute::after{content:'';position:absolute;inset:-1px -4px -5px}
.project .project-audio-more::after,.project .project-songtrack-more::after{content:'';position:absolute;inset:-4px -4px -1px 0}
.project .project-audio-gain::before{content:'';position:absolute;inset:-1px 0 -5px}
.project .project-zoom::after{content:'';position:absolute;inset:-5px -2px}
.project .project-track-add::after{content:'';position:absolute;inset:-3px -1px}
.project .project-block-more::after{content:'';position:absolute;inset:-2px -2px -2px -4px}
/* Beside an fx mark the ⋯ keeps to its own box, so the mark's edge stays the mark's. */
.project .project-block[data-fx] .project-block-more::after{left:0}
.project .project-block-fx::after{content:'';position:absolute;inset:-5px -3px}
@media(pointer:coarse){
  .project .project-audio-mute::after,.project .project-audio-arm::after,.project .project-songtrack-mute::after{inset:-1px -5px -11px}
  .project .project-audio-more::after,.project .project-songtrack-more::after{inset:-10px -6px -1px 0}
  .project .project-audio-more,.project .project-songtrack-more{opacity:1}
  .project .project-zoom::after{inset:-10px -2px}
  .project .project-block-more{top:1px;width:24px;height:24px}
}
/* While a clip is dragged, its track sits over the rows after it (a clip dragged onto another track stays in sight),
   still under the pinned heads. */
.project .project-audio-body:has(.project-clip[data-dragging]){z-index:1}
/* The name rule under a song track's name while it is typed (song-track-row.ts paintRule), in place of M and the kind. */
.project .project-songtrack-rule{grid-row:2;min-width:0;overflow:hidden;padding-left:12px;color:var(--muted);font-size:9.5px;line-height:18px;white-space:nowrap;text-overflow:ellipsis}
.project .project-songtrack-rule[data-invalid]{color:var(--rose)}
.project .project-songtrack-head[data-renaming] .project-songtrack-controls{display:none}
.project .project-songtrack-rename[aria-invalid=true]{border-color:color-mix(in srgb,var(--rose) 70%,transparent)}
@media (width < 600px){.project .project-songtrack-rule{padding-left:4px}}

/* The control deck: retained panels share a footprint; the selector never changes musical enable state. */
.deck-stage,.deck-rail{--stage-edge:var(--fill-3);--stage-highlight:var(--fill-2);--stage-flash:var(--edge-3);--chip-hover:var(--fill-2);--flash:150ms;min-width:0}
.deck-stage{position:relative;margin:0;padding:10px 12px 12px;border:1px solid var(--stage-edge);border-top:0;border-radius:0 0 8px 8px;background:var(--stage)}
.deck-stage.deck-switched{animation:deck-flash var(--flash) ease-out}
@keyframes deck-flash{from{box-shadow:inset 0 0 0 1px var(--stage-edge),inset 0 1px 0 var(--stage-flash),inset 0 14px 18px -14px var(--stage-flash)}to{box-shadow:inset 0 0 0 1px var(--stage-edge),inset 0 1px 0 var(--stage-highlight)}}
.deck-constants{margin:0 0 10px;padding:0 0 10px;border-bottom:1px solid var(--fill-3)}
.deck-groups-stack{display:grid;min-width:0}
.deck-panel{grid-area:1/1;min-width:0;visibility:hidden;align-self:start}
.deck-panel.deck-shown{visibility:visible}
.deck-group-head{display:flex;align-items:center;gap:10px;height:28px;margin:0 0 6px;min-width:0}
.deck-group-title{flex:none;line-height:24px}
.deck-head-tools{margin-left:auto}
.deck-subselector{display:inline-flex;gap:2px;padding:0;border:0;border-radius:0;background:transparent}
.deck-subselector[data-mode=narrow]{display:none}
.deck-subselector .deck-sub{display:grid;place-items:center;min-width:32px;height:28px;padding:0 8px;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;color:var(--muted);font-size:11px;white-space:nowrap}
.deck-subselector .deck-sub[aria-checked=true]{border-bottom-color:var(--text);color:var(--text);font-weight:600}
.deck-sub-view{visibility:inherit}
.deck-sub-view.deck-sub-hidden{visibility:hidden}
.deck-sub-stack[data-deck-sub-mode=always]{display:grid;grid-template-columns:minmax(0,1fr)}
.deck-sub-stack[data-deck-sub-mode=always]>.deck-sub-view{grid-area:1/1;align-self:start;min-width:0}
.deck-rail{position:relative;margin:8px 0 0;padding:0;background:var(--stage);border:1px solid var(--stage-edge);border-block:0;border-radius:8px 8px 0 0}
.deck-tabs,.deck-groups{display:flex;align-items:center;gap:2px;min-width:0}
.deck-rail .deck-tabs{align-items:flex-end;flex-wrap:nowrap;gap:4px;overflow-x:auto;scrollbar-width:none;margin:0 -1px;padding:0;border:0;background:var(--panel)}
.deck-tabs::-webkit-scrollbar{display:none}
.deck-tabs.deck-clipped-right{mask-image:linear-gradient(90deg,#000 calc(100% - 16px),transparent)}
.deck-tabs.deck-clipped-left{mask-image:linear-gradient(90deg,transparent,#000 16px)}
.deck-tabs.deck-clipped-left.deck-clipped-right{mask-image:linear-gradient(90deg,transparent,#000 16px,#000 calc(100% - 16px),transparent)}
.deck-groups{flex-wrap:wrap;gap:2px 6px;margin:0 10px;padding:4px 0 2px;min-height:34px;border-bottom:1px solid var(--stage-edge)}
.deck-rail [role=tab],.deck-rail .deck-group,.deck-rail .deck-end{display:inline-flex;flex:none;align-items:center;gap:7px;height:28px;padding:0 10px;border:0;border-radius:6px;background:transparent;color:var(--muted);font-size:11px;letter-spacing:.2px;white-space:nowrap;cursor:pointer;transition:background .12s,color .12s}
.deck-rail [role=tab]{height:32px;margin:0;padding:0 14px;border:1px solid var(--fill-3);border-bottom:0;border-radius:8px 8px 0 0;background:var(--surface-2);color:var(--muted);font-size:12px;font-weight:500}
.deck-rail [role=tab]:hover{background:var(--raised-hover);color:var(--text-2)}
.deck-rail [role=tab][aria-selected=true]{height:35px;background:var(--stage);color:var(--text);font-weight:600;border-color:var(--stage-edge)}
.deck-rail .deck-group{padding:0 8px;border-bottom:2px solid transparent;border-radius:0;text-transform:uppercase;font-weight:500;font-size:10px;letter-spacing:.4px}
.deck-rail .deck-group:hover,.deck-rail .deck-end:hover{background:var(--chip-hover);color:var(--text-2)}
.deck-rail .deck-group[aria-checked=true]{color:var(--text);font-weight:600;border-bottom-color:var(--text)}
.deck-group .deck-note{display:none}
.deck-rail .deck-end{margin-left:auto;font-size:10px;color:var(--muted)}
.deck-end-glyph{display:none}
.deck-rail :focus-visible,.deck-subselector :focus-visible{outline:var(--focus-ring);outline-offset:-2px}
.deck-live{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media (width < 760px){.deck-subselector[data-mode=narrow]{display:inline-flex}.deck-sub-stack[data-deck-sub-mode=narrow]{display:grid;grid-template-columns:minmax(0,1fr)}.deck-sub-stack[data-deck-sub-mode=narrow]>.deck-sub-view{grid-area:1/1;align-self:start;min-width:0}}
@media (width < 600px){.deck-rail .deck-end-compact{width:28px;min-width:28px;padding:0;justify-content:center}.deck-end-compact .deck-end-label{display:none}.deck-end-compact .deck-end-glyph{display:inline;font-size:15px;line-height:1}}
@media(pointer:coarse){.deck-rail [role=tab],.deck-rail [role=tab][aria-selected=true],.deck-rail .deck-group,.deck-rail .deck-end{height:44px}.deck-groups{min-height:46px}}
@media (width < 600px) and (pointer:coarse){.deck-rail .deck-end-compact{width:44px;min-width:44px}}
/* Reduced motion: a switch is immediate, with no animation or transition started at all (deck.ts skips the flash). */
@media(prefers-reduced-motion:reduce){.deck-stage.deck-switched{animation:none}.deck-rail [role=tab],.deck-rail .deck-group,.deck-rail .deck-end{transition:none}}
