/* AURORA 極光 — design tokens + application layout (index.html, src/ui/main.js, src/ui/app/*).
   Component styles (knobs, sliders, keyboard …) live in css/components.css; visualisers in css/visuals.css. */

/* ═══════════════════════════════ tokens ═══════════════════════════════ */
:root {
  --bg-0: #07080d; --bg-1: #0c0f18; --bg-2: #121726;
  --panel: rgba(22, 28, 46, .72); --panel-hi: rgba(38, 48, 78, .6);
  --line: rgba(140, 160, 220, .14); --text: #e8ecff; --text-dim: #8e97b8; --text-faint: #7a83a6;
  --a-cyan: #5cf2ff; --a-teal: #3ef0b0; --a-violet: #a78bfa; --a-pink: #ff6bd6; --a-amber: #ffc46b; --a-red: #ff6b81;
  --grad-aurora: linear-gradient(120deg, #3ef0b0, #5cf2ff 30%, #a78bfa 65%, #ff6bd6);
  --radius: 14px; --radius-sm: 8px; --shadow: 0 10px 40px rgba(0, 0, 0, .45);
  /* PingFang TC first: Apple devices draw CJK with the native face and never fetch the ~1.2 MB of Noto Sans TC slices */
  --font-ui: "Inter", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* section accents */
  --acc-sources: var(--a-cyan); --acc-filter: var(--a-violet); --acc-mod: var(--a-amber); --acc-fx: var(--a-pink); --acc-perform: var(--a-teal);
  /* layout */
  --topbar-h: calc(60px + env(safe-area-inset-top)); --dock-h: 150px; --sidebar-w: 276px; --gap: 12px;
  --shadow-soft: 0 6px 24px rgba(0, 0, 0, .32);
  --glass-border: rgba(160, 180, 240, .12);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.3, 1.35, .5, 1);
  /* type scale: English sub-labels / captions never go below --fs-cap at desktop sizes */
  --fs-cap: 11px; --fs-meta: 11px; --fs-small: 12px; --fs-body: 13px;
  --ls-cap: .07em;
  color-scheme: dark;
}

/* ═══════════════════════════════ base ═══════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 400 13px/1.4 var(--font-ui);
  color: var(--text);
  background: var(--bg-0);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
body::before { /* aurora sky behind everything */
  content: ""; position: fixed; inset: -10%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(62, 240, 176, .10), transparent 60%),
    radial-gradient(55% 55% at 88% 2%, rgba(167, 139, 250, .15), transparent 62%),
    radial-gradient(50% 45% at 55% 108%, rgba(255, 107, 214, .08), transparent 60%),
    radial-gradient(40% 35% at 40% 40%, rgba(92, 242, 255, .04), transparent 70%),
    var(--bg-0);
}
body::after { /* film grain */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
::selection { background: rgba(167, 139, 250, .35); }
button { font: inherit; color: inherit; }
button:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--a-cyan) 80%, transparent); outline-offset: 2px;
}
[hidden] { display: none !important; }
.ic-wrap { display: inline-grid; place-items: center; flex: none; line-height: 0; }
.ic { display: block; }
* { scrollbar-width: thin; scrollbar-color: rgba(140, 160, 220, .25) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(140, 160, 220, .22); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(140, 160, 220, .38); }
::-webkit-scrollbar-track { background: transparent; }

.glass {
  background: linear-gradient(180deg, rgba(30, 38, 62, .62), rgba(16, 20, 34, .66));
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), var(--shadow-soft);
}

/* ═══════════════════════════════ app grid ═══════════════════════════════ */
.app {
  height: 100vh; height: 100dvh;
  overflow: clip; /* guard: nothing inside may grow the document (a page scroll shifts the whole instrument) */
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) var(--dock-h);
  grid-template-areas: "top top" "side main" "dock dock";
}
.topbar { grid-area: top; }
.sidebar { grid-area: side; }
.main { grid-area: main; }
.dock { grid-area: dock; }
.main {
  min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden;
  padding: var(--gap) max(14px, env(safe-area-inset-right)) 18px max(14px, env(safe-area-inset-left)); scroll-behavior: smooth; overscroll-behavior: contain;
  scroll-padding-top: 54px;
  /* soft fade where content slides under the keyboard dock ("there is more below") */
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 22px), rgba(0, 0, 0, .15));
  mask-image: linear-gradient(180deg, #000 calc(100% - 22px), rgba(0, 0, 0, .15));
}
.scrim { display: none; }

/* ═══════════════════════════════ buttons ═══════════════════════════════ */
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; flex: none;
  border: 0; border-radius: 10px; cursor: pointer; color: var(--text-dim);
  background: linear-gradient(180deg, rgba(40, 48, 76, .55), rgba(20, 25, 40, .6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px rgba(140, 160, 220, .12);
  transition: color .18s ease, box-shadow .2s ease, transform .15s ease, background .2s ease;
}
.icon-btn:hover { color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 1px rgba(92, 242, 255, .38), 0 0 14px rgba(92, 242, 255, .12); }
.icon-btn:active { transform: scale(.94); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }
.icon-btn.is-on { color: var(--a-amber); }

.tb-btn, .pill-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 10px; flex: none;
  border: 0; border-radius: 10px; cursor: pointer; color: var(--text-dim); white-space: nowrap;
  font-size: 12.5px; font-weight: 500; letter-spacing: .02em;
  background: linear-gradient(180deg, rgba(40, 48, 76, .55), rgba(20, 25, 40, .6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px rgba(140, 160, 220, .12);
  transition: color .18s ease, box-shadow .2s ease, transform .15s ease;
}
.tb-btn:hover, .pill-btn:hover { color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 1px rgba(167, 139, 250, .45), 0 0 16px rgba(167, 139, 250, .14); }
.tb-btn:active, .pill-btn:active { transform: scale(.96); }
.tb-btn--mutate:hover { color: var(--a-teal); }
.tb-btn--random:hover { color: var(--a-pink); }
.tb-btn.is-flash .ic { animation: spin-pop .6s var(--ease-spring); }
.tb-btn.is-flash { animation: glow-pulse .7s ease-out; }
@keyframes spin-pop { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(-20deg) scale(1.25); } 100% { transform: rotate(0) scale(1); } }
@keyframes glow-pulse { 0% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 1px var(--a-violet), 0 0 26px rgba(167, 139, 250, .6); } 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px rgba(140, 160, 220, .12); } }
.pill-btn.is-on { color: #06121a; background: var(--grad-aurora); box-shadow: 0 0 18px rgba(92, 242, 255, .35); }

.btn {
  height: 36px; padding: 0 18px; border: 0; border-radius: 11px; cursor: pointer; font-weight: 600; font-size: 13px;
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:active { transform: scale(.97); }
.btn--primary { color: #061018; background: var(--grad-aurora); box-shadow: 0 4px 18px rgba(92, 242, 255, .25); }
.btn--primary:hover { filter: brightness(1.08); box-shadow: 0 6px 26px rgba(167, 139, 250, .35); }
.btn--ghost { color: var(--text-dim); background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { color: var(--text); }
.btn--danger { color: #fff; background: linear-gradient(120deg, #ff6b81, #ff6bd6); }

/* ═══════════════════════════════ top bar ═══════════════════════════════ */
.topbar {
  position: relative; z-index: 40;
  display: flex; align-items: center; gap: 14px; padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(14, 17, 28, .92), rgba(10, 12, 20, .78));
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
}
.topbar::after { /* aurora hairline */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; pointer-events: none;
  background: var(--grad-aurora); opacity: .35;
}
.tb-left, .tb-center, .tb-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-left { flex: none; }
.tb-center { flex: 1 1 auto; justify-content: center; }
.tb-right { flex: none; gap: 8px; }
.tb-browse { display: none; }
.tb-edit { display: none; }
.tb-group { display: flex; align-items: center; gap: 6px; flex: none; }
.tb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 2px; }

.logo { display: flex; align-items: center; gap: 9px; user-select: none; padding-right: 6px; }
.logo__mark {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: conic-gradient(from 200deg, #3ef0b0, #5cf2ff, #a78bfa, #ff6bd6, #3ef0b0);
  -webkit-mask: radial-gradient(circle, transparent 5.5px, #000 6.5px); mask: radial-gradient(circle, transparent 5.5px, #000 6.5px);
  box-shadow: 0 0 18px rgba(92, 242, 255, .45);
  animation: logo-spin 14s linear infinite;
}
@keyframes logo-spin { to { transform: rotate(360deg); } }
.logo__word {
  font-weight: 800; font-size: 17px; letter-spacing: .26em;
  background: var(--grad-aurora); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: aurora-shift 12s ease-in-out infinite alternate;
}
.logo__zh { font-size: 13px; font-weight: 500; color: var(--text-dim); letter-spacing: .12em; margin-left: -2px; }
@keyframes aurora-shift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

/* preset navigator */
.pn {
  display: flex; align-items: center; gap: 4px; padding: 3px; border-radius: 13px; min-width: 0; flex: 0 1 auto; overflow: hidden;
  background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px var(--line);
}
.pn .icon-btn { width: 30px; height: 30px; background: none; box-shadow: none; }
.pn .icon-btn:hover { background: rgba(255, 255, 255, .05); }
.pn__main {
  display: flex; align-items: center; gap: 8px; min-width: 96px; width: 240px; max-width: 280px; flex: 0 1 auto; height: 30px; padding: 0 12px;
  border: 0; border-radius: 9px; cursor: pointer; background: rgba(255, 255, 255, .03);
  transition: background .2s ease;
}
.pn__main:hover { background: rgba(255, 255, 255, .07); }
.pn__cat { color: var(--c, var(--a-cyan)); filter: drop-shadow(0 0 6px color-mix(in oklab, var(--c, var(--a-cyan)) 60%, transparent)); display: inline-flex; }
.pn__text { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pn__name { font-weight: 600; font-size: 14px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn__dirty { width: 6px; height: 6px; border-radius: 50%; background: var(--a-amber); box-shadow: 0 0 8px var(--a-amber); flex: none; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .25s var(--ease-spring); }
.topbar.is-dirty .pn__dirty { opacity: 1; transform: none; }
.topbar:not(.is-dirty) .pn__dirty { width: 0; margin-left: -6px; }
.pn__fav.is-on { color: var(--a-amber); }
.pn__fav.is-on .ic { fill: currentColor; filter: drop-shadow(0 0 6px rgba(255, 196, 107, .7)); }

/* demo button */
.demo {
  position: relative; display: inline-flex; align-items: center; gap: 9px; height: 38px; padding: 0 18px 0 12px; flex: none;
  border: 0; border-radius: 999px; cursor: pointer; overflow: hidden; isolation: isolate;
  color: #051018; font-weight: 700; letter-spacing: .04em;
  background: var(--grad-aurora); background-size: 180% 100%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .15) inset, 0 6px 22px rgba(92, 242, 255, .22), 0 0 30px rgba(167, 139, 250, .18);
  transition: transform .18s var(--ease-spring), box-shadow .25s ease, background-position .6s ease;
  animation: aurora-shift 8s ease-in-out infinite alternate;
}
.demo:hover { transform: translateY(-1px) scale(1.03); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25) inset, 0 8px 30px rgba(92, 242, 255, .35), 0 0 40px rgba(255, 107, 214, .25); }
.demo:active { transform: scale(.97); }
.demo__ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(5, 16, 24, .9); color: #fff; }
.demo__ic .ic { width: 12px; height: 12px; margin-left: 1px; }
.demo__txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.demo__lbl { font-size: 13.5px; }
.demo__sub { font-size: 11px; font-weight: 600; letter-spacing: .06em; opacity: .75; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo__sub:empty { display: none; }
.demo__prog { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p, 0) * 100%); background: rgba(5, 16, 24, .55); z-index: -1; transition: width .12s linear; }
.demo.is-playing { color: #fff; background: linear-gradient(120deg, #1a2140, #2a1f4a 60%, #3a1d45); box-shadow: 0 0 0 1px rgba(167, 139, 250, .55) inset, 0 0 26px rgba(167, 139, 250, .35); animation: none; }
.demo.is-playing .demo__ic { background: var(--grad-aurora); color: #051018; }
.demo.is-playing .demo__prog { background: var(--grad-aurora); height: 2px; }
.demo.is-playing::before { /* breathing aura */
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(60% 120% at 20% 50%, rgba(92, 242, 255, .25), transparent 70%);
  animation: breathe 1.8s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* tempo */
.tb-tempo { display: flex; align-items: center; gap: 4px; }
.tempo {
  position: relative; display: inline-flex; align-items: baseline; gap: 4px; height: 34px; padding: 0 10px 0 22px;
  border-radius: 10px; cursor: ns-resize; user-select: none; touch-action: none;
  background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line); line-height: 34px;
  transition: box-shadow .2s ease;
}
.tempo:hover, .tempo.is-drag { box-shadow: inset 0 0 0 1px rgba(62, 240, 176, .5), 0 0 14px rgba(62, 240, 176, .15); }
.tempo__val { font: 600 15px/34px var(--font-mono); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }
.tempo.is-seq .tempo__val { color: var(--a-teal); }
.tempo__unit { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--text-faint); }
.tempo__pulse { position: absolute; left: 9px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: rgba(62, 240, 176, .25); }
.tempo__pulse.is-beat { animation: beat .45s ease-out; }
.tempo__pulse.is-beat.is-bar { animation-name: beat-bar; }
@keyframes beat { 0% { background: var(--a-teal); box-shadow: 0 0 10px var(--a-teal); } 100% { background: rgba(62, 240, 176, .25); box-shadow: none; } }
@keyframes beat-bar { 0% { background: #fff; box-shadow: 0 0 14px var(--a-cyan); transform: scale(1.35); } 100% { background: rgba(62, 240, 176, .25); box-shadow: none; transform: none; } }
.tempo__input { width: 64px; height: 26px; border: 0; border-radius: 6px; padding: 0 6px; background: rgba(0, 0, 0, .5); color: var(--text); font: 600 14px var(--font-mono); }
.tb-btn--tap { padding: 0 10px; }
.tb-btn--tap.is-hit { animation: glow-pulse .45s ease-out; }

.tb-vol { display: flex; align-items: center; gap: 6px; color: var(--text-dim); width: 150px; }
.tb-vol .ac-slider { min-width: 0; flex: 1; }
.tb-vol .ac-slider--h { gap: 0; flex-direction: column-reverse; }
.tb-vol .ac-slider__head { justify-content: flex-end; margin-top: -3px; }
.tb-vol .ac-slider__value { font-size: 10.5px; color: var(--text-faint); }

.midi {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: 10px; cursor: pointer;
  color: var(--text-faint); background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px var(--line);
  font: 600 11px var(--font-mono); letter-spacing: .06em;
}
.midi__dot { width: 7px; height: 7px; border-radius: 50%; background: #3a4262; transition: background .2s; }
.midi.is-on { color: var(--text-dim); }
.midi.is-on .midi__dot { background: var(--a-teal); box-shadow: 0 0 8px var(--a-teal); }
.midi.is-off .midi__txt { text-decoration: line-through; text-decoration-color: rgba(255, 107, 129, .6); }
.midi__dot.is-hit { animation: midi-hit .3s ease-out; }
@keyframes midi-hit { 0% { background: #fff; box-shadow: 0 0 12px var(--a-cyan); } 100% { } }

.tb-perf { display: flex; align-items: center; gap: 8px; padding: 0 8px; height: 34px; border-radius: 10px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px var(--line); }
.tb-meter { width: 46px; height: 22px; display: flex; align-items: center; }
.tb-meter > * { width: 100%; height: 100%; }
.cpu { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; min-width: 30px; }
.cpu b { font: 600 11px var(--font-mono); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cpu small { font-size: 9.5px; letter-spacing: .16em; color: var(--text-faint); margin-top: 2px; }
.cpu.is-hot b { color: var(--a-red); }
.audio-badge {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 0; border-radius: 99px; cursor: pointer;
  font-size: 11px; font-weight: 600; color: #1a0d05; background: var(--a-amber); box-shadow: 0 0 14px rgba(255, 196, 107, .4);
}
.audio-badge.is-error { background: var(--a-red); color: #fff; }
.lang {
  display: inline-flex; align-items: baseline; gap: 2px; height: 34px; padding: 0 10px; border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; font-size: 12px; line-height: 34px;
}
.lang__zh { color: var(--text); }
.lang__en { color: var(--text-faint); font-size: 11px; }
.lang__sep { color: var(--text-faint); font-size: 10.5px; }
.lang.is-en .lang__zh { color: var(--text-faint); }
.lang.is-en .lang__en { color: var(--text); }
.lang:hover { box-shadow: inset 0 0 0 1px rgba(92, 242, 255, .38); }

/* ═══════════════════════════════ sidebar / preset browser ═══════════════════════════════ */
.sidebar {
  position: relative; z-index: 30; min-height: 0;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(14, 17, 28, .78), rgba(10, 12, 20, .7));
  border-right: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.sb-head { padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 10px; }
.sb-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; letter-spacing: .06em; color: var(--text-dim); }
.sb-title .ic-wrap { color: var(--a-cyan); }
.sb-close { display: none; margin-left: auto; width: 30px; height: 30px; }
.search {
  position: relative; display: flex; align-items: center; height: 36px; border-radius: 11px;
  background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s ease;
}
.search:focus-within { box-shadow: inset 0 0 0 1px rgba(92, 242, 255, .5), 0 0 18px rgba(92, 242, 255, .12); }
.search__ic { position: absolute; left: 10px; color: var(--text-faint); pointer-events: none; }
.search__input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; color: var(--text);
  padding: 0 32px 0 34px; font: 500 13px var(--font-ui);
}
.search__input::placeholder { color: var(--text-faint); }
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear { position: absolute; right: 4px; width: 26px; height: 26px; background: none; box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 14px 8px; }
.chip {
  --c: var(--a-cyan);
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px 0 7px; border: 0; border-radius: 99px; cursor: pointer;
  font-size: 11.5px; font-weight: 500; color: var(--text-dim);
  background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px var(--line);
  transition: color .15s, box-shadow .2s, background .2s, transform .15s var(--ease-spring);
}
.chip .ic-wrap { color: color-mix(in oklab, var(--c) 70%, var(--text-dim)); }
.chip:hover { color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 50%, transparent); }
.chip:active { transform: scale(.95); }
.chip.is-on {
  color: #fff; background: color-mix(in oklab, var(--c) 18%, rgba(20, 25, 40, .8));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 70%, transparent), 0 0 14px color-mix(in oklab, var(--c) 28%, transparent);
}
.chip.is-on .ic-wrap { color: var(--c); filter: drop-shadow(0 0 5px var(--c)); }
.chip__n { font: 500 11px var(--font-mono); color: var(--text-faint); }
.chip.is-on .chip__n { color: color-mix(in oklab, var(--c) 60%, #fff); }
.chip--tag { --c: var(--a-violet); }
.tagbar { padding: 0 14px; display: flex; gap: 6px; }
.tagbar:not(:empty) { padding-bottom: 8px; }
.plist {
  flex: 1; min-height: 0; overflow-y: auto; padding: 2px 8px 10px; outline: none;
  scroll-padding-top: 40px; scroll-padding-bottom: 8px; /* keep the current row clear of the sticky group header */
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 8px, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(180deg, transparent, #000 8px, #000 calc(100% - 18px), transparent);
}
.plist__sec { position: relative; }
.plist__group {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: 10px 8px 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in oklab, var(--c) 65%, var(--text-dim));
  background: rgb(11, 13, 22); border-radius: 8px; box-shadow: 0 6px 10px -6px rgba(0, 0, 0, .8);
}
.plist__group small { margin-left: auto; font: 500 11px var(--font-mono); color: var(--text-faint); letter-spacing: 0; }
.plist__empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 10px; color: var(--text-faint); }
.prow {
  --c: var(--a-cyan);
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 8px; margin: 1px 0;
  border-radius: 10px; cursor: pointer; transition: background .15s ease;
}
.prow:hover { background: rgba(255, 255, 255, .045); }
.prow__ic {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px;
  color: var(--c); background: color-mix(in oklab, var(--c) 10%, rgba(0, 0, 0, .3));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 22%, transparent);
}
.prow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.prow__name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow__tags { display: flex; gap: 6px; overflow: hidden; }
.prow__tag { font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.prow__tag:hover { color: var(--a-violet); }
.prow__user { color: var(--a-violet); display: inline-flex; }
.prow__fav, .prow__del {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none; border: 0; border-radius: 8px; background: none; cursor: pointer;
  color: var(--text-faint); opacity: 0; transition: opacity .15s, color .15s, transform .2s var(--ease-spring);
}
.prow:hover .prow__fav, .prow:hover .prow__del, .prow__fav.is-on { opacity: 1; }
.prow__fav:hover { color: var(--a-amber); transform: scale(1.15); }
.prow__del:hover { color: var(--a-red); }
.prow__fav.is-on { color: var(--a-amber); }
.prow__fav.is-on .ic { fill: currentColor; filter: drop-shadow(0 0 5px rgba(255, 196, 107, .7)); }
.prow.is-current {
  background: linear-gradient(90deg, color-mix(in oklab, var(--c) 20%, transparent), color-mix(in oklab, var(--c) 4%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 35%, transparent);
}
.prow.is-current::before {
  content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px;
  background: var(--c); box-shadow: 0 0 10px var(--c);
}
.prow.is-current .prow__name { color: #fff; }
.plist:focus-visible .prow.is-current { box-shadow: inset 0 0 0 1.5px var(--c); }
.sb-foot { padding: 8px 14px 12px; font: 500 11px var(--font-mono); color: var(--text-faint); border-top: 1px solid var(--line); }

/* ═══════════════════════════════ play view ═══════════════════════════════ */
/* The hero visual fills the whole block; the controls float on the night sky. Legibility comes from
   soft, local darkening (title corner, a pool under each knob, the floor) instead of opaque panels, so
   the aurora stays visible everywhere and nothing has to re-blur the animating canvas each frame. */
.play {
  --hero-k: 96px;               /* macro knob size */
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(240px, 24vw, 330px); gap: 14px;
  min-height: clamp(280px, 38vh, 400px); padding: 14px 14px 12px 20px;
  border-radius: calc(var(--radius) + 4px);
  background: radial-gradient(120% 140% at 30% 110%, rgba(18, 23, 40, .9), rgba(7, 8, 13, .96));
  box-shadow: inset 0 0 0 1px var(--glass-border), 0 18px 50px rgba(0, 0, 0, .45);
  transition: height .45s var(--ease-out), padding .45s var(--ease-out);
}
.play::before { /* glass rim + faint top sheen, above the sky */
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(160, 180, 240, .12), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.play__aurora { position: absolute; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; opacity: .9; transition: opacity 1s ease; }
.play.has-hero .play__aurora { opacity: 0; }
.play__aurora i {
  position: absolute; width: 70%; height: 120%; border-radius: 50%; filter: blur(60px); opacity: .55; mix-blend-mode: screen;
  animation: drift 18s ease-in-out infinite alternate;
}
.play__aurora i:nth-child(1) { left: -10%; top: -40%; background: radial-gradient(closest-side, rgba(62, 240, 176, .55), transparent); }
.play__aurora i:nth-child(2) { left: 25%; top: -55%; background: radial-gradient(closest-side, rgba(92, 242, 255, .45), transparent); animation-duration: 23s; animation-delay: -6s; }
.play__aurora i:nth-child(3) { left: 55%; top: -30%; background: radial-gradient(closest-side, rgba(167, 139, 250, .55), transparent); animation-duration: 27s; animation-delay: -12s; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(8%, 12%, 0) rotate(8deg) scale(1.12); }
  100% { transform: translate3d(-6%, 6%, 0) rotate(-6deg) scale(.95); }
}
.play__hero { position: absolute; inset: 0; z-index: -1; }
.play__hero > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.play__hero .av-hero { border-radius: inherit; box-shadow: none; }
.play::after { /* legibility: title corner + floor, sky left open in the middle */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 70% at 0% 0%, rgba(5, 6, 11, .7), rgba(5, 6, 11, .34) 45%, transparent 75%),
    linear-gradient(0deg, rgba(5, 6, 11, .55), rgba(5, 6, 11, .12) 22%, transparent 38%);
}
.play__left { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-width: 0; min-height: 0; }
.play__info { position: relative; min-width: 0; }
.play__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cat-chip {
  --c: var(--a-cyan);
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 99px;
  color: var(--c); font-size: 12px; font-weight: 600; letter-spacing: .04em;
  background: color-mix(in oklab, var(--c) 14%, rgba(4, 5, 10, .55)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 38%, transparent), 0 0 18px color-mix(in oklab, var(--c) 14%, transparent);
}
.cat-chip:empty { display: none; }
.cat-chip small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .75; }
.src-badge { margin-left: 4px; padding: 1px 6px; border-radius: 6px; font-size: 11px; color: var(--text); background: rgba(167, 139, 250, .3); }
.play__dirty { font-size: 11px; color: var(--a-amber); opacity: 0; transition: opacity .2s; text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
.play.is-dirty .play__dirty { opacity: 1; }
.play.is-dirty .play__dirty::before { content: "● "; }
.play__name {
  margin: 0; font-size: clamp(24px, 2.6vw, 38px); font-weight: 700; letter-spacing: -.01em; line-height: 1.12;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  background: linear-gradient(100deg, #fff 30%, #d6f9ff 55%, #e6dcff 80%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, .55)) drop-shadow(0 0 26px rgba(92, 242, 255, .12));
  animation: name-in .6s var(--ease-out) both;
}
@keyframes name-in { from { opacity: 0; transform: translateY(6px); filter: blur(4px); } to { opacity: 1; transform: none; } }
.play__desc {
  margin: 5px 0 0; max-width: 62ch; color: color-mix(in oklab, var(--text-dim) 80%, #fff); font-size: 13px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .85), 0 0 2px rgba(0, 0, 0, .6);
}
.play__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 11px; color: var(--text-dim); padding: 2px 8px; border-radius: 99px; background: rgba(4, 5, 10, .5); box-shadow: inset 0 0 0 1px rgba(140, 160, 220, .12); }

.play__macros {
  position: relative;
  display: flex; align-items: flex-end; justify-content: space-around; gap: 6px; padding: 8px 6px 2px; border-radius: var(--radius);
  align-self: stretch; width: min(100%, 720px);
}
/* the macro row floats on the sky: no panel, a faint horizon line instead of a box */
.play__macros.glass { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.play__macros::before {
  content: ""; position: absolute; left: 8%; right: 8%; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(160, 180, 240, .18), transparent);
}
.macro { --acc: var(--a-cyan); position: relative; display: flex; flex-direction: column; align-items: center; flex: 1 1 0; min-width: 0; }
.macro::before { /* dark pool behind knob + label: contrast without a panel */
  content: ""; position: absolute; left: 50%; top: calc(var(--hero-k) * -.12); width: calc(var(--hero-k) * 1.55); height: calc(var(--hero-k) * 1.75);
  transform: translateX(-50%); z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(4, 5, 10, .58), rgba(4, 5, 10, .26) 60%, transparent);
}
.macro .ac-knob--xl { --k-size: var(--hero-k); }
.macro .ac-knob__label .ac-zh, .macro .ac-knob__value { text-shadow: 0 1px 8px rgba(0, 0, 0, .9), 0 0 2px rgba(0, 0, 0, .7); }
.macro .ac-knob__label .ac-en { color: color-mix(in oklab, var(--acc) 35%, var(--text-dim)); text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }
.macro__n {
  position: absolute; top: -2px; left: 50%; transform: translateX(calc(var(--hero-k) * -.62)); z-index: 2;
  font: 700 11px/1 var(--font-mono); color: color-mix(in oklab, var(--acc) 82%, #fff); letter-spacing: .06em;
  padding: 3px 5px 2px; border-radius: 6px;
  background: rgba(4, 5, 10, .62); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--acc) 38%, transparent), 0 0 12px color-mix(in oklab, var(--acc) 18%, transparent);
  text-shadow: 0 0 8px color-mix(in oklab, var(--acc) 55%, transparent);
}
.macro__targets {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translate(-50%, 6px); z-index: 20; margin: 0; padding: 8px 10px; list-style: none;
  min-width: 180px; border-radius: 10px; pointer-events: none; opacity: 0; transition: opacity .18s ease, transform .22s var(--ease-out);
  background: linear-gradient(180deg, rgba(26, 32, 52, .97), rgba(12, 15, 25, .98)); box-shadow: 0 0 0 1px color-mix(in oklab, var(--acc) 40%, transparent), 0 14px 40px rgba(0, 0, 0, .55);
}
.macro:hover .macro__targets, .macro:focus-within .macro__targets, .macro.is-info .macro__targets { opacity: 1; transform: translate(-50%, 0); }
button.macro__n { border: 0; cursor: pointer; }
.macro__targets li { display: flex; align-items: baseline; gap: 6px; font-size: 12px; padding: 2px 0; white-space: nowrap; }
.macro__targets small { font-size: 11px; color: var(--text-faint); letter-spacing: .06em; text-transform: uppercase; }
.macro__targets b { margin-left: auto; font: 600 11px var(--font-mono); color: var(--acc); }
.macro__targets b.neg { color: var(--a-red); }
.macro__targets .muted { color: var(--text-faint); }
.macro .ac-knob__label { max-width: 132px; }

.play__side { display: grid; grid-template-rows: minmax(0, 1fr) 62px; gap: 10px; min-height: 0; }
.play__xy { min-height: 0; }
/* the XY pad is a window onto the sky: grid + puck over the live aurora */
.play__xy .ac-xy {
  height: 100%; aspect-ratio: auto; min-height: 0;
  background: radial-gradient(120% 90% at 50% 120%, rgba(167, 139, 250, .1), transparent 60%), linear-gradient(180deg, rgba(4, 6, 14, .32), rgba(4, 5, 12, .5));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 0 30px rgba(0, 0, 0, .35), 0 0 0 1px rgba(160, 180, 240, .16), 0 10px 30px rgba(0, 0, 0, .25);
}
.play__minis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 0; }
.mini-vis {
  position: relative; overflow: hidden; border-radius: 10px; cursor: pointer;
  background: rgba(4, 5, 11, .5); box-shadow: inset 0 0 0 1px rgba(160, 180, 240, .14);
  transition: box-shadow .2s ease;
}
.mini-vis:hover { box-shadow: inset 0 0 0 1px rgba(92, 242, 255, .38), 0 0 16px rgba(92, 242, 255, .12); }
.mini-vis .av-scope, .mini-vis .av-spectrum { background: linear-gradient(180deg, rgba(6, 8, 16, .45), rgba(4, 5, 11, .7)); box-shadow: none; border-radius: inherit; }
.mini-vis > :not(.mini-vis__lbl) { position: absolute; inset: 0; width: 100%; height: 100%; }
.mini-vis__lbl { position: absolute; left: 7px; top: 5px; z-index: 2; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); pointer-events: none; }
.play__collapse { position: absolute; right: 10px; top: 10px; z-index: 5; width: 28px; height: 28px; opacity: .55; }
.play__collapse:hover { opacity: 1; }
.play-collapsed .play { min-height: 0; padding-top: 10px; padding-bottom: 10px; }
.play-collapsed .play__info .play__desc, .play-collapsed .play__tags, .play-collapsed .play__side { display: none; }
.play-collapsed .play { grid-template-columns: minmax(0, 1fr); }
.play-collapsed .play__left { flex-direction: row; align-items: center; }
.play-collapsed .play__info { flex: 0 1 260px; }
.play-collapsed .play__macros { flex: 1; padding: 4px 6px; }
.play-collapsed .play__macros::before { display: none; }
.play-collapsed .play { --hero-k: 60px; }
.play-collapsed .macro .ac-knob__value { display: none; }
.play-collapsed .play__name { font-size: 22px; }

/* ═══════════════════════════════ editor + tabs ═══════════════════════════════ */
.editor {
  margin-top: var(--gap); --acc: var(--a-cyan);
  /* scrolled to, the editor can own the whole main area: tabs pinned on top, panel below */
  min-height: calc(100% - var(--gap));
}
.tabs {
  position: sticky; top: calc(-1 * var(--gap)); z-index: 12;
  display: flex; align-items: stretch; gap: 2px; padding: 4px; margin: 0 -2px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 20, 33, .97), rgba(12, 15, 25, .96));
  box-shadow: inset 0 0 0 1px var(--line), 0 10px 26px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.tab {
  --acc: var(--a-cyan);
  position: relative; z-index: 1; flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0;
  height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; color: var(--text-dim);
  transition: color .2s ease;
}
.tab:hover { color: var(--text); }
.tab__ic { color: color-mix(in oklab, var(--acc) 55%, var(--text-faint)); transition: color .2s, filter .2s; }
.tab.is-on { color: #fff; }
.tab.is-on .tab__ic { color: var(--acc); filter: drop-shadow(0 0 6px var(--acc)); }
.bi { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; }
.bi__main { font-size: 13.5px; font-weight: 600; letter-spacing: .04em; }
.bi__sub { font-size: var(--fs-cap); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.tab.is-on .bi__sub { color: color-mix(in oklab, var(--acc) 70%, #fff); }
.tab__badge {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center;
  font: 700 10.5px/17px var(--font-mono); color: #07080d; background: color-mix(in oklab, var(--acc) 85%, #fff);
  box-shadow: 0 0 8px color-mix(in oklab, var(--acc) 50%, transparent);
}
.tab__badge:empty { display: none; }
.tabs__ind {
  --acc: var(--a-cyan);
  position: absolute; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 10px; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in oklab, var(--acc) 22%, rgba(38, 48, 78, .8)), color-mix(in oklab, var(--acc) 9%, rgba(20, 25, 40, .8)));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 0 1px color-mix(in oklab, var(--acc) 45%, transparent), 0 0 22px color-mix(in oklab, var(--acc) 22%, transparent);
  transition: transform .35s var(--ease-spring), width .35s var(--ease-spring), background .3s ease, box-shadow .3s ease;
}
.tabs__ind::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 2px; border-radius: 2px; background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.tabpanel { min-height: 320px; }
.tabpanel.is-entering { animation: panel-in .34s var(--ease-out); }
@keyframes panel-in { from { opacity: 0; transform: translateX(calc(var(--dir, 1) * 18px)); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.pane-error { padding: 20px; color: var(--a-red); font-family: var(--font-mono); }

/* ═══════════════════════════════ cards ═══════════════════════════════ */
.card {
  --acc: var(--a-cyan);
  position: relative; min-width: 0; padding: 12px 14px 14px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(26, 32, 52, .7), rgba(16, 20, 34, .72));
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), var(--shadow-soft);
  transition: opacity .25s ease, box-shadow .3s ease, border-color .3s ease;
}
.card::before { /* accent hairline */
  content: ""; position: absolute; left: 16px; right: 16px; top: -1px; height: 1px; border-radius: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--acc) 70%, transparent), transparent); opacity: .7;
}
.card__head { display: flex; align-items: center; gap: 9px; min-height: 28px; margin-bottom: 10px; }
.card__icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--acc); background: color-mix(in oklab, var(--acc) 12%, rgba(0, 0, 0, .3)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--acc) 25%, transparent); }
.card__title { display: flex; align-items: baseline; gap: 7px; margin: 0; min-width: 0; white-space: nowrap; }
.card__title .t-main { font-size: 13.5px; font-weight: 600; letter-spacing: .04em; }
.card__title .t-sub { font-size: var(--fs-cap); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.card__spacer { flex: 1; }
.card__badge { white-space: nowrap; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; color: color-mix(in oklab, var(--acc) 80%, #fff); background: color-mix(in oklab, var(--acc) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--acc) 30%, transparent); }
.card__note { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 11px; color: var(--text-faint); }
.card__note .ic-wrap { color: color-mix(in oklab, var(--acc) 60%, var(--text-faint)); }
.card__head .ac-select { flex-direction: row; }
.card__head .ac-seg__opt { padding: 4px 9px; font-size: 11px; }
.card__offhint {
  display: none; position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%); z-index: 3; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 99px; font-size: 12px; color: var(--text); white-space: nowrap; pointer-events: none;
  background: rgba(10, 12, 20, .85); box-shadow: 0 0 0 1px color-mix(in oklab, var(--acc) 40%, transparent), 0 10px 30px rgba(0, 0, 0, .5);
}
.card.is-off .card__offhint { display: flex; }
.card.is-off .card__body > :not(.card__offhint) { opacity: .32; filter: saturate(.35); transition: opacity .25s, filter .25s; }
.card.is-bypassed .card__body { opacity: .5; filter: saturate(.5); transition: opacity .25s, filter .25s; }
.card.is-bypassed:hover .card__body { opacity: .8; }
.card.is-entering { opacity: 0; transform: translateY(6px); }
.card { transform: none; transition: opacity .28s ease, transform .32s var(--ease-out), box-shadow .3s ease; }

.krow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; }
.krow + .krow, .krow + .sect, .sect + .krow { margin-top: 10px; }
.card__body > .ac-select + .krow, .card__body > .ac-select + .sect { margin-top: 12px; }
/* mixed knob sizes in one row share a centre line (dials line up like on hardware), labels sit under each dial */
.krow:has(> .ac-knob--md) > .ac-knob--sm, .sect__row:has(> .ac-knob--md) > .ac-knob--sm { margin-top: 8px; }
.krow:has(> .ac-knob--lg) > .ac-knob--md, .sect__row:has(> .ac-knob--lg) > .ac-knob--md { margin-top: 9px; }
.krow:has(> .ac-knob--lg) > .ac-knob--sm, .sect__row:has(> .ac-knob--lg) > .ac-knob--sm { margin-top: 17px; }
.sect { margin-top: 12px; min-width: 0; }
.sect:first-child { margin-top: 0; }
.sect__label { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--text-dim); }
.sect__label small { font-size: var(--fs-cap); letter-spacing: var(--ls-cap); text-transform: uppercase; color: var(--text-faint); }
.sect__label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); align-self: center; }
.sect__row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; }
.is-disabled { opacity: .32; filter: grayscale(.6); pointer-events: none; transition: opacity .2s; }
.is-hidden { display: none !important; }
.env-wrap { margin-bottom: 10px; }
.env-wrap .ac-env { --env-h: 138px; }

/* icon choosers */
.ichoice { --acc: var(--a-cyan); display: flex; flex-wrap: wrap; gap: 6px; }
.ichoice__btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 60px; padding: 8px 6px 6px;
  border: 0; border-radius: 11px; cursor: pointer; color: var(--text-dim);
  background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 1px var(--line);
  transition: color .15s, box-shadow .2s, background .2s, transform .15s var(--ease-spring);
}
.ichoice__btn:hover { color: var(--text); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--acc) 45%, transparent); }
.ichoice__btn:active { transform: scale(.95); }
.ichoice__btn.is-on {
  color: #fff;
  background: linear-gradient(180deg, color-mix(in oklab, var(--acc) 26%, rgba(20, 25, 40, .9)), color-mix(in oklab, var(--acc) 8%, rgba(10, 12, 20, .9)));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--acc) 75%, transparent), 0 0 18px color-mix(in oklab, var(--acc) 30%, transparent);
}
.ichoice__btn.is-on .ic, .ichoice__btn.is-on .ichoice__svg { color: var(--acc); filter: drop-shadow(0 0 5px var(--acc)); }
.ichoice__lbl { font-size: 12px; font-weight: 500; }
.ichoice__sub { font-size: 11px; letter-spacing: .02em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ichoice__svg { display: block; line-height: 0; }
.ichoice--filters .ichoice__btn { min-width: 0; flex: 1 1 64px; padding: 6px 2px 5px; }
.ichoice--filters .ichoice__sub { letter-spacing: 0; }
.fthumb { width: 52px; height: 28px; }
.ichoice--small .fthumb { width: 40px; height: 22px; }
.ichoice--lfo .ichoice__btn { min-width: 0; flex: 1 1 0; padding: 5px 2px 4px; }
.ichoice--lfo .ichoice__sub { display: none; }
.ichoice--lfo .ichoice__lbl { font-size: 11px; }
.lshape { width: 26px; height: 20px; }

/* ═══════════════════════════════ sources pane ═══════════════════════════════ */
.pane--sources { display: grid; grid-template-columns: 220px minmax(0, 1fr) minmax(280px, 320px); gap: var(--gap); align-items: start; }
.col-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); padding: 2px 4px 8px; }
.src-rack { display: flex; flex-direction: column; gap: 8px; }
.src-strip {
  --acc: var(--a-cyan);
  position: relative; display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 4px; border-radius: 13px;
  background: linear-gradient(180deg, rgba(26, 32, 52, .66), rgba(16, 20, 34, .7)); border: 1px solid var(--glass-border);
  transition: box-shadow .25s ease, border-color .25s ease, background .25s ease, opacity .25s ease;
}
.src-strip:not(.is-on) { opacity: .62; }
.src-strip:hover { opacity: 1; border-color: color-mix(in oklab, var(--acc) 30%, transparent); }
.src-strip.is-selected {
  opacity: 1; border-color: color-mix(in oklab, var(--acc) 55%, transparent);
  background: linear-gradient(90deg, color-mix(in oklab, var(--acc) 16%, rgba(20, 25, 40, .9)), rgba(16, 20, 34, .75));
  box-shadow: 0 0 22px color-mix(in oklab, var(--acc) 16%, transparent);
}
.src-strip.is-selected::after {
  content: ""; position: absolute; right: -13px; top: 50%; width: 10px; height: 2px; background: color-mix(in oklab, var(--acc) 70%, transparent);
  box-shadow: 0 0 8px var(--acc);
}
.src-strip__sel { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 4px; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 9px; }
.src-strip__ic { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; color: var(--text-faint); background: rgba(0, 0, 0, .3); transition: color .2s, box-shadow .2s; }
.src-strip.is-on .src-strip__ic { color: var(--acc); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--acc) 40%, transparent), 0 0 14px color-mix(in oklab, var(--acc) 30%, transparent); }
.src-strip__txt { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 6px; min-width: 0; }
.src-strip__name { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.src-strip__en { display: none; }
.src-strip__sum { grid-column: 1 / -1; font: 500 11px var(--font-mono); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-strip.is-on .src-strip__sum { color: color-mix(in oklab, var(--acc) 55%, var(--text-dim)); }
.src-strip__ctl { display: flex; align-items: center; gap: 0; flex: none; }
.src-strip__ctl .ac-knob { min-width: 38px; }
.src-strip__ctl .ac-knob--sm { --k-size: 30px; }
.src-detail { min-width: 0; }
.card--src { min-height: 100%; }
.osc-grid { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 1.25fr); gap: 16px; }
.osc-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.osc-left .krow { justify-content: space-around; }
.wave-prev {
  position: relative; height: 128px; border-radius: 11px; overflow: hidden;
  background: radial-gradient(120% 100% at 50% 0%, color-mix(in oklab, var(--acc) 7%, transparent), transparent 70%), linear-gradient(180deg, rgba(4, 6, 12, .75), rgba(4, 6, 12, .5));
  box-shadow: inset 0 0 0 1px var(--line), inset 0 0 30px rgba(0, 0, 0, .5);
}
.wave-prev canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.wave-prev__tag { position: absolute; right: 8px; bottom: 6px; font: 600 11px var(--font-mono); color: var(--acc); opacity: .8; }
.osc-table .ac-dd__btn { height: 32px; }
.osc-right .sect { margin-top: 10px; }
.osc-right .sect:first-child { margin-top: 0; }

/* FM */
.fm-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
.fm-diag-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 12px 8px; border-radius: 12px; min-width: 180px;
  background: radial-gradient(100% 90% at 50% 20%, rgba(167, 139, 250, .09), transparent 70%), rgba(4, 6, 12, .55); box-shadow: inset 0 0 0 1px var(--line);
}
.fm-diagram { display: grid; place-items: center; min-height: 150px; }
.fm-diagram svg { max-width: 260px; max-height: 230px; width: auto; height: auto; overflow: visible; }
.fmd__op { cursor: pointer; transition: opacity .2s; }
.fmd__op:hover rect { stroke-width: 2.2; }
.fmd__num { font: 700 12px var(--font-mono); fill: #fff; pointer-events: none; }
.fmd__out { font: 700 10px var(--font-mono); fill: var(--text-faint); letter-spacing: .1em; }
.fm-algo-name { display: flex; align-items: baseline; gap: 6px; font-size: 12px; }
.fm-algo-name b { font: 700 11.5px var(--font-mono); color: var(--acc); }
.fm-algo-name small { font-size: var(--fs-cap); letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.fm-side { min-width: 0; }
.fm-algos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fm-algo {
  position: relative; display: grid; place-items: center; height: 58px; padding: 4px; border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, background .2s, transform .15s var(--ease-spring);
}
.fm-algo:hover { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--acc) 45%, transparent); }
.fm-algo:active { transform: scale(.95); }
.fm-algo.is-on { background: color-mix(in oklab, var(--acc) 14%, rgba(10, 12, 20, .9)); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--acc) 75%, transparent), 0 0 16px color-mix(in oklab, var(--acc) 25%, transparent); }
.fm-algo__svg svg { max-height: 44px; max-width: 60px; width: auto; height: auto; }
.fm-algo__n { position: absolute; left: 6px; top: 4px; font: 700 11px var(--font-mono); color: var(--text-faint); }
.fm-algo.is-on .fm-algo__n { color: var(--acc); }
.fm-globals { margin-top: 12px; }
.fm-ops { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.fm-op {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 8px; border-radius: 12px; overflow-x: auto;
  background: rgba(0, 0, 0, .2); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .3s ease, background .3s ease;
}
.fm-op.is-flash { animation: op-flash 1s ease-out; }
@keyframes op-flash { 0% { box-shadow: inset 0 0 0 1.5px var(--acc), 0 0 22px color-mix(in oklab, var(--acc) 40%, transparent); } 100% { box-shadow: inset 0 0 0 1px var(--line); } }
.fm-op__badge { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 62px; flex: none; }
.fm-op__n { font: 700 12px var(--font-mono); color: #c9b6ff; letter-spacing: .04em; }
.fm-op.is-carrier .fm-op__n { color: var(--a-cyan); text-shadow: 0 0 10px rgba(92, 242, 255, .5); }
.fm-op__role { font-size: 11px; color: var(--text-faint); letter-spacing: .06em; }
.fm-op.has-fb .fm-op__role::after { content: " ↺"; color: var(--acc); }
.fm-op__grp { display: flex; align-items: flex-start; gap: 6px; padding-left: 10px; border-left: 1px solid var(--line); flex: none; }
.fm-op__grp .ac-knob { min-width: 44px; }

/* physical */
.phys-choosers { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; margin-bottom: 12px; }
.phys-choice .ichoice__btn { flex: 1 1 60px; }
.phys-knobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px 18px; }
.phys-knobs .sect { margin-top: 0; }

/* noise */
.noise-grid { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.noise-color { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.noise-tilt { width: 100%; height: 86px; border-radius: 11px; overflow: hidden; background: rgba(4, 6, 12, .6); box-shadow: inset 0 0 0 1px var(--line); }
.noise-tilt svg { width: 100%; height: 100%; display: block; }

/* ═══════════════════════════════ filter pane ═══════════════════════════════ */
.flow { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 11px; color: var(--text-dim); flex-wrap: wrap; }
.flow__node { padding: 3px 10px; border-radius: 99px; background: rgba(167, 139, 250, .12); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .3); color: var(--text); font-weight: 500; transition: opacity .2s; }
.flow__node.is-off { opacity: .35; text-decoration: line-through; }
.flow__arrow { width: 18px; height: 1px; background: linear-gradient(90deg, rgba(167, 139, 250, .2), rgba(167, 139, 250, .8)); position: relative; }
.flow__arrow::after { content: ""; position: absolute; right: -1px; top: -3px; border: 3.5px solid transparent; border-left-color: rgba(167, 139, 250, .8); border-right: 0; }
.filter-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, 1fr); gap: var(--gap); align-items: start; }
.filter-col { display: flex; flex-direction: column; gap: var(--gap); }
.filter-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; margin: 12px 0; }
.fview-wrap {
  position: relative; height: 200px; border-radius: 12px; overflow: hidden;
  background: radial-gradient(100% 100% at 50% 0%, rgba(167, 139, 250, .08), transparent 70%), rgba(4, 6, 12, .6); box-shadow: inset 0 0 0 1px var(--line);
}
.fview-wrap--small { height: 92px; margin: 10px 0; }
.fview { position: absolute; inset: 0; width: 100%; height: 100%; }
.fview canvas { width: 100%; height: 100%; display: block; }
.filter-big { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 6px; }
.card--filter2.is-bypassed .card__body { opacity: .75; }
.card--filter2.is-bypassed .fview-wrap--small { opacity: .35; }

/* ═══════════════════════════════ mod pane ═══════════════════════════════ */
.mod-top { display: grid; grid-template-columns: minmax(320px, 1.35fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.envs-view.is-entering { opacity: 0; transform: translateY(4px); }
.envs-view { transition: opacity .25s ease, transform .3s var(--ease-out); }
.lfoview-wrap { position: relative; height: 92px; border-radius: 11px; overflow: hidden; margin-bottom: 10px; background: rgba(4, 6, 12, .6); box-shadow: inset 0 0 0 1px var(--line); }
.lfoview { position: absolute; inset: 0; width: 100%; height: 100%; }
.lfoview canvas { width: 100%; height: 100%; display: block; }
.lfo-ctl { display: flex; align-items: flex-end; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.lfo-sync { flex: 1 1 90px; min-width: 90px; align-self: center; }
.card--lfo.is-synced .lfo-sync .ac-dd__btn { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 0 0 1px color-mix(in oklab, var(--acc) 60%, transparent), 0 0 12px color-mix(in oklab, var(--acc) 20%, transparent); }
.lfo-uses { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; min-height: 22px; }
.use-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 3px; border-radius: 99px; font-size: 11px; color: var(--text); background: color-mix(in oklab, var(--c) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 35%, transparent); }
.use-chip b { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; font: 700 9px var(--font-mono); color: #07080d; background: var(--c); }
.use-none { font-size: 11px; color: var(--text-faint); }
.card--matrix { margin-top: var(--gap); }
.mm-count { font: 600 11px var(--font-mono); color: var(--a-amber); padding: 2px 8px; border-radius: 99px; background: rgba(255, 196, 107, .1); }
.mm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
.mm-row {
  --src: #5a6284;
  display: grid; grid-template-columns: 22px minmax(0, 1fr) 14px minmax(0, 1.25fr) minmax(96px, 1fr) 26px; align-items: center; gap: 7px;
  padding: 5px 6px 5px 6px; border-radius: 11px; background: rgba(0, 0, 0, .18); box-shadow: inset 3px 0 0 var(--src), inset 0 0 0 1px var(--line);
  transition: box-shadow .25s ease, background .25s ease, opacity .25s ease;
}
.mm-row--head { background: none; box-shadow: none; padding-top: 0; padding-bottom: 0; font-size: var(--fs-cap); letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.mm-row.is-empty { opacity: .6; }
.mm-row.is-empty:hover, .mm-row.is-empty:focus-within { opacity: 1; }
.mm-row.is-active { background: color-mix(in oklab, var(--src) 7%, rgba(0, 0, 0, .2)); box-shadow: inset 3px 0 0 var(--src), inset 0 0 0 1px color-mix(in oklab, var(--src) 28%, transparent); }
.mm-n { font: 700 11px var(--font-mono); color: var(--src); text-align: center; }
.mm-arrow { color: var(--text-faint); display: grid; place-items: center; }
.mm-row.is-active .mm-arrow { color: var(--src); }
.mm-row .ac-select { gap: 0; }
.mm-row .ac-dd__btn { height: 30px; font-size: 11.5px; padding-left: 9px; }
.mm-row .ac-slider { min-width: 0; }
.mm-row .ac-slider--h { gap: 0; }
.mm-row .ac-slider__head { justify-content: flex-end; height: 11px; }
.mm-row .ac-slider__value { font-size: 11px; }
.mm-row .ac-slider--h .ac-slider__track { height: 18px; }
.mm-row .ac-slider--h .ac-slider__rail { top: 6px; }
.mm-clear { width: 26px; height: 26px; border-radius: 8px; }

/* ═══════════════════════════════ fx pane ═══════════════════════════════ */
.fx-flow { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-size: 11px; color: var(--text-dim); }
.fx-flow small { font: 500 11px var(--font-mono); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-rack { display: flex; align-items: stretch; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; }
.card--fx { flex: 1 0 166px; scroll-snap-align: start; display: flex; flex-direction: column; padding-left: 12px; padding-right: 12px; }
.card--fx .ac-seg__opt { padding: 5px 1px; font-size: 11px; letter-spacing: 0; }
.card--fx .card__title .t-sub { display: none; }
.card--fx .card__body { display: flex; flex-direction: column; gap: 10px; }
.card--fx .krow + .krow { margin-top: 0; }
.card--fx .krow { justify-content: space-around; }
.card--fx[data-group="drive"] { flex-basis: 150px; }
.card--fx[data-group="chorus"] { flex-basis: 206px; }
.card--fx[data-group="phaser"] { flex-basis: 156px; }
.card--fx[data-group="delay"] { flex-basis: 162px; }
.card--reverb { flex: 1.3 0 198px; }
.card--eq { flex: 1 0 160px; }
@media (max-width: 1125px), (min-width: 1280px) and (max-width: 1405px) { /* widths where the rack overflows */
  .fx-rack {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - var(--rack-fade, 32px)), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - var(--rack-fade, 32px)), transparent);
  }
  @supports (animation-timeline: scroll()) {
    /* the fade retracts as the rack reaches its end */
    .fx-rack { animation: rack-fade linear both; animation-timeline: scroll(self inline); }
  }
}
@property --rack-fade { syntax: "<length>"; inherits: false; initial-value: 32px; }
@keyframes rack-fade { 0%, 85% { --rack-fade: 32px; } 100% { --rack-fade: 0px; } }
.fx-link { flex: 0 0 12px; display: grid; place-items: center; color: rgba(255, 107, 214, .45); }
.fx-viz { position: relative; height: 66px; border-radius: 10px; overflow: hidden; background: rgba(4, 6, 12, .6); box-shadow: inset 0 0 0 1px var(--line); }
.fx-viz svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-viz__txt { font: 600 5px var(--font-mono); fill: var(--text-dim); }
.fx-sync { flex: 1 1 100px; align-self: center; min-width: 96px; }

/* ═══════════════════════════════ perform pane ═══════════════════════════════ */
.perf-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.perf-grid .ac-select { min-width: 0; flex: 1 1 120px; }
.arp-steps { display: grid; grid-template-columns: repeat(16, 1fr); gap: 4px; margin-bottom: 12px; }
.arp-steps i { height: 9px; border-radius: 3px; background: rgba(140, 160, 220, .13); transition: background .25s ease, box-shadow .25s ease; }
.arp-steps i:nth-child(4n + 1) { background: rgba(140, 160, 220, .22); }
.arp-steps i.is-on { background: var(--a-teal); box-shadow: 0 0 10px var(--a-teal); transition-duration: 0s; }
.mini-piano { position: relative; height: 58px; margin: 10px 0 4px; }
.mp-key { position: absolute; top: 0; padding: 0; border: 0; border-radius: 0 0 5px 5px; cursor: pointer; }
.mp-key:disabled { cursor: default; }
.mp-key--w { left: calc(var(--x) * 100% / var(--nw) + 1px); width: calc(100% / var(--nw) - 2px); height: 100%; background: linear-gradient(180deg, #aeb6cc, #eef1f8 12%, #dfe4f0); }
.mp-key--b { left: calc(var(--x) * 100% / var(--nw)); width: calc(60% / var(--nw)); height: 60%; z-index: 1; background: linear-gradient(180deg, #0a0c14, #1d2334 80%, #262d42); }
.mp-key.is-on.mp-key--w { background: linear-gradient(180deg, #7fe8d0, #b9fbe9 40%, var(--a-teal)); box-shadow: 0 0 12px rgba(62, 240, 176, .55); }
.mp-key.is-on.mp-key--b { background: linear-gradient(180deg, #0a0c14, var(--a-teal)); box-shadow: 0 0 10px rgba(62, 240, 176, .6); }
.mp-key.is-root.mp-key--w { background: linear-gradient(180deg, #ffd999, #ffe9c2 40%, var(--a-amber)); box-shadow: 0 0 12px rgba(255, 196, 107, .55); }
.mp-key.is-root.mp-key--b { background: linear-gradient(180deg, #0a0c14, var(--a-amber)); }
.mp-key:not(:disabled):hover { filter: brightness(1.12); }
.chord-notes { font: 600 11px var(--font-mono); color: var(--a-teal); letter-spacing: .06em; margin-top: 4px; }

/* ═══════════════════════════════ dock ═══════════════════════════════ */
.dock {
  position: relative; z-index: 35;
  display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 14px; align-items: stretch;
  padding: 10px max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(12, 15, 25, .9), rgba(7, 8, 13, .96));
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.dock__wheels { display: flex; gap: 8px; }
.wheel {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 42px; padding: 6px 0 4px; border-radius: 12px;
  background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--line);
}
.wheel .ac-slider--v { height: auto; flex: 1; width: 34px; min-height: 0; }
.wheel .ac-slider--v .ac-slider__track { padding: 7px 0; }
.wheel__lbl { font-size: 11px; color: var(--text-faint); white-space: nowrap; }
.dock__ctl { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; width: 132px; }
.dock__cap { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 3px; }
.oct__row { display: flex; align-items: center; gap: 4px; }
.oct__btn { width: 28px; height: 28px; border-radius: 8px; }
.oct__val { flex: 1; text-align: center; font: 600 11px var(--font-mono); color: var(--text); }
.vel__row { display: flex; align-items: center; gap: 8px; }
.vel__bar { flex: 1; height: 5px; border-radius: 3px; background: rgba(140, 160, 220, .14); overflow: hidden; }
.vel__bar i { display: block; height: 100%; width: 79%; border-radius: 3px; background: var(--grad-aurora); transition: width .2s ease; }
.vel__val { font: 600 11px var(--font-mono); color: var(--text-dim); min-width: 24px; text-align: right; }
.hold { height: 30px; justify-content: center; }
.dock__kb { position: relative; min-width: 0; display: flex; align-items: flex-end; }
.dock__kb .ac-kb { --kb-h: 124px; flex: 1; }

/* ═══════════════════════════════ splash ═══════════════════════════════ */
.splash {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 120%, rgba(18, 12, 40, .6), transparent 60%), rgba(4, 5, 10, .86);
  -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2);
  transition: opacity .8s ease, transform .9s var(--ease-out), visibility .8s;
}
.splash.is-out { opacity: 0; visibility: hidden; transform: scale(1.06); pointer-events: none; }
.splash__sky { position: absolute; inset: -20%; pointer-events: none; }
.splash__sky i {
  position: absolute; width: 60vmax; height: 38vmax; border-radius: 50%; filter: blur(70px); mix-blend-mode: screen; opacity: .6;
  animation: sky 16s ease-in-out infinite alternate;
}
.splash__sky i:nth-child(1) { left: 5%; top: 8%; background: radial-gradient(closest-side, rgba(62, 240, 176, .7), transparent); }
.splash__sky i:nth-child(2) { left: 30%; top: 0; background: radial-gradient(closest-side, rgba(92, 242, 255, .55), transparent); animation-duration: 21s; animation-delay: -5s; }
.splash__sky i:nth-child(3) { left: 50%; top: 14%; background: radial-gradient(closest-side, rgba(167, 139, 250, .65), transparent); animation-duration: 25s; animation-delay: -9s; }
.splash__sky i:nth-child(4) { left: 62%; top: 30%; background: radial-gradient(closest-side, rgba(255, 107, 214, .45), transparent); animation-duration: 19s; animation-delay: -3s; }
@keyframes sky {
  0% { transform: translate3d(-4%, -2%, 0) rotate(-8deg) scaleY(.8); }
  50% { transform: translate3d(6%, 6%, 0) rotate(6deg) scaleY(1.15); }
  100% { transform: translate3d(-2%, 10%, 0) rotate(-3deg) scaleY(.9); }
}
.splash__stars {
  position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(1px 1px at 12% 22%, #fff, transparent), radial-gradient(1px 1px at 72% 14%, #fff, transparent), radial-gradient(1.5px 1.5px at 42% 64%, #cfe, transparent),
    radial-gradient(1px 1px at 86% 58%, #fff, transparent), radial-gradient(1px 1px at 28% 82%, #dde, transparent), radial-gradient(1.2px 1.2px at 58% 36%, #fff, transparent),
    radial-gradient(1px 1px at 92% 86%, #fff, transparent), radial-gradient(1px 1px at 6% 52%, #fff, transparent);
  animation: twinkle 5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .25; } to { opacity: .65; } }
.splash__content { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px; }
.splash__logo { display: flex; align-items: baseline; gap: 18px; animation: rise 1.1s var(--ease-out) both; }
.splash__word {
  font-weight: 800; font-size: clamp(46px, 10vw, 120px); letter-spacing: .2em; line-height: 1; margin-right: -.2em;
  background: var(--grad-aurora); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(92, 242, 255, .25)); animation: aurora-shift 6s ease-in-out infinite alternate;
}
.splash__zh { font-size: clamp(22px, 4vw, 44px); font-weight: 500; color: rgba(232, 236, 255, .85); letter-spacing: .18em; }
.splash__tag { margin: 14px 0 0; font-size: clamp(13px, 1.6vw, 16px); color: var(--text-dim); letter-spacing: .3em; animation: rise 1.1s .1s var(--ease-out) both; }
.splash__tag span { font-size: .8em; letter-spacing: .24em; text-transform: uppercase; color: var(--text-faint); margin-left: 8px; }
.splash__start {
  position: relative; margin-top: 46px; display: flex; flex-direction: column; align-items: center; gap: 16px;
  border: 0; background: none; cursor: pointer; animation: rise 1.1s .2s var(--ease-out) both;
}
.splash__play {
  position: relative; display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; color: #061018;
  background: var(--grad-aurora); background-size: 160% 160%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3) inset, 0 10px 40px rgba(92, 242, 255, .35), 0 0 80px rgba(167, 139, 250, .35);
  transition: transform .3s var(--ease-spring), box-shadow .3s ease;
  animation: aurora-shift 5s ease-in-out infinite alternate;
}
.splash__play .ic { width: 34px; height: 34px; margin-left: 5px; }
.splash__ring { position: absolute; top: 0; left: 50%; width: 96px; height: 96px; margin-left: -48px; border-radius: 50%; pointer-events: none; }
.splash__ring::before, .splash__ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(92, 242, 255, .55);
  animation: ring 2.6s ease-out infinite;
}
.splash__ring::after { animation-delay: 1.3s; border-color: rgba(167, 139, 250, .5); }
@keyframes ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }
.splash__start:hover .splash__play { transform: scale(1.07); box-shadow: 0 0 0 1px rgba(255, 255, 255, .4) inset, 0 12px 50px rgba(92, 242, 255, .5), 0 0 110px rgba(255, 107, 214, .35); }
.splash__start:active .splash__play { transform: scale(.96); }
.splash__cta { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: .12em; }
.splash__cta small { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--text-faint); }
.splash__status { margin: 18px 0 0; min-height: 18px; font-size: 12px; color: var(--text-dim); opacity: 0; transition: opacity .3s; }
.splash.is-loading .splash__status { opacity: 1; }
.splash.is-loading .splash__play { animation: aurora-shift 1s ease-in-out infinite alternate, spin-soft 1.4s linear infinite; }
@keyframes spin-soft { to { filter: hue-rotate(360deg); } }
.splash.is-error .splash__status { opacity: 1; color: var(--a-red); }
.splash__hint { margin: 28px 0 0; font-size: 12px; color: var(--text-faint); letter-spacing: .08em; animation: rise 1.1s .35s var(--ease-out) both; }
.splash__hintEn { opacity: .7; }
.splash__gh { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; padding: 6px 12px; border-radius: 999px; font-size: 12px; letter-spacing: .06em; color: var(--text-dim); text-decoration: none; border: 1px solid var(--line); background: rgba(255,255,255,.03); transition: color .2s, border-color .2s, background .2s; animation: rise 1.1s .45s var(--ease-out) both; }
.splash__gh .ic { width: 15px; height: 15px; }
.splash__gh:hover, .splash__gh:focus-visible { color: var(--text); border-color: rgba(92,242,255,.45); background: rgba(92,242,255,.08); outline: none; }
/* touch-only devices: tap the keys (no computer-keyboard letters, which also leave the on-screen keys) */
.splash__hint--touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .splash__hint--kb { display: none; }
  .splash__hint--touch { display: inline; }
  .ac-kb__hint { display: none; }
}
.splash:not(.is-ready) .splash__start { pointer-events: none; opacity: .5; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* ═══════════════════════════════ toasts / modal / menu / forms ═══════════════════════════════ */
.toasts { position: fixed; left: 50%; bottom: calc(var(--dock-h) + 16px); transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(560px, calc(100vw - 24px)); }
.toast {
  display: flex; align-items: center; gap: 9px; max-width: 100%; padding: 9px 16px 9px 12px; border-radius: 12px; pointer-events: auto; cursor: pointer;
  font-size: 12.5px; color: var(--text);
  background: linear-gradient(180deg, rgba(30, 37, 60, .96), rgba(16, 20, 33, .96));
  box-shadow: 0 0 0 1px rgba(140, 160, 220, .2), 0 12px 36px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transform: translateY(10px) scale(.97); transition: opacity .25s ease, transform .3s var(--ease-spring);
}
.toast.is-in { opacity: 1; transform: none; }
.toast.is-out { opacity: 0; transform: translateY(-6px) scale(.98); }
.toast .ic-wrap { color: var(--a-cyan); }
.toast--ok .ic-wrap { color: var(--a-teal); }
.toast--warn .ic-wrap { color: var(--a-amber); }
.toast--error { box-shadow: 0 0 0 1px rgba(255, 107, 129, .55), 0 12px 36px rgba(0, 0, 0, .5); }
.toast--error .ic-wrap { color: var(--a-red); }
.toast__msg { overflow-wrap: anywhere; }

.modal-back {
  position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px;
  background: rgba(3, 4, 8, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .2s ease;
}
.modal-back.is-in { opacity: 1; }
.modal {
  width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 18px; padding: 18px 20px 18px;
  background: linear-gradient(180deg, rgba(28, 35, 58, .97), rgba(14, 17, 29, .98));
  box-shadow: 0 0 0 1px rgba(160, 180, 240, .16), 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(167, 139, 250, .12);
  transform: translateY(10px) scale(.98); transition: transform .28s var(--ease-spring);
}
.modal-back.is-in .modal { transform: none; }
.modal--small { width: min(400px, 100%); }
.modal--help { width: min(560px, 100%); }
.modal__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal__title { margin: 0; flex: 1; font-size: 16px; font-weight: 600; letter-spacing: .02em; }
.modal__x { width: 30px; height: 30px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field__lbl { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--text-dim); }
.field__input {
  width: 100%; padding: 9px 11px; border: 0; border-radius: 10px; outline: none; resize: vertical;
  font: 500 13px var(--font-ui); color: var(--text); background: rgba(0, 0, 0, .35); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .2s ease;
}
.field__input:focus { box-shadow: inset 0 0 0 1px rgba(92, 242, 255, .6), 0 0 16px rgba(92, 242, 255, .12); }
.field__input.is-invalid { box-shadow: inset 0 0 0 1px var(--a-red); }
select.field__input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.help__table { width: 100%; border-collapse: collapse; }
.help__table th, .help__table td { padding: 7px 6px; text-align: left; border-bottom: 1px solid var(--line); font-size: 12.5px; vertical-align: top; }
.help__table th { width: 44%; font-weight: 500; }
kbd { display: inline-block; padding: 2px 7px; border-radius: 6px; font: 600 11px var(--font-mono); color: var(--text); background: rgba(255, 255, 255, .06); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .5), 0 0 0 1px var(--line); }
.menu {
  position: fixed; z-index: 2500; min-width: 220px; padding: 6px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(28, 35, 58, .97), rgba(14, 17, 29, .98));
  box-shadow: 0 0 0 1px rgba(160, 180, 240, .16), 0 20px 60px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top right; transition: opacity .15s ease, transform .2s var(--ease-spring);
}
.menu.is-in { opacity: 1; transform: none; }
.menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; cursor: pointer; background: none;
  color: var(--text); font-size: 12.5px; text-align: left;
}
.menu__item .ic-wrap { color: var(--text-dim); width: 16px; }
.menu__item:hover, .menu__item:focus-visible { background: rgba(92, 242, 255, .1); outline: none; }
.menu__item:hover .ic-wrap { color: var(--a-cyan); }
.menu__item kbd { margin-left: auto; font-size: 10.5px; }
.menu__sep { height: 1px; margin: 5px 6px; background: var(--line); }

/* fallback visualisers (only when visuals.js is unavailable) */
.fv { position: relative; width: 100%; height: 100%; }
.fv canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fv-meter { display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 100%; height: 100%; }
.fv-meter i { display: block; height: 4px; width: 0; border-radius: 2px; background: var(--grad-aurora); transition: width .08s linear; }

/* ═══════════════════════════════ responsive ═══════════════════════════════ */
@media (max-width: 1799px) {
  /* 突變 / 隨機 (the fun ones) keep their words longer than Save / Tap: a wand and a die alone say little */
  .tb-tools .tb-btn:not(.tb-btn--mutate):not(.tb-btn--random) .tb-btn__lbl, .tb-btn--tap .tb-btn__lbl { display: none; }
  .tb-tools .tb-btn:not(.tb-btn--mutate):not(.tb-btn--random), .tb-btn--tap { padding: 0; width: 34px; justify-content: center; }
  .tb-tools .tb-btn--mutate, .tb-tools .tb-btn--random { padding: 0 10px 0 8px; gap: 5px; }
  /* …and the preset name keeps its room: secondary readouts go first */
  .logo__zh, .midi .midi__txt, .tb-perf .cpu { display: none; }
}
@media (max-width: 1599px) {
  .tb-vol { width: 112px; }
  .pn__main { width: 210px; }
  .voices { display: none; }
}
@media (max-width: 1440px) {
  .tb-btn--tap { display: none; }
  .topbar { gap: 10px; }
  .tb-right { gap: 6px; }
  /* the preset name matters most: give it the room the secondary readouts used */
  .logo__zh, .midi .midi__txt, .tb-perf .cpu { display: none; }
  .logo__word { letter-spacing: .2em; }
  .tb-vol { width: 96px; }
  /* the name box shrinks first (never the ◀ ▶ ☆ around it — .pn clips its overflow) */
  .pn__main { min-width: 72px; }
  .tb-sep { margin: 0; }
}
@media (max-width: 1320px) {
  /* MIDI status only earns its space once a device is connected (auto-connects when already permitted; ⋯ menu offers 連接 MIDI) */
  .midi:not(.is-on) { display: none; }
  .tb-vol { width: 84px; }
}
@media (max-width: 1440px) {
  .pane--sources { grid-template-columns: 200px minmax(0, 1fr); }
  .pane--sources .card--amp { grid-column: 1 / -1; }
  .card--amp .card__body { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 0 18px; align-items: start; }
  .card--amp .env-wrap { grid-row: span 2; margin-bottom: 0; }
  .mod-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mod-top .card--envs { grid-column: 1 / -1; }
  .card--envs .envs-view { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 0 18px; align-items: start; }
  .card--envs .env-wrap { grid-row: span 2; margin-bottom: 0; }
}
@media (max-width: 1279px) {
  :root { --sidebar-w: 0px; --dock-h: 142px; }
  .tb-tools .tb-btn--mutate .tb-btn__lbl, .tb-tools .tb-btn--random .tb-btn__lbl { display: none; }
  .tb-tools .tb-btn--mutate, .tb-tools .tb-btn--random { padding: 0; width: 34px; justify-content: center; }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main" "dock"; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar-h); bottom: 0; width: min(330px, 88vw); z-index: 70;
    transform: translateX(-104%); transition: transform .38s var(--ease-out); box-shadow: 20px 0 60px rgba(0, 0, 0, .5);
    background: linear-gradient(180deg, rgba(14, 17, 28, .97), rgba(10, 12, 20, .97));
  }
  .drawer-open .sidebar { transform: none; }
  .sidebar { padding-left: env(safe-area-inset-left); }
  .scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 65; background: rgba(3, 4, 8, .5); opacity: 0; pointer-events: none; transition: opacity .3s ease; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .drawer-open .scrim { opacity: 1; pointer-events: auto; }
  .sb-close { display: inline-grid; }
  .tb-browse { display: inline-grid; }
  .logo__zh { display: none; }
  .voices { display: none; }
  .mm-grid { grid-template-columns: minmax(0, 1fr); }
  .mm-grid .mm-row--head:nth-child(2) { display: none; }
  .filter-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .perf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fm-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .tb-vol, .midi .midi__txt, .tb-perf, .logo__word, .tb-btn--tap { display: none; }
  .tb-center { gap: 6px; }
  .tb-tools { gap: 4px; }
  .pn__main { width: 220px; }
  .tb-tools .tb-sep { display: none; }
  .demo__sub { display: none; }
  .pane--sources { grid-template-columns: minmax(0, 1fr); }
  .src-rack { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .src-strip { flex-direction: column; align-items: stretch; }
  .src-strip.is-selected::after { display: none; }
  .src-strip__ctl { justify-content: space-between; }
}
/* phone / small tablet: "play" layout */
@media (max-width: 899px) {
  /* dock: 8 px pad + octave/hold strip 32 + 6 + keys 140 + bottom pad (the home-indicator inset when there is one) */
  :root { --topbar-h: calc(56px + env(safe-area-inset-top)); --dock-h: calc(186px + max(8px, env(safe-area-inset-bottom))); --fs-cap: 10px; }
  .topbar { gap: 6px; padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); }
  .logo__word, .tb-tools .tb-btn--mutate, .tb-tools .tb-btn:first-child, .tb-tools .icon-btn, .tb-tools .tb-sep, .tb-tempo, .midi, .tb-perf, .pn__fav { display: none; }
  .tb-center { justify-content: flex-start; gap: 5px; }
  .pn__main { min-width: 0; max-width: none; width: auto; flex: 1; padding: 0 8px; }
  .pn__name { font-size: 13.5px; letter-spacing: 0; }
  .pn { gap: 2px; }
  .pn .icon-btn { width: 26px; }
  .pn__main { padding: 0 6px 0 8px; }
  .pn__cat { display: none; }
  .pn { flex: 1 1 auto; }
  .demo { padding: 0 7px; height: 34px; }
  .demo__txt { display: none; }
  .tb-edit { display: inline-flex; padding: 0 10px; }
  .tb-edit .tb-btn__lbl { display: none; }
  /* editor open: the pencil becomes a filled ✓ 完成 (the way back to the play view) */
  .tb-edit.is-on { gap: 5px; color: #06121a; background: var(--grad-aurora); box-shadow: 0 0 14px rgba(92, 242, 255, .3); }
  .tb-edit.is-on .tb-btn__lbl { display: inline; }
  /* ◀ ▶ both stay: tighter buttons and gaps keep room for the preset name */
  .topbar, .tb-right { gap: 4px; }
  .tb-center { gap: 4px; }
  .topbar .icon-btn, .tb-tools .tb-btn { width: 32px; }
  .pn .icon-btn { width: 24px; }
  .demo, .dc-btn, .tb-edit:not(.is-on) { width: 34px; padding: 0; justify-content: center; }
  .play { height: auto; grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .play__collapse { display: none; }
  .play__left { gap: 14px; }
  .play__macros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; padding: 12px 6px 8px; }
  /* tall phone sky: the knobs get a smoked-glass tray (no blur) so labels stay legible over bright curtains */
  .play__macros.glass { background: linear-gradient(180deg, rgba(5, 6, 12, .5), rgba(5, 6, 12, .62)); box-shadow: inset 0 0 0 1px rgba(160, 180, 240, .1); }
  .play__macros::before { display: none; }
  .play { --hero-k: 84px; }
  .macro__targets { display: none; }
  .macro.is-info .macro__targets { display: block; }
  .play__side { grid-template-rows: auto 56px; }
  .play__xy .ac-xy { aspect-ratio: 16 / 10; height: auto; max-height: 300px; }
  .lang, .logo { display: none; }
  .editor { display: none; }
  .show-editor .editor { display: block; }
  .tabs { overflow-x: auto; }
  .tab { flex: 0 0 auto; }
  .tab .bi__sub { display: none; }
  .perf-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-col { grid-template-columns: minmax(0, 1fr); }
  .osc-grid, .noise-grid, .phys-choosers { grid-template-columns: minmax(0, 1fr); }
  .mod-top { grid-template-columns: minmax(0, 1fr); }
  .card--envs .envs-view, .card--amp .card__body { display: block; }
  .card--envs .env-wrap, .card--amp .env-wrap { margin-bottom: 10px; }
  .src-rack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dock {
    grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 6px 8px;
    padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  .dock__wheels { grid-row: 1 / span 2; }
  /* octave ‹ › and Hold stay reachable on touch: a compact strip above the keys (velocity comes from where a
     key is touched, so its meter is left out) */
  .dock__ctl { grid-column: 2; grid-row: 1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; width: auto; min-width: 0; }
  .dock__ctl .dock__cap, .dock__ctl .vel { display: none; }
  .oct__row { gap: 4px; }
  .oct__btn { width: 40px; height: 32px; border-radius: 10px; }
  .oct__val { flex: none; min-width: 66px; font-size: 11.5px; }
  .dock__ctl .hold { margin-left: auto; height: 32px; padding: 0 14px 0 11px; }
  .dock__kb { grid-column: 2; grid-row: 2; }
  .dock__kb .ac-kb { --kb-h: 140px; }
  .wheel { width: 36px; }
  .toasts { bottom: calc(var(--dock-h) + 10px); }
  .play-collapsed .play { height: auto; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .play__macros { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .tb-tools .tb-btn--random { display: none; } /* small phones: 隨機 moves into the ⋯ menu, the name keeps its room */
}
/* phone in landscape (the natural way to play the keys): a slim top bar, the octave / hold column beside the
   keys, and the play view as one row — title + the 4 macro knobs — so the macros are visible without scrolling */
@media (max-width: 899px) and (orientation: landscape) and (max-height: 500px) {
  :root { --topbar-h: calc(48px + env(safe-area-inset-top)); --dock-h: calc(120px + max(8px, env(safe-area-inset-bottom))); }
  .topbar .icon-btn, .topbar .tb-btn, .topbar .demo, .topbar .dc-btn { height: 32px; }
  .dock { grid-template-columns: auto auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .dock__wheels { grid-row: auto; }
  .dock__ctl { grid-column: auto; grid-row: auto; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 6px; width: 84px; }
  .oct { display: flex; flex-direction: column; }
  .oct__row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .oct__val { grid-column: 1 / -1; order: -1; min-width: 0; font-size: 11px; }
  .oct__btn { width: auto; height: 34px; }
  .dock__ctl .hold { margin-left: 0; height: 38px; padding: 0 8px; justify-content: center; }
  .dock__kb { grid-column: auto; grid-row: auto; }
  .dock__kb .ac-kb { --kb-h: 112px; }
  .play { --hero-k: 54px; padding: 8px 12px 8px 14px; gap: 10px; }
  .play__desc, .play__tags, .play__meta { display: none; }
  .play__left { flex-direction: row; align-items: center; gap: 10px; }
  .play__info { flex: 0 1 34%; }
  .play__name { font-size: 20px; }
  .play__macros { flex: 1; min-width: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 8px 4px 4px; }
  .macro .ac-knob__label { max-width: 96px; }
}
/* vertical economy on laptop-height screens: a tighter hero and keyboard leave the editor more room */
@media (max-height: 940px) and (min-width: 900px) {
  :root { --dock-h: 140px; }
  .dock__kb .ac-kb { --kb-h: 116px; }
  .play { --hero-k: 88px; min-height: 0; }
  .play__desc { -webkit-line-clamp: 1; line-clamp: 1; }
}
@media (max-height: 820px) and (min-width: 900px) {
  :root { --dock-h: 128px; }
  .dock__kb .ac-kb { --kb-h: 104px; }
  /* the octave / velocity / hold column must fit the 107 px content row too (it needed 121 px, so the dock
     overflowed the window by 4 px: clipped key bottoms, and focusing a dock control scrolled the whole page) */
  .dock__ctl { gap: 4px; }
  .dock__cap { font-size: 10px; line-height: 13px; margin-bottom: 1px; }
  .oct__btn { width: 26px; height: 26px; }
  .hold { height: 26px; }
  .play { --hero-k: 78px; padding-top: 12px; padding-bottom: 8px; }
  .play__name { font-size: clamp(22px, 2.3vw, 32px); }
  .play__tags { margin-top: 6px; }
}
@media (max-height: 700px) and (min-width: 900px) {
  .play { --hero-k: 70px; }
  .play__tags { display: none; }
}

/* first-run tips (main.js showCoach) */
.coach {
  position: fixed; right: 18px; bottom: calc(var(--dock-h) + 16px); z-index: 60; width: min(380px, calc(100vw - 24px)); padding: 12px 14px 12px;
  border-radius: 16px; background: linear-gradient(180deg, rgba(28, 34, 58, .97), rgba(14, 17, 29, .97));
  box-shadow: inset 0 0 0 1px rgba(92, 242, 255, .3), 0 18px 50px rgba(0, 0, 0, .55), 0 0 40px rgba(92, 242, 255, .1);
  opacity: 0; transform: translateY(12px); transition: opacity .3s ease, transform .35s var(--ease-out);
}
.coach.is-in { opacity: 1; transform: none; }
.coach__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.coach__title { font-size: 13px; font-weight: 700; letter-spacing: .06em; background: var(--grad-aurora); -webkit-background-clip: text; background-clip: text; color: transparent; }
.coach__x { width: 28px; height: 28px; font-size: 12px; }
.coach__list { margin: 0 0 10px; padding: 0; list-style: none; display: grid; gap: 8px; }
.coach__step { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.45; color: var(--text); }
.coach__n { flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; font: 700 11px var(--font-mono); color: #061018; background: var(--grad-aurora); }
.coach__go { flex: none; margin-left: auto; height: 26px; padding: 0 10px; border: 0; border-radius: 99px; cursor: pointer; font-size: 12px; color: var(--a-cyan); background: rgba(92, 242, 255, .1); box-shadow: inset 0 0 0 1px rgba(92, 242, 255, .35); }
.coach__ok { display: block; margin-left: auto; height: 32px; }
@media (max-width: 899px) { .coach { right: 12px; left: 12px; width: auto; bottom: calc(var(--dock-h) + 10px); } }

/* touch: small controls get a finger-sized hit area (the visual size mostly stays) */
@media (pointer: coarse) {
  .prow__fav, .prow__del { width: 36px; height: 36px; opacity: .6; } /* no hover on touch: the ☆ must be visible */
  .chip { min-height: 34px; }
  .pn .icon-btn, .av-chip { position: relative; }
  .pn .icon-btn::after, .av-chip::after { content: ""; position: absolute; inset: -6px -3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
