:root {
  --header-h: 52px;
  --menu-h: 40px;
  --footer-h: 28px;
  --key-h: 214px;
  --bg: #0c0b09;
  --bg-2: #16130e;
  --panel: #1b1712;
  --panel-2: #241f18;
  --line: rgba(224, 177, 90, 0.35);
  --text: #f6efe2;
  --muted: #b3a48b;
  --accent: #e0b15a;
  --accent-2: #8c6230;
  --led: #ffd78a;
  --trim: #d7b56a;
  --glow: #e7c56a;
  --glow-2: #2ee6ff;
  --danger: #d4654a;
  --key-white: #f4efe6;
  --key-white-text: #2a2118;
  --key-black: #1a1612;
  --key-black-edge: #3a3126;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  --viz-bg: #100e0a;
  --viz-line: #e0b15a;
  --viz-dim: rgba(224, 177, 90, 0.28);
  --viz-spec: rgba(224, 177, 90, 0.9);
  --viz-vu: #e7c27a;
  --font: "Segoe UI", "Helvetica Neue", "Noto Sans", "Noto Sans Arabic", "Noto Sans Hebrew", "Noto Sans Devanagari", sans-serif;
  color-scheme: dark;
  font-family: var(--font);
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 100% -10%, color-mix(in srgb, var(--glow-2) 16%, transparent), transparent 46%),
    radial-gradient(800px 380px at 0% 0%, color-mix(in srgb, var(--glow) 18%, transparent), transparent 42%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px),
    var(--bg);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

#app {
  height: 100%;
  display: grid;
  grid-template-rows: var(--header-h) var(--menu-h) minmax(0, 1fr) var(--key-h) var(--footer-h);
  background:
    radial-gradient(1200px 400px at 10% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 50%),
    var(--bg);
}

.topbar, .menubar, .credit {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  overflow: hidden;
  white-space: nowrap;
}
.topbar {
  height: var(--header-h);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 88%, white 6%), var(--bg-2));
  border-bottom: 1px solid var(--line);
}
.menubar {
  height: var(--menu-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 5;
}
.credit {
  height: var(--footer-h);
  justify-content: flex-start;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.credit span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.credit a { text-decoration: none; flex: 0 0 auto; }

.mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background:
    radial-gradient(circle at 50% 50%, transparent 0 18%, var(--led) 19% 22%, transparent 23%),
    linear-gradient(90deg, transparent 18%, var(--accent) 18% 22%, transparent 22% 38%, var(--accent) 38% 62%, transparent 62% 78%, var(--accent) 78% 82%, transparent 82%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--led) 70%, transparent);
}
.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.brand strong { font-size: 15px; letter-spacing: 0.01em; overflow: hidden; text-overflow: ellipsis; }
.ver {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--bg);
  background: var(--accent);
  border-radius: 999px;
  padding: 2px 6px;
}
.patch-name, .audio-state { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.patch-name { flex: 1; font-size: 13px; }
.audio-state { color: var(--muted); font-size: 12px; }

.hamburger {
  display: none;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 4px 8px;
}
.menu-row { display: flex; align-items: stretch; gap: 4px; min-width: 0; flex: 1; flex-wrap: nowrap; }
.menu { position: relative; flex: 0 0 auto; }
.menu > button.menu-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
}
.menu > button.menu-btn:hover, .menu.open > button.menu-btn { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.drop {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-start: 0;
  min-width: 240px;
  max-width: min(420px, 80vw);
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 30;
}
.menu.open > .drop { display: grid; gap: 4px; }
.drop button, .drop label.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: start;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
}
.drop button:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.drop .group-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 2px; }
.skin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line) !important;
  background: var(--panel-2) !important;
  border-radius: 10px !important;
  padding: 6px !important;
  min-height: 42px;
}
.swatch i {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25), 0 0 8px var(--swatch, var(--accent));
  background: radial-gradient(circle at 40% 35%, #fff 0 2px, var(--swatch, var(--accent)) 3px 70%, #000 100%);
}
.swatch span { font-size: 11px; line-height: 1.25; text-align: start; }
.swatch.active { outline: 2px solid var(--accent); }

#stage { min-height: 0; min-width: 0; display: flex; position: relative; z-index: 1; }
#workspace { min-height: 0; min-width: 0; flex: 1; display: flex; flex-direction: column; position: relative; }
.topbar { position: relative; z-index: 4; }
#grid {
  isolation: isolate;
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: grid;
  align-items: start;
  gap: 8px;
  padding: 8px;
  overflow: auto;
}
#pager {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 8px 6px;
}
.panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 1px, transparent 1px 3px),
    linear-gradient(165deg, color-mix(in srgb, var(--panel) 70%, white 12%) 0%, var(--panel) 42%, color-mix(in srgb, var(--panel) 88%, black) 100%);
  border: 1px solid color-mix(in srgb, var(--trim) 80%, white 10%);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 0 0 1px rgba(0,0,0,.45),
    inset 0 -12px 24px rgba(0,0,0,.18),
    0 10px 28px rgba(0,0,0,.38);
  overflow: hidden;
}
.panel::before {
  content: "";
  position: absolute;
  inset: 5px;
  pointer-events: none;
  z-index: 3;
  background:
    radial-gradient(circle at 7px 7px, #f4f4f4 0 1px, var(--trim) 1.5px 3px, transparent 3.6px),
    radial-gradient(circle at calc(100% - 7px) 7px, #f4f4f4 0 1px, var(--trim) 1.5px 3px, transparent 3.6px),
    radial-gradient(circle at 7px calc(100% - 7px), #f4f4f4 0 1px, var(--trim) 1.5px 3px, transparent 3.6px),
    radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), #f4f4f4 0 1px, var(--trim) 1.5px 3px, transparent 3.6px);
}
.panel.is-float {
  position: absolute;
  margin: 0;
  resize: none;
  box-shadow: var(--shadow), 0 0 0 1px var(--line);
}
.panel-head {
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px 0 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--trim) 42%, white 8%), color-mix(in srgb, var(--panel-2) 80%, black));
  border-bottom: 1px solid color-mix(in srgb, var(--trim) 70%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
  min-width: 0;
}
.panel-head h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  line-height: 1;
}
.icon-btn:hover { border-color: var(--line); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.panel-body { flex: 0 0 auto; height: auto; min-height: 0; overflow: visible; padding: 8px; }
.panel.is-float .panel-body { flex: 1; overflow: auto; }
.resize-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  inset-inline-end: 2px;
  bottom: 2px;
  cursor: nwse-resize;
  border-inline-end: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  opacity: 0.7;
}

.knobs { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: flex-start; }
.knob {
  width: 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  user-select: none;
  touch-action: none;
}
.knob svg { width: 64px; height: 64px; display: block; }
.knob .well { fill: #07080c; stroke: color-mix(in srgb, var(--trim) 70%, black); stroke-width: 2; }
.knob .knurl { fill: none; stroke: var(--trim); stroke-width: 3; stroke-dasharray: 1.4 2.1; }
.knob .track { fill: none; stroke: rgba(0,0,0,.45); stroke-width: 3.5; }
.knob .arc { fill: none; stroke: var(--glow); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 3px var(--glow)); }
.knob .arc-cyan { fill: none; stroke: var(--glow-2); stroke-width: 1.6; stroke-linecap: round; opacity: .9; }
.knob .cap { stroke: color-mix(in srgb, var(--trim) 80%, white); stroke-width: 1; }
.knob .spec { fill: rgba(255,255,255,.55); }
.knob .pointer { stroke: var(--glow-2); stroke-width: 2.4; stroke-linecap: round; filter: drop-shadow(0 0 2px var(--glow-2)); }
.knob label, .tiny {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}
.choice-row, .tool-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.choice, .tool-row button, .step, .pad, .white, .black {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 8px;
}
.choice, .tool-row button { padding: 6px 8px; }
.choice, .pad, .step {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 70%, white 10%), var(--panel-2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 0 rgba(0,0,0,.35);
}
.choice.active, .step.on, .pad.on {
  background: linear-gradient(180deg, color-mix(in srgb, var(--glow-2) 55%, white), var(--glow));
  color: #140e08;
  border-color: transparent;
  box-shadow: 0 0 12px color-mix(in srgb, var(--glow-2) 70%, transparent), inset 0 1px 0 rgba(255,255,255,.65);
}
select, input[type="search"], input[type="number"] {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 0;
  max-width: 100%;
}
input[type="search"] { width: 100%; }

.list-wrap, .clip-list { position: relative; overflow: auto; height: 168px; min-height: 168px; }
.list-spacer { position: relative; width: 100%; }
.list-window { position: absolute; inset-inline: 0; top: 0; }
.preset-row, .mini-row {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  background: transparent;
  width: 100%;
  text-align: start;
  border-radius: 0;
}
.preset-row:hover, .mini-row:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.preset-row .meta { margin-inline-start: auto; color: var(--muted); font-size: 10px; }
.star { color: var(--led); }

.seq { display: grid; gap: 3px; }
.seq-row { display: grid; grid-template-columns: 42px repeat(16, minmax(0, 1fr)); gap: 3px; align-items: center; }
.seq-row span { font-size: 10px; color: var(--muted); overflow: hidden; }
.step { height: 22px; padding: 0; }

.viz-canvas, .wt-canvas, .curve-canvas, .mini-canvas {
  width: 100%;
  display: block;
  border-radius: 12px;
  background: #07080c;
  border: 1px solid color-mix(in srgb, var(--trim) 75%, black);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 0 3px rgba(0,0,0,.55), inset 0 18px 28px rgba(255,255,255,.04);
}
.viz-canvas, .wt-canvas, .curve-canvas { height: 120px; }
.mini-canvas { height: 78px; }

#keyboard-dock {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.key-head { flex: 0 0 28px; display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.key-head strong { flex: 1; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.pads { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; padding: 0 8px 4px; }
.pad { height: 36px; }
.keybed { position: relative; flex: 1; min-height: 0; margin: 0 8px 8px; direction: ltr; }
.whites { display: flex; height: 100%; gap: 2px; }
.keybed {
  border-radius: 10px;
  background: linear-gradient(180deg, #1a140c, #070605);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--trim) 60%, transparent), 0 0 18px color-mix(in srgb, var(--glow) 28%, transparent);
}
.white {
  flex: 1;
  min-width: 0;
  height: 100%;
  color: var(--key-white-text);
  border-radius: 0 0 7px 7px;
  position: relative;
  background: linear-gradient(180deg, #fffefb 0%, var(--key-white) 46%, #d9c7a4 100%);
  box-shadow: inset 0 -10px 0 color-mix(in srgb, var(--glow) 45%, #8a7044), inset 0 1px 0 #fff;
}
.white.active { box-shadow: inset 0 -10px 0 var(--glow-2), 0 0 14px var(--glow-2); }
.black {
  position: absolute;
  top: 0;
  height: 58%;
  color: var(--text);
  border: 1px solid var(--key-black-edge);
  border-radius: 0 0 5px 5px;
  z-index: 2;
  background: linear-gradient(180deg, #3a342c 0%, var(--key-black) 40%, #050403 100%);
  box-shadow: inset 0 -6px 0 #000, inset 0 1px 0 rgba(255,255,255,.25);
}
.black.active { background: linear-gradient(180deg, var(--glow-2), var(--glow)); color: #140e08; box-shadow: 0 0 12px var(--glow-2); }
.k-label { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 10px; pointer-events: none; }

#splash {
  position: fixed;
  inset: 0;
  z-index: 80;
  border: 0;
  margin: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #f6efe2;
  background:
    radial-gradient(600px 320px at 50% 40%, rgba(224, 177, 90, 0.18), transparent 60%),
    #0c0b09;
}
.splash-card { display: grid; justify-items: center; gap: 6px; }
.emblem { width: min(180px, 40vw); height: auto; }
.ring { fill: none; stroke: #e0b15a; stroke-width: 3; }
.wave {
  fill: none;
  stroke: #f3e2b8;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  animation: draw 2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px #e0b15a);
}
.core { fill: #ffd78a; }
.splash-kicker { letter-spacing: 0.28em; font-size: 12px; text-transform: uppercase; color: #e0b15a; }
.splash-title { font-size: clamp(28px, 5vw, 56px); letter-spacing: -0.03em; }
.splash-sub { color: #b3a48b; letter-spacing: 0.22em; font-size: 12px; }
.splash-skip { margin-top: 10px; font-size: 13px; color: #d9c7a2; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal {
  width: min(640px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 8px; }
.price-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 8px 0;
  background: var(--panel-2);
}
.price-card strong { display: block; margin-bottom: 4px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.modal .actions button { border-radius: 8px; border: 1px solid var(--line); background: var(--bg); padding: 8px 12px; }

.empty-note { color: var(--muted); padding: 12px; }

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 18px 64px;
  line-height: 1.55;
}
.legal h1 { font-size: 28px; margin-bottom: 8px; }

@media (max-width: 860px) {
  :root { --header-h: 48px; --key-h: 188px; --footer-h: 26px; }
  .hamburger { display: inline-flex; }
  .brand strong { font-size: 13px; max-width: 46vw; }
  .patch-name, #voice-readout { display: none; }
  .credit { font-size: 11px; gap: 8px; }
  .menu-row {
    display: none;
    position: fixed;
    z-index: 60;
    top: calc(var(--header-h) + var(--menu-h));
    bottom: 0;
    inset-inline-start: 0;
    width: min(340px, 92vw);
    flex-direction: column;
    overflow: auto;
    background: var(--panel);
    border-inline-end: 1px solid var(--line);
    padding: 8px;
    gap: 4px;
  }
  body.drawer-open .menu-row { display: flex; }
  .menu { width: 100%; }
  .drop { position: static; display: grid; min-width: 0; max-height: none; box-shadow: none; border: 0; padding: 0 0 8px; background: transparent; }
  .menu > button.menu-btn { width: 100%; text-align: start; background: color-mix(in srgb, var(--accent) 10%, transparent); }
  .pad { height: 32px; }
  .black { height: 54%; }
}

@media (max-width: 640px) {
  :root { --key-h: 248px; }
  .pads { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pad { height: 34px; font-size: 12px; }
  .lib-layout { flex-direction: column; }
  .lib-tree { width: auto; flex-basis: auto; flex-direction: row; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .wave { animation: none; stroke-dashoffset: 0; }
}

.ai-toggle {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  flex: 0 0 auto;
}
.ai-toggle[aria-expanded="true"] { background: var(--accent); color: #1a1208; }
#bot-drawer {
  flex: 0 0 min(340px, 78vw);
  width: min(340px, 78vw);
  min-width: 0;
  overflow: auto;
  border-inline-start: 1px solid var(--line);
  background: var(--bg-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
}
.bot-head, .osc-head, .key-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bot-log { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow: auto; }
.bot-card, .drop-zone, .matrix, .arranger, .lib-tree {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: color-mix(in srgb, var(--panel) 80%, transparent);
}
.drop-zone { min-height: 52px; text-align: center; color: var(--muted); }
.chips, .lfo-grid, .fx-chain { display: flex; flex-wrap: wrap; gap: 6px; }
.lfo-grid > div, .fx-row, .matrix-row, .track-row, .user-row { flex: 1 1 180px; min-width: 0; }
.fx-row, .matrix-row, .user-row, .track-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.arranger { overflow-x: auto; }
.ruler, .lane { display: grid; grid-template-columns: repeat(16, 48px); min-width: 768px; }
.lane { position: relative; height: 36px; }
.clip { position: absolute; top: 4px; height: 28px; border-radius: 6px; background: var(--accent); color: #1a1208; padding: 4px 6px; overflow: hidden; }
.track-row { display: grid; grid-template-columns: minmax(140px, 180px) 1fr; gap: 6px; margin-top: 6px; }
.lib-layout { display: flex; gap: 8px; align-items: flex-start; }
.lib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lib-tree { width: 190px; flex: 0 0 190px; display: flex; flex-direction: column; gap: 2px; max-height: none; }
.tree-item, .tree-child { text-align: start; border: 0; background: transparent; color: var(--text); border-radius: 6px; padding: 4px 6px; }
.tree-child { padding-inline-start: 14px; color: var(--muted); }
.transpose-ribbon { height: 28px; margin: 0 8px; border-radius: 999px; border: 1px solid var(--line); display: flex; align-items: center; padding: 0 10px; background: color-mix(in srgb, var(--accent) 18%, transparent); }
.play-row { display: flex; align-items: stretch; flex: 1; min-height: 72px; }
.wheels { display: flex; gap: 6px; padding: 0 0 0 8px; }
.wheel { display: flex; flex-direction: column; align-items: center; font-size: 10px; color: var(--muted); }
.wheel input { writing-mode: vertical-lr; direction: rtl; height: 72px; width: 24px; }
.key-tools { padding: 0 8px 4px; }
.key-tools select { max-width: 46%; }
.knob.is-modulated .arc { stroke: var(--led); filter: drop-shadow(0 0 6px var(--led)); }
.meter { height: 8px; border-radius: 99px; background: #1a140c; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); }
#lyric-box, #bot-input { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.pad { white-space: nowrap; }

html[data-skin="obsidian-gold"] {
  --bg:#0c0b09; --bg-2:#16130e; --panel:#1c1812; --panel-2:#282218; --line:rgba(224,177,90,.38);
  --text:#f6efe2; --muted:#b3a48b; --accent:#e0b15a; --led:#ffd78a; --key-white:#f4efe6; --key-white-text:#2a2118;
  --viz-bg:#100e0a; --viz-line:#e0b15a; --viz-spec:rgba(224,177,90,.9); --viz-vu:#e7c27a; color-scheme:dark;
}
html[data-skin="crimson-stage"] {
  --bg:#14080b; --bg-2:#241014; --panel:#2c1218; --panel-2:#3a1820; --line:rgba(255,92,92,.4);
  --text:#ffe8ea; --muted:#e0a8ad; --accent:#ff4d4d; --led:#ffb3b3; --key-white:#fff1f1; --key-white-text:#3a1014;
  --viz-bg:#1a090c; --viz-line:#ff6b6b; --viz-spec:rgba(255,80,80,.9); --viz-vu:#ff8080; color-scheme:dark;
}
html[data-skin="walnut-analog"] {
  --bg:#2a1c12; --bg-2:#3a2818; --panel:#4a3422; --panel-2:#5c4030; --line:rgba(232,196,150,.35);
  --text:#fff4e4; --muted:#e6c9a8; --accent:#e0a15a; --led:#ffd19a; --key-white:#fff8ee; --key-white-text:#3a2614;
  --viz-bg:#24180f; --viz-line:#e7b56a; --viz-spec:rgba(224,161,90,.9); --viz-vu:#f0c48a; color-scheme:dark;
}
html[data-skin="cyber-violet"] {
  --bg:#120818; --bg-2:#1c0e28; --panel:#26143a; --panel-2:#321c4c; --line:rgba(196,140,255,.4);
  --text:#f6ecff; --muted:#c8b0e6; --accent:#c084fc; --led:#e4c6ff; --key-white:#f7f0ff; --key-white-text:#2a103c;
  --viz-bg:#140a1c; --viz-line:#d7a6ff; --viz-spec:rgba(192,132,252,.9); --viz-vu:#d7a6ff; color-scheme:dark;
}
html[data-skin="midnight-studio"] {
  --bg:#070b14; --bg-2:#101826; --panel:#152033; --panel-2:#1c2942; --line:rgba(140,170,220,.35);
  --text:#e7eefc; --muted:#9aabc8; --accent:#7aa2ff; --led:#c5d6ff; --key-white:#f4f7ff; --key-white-text:#152033;
  --viz-bg:#0a101c; --viz-line:#8eb4ff; --viz-spec:rgba(122,162,255,.9); --viz-vu:#9ec0ff; color-scheme:dark;
}
html[data-skin="daylight-ivory"] {
  --bg:#f4efe4; --bg-2:#fffaf2; --panel:#fffdf8; --panel-2:#f3ecdf; --line:rgba(90,60,20,.28);
  --text:#24180f; --muted:#6d5844; --accent:#8a5a12; --led:#a86b16; --key-white:#fff; --key-white-text:#24180f;
  --key-black:#2a241e; --viz-bg:#fffaf3; --viz-line:#8a5a12; --viz-dim:rgba(138,90,18,.3); --viz-spec:rgba(138,90,18,.85); --viz-vu:#8a5a12;
  --shadow:0 8px 20px rgba(70,40,10,.08); color-scheme:light;
}
html[data-skin="brushed-titanium"] {
  --bg:#3e4348; --bg-2:#4c5258; --panel:#5a6168; --panel-2:#6a727a; --line:rgba(230,236,240,.28);
  --text:#f4f7f8; --muted:#d5dde2; --accent:#d7dee4; --led:#ffffff; --key-white:#f7f8f8; --key-white-text:#2a2e32;
  --viz-bg:#2e3338; --viz-line:#e8eef2; --viz-spec:rgba(220,230,236,.85); --viz-vu:#f2f5f7; color-scheme:dark;
}
html[data-skin="arctic-cyan"] {
  --bg:#061416; --bg-2:#0c2428; --panel:#103238; --panel-2:#164048; --line:rgba(120,230,220,.35);
  --text:#e7fffb; --muted:#9ed4cc; --accent:#3ee0d0; --led:#bffff6; --key-white:#f3fffd; --key-white-text:#083034;
  --viz-bg:#07181a; --viz-line:#5ef0e0; --viz-spec:rgba(62,224,208,.9); --viz-vu:#7af3e6; color-scheme:dark;
}
html[data-skin="acid-emerald"] {
  --bg:#07140c; --bg-2:#0e2416; --panel:#143220; --panel-2:#1b422a; --line:rgba(80,220,120,.35);
  --text:#e9ffe9; --muted:#a6d8b4; --accent:#3dce6e; --led:#c8ffd4; --key-white:#f4fff6; --key-white-text:#0e2816;
  --viz-bg:#08160e; --viz-line:#5ee08a; --viz-spec:rgba(61,206,110,.9); --viz-vu:#7aeea4; color-scheme:dark;
}
html[data-skin="solar-amber"] {
  --bg:#1a0e04; --bg-2:#2a1808; --panel:#3a220c; --panel-2:#4a2e12; --line:rgba(255,170,60,.4);
  --text:#fff4e4; --muted:#efc89a; --accent:#ff9d2e; --led:#ffe0a8; --key-white:#fff8ee; --key-white-text:#3a2208;
  --viz-bg:#1c1006; --viz-line:#ffb04a; --viz-spec:rgba(255,157,46,.9); --viz-vu:#ffc16a; color-scheme:dark;
}
html[data-skin="pearl-champagne"] {
  --bg:#f7f1e8; --bg-2:#fffaf4; --panel:#fffdf9; --panel-2:#f6eee4; --line:rgba(120,90,50,.25);
  --text:#2c2418; --muted:#6e5c48; --accent:#a78455; --led:#8d6840; --key-white:#fff; --key-white-text:#2c2418;
  --key-black:#3a332c; --viz-bg:#fffaf4; --viz-line:#a78455; --viz-dim:rgba(167,132,85,.28); --viz-spec:rgba(167,132,85,.85); --viz-vu:#a78455;
  --shadow:0 8px 20px rgba(80,50,20,.08); color-scheme:light;
}
html[data-skin="tokyo-neon"] {
  --bg:#070712; --bg-2:#12122a; --panel:#181836; --panel-2:#22224a; --line:rgba(255,70,180,.4);
  --text:#f4f4ff; --muted:#c0b0e8; --accent:#ff3cac; --led:#7af6ff; --key-white:#f7f7ff; --key-white-text:#201038;
  --viz-bg:#0a0a18; --viz-line:#7af6ff; --viz-spec:rgba(255,60,172,.9); --viz-vu:#ff77c8; color-scheme:dark;
}
html[data-skin="carbon-stealth"] {
  --bg:#050505; --bg-2:#101010; --panel:#161616; --panel-2:#222; --line:rgba(180,180,180,.28);
  --text:#f2f2f2; --muted:#a3a3a3; --accent:#d0d0d0; --led:#ffffff; --key-white:#f5f5f5; --key-white-text:#111;
  --viz-bg:#080808; --viz-line:#e8e8e8; --viz-spec:rgba(220,220,220,.85); --viz-vu:#eee; color-scheme:dark;
}
html[data-skin="velvet-rose"] {
  --bg:#160910; --bg-2:#261018; --panel:#341824; --panel-2:#452030; --line:rgba(255,170,190,.35);
  --text:#ffeef3; --muted:#e7b4c2; --accent:#e7a0b4; --led:#ffd0dc; --key-white:#fff5f7; --key-white-text:#3a1824;
  --viz-bg:#1a0c12; --viz-line:#f0b4c4; --viz-spec:rgba(231,160,180,.9); --viz-vu:#f3c2d0; color-scheme:dark;
}
html[data-skin="deep-ocean"] {
  --bg:#041018; --bg-2:#08202e; --panel:#0c2c40; --panel-2:#12384e; --line:rgba(120,190,220,.35);
  --text:#e7f6ff; --muted:#9ec6d8; --accent:#3aa0d0; --led:#b7e6ff; --key-white:#f3fbff; --key-white-text:#08202e;
  --viz-bg:#061820; --viz-line:#67c4ea; --viz-spec:rgba(58,160,208,.9); --viz-vu:#8fd4f0; color-scheme:dark;
}
html[data-skin="obsidian-gold"] { --trim:#e7c56a; --glow:#f0c14a; --glow-2:#2ee6ff; }
html[data-skin="crimson-stage"] { --trim:#ffb3a8; --glow:#ff5a4a; --glow-2:#ffd0a1; }
html[data-skin="walnut-analog"] { --trim:#e7c08a; --glow:#e0a15a; --glow-2:#f2d7a2; }
html[data-skin="cyber-violet"] { --trim:#e4c6ff; --glow:#c084fc; --glow-2:#7af6ff; }
html[data-skin="midnight-studio"] { --trim:#c5d6ff; --glow:#7aa2ff; --glow-2:#d7e4ff; }
html[data-skin="daylight-ivory"] { --trim:#8a5a12; --glow:#a86b16; --glow-2:#0e7490; }
html[data-skin="brushed-titanium"] { --trim:#f2f5f7; --glow:#d7dee4; --glow-2:#9fd7ff; }
html[data-skin="arctic-cyan"] { --trim:#bffff6; --glow:#3ee0d0; --glow-2:#e8fffb; }
html[data-skin="acid-emerald"] { --trim:#c8ffd4; --glow:#3dce6e; --glow-2:#e7ff9a; }
html[data-skin="solar-amber"] { --trim:#ffe0a8; --glow:#ff9d2e; --glow-2:#ffe7a3; }
html[data-skin="pearl-champagne"] { --trim:#8d6840; --glow:#a78455; --glow-2:#8a5a2b; }
html[data-skin="tokyo-neon"] { --trim:#ffd0ea; --glow:#ff3cac; --glow-2:#7af6ff; }
html[data-skin="carbon-stealth"] { --trim:#e8e8e8; --glow:#d0d0d0; --glow-2:#7af6ff; }
html[data-skin="velvet-rose"] { --trim:#ffd0dc; --glow:#e7a0b4; --glow-2:#ffd9a0; }
html[data-skin="deep-ocean"] { --trim:#b7e6ff; --glow:#3aa0d0; --glow-2:#7af0ff; }
html[data-skin="mono-mastering"] { --trim:#222; --glow:#111; --glow-2:#3a3a3a; }

html[data-skin="mono-mastering"] {
  --bg:#f2f2f2; --bg-2:#ffffff; --panel:#ffffff; --panel-2:#ececec; --line:rgba(0,0,0,.2);
  --text:#111; --muted:#444; --accent:#111; --led:#333; --key-white:#fff; --key-white-text:#111;
  --key-black:#111; --viz-bg:#fafafa; --viz-line:#111; --viz-dim:rgba(0,0,0,.25); --viz-spec:rgba(0,0,0,.75); --viz-vu:#111;
  --shadow:0 8px 18px rgba(0,0,0,.06); color-scheme:light;
}
}

x-css-guard{}
/* release fix 2026-12-01: fixed-height virtual rows must never wrap/overlap */
.preset-row, .mini-row {
  display: block; height: 30px; line-height: 29px; min-height: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  box-shadow: none; font-size: 13px; box-sizing: border-box;
}
