/* The editor of our synths (daw/synth-ui.js): one layout kit, a theme per synth. */

.synthoverlay.open { align-items: stretch; }
.sheet.synthpanel {
  --radius: 12px;
  width: min(1040px, calc(100vw / var(--z, 1))); max-width: none; max-height: none; height: calc(100dvh / var(--z, 1)); margin: 0 auto;
  border-radius: 0; border: 0; padding: 10px 12px calc(env(safe-area-inset-bottom) + 16px);
  display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 900px) { .synthoverlay.open { align-items: center; } .sheet.synthpanel { height: min(calc(94dvh / var(--z, 1)), 980px); border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.55); } }
.synthpanel button, .synthpanel select, .synthpanel input { color: var(--text); }
.synthpanel .x { background: var(--panel2); border: 1px solid var(--line); color: var(--text); }

/* ---- header: brand, LCD with the preset, actions ---- */
.shead { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.sbrand { display: flex; align-items: center; gap: 8px; letter-spacing: 3px; font-size: 15px; }
.sbrand .sicon { font-size: 22px; filter: drop-shadow(0 0 6px var(--fill)); }
.sbrand b { color: var(--accent); font-weight: 800; }
.slcd { display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; min-width: 0; background: var(--lcdbg); border-radius: 8px; padding: 3px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.04); border: 1px solid var(--line); }
.slcd button { background: transparent; border: 0; color: var(--lcdtext); min-height: 34px; padding: 0 6px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.slcd .lcdpreset { font-size: 15px; letter-spacing: 1px; text-shadow: 0 0 8px var(--lcdglow, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.sactions { display: flex; gap: 6px; }
.sactions .sclose { min-width: 40px; }
@media (max-width: 640px) {
  .shead { grid-template-columns: 1fr auto; }
  .slcd { grid-column: 1 / -1; order: 3; }
  .sbrand b { font-size: 13px; }
}

/* ---- macros, tabs, sources ---- */
.smacros { display: flex; gap: 6px; justify-content: space-around; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 6px; }
.stabs { flex: 0 0 auto; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.stabs button { flex: 0 0 auto; background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 14px; font-weight: 600; letter-spacing: .4px; }
.stabs button.on { background: var(--accent); border-color: var(--accent); color: var(--onaccent, #111); }
.ssources { flex: 0 0 auto; display: flex; gap: 6px; overflow-x: auto; padding: 6px 2px; margin: 0 -2px; background: var(--bg); scrollbar-width: none; touch-action: pan-x; }
.schip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 11px 5px 8px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); touch-action: none; cursor: grab; }
.schip .sdot, .sslot .sdot { width: 10px; height: 10px; border-radius: 50%; background: var(--source); box-shadow: 0 0 6px var(--source); flex: 0 0 auto; }
.synthpanel.assigning .schip { opacity: .7; }
.sassignbanner { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 10px; background: color-mix(in srgb, var(--assign) 22%, var(--panel)); border: 1px solid var(--assign); font-size: 13px; }
.sassignbanner[hidden] { display: none; }
.sghost { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%, -160%); padding: 4px 10px; border-radius: 999px; background: var(--source); color: #111; font-size: 12px; font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.5); }

/* ---- sections ---- */
.sbody { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); grid-auto-rows: max-content; gap: 8px; align-content: start; padding-bottom: 20px; }
.ssection { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px 10px; display: grid; gap: 6px; align-content: start; position: relative; overflow: hidden; }
.ssection::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 70%); opacity: .7; }
.ssection.wide { grid-column: 1 / -1; }
.ssectionhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 32px; }
.ssectionhead h3 { margin: 0; font-size: 11.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.ssectionhead .sselect { flex-direction: row; align-items: center; gap: 6px; }
.ssectionhead .sselect span { display: none; }
.ssectionbody { display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: flex-end; }
.ssection.off .ssectionbody { opacity: .38; }
.srow { display: flex; flex-wrap: wrap; gap: 6px 4px; align-items: flex-end; flex-basis: 100%; }
.snote { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.45; flex-basis: 100%; }

/* ---- knob ---- */
.sknob { width: 62px; display: flex; flex-direction: column; align-items: center; gap: 0; user-select: none; -webkit-user-select: none; }
.sknobdial { width: 52px; height: 52px; touch-action: none; cursor: ns-resize; overflow: visible; }
.sknob.small { width: 54px; } .sknob.small .sknobdial { width: 40px; height: 40px; }
.sknob.big { width: 84px; } .sknob.big .sknobdial { width: 70px; height: 70px; }
.sktrack { fill: none; stroke: var(--knobtrack, var(--line)); stroke-width: 7; stroke-linecap: round; }
.skvalue { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 3px var(--fill)); }
.skmod { fill: none; stroke-width: 4; stroke-linecap: round; opacity: .95; }
.skcap { fill: var(--knobcap); stroke: var(--knobedge, rgba(255,255,255,.08)); stroke-width: 1.5; }
.skpointer { stroke: var(--pointer, var(--text)); stroke-width: 4.5; stroke-linecap: round; }
.sklive { fill: var(--livedot, #fff); filter: drop-shadow(0 0 3px #fff); opacity: 0; }
.sklive.on { opacity: 1; }
.sknob span.skvalue { font-size: 11px; color: var(--text); margin-top: -4px; white-space: nowrap; }
.sklabel { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sknob.modulated .sklabel { color: var(--text); }
.synthpanel.assigning .sknob.modable .sknobdial { filter: drop-shadow(0 0 7px var(--assign)); animation: sknobpulse 1s ease-in-out infinite alternate; }
.synthpanel.assigning .sknob:not(.modable) { opacity: .35; }
.sknob.dropping .sknobdial { transform: scale(1.18); }
@keyframes sknobpulse { from { filter: drop-shadow(0 0 2px var(--assign)); } to { filter: drop-shadow(0 0 10px var(--assign)); } }

/* ---- selects and toggles ---- */
.sselect { display: flex; flex-direction: column; gap: 2px; font-size: 10px; color: var(--muted); min-width: 0; }
.sselect select, .synthpanel .sslot select, .spopover select, .spopover input[type=number] { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; min-height: 32px; max-width: 100%; }
.stoggle { background: var(--panel2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; min-height: 30px; }
.stoggle.on { color: var(--onaccent, #111); background: var(--accent); border-color: var(--accent); }
.stoggle.spower { letter-spacing: 1.4px; text-transform: uppercase; font-size: 11px; }
.stoggle.spower::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: currentColor; box-shadow: 0 0 6px currentColor; opacity: .8; }

/* ---- displays ---- */
.sdisplay { flex-basis: 100%; width: 100%; display: block; border-radius: 9px; background: var(--displaybg, var(--lcdbg)); border: 1px solid var(--line); touch-action: none; cursor: crosshair; box-shadow: inset 0 2px 10px rgba(0,0,0,.45); }

/* ---- modulation: slots, popover, matrix ---- */
.sslot { display: grid; gap: 6px; padding: 8px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--source); }
.sslothead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sslothead select { flex: 1 1 120px; min-width: 0; }
.sslothead .sarrow { color: var(--muted); }
.sslotrange { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; align-items: center; }
.sslotrange select { grid-column: 1 / -1; }
.sslider { display: grid; grid-template-columns: 30px 1fr 44px; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.sslider input { width: 100%; accent-color: var(--source, var(--accent)); }
.sslider output { text-align: right; color: var(--text); font-size: 11.5px; }
.smatrix { display: grid; gap: 8px; flex-basis: 100%; }
.saddslot { justify-self: start; }
.spopover { position: absolute; z-index: 20; width: min(360px, calc(100% - 12px)); background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; box-shadow: 0 18px 50px rgba(0,0,0,.55); }
.spophead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.spophead b { font-size: 13px; }
.spoprow { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.spoprow input { flex: 1; min-width: 0; }
.spopmods { display: grid; gap: 8px; }
.spopnote { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.spopover .sslot { background: var(--panel); }

/* ---- presets ---- */
.page-presets { display: block; }
.spresettabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.spresettabs button { background: var(--panel2); border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 6px 12px; }
.spresettabs button.on { color: var(--onaccent, #111); background: var(--accent); border-color: var(--accent); }
.spresetlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.spreset { display: flex; gap: 4px; }
.spresetname { flex: 1; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-weight: 600; }
.spreset.current .spresetname { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; color: var(--accent); }

/* ════════ themes ════════ */
/* Swarm: graphite and honey, a faint honeycomb */
.theme-swarm {
  --bg: #131315; --panel: #1c1d21; --panel2: #25262b; --line: #34353c; --text: #efeadf; --muted: #9b968b;
  --accent: #f5b83d; --onaccent: #1a1205; --grid: #2b2c32; --fill: rgba(245, 184, 61, .16);
  --lcdbg: #0c0a04; --lcdtext: #ffc95a; --lcdglow: rgba(255, 190, 70, .55); --knobcap: #2b2c32; --displaybg: #0f0e0b;
  background-color: #131315;
  background-image: radial-gradient(circle at 0 0, rgba(245,184,61,.06) 0 2px, transparent 3px), radial-gradient(circle at 14px 8px, rgba(245,184,61,.05) 0 2px, transparent 3px);
  background-size: 28px 16px;
}
.theme-swarm .ssection { background: linear-gradient(180deg, #202126, #1b1c20); }

/* Elixir: deep blue glass, cyan light, blue modulation */
.theme-elixir {
  --bg: #090d14; --panel: #0f1622; --panel2: #152033; --line: #22314a; --text: #e5f1ff; --muted: #7d92ad;
  --accent: #36d0ff; --onaccent: #04121a; --grid: #1a2a40; --fill: rgba(54, 208, 255, .15);
  --lcdbg: #04080e; --lcdtext: #80e4ff; --lcdglow: rgba(80, 210, 255, .6); --knobcap: #18243a; --displaybg: #050a12;
  background: radial-gradient(1200px 500px at 50% -200px, #12345a55, transparent), #090d14;
}
.theme-elixir .ssection { background: linear-gradient(180deg, #111a29, #0d1420); }
.theme-elixir .ssection::before { background: linear-gradient(90deg, #36d0ff, #7c6bff 60%, transparent); }

/* Alabaster: white enamel, dark knobs, a red line and a green-grey LCD */
.theme-alabaster {
  --bg: #e7e5df; --panel: #f7f6f2; --panel2: #ffffff; --line: #cdc9bf; --text: #1d1c1a; --muted: #6c6860;
  --accent: #d23c2c; --onaccent: #fff; --grid: #d9d5cb; --fill: rgba(210, 60, 44, .12);
  --lcdbg: #a8b597; --lcdtext: #1d2715; --lcdglow: transparent; --knobcap: #2a2a2d; --knobedge: #000; --pointer: #f4f2ec; --knobtrack: #d3cfc5; --livedot: #d23c2c; --displaybg: #b3bfa4;
  background: linear-gradient(180deg, #efede8, #e2e0d9);
}
.theme-alabaster .ssection { box-shadow: 0 1px 0 #fff inset, 0 2px 6px rgba(0,0,0,.06); }
.theme-alabaster .ssectionhead h3 { color: #1d1c1a; }
.theme-alabaster .ssectionhead h3::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); margin-right: 7px; vertical-align: 1px; }
.theme-alabaster .sbrand b { color: #1d1c1a; letter-spacing: 5px; }
.theme-alabaster .sdisplay { box-shadow: inset 0 2px 6px rgba(0,0,0,.25); }
.theme-alabaster .sklive { filter: none; }

/* the app's general hover colour would cover the themes */
.sheet.synthpanel button:hover:not(:disabled) { background-color: color-mix(in srgb, var(--accent) 14%, var(--panel2)); }
.sheet.synthpanel button.on:hover:not(:disabled) { background-color: var(--accent); }
.sheet.synthpanel .slcd button:hover:not(:disabled) { background-color: rgba(255,255,255,.06); }

/* ---- Alabaster's arp pattern: 16 steps ---- */
.sstepgrid { flex-basis: 100%; display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; }
@media (max-width: 640px) { .sstepgrid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.sstep { position: relative; height: 86px; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); overflow: hidden; touch-action: none; display: grid; align-content: space-between; justify-items: center; color: var(--muted); }
.sstep i { position: absolute; left: 0; right: 0; bottom: 0; height: var(--lift); background: color-mix(in srgb, var(--accent) 18%, transparent); border-top: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.sstep.on { border-color: var(--accent); color: var(--text); }
.sstep.on i { background: color-mix(in srgb, var(--accent) 38%, transparent); border-top-color: var(--accent); }
.sstep span { position: relative; font-size: 12px; font-weight: 700; margin-top: 6px; }
.sstep small { position: relative; font-size: 9px; margin-bottom: 4px; }
.sstep.beyond { opacity: .3; }
.sslotspeed { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; padding: 4px 0; border-top: 1px dashed var(--line); }
.sslotspeed[hidden] { display: none; }
.sslotspeedlabel { font-size: 11px; color: var(--muted); align-self: center; }

/* Maya: dark jade stone, gold, a stepped (greca) border on the sections */
.theme-maya {
  --bg: #0d1412; --panel: #13201c; --panel2: #1a2a25; --line: #2b423a; --text: #ecf3ec; --muted: #8fa89b;
  --accent: #e3ad3c; --onaccent: #1b1204; --grid: #22362f; --fill: rgba(227, 173, 60, .15);
  --lcdbg: #07100d; --lcdtext: #6fe0b0; --lcdglow: rgba(80, 220, 160, .45); --knobcap: #1e3029; --displaybg: #08110e;
  background: radial-gradient(900px 400px at 50% -150px, #1f4a3b66, transparent), #0d1412;
}
.theme-maya .ssection { background: linear-gradient(180deg, #152520, #111c18); }
.theme-maya .ssection::before { height: 6px; opacity: .9;
  background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 12px), linear-gradient(90deg, #3fbf8a, transparent);
  -webkit-mask: linear-gradient(90deg, #000, transparent 85%); mask: linear-gradient(90deg, #000, transparent 85%); }
.theme-maya .sbrand b { color: #6fe0b0; }
.smayapad { flex-basis: 100%; min-height: 56px; border-radius: 12px; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--panel2)); color: var(--text); font-weight: 700; font-size: 15px; touch-action: manipulation; }
.smayapad.hit { background: var(--accent); color: var(--onaccent); }
.smayactl { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.smayactl select { width: auto; flex: 0 0 auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; min-height: 36px; }
.smayaplay.on { background: var(--accent) !important; color: var(--onaccent) !important; }
.smayalanes { flex-basis: 100%; display: grid; gap: 8px; }
.smayalane { display: grid; gap: 4px; padding: 6px 8px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.smayalane.off .smayacells { opacity: .3; }
.smayalanehead { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.smayalanehead b { font-size: 12.5px; }
.smayalanehead .sselect span { display: none; }
.smayacells { display: grid; grid-template-columns: repeat(var(--steps, 16), minmax(0, 1fr)); gap: 3px; }
.smayacell { height: 26px; padding: 0; border-radius: 5px; border: 1px solid var(--line); background: var(--panel); min-height: 0; }
.smayacell.beat { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.smayacell.on { background: color-mix(in srgb, var(--accent) calc(35% + var(--velocity) * 65%), var(--panel)); border-color: var(--accent); }
.smayaknobs { display: flex; flex-wrap: wrap; gap: 2px; }
.smayadesigner { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; }
.smayagroove { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.smayagroove b { flex: 1; font-size: 13px; }
.smayagroove .x { min-height: 32px; padding: 0 10px; font-size: 12px; }
.smayagroove.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.smayamore { justify-self: start; }

/* computers: a wide window like the originals, more sections side by side */
@media (min-width: 1500px) {
  .sheet.synthpanel { width: min(1900px, calc(96vw / var(--z, 1))); }
  .sbody { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
  .sbody .swave { height: 130px !important; }
}

/* Impulse: black steel, a hot red-orange like a speaker cone under a strobe */
.theme-impulse {
  --bg: #0c0b0b; --panel: #161313; --panel2: #1f1a19; --line: #3a2b27; --text: #f4ece8; --muted: #a8948c;
  --accent: #ff5a2a; --onaccent: #190500; --grid: #2e2220; --fill: rgba(255, 90, 42, .16);
  --lcdbg: #110706; --lcdtext: #ff8a5c; --lcdglow: rgba(255, 110, 60, .5); --knobcap: #251d1b; --displaybg: #0d0807;
  background: radial-gradient(700px 360px at 50% -140px, #ff5a2a33, transparent), #0c0b0b;
}
.theme-impulse .ssection { background: linear-gradient(180deg, #1a1514, #131010); }
.theme-impulse .ssection::before { height: 3px; background: linear-gradient(90deg, var(--accent), #ffc04a 40%, transparent); }
.theme-impulse .sbrand b { color: var(--accent); letter-spacing: 6px; }
.simpulsetop { flex-basis: 100%; display: grid; grid-template-columns: 1fr 120px; gap: 8px; align-items: stretch; }
.simpulsewave { width: 100%; height: 130px; }
.simpulsepad { border-radius: 14px; border: 1px solid var(--accent); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 30%, var(--panel2)), var(--panel2)); color: var(--text); font-weight: 800; font-size: 16px; touch-action: manipulation; }
.simpulsepad.hit { background: var(--accent); color: var(--onaccent); }
.simpulseinfo { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .simpulsetop { grid-template-columns: 1fr; } .simpulsepad { min-height: 56px; } }

/* Resonance: deep violet like a bass cabinet under UV light, a lime squelch accent */
.theme-resonance {
  --bg: #0e0b14; --panel: #17121f; --panel2: #201a2b; --line: #352a47; --text: #efeaf7; --muted: #9c90b0;
  --accent: #b6f23a; --onaccent: #142000; --grid: #2a2238; --fill: rgba(182, 242, 58, .14);
  --lcdbg: #0a0710; --lcdtext: #c9a6ff; --lcdglow: rgba(170, 120, 255, .5); --knobcap: #241d30; --displaybg: #0b0812;
  background: radial-gradient(800px 380px at 50% -150px, #6a3cc044, transparent), #0e0b14;
}
.theme-resonance .ssection { background: linear-gradient(180deg, #1a1424, #14101b); }
.theme-resonance .ssection::before { height: 3px; background: repeating-linear-gradient(90deg, var(--accent) 0 10px, transparent 10px 14px); opacity: .8; }
.theme-resonance .sbrand b { color: #c9a6ff; letter-spacing: 4px; }

/* step sequencer (Resonance, Fractal) */
.sseqctl { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sseqctl select { width: auto; flex: 0 0 auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; min-height: 36px; }
.sseqplay.on { background: var(--accent) !important; color: var(--onaccent) !important; }
.sseqgrid { flex-basis: 100%; display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 4px; }
@media (max-width: 640px) { .sseqgrid { grid-template-columns: repeat(8, minmax(0, 1fr)); row-gap: 8px; } }
.sseqcol { display: grid; gap: 3px; }
.sseqcol.beyond { opacity: .3; }
.sseqstep { height: 78px; }
.sseqflags { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.sseqflag { min-height: 26px; padding: 0; font-size: 10px; font-weight: 700; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); }
.sseqflag.on { background: var(--accent); color: var(--onaccent); border-color: var(--accent); }
.sseqlibrary { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.sseqlibrary .x { min-height: 34px; padding: 0 12px; font-size: 12.5px; }

/* Fractal: deep night-blue glass with an ice-cyan edge, like a crystal in UV */
.theme-fractal {
  --bg: #070b12; --panel: #0d1420; --panel2: #131c2b; --line: #22324a; --text: #e8f3ff; --muted: #8aa0bb;
  --accent: #39e6ff; --onaccent: #001a20; --grid: #1a2638; --fill: rgba(57, 230, 255, .14);
  --lcdbg: #04080e; --lcdtext: #7ef3ff; --lcdglow: rgba(60, 220, 255, .55); --knobcap: #18233a; --displaybg: #050a12;
  background: radial-gradient(800px 380px at 30% -160px, #1d4dff33, transparent), radial-gradient(600px 300px at 90% -120px, #39e6ff22, transparent), #070b12;
}
.theme-fractal .ssection { background: linear-gradient(160deg, #101a2a, #0b111c); }
.theme-fractal .ssection::before { height: 3px; background: linear-gradient(90deg, #39e6ff, #9b6bff 50%, transparent); }
.theme-fractal .sbrand b { color: var(--accent); letter-spacing: 5px; }
.sfractalslice { width: 100%; height: 110px; flex-basis: 100%; }
.sfractalspace { width: min(100%, 300px); aspect-ratio: 1; height: auto; touch-action: none; border-radius: 50%; }
.spresettabs .spreview { margin-left: auto; }

/* computer: the editor as a floating window (daw/floating-window.js) */
.overlay.floatwin { background: none !important; pointer-events: none; backdrop-filter: none; }
.overlay.floatwin > .sheet { pointer-events: auto; position: fixed; margin: 0; max-width: none; max-height: none; resize: both; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.overlay.floatwin > .sheet.synthpanel { height: auto; }
.overlay.floatwin .shead { cursor: move; }
.sactions .spin.on { background: var(--accent); color: var(--onaccent); }

/* pattern presets (daw/pattern-presets.js) */
.spatterns { flex-basis: 100%; display: grid; gap: 8px; }
.spatternhead, .spatterngenres { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.spatternhead select { width: auto; margin-left: auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; min-height: 36px; }
.spatternhead .x.on, .spatterngenres .x.on { background: var(--accent); color: var(--onaccent); border-color: var(--accent); }
.spatterngenres .x { min-height: 32px; padding: 0 10px; font-size: 12.5px; }
.spatternlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.spatternrow { display: flex; gap: 4px; }
.spatternname { flex: 1; min-height: 40px; text-align: left; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); font-weight: 600; }
.spatternwrite { min-width: 44px; font-size: 16px; }
