:root { color-scheme: dark; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #0c0c10; color: #f4f2f6; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 1100px; min-height: 100svh; margin: auto; padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); }
a { color: #a9b9ff; }
.masthead { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.masthead a { white-space: nowrap; font-size: .86rem; }
.eyebrow { margin: 0 0 8px; color: #8e96ad; font-size: .72rem; font-weight: 700; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.6rem); line-height: 1.15; }
.subhead { margin: 10px 0 0; color: #b0afba; }
.play-modes { display: flex; gap: 8px; margin: 0 0 10px; padding-block: 6px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: #0c0c10; }
.play-modes button { flex: 1 1 0; min-width: 0; min-height: 48px; border-color: #465270; padding: 10px 8px; font-size: .84rem; }
.play-modes button[aria-pressed="true"] { background: #253e32; border-color: #91c4a8; color: #e5ffef; }
.play-route { border-left: 3px solid #91c4a8; margin: 0 0 22px; padding: 8px 12px; color: #c5d4cc; font-size: .86rem; line-height: 1.6; }
.play-route[data-mode="machine"] { border-color: #c0a1e7; color: #d5c6e6; }
.quick-transport { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 0 0 18px; padding: 14px 16px; border: 1px solid #5a7062; border-radius: 14px; background: #16231c; }
.quick-transport-current { flex: 1 1 220px; min-width: 0; }
.quick-transport-current span { display: block; color: #a6c6b2; font-size: .75rem; }
.quick-transport-current strong { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.quick-transport-current p { margin: 4px 0 0; color: #c5d4cc; font-size: .8rem; line-height: 1.45; }
.quick-level { display: grid; grid-template-columns: auto minmax(100px, 1fr); align-items: center; gap: 2px 12px; max-width: 420px; margin-top: 10px; color: #d6e9da; font-size: .8rem; }
.quick-level span { white-space: nowrap; }
.quick-level input { width: 100%; min-height: 44px; margin: 0; }
.quick-level small { grid-column: 1 / -1; color: #a8beb1; }
.quick-transport-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.quick-transport-actions button { min-height: 44px; }
.quick-transport-actions #quick-play { background: #b6d89d; border-color: #b6d89d; color: #142011; font-weight: 700; }
.quick-transport-actions a { padding: 8px 2px; font-size: .84rem; }
#library-title, #editor-title { scroll-margin-top: 72px; }
@media (max-width: 600px) { #library-title, #editor-title { scroll-margin-top: 180px; } }
.set-connection { padding: 12px 16px; margin: 0 0 14px; border: 1px solid #466253; border-radius: 12px; color: #c9e5d3; background: #15201b; font-size: .84rem; line-height: 1.6; }
.deck-transfer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid #39465d; }
.deck-transfer button { border-color: #83b396; }
.deck-transfer p { flex: 1 1 230px; margin: 0; }
.intro { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.intro span { padding: 8px 12px; border: 1px solid #363641; border-radius: 999px; color: #dedce5; font-size: .82rem; }
.pwa-panel { margin-bottom: 20px; padding: 4px 16px; border: 1px solid #485967; border-radius: 14px; background: #141b20; }
.pwa-panel summary { min-height: 48px; padding-block: 13px; cursor: pointer; font-size: .9rem; font-weight: 700; }
.pwa-panel summary span { display: inline-block; margin-left: 8px; color: #a2dfc6; font-size: .79rem; font-weight: 400; }
.pwa-panel p, .pwa-steps { color: #c2cdd5; font-size: .84rem; line-height: 1.65; }
.pwa-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pwa-actions button { border-color: #6c998a; background: #233a33; }
.pwa-steps { padding-left: 23px; }
.pwa-steps li { padding-left: 3px; margin-block: 9px; }
.pwa-panel h3 { margin: 18px 0 10px; font-size: .95rem; }
.pwa-sources { display: grid; gap: 10px; margin: 0 0 12px; font-size: .84rem; line-height: 1.55; }
.pwa-sources > div { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 8px; }
.pwa-sources dt { color: #c6efd8; font-weight: 650; }
.pwa-sources dd { margin: 0; color: #c2cdd5; }
.pwa-panel .pwa-note { color: #a6b6c1; font-size: .8rem; }
@media (max-width: 540px) { .pwa-sources > div { grid-template-columns: 1fr; gap: 2px; } }
.module-rack { margin-bottom: 20px; padding: 18px; border: 1px solid #5b5375; border-radius: 18px; background: linear-gradient(135deg, #211d30, #15151b 76%); }
.module-rack-heading h2 { font-size: 1.1rem; }
.module-rack-heading p:last-child { margin: 8px 0 0; color: #cbc5d8; font-size: .86rem; line-height: 1.5; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.module-card { min-width: 0; padding: 15px; border: 1px solid #4f4c5a; border-radius: 12px; background: #20202a; }
.module-card-acid { border-color: #8b684a; background: #2a211e; }
.module-number { color: #b9a8d7; font-size: .68rem; font-weight: 800; letter-spacing: .12em; }
.module-card-acid .module-number { color: #f0bd81; }
.module-card h3 { margin: 6px 0; font-size: .96rem; }
.module-card p { min-height: 3.2em; margin: 0 0 12px; color: #d0ccd7; font-size: .82rem; line-height: 1.5; }
.module-card a, .module-stage-actions a { display: inline-flex; align-items: center; min-height: 44px; }
.module-card-acid button { border-color: #d49a59; background: #53351f; }
.module-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.module-stage { margin-top: 15px; padding-top: 15px; border-top: 1px solid #5b5375; }
.module-stage-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.module-stage-actions > div:first-child { display: grid; gap: 3px; }
.module-stage-actions strong { color: #ffe1bd; }
.module-stage-actions span, .module-stage-note, #acid-module-status { color: #c9bfce; font-size: .82rem; line-height: 1.5; }
.module-stage-actions > div:last-child { display: flex; align-items: center; gap: 12px; }
.module-stage-actions button { border-color: #ac7859; }
#acid-module-status { min-height: 1.4em; margin: 9px 0; }
#acid-module-frame { display: block; width: 100%; height: min(780px, 80svh); border: 1px solid #5d5368; border-radius: 10px; background: #111; }
.module-stage-note { margin: 10px 0 0; }
.acid-bridge { margin: 12px 0; padding: 12px; border: 1px solid #705943; border-radius: 12px; background: #231e1e; }
.acid-bridge-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.acid-bridge-heading > div { display: grid; gap: 4px; }
.acid-bridge-heading strong { color: #ffe1bd; font-size: .9rem; }
.acid-bridge-heading span { color: #c9bfce; font-size: .8rem; line-height: 1.5; }
.acid-bridge button { min-height: 44px; }
.acid-saved-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.acid-saved-item { display: grid; gap: 4px; min-width: 0; }
.acid-saved-list button { display: grid; gap: 2px; max-width: 100%; text-align: left; }
.acid-saved-item a { min-height: 34px; font-size: .8rem; }
.acid-saved-list small { color: #bfb7b1; }
.acid-saved-list .empty-note { margin: 0; }
.acid-tempo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.library { padding: 18px; margin-bottom: 20px; border: 1px solid #35323f; border-radius: 18px; background: #15151b; }
.library-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.library-heading p:last-child, .draft-heading p { margin: 0; color: #aaa9b7; font-size: .85rem; }
.library-heading .eyebrow { margin-bottom: 5px; }
.published-shelf { display: grid; gap: 24px; }
.shelf-group + .shelf-group { border-top: 1px solid #393642; padding-top: 18px; }
.shelf-group h3 { margin: 0 0 8px; font-size: 1rem; }
.shelf-group-description { margin: 0 0 12px; color: #aaa9b7; font-size: .84rem; line-height: 1.5; }
.pattern-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.pattern-card { display: flex; flex-direction: column; align-items: start; text-align: left; min-height: 132px; gap: 5px; padding: 14px; border-color: #4b4756; background: #20202a; }
.pattern-card strong { font-size: 1.05rem; }
.pattern-card[aria-pressed="true"], .draft-open[aria-pressed="true"] { border-color: #9fb2ff; background: #29304a; }
.card-label { color: #b7b7c7; font-size: .76rem; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card-genre, .card-status { padding: 3px 7px; border: 1px solid #615d73; border-radius: 6px; color: #d9dcf1; font-size: .73rem; }
.card-status { border-color: #807354; color: #e5d3a8; }
.card-genre-note { color: #aaa9b7; font-size: .75rem; line-height: 1.45; }
.card-description { color: #d2d0da; font-size: .84rem; line-height: 1.45; }
.draft-details { margin-top: 18px; border-top: 1px solid #393642; padding-top: 12px; }
.draft-details summary { cursor: pointer; font-size: .93rem; font-weight: 700; }
.draft-details summary span { margin-left: 8px; color: #aaa9b7; font-size: .79rem; font-weight: 400; }
.draft-details > p { margin: 8px 0 12px; color: #aaa9b7; font-size: .85rem; }
.draft-list { display: grid; gap: 8px; }
.draft-row { display: flex; gap: 8px; }
.draft-open { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; text-align: left; min-width: 0; }
.draft-open strong { overflow-wrap: anywhere; }
.draft-remove { min-width: 64px; }
.backup-details { margin-top: 18px; border-top: 1px solid #393642; padding-top: 12px; }
.backup-details summary { min-height: 44px; padding-block: 9px; cursor: pointer; font-size: .93rem; font-weight: 700; }
.backup-details > p, .backup-preview > p { color: #bbbaca; font-size: .85rem; line-height: 1.6; }
.backup-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.backup-actions label { display: grid; gap: 7px; min-width: 0; max-width: 100%; color: #d8dcec; font-size: .84rem; }
.backup-actions input { max-width: 100%; min-width: 0; min-height: 44px; color: #d8dcec; font: inherit; }
.backup-actions input::file-selector-button { min-height: 44px; margin-right: 8px; padding: 8px 12px; border: 1px solid #696178; border-radius: 9px; color: #f4f2f6; background: #24212c; font: inherit; cursor: pointer; }
.backup-preview { margin-top: 14px; padding: 14px; border: 1px solid #737f9d; border-radius: 10px; background: #1b2231; }
.backup-preview strong, .backup-preview li { overflow-wrap: anywhere; }
.backup-preview ul { max-height: 220px; overflow-y: auto; margin: 12px 0; padding-left: 20px; color: #d4d9e7; font-size: .85rem; line-height: 1.6; }
.backup-preview button:first-child { border-color: #9fb2ff; background: #303e62; }
.empty-note { margin: 0; color: #9999a7; font-size: .84rem; }
.deck-setup { display: grid; gap: 14px; margin-bottom: 20px; padding: 18px; border: 1px solid #4a5570; border-radius: 18px; background: linear-gradient(140deg, #18202d, #15151b 72%); }
.deck-setup h2 { font-size: 1.1rem; }
.deck-setup p { margin: 8px 0 0; color: #c3c8d7; font-size: .87rem; line-height: 1.5; }
.deck-pickers { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 9px; align-items: end; }
.deck-pickers label { display: grid; gap: 6px; min-width: 0; color: #dfe5f7; font-size: .81rem; font-weight: 700; }
.deck-pickers select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid #737f9d; border-radius: 9px; color: #f4f2f6; background: #202737; font: inherit; }
.deck-pickers button:last-child { border-color: #9fb2ff; background: #303e62; }
.deck-info { color: #bec9e4 !important; }
.workspace { border: 1px solid #35323f; border-radius: 18px; background: #15151b; overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.minimal-playback-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 16px 18px 0; padding: 14px; border: 1px solid #536c61; border-radius: 10px; background: #17251e; }
.minimal-playback-panel label { display: grid; gap: 7px; min-width: 0; color: #d7ebdf; font-size: .85rem; font-weight: 650; }
.minimal-playback-panel select { width: 100%; min-width: 180px; min-height: 44px; padding: 8px 10px; border: 1px solid #83b396; border-radius: 9px; color: #f4f2f6; background: #20352a; font: inherit; }
.minimal-playback-panel p { flex: 1 1 260px; margin: 0; color: #c0d3c7; font-size: .82rem; line-height: 1.6; }
.minimal-first-steps { flex-basis: 100%; }
.minimal-first-steps h3 { margin: 0 0 5px; font-size: .95rem; }
.minimal-first-steps a { color: #d7ebdf; text-underline-offset: 3px; }
.minimal-mode-guide { flex: 1 1 260px; }
.minimal-mode-guide p + p { margin-top: 6px; }
.minimal-playback-panel select:focus-visible { outline: 3px solid #9fb2ff; outline-offset: 3px; }
h2 { margin: 0; font-size: 1rem; }
#current-work { margin: 6px 0 0; color: #aeb7d7; font-size: .83rem; }
button { min-height: 44px; border: 1px solid #696178; border-radius: 9px; padding: 8px 12px; color: #f4f2f6; background: #24212c; font: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #9fb2ff; outline-offset: 3px; }
.inline-panel { margin: 12px 18px 0; padding: 14px; border: 1px solid #696178; border-radius: 10px; background: #20202a; }
.inline-panel label { display: block; margin-bottom: 8px; font-size: .9rem; font-weight: 700; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-actions input { flex: 1 1 200px; min-width: 0; min-height: 44px; border: 1px solid #696178; border-radius: 9px; padding: 8px 10px; color: #f4f2f6; background: #15151b; font: inherit; }
#confirm-dialog { width: min(420px, calc(100vw - 32px)); border: 1px solid #696178; border-radius: 12px; padding: 18px; color: #f4f2f6; background: #20202a; }
#confirm-dialog::backdrop { background: rgb(0 0 0 / .7); }
#confirm-dialog p { margin: 0 0 16px; line-height: 1.5; }
#status { min-height: 1.4em; margin: 8px 18px 14px; color: #aeadb9; font-size: .88rem; }
.mix-panel { margin: 0 18px 18px; padding: 15px; border: 1px solid #53678b; border-radius: 14px; background: #1a2333; }
.mix-panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 15px; }
.mix-panel h3 { margin: 0; font-size: .98rem; }
.mix-panel-heading p, .mix-panel > p { margin: 0; color: #bfcbe4; font-size: .81rem; line-height: 1.5; }
.mix-panel > p { margin-top: 10px; }
.mix-fader { display: grid; grid-template-columns: minmax(76px, auto) minmax(100px, 1fr) 50px; align-items: center; gap: 10px; margin-top: 13px; color: #ecf1ff; font-size: .82rem; font-weight: 700; }
.mix-fader input[type="range"] { width: 100%; min-height: 44px; accent-color: #a9b9ff; touch-action: pan-y; }
.mix-fader output { text-align: right; font-variant-numeric: tabular-nums; color: #dce5ff; }
.deck-fader-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.deck-fader-grid .mix-fader { grid-template-columns: 1fr auto; gap: 2px 8px; }
.deck-fader-grid .mix-fader input { grid-column: 1 / -1; grid-row: 2; }
.acid-faders { margin: 0 18px 18px; padding: 16px; border: 1px solid #796344; border-radius: 14px; background: linear-gradient(160deg, #282019, #17171b 70%); }
.acid-faders-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.acid-faders-heading h3 { margin: 0; font-size: 1rem; }
.acid-faders-heading p:last-child { max-width: 46ch; margin: 0; color: #c7bcb1; font-size: .8rem; line-height: 1.5; }
.fader-bank { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.acid-fader { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; padding: 10px 4px 8px; border: 1px solid #5d4a35; border-radius: 12px; background: #151416; }
.acid-fader span { color: #f9c782; font-size: .68rem; font-weight: 800; letter-spacing: .04em; }
.acid-fader output { min-height: 1.4em; color: #fff4df; font-size: .87rem; font-variant-numeric: tabular-nums; }
.acid-fader input[type="range"] { width: 36px; height: 146px; margin: 4px 0; writing-mode: vertical-lr; direction: rtl; accent-color: #ff9c42; cursor: ns-resize; touch-action: none; }
.acid-fader input[type="range"]:disabled { opacity: .5; cursor: wait; }
.acid-fader small { color: #b5a898; font-size: .72rem; }
.acid-fader-guide { margin-top: 14px; padding-top: 12px; border-top: 1px solid #5d4a35; }
.acid-fader-guide-intro { margin: 0 0 10px; color: #e7d7c1; font-size: .86rem; line-height: 1.5; }
.acid-fader-guide dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; }
.acid-fader-guide dl > div { min-width: 0; }
.acid-fader-guide dt { color: #f9c782; font-size: .83rem; font-weight: 800; }
.acid-fader-guide dt span { margin-left: 4px; color: #d9c4a9; font-weight: 500; }
.acid-fader-guide dd { margin: 3px 0 0; color: #d0c5ba; font-size: .85rem; line-height: 1.55; }
#editor { min-height: 520px; }
strudel-editor { display: contents; }
#editor .cm-editor { min-height: 520px; }
#editor .cm-slider input[type="range"] { width: 104px !important; min-height: 36px; }
footer { max-width: 72ch; margin-top: 22px; color: #a9a8b3; font-size: .82rem; line-height: 1.55; }
footer p { margin: 0 0 8px; }
@media (max-width: 640px) {
  main { padding-inline: 10px; }
  .masthead { align-items: start; flex-direction: column; gap: 12px; padding-inline: 5px; }
  .intro { padding-inline: 4px; }
  .intro span { width: 100%; border-radius: 8px; }
  .module-rack { padding: 14px; border-radius: 12px; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card p { min-height: 0; }
  .module-stage-actions { align-items: start; flex-direction: column; }
  .module-stage-actions > div:last-child { flex-wrap: wrap; }
  .acid-bridge-heading { flex-direction: column; }
  #acid-module-frame { height: min(720px, 75svh); }
  .library { border-radius: 12px; padding: 14px; }
  .library-heading { align-items: start; flex-direction: column; }
  .pattern-list { grid-template-columns: 1fr; }
  .pattern-card { min-height: 0; }
  .draft-open { align-items: start; flex-direction: column; }
  .backup-actions { align-items: stretch; flex-direction: column; }
  .backup-preview { padding: 12px; }
  .deck-setup { padding: 14px; border-radius: 12px; }
  .deck-pickers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deck-pickers label { grid-column: 1 / -1; }
  .workspace { border-radius: 12px; }
  .section-heading { align-items: start; flex-direction: column; }
  .mix-panel { margin-inline: 10px; padding: 12px; }
  .minimal-playback-panel { margin-inline: 10px; padding: 12px; gap: 12px; }
  .minimal-playback-panel label { flex-basis: 100%; }
  .mix-panel-heading { align-items: start; flex-direction: column; gap: 5px; }
  .deck-fader-grid { grid-template-columns: 1fr; gap: 0; }
  .acid-faders { margin-inline: 10px; padding: 12px 8px; }
  .acid-faders-heading { align-items: start; flex-direction: column; gap: 4px; padding-inline: 5px; }
  .fader-bank { gap: 5px; }
  .acid-fader { padding-inline: 2px; }
  .acid-fader span { font-size: .68rem; }
  .acid-fader-guide dl { grid-template-columns: 1fr; }
  #editor, #editor .cm-editor { min-height: 68svh; }
  #editor .cm-slider input[type="range"] { width: 120px !important; min-height: 44px; }
}

.masthead-actions { display: flex; align-items: center; gap: 16px; }
.audio-help { margin: 0 0 18px; color: #c9dfcf; font-size: .78rem; }
.audio-help summary { min-height: 44px; padding-block: 12px; cursor: pointer; }
.audio-help p { margin: 10px 0; line-height: 1.65; }
#performance-open { border-color: #9fbca5; background: #20352b; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.performance-view main { max-width: 1540px; }
.performance-view .intro, .performance-view .module-rack, .performance-view .deck-setup { display: none; }
.performance-view:not(.set-library-visible) .library { display: none; }
.performance { margin-bottom: 22px; --set-orange: #ffb970; --set-green: #b3f3bd; }
.performance fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
.set-transport { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px; border: 1px solid #5a7062; border-radius: 14px; background: #16231c; }
.set-heading { margin-right: auto; }
.set-heading .eyebrow { color: var(--set-green); margin-bottom: 6px; }
.set-heading h2 { font-size: 1.12rem; }
#set-position { display: block; margin-top: 7px; color: #b8cabd; font-size: .72rem; font-variant-numeric: tabular-nums; }
.set-transport a { color: #c7dfcc; font-size: .8rem; }
.set-start { background: #b3f3bd; color: #12271b; border-color: #b3f3bd; font-weight: 800; }
.set-stop { border-color: #b17778; color: #ffc6c8; }
#set-master { width: 155px; }
.set-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.set-presets button { font-size: .84rem; }
.set-presets button[aria-pressed="true"] { color: #e4ffe7; border-color: #b3f3bd; background: #273a2d; }
.set-choice-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-block: 12px; }
.set-choice-row .set-presets { margin: 0; }
.set-live-controls { display:flex;flex-wrap:wrap;align-items:end;gap:10px;padding:12px!important;margin:8px 0 14px;background:#17291f;border:1px solid #435d4d;border-radius:10px; }
.set-live-controls label { display:grid;gap:5px;font-size:.75rem;color:#c9dfcf; }
.set-live-controls select { min-height:44px;max-width:100%;background:#131d17;color:#edfff1;border:1px solid #68826e;border-radius:8px;padding:7px; }
#set-live-lock[aria-pressed="true"] { background:#3b533e;border-color:#b3f3bd; }
.set-listening { display:none;border:1px solid #4d7560;border-radius:16px;padding:40px 20px;margin-top:18px;text-align:center;background:radial-gradient(ellipse at top,#26463b,#101a17); }
.set-listening h3 { font-size:clamp(1.4rem,4vw,2.5rem); }
.set-listening progress { width:min(520px,90%);height:9px;accent-color:#b3f3bd;margin:20px 0; }
.listening-view .set-listening { display:block; }
.listening-view #set-controls,.listening-view .set-choice-row,.listening-view .set-guide,.listening-view #set-phrase,.listening-view .workspace { display:none; }
.listening-view #set-status { text-align:center; }
.set-evolution { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.performance .set-dice { border:1px solid #748956;border-radius:12px;padding:12px;margin:12px 0;background:#243022; }
.set-dice legend { color:#e0f1bc;font-weight:700;padding-inline:6px; }
.set-dice-actions,.set-dice-locks { display:flex;flex-wrap:wrap;gap:8px;align-items:center; }
.set-dice-actions button { min-height:44px; }
#set-nudge-dice { background:#d4eda0;color:#14220f;border-color:#d4eda0;font-weight:700; }
.set-dice-locks { margin-top:10px;font-size:.75rem;color:#c3d2bb; }
.set-dice-locks label { display:flex;align-items:center;gap:5px;min-height:44px; }
.set-dice-locks input { width:20px;height:20px;accent-color:#c8e899; }
.set-instruments { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:10px;margin-top:10px; }
.set-instruments label { display:flex;flex-direction:column;gap:6px;font-size:.8rem;color:#c3d2bb; }
.set-instruments select { width:100%;min-width:0;min-height:44px; }
.listening-view #set-dice { display:none; }
.set-evolution button { font-size: .72rem; padding-inline: 9px; }
.set-evolution label { font-size: .68rem; display: flex; align-items: center; gap: 5px; }
.set-evolution select { background: #18231d; color: #dceade; border: 1px solid #65776a; border-radius: 8px; min-height: 40px; }
#set-hold[aria-pressed="true"] { border-color: #b3f3bd; background: #294334; }
.set-kit-details, .set-synth-details { font-size: .72rem; margin-top: 10px; }
.set-kit-details summary, .set-synth-details summary { cursor: pointer; min-height: 26px; color: #c6d9cb; }
.set-kit { display: flex; flex-wrap: wrap; gap: 5px; margin-block: 8px; }
.set-kit button { font-size: .63rem; min-height: 34px; padding: 4px 8px; }
.set-kit button[aria-pressed="true"] { background: #294334; border-color: #b3f3bd; }
#set-groove-faders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 8px; }
#set-shadow-faders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 8px 0; }
.set-scenes-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 16px; }
.set-bpm-label { display: grid; gap: 4px; font-size: .67rem; font-weight: 800; color: #d9e0dc; }
#set-bpm { width: 76px; min-height: 44px; padding: 8px; border: 1px solid #77897c; background: #151d18; color: #effff0; border-radius: 9px; font-size: 1.1rem; font-weight: 700; }
.set-scenes { display: flex; flex: 1; gap: 6px; flex-wrap: wrap; }
.set-scenes button { flex: 1; min-width: 105px; font-size: .78rem; font-weight: 800; background: #1a1c21; }
.set-scenes button[aria-pressed="true"] { background: #71442b; border-color: var(--set-orange); color: #fff1e0; }
#set-auto[aria-pressed="true"] { background: #294334; border-color: var(--set-green); }
.set-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
.set-card { min-width: 0; padding: 17px; border: 1px solid #424b44; border-radius: 14px; background: linear-gradient(145deg, #1b211e, #121614); }
.set-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.set-card-heading .eyebrow { color: #8fa493; margin-bottom: 5px; font-size: .62rem; }
.set-card h3 { font-size: .98rem; margin: 0; }
.set-chip { border: 1px solid #3e5144; border-radius: 5px; padding: 5px 7px; color: #abc5b2; font-size: .57rem; letter-spacing: .07em; white-space: nowrap; }
.set-card label { font-size: .78rem; }
.set-card select { max-width: 100%; min-width: 0; min-height: 44px; border: 1px solid #707972; border-radius: 7px; padding: 7px; background: #161b18; color: #edf6ed; font: inherit; }
.set-help { color: #acb9ae; font-size: .73rem; line-height: 1.6; margin: 12px 0 0; }
.set-step-scroll, .set-note-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.set-step-scroll { margin-top: 12px; padding-bottom: 4px; }
.set-step-row { display: grid; grid-template-columns: 85px repeat(16, minmax(27px, 1fr)); min-width: 610px; gap: 4px; align-items: center; margin-bottom: 5px; }
.set-row-title { font-size: .6rem; letter-spacing: .02em; color: #cad4ca; }
.set-step { min-height: 38px; padding: 0; background: #232c25; border-color: #3d4e42; border-radius: 5px; font-size: .57rem; color: #819188; }
.set-step.beat-start { border-left: 2px solid #829486; }
.set-step[aria-pressed="true"] { background: #a9dcb4; color: #14251a; border-color: #a9dcb4; }
.set-step.is-current, .set-note.is-current { outline: 2px solid #ffcb7d; outline-offset: -2px; }
.set-acid { border-color: #6d573d; background: linear-gradient(145deg, #29211a, #191715); }
.set-acid .eyebrow { color: #c9a170; }
.set-acid .set-chip { border-color: #655039; color: #d5b991; }
.set-acid-faders { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.set-fader { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; min-width: 0; color: #d7e4d9; font-size: .72rem; }
.set-fader output { font-size: .75rem; font-variant-numeric: tabular-nums; }
.set-live-value { color: #a5dcb0; font-size: .62rem; font-variant-numeric: tabular-nums; }
.set-live-meter { grid-column: 1 / -1; width: 100%; height: 5px; accent-color: #a5dcb0; }
.set-automation-help { margin-bottom: 12px; }
.set-tempo { display: grid; grid-template-columns: 76px minmax(100px, 160px); align-items: center; gap: 4px 8px; }
.set-tempo input[type="range"] { width: 100%; min-height: 44px; touch-action: pan-y; accent-color: #b3f3bd; }
.set-tempo > span { grid-column: 1 / -1; font-size: .62rem; color: #9abca5; }
.set-fader input { grid-column: 1 / -1; width: 100%; min-height: 38px; margin: 0; accent-color: #c0e8c7; cursor: pointer; touch-action: pan-y; }
.set-fader-vertical { display: flex; flex-direction: column; padding: 9px 4px; border: 1px solid #475249; border-radius: 8px; background: #141b16; gap: 5px; text-align: center; }
.set-fader-vertical span { font-size: .64rem; white-space: nowrap; }
.set-fader-vertical input { width: 36px; height: 116px; writing-mode: vertical-lr; direction: rtl; touch-action: none; cursor: ns-resize; }
.set-acid .set-fader-vertical { background: #1a1613; border-color: #695238; }
.set-acid .set-fader input { accent-color: var(--set-orange); }
.set-note-scroll { margin-top: 12px; }
#set-acid-notes { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; min-width: 0; padding: 2px; }
.set-note { min-height: 36px; padding: 0; font-size: .6rem; border-radius: 4px; color: #998979; }
.set-note[aria-pressed="true"] { background: #67462b; border-color: #b88653; color: #ffdfb7; }
.set-mixer { display: grid; grid-template-columns: repeat(var(--set-channel-count, 5), minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.set-channel { display: grid; gap: 6px; min-width: 0; }
.set-mute { padding: 3px; min-height: 36px; font-size: .67rem; }
.set-mute[aria-pressed="true"] { color: #ffdddd; border-color: #c67777; background: #612c2c; }
.set-layer-pickers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 14px 0 10px; }
.set-layer-pickers label { display: grid; gap: 5px; }
#set-layer-faders { display: grid; gap: 4px; }
#set-boom { margin-top: 10px; }
#set-boom .set-fader { grid-template-columns: 145px 1fr auto; }
#set-boom input { grid-column: 2; grid-row: 1; }
#set-boom output { grid-column: 3; }
.set-status { color: #c7d6cb; font-size: .81rem; margin: 14px 0; }
.set-guide { padding: 0 14px; border: 1px solid #455147; border-radius: 10px; background: #171e19; font-size: .8rem; line-height: 1.7; color: #bdcdbf; }
.set-guide summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.set-guide ol { padding-left: 20px; }
.set-guide li { margin-bottom: 8px; }
/* LIVE starts with the performance essentials; the same controls remain in full view. */
.performance-view:not(.set-detailed-view) [data-set-advanced],
.performance-view:not(.set-detailed-view) .workspace { display: none; }
.performance-view .play-modes { position: static; }
.performance-view .masthead { margin-bottom: 14px; }
.performance-view .masthead h1 { font-size: 1.3rem; }
.performance-view .masthead .eyebrow, .performance-view .masthead .subhead,
.performance-view .masthead-actions { display: none; }
.performance-view .play-route { margin-bottom: 6px; font-size: .78rem; }
.performance-view .audio-help { margin-bottom: 8px; }
.performance-view .library .published-shelf, .performance-view .library-heading > p { display: none; }
.performance-view .library, .performance-view #editor-title { scroll-margin-top: 170px; }
.set-heading { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-bottom: 12px; }
.set-heading .eyebrow { display: none; }
.set-heading h2 { margin: 0; }
#set-position { margin: 0 0 0 auto; }
.set-transport { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6; box-shadow: 0 6px 18px #0005; }
#set-master { flex: 1 1 180px; max-width: 480px; margin-inline: auto; }
.set-transport button { min-height: 44px; }
.set-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding-block: 8px; }
.set-toolbar button, .set-toolbar a { min-height: 44px; font-size: .78rem; }
.set-toolbar button { border-color: #424e47; background: #141b17; }
.set-toolbar a { display: inline-flex; align-items: center; color: #c1d8c8; }
.set-toolbar button[aria-pressed="true"], .set-toolbar button[aria-expanded="true"] { border-color: #b3f3bd; background: #294334; }
.set-feedback .inline-panel { margin: 8px 0; }
.set-feedback #status { margin: 4px 0 12px; padding: 8px 12px; border-left: 2px solid #708f7b; font-size: .8rem; }
.set-feedback #status:empty { display: none; }
.set-quick-start { color: #bdcdbf; font-size: .8rem; margin: 6px 0 14px; }
.set-dice-memory { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.set-dice-memory button { font-size: .76rem; min-height: 44px; background: #192319; border-color: #617259; }
.set-dice-options { margin-top: 12px; border-top: 1px solid #4d6145; }
.set-dice-options summary { cursor: pointer; padding-block: 12px; min-height: 44px; font-size: .8rem; color: #d7e6c8; }
#set-dice-settings-summary { display: inline-block; margin-left: 8px; color: #b3c5a7; font-size: .72rem; }
.set-instruments select { background: #152016; color: #edffe9; border: 1px solid #6d8064; border-radius: 8px; padding: 8px; font: inherit; }
.set-kit-details summary, .set-synth-details summary { min-height: 44px; padding-block: 12px; }
.performance :is(button, input, select, a, summary):focus-visible { outline: 2px solid #ffe2a6; outline-offset: 3px; }
.listening-view .set-quick-start { display: none; }
@media (min-width: 1121px) {
  .performance-view:not(.set-detailed-view) .set-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); }
}
@media (max-width: 600px) {
  .set-transport #set-master { flex-basis: 100%; width: 100%; max-width: none; order: 1; }
  .set-transport #set-save { margin-left: auto; }
  .set-toolbar { gap: 4px 8px; }
  .set-toolbar button { padding-inline: 10px; }
  .set-dice-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #set-nudge-dice { grid-column: 1 / -1; }
  .set-dice-actions button { padding-inline: 6px; }
}
@media (min-width: 1121px) {
  .performance-view .masthead { margin-bottom: 16px; align-items: center; }
  .performance-view .masthead h1 { font-size: 1.5rem; }
  .performance-view .masthead .eyebrow, .performance-view .masthead .subhead { display: none; }
  .set-card { padding: 12px; }
  .set-help { margin-top: 9px; }
  .set-step { min-height: 32px; }
  .set-step-row { margin-bottom: 4px; }
  .set-fader-vertical input { height: 94px; }
  .set-layer-pickers { margin-top: 10px; margin-bottom: 6px; }
  #set-layer-faders .set-fader { gap: 0 8px; }
  #set-layer-faders input { min-height: 28px; }
}
@media (max-width: 1120px) {
  .set-grid { grid-template-columns: minmax(0, 1fr); }
  .set-acid-faders .set-fader-vertical input { height: 98px; }
  #set-acid-notes { min-width: 0; }
  .masthead-actions { align-items: end; flex-direction: column; gap: 10px; }
}
@media (max-width: 600px) {
  .masthead-actions { align-items: start; }
  .set-transport { padding: 13px; }
  .set-heading { width: 100%; }
  .set-heading h2 { font-size: 1rem; }
  #set-master { flex: 1; min-width: 130px; }
  .set-transport > a { min-height: 36px; padding-top: 8px; }
  .set-card { padding: 12px; }
  .set-scenes-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); }
  .set-tempo { grid-column: 1 / -1; grid-row: 1; grid-template-columns: 76px minmax(0, 1fr); }
  #set-auto { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
  .set-scenes { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .set-scenes button { min-width: 0; padding-inline: 5px; }
  .set-card-heading { align-items: start; }
  .set-chip { font-size: .5rem; }
  .set-fader-vertical span { font-size: .59rem; white-space: normal; }
  .set-mixer { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .set-mixer .set-fader-vertical span { min-height: 2.6em; }
  .set-fader-vertical input { width: 44px; }
  .set-layer-pickers { grid-template-columns: 1fr; }
  #set-acid-notes { grid-template-columns: repeat(16, minmax(29px, 1fr)); min-width: 620px; }
  #set-boom .set-fader { grid-template-columns: 100px 1fr auto; }
}

/* Move existing panels into the linked view; never duplicate their controls. */
.joint-panel { margin: 16px 0 24px; padding: 16px; border: 1px solid #709885; border-radius: 16px; background: #131e1a; }
.joint-transport { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.joint-transport label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; }
.joint-transport input { width: 190px; min-height: 44px; }
.joint-panel > p, .joint-panel details { color: #c4d8cd; font-size: .84rem; line-height: 1.65; }
.joint-panel > details { margin-bottom: 16px; }
.joint-panes { display: grid; gap: 16px; align-items: start; }
.joint-panes > * { min-width: 0; margin: 0; }
.joint-panes .module-stage { padding-top: 0; border-top: 0; }
.joint-panes .module-stage-actions > div:first-child span, .joint-panes .module-stage > .module-stage-note { display: none; }
.joint-view .module-rack, .joint-view .intro { display: none; }
.joint-view .set-transport { position: static; }
.joint-view main { max-width: 1900px; }
.joint-view .play-modes { position: static; }
.joint-view #acid-module-frame { height: 850px; }
@media (min-width: 1280px) {
  .joint-panes { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .joint-panes .set-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .play-modes { flex-wrap: wrap; }
  .play-modes button { flex-basis: 40%; }
  .joint-panel { padding: 10px; }
}

.joint-panel:not(.is-linked) > .joint-transport, .joint-panel:not(.is-linked) > #joint-status, .joint-panel:not(.is-linked) > details { display: none; }
.joint-panel:not(.is-linked) .joint-panes { display: block; }

.joint-saves {display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:12px 0;}
.joint-saves select {min-width:0;max-width:100%;flex:1 1 260px;}
