/* Shared performance policy. Text fields and explanatory dialogs retain editing. */
[data-performance-root] {
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: pan-x pan-y; overscroll-behavior: contain;
}
[data-performance-root] button { touch-action: none; }
[data-performance-root] :is(input:not([type=range]):not([type=checkbox]):not([type=radio]), textarea, [contenteditable]:not([contenteditable=false]), [data-allow-selection]) {
  user-select: text; -webkit-user-select: text; -webkit-touch-callout: default;
}
#studioRoot[hidden] { display: none !important; }
:root[data-view=studio], :root[data-view=studio] body { margin: 0; height: 100%; overflow: hidden; background: #303633; }
:root[data-view=studio] main { margin: 0; padding: max(4px, env(safe-area-inset-top)) max(4px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); max-width: none; width: 100%; height: 100dvh; min-height: 0; overflow: hidden; box-sizing: border-box; }
:root[data-view=studio] #studioRoot { width: 100%; height: 100%; }
:root[data-view=studio] main > :not(#studioRoot) { display: none !important; }
:root[data-view=studio] dialog { color: var(--text); }
.st-console, .st-popover {
  --st-paper: #eaeae3; --st-panel: #f7f7f0; --st-field: #e5e6df; --st-line: #c9cdc3;
  --st-ink: #24322d; --st-muted: #5a675e; --st-accent: #b0442c; --st-accent-soft: #f5e8dd;
  --st-accent-ink: #fffaf3; --st-screen: #172d28; --st-light: #a9dbc3; --st-fx: #78bca4;
  color: var(--st-ink); font: 14px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-variant-numeric: tabular-nums;
}
:root:is([data-theme=cobalt], [data-theme=violet]) :is(.st-console, .st-popover) {
  --st-paper: #202a36; --st-panel: #293646; --st-field: #1c2632; --st-line: #4b5b6a;
  --st-ink: #ecf0ed; --st-muted: #b4c1c7; --st-accent: #97cced; --st-accent-soft: #314c60;
  --st-accent-ink: #122732; --st-screen: #10252d; --st-light: #c3eee4; --st-fx: #9bdbed;
}
:root[data-theme=violet] :is(.st-console, .st-popover) {
  --st-paper: #302c3c; --st-panel: #3c354b; --st-field: #282333; --st-line: #655870;
  --st-accent: #d1b3ed; --st-accent-soft: #534266; --st-screen: #241e32; --st-fx: #c6aadf;
}
:root[data-theme=daylight] :is(.st-console, .st-popover) { --st-paper: #f1f2ed; --st-panel: #fff; --st-field: #e9ede9; --st-accent: #b53739; }
:root[data-theme=mint] :is(.st-console, .st-popover) { --st-paper: #d9e6d9; --st-panel: #ebf1e7; --st-field: #dbe5d7; --st-accent: #357361; --st-accent-soft: #c7dfcd; }
/* One fitted desk. Only choice lists and existing dialogs float above it. */
.st-console { --desk-scale: 1; background: var(--st-paper); border: 1px solid #ffffff52; border-inline: 4px solid var(--st-accent); border-radius: 8px; box-shadow: inset 0 1px #fff7; }
.st-console *, .st-popover * { box-sizing: border-box; min-width: 0; }
.st-desk { display: grid; grid-template-rows: 46px minmax(244px, 1fr) minmax(416px, 1.7fr) minmax(188px, .7fr) 96px 30px; gap: 6px; padding: 8px; width: 100%; height: 100%; zoom: var(--desk-scale); }
.st-desk[data-expanded=true] { grid-template-rows: 46px minmax(484px, 1.7fr) minmax(416px, 1.7fr) minmax(188px, .7fr) 96px 30px; }
.st-desk > *, .st-rack > *, .st-bottom > *, .st-section > * { min-height: 0; }
.st-rack { display: grid; grid-template-columns: minmax(235px, .85fr) minmax(0, 3.6fr) minmax(235px, .85fr); gap: 6px; }
.st-bottom { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 6px; }
.st-section { display: grid; grid-template-rows: 20px minmax(0, 1fr); gap: 4px; }
.st-section-heading { display: flex; align-items: center; gap: 10px; }
.st-section-heading > div { display: flex; align-items: center; gap: 10px; }
.st-section-heading > .st-quiet { margin-left: auto; text-align: right; }
.st-section-heading > .st-button { min-height: 20px; padding: 2px 8px; }
.st-console h2, .st-console h3 { color: var(--st-ink); font-size: 13px; line-height: 1.1; letter-spacing: -.2px; margin: 0; }
.st-console h2 > span { color: var(--st-accent); }
.st-section-label { font: 9px/1.2 ui-monospace, monospace; letter-spacing: .8px; font-weight: 600; color: var(--st-muted); }
.st-section-label b { color: var(--st-accent); margin-left: 4px; }
.st-quiet { color: var(--st-muted); font-size: 10px; margin: 0; line-height: 1.3; }
.st-module { padding: 6px; border: 1px solid var(--st-line); border-radius: 6px; background: var(--st-panel); box-shadow: 0 2px 4px #00000004; }
.st-module-heading { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.st-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Shared controls. Menus keep screen-sized targets even when the desk fits down. */
.st-console :is(button, input, select), .st-popover :is(button, input) { font: inherit; }
.st-console button { min-height: 24px; border-radius: 4px; white-space: nowrap; font-size: 11px; line-height: 1.15; }
.st-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 3px 7px; border: 1px solid var(--st-line); background: var(--st-panel); color: var(--st-ink); font-weight: 600; box-shadow: 0 1px 1px #0000000b, inset 0 1px #ffffff36; }
.st-console .st-button:hover:not(:disabled) { border-color: var(--st-muted); background: var(--st-field); }
.st-console .st-button[aria-pressed=true] { color: var(--st-accent); border-color: var(--st-accent); background: var(--st-accent-soft); }
.st-console button:disabled { opacity: .46; cursor: default; color: var(--st-muted); }
.st-console button:active:not(:disabled) { transform: translateY(1px); }
.st-console :is(button, input):focus-visible, .st-play-surface:focus-visible, .st-xy:focus-visible, .st-choice-trigger[data-focus-visible], .st-option[data-focus-visible] { outline: 2px solid var(--st-accent); outline-offset: 1px; }
.st-console .st-text-button { background: transparent; border-color: transparent; box-shadow: none; }
.st-console .st-text-button:hover:not(:disabled) { background: var(--st-field); border-color: transparent; }
.st-icon { width: 15px; height: 15px; flex: none; }
.st-state { display: inline-flex; align-items: center; gap: 4px; color: var(--st-muted); font-size: 9px; white-space: nowrap; }
.st-state i, .st-led { width: 5px; height: 5px; flex: none; border-radius: 50%; background: var(--st-muted); display: inline-block; }
.st-state[data-state=recording] { color: #b52f29; }
.st-state[data-state=recording] i { background: #d44138; box-shadow: 0 0 0 3px #d4413818; }
.st-state:is([data-state=armed], [data-state=overdub], [data-state=replacing]) i { background: #c1841b; }
.st-state[data-state=playing] i { background: #438a70; }
.st-led { background: var(--st-line); }
[aria-pressed=true] .st-led { background: var(--st-accent); }
.st-field-label { font: 9px/1.2 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--st-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-choice { display: flex; flex-direction: column; gap: 2px; }
.st-console .st-choice-trigger { display: flex; align-items: center; justify-content: space-between; gap: 5px; width: 100%; min-height: 22px; padding: 3px 6px; color: var(--st-ink); background: var(--st-field); border: 1px solid var(--st-line); text-align: left; font-size: 11px; }
.st-choice-trigger > :first-child { overflow: hidden; text-overflow: ellipsis; }
.st-choice-trigger > :last-child { color: var(--st-accent); }
.st-choice-trigger[aria-expanded=true] { border-color: var(--st-accent); }
.st-popover { z-index: 100; width: max(var(--trigger-width), 240px); max-width: calc(100vw - 24px); max-height: min(380px, 65dvh); overflow: auto; background: var(--st-panel); border: 1px solid var(--st-line); border-radius: 10px; padding: 6px; box-shadow: 0 14px 40px #0003; overscroll-behavior: contain; }
.st-options { outline: none; }
.st-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; padding: 11px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; touch-action: pan-y; }
.st-option[data-focused] { background: var(--st-field); }
.st-option[data-selected] { background: var(--st-accent-soft); color: var(--st-accent); font-weight: 600; }
.st-option[data-disabled] { opacity: .4; cursor: default; }
.st-option-check { visibility: hidden; }
.st-option[data-selected] .st-option-check { visibility: visible; }
.st-fader { position: relative; display: grid; grid-template-columns: 1fr auto; grid-template-rows: 11px 20px; gap: 0 6px; color: var(--st-ink); align-items: center; }
.st-fader output { font: 9px/1.2 ui-monospace, monospace; }
.st-fader input[type=range] { grid-column: 1/-1; width: 100%; min-width: 0; min-height: 20px; height: 20px; margin: 0; padding: 0; appearance: none; -webkit-appearance: none; background: transparent; border: 0; touch-action: none; }
.st-fader input::-webkit-slider-runnable-track { height: 4px; border-radius: 3px; background: linear-gradient(to right, var(--st-accent) var(--fill), var(--st-field) var(--fill)); box-shadow: inset 0 1px 2px #0002; }
.st-fader input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 16px; height: 19px; margin-top: -7.5px; border-radius: 3px; border: 1px solid var(--st-muted); background: linear-gradient(to bottom, var(--st-panel), var(--st-paper) 42%, var(--st-muted) 44%, var(--st-muted) 48%, var(--st-paper) 51%); box-shadow: 0 1px 2px #0002; }
.st-fader input::-moz-range-track { height: 4px; border-radius: 3px; background: var(--st-field); }
.st-fader input::-moz-range-progress { height: 4px; border-radius: 3px; background: var(--st-accent); }
.st-fader input::-moz-range-thumb { width: 16px; height: 18px; border-radius: 3px; border: 1px solid var(--st-muted); background: var(--st-paper); }
.st-number { display: flex; flex-direction: column; gap: 2px; }
.st-number input { color: var(--st-ink); background: var(--st-field); border: 1px solid var(--st-line); border-radius: 4px; padding: 3px 5px; min-height: 22px; width: 100%; }
.st-console .st-hold { display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--st-ink); border: 1px solid var(--st-line); background: var(--st-paper); padding: 2px; box-shadow: inset 0 1px #ffffff40, inset 0 -2px #00000009; touch-action: none; user-select: none; -webkit-user-select: none; }
.st-hold strong { font: 12px/1.1 ui-monospace, monospace; }
.st-console .st-hold[aria-pressed=true] { background: var(--st-accent); color: var(--st-accent-ink); border-color: var(--st-accent); box-shadow: inset 0 2px 3px #0002; }
.st-console kbd { font: 8px/1.3 ui-monospace, monospace; color: var(--st-muted); margin: 0; }
.st-hold[aria-pressed=true] kbd { color: inherit; }

/* Transport and output are permanent edges of the instrument. */
.st-header { display: flex; align-items: center; gap: 18px; padding-bottom: 5px; border-bottom: 1px solid var(--st-line); position: relative; }
.st-brand { font-size: 25px; letter-spacing: -1.5px; line-height: 1; font-weight: 850; white-space: nowrap; }
.st-brand > span { color: var(--st-accent); padding: 0 3px; }
.st-brand small { display: block; font: 8px/1.2 ui-monospace, monospace; letter-spacing: 2.5px; margin-top: 3px; color: var(--st-muted); }
.st-transport { display: flex; align-items: stretch; gap: 6px; height: 36px; flex: none; }
.st-transport .st-button { padding-inline: 12px; font-size: 12px; }
.st-console .st-capture { color: var(--st-accent-ink); background: var(--st-accent); border-color: var(--st-accent); }
.st-console .st-capture:hover:not(:disabled) { background: var(--st-accent); }
.st-capture > span { opacity: .7; font: 10px ui-monospace, monospace; }
.st-console .st-tempo { background: var(--st-screen); border-color: var(--st-screen); color: var(--st-light); padding: 3px 12px; gap: 8px; box-shadow: inset 0 2px 5px #0004; }
.st-console .st-tempo:hover { background: var(--st-screen) !important; }
.st-tempo strong { font: 25px/1 ui-monospace, monospace; letter-spacing: -1px; }
.st-tempo > span { font: 8px/1.3 ui-monospace, monospace; text-align: left; }
.st-tempo small { display: block; font-size: 7px; opacity: .7; }
.st-record-destination { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.2fr); gap: 10px; flex: 1; }
.st-topbar { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.st-topbar .st-button { min-height: 32px; padding-inline: 10px; }
.st-fullscreen > span:first-child { font-size: 19px; }
.st-learning { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: var(--st-accent-soft); color: var(--st-ink); border: 1px solid var(--st-accent); box-shadow: 0 4px 15px #0002; }
.st-learning strong { margin-right: 12px; }
.st-console[data-learning=true] [data-control] { outline: 1px dashed var(--st-accent); outline-offset: 1px; cursor: crosshair; }
.st-console[data-learning=true] .learn-target { outline: 3px solid var(--st-accent); }
.st-footer { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--st-line); padding-top: 3px; }
.st-status { display: flex; align-items: center; gap: 10px; flex: 1; }
.st-status p { font-size: 10px; margin: 0; line-height: 1.2; color: var(--st-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-meter-label { display: flex; align-items: center; gap: 8px; flex: none; font: 8px ui-monospace, monospace; color: var(--st-muted); }
.st-meter { display: block; width: 48px; height: 5px; border-radius: 2px; background: var(--st-line); overflow: hidden; }
.st-meter > i { display: block; width: 100%; height: 100%; background: #54866c; transform: scaleX(var(--signal, 0)); transform-origin: left; }
.st-footer .st-fader, .st-channel > .st-fader { display: grid; grid-template-columns: auto minmax(20px, 1fr) 32px; grid-template-rows: 22px; gap: 5px; }
.st-footer .st-fader { width: 230px; flex: none; }
.st-footer .st-fader input, .st-channel > .st-fader input { grid-column: 2; grid-row: 1; }
.st-footer .st-fader output, .st-channel > .st-fader output { grid-column: 3; grid-row: 1; text-align: right; }
.st-output-meter { width: 30px; flex: none; }
.st-console .st-panic, .st-clear { color: var(--st-accent); }
.st-tape .st-icon { color: var(--st-accent); }
.st-tape[aria-pressed=true] { border-color: var(--st-accent); }

/* Every loop owns its complete controls; additional tracks use a second row. */
.st-loop-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 6px; }
.st-channel { display: grid; grid-template-columns: 88px minmax(0, 1fr); grid-template-rows: 24px minmax(74px, 1fr) 34px 48px 22px; gap: 3px 6px; }
.st-channel[data-selected=true] { border-color: var(--st-accent); box-shadow: inset 0 2px var(--st-accent); }
.st-channel > .st-module-heading { grid-column: 1; grid-row: 1; }
.st-console .st-channel-select { min-height: 24px; padding: 0 2px; background: transparent; border: 0; box-shadow: none; font: 19px ui-monospace, monospace; }
.st-channel-select > span { display: none; }
.st-channel .st-state { font-size: 8px; gap: 3px; overflow: hidden; text-overflow: ellipsis; }
.st-name { grid-column: 2; grid-row: 1; position: relative; }
.st-name input { width: 100%; height: 24px; padding: 2px 18px 2px 4px; min-height: 24px; border: 0; border-radius: 4px; color: var(--st-ink); background: transparent; font-size: 13px; font-weight: 650; }
.st-name > span:last-child { position: absolute; top: 4px; right: 3px; color: var(--st-muted); pointer-events: none; font-size: 11px; }
.st-record-row { display: contents; }
.st-console .st-record { grid-column: 1; grid-row: 2; width: 78px; height: 78px; align-self: center; justify-self: center; padding: 0; border-radius: 50%; border: 0; position: relative; background: transparent; box-shadow: none; touch-action: none; }
.st-console .st-record:hover:not(:disabled) { background: transparent; }
.st-record-ring { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-width: 4; transform: rotate(-90deg); }
.st-ring-track { stroke: var(--st-line); stroke-dasharray: 1 7; }
.st-ring-progress { stroke: var(--st-accent); stroke-dasharray: 464.96; stroke-dashoffset: 464.96; stroke-linecap: round; }
.st-record-face { position: absolute; inset: 11px; border-radius: 50%; border: 1px solid #acb1a8; background: radial-gradient(ellipse at 50% 5%, #ffffffc2, transparent 70%), var(--st-paper); box-shadow: inset 0 -2px 3px #0000000c, 0 3px 5px #00000012; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.st-record-face .st-icon { width: 11px; height: 11px; color: var(--st-accent); }
.st-record-face strong { font-size: 9px; color: var(--st-ink); }
.st-record-face small { font: 7px/1.2 ui-monospace, monospace; color: var(--st-muted); }
.st-channel[data-mode=recording] .st-record-face { background: #b0442c; border-color: #a9382a; }
.st-channel[data-mode=recording] .st-record-face :is(strong, small, .st-icon) { color: #fff7ed; }
.st-track-actions { grid-column: 2; grid-row: 2; align-self: start; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.st-track-actions .st-button { min-height: 23px; padding: 2px; font-size: 10px; }
.st-track-actions > :first-child { grid-column: 1/-1; }
.st-track-actions .st-icon { width: 11px; height: 11px; }
.st-channel > .st-fader { grid-column: 2; grid-row: 2; align-self: end; }
.st-channel > .st-fader .st-field-label { font-size: 8px; }
.st-loop-routing { grid-column: 1/-1; grid-row: 3; display: grid; grid-template-columns: 1.2fr 1fr; gap: 6px; }
.st-chops { grid-column: 1/-1; grid-row: 4; display: grid; grid-template-columns: minmax(0, 1fr) 66px; grid-template-rows: 26px 16px; gap: 3px 5px; padding-top: 2px; border-top: 1px solid var(--st-line); }
.st-row-heading { display: none; }
.st-slice-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
.st-chops > .st-slice-grid { grid-column: 1; grid-row: 1; }
.st-chops > .st-pattern { grid-row: 2; }
.st-pattern .st-button { min-height: 16px; padding: 1px; background: var(--st-field); }
.st-pattern i { width: 12px; height: 3px; border-radius: 2px; background: var(--st-muted); }
.st-pattern span { display: none; }
.st-console .st-pattern .st-button[aria-pressed=true] { background: var(--st-panel); border-color: var(--st-line); }
.st-pattern .st-button[aria-pressed=true] i { background: var(--st-accent); }
.st-chop-mode { grid-column: 2; grid-row: 1/3; }
.st-segmented { display: grid; gap: 3px; }
.st-segmented .st-button { min-height: 21px; padding: 2px 3px; font-size: 9px; }
.st-channel-bottom { grid-column: 1/-1; grid-row: 5; display: flex; justify-content: space-between; gap: 4px; }
.st-channel-bottom .st-button { min-height: 22px; padding: 2px 7px; font-size: 10px; }

/* Four touch voices retain every shaping control immediately below the pad. */
#studioSynths { grid-template-rows: 20px 63px minmax(246px, 1fr) 70px; }
.st-synth-global, .st-synth-shared { border: 0; padding: 0 2px; background: transparent; box-shadow: none; }
.st-harmony-settings { display: grid; grid-template-columns: 1.5fr .5fr 1.1fr 1.2fr .8fr; gap: 8px; }
.st-harmony-bar { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.st-chords { display: flex; gap: 3px; flex: 1; min-width: 0; overflow-x: auto; }
.st-chords .st-button { flex: 1; min-width: 28px; }
.st-harmony-bar .st-button { min-height: 23px; font-size: 10px; }
.st-check { display: flex; align-items: center; gap: 4px; margin-left: auto; font-size: 9px; color: var(--st-muted); white-space: nowrap; }
.st-check input { width: 15px; height: 15px; min-height: 15px; margin: 0; accent-color: var(--st-accent); }
.st-synth-global > p { display: none; }
.st-synth-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.st-synth { display: grid; position: relative; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: 23px minmax(75px, 1fr) 24px repeat(3, 29px); gap: 3px 4px; }
.st-synth[data-selected=true] { border-color: var(--st-accent); }
.st-synth > .st-module-heading { grid-column: 1/3; grid-row: 1; }
.st-synth .st-module-heading .st-section-label { font-size: 0; }
.st-synth .st-section-label b { font-size: 13px; margin: 0; }
.st-console .st-destination { font-size: 8px; padding: 2px; min-height: 22px; }
.st-synth > .st-choice { grid-column: 3/7; grid-row: 1; }
.st-synth > .st-choice > .st-field-label { display: none; }
.st-synth .st-choice-trigger { font-size: 10px; min-height: 20px; padding: 2px 4px; }
.st-synth-note { position: absolute; top: 35px; left: 12px; right: 12px; z-index: 1; display: flex; justify-content: space-between; gap: 5px; pointer-events: none; font: 7px/1.2 ui-monospace, monospace; color: var(--st-light); }
.st-synth-note > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.st-play-surface { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; border-radius: 4px; overflow: hidden; }
.st-play-surface[aria-disabled=true] { opacity: .5; cursor: default; }
.st-synth-surface { grid-column: 1/-1; grid-row: 2; background: var(--st-screen); color: var(--st-light); box-shadow: inset 0 2px 8px #0005; }
.st-note-columns { position: absolute; inset: 0; display: flex; pointer-events: none; }
.st-note-columns > span { flex: 1; border-right: 1px solid #b3dacb18; display: flex; justify-content: center; align-items: flex-end; padding-bottom: 5px; }
.st-note-columns > span[data-chord=true] { background: #b5debb16; }
.st-note-columns > span[data-sounding=true] { background: #94d2af65; box-shadow: inset 0 0 12px #abdcbc33; }
.st-note-columns small { font: 7px ui-monospace, monospace; color: #cee8d5; }
.st-free-strips { position: absolute; inset: 0; pointer-events: none; }
.st-free-strips > span { position: absolute; left: 0; width: 100%; border-block: 1px solid #bbdf9866; background: #a0c98424; color: #d4edbc; font: 6px ui-monospace, monospace; letter-spacing: 1px; padding: 2px 5px; }
.st-free-indicator { position: absolute; top: 18px; left: 8px; background: var(--st-screen); color: #dbedbf; font: 8px ui-monospace, monospace; }
.st-fingers { position: absolute; inset: 0; pointer-events: none; }
.st-finger { position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #d6efdf; background: #add0b530; box-shadow: 0 0 0 6px #cce8d520, 0 0 20px #accfb650; transform: translate(-50%,-50%); }
.st-synth-switches { grid-column: 1/4; grid-row: 3; display: flex; gap: 3px; }
.st-synth-switches .st-button { flex: 1; min-height: 22px; font-size: 9px; padding: 2px; }
.st-synth > .st-fader { grid-column: 4/7; grid-row: 3; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 22px; gap: 4px; }
.st-synth > .st-fader .st-field-label { display: none; }
.st-synth > .st-fader input { grid-column: 1; grid-row: 1; }
.st-synth > .st-fader output { grid-column: 2; grid-row: 1; }
.st-synth-settings { display: contents; }
.st-synth-settings .st-choice { grid-column: span 2; gap: 1px; }
.st-synth-settings .st-field-label { font-size: 8px; }
.st-synth-settings .st-choice:nth-of-type(-n+3) { grid-row: 4; }
.st-synth-settings .st-choice:nth-of-type(n+4):nth-of-type(-n+6) { grid-row: 5; }
.st-synth-settings .st-choice:nth-of-type(n+7) { grid-row: 6; }
.st-synth-settings .st-choice:nth-of-type(3n+1) { grid-column: 1/3; }
.st-synth-settings .st-choice:nth-of-type(3n+2) { grid-column: 3/5; }
.st-synth-settings .st-choice:nth-of-type(3n) { grid-column: 5/7; }
.st-synth-tools { grid-row: 6; grid-column: 5/7; display: flex; gap: 2px; align-self: end; }
.st-synth-tools .st-button { flex: 1; min-height: 20px; padding: 1px; font-size: 14px; }
.st-synth-shared { display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: 31px 34px; gap: 4px 8px; }
.st-shared-levels { grid-column: 1/-1; display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 18px; align-items: end; }
.st-shared-levels .st-hold { min-height: 25px; margin-bottom: 2px; }
.st-strips-heading { display: flex; align-items: center; gap: 3px; }
.st-strips-heading > div { flex: 1; }
.st-strips-heading p { display: none; }
.st-strips-heading .st-section-label { font-size: 8px; }
.st-strips-heading .st-button { min-height: 24px; font-size: 9px; padding: 2px 4px; }
.st-strip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.st-strip-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.st-strip-controls > .st-section-label { display: none; }
.st-strip-controls .st-fader { grid-template-rows: 11px 20px; }
.st-strip-controls .st-field-label, .st-strip-controls output { font-size: 8px; }

/* Input processors flank the synths on the left; playback processors on the right. */
.st-effects-grid { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 6px; }
.st-effects { display: grid; grid-template-rows: 17px 24px 20px minmax(54px, 1fr) 33px; gap: 3px; }
.st-effects .st-module-heading .st-button { min-height: 17px; padding: 0 3px; font-size: 9px; }
.st-fx-selectors > .st-choice > .st-field-label { display: none; }
.st-fx-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.st-fx-presets .st-button { min-height: 20px; padding: 1px 3px; font-size: 9px; }
.st-pad-frame { padding: 3px; border-radius: 6px; border: 1px solid var(--st-line); background: var(--st-field); box-shadow: inset 0 2px 3px #0001; min-height: 0; }
.st-xy { height: 100%; position: relative; overflow: hidden; border-radius: 3px; color: var(--st-light); background: repeating-linear-gradient(0deg, transparent 0 27px, #9bc7ad12 28px 29px), repeating-linear-gradient(90deg, transparent 0 27px, #9bc7ad12 28px 29px), radial-gradient(ellipse at 50% 0, #4866564a, transparent 85%), var(--st-screen); box-shadow: inset 0 3px 12px #0004; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.st-xy[data-active=true] { background: radial-gradient(circle at var(--x) var(--y), #a5edc32e, transparent 48%), repeating-linear-gradient(0deg, transparent 0 27px, #9bc7ad12 28px 29px), repeating-linear-gradient(90deg, transparent 0 27px, #9bc7ad12 28px 29px), var(--st-screen); }
.st-xy[data-bypassed=true] { opacity: .6; }
.st-pad-axis { position: absolute; z-index: 1; font: 7px/1.3 ui-monospace, monospace; color: #b9d1be; pointer-events: none; }
.st-pad-axis-x { bottom: 6px; right: 7px; }
.st-pad-axis-y { top: 6px; left: 7px; }
.st-pad-axis > span { padding-left: 4px; color: var(--st-fx); }
.st-pad-reticle { position: absolute; inset: 0; opacity: .6; pointer-events: none; }
.st-pad-reticle i:first-child { position: absolute; left: var(--x); top: 0; height: 100%; border-left: 1px dashed #9bd3b234; }
.st-pad-reticle i:last-child { position: absolute; top: var(--y); left: 0; width: 100%; border-top: 1px dashed #9bd3b234; }
.st-pad-puck, .st-pad-orbit { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; }
.st-pad-puck { width: 11px; height: 11px; border: 2px solid var(--st-fx); background: var(--st-fx); box-shadow: 0 0 0 5px #9bd3b215; }
.st-pad-orbit { width: 42px; height: 42px; border: 1px solid #9bd3b235; }
.st-xy[data-active=true] .st-pad-puck { background: #d2f9d9; box-shadow: 0 0 0 6px #9bd3b226, 0 0 24px #9bd3b270; }
.st-pad-center { position: absolute; top: 68%; left: 0; right: 0; text-align: center; font: 7px/1.2 ui-monospace, monospace; letter-spacing: 1px; color: #a9c7b09c; pointer-events: none; }
.st-pad-coordinates { position: absolute; right: 7px; top: 6px; font: 7px/1.3 ui-monospace, monospace; color: #a9c7b0aa; pointer-events: none; }
.st-fx-controls { display: grid; grid-template-columns: minmax(0, 1fr) 103px; align-items: end; gap: 8px; }
.st-toggle-pair { display: flex; gap: 3px; padding-bottom: 3px; }
.st-toggle-pair .st-button { flex: 1; font-size: 9px; padding: 2px 4px; }
.st-fx-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.st-effects[data-enabled=false] .st-pad-frame { opacity: .4; }

/* The complete beat editor and manual instruments share the bottom playing row. */
.st-beat-layout { display: grid; grid-template-columns: minmax(0, 3.3fr) minmax(180px, 1fr); gap: 6px; }
.st-beat-pattern { display: grid; grid-template-columns: 215px minmax(0, 1fr); grid-template-rows: 27px minmax(81px, 1fr) 32px; gap: 4px 8px; }
.st-beat-toolbar { grid-column: 1/-1; display: flex; align-items: end; gap: 6px; }
.st-beat-toolbar > .st-choice { flex: 1; flex-direction: row; align-items: center; gap: 8px; }
.st-beat-toolbar .st-field-label { flex: none; }
.st-beat-toolbar .st-button { font-size: 10px; }
.st-beat-pattern > p, .st-beat-variation > p { display: none; }
.st-sequencer-scroll { grid-column: 1/-1; min-height: 0; }
.st-sequencer { display: grid; grid-template-rows: 11px repeat(4, minmax(0, 1fr)); gap: 3px; height: 100%; }
.st-step-counts, .st-step-row { display: grid; grid-template-columns: 35px repeat(16, minmax(0, 1fr)); gap: 3px; }
.st-step-counts { color: var(--st-muted); text-align: center; font: 7px ui-monospace, monospace; }
.st-step-row { align-items: stretch; }
.st-row-name { font: 8px ui-monospace, monospace; color: var(--st-muted); align-self: center; }
.st-console .st-step { min-height: 0; height: 100%; padding: 0; border-radius: 2px; background: var(--st-field); box-shadow: inset 0 1px #0000000a; border-color: var(--st-line); opacity: 1; }
.st-console .st-step[data-hit=on] { background: #528068; border-color: #3f6d56; }
.st-console .st-step[data-hit=roll] { background: var(--st-accent); border-color: var(--st-accent); }
.st-step[data-hit=roll] > span { height: 8px; width: 10px; border-inline: 2px solid #fff9; }
.st-console .st-step.st-now { outline: 1px solid var(--st-accent); outline-offset: 1px; }
.st-beat-transport { grid-column: 1; grid-row: 3; display: flex; align-items: end; gap: 4px; }
.st-beat-transport .st-button { flex: 1; font-size: 10px; }
.st-beat-mix { grid-column: 2; grid-row: 3; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 10px; }
.st-beat-variation { display: grid; grid-template-rows: 14px minmax(45px, 1fr) 23px 31px; gap: 4px; }
.st-beat-surface { background: radial-gradient(ellipse at 100% 0,#99945844,transparent 70%),repeating-linear-gradient(0deg,transparent 0 27px,#a9c7b018 28px 29px),repeating-linear-gradient(90deg,transparent 0 27px,#a9c7b018 28px 29px),var(--st-screen); border: 1px solid #425c4e; box-shadow: inset 0 2px 7px #0005; }
.st-beat-corner { position: absolute; font: 7px ui-monospace,monospace; letter-spacing: .5px; color: #d1dbc0; }
.st-beat-simple { bottom: 7px; left: 7px; }
.st-beat-build { top: 7px; right: 7px; }
.st-beat-original { position: absolute; left: 0; right: 0; top: 45%; text-align: center; font: 7px ui-monospace,monospace; letter-spacing: 1px; color: #abc6ae; }
.st-beat-puck { position: absolute; width: 12px; height: 12px; border: 2px solid #e1dfab; background: #d2d48f; border-radius: 50%; box-shadow: 0 0 0 5px #d3d09216; transform: translate(-50%,-50%); pointer-events: none; }
.st-beat-pad-actions { display: flex; gap: 4px; }
.st-beat-pad-actions .st-button { flex: 1; min-height: 23px; font-size: 10px; }
.st-beat-axis-faders { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#studioKeys .st-section-heading .st-section-label { display: none; }
#studioKeys .st-section-heading > .st-quiet { font-size: 8px; }
.st-instrument { display: grid; grid-template-rows: 34px minmax(0, 1fr); gap: 6px; }
.st-key-settings { display: grid; grid-template-columns: 1.2fr 1.2fr .6fr .9fr .8fr; align-items: end; gap: 6px; }
.st-playing-keys { display: grid; grid-template-rows: minmax(42px, 1fr) 26px; gap: 4px; }
.st-keybed { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.st-console .st-key { flex-direction: column; gap: 6px; background: linear-gradient(90deg, var(--st-paper), var(--st-panel) 20%, var(--st-panel) 80%, var(--st-paper)); border: 1px solid var(--st-line); border-radius: 3px 3px 6px 6px; box-shadow: inset 0 -3px #00000010; }
.st-drum-pads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.st-console .st-drum-key { background: var(--st-field); border-bottom: 3px solid var(--st-line); }
.st-drum-key strong { font: 10px/1 ui-monospace, monospace; }
.st-instrument > p { display: none; }

/* All routes, clock and microphone controls remain on the desk. */
#studioMixer { grid-template-rows: 15px minmax(0, 1fr); gap: 3px; }
#studioMixer .st-section-heading .st-section-label { display: none; }
#studioMixer h2 { font-size: 11px; }
.st-mixer-grid { display: grid; grid-template-columns: .9fr 1.1fr 1.35fr; gap: 6px; }
.st-mixer-grid .st-module { display: grid; grid-template-rows: 16px 34px; gap: 4px; position: relative; }
.st-mixer-grid h3 { font-size: 10px; }
.st-mixer-grid .st-module > p { display: none; }
.st-settings-stack { display: grid; grid-template-columns: .65fr 1fr 1.3fr; gap: 8px; }
.st-route-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.st-input-module .st-settings-stack { grid-template-columns: 1.3fr 1fr .8fr; }
.st-input-module .st-module-heading { padding-right: 96px; }
.st-input-module .st-module-heading .st-button { min-height: 20px; font-size: 9px; padding: 1px 5px; }
.st-input-module > .st-button { position: absolute; right: 6px; top: 4px; min-height: 20px; width: 87px; padding: 2px 4px; font-size: 9px; }
.st-mixer-grid .st-input-module > p[role=status] { display: block; position: absolute; bottom: 2px; left: 6px; right: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 8px; }

/* Portrait is an explicit gate, with sound and view controls still reachable. */
@media (orientation: portrait) {
  :root[data-view=studio] main { display: none; }
  :root[data-view=studio] #rotateNotice { display: flex; position: fixed; inset: 0; z-index: 30; flex-direction: column; justify-content: center; align-items: center; gap: 16px; padding: 28px; text-align: center; background: #eaeae3; color: #24322d; }
  :root[data-view=studio] #rotateNotice .rotate-device { font: 72px/1 sans-serif; color: #b0442c; }
  :root[data-view=studio] #rotateNotice .eyebrow { color: #5a675e; }
  :root[data-view=studio] #rotateNotice h1 { font-size: 32px; letter-spacing: -1px; margin: 0; color: #24322d; }
  :root[data-view=studio] #rotateNotice p { font-size: 16px; line-height: 1.5; color: #5a675e; margin: 0; }
  :root[data-view=studio] #rotateNotice > div:last-child { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
  :root[data-view=studio] #rotateNotice button { min-height: 44px; background: #f7f7f0; border: 1px solid #c9cdc3; border-radius: 8px; padding: 10px 14px; color: #24322d; font-size: 14px; }
}

.st-choice-hint { display:block; max-width:34em; white-space:normal; font-size:10px; line-height:1.4; opacity:.75; margin-top:3px; }

.st-beat-fill{position:absolute;right:10px;bottom:10px;font:10px ui-monospace,monospace;pointer-events:none}
