/* SYNDRUS — same family as NODRUS / PUDRUS: near-black, neon green, IBM Plex Mono.
   Desktop: everything fits in the window (no page scroll). Phone: one section at a time + bottom tabs. */
:root { --bg: #050508; --bg2: #0b0b14; --bg3: #12121c; --line: rgba(0,212,255,0.15); --g: #66ff33; --c: #00d4ff; --m: #ff3fa4; --y: #ffd23f; --r: #ff3355; --text: #d0efff; --dim: rgba(208,239,255,0.5); --font: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  /* what a theme changes besides the colours above: the brightest text, the text on an accent, the accents as r,g,b
     (for rgba(var(--x-rgb), alpha)) and the shades of wells, steps, keys and fader caps */
  --head: #fff; --on: #000;
  --g-rgb: 102,255,51; --c-rgb: 0,212,255; --m-rgb: 255,63,164; --y-rgb: 255,210,63; --text-rgb: 208,239,255; --bg-rgb: 5,5,8; --bg2-rgb: 11,11,20; --well-rgb: 7,7,12;
  --well: #07070c; --track: #1a1a26; --groove: #1d1d2b; --step: #0e0e18; --step-q: #141424; --step-q2: #10101c;
  --key: #1a1a26; --key-bd: #1a1a28; --key-sc: #232336; --key-blk: #07070c; --key-blk-sc: #10101c;
  --cap1: #dfe8ef; --cap2: #8a96a0; --cap-line: #111; --ring-off: #1d2a3a; --ring-mute: #2b5a37;
  --ph: clamp(26px, 3.7vh, 34px); --sh: clamp(13px, 2.3vh, 26px); --nh: clamp(28px, 5.2vh, 54px); --kh: clamp(24px, 5vh, 60px); }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 12px/1.4 var(--font); }
button, select { font: inherit; color: inherit; }
.sy-sp { flex: 1; }
.sy-dim { color: var(--dim); }

/* ── top bar ── */
.sy-bar { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: rgba(var(--bg-rgb),0.96); border-bottom: 1px solid var(--line); z-index: 20; }
.sy-logo { font-weight: 700; font-size: 16px; letter-spacing: .08em; color: var(--head); text-decoration: none; margin-right: 2px; }
.sy-logo span { color: var(--g); text-shadow: 0 0 12px rgba(var(--g-rgb),0.6); }
.sy-more { display: contents; }
.sy-morebtn { display: none; }
.sy-group { display: flex; align-items: center; gap: 6px; }
.sy-group .sy-param { width: 96px; }
.sy-btn { height: 30px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; white-space: nowrap; }
.sy-btn:hover { border-color: var(--g); color: var(--g); }
.sy-play { width: 46px; font-size: 15px; border-color: rgba(var(--g-rgb),0.5); color: var(--g); }
.sy-play.on { background: var(--g); color: var(--bg); box-shadow: 0 0 18px rgba(var(--g-rgb),0.5); }
select { height: 30px; background: var(--bg2); border: 1px solid var(--line); border-radius: 7px; padding: 0 6px; }
.sy-mini { height: 22px; padding: 0 8px; border-radius: 5px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; font-size: 11px; }
.sy-mini:hover { border-color: var(--g); }
.sy-mini.on { background: var(--y); color: var(--on); border-color: var(--y); }
.sy-mini.cur { border-color: var(--g); color: var(--g); box-shadow: 0 0 8px rgba(var(--g-rgb),0.35); }

/* ── panels ── */
.sy-panel { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px 9px; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.sy-head { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.sy-head b { color: var(--g); letter-spacing: .14em; font-size: 12px; }
.sy-hint { color: var(--dim); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* drag parameters (like NODRUS) */
.sy-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 5px; }
.sy-params.sy-row { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.sy-param { position: relative; height: var(--ph); border-radius: 6px; background: var(--bg3); border: 1px solid var(--line); cursor: ew-resize; overflow: hidden; user-select: none; touch-action: none; }
.sy-param .fill { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(var(--g-rgb),0.10), rgba(var(--g-rgb),0.28)); border-right: 2px solid var(--g); }
.sy-param .l { position: absolute; left: 6px; top: 2px; font-size: 9px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.sy-param .v { position: absolute; left: 6px; bottom: 2px; font-size: 12px; color: var(--head); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sy-param:hover { border-color: rgba(var(--g-rgb),0.5); }
.sy-param.wide { grid-column: span 2; }
.sy-sel { display: flex; flex-direction: column; justify-content: center; gap: 1px; height: var(--ph); overflow: hidden; border-radius: 6px; background: var(--bg3); border: 1px solid var(--line); padding: 1px 6px; min-width: 0; }
.sy-sel span { font-size: 9px; line-height: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sy-sel select, .sy-sel b { height: 16px; border: 0; padding: 0; background: transparent; color: var(--head); font-size: 12px; font-weight: 400; }
.sy-tabs-in { display: flex; gap: 4px; }
.sy-tabs-in button { height: 22px; padding: 0 10px; border-radius: 5px; border: 1px solid var(--line); background: var(--bg3); cursor: pointer; font-size: 11px; color: var(--dim); }
.sy-tabs-in button.on { color: var(--g); border-color: var(--g); }

/* drum grid */
.sy-chips { display: none; gap: 4px; }
.sy-grid { display: grid; grid-template-columns: 104px 20px 20px repeat(16, minmax(0, 1fr)); gap: 3px; }
.sy-name { text-align: left; padding: 0 7px; height: var(--sh); border-radius: 4px; border: 1px solid var(--line); background: var(--bg3); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.sy-name.sel { border-color: var(--g); color: var(--g); }
.sy-ms { height: var(--sh); padding: 0; font-size: 9.5px; border-radius: 4px; border: 1px solid var(--line); background: var(--bg3); cursor: pointer; color: var(--dim); }
.sy-ms.on.m { background: var(--m); color: var(--on); border-color: var(--m); }
.sy-ms.on.s { background: var(--y); color: var(--on); border-color: var(--y); }
.sy-step { height: var(--sh); border-radius: 3px; border: 1px solid rgba(var(--c-rgb),0.12); background: var(--step); cursor: pointer; padding: 0; }
.sy-step.q { background: var(--step-q); }
.sy-step.on { background: rgba(var(--g-rgb),0.55); border-color: rgba(var(--g-rgb),0.7); }
.sy-step.acc { background: var(--g); box-shadow: 0 0 10px rgba(var(--g-rgb),0.6); }
.sy-step.now { outline: 2px solid var(--head); outline-offset: -2px; }
.sy-step.now.on, .sy-step.now.acc { background: var(--head); }

/* synth sequencer */
.sy-seq { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 3px; }
.sy-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sy-note { height: var(--nh); border-radius: 4px; border: 1px solid rgba(var(--c-rgb),0.12); background: var(--step); cursor: ns-resize; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 2px; position: relative; overflow: hidden; touch-action: none; user-select: none; }
.sy-note .bar { position: absolute; left: 2px; right: 2px; bottom: 0; background: rgba(var(--c-rgb),0.18); border-top: 2px solid var(--c); }
.sy-note .nm { position: relative; font-size: 10px; color: var(--dim); }
.sy-note.on .bar { background: rgba(var(--g-rgb),0.3); border-color: var(--g); }
.sy-note.on .nm { color: var(--head); }
.sy-note.now { outline: 2px solid var(--head); outline-offset: -2px; }
.sy-col .ab { display: flex; gap: 2px; }
.sy-col .ab button { flex: 1; min-width: 0; height: 16px; padding: 0; font-size: 9px; border-radius: 3px; border: 1px solid var(--line); background: var(--bg3); cursor: pointer; color: var(--dim); }
.sy-col .ab button.on { background: var(--c); color: var(--on); border-color: var(--c); }
.sy-col .ab button.on.a { background: var(--y); border-color: var(--y); }
.sy-keys { display: flex; height: var(--kh); user-select: none; touch-action: none; }
.sy-key { flex: 1; border: 1px solid var(--key-bd); background: var(--key); border-radius: 0 0 4px 4px; cursor: pointer; position: relative; }
.sy-key.blk { background: var(--key-blk); }
.sy-key.scale { background: var(--key-sc); }
.sy-key.blk.scale { background: var(--key-blk-sc); }
.sy-key.on { background: var(--g); box-shadow: 0 0 14px rgba(var(--g-rgb),0.6); }
.sy-key.root::after { content: ''; position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--g); }

/* rings */
.sy-ringrow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; flex: 1; min-height: 0; }
.sy-ring { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 5px; min-height: 0; min-width: 0; }
.sy-ring .top { display: flex; align-items: center; gap: 5px; }
.sy-ring .top b { color: var(--c); font-size: 10.5px; letter-spacing: .1em; }
.sy-ring .tabs { display: flex; gap: 3px; }
.sy-ring .tabs button { height: 18px; padding: 0 6px; font-size: 9.5px; border-radius: 4px; border: 1px solid var(--line); background: var(--bg2); color: var(--dim); cursor: pointer; }
.sy-ring .tabs button.on { color: var(--g); border-color: var(--g); }
.sy-ring .tabs .sh { display: none; }
.sy-ring .cvbox { flex: 1; min-height: 50px; display: flex; align-items: center; justify-content: center; }
.sy-ring canvas { height: 100%; max-height: 100%; aspect-ratio: 1; max-width: 100%; display: block; }
.sy-ring .sy-params { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.sy-ringchips { display: none; }

/* arpeggio: progression of 4 chords + parameters; shares the lower left space with the rings on the desktop */
.sy-arpbody { display: flex; flex-direction: column; gap: 5px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; }
.sy-prog { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.sy-chord { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr); gap: 4px; align-items: center; padding: 3px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg3); min-width: 0; }
.sy-chord b { font-size: 13px; color: var(--y); text-align: center; white-space: nowrap; }
.sy-chord.empty b { color: var(--dim); }
.sy-chord.now { border-color: var(--y); box-shadow: 0 0 10px rgba(var(--y-rgb),0.35); }
.sy-chord select { min-width: 0; width: 100%; padding: 0 3px; appearance: none; -webkit-appearance: none; text-align: center; cursor: pointer; height: 22px; font-size: 10.5px; border-radius: 4px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); }
.sy-strip.grp-arp { border-color: rgba(var(--y-rgb),0.4); }

/* deck A/B and locks in the top bar */
.sy-deck { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.sy-deck button { height: 30px; width: 34px; border: 0; background: var(--bg2); cursor: pointer; font-weight: 700; color: var(--dim); }
.sy-deck button.on { background: var(--c); color: var(--on); }
body[data-deck="B"] .sy-deck button.on { background: var(--m); }
.sy-lock { height: 30px; width: 30px; padding: 0; border-radius: 7px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; opacity: 0.55; }
.sy-lock.on { opacity: 1; border-color: var(--y); box-shadow: 0 0 8px rgba(var(--y-rgb),0.35); }
/* the edited deck tints the panels' titles */
body[data-deck="A"] .sy-drums .sy-head b, body[data-deck="A"] .sy-synth .sy-head b, body[data-deck="A"] .sy-rings .sy-head b { color: var(--c); }
body[data-deck="B"] .sy-drums .sy-head b, body[data-deck="B"] .sy-synth .sy-head b, body[data-deck="B"] .sy-rings .sy-head b { color: var(--m); }
body[data-deck="A"] .sy-drums .sy-head b::after, body[data-deck="A"] .sy-synth .sy-head b::after, body[data-deck="A"] .sy-rings .sy-head b::after { content: ' · A'; }
body[data-deck="B"] .sy-drums .sy-head b::after, body[data-deck="B"] .sy-synth .sy-head b::after, body[data-deck="B"] .sy-rings .sy-head b::after { content: ' · B'; }
/* mixer */
.sy-mixer { display: flex; flex-direction: column; gap: 6px; }
.sy-xf { height: var(--ph); }
.sy-xf .fill { background: linear-gradient(90deg, rgba(var(--c-rgb),0.3), rgba(var(--m-rgb),0.3)); border-right-color: var(--head); }
.sy-xfbtns { display: flex; gap: 4px; }
.sy-xfbtns .sy-mini { flex: 1; }
.sy-decks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sy-deckcol { display: flex; flex-direction: column; gap: 3px; padding: 5px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg3); min-width: 0; }
.sy-deckcol:first-child.edit { border-color: var(--c); }
.sy-deckcol:last-child.edit { border-color: var(--m); }
.sy-deckhead { display: flex; align-items: center; gap: 5px; min-width: 0; }
.sy-deckhead b { font-size: 15px; }
.sy-deckcol:first-child .sy-deckhead b { color: var(--c); }
.sy-deckcol:last-child .sy-deckhead b { color: var(--m); }
.sy-deckhead .sy-dim { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sy-deckcol .sy-params { grid-template-columns: 1fr 1fr; gap: 3px; }
.sy-eq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.sy-eq .sy-param { height: 24px; } .sy-eq .sy-param .l { left: 4px; top: 1px; font-size: 8px; letter-spacing: 0; } .sy-eq .sy-param .v { left: 4px; bottom: 0; font-size: 10.5px; }
.sy-eq .sy-param .fill { background: linear-gradient(90deg, rgba(var(--c-rgb),0.08), rgba(var(--c-rgb),0.24)); border-right-color: var(--c); }
.sy-mutes { display: flex; gap: 3px; }
.sy-mutes { flex-wrap: wrap; }
.sy-mutes .sy-mini { flex: 1 1 58px; min-width: 0; padding: 0 2px; font-size: 10px; overflow: hidden; text-overflow: clip; }
.sy-mutes .sy-mini.on, .sy-deckcol > .sy-mini.on { background: var(--m); border-color: var(--m); color: var(--on); }
.sy-subhead { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.sy-subhead b { color: var(--g); letter-spacing: .12em; font-size: 10.5px; }
.sy-subhead .sy-dim { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sy-bank { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.sy-slot { height: 24px; border-radius: 6px; border: 1px dashed var(--line); background: var(--bg3); color: var(--dim); cursor: pointer; font-size: 10px; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sy-slot.full { border-style: solid; color: var(--head); border-color: rgba(var(--g-rgb),0.35); }
.sy-slot.queued { border-color: var(--y); color: var(--y); animation: syBlink .5s steps(2) infinite; }
@keyframes syBlink { 50% { opacity: .45; } }

/* cue + FX panel */
.sy-cue { display: flex; gap: 4px; align-items: center; }
.sy-cue .sy-sel { flex: 1; }
.sy-cue .sy-param { flex: 1; }
.sy-deckcol .sy-cuebtn.on { background: var(--y); border-color: var(--y); color: var(--on); box-shadow: 0 0 10px rgba(var(--y-rgb),0.4); }
.sy-fxbody { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.sy-seg { display: flex; gap: 3px; align-items: center; }
.sy-seg > span { font-size: 9.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; white-space: nowrap; }
.sy-seg button { flex: 1; height: 24px; border-radius: 5px; border: 1px solid var(--line); background: var(--bg3); cursor: pointer; font-size: 11px; color: var(--dim); }
.sy-seg button.on { border-color: var(--g); color: var(--g); }
.sy-perf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.sy-perf button { height: clamp(36px, 6vh, 56px); border-radius: 8px; border: 1px solid var(--line); background: var(--bg3); cursor: pointer; font-size: 12px; line-height: 1.15; padding: 0 2px; }
.sy-perf button:hover { border-color: var(--g); color: var(--g); }
.sy-perf button.drop { border-color: rgba(var(--m-rgb),0.6); color: var(--m); font-weight: 700; }
.sy-perf button.armed { background: var(--y); color: var(--on); border-color: var(--y); animation: syBlink .5s steps(2) infinite; }
.sy-perf button.live { background: var(--g); color: var(--on); border-color: var(--g); }
.sy-rolls { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)) auto; gap: 4px; align-items: center; }
.sy-rolls > span { font-size: 9.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }
.sy-rolls button { height: clamp(28px, 4.5vh, 44px); border-radius: 6px; border: 1px solid var(--line); background: var(--bg3); cursor: pointer; touch-action: none; user-select: none; }
.sy-rolls button.on { background: var(--c); color: var(--on); border-color: var(--c); }
.sy-fx .sy-params { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* master */
#scope { width: 100%; height: clamp(36px, 7vh, 170px); display: block; border-radius: 6px; background: #030306; border: 1px solid var(--line); }
.sy-master .sy-params { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* status bar */
.sy-status { display: flex; align-items: center; gap: 14px; height: 24px; padding: 0 12px; border-top: 1px solid var(--line); background: var(--well); font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; }
.sy-status b { color: var(--text); font-weight: 600; }
.sy-status .it + .it::before { content: '·'; color: rgba(var(--text-rgb),0.3); margin-right: 14px; }
.sy-status .ok { color: var(--g); }
.sy-status .warn { color: var(--y); }
.sy-status .bad { color: var(--r); }
.sy-status .meter { display: inline-block; width: 70px; height: 7px; border-radius: 2px; background: var(--track); vertical-align: middle; position: relative; overflow: hidden; }
.sy-status .meter i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--g) 70%, var(--y) 88%, var(--r)); }
.sy-status .clip { color: var(--r); font-weight: 700; }
.sy-tabbar { display: none; }

/* help + toast */
.sy-help { position: fixed; left: 50%; top: 80px; transform: translateX(-50%); z-index: 40; width: min(560px, calc(100vw - 32px)); background: var(--bg2); border: 1px solid rgba(var(--g-rgb),0.4); border-radius: 12px; padding: 16px; line-height: 1.7; box-shadow: 0 0 40px rgba(0,0,0,0.6); }
.sy-help[hidden] { display: none; }
.sy-toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 50; background: rgba(var(--bg2-rgb),0.96); border: 1px solid rgba(var(--g-rgb),0.45); border-radius: 8px; padding: 8px 14px; opacity: 0; transition: opacity .25s; pointer-events: none; max-width: calc(100vw - 32px); }
.sy-toast.show { opacity: 1; }

/* ── DESKTOP: one screen, no page scroll ── */
@media (min-width: 761px) {
  html, body { height: 100%; overflow: hidden; }
  body { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; height: 100dvh; }
  .sy-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) clamp(270px, 25vw, 350px); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "drums drums master" "synth synth master" "rings arp fx"; gap: 8px; padding: 8px 12px; min-height: 0; }
  .sy-arp { grid-area: arp; overflow: hidden; }
  /* the euclidean rings and the arpeggio side by side: the rings in a 2×2 grid, each one with its circle on the left */
  .sy-rings .sy-hint, .sy-arp .sy-hint { display: none; }
  .sy-ringrow { container-type: size; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .sy-ring { --cv: max(40px, min(calc((100cqh - 6px) / 2 - 12px), 24cqw, calc(50cqw - 215px))); display: grid; grid-template-columns: var(--cv) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "cv top" "cv ps"; gap: 4px 8px; padding: 5px; overflow: hidden; }
  .sy-ring .cvbox { grid-area: cv; min-height: 0; }
  .sy-ring canvas { width: 100%; height: auto; }
  .sy-ring .top { grid-area: top; min-width: 0; flex-wrap: nowrap; }
  .sy-ring .top b { white-space: nowrap; }
  .sy-ring .tabs button { padding: 0 4px; }
  .sy-ring .sy-params { grid-area: ps; align-content: start; min-height: 0; overflow-y: auto; --ph: clamp(22px, 2.9vh, 34px); }
  .sy-arp .sy-params.sy-row { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 4px; flex: none; }
  /* spare room goes to what you play live: the chord cards, the FX pads and the bank slots grow */
  .sy-prog { container-type: size; flex: 1 1 32px; min-height: 32px; max-height: 150px; }
  @container (min-height: 64px) {
    .sy-chord { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; padding: 5px 6px; }
    .sy-chord b { grid-column: 1 / -1; align-self: center; font-size: clamp(15px, 24cqh, 34px); }
  }
  .sy-fxbody { flex: 1 1 auto; }
  .sy-perf { flex: 3 1 auto; max-height: 230px; grid-auto-rows: minmax(clamp(36px, 6vh, 56px), 1fr); }
  .sy-perf button { height: auto; font-size: clamp(12px, 1.6vh, 16px); }
  .sy-rolls { flex: 2 1 auto; max-height: 130px; align-items: stretch; }
  .sy-rolls > span { align-self: center; }
  .sy-rolls button { height: auto; min-height: clamp(28px, 4.5vh, 44px); }
  .sy-mixer { flex: 1 1 auto; min-height: 0; }
  .sy-bank { flex: 1 1 auto; max-height: 150px; grid-auto-rows: minmax(24px, 1fr); }
  .sy-bank .sy-slot { height: auto; }
  .sy-drums { grid-area: drums; } .sy-synth { grid-area: synth; } .sy-rings { grid-area: rings; } .sy-master { grid-area: master; overflow: auto; } .sy-fx { grid-area: fx; overflow: auto; }
}
/* narrow desktop: the rings stack their header and scroll inside their card */
@media (min-width: 761px) and (max-width: 1240px) { .sy-ring .top { flex-wrap: wrap; row-gap: 3px; } .sy-ring { overflow-y: auto; } .sy-ring .tabs button { font-size: 9px; padding: 0 3px; } }
/* the top bar fits up to ~1680px: icons only for Consola and NODRUS, narrower faders and preset menu */
@media (min-width: 761px) and (max-width: 1679px) { .sy-bar .sy-lbl, .sy-bar .sy-ico { display: none; } .sy-bar .sy-group .sy-param { width: 84px; } #preset { max-width: 118px; } #scale { max-width: 94px; } .sy-bar { gap: 6px; } .sy-bar .sy-group { gap: 4px; } }
@media (min-width: 761px) and (max-width: 1500px) { .sy-ring .top { gap: 3px; } .sy-ring .top b { font-size: 9.5px; } .sy-ring .tabs { gap: 2px; } .sy-ring .tabs button { font-size: 9px; padding: 0 3px; } .sy-ring { --cv: max(28px, min(calc((100cqh - 6px) / 2 - 12px), 24cqw, calc(50cqw - 172px))); } .sy-ring .tabs .lg { display: none; } .sy-ring .tabs .sh { display: inline; } .sy-seg button { white-space: nowrap; overflow: hidden; padding: 0 2px; } .sy-arp .sy-params.sy-row { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); } }
@media (min-width: 761px) and (max-width: 1320px) { .sy-bar .sy-logo { display: none; } .sy-arp .sy-params.sy-row { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); } }
@media (min-width: 761px) and (max-width: 1180px) { .sy-hint { display: none; } .sy-bar { flex-wrap: wrap; } }
@media (min-width: 761px) and (max-height: 720px) { :root { --ph: 26px; } .sy-ring .sy-params { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ── PHONE: one section at a time, bottom tabs, menu for the rest ── */
@media (max-width: 760px) {
  :root { --ph: 40px; --sh: 30px; --nh: 56px; --kh: 64px; }
  body { padding-bottom: 92px; }
  .sy-bar { position: sticky; top: 0; flex-wrap: nowrap; }
  .sy-bar .sy-group .sy-param { width: 76px; }
  .sy-logo { display: none; }   /* the phone bar keeps play, deck A/B, BPM and its lock */
  .sy-bar { gap: 6px; padding: 6px 8px; }
  .sy-morebtn { display: inline-block; margin-left: auto; }
  .sy-more { display: none; position: fixed; left: 8px; right: 8px; top: 50px; z-index: 30; flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; background: var(--bg2); border: 1px solid rgba(var(--g-rgb),0.4); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.7); }
  .sy-more.open { display: flex; }
  .sy-more .sy-group { flex-wrap: wrap; }
  .sy-more .sy-group > * { flex: 1; }
  .sy-more .sy-sp { display: none; }
  .sy-main { display: block; padding: 8px; }
  .sy-panel { display: none; }
  body[data-tab="drums"] .sy-drums, body[data-tab="synth"] .sy-synth, body[data-tab="arp"] .sy-arp, body[data-tab="rings"] .sy-rings, body[data-tab="master"] .sy-master, body[data-tab="fx"] .sy-fx { display: flex; }
  .sy-prog { grid-template-columns: 1fr 1fr; }
  .sy-perf button { height: 54px; }
  .sy-rolls button { height: 50px; }
  .sy-hint { display: none; }
  /* drums: instrument chips + 4×4 pads for the chosen one */
  .sy-chips { display: flex; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .sy-chips button { flex: none; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg3); cursor: pointer; }
  .sy-chips button.sel { border-color: var(--g); color: var(--g); }
  .sy-chips button.has::after { content: ' •'; color: var(--g); }
  .sy-grid.pads { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .sy-grid.pads .sy-step { height: auto; aspect-ratio: 1; border-radius: 10px; }
  .sy-grid.pads .sy-step.q { background: var(--step-q2); }
  .sy-padbar { grid-column: 1 / -1; display: flex; gap: 6px; }
  .sy-padbar button { flex: 1; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg3); }
  .sy-padbar button.on.m { background: var(--m); color: var(--on); }
  .sy-padbar button.on.s { background: var(--y); color: var(--on); }
  .sy-params, .sy-params.sy-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* synth: 2 rows of 8 */
  .sy-seq { grid-template-columns: repeat(8, minmax(0, 1fr)); row-gap: 8px; }
  .sy-col .ab button { height: 24px; font-size: 11px; }
  .sy-tabs-in { flex-wrap: wrap; }
  .sy-tabs-in button { height: 30px; flex: 1; }
  /* rings: one at a time */
  .sy-ringchips { display: flex; }
  .sy-ringrow { display: block; }
  .sy-ring { display: none; }
  .sy-ring.cur { display: flex; }
  .sy-ring .cvbox { flex: none; height: min(70vw, 300px); }
  .sy-ring .tabs button { height: 28px; padding: 0 10px; font-size: 11px; }
  .sy-ring .sy-params { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #scope { height: 150px; }
  .sy-status { position: fixed; left: 0; right: 0; bottom: 56px; z-index: 25; gap: 10px; }
  .sy-status .it + .it::before { margin-right: 10px; }
  .sy-status .lo { display: none; }
  .sy-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; height: 56px; padding-bottom: env(safe-area-inset-bottom); background: rgba(var(--well-rgb),0.98); border-top: 1px solid var(--line); }
  .sy-tabbar button { flex: 1; border: 0; background: transparent; color: var(--dim); font-size: 12px; cursor: pointer; }
  .sy-tabbar button { font-size: 11px; }
  body[data-tab="drums"] .sy-tabbar [data-tab="drums"], body[data-tab="synth"] .sy-tabbar [data-tab="synth"], body[data-tab="arp"] .sy-tabbar [data-tab="arp"], body[data-tab="rings"] .sy-tabbar [data-tab="rings"], body[data-tab="master"] .sy-tabbar [data-tab="master"], body[data-tab="fx"] .sy-tabbar [data-tab="fx"] { color: var(--g); box-shadow: inset 0 2px 0 var(--g); }
}

/* dark native controls (dropdown lists, scrollbars): no white text on white */
:root { color-scheme: dark; }
select option, select optgroup { background: var(--bg2); color: var(--text); }

/* ── console ── */
.sy-console { position: fixed; left: 0; right: 0; top: 46px; bottom: 24px; z-index: 15; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; background: rgba(var(--bg-rgb),0.97); border-top: 1px solid var(--line); }
.sy-console[hidden] { display: none; }
.sy-conhead { display: flex; align-items: center; gap: 10px; }
.sy-conhead b { color: var(--g); letter-spacing: .14em; }
.sy-conbody { flex: 1; min-height: 0; display: flex; gap: 10px; }
.sy-strips { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.sy-strip { flex: 1 1 54px; min-width: 52px; max-width: 96px; min-height: 0; display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 6px 5px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--line); }
.sy-strip.grp-synth { border-color: rgba(var(--c-rgb),0.4); } .sy-strip.grp-rings { border-color: rgba(var(--m-rgb),0.35); }
.sy-strip.sep { margin-left: 6px; }
.sy-strip .nm { font-size: 10.5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.sy-strip .grp { font-size: 8.5px; text-align: center; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.sy-knob { position: relative; height: 30px; border-radius: 5px; background: var(--bg3); border: 1px solid var(--line); cursor: ew-resize; overflow: hidden; touch-action: none; user-select: none; }
.sy-knob .fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(var(--c-rgb),0.25); border-right: 2px solid var(--c); }
.sy-knob .l { position: absolute; left: 4px; top: 1px; font-size: 8.5px; color: var(--dim); text-transform: uppercase; }
.sy-knob .v { position: absolute; left: 4px; bottom: 1px; font-size: 10px; color: var(--head); }
.sy-faderwrap { flex: 1; min-height: 60px; display: flex; gap: 4px; justify-content: center; }
.sy-vf { position: relative; width: 28px; border-radius: 6px; background: var(--well); border: 1px solid var(--line); cursor: ns-resize; touch-action: none; user-select: none; }
.sy-vf::before { content: ''; position: absolute; left: 50%; top: 8px; bottom: 8px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--groove); }
.sy-vf .thumb { position: absolute; left: 2px; right: 2px; height: 16px; margin-top: -8px; border-radius: 4px; background: linear-gradient(var(--cap1), var(--cap2)); box-shadow: 0 2px 6px rgba(0,0,0,0.6); }
.sy-vf .thumb::after { content: ''; position: absolute; left: 3px; right: 3px; top: 7px; height: 2px; background: var(--cap-line); }
.sy-vf.deckA .thumb { background: linear-gradient(#9ff3ff, #2aa9c9); } .sy-vf.deckB .thumb { background: linear-gradient(#ffb3dc, #c9387f); } .sy-vf.master .thumb { background: linear-gradient(#c9ff9f, #4fbf1c); }
.sy-meter { position: relative; width: 8px; border-radius: 3px; background: var(--well); border: 1px solid var(--line); overflow: hidden; }
.sy-meter i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(to top, var(--g) 65%, var(--y) 85%, var(--r)); }
.sy-strip .val { font-size: 10px; text-align: center; color: var(--dim); font-variant-numeric: tabular-nums; }
.sy-strip .btns { display: flex; gap: 3px; }
.sy-strip .btns button { flex: 1; height: 22px; padding: 0; border-radius: 4px; border: 1px solid var(--line); background: var(--bg3); cursor: pointer; font-size: 10px; color: var(--dim); }
.sy-strip .btns button.on.m { background: var(--m); color: var(--on); border-color: var(--m); }
.sy-strip .btns button.on.s { background: var(--y); color: var(--on); border-color: var(--y); }
.sy-conmaster { flex: none; display: flex; gap: 6px; padding-left: 10px; border-left: 1px solid var(--line); }
.sy-conmaster .sy-strip { flex: 0 0 70px; }
.sy-strip .btns button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sy-conmaster .btns button { font-size: 9px; }
.sy-xfh { position: relative; height: 34px; border-radius: 6px; background: var(--well); border: 1px solid var(--line); cursor: ew-resize; touch-action: none; user-select: none; }
.sy-xfh .thumb { position: absolute; top: 2px; bottom: 2px; width: 16px; margin-left: -8px; border-radius: 4px; background: linear-gradient(90deg, var(--cap1), var(--cap2)); }
.sy-xfwrap { display: flex; flex-direction: column; gap: 4px; justify-content: flex-end; width: 124px; padding: 6px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--line); }
.sy-xfwrap .lbls { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; } .sy-xfwrap .lbls b:first-child { color: var(--c); } .sy-xfwrap .lbls b:last-child { color: var(--m); }
.sy-xfwrap .sy-xfbtns { display: flex; gap: 3px; }
@media (max-width: 760px) {
  .sy-console { top: 50px; bottom: 80px; padding: 8px; }
  .sy-conhead .sy-hint { display: none; }
  .sy-conbody { flex-direction: column; overflow-y: auto; }
  .sy-strips { flex: none; height: 62vh; min-height: 300px; }
  .sy-strip { flex: 0 0 70px; }
  .sy-conmaster { padding: 8px 0 0; border-left: 0; border-top: 1px solid var(--line); height: 300px; overflow-x: auto; }
  .sy-vf { width: 34px; }
}

/* phone remote popover */
.sy-remote { width: min(600px, calc(100vw - 32px)); }
.sy-rmtop { display: flex; gap: 14px; align-items: flex-start; }
.sy-qr { flex: none; width: 170px; height: 170px; background: #fff; border-radius: 8px; padding: 6px; color: #000; font-size: 11px; }
.sy-qr svg { display: block; width: 100%; height: 100%; }
.sy-rmstatus { color: var(--y); }
.sy-remote a { color: var(--g); word-break: break-all; font-size: 11px; }
#remoteBtn.on { border-color: var(--g); color: var(--g); box-shadow: 0 0 8px rgba(var(--g-rgb),0.35); }
@media (max-width: 760px) { .sy-rmtop { flex-direction: column; align-items: center; } }

/* MIDI */
#midiBtn.rx { border-color: var(--y); color: var(--y); }
.sy-midi { width: min(540px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; }
#midiBody { display: flex; flex-direction: column; gap: 8px; }
#midiBody .ok { color: var(--g); }
.sy-chk { display: flex; gap: 8px; align-items: center; cursor: pointer; }
#midiBody .sy-sel { height: auto; padding: 4px 8px; }
.sy-btn.on { border-color: var(--y); color: var(--y); }
body.sy-learning .sy-param, body.sy-learning .sy-knob, body.sy-learning .sy-vf { outline: 1px dashed rgba(var(--y-rgb),0.6); outline-offset: 1px; cursor: crosshair; }
.sy-armed { outline: 2px solid var(--y) !important; box-shadow: 0 0 12px rgba(var(--y-rgb),0.5); }

/* audio still locked by the browser while playing (e.g. started from SETRUS) */
.sy-unlock { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 0; background: rgba(var(--bg-rgb),0.82); color: var(--head); font: inherit; cursor: pointer; text-align: center; padding: 20px; }
.sy-unlock b { font-size: 22px; color: var(--g); text-shadow: 0 0 18px rgba(var(--g-rgb),0.6); animation: sy-unl 1s ease-in-out infinite alternate; }
.sy-unlock span { color: rgba(var(--text-rgb),0.7); max-width: 420px; }
@keyframes sy-unl { to { opacity: .55; } }
/* the EQ row of each deck takes its height from the scope, so the panels below keep theirs */
@media (min-width: 761px) { #scope { height: clamp(22px, calc(7vh - 27px), 170px); } }
@media (max-width: 760px) { .sy-eq .sy-param { height: 40px; } .sy-eq .sy-param .l { font-size: 9px; top: 2px; } .sy-eq .sy-param .v { font-size: 12px; bottom: 2px; } }
/* recording the live set */
#rec { color: var(--r); }
#rec.on { background: var(--r); border-color: var(--r); color: var(--on); animation: sy-rec 1.2s steps(2, jump-none) infinite; }
@keyframes sy-rec { 50% { opacity: 0.55; } }
.sy-status .rec { color: var(--r); font-weight: 700; }

/* ── LIGHT THEME (opt-in: js/theme.js sets data-theme="light" on <html>; the dark one above is the default) ──
   The same panel as the site: warm off-white, cream keys, slate strips for the top bar and the status bar, orange for
   what is on. Deck A stays blue and deck B magenta, darker so they read on a light panel. The spectrum stays a dark display. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e8e6de; --bg2: #f3f1ea; --bg3: #ebe2c8; --line: rgba(43,47,53,0.2);
  --g: #b23c08; --c: #1a657f; --m: #a8246a; --y: #865600; --r: #c21f3a; --text: #2b2f35; --dim: rgba(43,47,53,0.72);
  --head: #1b1e22; --on: #fff;
  --g-rgb: 178,60,8; --c-rgb: 26,101,127; --m-rgb: 168,36,106; --y-rgb: 134,86,0; --text-rgb: 43,47,53; --bg-rgb: 232,230,222; --bg2-rgb: 243,241,234; --well-rgb: 211,207,194;
  --well: #d3cfc2; --track: #d3cfc2; --groove: #a8a294; --step: #e6dfcb; --step-q: #d8cfb6; --step-q2: #d8cfb6;
  --key: #fbfaf6; --key-bd: #b5b0a3; --key-sc: #f3d6bd; --key-blk: #3c444d; --key-blk-sc: #7a4a2c;
  --cap1: #59636e; --cap2: #2f363d; --cap-line: #eceef0; --ring-off: #cbc5b5; --ring-mute: #d9b9a3;
}
/* the top bar, the status bar and the phone's tab bar are the dark slate strips: inside them the colours are the bright ones */
:root[data-theme="light"] .sy-bar, :root[data-theme="light"] .sy-status, :root[data-theme="light"] .sy-tabbar {
  color: var(--text);
  --bg2: #2f363d; --bg3: #2a3037; --line: rgba(255,255,255,0.18);
  --g: #ffa066; --c: #7fd4ee; --m: #ff8cc6; --y: #ffd23f; --r: #ff8fa0; --text: #eceef0; --dim: rgba(236,238,240,0.7);
  --head: #fff; --on: #000;
  --g-rgb: 255,160,102; --c-rgb: 127,212,238; --m-rgb: 255,140,198; --y-rgb: 255,210,63; --text-rgb: 236,238,240; --bg-rgb: 60,68,77; --bg2-rgb: 47,54,61; --well-rgb: 60,68,77;
  --well: #3c444d; --track: #23282e;
}
:root[data-theme="light"] .sy-step.on { background: rgba(var(--g-rgb),0.5); }
:root[data-theme="light"] .sy-panel { box-shadow: 0 1px 3px rgba(43,47,53,0.1); }
