@font-face { font-family: Comfortaa; src: url('../fonts/comfortaa-variable.ttf') format('truetype'); font-style: normal; font-weight: 300 700; font-display: swap; }
:root { font-family: var(--font-display); color: var(--text); background: var(--page); --control-color: var(--sound-control); }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; align-items: center; background: var(--page) var(--page-image) center / cover fixed; }
button, input, select { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; touch-action: manipulation; }
/* Musical gestures must not start text selection, image dragging or scrolling.
   Text fields remain editable and the empty panel space can still scroll. */
#instrument { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#instrument input:not([type=range]), #instrument textarea, #instrument [contenteditable=true] { user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; }
/* Shared SVG tools inherit the skin and stay sharp at every control size. */
.ui-icon { display: inline-block; width: 24px; height: 24px; flex: 0 0 auto; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
/* Dark skins lighten control text without turning character pupils white. */
svg { --tool-ink: var(--art-ink); }
.ui-icon { color: var(--tool-ink); }
.recording-close .ui-icon { color: var(--text); }
input[type=range] { touch-action: none; user-select: none; -webkit-user-select: none; --range-thumb-size: 24px; }
.harmonics input, .eq-sliders input[type=range] { --range-thumb-size: 20px; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { --instrument-max-width: 1280px; width: min(var(--instrument-max-width), calc(100% - 16px)); margin: 24px auto; padding: 6px; background: var(--shell); container-type: inline-size; }
.masthead { display: grid; grid-template-columns: minmax(0,1fr) max-content minmax(0,1fr); align-items: center; gap: 14px; min-height: 84px; padding: 2px 8px 14px; }
/* Centre the name itself; the mascot and version sit beside it independently. */
.brand { --brand-gap: 18px; position: relative; display: flex; align-items: baseline; min-width: 0; font-family: var(--font-brand); }
.brand h1 { font-size: clamp(30px, 4.1cqw, 58px); white-space: nowrap; margin: 0; line-height: 1.2; }
.brand small { position: relative; left: var(--brand-gap); flex: 0 0 0; width: 0; font-size: clamp(12px, 1.35cqw, 18px); font-weight: 700; line-height: 1; white-space: nowrap; color: var(--brand-version); }
.brand-reset { position: absolute; right: calc(100% + var(--brand-gap)); top: 50%; transform: translateY(-50%); }
.brand-reset, .settings-button { border: 0; background: transparent; padding: 0; }
.brand-reset .snake-character { width: clamp(64px, 11cqw, 152px); height: auto; }
.snake-character { display: block; fill: none; stroke: var(--snake-ink); stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.snake-character.noise-snake { --snake-body: var(--snake-noise-body); --snake-belly: var(--snake-noise-belly); --snake-eyelid: var(--snake-noise-eyelid); --snake-highlight-opacity: .12; --snake-speckles: .92; }
.settings-button { display: inline-flex; align-items: center; justify-content: center; }
.settings-button .ui-icon { width: 22px; height: 22px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions.header-editing { --header-edit-size: clamp(30px,3.5cqw,42px); display: flex; flex-wrap: nowrap; gap: clamp(4px,.5cqw,7px); justify-self: start; }
.header-primary, .sound-history { display: flex; align-items: center; gap: clamp(4px,.5cqw,7px); }
.header-editing .header-button { width: var(--header-edit-size); min-width: var(--header-edit-size); height: var(--header-edit-size); min-height: var(--header-edit-size); border-radius: 12px; }
.header-editing .header-button .ui-icon { width: clamp(19px,2cqw,25px); height: clamp(19px,2cqw,25px); }
.header-actions:last-child { justify-self: end; }
.header-divider { flex: 0 0 1px; width: 1px; height: 25px; margin-inline: 2px; background: color-mix(in srgb,var(--tool-border),transparent 48%); }
.sync-button { position: relative; }
.sync-countdown { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; min-width: 20px; height: 20px; border: 1px solid var(--tool-ink); border-radius: 50%; background: var(--icon-b); color: var(--tool-ink); font: 700 12px var(--font-body); }
.sync-button.waiting { box-shadow: 0 0 0 2px var(--icon-b); }
.header-button { display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.header-button .ui-icon { width: 25px; height: 25px; object-fit: contain; }

.header-button.recording { background: var(--sound-active); border-color: var(--sound-control); animation: pulse 1s infinite; }
.header-button .record-stop, .header-button.recording .record-start { display: none; }
.header-button.recording .record-stop { display: block; }
[data-color-title] { font-weight: 700; }
.brand [data-color-title] { font-weight: 700; letter-spacing: .01em; }
/* Comfortaa's heaviest weight is 700. An outer stroke adds body while keeping
   the coloured letter interiors and open counters intact. */
.brand h1 span { -webkit-text-stroke: .065em color-mix(in srgb,currentColor,black 36%); paint-order: stroke fill; }
.brand h1 span:nth-child(1) { color: var(--envelope-attack); }
.brand h1 span:nth-child(2) { color: var(--envelope-decay); }
.brand h1 span:nth-child(3) { color: var(--envelope-release); }
.button { border: 1px solid var(--button-border); border-radius: var(--button-radius); background: var(--panel-secondary); padding: 7px 10px; min-height: 32px; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.button > .ui-icon { width: 18px; height: 18px; }
.device-button > .ui-icon { width: 27px; height: 27px; color: var(--tool-ink); }
.button[aria-pressed=true], .button.active { background: var(--selected); }
.button:hover, .image-button:hover { filter: brightness(1.08); }
.workbench { --workspace-height: clamp(480px,34cqw,485px); --utility-height: 112px; display: grid; grid-template-columns: minmax(0,270fr) minmax(0,415fr) minmax(0,270fr); grid-template-rows: var(--workspace-height) var(--utility-height); gap: 6px 10px; align-items: stretch; }
.workbench { position:relative; }
.left-column, .center-column, .right-column { display: grid; grid-template-rows: subgrid; grid-row: 1 / span 2; min-width: 0; }
.left-column { grid-column: 1; } .center-column { grid-column: 2; }
.right-column { grid-column: 3; }
.right-top { display: grid; grid-template-rows: minmax(0,5fr) minmax(0,4fr) auto; gap: 6px; min-height: 0; }
.panel { border: 2px solid var(--border); border-radius: var(--panel-radius); background: var(--panel); min-width: 0; }
/* One quiet heading colour lets the musical controls carry the bright colours. */
h2 { margin: 2px 0 8px; text-align: center; font-size: 20px; font-weight: 700; letter-spacing: .015em; color: var(--heading-ink); }
.oscillator-panel { padding: 6px 10px 8px; flex: 1; display: flex; flex-direction: column; justify-content: space-around; }
.oscillator-heading { display: grid; grid-template-columns: 28px minmax(0,1fr) 28px; align-items: center; gap: 4px; }
.oscillator-heading h2 { margin: 0; font-size: clamp(15px,1.8cqw,20px); }
.oscillator-heading .oscillator-page { width: 28px; height: 28px; min-height: 28px; padding: 2px; border-radius: 9px; }
.oscillator-page .ui-icon { width: 20px; height: 20px; }
.osc-card { margin: 6px 0 12px; }
.osc-top { display: grid; grid-template-columns: 48px minmax(0,1fr) 38px; align-items: center; gap: 8px; }
/* Shared circular button: shape, inset icon, focus and pressed treatment.
   Colours follow the skin's tool tokens, separately from musical note colours. */
:is(.round-button,.source-toggle) { --round-size: 40px; position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; width: var(--round-size); height: var(--round-size); padding: 0; border: 2px solid var(--tool-border); border-radius: 50%; background: var(--tool-surface); color: var(--tool-ink); box-shadow: 0 2px 0 color-mix(in srgb,var(--tool-border),transparent 40%); }
.preset-button > .ui-icon { width: 25px; height: 25px; }
:is(.round-button,.source-toggle).active, :is(.round-button,.source-toggle)[aria-pressed=true] { background: var(--tool-active); border-color: var(--tool-ink); box-shadow: inset 0 0 0 1px var(--tool-ink); }
:is(.round-button,.source-toggle):active:not(:disabled) { box-shadow: inset 0 2px 3px var(--tool-border); }
.mute[aria-pressed=false] { background: var(--tool-active); border-color: var(--tool-ink); }
.mute[aria-pressed=true] { background: var(--tool-surface); border-color: var(--tool-border); box-shadow: none; }
.mute[aria-pressed=true]::after { content: ''; position: absolute; width: 64%; height: 2px; border-radius: 2px; background: var(--tool-ink); transform: rotate(-40deg); pointer-events: none; }
.source-toggle { display: inline-flex; justify-content: center; align-items: center; width: 48px; height: 36px; padding: 4px; border-radius: 10px; }
.source-toggle > .snake-character { width: 42px; height: 28px; flex-shrink: 0; }
.source-toggle.mute[aria-pressed=false] { background: var(--source-on); border-color: var(--source-edge); }
.source-toggle.mute[aria-pressed=true] { background: var(--source-off); border-color: var(--envelope-neutral); }
.source-toggle.mute[aria-pressed=true] > .snake-character { filter: grayscale(1); opacity: .45; }
.source-number { position: absolute; z-index: 1; right: -4px; bottom: -4px; display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--tool-border); border-radius: 5px; background: var(--panel); color: var(--tool-ink); font: 700 10px/1 var(--font-display); pointer-events: none; }
.source-toggle.mute[aria-pressed=true]::after { width: 64%; left: 18%; }
.osc-face { display: grid; grid-template-columns: 25px minmax(0,1fr) 36px; grid-template-rows: 74px; gap: 8px; align-items: stretch; margin-top: 7px; }
.voice-meter { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px; width: 100%; height: 100%; padding: 2px; border: 1px solid var(--meter-border); background: var(--meter-surface); border-radius: 6px; overflow: hidden; }
.voice-meter-channel { position: relative; min-width: 0; border-radius: 2px; overflow: hidden; background: color-mix(in srgb,var(--meter-fill) 12%,transparent); }
.voice-meter i { position: absolute; inset: 0; background: var(--meter-fill); border-radius: 2px; transform: scaleY(var(--level,0)); transform-origin: center bottom; transition: transform .08s linear; }
.wave-preview { display: grid; grid-template-rows: minmax(0,1fr); width: 100%; padding: 5px 0; border: 2px solid var(--wave-border); border-radius: 6px; overflow: hidden; height: 100%; box-shadow: 1px 1px 1px var(--control-shadow); background: color-mix(in srgb,var(--wave-surface) 82%,var(--wave-tint,var(--icon-a))); }
.wave-preview { container: wave-stage / inline-size; }
.wave-preview[data-wave-shape=sine] { --wave-tint: var(--icon-a); }
.wave-preview[data-wave-shape=triangle] { --wave-tint: var(--envelope-sustain); }
.wave-preview[data-wave-shape=square] { --wave-tint: var(--icon-b); }
.wave-preview[data-wave-shape=sawtooth] { --wave-tint: var(--icon-record); }
.wave-preview[data-wave-shape=custom] { --wave-tint: var(--icon-c); }
.wave-art { display: flex; justify-content: center; gap: 3px; padding-inline: 3px; width: 100%; height: 100%; min-height: 0; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.wave-actor { --wave-body: var(--wave-a); --wave-trim: var(--wave-b); display: block; flex: 1; width: 0; height: 100%; min-width: 0; }
.wave-actor:nth-child(2) { --wave-body: var(--wave-c); --wave-trim: var(--wave-a); }
.wave-actor:nth-child(3) { --wave-body: var(--wave-b); --wave-trim: var(--wave-c); display: none; }
/* Use the actual panel width; a phone's enlarged, rotated stage still gets two. */
@container wave-stage (min-width: 240px) {
  :root:not(.fitted-instrument) .wave-preview .wave-actor:nth-child(3) { display: block; }
}
.wave-dancer { transform-box: fill-box; transform-origin: 50% 95%; }
.wave-art { --wave-left-x: 29px; --wave-left-y: 77px; --wave-right-x: 115px; --wave-right-y: 77px; }
.wave-art[data-wave-shape=square] { --wave-left-x: 32px; --wave-left-y: 65px; --wave-right-x: 112px; --wave-right-y: 65px; }
.wave-art[data-wave-shape=sawtooth] { --wave-left-x: 39px; --wave-left-y: 78px; --wave-right-x: 125px; --wave-right-y: 61px; }
.wave-art[data-wave-shape=custom] { --wave-left-x: 27px; --wave-left-y: 73px; --wave-right-x: 116px; --wave-right-y: 77px; }
.wave-arm-anchor.left { transform: translate(var(--wave-left-x),var(--wave-left-y)); }
.wave-arm-anchor.right { transform: translate(var(--wave-right-x),var(--wave-right-y)); }
.wave-limb { transform-box: view-box; transform-origin: 0 0; }
.wave-crayon { display: none; }
[data-wave-shape=custom] .wave-crayon { display: inline; }
.wave-actor, .jellyfish-illustration, .snake-character, .effect-character { --wave-awake: 1; --wave-asleep: 0; }
.wave-actor.is-blinking, .jellyfish-illustration.is-blinking, .snake-character.is-blinking, .effect-character.is-blinking, [data-mode-character].is-blinking, [data-speed-character].is-blinking { --wave-awake: 0; --wave-asleep: 1; }
.wave-preview, [data-bass-art] { --wave-rest-mouth: 1; --wave-singing: 0; --wave-energy: 0; --wave-motion: 0; }
.wave-preview .wave-art { transition: opacity .2s ease; }
.wave-preview[data-voice-state=muted] .wave-art { opacity: .55; }
.wave-actor { --wave-phase: 0s; }
.wave-actor:nth-child(2) { --wave-phase: -.27s; }
.wave-actor:nth-child(3) { --wave-phase: -.53s; }
:is(.wave-preview,[data-bass-art]).is-moving .wave-dancer { animation: wave-dance .8s ease-in-out var(--wave-phase) infinite; }
:is(.wave-preview,[data-bass-art]).is-moving .wave-arm { animation: wave-wave .8s ease-in-out var(--wave-phase) infinite; }
:is(.wave-preview,[data-bass-art]).is-moving .wave-leg { animation: wave-step .8s ease-in-out var(--wave-phase) infinite; }
:is(.wave-preview,[data-bass-art]).is-moving .wave-limb.right { animation-direction: reverse; }
@keyframes wave-wave {
  0%,100% { transform: rotate(calc(var(--wave-energy)*-18deg)); }
  35% { transform: rotate(calc(var(--wave-energy)*30deg)); }
  75% { transform: rotate(calc(var(--wave-energy)*-28deg)); }
}
@keyframes wave-step {
  0%,100% { transform: rotate(calc(var(--wave-energy)*-12deg)); }
  35% { transform: rotate(calc(var(--wave-energy)*18deg)); }
  65% { transform: rotate(calc(var(--wave-energy)*-20deg)); }
}
@keyframes wave-dance {
  0%,100% { transform: translateY(calc(var(--wave-energy)*2px)) rotate(calc(var(--wave-energy)*-3deg)) scale(calc(1 + var(--wave-energy)*.06),calc(1 - var(--wave-energy)*.06)); }
  48% { transform: translateY(calc(var(--wave-energy)*-28px)) rotate(calc(var(--wave-energy)*3deg)) scale(calc(1 - var(--wave-energy)*.03),calc(1 + var(--wave-energy)*.04)); }
  80% { transform: translateY(0) rotate(0deg) scale(calc(1 + var(--wave-energy)*.04),calc(1 - var(--wave-energy)*.03)); }
}
.osc-tools { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.icon-action, .module-button { padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.icon-action .ui-icon, .module-button .ui-icon { width: 25px; height: 25px; object-fit: contain; }

.noise-card { position: relative; display: grid; grid-template-columns: 48px 26px minmax(0,1fr) 38px; align-items: center; gap: 6px; margin-top: 6px; }
.noise-card::before { content: ''; position: absolute; top: -10px; left: 0; right: 0; height: 1px; background: color-mix(in srgb,var(--border) 45%,transparent); }
.noise-card .source-toggle { justify-self: end; }
.noise-picker { position: relative; display: grid; place-items: center; }
[data-noise-color=pink] { --noise-color: #d97dab; }
[data-noise-color=white] { --noise-color: #fff; }
[data-noise-color=brown] { --noise-color: #937450; }
.noise-trigger, .noise-swatch { display: block; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--tool-border); padding: 0; background: var(--noise-color); }
.noise-options { position: absolute; z-index: 20; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 4px; padding: 5px; border: 1px solid var(--tool-border); border-radius: 24px; background: var(--panel); box-shadow: 0 3px 10px rgb(0 0 0 / 18%); }
.noise-option { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 2px solid transparent; border-radius: 50%; background: transparent; }
.noise-option[aria-selected=true] { border-color: var(--tool-ink); }
.noise-option:hover { background: var(--tool-active); }
.left-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.octave-panel, .patch-panel, .preset-panel { padding: 5px 8px; text-align: center; background: var(--panel-muted); }
.preset-panel { background: var(--panel-presets); }
.left-bottom h2, .preset-panel h2 { font-size: 16px; line-height: 20px; margin: 0 0 5px; }
.utility-heading { display:flex; align-items:center; justify-content:center; gap:4px; white-space:nowrap; }
.left-bottom .utility-heading { font-size:clamp(14px,1.8cqw,16px); }
.utility-heading .ui-icon { width:18px; height:18px; }
.octave-controls, .patch-actions { display: flex; justify-content: center; gap: 6px; }
.image-button { padding: 5px; background: var(--control-surface); border: 1px solid var(--tool-border); border-radius: 11px; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.image-button, .arp-rate-button, .drum-pages .button { box-shadow: 0 2px 0 color-mix(in srgb,var(--tool-border),transparent 40%); }
:is(.image-button,.arp-rate-button,.drum-pages .button):active:not(:disabled) { box-shadow: inset 0 1px 3px var(--tool-border); }
.image-button svg { display: block; width: 24px; height: 24px; object-fit: contain; }
.octave-position { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); height: 18px; max-width: 128px; margin: 0 auto; }
.octave-step { --octave-color: color-mix(in srgb, var(--octave-low), var(--octave-high) var(--octave-lightness)); display: grid; place-items: center; min-width: 0; width: 100%; height: 18px; padding: 0; border: 0; border-radius: 4px; background: transparent; }
.octave-step .octave-dot { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--octave-color); box-shadow: 0 0 0 1px color-mix(in srgb, var(--octave-ink) 45%, transparent); pointer-events: none; }
.octave-step:is(:hover,:focus-visible) .octave-dot { box-shadow: 0 0 0 1.5px var(--octave-ink); }
.octave-step:focus-visible { outline-offset: -1px; }
.octave-step.current .octave-dot { width: 8px; height: 8px; box-shadow: 0 0 0 1.5px var(--octave-ink), 0 0 0 3px var(--octave-high); }
.octave-controls button { background: color-mix(in srgb, var(--octave-button-low), var(--octave-high) var(--octave-lightness)); color: var(--octave-ink); border-color: var(--octave-ink); transition: background-color .12s; }
.octave-controls button:disabled { opacity: 1; border-style: dashed; }
.octave-controls button:disabled svg { opacity: .65; }
.patch-actions .image-button { color: var(--tool-ink); background: var(--tool-surface); }
.patch-actions .image-button:is(:hover,:active) { background: var(--tool-active); }
.patch-actions .ui-icon { width: 26px; height: 26px; }
.patch-name { display: block; width: 100%; min-width: 0; margin-top: 3px; padding: 0; border: 0; border-bottom: 1px dotted var(--control-shadow); font: 11px/15px var(--font-body); text-align: center; background: transparent; }
.center-panel { padding: 12px 15px; height: 100%; min-height: 0; position: relative; overflow: hidden; }
.workspace { height: 100%; overflow-y: auto; scrollbar-width: thin; }
.workspace-panel { min-width: 0; padding-bottom: 8px; }
.workspace-panel > h2 { margin-top: 22px; }
.module-tabs { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: repeat(var(--tab-count),minmax(0,1fr)); gap: 6px; padding: 5px; margin: 12px 0; border: 1px solid var(--tool-border); border-radius: 12px; background: var(--panel-secondary); }
.module-tab { flex-direction: column; gap: 5px; min-width: 0; padding: 7px 3px; font-size: 11px; border-color: transparent; background: transparent; }
.module-tab .ui-icon { width: 24px; height: 24px; object-fit: contain; }
.module-tab[aria-selected=true] { background: var(--tool-active); border-color: var(--tool-ink); box-shadow: inset 0 0 0 1px var(--tool-ink); }
.group-panel { min-width: 0; }
#panel-sound .xy-pad { height: 140px; }
#panel-sound .lfo-controls { margin-top: 16px; }
.scope-wrap { position: relative; margin: 2px auto 12px; width: 62%; overflow: hidden; isolation: isolate; border: 2px solid var(--control-border); border-radius: 28px; background: var(--scope-surface); box-shadow: inset 0 0 0 3px var(--control-surface); }
.scope { display: block; width: 100%; height: clamp(75px, 9cqw, 135px); }
/* Reserve the controls and their focus/shadow space first. The drawings absorb
   changes in available height, including the intermediate-width breakpoint. */
#panel-envelope { --envelope-picture-height: 110px; height: 100%; display: grid; grid-template-rows: minmax(54px,1fr) minmax(64px,var(--envelope-picture-height)) auto 40px; gap: 8px; padding-top: 6px; }
#panel-envelope .scope-wrap { height: 100%; min-height: 0; margin: 0 auto; }
#panel-envelope .scope { height: 100%; }
.jellyfish-envelope { display: flex; justify-content: center; align-items: center; height: 100%; min-height: 0; }
.envelope-chart { display: block; width: 100%; max-width: 420px; height: 100%; overflow: visible; color: var(--tool-ink); }
.jellyfish-arms { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.jellyfish-tentacle-outline { stroke: currentColor; stroke-width: 10; }
.envelope-phase { stroke-width: 5.5; stroke-linecap: butt; }
.jellyfish-illustration { fill: none; stroke: currentColor; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
/* Keep the 3px focus ring and its 3px offset inside the scrolling workspace. */
.envelope-dials { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; padding-inline: 7px; }
.dial-control { min-width: 0; display: flex; align-items: center; flex-direction: column; color: var(--control-color); }
.dial { display: block; position: relative; width: 100%; max-width: 92px; aspect-ratio: 1; background: var(--control-color); border: 2px solid var(--control-border); border-radius: 50%; box-shadow: 0 1px 2px var(--control-shadow); }
.dial i { position: absolute; width: 6px; left: calc(50% - 3px); top: 50%; height: 47%; transform-origin: 50% 0; transform: rotate(var(--rotation,0deg)); background: color-mix(in srgb, var(--control-color), black 40%); border-radius: 3px; pointer-events: none; }
.dial:after { content: ''; position: absolute; left: calc(50% - 7px); top: calc(50% - 7px); width: 14px; height: 14px; border-radius: 50%; background: color-mix(in srgb, var(--control-color), black 40%); pointer-events: none; }
.dial-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ns-resize; touch-action: none; }
.dial:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.dial-control strong { font-weight: 600; font-size: 32px; line-height: 1.4; color: color-mix(in srgb,var(--control-color),var(--dial-label-mix) 45%); }
.envelope-dials .dial i, .envelope-dials .dial:after { background: var(--art-ink); }
.pan-control { --control-color: var(--fader-pan); gap: 3px; }
.pan-control .dial { width: 34px; }
.pan-control .dial i { width: 3px; left: calc(50% - 1.5px); height: 43%; background: color-mix(in srgb,var(--control-color),black 60%); }
.pan-control .dial:after { width: 6px; height: 6px; left: calc(50% - 3px); top: calc(50% - 3px); background: color-mix(in srgb,var(--control-color),black 60%); }
.settings-group { min-width: 0; margin: 14px 0 4px; padding: 10px; border: 1px solid var(--button-border); border-radius: var(--button-radius); }
.settings-group legend { font-size: 13px; font-weight: 700; color: var(--heading-ink); padding: 0 5px; }
.key-shape-choices { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 5px; }
.key-appearance-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.key-appearance-columns > div { min-width:0; }
.key-setting-label { display:block; margin-bottom:6px; font-size:12px; }
.keys-settings .key-shape-choices { grid-template-columns:repeat(3,minmax(0,1fr)); }
.keys-settings .note-palette-choices { grid-template-columns:minmax(0,1fr); gap:5px; }
.keys-settings .note-palette-choice { height:38px; min-height:38px; padding:3px 6px; gap:2px; font-size:11px; }
.keys-settings .palette-swatches > span { height:12px; border-radius:4px; }
.shape-choice, .shape-upload { min-width: 0; height: 38px; padding: 5px; }
.shape-upload svg { width: 22px; height: 22px; }
.shape-choice > .shape-sample { display: block; width: 24px; height: 24px; color: var(--tool-ink); }
.note-names-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.note-setting { display: grid; min-width: 0; gap: 6px; font-size: 12px; }
.note-setting-label { align-self: end; }
.note-visibility-choices, .note-system-choices { display: grid; gap: 4px; }
.note-visibility-choices { grid-template-columns: repeat(4,minmax(0,1fr)); }
.note-system-choices { grid-template-columns: repeat(2,minmax(0,1fr)); }
.note-choice { min-width: 0; height: 42px; padding: 3px; color: var(--tool-ink); }
.note-choice[aria-pressed=true] { background: var(--tool-active); border-color: var(--tool-ink); box-shadow: inset 0 0 0 1px var(--tool-ink); }
.note-choice svg { width: 28px; max-width: 100%; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.note-choice svg text { font: 700 9px var(--font-body); }
.note-name-sample { display: flex; justify-content: center; gap: 2px; width: 100%; }
.note-name-sample span { display: grid; place-items: center; flex: 1; min-width: 0; height: 23px; border-radius: 5px; background: var(--sample-color); color: var(--ink); font: 700 10px var(--font-body); }
.note-palette-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.note-palette-choice { display: grid; grid-template-columns: minmax(0,1fr); gap: 6px; padding: 7px 6px; width: 100%; min-width: 0; min-height: 40px; text-align: center; font-size: 11px; }
.note-palette-choice[aria-pressed=true] { background: var(--tool-active); border-color: var(--tool-ink); box-shadow: inset 0 0 0 1px var(--tool-ink); }
.palette-swatches { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 3px; }
.palette-swatches > span { height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 12%); }
:root { --shape-triangle: polygon(50% 2%,98% 98%,2% 98%); --shape-pentagon: polygon(50% 2%,98% 38%,80% 98%,20% 98%,2% 38%); --shape-diamond: polygon(50% 2%,98% 50%,50% 98%,2% 50%); }
:root[data-key-shape=circle] { --key-radius: 50%; }
:root[data-key-shape=triangle] { --key-clip: var(--shape-triangle); }
:root[data-key-shape=pentagon] { --key-clip: var(--shape-pentagon); }
:root[data-key-shape=diamond] { --key-clip: var(--shape-diamond); }
.random-reset { display: flex; justify-content: center; gap: 12px; margin-top: 13px; }
.random-reset .ui-icon { width: 21px; height: 21px; }

#panel-envelope .random-reset { margin: 0; align-items: center; }

.preset-buttons { display: grid; grid-template-columns: repeat(16,minmax(0,1fr)); row-gap: 6px; max-width: 365px; margin: 0 auto; justify-items: center; }
.preset-button { --round-size: 36px; grid-column: span 2; width: calc(100% - 3px); max-width: 36px; height: auto; aspect-ratio: 1; }
.preset-button:nth-child(9) { grid-column: 2 / span 2; }
.preset-button > .ui-icon { width: 74%; height: 74%; }
.preset-button[aria-pressed=true] {
  background: color-mix(in srgb,var(--tool-active),var(--tool-ink) 18%);
  border-color: var(--tool-ink);
  box-shadow: inset 0 3px 5px color-mix(in srgb,var(--tool-ink),transparent 40%), inset 0 0 0 2px var(--tool-active);
}
.output-panel { display: flex; flex-direction: column; justify-content: space-around; padding: 9px 9px 6px; background: var(--panel-secondary); }
.range-row { display: grid; grid-template-columns: 75px minmax(0,1fr) auto; align-items: center; gap: 7px; margin: 10px 0; position: relative; min-width: 0; }
.range-row label { font-size: 14px; font-weight: 600; white-space: nowrap; }
.range-row > .ui-icon { width: 23px; height: 23px; object-fit: contain; grid-column: 3; grid-row: 1; }
.range-row output { font: 9px var(--font-body); color: var(--text-value); position: absolute; right: 28px; top: calc(100% + 1px); pointer-events: none; }
.range-row input[type=range] { width: 100%; min-width: 0; height: 28px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; --control-color: var(--fader-accent); --track-fill: var(--fader-track); --track-size: 11px; }
.range-row input[type=range]::-webkit-slider-runnable-track { height: var(--track-size); background: linear-gradient(to right,var(--control-color) var(--fill,0%),var(--track-fill) var(--fill,0%)); border-radius: 20px; box-shadow: inset 0 1px 1px rgb(0 0 0 / 10%); }
.range-row input[type=range]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; box-sizing: border-box; width: var(--range-thumb-size); height: var(--range-thumb-size); border-radius: 50%; background: var(--control-color); margin-top: calc((var(--track-size) - var(--range-thumb-size)) / 2); border: 3px solid var(--fader-rim); box-shadow: 0 0 0 1px color-mix(in srgb,var(--control-color),black 15%),0 2px 2px rgb(0 0 0 / 18%); }
.range-row input[type=range]::-moz-range-track { height: var(--track-size); background: linear-gradient(to right,var(--control-color) var(--fill,0%),var(--track-fill) var(--fill,0%)); border-radius: 20px; box-shadow: inset 0 1px 1px rgb(0 0 0 / 10%); }
.range-row input[type=range]::-moz-range-thumb { box-sizing: border-box; width: var(--range-thumb-size); height: var(--range-thumb-size); border-radius: 50%; background: var(--control-color); border: 3px solid var(--fader-rim); box-shadow: 0 0 0 1px color-mix(in srgb,var(--control-color),black 15%),0 2px 2px rgb(0 0 0 / 18%); }
.range-row .range-dragging::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb,var(--control-color) 25%,transparent); }
.range-row .range-dragging::-moz-range-thumb { box-shadow: 0 0 0 4px color-mix(in srgb,var(--control-color) 25%,transparent); }
.output-line { display: flex; align-items: center; gap: 7px; }
.output-line > .range-row { flex: 1; }
.master-volume .pan-control { flex: 0 0 38px; }
.output-panel .range-row { grid-template-columns: 43px minmax(0,1fr) auto; margin: 0; }
.output-panel .range-row output { display: none; }
.transpose-control { display: grid; grid-template-columns: auto minmax(64px,180px); align-items: center; justify-content: start; gap: 7px; }
.transpose-control > label { font-size: 13px; font-weight: 600; }
.output-panel .transpose-range { --transpose-thumb-size: 34px; display: block; margin: 0; }
.transpose-range input[type=range] { display: block; position: relative; z-index: 1; height: 32px; --range-thumb-size: var(--transpose-thumb-size); --control-color: var(--transpose-color); }
.transpose-range input[type=range]::-webkit-slider-runnable-track { background: transparent; box-shadow: none; }
.transpose-range input[type=range]::-moz-range-track { background: transparent; box-shadow: none; }
/* The output is the visible thumb, so the note stays inside it while dragging.
   Keep the native thumb's width for pointer, keyboard and assistive input. */
.transpose-range input[type=range]::-webkit-slider-thumb { opacity: 0; }
.transpose-range input[type=range]::-moz-range-thumb { opacity: 0; }
.output-panel .transpose-range output { display: grid; place-items: center; position: absolute; z-index: 2; top: 50%; left: calc((100% - var(--transpose-thumb-size)) * var(--transpose-position,0)); right: auto; transform: translateY(-50%); width: var(--transpose-thumb-size); height: 28px; padding: 0 2px; border: 2px solid var(--fader-rim); border-radius: 9px; background: var(--transpose-color); color: var(--transpose-ink,var(--ink)); box-shadow: 0 0 0 1px color-mix(in srgb,var(--transpose-color),black 15%),0 2px 2px rgb(0 0 0 / 18%); font: 700 10px var(--font-body); white-space: nowrap; }
.transpose-range:has(.range-dragging) output { box-shadow: 0 0 0 4px color-mix(in srgb,var(--transpose-color) 25%,transparent); }
.transpose-stops { position: absolute; inset: 10.5px 0 auto; height: 11px; display: flex; gap: 2px; pointer-events: none; }
.transpose-stops span { flex: 1; border-radius: 3px; box-shadow: inset 0 1px 1px rgb(0 0 0 / 12%); }
.tempo-controls { display: flex; align-items: center; gap: 8px; border-top: 1px solid color-mix(in srgb,var(--border) 45%,transparent); padding-top: 7px; }
.output-panel .tempo-controls .range-row { flex: 1; grid-template-columns: 1fr auto; gap: 3px 8px; }
.tempo-controls .range-row label { font: 12px var(--font-body); }
.tempo-controls input { grid-column: 1 / -1; grid-row: 2; }
.tempo-controls input[type=range] { --control-color: var(--fader-tempo); }
.tempo-controls .feel-toggle { flex:0 0 35px; width:35px; height:43px; padding:2px; display:flex; flex-direction:column; align-items:center; justify-content:center; border-radius:11px; background:var(--tool-surface); }
.feel-art { width:26px; height:27px; overflow:visible; }
.feel-toggle span { font:700 8px var(--font-display); line-height:1; }
.feel-rocker { transform-origin:15px 24px; }
.feel-toggle[aria-pressed=true] { background:color-mix(in srgb,var(--fader-tempo) 18%,var(--tool-surface)); border-color:var(--fader-tempo); }
.feel-toggle[aria-pressed=true] .feel-rocker { transform:rotate(-12deg); }
.feel-toggle[aria-pressed=true][data-playing=true] .feel-rocker { animation:rhythm-swing var(--feel-beat, .67s) ease-in-out infinite; }
@keyframes rhythm-swing { 0%,100% { transform:rotate(-12deg); } 66.667% { transform:rotate(12deg); } }
@media (prefers-reduced-motion:reduce) { .feel-toggle .feel-rocker { animation:none!important; } }
.output-panel .tempo-controls output { display: block; position: static; grid-row: 1; grid-column: 2; padding: 2px 6px; border: 1px solid color-mix(in srgb,var(--fader-tempo) 55%,var(--tool-border)); border-radius: 6px; background: color-mix(in srgb,var(--fader-tempo) 12%,var(--control-surface)); font: 700 13px var(--font-body); font-variant-numeric: tabular-nums; }
.output-panel { --control-color: var(--output-control); }
.range-row input[data-path$=".volume"] { --control-color: var(--fader-output); }
.mini-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; padding: 0; }

.effect-panel { display: flex; flex-direction: column; justify-content: space-around; padding: 5px 10px 9px; }
.effect-panel h2 { margin: 0; font-size: 16px; }
.effect-panel .range-row output { display: none; }
.effect-panel .range-row { grid-template-columns: 92px minmax(0,1fr) auto; }
.effect-panel .range-row { margin: 0; }
.effect-panel input[type=range], .mixer-effects input[type=range] { --control-color: var(--fader-effects); }
.effect-panel .range-row > .ui-icon { width: 30px; height: 30px; grid-column: 3; grid-row: 1; color: var(--tool-ink); }
.effect-character, .effect-thumbnail { overflow: visible; }
.transport-panel { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); align-items: center; gap: 5px; padding: 6px 7px; background: var(--panel-instruments); }
.transport-panel .module-button { width: 100%; min-width: 0; height: 46px; flex-direction: column; padding: 3px 1px; gap: 2px; font-size: 11px; font-weight: 650; line-height: 1.1; white-space: nowrap; }
.transport-panel .module-button .ui-icon { width: 23px; height: 23px; }
.transport-launcher { position:relative; min-width:0; padding-top:7px; }
.transport-launcher:has(.part-play-badge) .module-button > .ui-icon { margin-right:7px; }
.transport-launcher .part-play-badge { position:absolute; z-index:1; top:0; right:-2px; width:23px; height:23px; min-height:23px; border-radius:50%; padding:0; background:var(--tool-surface); }
.transport-launcher .part-play-badge .ui-icon { width:13px; height:13px; }
.transport-launcher .part-play-badge[aria-pressed=true] { background:var(--icon-b); border-color:var(--tool-ink); }
.sequence-switch svg { width: 21px; height: 21px; }
.sequence-play { display: flex; }
.sequence-pause, .sequence-switch[aria-pressed=true] .sequence-play { display: none; }
.sequence-switch[aria-pressed=true] .sequence-pause { display: flex; }
.module-menu { display: grid; align-content: center; gap: 7px; padding: 3px 6px; background: var(--panel-muted); }
.module-menu-heading { display:flex; align-items:center; justify-content:center; gap:5px; margin:0; font-size:14px; }
.module-menu-heading .ui-icon { width:19px; height:19px; }
.module-menu-buttons { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); justify-items:center; gap:4px; }
.module-menu .module-button .ui-icon { width: 28px; height: 28px; }

.volume-mini { display: block; margin: 0; }
.volume-mini label, .volume-mini output { display: none; }
.performance-panel { display: grid; grid-template-columns: 102px minmax(0,1fr); gap: 5px; margin-top: 12px; }
.keyboard-sidebar { display: grid; grid-template-columns: repeat(2,40px); align-content: space-between; justify-content: center; gap: 5px; background: var(--panel-performance); border: 2px solid var(--border); border-radius: var(--panel-radius); padding: 6px; }
.sidebar-button { padding: 0; display: flex; align-items: center; justify-content: center; }

.sidebar-button .ui-icon { width: 24px; height: 24px; object-fit: contain; }
.keyboard-sidebar > [data-toggle] .ui-icon { width: 28px; height: 28px; }
.ribbon-choice { grid-column: 1 / -1; position: relative; display: grid; place-items: center; min-height: 38px; }
.keyboard-sidebar .sidebar-button { width: 40px; height: 38px; }
.keyboard-sidebar .surface-trigger { position: relative; width: 100%; height: 34px; }
.surface-trigger .surface-art { display: grid; place-items: center; }
.surface-art > .ui-icon { grid-area: 1 / 1; width: 36px; height: 32px; visibility: hidden; }
.surface-art > .ui-icon[data-selected=true] { visibility: visible; }
.surface-options { position: absolute; left: calc(100% + 12px); bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3,76px); gap: 6px; padding: 8px; border: 2px solid var(--tool-border); border-radius: 16px; background: var(--panel); box-shadow: 0 5px 16px rgb(0 0 0 / 22%); }
.surface-option { display: grid; justify-items: center; gap: 7px; padding: 10px 4px; border: 2px solid transparent; border-radius: 10px; background: var(--tool-surface); color: var(--tool-ink); font-size: 12px; font-weight: 700; }
.surface-option > .ui-icon { width: 36px; height: 36px; }
.surface-option:is(:hover,:focus-visible) { background: var(--tool-active); }
.surface-option[aria-selected=true] { border-color: var(--tool-ink); background: var(--tool-active); box-shadow: inset 0 -3px 0 color-mix(in srgb,var(--tool-ink),transparent 70%); }
.playing-surface { min-width: 0; display: flex; align-items: center; background: var(--panel-performance); border: 2px solid var(--border); border-radius: var(--panel-radius); padding: 6px; }
/* Keep notes within reach on wide screens, including scales with fewer notes. */
.keyboard { width: 100%; max-width: min(864px,calc(var(--keyboard-columns,16) * 54px)); display: grid; grid-template-columns: repeat(var(--keyboard-columns,16),minmax(0,1fr)); column-gap: 2px; row-gap: 5px; margin-inline: auto; align-items: end; }
.keyboard .key { grid-column: var(--key-column) / span 2; grid-row: 1; }
:root[data-keyboard-layout=chromatic] .keyboard { column-gap: 1px; row-gap: 2px; }
:root[data-keyboard-layout=chromatic] .natural-key { grid-row: 2; }
/* Let sharps tuck between their neighbours while retaining their full touch size. */
.keyboard .accidental-key { grid-row: 1; width: 58%; justify-self: center; margin-bottom: -14%; z-index: 1; }
.accidental-key .key-label { font-size: clamp(14px,1.35cqw,19px); }
.key { --key-surface: var(--key-color); --key-edge: color-mix(in srgb,var(--key-color) 75%,var(--key-outline)); position: relative; overflow: hidden; width: 100%; aspect-ratio: 1; border: 3px solid var(--key-edge); border-radius: var(--key-radius); background: var(--key-surface); padding: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.keyboard { touch-action: none; }
.key.active,.key.sounding { --key-surface: color-mix(in srgb,var(--key-color),black 22%); }
/* Only the decoration is clipped. All shapes keep the full note's touch area. */
:root:is([data-key-shape=triangle],[data-key-shape=pentagon],[data-key-shape=diamond]) .key { border: 0; border-radius: 0; background: transparent; }
:root:is([data-key-shape=triangle],[data-key-shape=pentagon],[data-key-shape=diamond]) .key::before { content: ''; position: absolute; inset: 0; clip-path: var(--key-clip); pointer-events: none; background: var(--key-edge); }
:root:is([data-key-shape=triangle],[data-key-shape=pentagon],[data-key-shape=diamond]) .key .key-surface { inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); clip-path: var(--key-clip); }
.bend-marker { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
:root:is([data-key-shape=triangle],[data-key-shape=pentagon],[data-key-shape=diamond]) .bend-marker { z-index: 1; clip-path: var(--key-clip); }
.bend-touch { fill: rgb(0 0 0 / 28%); stroke: rgb(255 255 255 / 45%); stroke-width: 1.5; }
.key:disabled { opacity: .25; }
.key-label { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: 2; pointer-events: none; opacity: 0; font-size: clamp(22px,2.2cqw,30px); font-weight: 700; line-height: 1; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / 75%),0 0 1px var(--ink); }
:root[data-note-names=hover] .key.hovered .key-label,
:root[data-note-names=on-touch] .key.pressed .key-label,
:root[data-note-names=on-touch] .key.sounding .key-label,
:root[data-note-names=always] .key-label { opacity: 1; }
.ribbon { position: relative; width: 100%; min-height: 112px; background: linear-gradient(90deg,var(--ribbon-colors)); border-radius: 8px; touch-action: none; }
.ribbon-marker { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.ribbon-dot { position: absolute; left: var(--touch-x); top: var(--touch-y); width: 24px; height: 24px; border: 3px solid white; border-radius: 50%; background: color-mix(in srgb,var(--ribbon-note-color),black 65%); box-shadow: 0 2px 5px rgb(0 0 0 / 35%); transform: translate(-50%,-50%); }
.ribbon-marker.held .ribbon-dot { box-shadow: 0 0 0 3px rgb(255 255 255 / 30%),0 2px 5px rgb(0 0 0 / 35%); }
.ribbon-note { position: absolute; left: clamp(30px,var(--touch-x),calc(100% - 30px)); top: calc(var(--touch-y) - 21px); transform: translate(-50%,-100%); padding: 5px 9px; border: 1px solid rgb(255 255 255 / 85%); border-radius: 9px; background: color-mix(in srgb,var(--ribbon-note-color),black 72%); color: white; font-size: 20px; font-weight: 700; line-height: 1; white-space: nowrap; box-shadow: 0 2px 5px rgb(0 0 0 / 20%); }
.select-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; font-size: 14px; }
select { max-width: 100%; font: 12px var(--font-body); background: var(--control-surface); border: 1px solid var(--select-border); border-radius: 4px; padding: 5px; }
/* The oscillator editors keep the whole sound strip together above the character. */
.workspace-panel[data-module^=osc] { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr); gap: 6px; padding-bottom: 0; }
/* Leave room for the outer focus rings at the scroll viewport's top and sides. */
.osc-editor-heading { display: grid; grid-template-columns: 42px max-content minmax(36px,1fr) 34px; align-items: center; gap: 7px; padding: 7px 7px 0; }
.osc-editor-heading h2 { margin: 0; font-size: 16px; white-space: nowrap; }
.osc-editor-heading .source-toggle { width: 42px; height: 34px; }
.osc-editor-heading .volume-mini { margin: 0; }
/* Keep the footer's shadow and keyboard focus ring inside the scroll viewport. */
.osc-editor { display: grid; grid-template-rows: minmax(74px,1fr) 112px 74px 40px; gap: 6px; padding: 0 3px 8px; min-height: 0; }
.editor-wave { width: 76.5%; height: 100%; min-width: 0; justify-self: center; border-radius: 18px; }
.osc-editor-tone { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: stretch; gap: 7px; }
.osc-editor-tone .settings-group { margin: 0; padding: 5px; height: 100%; }
.osc-editor-tone legend { padding: 0 3px; font-size: 12px; }
.mode-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; height: 100%; align-content: center; }
.mode-choice { min-width: 0; height: 34px; padding: 2px; }
.mode-choice .ui-icon { width: 27px; height: 27px; }
.mode-choice[aria-pressed=true] { border-color: var(--tool-ink); background: var(--tool-active); box-shadow: inset 0 0 0 1px var(--tool-ink); }
.oscillator-box-content { display: grid; grid-template-rows: 56px 24px; justify-items: center; align-content: center; gap: 5px; height: 100%; }
.oscillator-dial { width: 100%; }
.detune-choices { display: flex; gap: 4px; }
.detune-choice { display: grid; place-items: center; width: 30px; height: 24px; min-height: 24px; padding: 1px; border-radius: 7px; }
.detune-choice .ui-icon { width: 21px; height: 21px; }
.detune-choice[aria-pressed=true] { background: var(--tool-active); border-color: var(--tool-ink); box-shadow: inset 0 0 0 1px var(--tool-ink); }
.detune-dial { --control-color: var(--envelope-sustain); }
.partialCount-dial { --control-color: var(--envelope-release); }
.oscillator-dial .dial { max-width: 56px; border-width: 3px; }
.oscillator-dial .dial i { width: 4px; left: calc(50% - 2px); background: var(--art-ink); }
.oscillator-dial .dial::after { width: 10px; height: 10px; left: calc(50% - 5px); top: calc(50% - 5px); background: var(--art-ink); }
.harmonic-count { display: block; width: min(72px,100%); height: 24px; }
.harmonic-count rect { fill: var(--inset); stroke: var(--harmonics); stroke-width: .5; }
.harmonic-count rect.active { fill: var(--envelope-release); }
.harmonic-paint.settings-group { margin: 0; padding: 5px 8px; min-height: 0; }
.osc-editor legend { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.osc-editor legend .ui-icon { width: 18px; height: 18px; flex-shrink: 0; }
.osc-editor-tone legend { gap: 3px; }
.osc-editor-tone legend .ui-icon { width: 16px; height: 16px; }
.harmonics { display: flex; height: 100%; min-height: 0; gap: 4px; touch-action: none; user-select: none; -webkit-user-select: none; }
.harmonic-column { position: relative; flex: 1; min-width: 0; overflow: hidden; border-radius: 6px; border: 1px solid color-mix(in srgb,var(--harmonics),transparent 50%); background: var(--inset); }
.harmonic-fill { position: absolute; inset: auto 0 0; height: var(--harmonic-height,0%); min-height: 3px; border-radius: 5px 5px 0 0; background: var(--harmonics); pointer-events: none; }
.harmonic-column:nth-child(3n+2) .harmonic-fill { background: var(--envelope-sustain); }
.harmonic-column:nth-child(3n) .harmonic-fill { background: var(--envelope-attack); }
.harmonic-column:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.harmonics input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; writing-mode: vertical-lr; direction: rtl; cursor: crosshair; }
.osc-editor .random-reset { margin: 0; gap: 12px; }
.osc-editor .osc-editor-tools { justify-content: center; gap: 8px; }
.osc-editor-tools .compare-sound .ui-icon { width: 30px; height: 30px; }
.compare-sound { --compare-before: .45; --compare-after: 1; touch-action: none; }
.compare-sound[aria-pressed=true] { --compare-before: 1; --compare-after: .45; background: var(--tool-active); box-shadow: inset 0 0 0 1px var(--tool-ink); }
.editor-wave.is-comparing { border-color: var(--icon-b); box-shadow: inset 0 0 0 2px var(--icon-b); }
.xy-pad { position: relative; height: 180px; background: var(--panel-muted); border: 2px solid var(--pad-border); border-radius: var(--pad-radius); touch-action: none; overflow: hidden; }
.xy-dot { position: absolute; height: 20px; width: 20px; margin: -10px; background: var(--icon-b); border: 2px solid var(--tool-ink); border-radius: 50%; pointer-events: none; }
.xy-caption { position: absolute; bottom: 5px; width: 100%; text-align: center; font: 10px var(--font-body); pointer-events: none; color: var(--control-surface); }
.drum-grid { display: grid; grid-template-columns: 34px repeat(8,minmax(0,1fr)) 24px 24px; grid-template-rows: repeat(6,28px); gap: 3px; align-items: center; margin-top: 6px; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--panel-radius); background: color-mix(in srgb,var(--panel) 88%,var(--ink)); isolation: isolate; }
.drum-row { display: contents; }
.drum-row > * { grid-row: var(--drum-row); z-index: 1; }
.drum-beat-band { grid-row: 1 / span 6; align-self: stretch; border-radius: 5px; background: var(--drum-beat-light); pointer-events: none; }
.drum-beat-band:is([data-beat="1"],[data-beat="3"]) { background: var(--drum-beat-shade); }
.drum-row-random { grid-column: 10; }
.drum-row-clear { grid-column: 11; }
.drum-heading { display: grid; justify-items: center; gap: 6px; margin: 20px 0 6px; }
.drum-heading h2 { margin: 0; white-space: nowrap; }
.drum-heading h2 .ui-icon { width: 28px; height: 28px; }
.drum-heading .drum-pages { justify-self: end; }
.drum-pages { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.drum-pages .button { width: 26px; min-height: 30px; padding: 0; font: 700 22px var(--font-body); }
.drum-pages .ui-icon { width: 18px; height: 18px; }
.drum-pages output { min-width: 27px; text-align: center; font: 700 10px var(--font-body); border-radius: 5px; padding-block: 4px; }
.drum-pages .playing { background: var(--drum-hit); box-shadow: inset 0 0 0 1px var(--drum-playhead); }
.drum-choices { position: relative; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 6px 0 8px; color: var(--tool-ink); }
.drum-picker { min-width: 0; }
.drum-choice-trigger { display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 100%; min-height: 62px; padding: 6px 9px; border: 1px solid var(--tool-border); border-radius: 13px; background: var(--tool-surface); color: inherit; box-shadow: 0 2px 0 color-mix(in srgb,var(--tool-border),transparent 55%); text-align: left; }
.drum-choice-label { font: 700 10px var(--font-body); color: var(--text-secondary); }
.drum-choice-value { display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; font: 700 12px var(--font-display); }
.drum-choice-art { display: grid; place-items: center; flex: 0 0 auto; }
.drum-choice-art > .ui-icon { width: 30px; height: 30px; }
.drum-choice-value > .ui-icon { width: 12px; height: 12px; margin-left: auto; }
.drum-choice-trigger[aria-expanded=true] { background: var(--tool-active); border-color: var(--tool-ink); box-shadow: inset 0 0 0 1px var(--tool-ink); }
.drum-choice-trigger[aria-expanded=true] .drum-choice-value > .ui-icon { transform: rotate(180deg); }
.drum-choice-options { max-height: calc(var(--workspace-height) - 200px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; position: absolute; z-index: 6; inset: calc(100% + 5px) 0 auto; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; padding: 8px; border: 1px solid var(--tool-border); border-radius: 16px; background: var(--panel); box-shadow: 0 6px 18px rgb(0 0 0 / 20%); }
.drum-choice-option { display: flex; align-items: center; justify-content: flex-start; gap: 7px; min-width: 0; min-height: 48px; padding: 5px 7px; border: 2px solid transparent; border-radius: 10px; background: var(--tool-surface); color: inherit; font: 700 11px var(--font-display); }
.drum-choice-option > .ui-icon { width: 32px; height: 32px; }
.drum-choice-option[aria-selected=true] { background: var(--tool-active); border-color: var(--tool-ink); }
.drum-choice-option:focus-visible { outline-offset: -3px; }
@media (hover: hover) {
  .drum-choice-trigger:hover, .drum-choice-option:hover { background: var(--tool-active); }
}
.rhythm-preview { display: block; flex: 0 0 auto; width: 48px; height: 20px; pointer-events: none; }
.drum-choice-value .rhythm-preview { width: 42px; }
.drum-choices + .drum-grid { margin-top: 8px; }
#panel-drums .panel-tools { margin-top: 3px; }
#panel-drums .panel-tools .icon-action { width: 32px; height: 32px; border-radius: 9px; }
#panel-drums .panel-tools .ui-icon { width: 21px; height: 21px; }
#panel-drums .sequence-switch[aria-pressed=true] { background: var(--drum-hit); border-color: var(--drum-playhead); box-shadow: inset 0 0 0 1px var(--drum-playhead); }
#panel-drums .drum-length .ui-icon { width: 30px; height: 26px; }
#panel-drums .panel-tools .drum-length { width: 46px; }
.drum-name { grid-column: 1; display: grid; place-items: center; width: 32px; height: 28px; position: relative; border: 1px solid var(--tool-border); padding: 1px 2px 4px; border-radius: 8px; color: var(--tool-ink); }
.drum-name[aria-pressed=false] { background: var(--icon-paper); border-color: var(--tool-border); box-shadow: 0 1px 0 var(--tool-border); }
.drum-name[aria-pressed=true] { background: var(--control-surface); }
.drum-name[aria-pressed=true] .ui-icon { filter: grayscale(1); opacity: .45; }
.drum-name.mute[aria-pressed=true]::after { content: none; }
.drum-name[aria-pressed=false]:is(.key-held,.is-playing), .drum-name:active { background: var(--drum-hit); border-color: var(--drum-playhead); box-shadow: inset 0 0 0 1px var(--drum-playhead); }
.drum-shortcut { white-space: nowrap; position: absolute; right: -2px; bottom: -1px; min-width: 12px; padding: 1px; border: 1px solid var(--tool-border); border-radius: 4px; background: var(--panel); color: var(--tool-ink); font: 700 10px/1 var(--font-body); pointer-events: none; }
.drum-name[aria-pressed=false]:is(.key-held,.is-playing) .drum-shortcut { background: var(--drum-hit); border-color: var(--drum-playhead); }
.drum-name .ui-icon { width: 22px; height: 22px; }
.step-button { min-width: 0; width: min(100%,28px); height: auto; aspect-ratio: 1; justify-self: center; padding: 0; border: 2px solid var(--step-border); background: var(--control-surface); --step-surface: var(--control-surface); position: relative; border-radius: 50%; touch-action: none; }
.step-button[aria-pressed=true] { --step-surface: var(--drum-step-on); background: var(--drum-step-on); border-color: var(--drum-step-edge); }
.step-button.playhead { outline: 2px solid var(--drum-playhead); outline-offset: 0; }
.step-button[aria-pressed=true].playhead { --step-surface: var(--drum-hit); background: var(--drum-hit); border-color: var(--drum-playhead); }
.drum-grid .icon-action .ui-icon { width: 18px; height: 18px; }
.drum-grid .icon-action { width: 24px; height: 26px; border: 1px solid var(--tool-border); border-radius: 7px; background: var(--tool-surface); box-shadow: 0 1px 0 color-mix(in srgb,var(--tool-border),transparent 40%); }
.module-heading { display: flex; align-items: center; justify-content: center; gap: 8px; }
.module-heading > .ui-icon { color: var(--tool-ink); }
.arp-heading { margin: 24px 4px 0; }
.arp-heading h2 { margin: 0; }
.arp-stage { position: relative; margin: 18px 0 16px; }
.arp-rate { position: absolute; top: calc(50% + 32px); left: 50%; transform: translateX(-50%); text-align: center; font: 700 12px var(--font-body); color: var(--text-secondary); }
.arp-rate-button { position: absolute; z-index: 1; top: 0; width: 56px; height: 44px; padding: 4px; gap: 2px; background:color-mix(in srgb,var(--fader-tempo) 12%,var(--tool-surface)); border-color:color-mix(in srgb,var(--fader-tempo) 55%,var(--tool-border)); }
.arp-rate-button[data-action=arp-slower] { left: 2px; }
.arp-rate-button[data-action=arp-faster] { right: 2px; }
.arp-rate-button > .ui-icon { width: 14px; height: 14px; }
.arp-rate-button > [data-speed-character] { width: 28px; height: 28px; }
.arp-rate-button:disabled { opacity: 1; background: color-mix(in srgb,var(--fader-tempo) 25%,var(--tool-surface)); border-color: var(--fader-tempo); box-shadow: inset 0 1px 3px var(--tool-border); filter: none; }
.arp-grid { position: relative; width: min(76%,242px); aspect-ratio: 1; margin: 0 auto; }
.arp-sing { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); display: grid; place-items: center; width: 62px; height: 62px; padding: 11px; border-radius: 50%; border: 1px solid var(--tool-border); background: var(--tool-surface); box-shadow: 0 2px 0 var(--tool-border); }
.arp-sing > .ui-icon { width: 37px; height: 37px; }
.sing-progress { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke: var(--icon-a); stroke-width: 3; pointer-events: none; }
.sing-progress circle { stroke-dasharray: 182.2; stroke-dashoffset: calc(182.2 * (1 - var(--sing-progress,0))); }
.arp-sing[aria-pressed=true] { background: color-mix(in srgb,var(--icon-a) 22%,var(--tool-surface)); box-shadow: inset 0 1px 3px var(--tool-border); }
.arp-sing[data-status=range] { outline: 2px dashed var(--icon-c); outline-offset: 2px; }
.arp-sing[data-status=accepted] { background: color-mix(in srgb,var(--icon-c) 35%,var(--tool-surface)); }
.arp-sing:disabled { opacity: .5; }
.arp-cell.entry-next .note-trigger { outline: 3px dashed var(--arp-highlight); outline-offset: 3px; }
.arp-cell { position: absolute; left: var(--step-x); top: var(--step-y); transform: translate(-50%,-50%); width: 26%; aspect-ratio: 1; }
.arp-cell > span { position: absolute; z-index: 1; top: -2px; left: 0; width: 17px; height: 17px; border-radius: 50%; background: var(--panel); text-align: center; font: 10px/17px var(--font-body); pointer-events: none; }
.note-trigger { position: relative; overflow: hidden; width: 100%; height: 100%; margin: 0; padding: 0 2px; text-align: center; font: 700 15px var(--font-display); border: 3px solid var(--control-border); border-radius: 50%; background: var(--step-color); color: var(--ink); cursor: pointer; }
.arp-cell.rest .note-trigger { color: var(--text-muted); background: var(--panel-secondary); border-color: var(--panel-muted); border-style: dashed; }
.arp-cell.playhead .note-trigger { outline: 3px solid var(--arp-highlight); outline-offset: 2px; }
.note-trigger:focus-visible { box-shadow: 0 0 0 5px var(--focus); }
.note-options { position: absolute; z-index: 5; width: 136px; max-width: 100%; max-height: min(218px,100%); overflow-y: auto; overscroll-behavior: contain; padding: 6px; border: 1px solid var(--tool-border); border-radius: 15px; background: var(--panel); box-shadow: 0 4px 14px rgb(0 0 0 / 22%); scrollbar-width: thin; }
.note-option { display: flex; width: 100%; align-items: center; gap: 10px; min-height: 38px; padding: 5px 8px; border: 2px solid transparent; border-radius: 9px; background: transparent; font: 700 13px var(--font-display); }
.note-option:hover, .note-option:focus-visible { background: var(--tool-active); outline: none; }
.note-option[aria-selected=true] { border-color: var(--tool-ink); }
.note-swatch { flex: 0 0 auto; width: 21px; height: 21px; border: 1px solid var(--tool-border); border-radius: 50%; background: var(--note-color); }
.note-option[data-note-value=rest] .note-swatch { border-style: dashed; }
#panel-arp .panel-tools { position:relative; flex-wrap: nowrap; gap: 4px; }
#panel-arp .icon-action { flex: 0 1 40px; min-width: 32px; gap: 4px; min-height: 44px; }
#panel-arp .icon-action .ui-icon { width: 21px; height: 21px; }
#panel-arp .panel-tools .icon-action .ui-icon { max-width:100%; }
#panel-arp [data-arp-fix] .ui-icon, #panel-bass [data-bass-fix] .ui-icon { width:29px; height:29px; }
#panel-arp :is([data-arp-fix],[data-arp-movable-do])[aria-pressed=true] { background: var(--tool-active); border-color: var(--tool-ink); box-shadow: inset 0 1px 3px var(--tool-border); }
.arp-pattern-picker { flex:0 1 74px; min-width:54px; }
.arp-pattern-picker .arp-pattern-trigger { display:flex; align-items:center; justify-content:center; gap:3px; width:100%; height:44px; padding:4px; background:var(--tool-surface); }
.arp-pattern-trigger > .ui-icon { flex:0 0 10px; width:10px; height:10px; }
.arp-pattern-trigger :is([data-arp-pattern-preview],[data-bass-pattern-preview]) { flex:1; min-width:0; }
.arp-pattern-art { display:block; width:100%; height:30px; }
.arp-pattern-trigger[aria-expanded=true] { background:var(--tool-active); border-color:var(--tool-ink); }
.arp-pattern-trigger[aria-expanded=true] > .ui-icon { transform:rotate(180deg); }
.arp-pattern-options { position:absolute; z-index:8; bottom:calc(100% + 8px); left:0; right:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; max-height:276px; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; padding:8px; border:1px solid var(--tool-border); border-radius:16px; background:var(--panel); box-shadow:0 6px 18px rgb(0 0 0 / 20%); }
.arp-pattern-option { display:flex; align-items:center; gap:7px; min-height:47px; min-width:0; padding:5px 7px; border:2px solid transparent; border-radius:10px; background:var(--tool-surface); font:700 11px var(--font-display); text-align:left; }
.arp-pattern-option-art { display:flex; align-items:center; gap:3px; flex:0 1 72px; min-width:42px; }
.arp-pattern-option-art .arp-pattern-art { min-width:0; }
.arp-pattern-option-art > .ui-icon { flex:0 0 12px; width:12px; height:12px; }
.arp-pattern-option[aria-selected=true] { background:var(--tool-active); border-color:var(--tool-ink); }
.arp-pattern-option:hover { background:var(--panel-secondary); }
.arp-pattern-option:focus-visible { outline-offset:-3px; }
.draw-canvas { width: 100%; height: 210px; display: block; border: 2px solid var(--border); border-radius: var(--pad-radius); background: var(--drawing-paper); touch-action: none; }
.panel-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; }
.drawing-tools { column-gap: 10px; }
.color-options { display: grid; grid-template-columns: repeat(var(--drawing-colors,8),minmax(0,1fr)); gap: 3px; width: 100%; padding: 3px; }
.color-button { display: grid; place-items: center; min-width: 0; width: 100%; height: 34px; padding: 2px; border: 0; border-radius: 7px; background: transparent; }
.color-button .paint-swatch { display: block; width: min(23px,100%); aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--control-border); background: var(--key-color); pointer-events: none; }
.color-button.active .paint-swatch { outline: 2px solid var(--tool-ink); outline-offset: 1px; }
.drawing-tools .icon-action[aria-pressed=true] { background: var(--tool-active); border-color: var(--tool-ink); }
.inline-notice { font: 11px/1.5 var(--font-body); color: var(--text-secondary); }
#panel-tracking { height: 100%; display: flex; flex-direction: column; }
#panel-tracking > h2 { flex: 0 0 auto; margin: 14px 0 8px; }
#panel-tracking > .module-tabs { flex: 0 0 auto; margin: 4px 0 8px; }
#panel-tracking .module-tab { flex-direction: row; justify-content: center; padding: 5px 3px; }
.tracking-panel { position: relative; flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(80px,1fr) auto auto; gap: 7px; padding-bottom: 3px; }
.tracking-stage { position: relative; min-height: 0; border: 1px solid var(--tool-border); border-radius: 20px; background: color-mix(in srgb,var(--icon-a) 9%,var(--panel)); overflow: hidden; }
.tracking-avatar { display: block; width: 100%; height: 100%; color: var(--art-ink); --wave-awake: 1; --wave-asleep: 0; }
.tracking-avatar [hidden] { display: none; }
.tracking-gaze-field { position: absolute; inset: 15px; pointer-events: none; }
.tracking-gaze-dot { position: absolute; width: 20px; height: 20px; border: 3px solid #fff; border-radius: 50%; background: var(--icon-c); box-shadow: 0 0 0 1px var(--art-ink), 0 2px 5px #0003; transform: translate(-50%,-50%); }
.avatar-arm { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.avatar-arm-outline { stroke: var(--art-ink); stroke-width: 11; }
.avatar-sleeve { stroke: var(--icon-c); stroke-width: 6; }
.avatar-arm:not(.detected) .avatar-arm-outline { stroke-width: 8; }
.avatar-arm:not(.detected) .avatar-sleeve { stroke-width: 4; }
.avatar-mitten, .avatar-palm { fill: var(--hand-fill); stroke: var(--art-ink); stroke-width: 2; stroke-linejoin: round; }
.avatar-finger, .avatar-finger-outline { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.avatar-finger-outline { stroke: var(--art-ink); stroke-width: 7; }
.avatar-finger { stroke: var(--hand-fill); stroke-width: 4; }
.avatar-limb { --hand-fill: var(--icon-b); }
.avatar-limb, .avatar-arm { opacity: .72; }
.avatar-limb.detected, .avatar-arm.detected { opacity: 1; }
.avatar-limb.playing { --hand-fill: var(--icon-a); }
.tracking-power { position: absolute; right: 8px; top: 8px; width: 38px; height: 38px; }
.tracking-power[aria-pressed=true] { background: var(--tool-active); box-shadow: inset 0 2px 2px color-mix(in srgb,var(--tool-ink) 22%,transparent); }
.tracking-assignments { display: grid; grid-template-columns: repeat(var(--tracking-sources),minmax(0,1fr)); gap: 8px; }
.tracking-source { min-width: 0; margin: 0; padding: 4px 7px 7px; border: 1px solid var(--tool-border); border-radius: 14px; }
.tracking-source legend { font-size: 12px; padding: 0 4px; }
.tracking-source legend .ui-icon { width: 19px; height: 19px; vertical-align: middle; margin-right: 3px; }
.tracking-assignment { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 30px; margin: 3px 0; padding: 3px 5px; border: 1px solid var(--tool-border); border-radius: 9px; background: var(--tool-surface); color: var(--text); box-shadow: 0 2px 0 color-mix(in srgb,var(--tool-border) 35%,transparent); }
.tracking-assignment > .ui-icon { width: 18px; height: 18px; flex: 0 0 18px; }
.tracking-target { display: flex; align-items: center; justify-content: center; gap: 4px; flex: 1; font-size: 11px; }
.tracking-target .ui-icon { width: 21px; height: 21px; flex: 0 0 21px; }
.tracking-target .effect-thumbnail { width: 26px; height: 26px; flex-basis: 26px; }
.tracking-assignment[aria-expanded=true] { background: var(--tool-active); }
.tracking-options { position: absolute; inset: 0; z-index: 4; border: 2px solid var(--tool-border); border-radius: 16px; background: var(--panel); box-shadow: 0 5px 16px #0002; padding: 9px; overflow: auto; }
.tracking-options-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tracking-options-heading strong { font-size: 14px; }
.tracking-options-heading button { width: 30px; height: 30px; }
.tracking-option-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.tracking-option { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 49px; padding: 4px; gap: 3px; font-size: 10px; }
.tracking-option[aria-pressed=true] { background: var(--tool-active); border-color: var(--tool-ink); }
.tracking-option .effect-thumbnail { width: 32px; height: 32px; }
[data-icon-character].is-blinking { --wave-awake: 0; --wave-asleep: 1; }
.effect-thumbnail.is-blinking { --wave-awake:0; --wave-asleep:1; }
@media (prefers-reduced-motion: reduce) { [data-icon-character] { --gaze-transition: none; } }
.connection-status { margin: 12px 0; padding: 7px; background: var(--panel-muted); border: 1px solid var(--tool-border); border-radius: 16px; }
.connection-friends { display: flex; justify-content: center; align-items: center; gap: 16px; }
.connection-player { display: flex; padding: 4px; border: 2px dashed var(--tool-border); border-radius: 16px; opacity: .4; }
.connection-player > .ui-icon { width: 48px; height: 48px; }
.connection-peer { --player-shirt: var(--icon-c); }
.connection-status:is([data-state=waiting],[data-state=connected]) .connection-self,
.connection-status[data-state=connected] .connection-peer { opacity: 1; border-style: solid; background: var(--tool-surface); }
.connection-bridge { display: grid; place-items: center; width: 38px; }
.connection-bridge > span { grid-area: 1 / 1; }
.connection-bridge .ui-icon { width: 32px; height: 32px; }
.connection-dots { display: flex; gap: 5px; }
.connection-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--tool-border); }
.connection-ready, .connection-failed { visibility: hidden; }
.connection-status[data-state=connected] .connection-ready,
.connection-status[data-state=error] .connection-failed { visibility: visible; }
.connection-status:is([data-state=connected],[data-state=error]) .connection-dots { visibility: hidden; }
.connection-status:is([data-state=creating],[data-state=connecting],[data-state=waiting]) .connection-dots i { background: var(--icon-a); animation: connection-wait 1.8s ease-in-out infinite; }
.connection-status .connection-dots i:nth-child(2) { animation-delay: .2s; }
.connection-status .connection-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes connection-wait { 0%,100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.connection-share-tools { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 10px 0; }
.connection-actions { display: flex; justify-content: center; gap: 12px; }
.connection-share-tools:has(#connection-qr:not([hidden])) .connection-actions { flex-direction: column; gap: 9px; }
.icon-action.connection-button { flex: 0 0 auto; width: 48px; height: 46px; padding: 5px; border: 2px solid var(--tool-border); border-radius: 13px; background: var(--tool-surface); box-shadow: 0 2px 0 var(--tool-border); }
.connection-button .ui-icon { width: 32px; height: 32px; }
.connection-button > span { display: flex; }
.connection-button:active:not(:disabled) { box-shadow: inset 0 2px 3px var(--tool-border); }
.connection-button[data-action=connect-create]:enabled { background: color-mix(in srgb,var(--icon-a) 30%,var(--tool-surface)); }
.connection-copy-done, .connection-button[data-copied=true] .connection-copy-icon { display: none !important; }
.connection-button[data-copied=true] .connection-copy-done { display: flex !important; }
.connection-invite { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding: 5px; border: 1px solid var(--tool-border); border-radius: 14px; background: var(--tool-surface); }
.connection-invite label { display: flex; padding-left: 3px; }
.connection-invite label .ui-icon { width: 24px; height: 24px; }
.connection-invite input { min-width: 0; width: 100%; flex: 1; height: 38px; padding: 5px; font: 12px var(--font-body); color: var(--art-ink); background: var(--icon-paper); border: 1px solid var(--tool-border); border-radius: 7px; }
.connection-error { margin: 10px 0 0; font: 12px/1.5 var(--font-body); overflow-wrap: anywhere; }
#connection-qr { order: -1; flex: 0 0 auto; width: fit-content; padding: 10px; border-radius: 12px; background: #fafbf3; }
.device-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.lfo-controls .range-row { grid-template-columns: 52px minmax(0,1fr); }
.lfo-row { display: flex; align-items: center; gap: 8px; }
.switch { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--tool-surface); color: var(--tool-ink); border: 1px solid var(--tool-border); padding: 6px 9px; border-radius: 10px; font-size: 12px; }
.switch[aria-pressed=true] { background: var(--tool-active); border-color: var(--tool-ink); box-shadow: inset 0 0 0 1px var(--tool-ink); }
details { margin-top: 14px; }
summary { cursor: pointer; font: 12px var(--font-body); }
/* A saved take lives in a small listening window, outside the instrument layout. */
.record-control { position: relative; display: inline-flex; }
.record-listen { position: absolute; right: -10px; bottom: -10px; display: grid; place-items: center; width: 26px; height: 26px; padding: 1px; border: 1px solid var(--tool-border); border-radius: 50%; background: var(--control-surface); box-shadow: 0 1px 2px #0002; }
.record-listen .ui-icon { width: 20px; height: 20px; }
.recording-result { width: min(360px,calc(100vw - 28px)); max-height: calc(100dvh - 28px); margin: auto; padding: 20px; border: 2px solid var(--border); border-radius: 26px; background: var(--panel); color: var(--text); box-shadow: 0 16px 50px #233c3933; overflow: auto; }
.recording-result::backdrop { background: #253b394a; backdrop-filter: blur(3px); }
.recording-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.recording-heading h2 { margin: 0; font-size: 19px; }
.recording-close { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--tool-border); border-radius: 12px; background: var(--tool-surface); flex-shrink: 0; }
.recording-stage { position: relative; display: grid; place-items: center; height: 148px; border-radius: 22px; background: color-mix(in srgb,var(--icon-a) 13%,var(--panel)); margin-bottom: 18px; }
.recording-waves { --tool-ink: var(--text-secondary); position: absolute; inset: 12px 0; width: 100%; height: calc(100% - 24px); }
.recording-bars path { transform-box: fill-box; transform-origin: center; stroke: var(--icon-a); }
.recording-bars path:nth-child(2n) { stroke: var(--icon-c); }
.recording-bars path:nth-child(3) { stroke: var(--icon-b); }
.recording-play { position:relative; z-index: 1; display: grid; place-items: center; width: 80px; height: 80px; border: 2px solid color-mix(in srgb,var(--icon-b),var(--tool-ink) 24%); border-radius: 50%; background: var(--icon-b); box-shadow: 0 4px 0 color-mix(in srgb,var(--icon-b),var(--tool-ink) 22%); }
.recording-headphones { position:absolute; width:120px; height:116px; left:50%; top:50%; transform:translate(-50%,-60%); pointer-events:none; }
.recording-play .ui-icon { width: 44px; height: 44px; color: var(--tool-ink); }
.recording-play:active { transform: translateY(2px); box-shadow: 0 2px 0 color-mix(in srgb,var(--icon-b),var(--tool-ink) 22%); }
.recording-play .recording-pause-icon, .is-playing .recording-play-icon { display: none; }
.is-playing .recording-pause-icon { display: block; }
.is-playing .recording-bars path { animation: recording-dance .8s ease-in-out infinite alternate; }
.is-playing .recording-bars path:nth-child(2) { animation-delay: -.3s; }
.is-playing .recording-bars path:nth-child(3) { animation-delay: -.6s; }
.is-playing .recording-bars path:nth-child(4) { animation-delay: -.1s; }
.recording-save { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 54px; padding: 10px 18px; border: 2px solid color-mix(in srgb,var(--icon-c),var(--tool-border) 50%); border-radius: 16px; background: color-mix(in srgb,var(--icon-c) 24%,var(--panel)); font-weight: 700; }
.recording-save .ui-icon { width: 28px; height: 28px; }
.recording-save:hover, .recording-close:hover { filter: brightness(1.04); }
.patch-save-stage { display:flex; flex-direction:column; align-items:center; gap:12px; padding:16px; margin-bottom:18px; border-radius:22px; background:color-mix(in srgb,var(--icon-a) 13%,var(--panel)); }
.patch-save-stage > .ui-icon { width:76px; height:76px; }
.patch-save-stage label { align-self:flex-start; font-size:14px; }
.patch-save-stage input { width:100%; min-width:0; border:2px solid var(--tool-border); border-radius:12px; padding:12px; background:var(--tool-surface); font-size:19px; }
.log-result .recording-stage { height: 132px; }
.log-result .recording-stage > .ui-icon { width: 86px; height: 86px; }
.log-download-done, .log-result[data-downloaded=true] .log-download-icon { display: none; }
.log-result[data-downloaded=true] .log-download-done { display: block; }
.log-result[data-downloaded=true] .recording-save { background: color-mix(in srgb,var(--icon-a) 26%,var(--panel)); }
@keyframes recording-dance { from { transform: scaleY(.55); } to { transform: scaleY(1.12); } }
@media (prefers-reduced-motion:reduce) { .is-playing .recording-bars path { animation: none; } }
footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 4px; }
.copyright { flex-basis: 100%; text-align: center; font-size: 13px; }
#status:not(.sr-only) { position: fixed; z-index: 50; top: 8px; left: 50%; transform: translateX(-50%); max-width: min(420px,90vw); margin: 0; padding: 10px 14px; border: 1px solid var(--tool-border); border-radius: 10px; background: var(--panel); box-shadow: 0 3px 12px rgb(0 0 0 / 15%); font: 12px/1.4 var(--font-body); color: var(--text); text-align: center; pointer-events: none; }
#activity-indicator { font: bold 10px var(--font-body); color: var(--sound-control); }
@keyframes pulse { 50% { opacity: .4; } }
@media (max-width:1100px) { .shell { width: calc(100% - 10px); padding: 4px; } }
@container (max-width:1100px) {
  .masthead { gap: 6px; }
  .header-actions { gap: 6px; } .header-button .ui-icon { width: 21px; }
  .brand { --brand-gap: 9px; } .workbench { --workspace-height: 420px; gap: 6px; }
  .oscillator-panel { padding: 6px; } .osc-top { gap: 8px; } .osc-face { gap: 5px; grid-template-columns: 19px minmax(0,1fr) 36px; }
  .osc-face .icon-action .ui-icon, .osc-face .module-button .ui-icon { width: 19px; }
  .center-panel { padding: 10px; } .envelope-dials { gap: 10px; } #panel-envelope { --envelope-picture-height: 98px; }
  .effect-panel { padding: 4px 6px 8px; } .range-row { grid-template-columns: 66px minmax(0,1fr) auto; gap: 5px; }
  .effect-panel .range-row { grid-template-columns: 80px minmax(0,1fr) auto; }
  .range-row label { font-size: 12px; } .range-row > .ui-icon { width: 18px; }
  .module-menu { column-gap: 5px; } .module-menu .module-button .ui-icon { width: 23px; }
  .transport-panel { gap: 4px; padding: 6px 4px; } .transport-panel .module-button, .sequence-switch { font-size: 10px; }
  .performance-panel { grid-template-columns: 102px minmax(0,1fr); }
}
@media (max-width:760px) {
  body { display: block; } .shell { margin: 8px auto; }
}
@container (max-width:760px) {
  .masthead { grid-template-columns: 1fr 1fr; min-height: 70px; padding: 0 2px 8px; }
  .masthead .header-actions { grid-row: 2; }
  .brand { grid-column: 1 / -1; grid-row: 1; justify-self: center; } .brand h1 { font-size: 38px; } .brand-reset .snake-character { width: 68px; }
  /* Keep the original left/centre/right geography in a scrollable instrument,
     instead of moving familiar modules to different rows on small screens. */
  #instrument { overflow-x: auto; overscroll-behavior-x: contain; padding: 3px 2px 6px; }
  .workbench, .performance-panel { min-width: 740px; }
  .workbench { grid-template-columns: 210px 320px 200px; gap: 5px; }
  .osc-face { grid-template-columns: 16px minmax(0,1fr) 36px; gap: 4px; }
  .output-panel { padding: 7px 5px; } .output-panel .range-row { grid-template-columns: 32px minmax(0,1fr) auto; }
  .effect-panel .range-row { grid-template-columns: 78px minmax(0,1fr) auto; }
  .module-menu { padding-inline: 4px; column-gap: 4px; } .module-menu .module-button { gap: 3px; } .module-menu .module-button .ui-icon { width: 22px; }
  .transport-panel .module-button { font-size: 9px; }
  .range-row > .ui-icon { width: 16px; } .range-row output { font-size: 8px; }
  .performance-panel { grid-template-columns: 102px 1fr; }
  .ribbon { min-height: 104px; }
}
.safe-area-measure { position: fixed; visibility: hidden; pointer-events: none; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
/* Small-screen stage: one coherent landscape instrument, including its header,
   keys and footer. Container queries above follow this stage, not the phone. */
.fitted-instrument { overflow: hidden; }
.fitted-instrument body { display: block; position: relative; overflow: hidden; height: 100dvh; min-height: 0; }
.fitted-instrument .shell {
  position: absolute; left: 0; top: 0; margin: 0; padding: 4px; transform-origin: 0 0;
}
.fitted-instrument .masthead { min-height: 62px; padding: 0 6px 6px; }
.fitted-instrument .brand h1 { font-size: 42px; }
.fitted-instrument .brand-reset .snake-character { width: 68px; }
.fitted-instrument .workbench { --workspace-height: 408px; }
.fitted-instrument .osc-card { margin-bottom: 8px; }
.fitted-instrument .center-panel { padding: 10px; }
.fitted-instrument .drum-heading { margin-top: 14px; gap: 4px; }
.fitted-instrument .drum-pages .button { min-height: 26px; }
.fitted-instrument .drum-choice-trigger { min-height: 54px; }
.fitted-instrument .scope { height: 70px; }
.fitted-instrument #panel-envelope { --envelope-picture-height: 83px; }
.fitted-instrument .dial { max-width: 68px; }
.fitted-instrument .dial-control strong { font-size: 26px; }

.fitted-instrument .performance-panel { margin-top: 6px; }
.fitted-instrument footer { gap: 4px 10px; }
.fitted-instrument .copyright { flex-basis: auto; }
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation: none !important; } }
@media (prefers-reduced-motion: reduce) { .wave-actor, .jellyfish-illustration, .snake-character, .effect-character, [data-mode-character], [data-speed-character] { --gaze-transition: none; } }

/* One icon, one touch target. Tool colours are independent of musical notes. */
:is(.header-button,.settings-button,.icon-action,.module-button,.sidebar-button,.mini-toggle,.toy-button) {
  width: 40px; height: 40px; border: 1px solid var(--tool-border); border-radius: 12px;
  background: var(--tool-surface); color: var(--tool-ink); box-shadow: 0 2px 0 color-mix(in srgb,var(--tool-border),transparent 40%);
}
:is(.header-button,.settings-button,.icon-action,.module-button,.sidebar-button,.mini-toggle,.toy-button)[aria-pressed=true], .surface-trigger[aria-expanded=true] {
  background: var(--tool-active); border-color: var(--tool-ink); box-shadow: inset 0 0 0 1px var(--tool-ink);
}
:is(.header-button,.settings-button,.icon-action,.module-button,.sidebar-button,.mini-toggle,.toy-button):active:not(:disabled) { background: var(--tool-active); box-shadow: inset 0 1px 3px var(--tool-border); }
.osc-tools :is(.icon-action,.module-button) { width: 34px; height: 34px; border-radius: 10px; }
.osc-tools .ui-icon { width: 21px; height: 21px; }
.random { background: color-mix(in srgb,var(--random) 18%,var(--tool-surface)); }
.header-button.connection { background: color-mix(in srgb,var(--connection) 18%,var(--tool-surface)); }
.module-menu .module-button { width: min(100%,44px); min-width: 0; height: 40px; padding: 3px; }
.keyboard-sidebar { align-items: stretch; }
.sidebar-button { width: 100%; height: 38px; }
.mini-toggle { width: 32px; height: 32px; border-radius: 10px; }
.copyright { font-weight: 700; color: var(--text-secondary); }
.copyright span { -webkit-text-stroke: .065em color-mix(in srgb,currentColor,black 36%); paint-order: stroke fill; }
.copyright span:nth-child(1) { color: var(--envelope-attack); }
.copyright span:nth-child(2) { color: var(--envelope-decay); }
.copyright span:nth-child(3) { color: var(--envelope-release); }


.keyboard-layout-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.keyboard-layout-choice { min-width: 0; display: grid; justify-items: center; gap: 6px; padding: 7px; font-size: 11px; }
.keyboard-layout-choice svg { width: 100%; max-width: 112px; height: 48px; color: var(--tool-ink); }
.keyboard-layout-choice[aria-pressed=true] { background: var(--tool-active); border-color: var(--tool-ink); box-shadow: inset 0 0 0 1px var(--tool-ink); }

/* Painted SVG surfaces keep the established colours, shapes and hit areas. */
button svg { pointer-events: none; }
.key-surface, .step-surface, .note-face { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.note-trigger-label { position: relative; z-index: 1; pointer-events: none; }
.arp-cell.rest .note-face circle { fill: var(--panel-secondary); }
.noise-face { display: block; width: 100%; height: 100%; }
.paint-swatch { height: auto; }
.palette-swatches svg { display: block; width: 100%; height: 100%; }
.note-name-sample .note-name-tile { width: 100%; height: 23px; }
.note-name-sample .note-name-tile text { font-size: 10px; }
.switch > .ui-icon { width: 21px; height: 21px; }

.fitted-instrument .oscillator-dial .dial { max-width: 56px; }


.skin-settings { margin-top: 12px; }
.skin-choices { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; }
.skin-choice { position: relative; display: grid; gap: 6px; justify-items: center; min-width: 0; padding: 5px 3px 7px; border: 2px solid transparent; border-radius: 12px; background: transparent; color: var(--text-secondary); font-size: 10px; font-weight: 700; }
.skin-preview { display: block; width: 100%; max-width: 64px; height: auto; }
.skin-choice:hover { background: var(--panel-secondary); }
.skin-choice[aria-pressed=true] { border-color: var(--focus); background: var(--panel-secondary); color: var(--text); box-shadow: inset 0 -2px 0 color-mix(in srgb,var(--focus),transparent 60%); }
.skin-choice[aria-pressed=true]::after { content: ''; position: absolute; width: 6px; height: 6px; border-radius: 50%; top: -4px; right: 5px; background: var(--focus); border: 1px solid var(--panel); }
:root[data-skin=night] .brand-reset .snake-character { --snake-body: #9dabb4; --snake-ink: #9dabb4; --snake-belly: #c0c9cd; --snake-highlight: #dce3e5; }

/* Shared toy controls for the bass, mixer, patch playground and scales. */
.synth-bank { flex:1; min-height:0; display:flex; flex-direction:column; justify-content:space-around; }
.bass-bank { flex:1; min-height:0; display:flex; flex-direction:column; justify-content:space-evenly; gap:10px; }
.bass-bank .module-heading { margin:0; }
.bass-source-level { display:flex; align-items:center; gap:12px; padding:0 8px; }
.bass-source-level .range-row { flex:1; min-width:0; }
.bass-wave-art { display:block; width:92%; height:125px; margin:0 auto; background:var(--wave-surface); border:2px solid var(--border); border-radius:22px; padding:8px; }
.bass-wave-art > span,.bass-wave-art .wave-art { display:flex; width:100%; height:100%; justify-content:center; }
.keyboard-settings legend { display:flex; gap:6px; align-items:center; }
.keyboard-settings legend .ui-icon { width:22px; height:22px; }
.bass-tune { display:flex; align-items:center; gap:8px; padding:0 10px; --control-color:var(--envelope-sustain); }
.bass-tune .range-row { flex:1; min-width:0; }
.bass-tune output { display:none; }
.bass-heading .module-heading { margin:4px 0 10px; }
.bass-tone { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
.bass-tone-box { margin:0; min-width:0; padding:7px 4px 9px; --control-color:var(--envelope-attack); }
.bass-tone-box:nth-child(3n + 2) { --control-color:var(--envelope-release); }
.bass-tone-box:nth-child(3n) { --control-color:var(--envelope-sustain); }
.bass-tone-box legend { display:flex; align-items:center; gap:4px; font-size:10px; padding:0 2px; }
.bass-tone-box legend .ui-icon { width:21px; height:21px; }
.bass-dial .dial { width:48px; height:48px; border-width:3px; }
.bass-dial .dial i { width:4px; left:calc(50% - 2px); background:var(--art-ink); }
.bass-dial .dial::after { width:10px; height:10px; left:calc(50% - 5px); top:calc(50% - 5px); background:var(--art-ink); }
.bass-pattern { position:relative; margin:10px 0 0; padding:5px 5px 9px; background:var(--inset); }
.bass-pattern legend { padding:0 5px; }
.bass-pattern legend .ui-icon { width:30px; height:24px; }
.bass-steps { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:4px; }
.bass-step { display:flex; flex-direction:column; gap:6px; padding:3px 0; min-width:0; border-radius:12px; }
.bass-step.playing { background:color-mix(in srgb,var(--icon-b) 35%,transparent); outline:2px solid var(--arp-highlight); }
.bass-step .button { padding:3px; min-width:0; width:100%; height:30px; min-height:30px; border-radius:10px; }
.bass-step > .button .ui-icon { width:21px; height:21px; }
.bass-step > .button[aria-pressed=true] { background:var(--tool-active); border-color:var(--tool-ink); }
.bass-pattern-choices { position:relative; justify-content:center; flex-wrap:nowrap; gap:7px; margin-top:12px; }
.bass-pattern-picker { flex-basis:96px; }
.bass-pattern-art { display:block; width:100%; height:36px; }
.bass-pattern-picker .arp-pattern-option-art { flex-basis:82px; }
.bass-pattern-picker .arp-pattern-trigger { height:44px; }
.bass-pattern-choices > [aria-pressed=true] { background:var(--tool-active); border-color:var(--tool-ink); }
.picture-choice { position:relative; min-width:0; }
.picture-trigger { width:100%; min-width:0; padding:6px 9px; background:var(--tool-surface); }
[data-picture-selected] { display:flex; align-items:center; justify-content:center; gap:8px; min-width:0; width:100%; }
.picture-options { position:absolute; top:calc(100% + 8px); left:0; right:0; z-index:30; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; max-height:240px; overflow:auto; padding:8px; border:2px solid var(--tool-border); border-radius:16px; background:var(--panel); box-shadow:0 5px 14px rgb(0 0 0 / 18%); }
.picture-option { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; padding:7px; min-width:0; border:2px solid transparent; border-radius:10px; background:var(--tool-surface); color:var(--text); font-size:11px; }
.picture-option[aria-selected=true] { border-color:var(--tool-ink); background:var(--tool-active); }
.picture-option:hover { background:var(--panel-secondary); }
.scale-preview { width:82px; height:30px; }
.scale-settings { margin-top:12px; }
.scale-editor-tools { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
.scale-editor-tools .picture-choice { flex:1; }
.scale-editor-tools .picture-trigger { height:45px; font-size:12px; }
.scale-editor-tools .picture-options { right:-46px; }
.scale-note-grid { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:3px; }
.scale-note { position:relative; min-width:0; padding:1px; height:34px; border-radius:8px; background:var(--tool-surface); }
.scale-note-face { width:100%; height:100%; opacity:.23; }
.scale-note [data-scale-note-label] { position:absolute; font-size:10px; font-weight:700; white-space:nowrap; color:var(--text); }
.scale-note[aria-pressed=true] .scale-note-face { opacity:1; }
.scale-note[aria-pressed=true] [data-scale-note-label] { color:var(--scale-note-ink); }
.scale-note:disabled { opacity:1; }
.scale-note[aria-pressed=false]:disabled { opacity:.5; }
.bass-note-choice { position:static; --choice-note-color:var(--bass-note); }
.bass-note-choice .picture-trigger { height:38px; padding:0; border:0; border-radius:50%; background:transparent; box-shadow:none; }
.bass-note-choice [data-picture-selected] { position:relative; height:100%; gap:0; }
.choice-note { width:30px; height:30px; border:2px solid color-mix(in srgb,var(--tool-ink),transparent 65%); border-radius:50%; }
.bass-note-choice [data-picture-selected] .choice-name { position:absolute; font:700 11px var(--font-display); }
.bass-note-choice .picture-options { top:auto; bottom:calc(100% + 8px); left:0; right:0; grid-template-columns:repeat(6,minmax(0,1fr)); max-height:225px; }
.bass-note-choice .picture-option { padding:4px 2px; font:700 12px var(--font-display); }
.note-trigger-label, .bass-note-choice [data-picture-selected] .choice-name { color:#fff; text-shadow:0 1px 2px rgb(0 0 0 / 75%),0 0 1px var(--ink); }
.note-trigger-label, .note-option-label, .bass-note-choice .choice-name { opacity:0; pointer-events:none; }
:root[data-note-names=always] :is(.note-trigger-label,.note-option-label,.bass-note-choice .choice-name),
:root[data-note-names=hover] .note-hovered > :is(.note-trigger-label,.note-option-label,.choice-name),
:root[data-note-names=hover] .bass-note-choice .picture-trigger.note-hovered .choice-name,
:root[data-note-names=on-touch] .note-touched > :is(.note-trigger-label,.note-option-label,.choice-name),
:root[data-note-names=on-touch] .bass-note-choice .picture-trigger.note-touched .choice-name,
:root[data-note-names=on-touch] .arp-cell.playhead .note-trigger-label,
:root[data-note-names=on-touch] .bass-step.playing .picture-trigger .choice-name,
.arp-cell.rest .note-trigger-label, .note-option[data-note-value=rest] .note-option-label,
.bass-step.rest .picture-trigger .choice-name, .bass-note-choice [data-picture-value=rest] .choice-name { opacity:1; }
.arp-cell.rest .note-trigger-label, .bass-step.rest .picture-trigger .choice-name { color:var(--text-muted); text-shadow:none; }
#panel-mixer > .module-heading { margin:4px 0 12px; }
.mixer-channels { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; }
.mixer-strip { display:flex; align-items:center; flex-direction:column; gap:10px; padding:8px 5px 10px; border:2px solid var(--border); border-radius:16px; background:var(--inset); min-width:0; }
.mixer-art { width:100%; height:auto; min-height:55px; display:flex; flex-direction:column; gap:4px; align-items:center; justify-content:center; padding:3px; border:2px solid var(--tool-border); border-radius:12px; background:var(--tool-surface); }
.mixer-art .ui-icon { width:31px; height:31px; }
.mixer-art strong { font-size:10px; white-space:nowrap; }
.mixer-art[aria-pressed=true] { background:var(--tool-active); border-color:var(--tool-ink); }
.mixer-strip[data-selected=true] { border-color:var(--tool-ink); background:color-mix(in srgb,var(--icon-a) 12%,var(--inset)); }
.mixer-fader { display:flex; justify-content:center; margin:0; width:100%; --control-color:var(--fader-output); }
.mixer-fader label,.mixer-fader output,.mixer-pan output,.mixer-effects output { display:none; }
.mixer-fader input[type=range] { writing-mode:vertical-lr; direction:rtl; width:30px; height:98px; margin:0 auto; }
.mixer-fader input[type=range]::-webkit-slider-runnable-track { width:var(--track-size); height:100%; background:linear-gradient(to top,var(--control-color) var(--fill,0%),var(--track-fill) var(--fill,0%)); }
.mixer-fader input[type=range]::-webkit-slider-thumb { margin-top:0; margin-left:calc((var(--track-size) - var(--range-thumb-size)) / 2); }
.mixer-fader input[type=range]::-moz-range-track { width:var(--track-size); height:100%; background:linear-gradient(to top,var(--control-color) var(--fill,0%),var(--track-fill) var(--fill,0%)); }
.mixer-pan .dial { width:38px; height:38px; }
.mixer-buttons { display:flex; gap:5px; align-items:center; justify-content:center; }
.mixer-buttons .button,.mixer-buttons .sequence-switch { width:32px; height:32px; min-height:32px; padding:3px; }
.mixer-buttons .ui-icon { width:22px; height:22px; }
.mixer-mute { position:relative; touch-action:none; }
.mixer-mute[aria-pressed=true] .ui-icon { filter:grayscale(1); opacity:.4; }
.mixer-mute[aria-pressed=true]::after { content:''; position:absolute; width:65%; height:2px; border-radius:2px; background:var(--tool-ink); transform:rotate(-40deg); pointer-events:none; }
.mixer-live { display:grid; width:29px; height:29px; place-items:center; opacity:.6; }
.mixer-effects { width:100%; min-width:0; padding:3px 0 9px; display:grid; gap:2px; border-bottom:1px solid color-mix(in srgb,var(--tool-border),transparent 48%); }
.mixer-effects .range-row { display:grid; grid-template-columns:minmax(0,1fr) 22px; align-items:center; gap:3px; margin:0; }
.mixer-effects .range-row label { display:none; }
.mixer-effects .range-row input { width:100%; height:24px; --range-thumb-size:14px; --track-size:6px; }
.mixer-effects input::-webkit-slider-thumb { border-width:2px; }
.mixer-effects input::-moz-range-thumb { border-width:2px; }
.mixer-effects .range-row > .ui-icon { grid-column:2; width:22px; height:22px; }
/* Match the workspace's compact breakpoint so Bass and Mixer cannot outgrow it. */
@container (max-width:1100px) {
  .bass-tone-box { padding:3px 3px 6px; }
  .bass-dial .dial { width:40px; height:40px; }
  .bass-tone-box legend { font-size:9px; gap:2px; }
  .bass-tone-box legend .ui-icon { width:18px; height:18px; }
  .bass-heading .module-heading { margin-bottom:6px; }
  .bass-pattern { margin-top:7px; padding-bottom:5px; }
  .bass-pattern-choices { margin-top:8px; gap:5px; }
  .mixer-strip { gap:7px; }
  .mixer-fader input[type=range] { height:60px; }
  .mixer-art { min-height:45px; }
  .mixer-pan .dial { width:33px; height:33px; }
  .patch-toolbar { gap:4px; }
  .patch-toolbar .icon-action { width:29px; height:29px; min-width:29px; }
}

.picture-choice.opens-up .picture-options { top:auto; bottom:calc(100% + 8px); }
.mixer-fader input[type=range],.bass-source-level input[type=range]:not(.dial-input) { --control-color:var(--fader-output); }
.bass-tune input[type=range] { --control-color:var(--envelope-sustain); }
.bass-source-level .pan-control { flex-shrink:0; }
.fitted-instrument .mixer-strip { gap:5px; }
.fitted-instrument .mixer-fader input[type=range] { height:54px; }
.fitted-instrument .mixer-pan .dial { width:33px; height:33px; }
.fitted-instrument .bass-tone-box { padding:3px 3px 6px; }
.fitted-instrument .bass-dial .dial { width:40px; height:40px; }
.fitted-instrument .bass-tone-box legend { font-size:9px; gap:2px; }
.fitted-instrument .bass-tone-box legend .ui-icon { width:18px; height:18px; }
.fitted-instrument .bass-heading .module-heading { margin-bottom:6px; }
.fitted-instrument .bass-pattern { margin-top:4px; padding-bottom:5px; }
.fitted-instrument .bass-pattern-choices { margin-top:4px; gap:5px; }
@container (max-width:850px) {
  .osc-editor-tone legend { font-size:11px; gap:2px; }
  .osc-editor-tone legend .ui-icon { width:14px; height:14px; }
  #panel-arp .panel-tools { gap:2px; }
  #panel-arp .panel-tools .icon-action { min-width:28px; }
  #panel-arp .panel-tools .header-divider { margin-inline:1px; }
  .arp-pattern-option { gap:4px; padding:5px; font-size:10px; }
  .arp-pattern-option-art { flex-basis:58px; }
}


/* The FX panel follows the chosen instrument; Mod lives with the tools below. */
.effect-panel [data-fx-heading] { display:flex; justify-content:center; align-items:center; gap:5px; font-size:14px; white-space:nowrap; }
[data-fx-heading] .ui-icon { width:22px; height:22px; }
[data-fx-part-icon] { display:flex; }
.fx-heading-divider { width:1px; height:16px; margin:0 2px; background:var(--border); }
#panel-modular { max-width:420px; width:100%; margin-inline:auto; height:100%; display:flex; flex-direction:column; justify-content:space-evenly; gap:8px; }
#panel-modular > .module-heading { flex:0 0 auto; margin:0; }
.mod-parts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.mod-parts .toy-button { align-items:center; justify-content:center; width:100%; min-width:0; display:flex; flex-direction:column; gap:3px; height:46px; padding:4px 1px; font-size:10px; }
.mod-parts .ui-icon { width:27px; height:27px; }
.mod-shaping { display:grid; grid-template-columns:1fr 1.3fr; gap:8px; }
.mod-shaping .settings-group { margin:0; min-width:0; padding:5px 8px 8px; display:flex; flex-direction:column; justify-content:space-between; gap:6px; }
#panel-modular legend { display:flex; align-items:center; gap:4px; padding:0 3px; font-size:13px; }
#panel-modular legend .ui-icon { width:22px; height:22px; }
.mod-filter-switch { display:flex; align-items:center; gap:8px; width:74px; height:40px; margin:0 auto; padding:4px; }
.mod-filter-switch > .ui-icon:first-child { width:33px; height:33px; }
.mod-filter-switch > .ui-icon:last-child { width:18px; height:18px; }
.mod-filter-switch[aria-pressed=false] > .ui-icon:first-child { opacity:.4; filter:grayscale(1); }
.mod-slider { margin:0; display:flex; align-items:center; gap:5px; min-width:0; }
.mod-slider .ui-icon { width:21px; height:21px; }
.mod-slider input[type=range] { height:22px; width:100%; min-width:0; --control-color:var(--icon-a); --range-thumb-size:18px; }
.mod-lfo .mod-slider input[type=range] { --control-color:var(--icon-c); }
.mod-slider input:disabled { opacity:.35; }
.mod-lfo-targets { display:flex; justify-content:center; gap:6px; }
.mod-lfo-targets .toy-button { width:32px; height:32px; padding:3px; }
.mod-lfo-targets .ui-icon { width:23px; height:23px; }
.mod-effects { margin:0; padding:6px 8px 8px; background:var(--inset); }
.mod-fx-chain { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.mod-fx-chain .toy-button { position:relative; width:calc((100% - 42px)/4); height:40px; padding:4px; }
.mod-fx-chain .toy-button:not(:last-child)::after { content:''; position:absolute; right:-12px; top:18px; width:6px; height:6px; border-top:2px solid var(--border); border-right:2px solid var(--border); transform:rotate(45deg); }
.mod-fx-chain .ui-icon { width:34px; height:34px; }
.mod-fx-move { display:flex; justify-content:center; gap:10px; margin-top:9px; }
.mod-fx-move .icon-action { width:28px; height:25px; }
.mod-fx-move .ui-icon { width:19px; height:19px; }
.mod-tools { margin:0; gap:12px; }
.mod-tools .icon-action { width:32px; height:32px; }
@container (max-width:1050px) {
  .transport-panel .module-button { font-size:10px; gap:2px; }
  .transport-panel .module-button .ui-icon { width:22px; height:22px; }
  .effect-panel [data-fx-heading] { font-size:12px; gap:4px; }
  #panel-modular { gap:5px; }
  .mod-parts .toy-button { height:46px; }
  .mod-parts .ui-icon { width:24px; height:24px; }
  .mod-shaping .settings-group { padding:3px 6px 6px; gap:4px; }
  .mod-effects { padding:4px 7px 6px; }
  .mod-fx-chain .toy-button { height:39px; }
  .mod-fx-chain .ui-icon { width:29px; height:29px; }
  .mod-fx-move { margin-top:7px; }
}

.mod-parts .toy-button span { white-space:nowrap; }

/* Quiet settings groups; note tiles are unfolded only for editing a scale. */
#panel-devices .settings-group > legend { display:flex; align-items:center; gap:6px; }
#panel-devices .settings-group > legend .ui-icon { width:23px; height:23px; }
.scale-editor-tools { margin-bottom:0; }
.scale-editor-tools [data-scale-copy][aria-expanded=true] { background:var(--tool-active); border-color:var(--tool-ink); box-shadow:inset 0 1px 3px var(--control-shadow); }
.scale-note-grid { margin-top:10px; padding:6px 4px; border:1px solid var(--border); border-radius:12px; background:var(--inset); }
#activity-settings { margin-bottom:6px; }
.log-tools { display:flex; flex-wrap:nowrap; justify-content:center; align-items:center; gap:14px; margin:2px 0 4px; }
.log-tools .icon-action { flex:0 0 40px; width:40px; height:40px; }
.log-start { display:flex; }
.log-pause, .log-switch[aria-pressed=true] .log-start { display:none; }
.log-switch[aria-pressed=true] .log-pause { display:flex; }
.settings-utility-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.settings-utility-row > .settings-group { margin:14px 0 6px; padding:8px; }
.settings-utility-row .device-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
.settings-utility-row :is(.device-button,.log-tools .icon-action) { min-width:0; min-height:68px; height:68px; flex-direction:column; gap:4px; padding:4px; font-size:11px; line-height:1.2; text-align:center; }
.settings-utility-row .log-tools { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); min-height:68px; margin:0; gap:4px; }
.settings-utility-row .log-tools .icon-action { width:100%; }
.settings-utility-row .log-tools .ui-icon { width:27px; height:27px; }

/* Paired illustrated dropdowns keep settings compact without losing previews. */
.settings-choice-pair, .settings-appearance-row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.settings-choice-pair > div { min-width:0; }
.settings-appearance-row > .settings-group { margin:14px 0 4px; padding:8px; }
.settings-picker .picture-trigger { min-height:50px; gap:5px; padding:5px 7px; justify-content:space-between; }
[data-settings-selected] { display:flex; align-items:center; gap:6px; min-width:0; }
[data-settings-preview] { display:flex; align-items:center; gap:6px; min-width:0; }
.settings-choice-art { flex:0 0 34px; display:grid; place-items:center; }
.settings-choice-art > svg { width:34px; height:34px; max-width:100%; }
.settings-choice-art .settings-palette-art { width:40px; }
.settings-picker .choice-name { font:600 11px/1.2 var(--font-body); overflow-wrap:anywhere; text-align:left; }
.settings-picker .settings-chevron { flex:0 0 12px; width:12px; height:16px; }
.settings-picker .picture-options { grid-template-columns:minmax(0,1fr); padding:5px; gap:4px; }
.settings-picker .picture-option { flex-direction:row; justify-content:flex-start; min-height:44px; gap:7px; padding:4px 5px; }
.settings-picker:has(.picture-trigger[aria-expanded=true]) { z-index:35; }

.key-custom-surface { display:none; position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
:root[data-key-shape=custom] .key { background:transparent; border:0; border-radius:0; }
:root[data-key-shape=custom] .key .key-surface { display:none; }
:root[data-key-shape=custom] .key .key-custom-surface { display:block; }
.key-image-editor { width:min(640px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow:auto; padding:16px; }
.key-image-workspace { display:grid; grid-template-columns:minmax(0,1fr) 100px; gap:16px; width:100%; max-width:min(480px,calc(42dvh + 116px)); margin:12px auto; }
.key-image-crop { position:relative; aspect-ratio:1; overflow:hidden; border:2px solid var(--tool-border); border-radius:12px; background:repeating-conic-gradient(var(--inset) 0% 25%,var(--tool-surface) 0% 50%) 0 0 / 16px 16px; }
.key-image-crop canvas { display:block; width:100%; height:100%; touch-action:none; cursor:move; }
.key-image-crop canvas:focus-visible { outline:3px solid var(--focus); outline-offset:-4px; }
.key-image-grid { position:absolute; inset:0; pointer-events:none; background:linear-gradient(90deg,transparent 33%,#ffffff60 33%,#ffffff60 33.5%,transparent 33.5%,transparent 66%,#ffffff60 66%,#ffffff60 66.5%,transparent 66.5%),linear-gradient(transparent 33%,#ffffff60 33%,#ffffff60 33.5%,transparent 33.5%,transparent 66%,#ffffff60 66%,#ffffff60 66.5%,transparent 66.5%); }
.key-image-preview { display:flex; flex-direction:column; justify-content:space-around; align-items:center; gap:4px; padding:5px; border:1px solid var(--tool-border); border-radius:12px; background:var(--inset); min-height:0; }
.key-image-preview svg { display:block; width:100%; flex:1 1 0; min-height:0; max-height:90px; }
.key-image-controls { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.key-image-controls .range-row { display:grid; grid-template-columns:24px minmax(0,1fr); gap:5px; margin:0; font:12px var(--font-body); }
.key-image-controls .range-row > .ui-icon { grid-column:1; width:22px; height:22px; }
.key-image-controls input { grid-column:1 / -1; --control-color:var(--icon-c); }
.key-image-controls label:has(input:disabled) { opacity:.45; }
.key-image-status { min-height:1.2em; margin:6px 0; font:12px/1.3 var(--font-body); color:var(--text); }
.key-image-actions { display:flex; align-items:center; justify-content:center; gap:12px; }
.key-image-actions > button { display:flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:6px 12px; font-size:13px; }
.key-image-actions .recording-save { margin:0; }


.generator-title { display:flex; align-items:center; justify-content:center; gap:5px; }
.generator-title .ui-icon { width:24px; height:24px; }
[data-icon-character=bass] > use { transform:translateY(var(--bass-bounce,0px)); }

/* A small, playable kit workshop replaces the oscillator column for DM 808. */
.drum-kit-bank { height:100%; display:flex; flex-direction:column; justify-content:space-between; gap:5px; padding:2px; }
.drum-kit-bank .module-heading { margin:0 0 4px; }
.kit-pads { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
.kit-pads button { min-width:0; height:43px; padding:4px; }
.kit-pads .ui-icon { width:31px; height:31px; }
.kit-pads button[aria-pressed=true] { border-color:var(--icon-c); background:color-mix(in srgb,var(--icon-c) 22%,var(--panel)); }
.kit-pads button.is-playing { background:var(--drum-hit); box-shadow:inset 0 2px 2px var(--control-shadow); }
.kit-source { position:relative; }
.kit-source .drum-choice-trigger { min-height:48px; padding:4px 8px; }
.kit-source .drum-choice-value { justify-content:center; gap:10px; }
.kit-source-label { display:flex; flex-direction:column; gap:3px; }
[data-kit-voice-name] { font-size:10px; font-weight:400; }
[data-kit-source-art] { display:flex; align-items:center; }
[data-kit-source-art] .ui-icon { width:31px; height:31px; }
.kit-source .drum-choice-options { z-index:10; }
.kit-source.opens-up .drum-choice-options { inset:auto 0 calc(100% + 5px); }
.kit-source .drum-choice-option { gap:5px; min-height:43px; padding:4px; }
.kit-source .drum-choice-option > .ui-icon { width:27px; height:27px; flex-shrink:0; }
.kit-preview { align-self:center; flex-shrink:0; }
.kit-preview > .ui-icon { width:28px; height:28px; }
.kit-preview.is-playing { background:var(--drum-hit); box-shadow:inset 0 2px 2px var(--control-shadow); }
.kit-dials { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.kit-dial { --control-color:var(--envelope-sustain); gap:5px; }
.kit-dial:nth-child(2) { --control-color:var(--envelope-release); }
.kit-dial > span:first-child { display:flex; align-items:center; justify-content:center; gap:4px; font-size:11px; }
.kit-dial > span:first-child .ui-icon { width:19px; height:19px; }
.kit-dial .dial { max-width:60px; }
.kit-volume { grid-template-columns:27px minmax(0,1fr) 23px; margin:0; }
.kit-volume input[type=range] { width:100%; --control-color:var(--fader-output); }
.kit-edit-tools { display:flex; align-items:center; justify-content:center; gap:14px; padding-top:7px; border-top:1px solid var(--control-border); }
.kit-edit-tools strong { display:flex; align-items:center; gap:5px; font-size:12px; font-weight:600; }
.drum-kit-bank[data-custom=true] .kit-edit-tools strong { color:var(--heading-ink); }
.fitted-instrument .drum-kit-bank { gap:4px; }
.fitted-instrument .kit-pads { gap:5px; }
.fitted-instrument .kit-pads button { height:36px; }
.fitted-instrument .kit-dial .dial { max-width:54px; }
.fitted-instrument .effect-panel .range-row > .ui-icon { width:25px; height:25px; }
.fitted-instrument .effect-panel .range-row input[type=range] { height:24px; }
.mixer-strip[aria-disabled=true] { opacity:.45; }

/* Sound design has its own rose/copper palette, apart from timing and FX. */
:root { --eq-colour:#a85f83; --filter-frequency:#c28b62; --filter-resonance:#899653; --lfo-speed:#a880af; --lfo-depth:#799aaa; }
#panel-sound > h2 { margin-top:8px; }
#panel-sound > .module-tabs { margin:8px 0 10px; }
#panel-sound .module-tab { flex-direction:row; padding:6px 3px; }
.design-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.design-toolbar .picture-choice { width:142px; max-width:calc(100% - 108px); flex:none; }
.design-toolbar .picture-trigger { width:100%; min-height:42px; height:42px; padding:3px 9px; }
.design-toolbar .sound-art { width:34px; height:26px; }
.design-toolbar .picture-options { grid-template-columns:1fr; }
.design-toolbar .tilt-control,.design-toolbar .design-power { width:42px; height:42px; padding:7px; flex:none; }
.design-toolbar .tilt-control .ui-icon,.design-toolbar .design-power .ui-icon { width:26px; height:26px; }
.design-toolbar .eq-band-choice { width:94px; }
.eq-band-choice .picture-options { grid-template-columns:repeat(3,1fr); width:180px; left:50%; transform:translateX(-50%); }
.eq-band-choice .picture-option { flex-direction:column; padding:8px 2px; }
.eq-sliders { display:grid; grid-template-columns:repeat(var(--eq-bands,3),minmax(0,1fr)); gap:8px; padding:8px 12px 9px; border:1px solid var(--tool-border); border-radius:20px; background:color-mix(in srgb,var(--eq-colour) 8%,var(--panel)); }
.eq-band { display:flex; align-items:center; flex-direction:column; gap:4px; min-width:0; color:var(--eq-colour); }
.eq-fader { position:relative; display:block; width:34px; height:98px; }
.eq-band input[type=range] { --range-thumb-size:25px; writing-mode:vertical-lr; direction:rtl; appearance:none; -webkit-appearance:none; width:34px; height:98px; margin:0; background:transparent; cursor:pointer; }
.eq-band input::-webkit-slider-runnable-track { width:10px; border-radius:12px; background:linear-gradient(to top,var(--eq-colour) var(--fill),var(--fader-track) var(--fill)); box-shadow:inset 1px 0 2px #0002; }
.eq-band input::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:25px; height:25px; margin-left:-7.5px; border:3px solid var(--fader-rim); border-radius:50%; background:var(--eq-colour); box-shadow:0 0 0 1px color-mix(in srgb,var(--eq-colour),black 15%),0 2px 2px #0003; }
.eq-band input::-moz-range-track { width:10px; border-radius:12px; background:var(--fader-track); }
.eq-band input::-moz-range-thumb { width:19px; height:19px; border:3px solid var(--fader-rim); border-radius:50%; background:var(--eq-colour); box-shadow:0 2px 2px #0003; }
.eq-zero { position:absolute; left:2px; right:2px; top:50%; height:1px; background:var(--tool-border); z-index:-1; pointer-events:none; }
.eq-frequency,.eq-gain { font-size:11px; line-height:17px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.eq-frequency { color:var(--text); }
.eq-gain { font-weight:700; color:var(--eq-colour); }
.eq-presets { display:flex; align-items:center; justify-content:center; gap:10px; margin-top:10px; padding-bottom:5px; }
.eq-presets .button { width:70px; height:63px; padding:3px 5px; flex-direction:column; gap:1px; font-size:10px; line-height:12px; }
.eq-presets .eq-preset-art { width:40px; height:40px; flex:none; }
.design-dials { display:flex; align-items:center; justify-content:center; gap:clamp(20px,5cqw,60px); }
.design-dial { gap:6px; width:88px; }
.design-dial .dial { width:64px; height:64px; flex:none; }
.design-dial .dial i { width:4px; left:calc(50% - 2px); background:var(--art-ink); }
.design-dial .dial::after { background:var(--art-ink); width:10px; height:10px; left:calc(50% - 5px); top:calc(50% - 5px); }
.design-dial-label { font-size:12px; color:var(--text); }
#panel-sound .filter-sea { height:138px; margin:0 0 12px; background:color-mix(in srgb,var(--filter-frequency) 5%,var(--panel)); }
.filter-water { width:100%; height:100%; position:absolute; inset:0; pointer-events:none; }
[data-filter-fill] { fill:color-mix(in srgb,var(--icon-a) 30%,var(--panel)); }
[data-filter-wave] { stroke:var(--icon-a); stroke-width:3; stroke-linecap:round; }
.filter-ripples { fill:none; stroke:var(--icon-a); opacity:.45; stroke-width:2; }
.filter-surfer { position:absolute; width:46px; height:46px; transform:translate(-50%,-88%); pointer-events:none; }
.filter-surfer > .ui-icon { width:100%; height:100%; }
.icon-eyes { opacity:var(--wave-awake,1); }
.icon-pupils { transform:translate(var(--gaze-x,0px),var(--gaze-y,0px)); }
.lfo-toolbar { gap:10px; }
.lfo-wave-choice .wave-art { width:44px; height:36px; flex:none; padding:0; }
.lfo-wave-choice [data-picture-preview]:not([hidden]) { display:flex; align-items:center; justify-content:center; gap:5px; }
.lfo-wave-choice .picture-option { min-height:48px; padding:4px 10px; }
.design-power[aria-pressed=false] .ui-icon { opacity:.5; filter:grayscale(1); }
.is-bypassed .eq-sliders,.is-bypassed .filter-sea { opacity:.55; }
.is-bypassed .filter-dials .dial { filter:saturate(.35); }
.lfo-toolbar .picture-trigger { gap:7px; padding-inline:8px; }
.lfo-playground { height:138px; margin:0 0 12px; overflow:hidden; border:1px solid var(--tool-border); border-radius:20px; background:color-mix(in srgb,var(--lfo-speed) 5%,var(--panel)); }
.lfo-track { display:block; width:100%; height:100%; overflow:visible; }
.lfo-centre { fill:none; stroke:var(--tool-border); stroke-width:1; stroke-dasharray:3 7; }
[data-lfo-line] { fill:none; stroke:var(--lfo-speed); stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
[data-lfo-fill] { fill:color-mix(in srgb,var(--lfo-speed) 12%,transparent); }
.lfo-playground:not(.is-enabled) [data-lfo-line] { stroke:var(--tool-border); }
.lfo-playground:not(.is-enabled) [data-lfo-fill] { opacity:.35; }
.lfo-dials .dial { width:64px; height:64px; }
.fitted-instrument .lfo-playground { height:130px; }
@media (max-width:1100px) { .eq-sliders { gap:2px; padding-inline:4px; } .eq-fader,.eq-band input[type=range] { width:28px; } }
.fitted-instrument .eq-fader,.fitted-instrument .eq-band input[type=range] { height:84px; }
.fitted-instrument #panel-sound .filter-sea { height:130px; }
.fitted-instrument .design-dial .dial { width:58px; height:58px; }

.face-harmony-controls { display:flex; justify-content:center; align-items:center; gap:10px; }
.face-harmony-controls .button { width:auto; min-width:100px; height:36px; min-height:36px; white-space:nowrap; padding:4px 12px; gap:7px; font-size:11px; }
.face-harmony-controls .ui-icon { width:24px; height:24px; }
.face-harmony-controls .button[aria-pressed=false] > .ui-icon { opacity:.45; filter:grayscale(1); }
[data-tracking-stage=camera][data-expression=major] { background:color-mix(in srgb,var(--icon-b) 13%,var(--panel)); }
[data-tracking-stage=camera][data-expression=minor] { background:color-mix(in srgb,var(--envelope-sustain) 12%,var(--panel)); }
[data-tracking-stage=camera][data-expression=augmented] { background:color-mix(in srgb,var(--icon-c) 13%,var(--panel)); }
[data-tracking-stage=camera][data-expression=diminished] { background:color-mix(in srgb,var(--fader-accent) 9%,var(--panel)); }

/* Eyes: play gate, paired directions, then independent eyelids. */
.gaze-assignments,.face-assignments { grid-template-columns:1fr; }
.gaze-assignments .tracking-source,.face-assignments .tracking-source { padding-top:4px; }
.gaze-directions,.gaze-eye-controls,.face-directions,.face-gestures { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.gaze-eye-controls { margin-top:4px; padding-top:4px; border-top:1px solid var(--tool-border); }
.tracking-eye-title { display:block; text-align:center; font-size:11px; line-height:14px; color:var(--text-secondary); }
.tracking-eye-field[data-eye-open=true] .tracking-assignment > .ui-icon { color:var(--icon-a); }
.tracking-eye-field[data-eye-open=false] .tracking-assignment > .ui-icon { opacity:.55; }

/* Learning levels remove unavailable controls from layout and keyboard focus. */
.level-unavailable { display: none !important; }
.oscillator-heading.two-oscillators { grid-template-columns: minmax(0,1fr); }
[data-active-level=simple] .osc-face { grid-template-columns: 25px minmax(0,1fr); }
.learning-level-settings legend svg { width: 28px; height: 24px; }
.learning-level-choices { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.learning-level-choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; padding: 6px 3px; border-radius: 14px; font: 650 12px var(--font-body); }
.learning-level-choice > .ui-icon { width: 48px; max-width: 100%; height: 48px; }
[data-active-level=simple] .left-bottom, [data-active-level=explore] .left-bottom { grid-template-columns: minmax(0,1fr); }
.learning-level-choice[aria-pressed=true] { background: color-mix(in srgb,var(--icon-a) 20%,var(--tool-surface)); border-color: var(--tool-ink); box-shadow: inset 0 0 0 1px var(--tool-ink), 0 3px 0 var(--tool-border); }
[data-stereo=false] .osc-top { grid-template-columns: 48px minmax(0,1fr); }
[data-stereo=false] .noise-card { grid-template-columns: 48px 26px minmax(0,1fr); }
[data-stereo=false] .osc-editor-heading { grid-template-columns: 42px max-content minmax(36px,1fr); }
.drum-kit-bank[data-editable=false] { justify-content: space-evenly; gap: 12px; }
.drum-kit-bank[data-editable=false] .kit-pads { grid-template-columns: repeat(2,minmax(0,1fr)); }
.drum-kit-bank[data-editable=false] .kit-pads button { height: 54px; }
.drum-kit-bank[data-editable=false] .kit-source .drum-choice-trigger:disabled { opacity: 1; cursor: default; border-color: transparent; background: transparent; box-shadow: none; }
