:root {
  --bg: #000000;
  --plate: #07040b;
  --plate-2: #110a1a;
  --line: #22163a;
  --text: #efe7ff;
  --muted: #a395bd;
  --accent: #a855f7;
  --accent-soft: rgba(168, 85, 247, .2);
  --led-off: #2a1a3a;
  --meter: #d8b4fe;
  --radius: 14px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 13px; user-select: none; -webkit-user-select: none; min-width: 320px; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------- rack + clip dock */
.rack { display: flex; max-width: 1040px; margin: 0 auto; align-items: stretch; }
.rack .unit { flex: 1; min-width: 0; margin: 0; }
body.in-plugin .rack { max-width: none; min-height: 100vh; }
.dock {
  width: 250px; flex: none; background: #0e0914; border-right: 1px solid var(--line);
  padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 100vh; overflow-y: auto;
}
.dock-head { display: flex; align-items: center; justify-content: space-between; }
.dock-head strong { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 10.5px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 4px; }
.sw { width: 10px; height: 8px; border-radius: 2px; display: inline-block; }
.sw.in { background: #7c7391; }
.sw.out { background: var(--accent); }
.sw.gr { background: rgba(255, 79, 216, .45); }
.sw.lim { background: #ff3b30; }
.clips { display: flex; flex-direction: column; gap: 8px; }
.clip-card { background: var(--plate); border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.clip-card .clip-top { display: flex; align-items: center; gap: 6px; font-size: 11px; margin-bottom: 4px; }
.clip-card .clip-top span { flex: 1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip-card .x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: 13px; }
.clip-card .x:hover { color: var(--text); }
.clip-card canvas { width: 100%; height: 86px; display: block; border-radius: 6px; background: #0a0610; cursor: zoom-in; }
.clip-card.big canvas { height: 180px; cursor: zoom-out; }
.btn.download { text-decoration: none; font-weight: 700; white-space: nowrap; }
.rec-top { border-color: #4b2a6e; font-variant-numeric: tabular-nums; min-width: 92px; }
.rec-top.live { background: #c9302c; border-color: #c9302c; color: #fff; }
.viz-icon {
  width: 26px; height: 26px; display: grid; place-items: center;
}
.viz-icon::before {
  content: ""; width: 12px; height: 9px;
  background: linear-gradient(90deg, #7c7391 0 2px, transparent 2px 4px, var(--accent) 4px 6px, transparent 6px 8px, #7c7391 8px 10px, transparent 10px);
  border-radius: 1px;
}
.face.viz { display: block; min-height: 230px; }
.viz-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin-bottom: 10px; }
.viz-empty { color: var(--muted); text-align: center; margin: 60px 0; }
.face.viz .clips { display: flex; flex-direction: column; gap: 10px; }
.face.viz .clip-card canvas { height: 110px; }
.face.viz .clip-card.big canvas { height: 220px; }
.btn.small { padding: 3px 8px; font-size: 11px; }

/* ------------------------------------------------------------- the unit */
.unit {
  max-width: 940px; margin: 0 auto; padding: 14px 16px 18px;
  /* crying obsidian: black glass with purple flecks and glowing tears */
  background:
    radial-gradient(3px 3px at 12% 18%, rgba(196, 120, 255, .55), transparent 70%),
    radial-gradient(2px 2px at 27% 64%, rgba(168, 85, 247, .5), transparent 70%),
    radial-gradient(4px 9px at 41% 8%, rgba(214, 140, 255, .35), transparent 70%),
    radial-gradient(2px 2px at 58% 42%, rgba(196, 120, 255, .45), transparent 70%),
    radial-gradient(3px 7px at 73% 12%, rgba(214, 140, 255, .3), transparent 70%),
    radial-gradient(2px 2px at 86% 71%, rgba(168, 85, 247, .5), transparent 70%),
    radial-gradient(3px 3px at 93% 28%, rgba(196, 120, 255, .4), transparent 70%),
    linear-gradient(160deg, #0c0612, #000 55%, #07030c);
  border-bottom: 1px solid var(--line);
}
body.in-plugin .unit { max-width: none; min-height: 100vh; border: 0; }
.top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo {
  box-shadow: 0 0 10px rgba(168, 85, 247, .6);
  width: 18px; height: 18px; border-radius: 50% 50% 50% 6%; transform: rotate(-45deg);
  background: radial-gradient(circle at 35% 35%, #e9b8ff, var(--accent) 60%, #5b1a99);
}
.wordmark { font-weight: 800; font-size: 16px; letter-spacing: .03em; }
.byline { font-size: 11px; color: #ff2d3d; text-shadow: 0 0 6px rgba(255, 45, 61, .55); font-style: italic; letter-spacing: .04em; margin-left: -4px; }
.badge {
  font-size: 11px; color: var(--muted); padding: 2px 8px; border: 1px solid var(--line);
  border-radius: 999px; white-space: nowrap;
}
.spacer { flex: 1; }
.web-tools { display: flex; gap: 6px; align-items: center; }
.btn {
  background: var(--plate-2); border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; cursor: pointer;
}
.btn:hover { border-color: #4f3d66; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #0d0517; font-weight: 700; }
.btn:disabled { opacity: .4; cursor: default; }
.chip { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip.ok { color: var(--meter); border-color: #3d2a66; }
.chip.warn { color: #e9b8ff; border-color: #5a2f7a; }

/* ------------------------------------------------------------- tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 10px; }
.tab {
  flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 4px;
  background: var(--plate); border: 1px solid var(--line); border-radius: 10px; min-height: 38px;
}
.tab.sel { background: var(--plate-2); border-color: #4a3a5e; box-shadow: inset 0 -2px 0 var(--accent); }
.tab .name { flex: 1; text-align: left; background: none; border: 0; padding: 9px 0; cursor: pointer; font-weight: 600; letter-spacing: .04em; }
.power {
  width: 26px; height: 26px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.power::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--led-off);
  transition: background .12s, box-shadow .12s;
}
.power.on::before { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* ------------------------------------------------------------- faces */
.face {
  position: relative; display: grid; align-items: center; gap: 8px 14px;
  grid-template-columns: auto auto 1fr auto auto;
  background: radial-gradient(120% 140% at 30% 0%, #120a1c, #020103 70%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px;
  min-height: 230px;
}
.face.clip { grid-template-columns: auto auto 1fr auto; }
.face.off .controls-dim { opacity: .35; filter: saturate(.3); }
.off-note {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
  font-size: 11px; color: var(--muted); background: var(--bg); border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 999px; display: none;
}
.face.off .off-note { display: block; }
.controls-dim { display: contents; }
.times { display: flex; flex-direction: column; align-items: center; gap: 4px; justify-self: center; }
.times-row { display: flex; gap: 6px; }
.auto { display: flex; align-items: center; gap: 4px; font-size: 10px; letter-spacing: .14em; color: var(--muted); }
.auto .power { width: 18px; height: 18px; }
.auto .power::before { width: 6px; height: 6px; }
.auto.on { color: var(--text); }

.face-bottom {
  grid-column: 1 / -1; display: flex; gap: 18px; align-items: center; justify-content: center;
  border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; flex-wrap: wrap;
}
.face.off .face-bottom { opacity: .35; filter: saturate(.3); }
.switch-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.switch { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.switch button {
  background: transparent; border: 0; padding: 5px 12px; cursor: pointer; color: var(--muted);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}
.switch button + button { border-left: 1px solid var(--line); }
.switch button.sel { background: var(--plate-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.switch-cap { font-size: 9.5px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.meter-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.limit { display: flex; align-items: center; gap: 4px; font-size: 9.5px; letter-spacing: .12em; color: var(--muted); }
.limit i { width: 7px; height: 7px; border-radius: 50%; background: var(--led-off); }
.limit.on i { background: #ffd23f; box-shadow: 0 0 6px #ffd23f; }
.limit.red i { background: #ff3b30; box-shadow: 0 0 6px #ff3b30; }

/* ------------------------------------------------------------- knobs */
.knob {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: ns-resize; touch-action: none; border-radius: 10px; padding: 4px 2px;
}
.knob svg { display: block; }
.knob .track { stroke: #2f2340; }
.knob .val { stroke: var(--accent); transition: stroke .15s; filter: drop-shadow(0 0 3px rgba(168, 85, 247, .55)); }
.knob .cap { fill: url(#capGrad); stroke: #4a3a5e; }
.knob .needle { stroke: var(--text); }
.knob .mark { stroke: #8f7bb0; stroke-width: 2; }
.knob .mark-label { fill: #cdb8f0; font-size: 13px; font-weight: 600; text-anchor: middle; font-variant-numeric: tabular-nums; }
.knob .num { font-size: 12px; font-variant-numeric: tabular-nums; min-height: 15px; }
.knob .lbl { font-size: 10.5px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.knob.auto-driven .val { stroke: #c9a3ff; stroke-dasharray: 2 3; }
.knob.auto-driven .num::after { content: " auto"; color: var(--muted); font-size: 10px; }

/* ------------------------------------------------------------- meters */
.meters { display: flex; gap: 8px; align-items: stretch; height: 170px; }
.meter { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 22px; }
.meter .well {
  position: relative; flex: 1; width: 10px; border-radius: 5px; background: #0b0710; border: 1px solid var(--line); overflow: hidden;
}
.meter .fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--meter); }
.meter.gr .fill { top: 0; bottom: auto; background: var(--accent); }
.meter span { font-size: 9.5px; color: var(--muted); letter-spacing: .1em; }
.meter b { font-size: 10px; font-weight: 500; font-variant-numeric: tabular-nums; min-height: 13px; }

.btn.rec-btn.live { background: #c9302c; border-color: #c9302c; color: #fff; }
.btn.toggle.on { border-color: var(--accent); color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(16px);
  background: #1d1328; border: 1px solid var(--line); padding: 8px 14px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 760px) {
  .rack { flex-direction: column; }
  .dock { width: auto; border-right: 0; border-bottom: 1px solid var(--line); max-height: none; }
  .clips { flex-direction: row; overflow-x: auto; }
  .clip-card { min-width: 230px; }
}
@media (max-width: 640px) {
  .face, .face.clip { grid-template-columns: 1fr 1fr; justify-items: center; }
  .meters { grid-column: 1 / -1; height: 120px; }
  .flow { grid-template-columns: 1fr; }
  .tab .name { font-size: 12px; }
}

/* ------------------------------------------------------------- big meter layout */
.face.comp, .face.clip {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "left meter right" "strip strip strip" "row row row" "bottom bottom bottom";
  gap: 10px 16px;
}
.area-left { grid-area: left; }
.area-right { grid-area: right; }
.area-meter { grid-area: meter; }
.area-row { grid-area: row; }
.area-strip { grid-area: strip; }
.livestrip {
  position: relative; height: 46px; border-radius: 8px; overflow: hidden; cursor: zoom-in;
  background: #0a0610; border: 1px solid var(--line); box-shadow: inset 0 0 14px rgba(168, 85, 247, .12);
}
.livestrip canvas { width: 100%; height: 100%; display: block; }
.livestrip .live-tag {
  position: absolute; right: 8px; top: 4px; font-size: 9px; letter-spacing: .14em; color: var(--muted);
  pointer-events: none; opacity: .8;
}
.livestrip.flash { box-shadow: inset 0 0 0 2px var(--accent), 0 0 14px rgba(168, 85, 247, .5); }
.area-bottom { grid-area: bottom; }
.face.off > :not(.off-note) { opacity: .35; filter: saturate(.3); }
.face.off .face-bottom { opacity: .35; }

.bigmeter-wrap { display: flex; align-items: stretch; gap: 8px; justify-content: center; min-width: 0; }
.bigmeter {
  position: relative; flex: 1; max-width: 380px; min-width: 180px;
  border-radius: 12px; border: 1px solid var(--line);
  box-shadow: inset 0 0 24px rgba(168, 85, 247, .18), 0 0 18px rgba(168, 85, 247, .12);
  overflow: hidden;
}
.bigmeter svg { display: block; width: 100%; height: auto; }
.bigmeter .scale { fill: none; stroke: #6d5a8a; stroke-width: 2; }
.bigmeter .hot { fill: none; stroke: #ff4fd8; stroke-width: 4; opacity: .75; }
.bigmeter .tick { stroke: #8f7bb0; stroke-width: 1.2; }
.bigmeter .tick.major { stroke: #d8b4fe; stroke-width: 2; }
.bigmeter .tlabel { fill: #cdb8f0; font-size: 12px; font-weight: 600; text-anchor: middle; font-variant-numeric: tabular-nums; }
.bigmeter .dial-title { fill: #8f7bb0; font-size: 9px; letter-spacing: .18em; text-anchor: middle; }
.bigmeter .needle { stroke: #f3e8ff; stroke-width: 2.5; stroke-linecap: round; filter: drop-shadow(0 0 4px #a855f7); }
.bigmeter .hub { fill: #050308; stroke: #2a1a44; stroke-width: 1.5; }
.bigmeter .peak { fill: #ff4fd8; transition: opacity .3s; }
.bigmeter .readout {
  position: absolute; left: 12px; bottom: 8px; display: flex; align-items: baseline; gap: 3px;
  font-variant-numeric: tabular-nums;
}
.bigmeter .readout b { font-size: 20px; font-weight: 700; color: var(--text); text-shadow: 0 0 8px rgba(168, 85, 247, .7); }
.bigmeter .readout span { font-size: 10px; color: var(--muted); }
.bigmeter .limit { position: absolute; right: 12px; bottom: 10px; }
.fader-meter { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 74px; align-self: stretch; }
.fm-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.fm-track {
  position: relative; flex: 1; min-height: 150px; width: 26px; border-radius: 6px; cursor: ns-resize; touch-action: none;
  background: #0a0610; border: 1px solid var(--line); box-shadow: inset 0 0 10px rgba(168, 85, 247, .15);
}
.fm-scale { position: absolute; left: -30px; top: 0; bottom: 0; width: 26px; pointer-events: none; }
.fm-scale span {
  position: absolute; right: 0; transform: translateY(50%); font-size: 8.5px; color: #7f6f99; font-variant-numeric: tabular-nums;
}
.fm-fill {
  /* full height, shown up to the level with clip-path (no layout per frame) */
  position: absolute; left: 3px; right: 3px; bottom: 3px; height: calc(100% - 6px); border-radius: 3px;
  clip-path: inset(100% 0 0 0); will-change: clip-path;
  background: linear-gradient(0deg, #7c3aed, #a855f7 60%, #e9b8ff); box-shadow: 0 0 10px rgba(168, 85, 247, .6);
}
.fm-peak { position: absolute; left: 3px; right: 3px; bottom: 3px; height: 2px; background: #f3e8ff; opacity: .8; transform: translateY(50%); will-change: transform; }
.fm-handle {
  position: absolute; left: -10px; right: -10px; height: 0; transform: translateY(0);
}
.fm-handle::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: #ff4fd8; box-shadow: 0 0 6px #ff4fd8;
}
.fm-handle i {
  position: absolute; right: -2px; top: -7px; width: 0; height: 0;
  border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-right: 11px solid #ff4fd8;
  filter: drop-shadow(0 0 4px rgba(255, 79, 216, .7));
}
.fm-value { font-size: 12px; font-variant-numeric: tabular-nums; }
.fm-level { font-size: 9.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 12px; }
.fm-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.meter.side { width: 18px; }
.meter.side .well { width: 8px; }

.face-row { display: flex; align-items: center; justify-content: center; gap: 6px 14px; flex-wrap: wrap; }
.face-row .auto { flex-direction: column; gap: 2px; }
.face-row .auto .power { width: 22px; height: 22px; }
.face-row .auto .power::before { width: 8px; height: 8px; }

@media (max-width: 640px) {
  .face.comp, .face.clip {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "meter meter" "left right" "strip strip" "row row" "bottom bottom";
  }
}

/* ------------------------------------------------------------- gloss pass: deep black glass */
body { background: radial-gradient(120% 80% at 50% 0%, #0b0612, #000 70%); }
.face, .tab, .deck, .clip-card, .bigmeter, .livestrip, .fm-track { position: relative; }
.face { border-color: #1d1230; box-shadow: 0 10px 40px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .06); }
.face::before {
  /* glass sheen across the top of the panel */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 46%; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, 0) 100%);
}
.bigmeter::after {
  /* curved glass reflection over the dial */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(140% 70% at 30% -10%, rgba(255, 255, 255, .13), rgba(255, 255, 255, 0) 55%),
    linear-gradient(115deg, rgba(255, 255, 255, 0) 55%, rgba(255, 255, 255, .05) 62%, rgba(255, 255, 255, 0) 70%);
}
.bigmeter { border-color: #2a1a44; box-shadow: inset 0 0 30px rgba(168, 85, 247, .22), 0 0 24px rgba(168, 85, 247, .16), 0 6px 18px rgba(0, 0, 0, .9); }
.tab {
  background: linear-gradient(180deg, #130c1d, #050308); border-color: #1d1230;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}
.tab.sel { background: linear-gradient(180deg, #1e1230, #08040e); box-shadow: inset 0 -2px 0 var(--accent), 0 0 16px rgba(168, 85, 247, .25), inset 0 1px 0 rgba(255, 255, 255, .1); }
.btn {
  background: linear-gradient(180deg, #170f22, #07040b); border-color: #2a1a44;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 6px rgba(0, 0, 0, .7);
}
.btn:hover { border-color: #4b2a6e; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 10px rgba(168, 85, 247, .25); }
.btn.accent { background: linear-gradient(180deg, #c084fc, #8b3fe0); border-color: #a855f7; box-shadow: 0 0 12px rgba(168, 85, 247, .45), inset 0 1px 0 rgba(255, 255, 255, .35); }
.fm-track { background: linear-gradient(90deg, #000, #0a0510 50%, #000); }
.fm-track::after, .livestrip::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 45%);
}
.livestrip { background: #000; }
.knob .track { stroke: #1f1530; }
.knob .cap { stroke: #3a2a55; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .9)); }
.switch { background: #030205; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .9); }
.switch button.sel { background: linear-gradient(180deg, #24163a, #0d0716); }
.power.on::before { box-shadow: 0 0 10px var(--accent), 0 0 2px #fff inset; }
.unit { border-bottom-color: #160d24; }

/* ------------------------------------------------------------- round 2: R Comp layout */
.face.comp {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "left mode right" "left meter right" "left row right" "left bottom right" "strip strip strip";
  gap: 10px 18px;
}
.area-mode { grid-area: mode; }
.mode-row { display: flex; justify-content: center; }
.mode-switch .switch { border-radius: 10px; }
.mode-switch .switch button { font-size: 14px; font-weight: 700; letter-spacing: .14em; padding: 9px 30px; }
.mode-switch .switch-cap { display: none; }
.side-col { display: flex; flex-direction: column; align-items: center; gap: 10px; align-self: stretch; }
.side-col .fader-meter, .face.comp > .fader-meter { flex: 1; }
.face.comp .fader-meter { width: 92px; }
.face.comp .fm-track { width: 40px; min-height: 280px; }
.fm-fill.r, .fm-peak.r { display: none; }
.fader-meter.stereo .fm-fill.l, .fader-meter.stereo .fm-peak.l { right: 50%; margin-right: 1px; }
.fader-meter.stereo .fm-fill.r, .fader-meter.stereo .fm-peak.r { display: block; left: 50%; margin-left: 1px; }
.fader-meter.auto-driven .fm-handle::before { background: repeating-linear-gradient(90deg, #ff4fd8 0 5px, transparent 5px 8px); }
.fader-meter.auto-driven .fm-value::after { content: " auto"; color: var(--muted); font-size: 10px; font-weight: 400; }
.autothr {
  width: 84px; height: 84px; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; line-height: 1.25;
  color: var(--muted); background: linear-gradient(180deg, #170f22, #05030a); border: 1px solid #2a1a44;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 4px 10px rgba(0, 0, 0, .8);
}
.autothr i { width: 12px; height: 12px; border-radius: 50%; background: var(--led-off); }
.autothr.on { color: var(--text); border-color: var(--accent); box-shadow: 0 0 16px rgba(168, 85, 247, .45), inset 0 1px 0 rgba(255, 255, 255, .12); }
.autothr.on i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.livestrip { height: 110px; cursor: default; transition: height .15s; }
.livestrip.tall { height: 240px; }
.strip-save { position: absolute; left: 8px; top: 6px; padding: 2px 8px; font-size: 10.5px; }
.livestrip .live-tag { top: 6px; }

/* Visualizer: blue + yellow so it reads as a separate tool */
.face.viz { --viz-blue: #3b82f6; --viz-yellow: #facc15; }
.sw.in { background: #3b82f6; }
.sw.out { background: #facc15; }
.sw.gr { background: rgba(255, 255, 255, .35); }
.face.viz .btn { background: linear-gradient(180deg, #13254a, #071023); border-color: #1e3a8a; color: #dbeafe; }
.face.viz .btn:hover { border-color: #facc15; box-shadow: 0 0 10px rgba(250, 204, 21, .3); }
.face.viz .clip-card { background: #050a14; border-color: #1e3a8a; }
.face.viz .clip-card strong { color: #facc15; }
.face.viz .clip-card .x:hover { color: #facc15; }
.face.viz .clip-card canvas { height: 150px; background: #02050c; }
.face.viz .clip-card.big canvas { height: 320px; }
.tab.viz-tab.sel { box-shadow: inset 0 -2px 0 #facc15, 0 0 16px rgba(59, 130, 246, .3), inset 0 1px 0 rgba(255, 255, 255, .1); }

@media (max-width: 640px) {
  .face.comp {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "mode mode" "meter meter" "left right" "row row" "bottom bottom" "strip strip";
  }
}

/* Ratio: the big knob in the middle of the row */
.face-row .knob:first-child .num { font-size: 15px; font-weight: 700; }
.face-row .knob:first-child .lbl { font-size: 12px; color: var(--text); letter-spacing: .18em; }
.face-row .knob:first-child .mark-label { font-size: 12px; }

/* Ratio bar (R Comp style: ratio slider inside the gain-reduction meter) */
.side-right { flex-direction: row; align-items: stretch; gap: 4px; }
.side-right .fader-meter { flex: none; }
.fm-gr { display: none; }
.gr-bar .fm-fill, .gr-bar .fm-peak { display: none !important; }
.gr-bar .fm-gr {
  display: block; position: absolute; left: 3px; right: 3px; top: 3px; height: calc(100% - 6px); border-radius: 3px;
  clip-path: inset(0 0 100% 0); will-change: clip-path;
  background: linear-gradient(180deg, #ff4fd8, #a855f7 70%, #5b21b6); box-shadow: 0 0 10px rgba(255, 79, 216, .5);
}
.gr-bar .fm-handle::before { background: #f3e8ff; box-shadow: 0 0 6px #fff; }
.gr-bar .fm-handle i { border-right-color: #f3e8ff; }

/* Tab bar: added effects get an x; the Add dropdown sits at the far right */
.tabs { align-items: stretch; }
.tab-x {
  background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 4px; margin-left: -4px;
}
.tab-x:hover { color: #ff4fd8; }
.add-tab {
  margin-left: auto; flex: none; min-width: 140px; border-radius: 10px; padding: 0 10px; cursor: pointer;
  background: linear-gradient(180deg, #1e1230, #08040e); border: 1px dashed #4b2a6e; color: var(--text); font-weight: 600;
}
.add-tab:hover { border-color: var(--accent); box-shadow: 0 0 12px rgba(168, 85, 247, .3); }
.tabs .tab { flex: 0 1 200px; }

.face-row { flex-wrap: nowrap; gap: 4px 8px; }

/* Visualize stays at the far right of the tabs, next to "+ Add effect" */
.tabs .viz-tab { margin-left: auto; order: 90; }
.tabs .add-tab { margin-left: 6px; order: 91; }
/* per-effect colours */
.sw.st-c1 { background: rgba(34, 211, 238, .8); }
.sw.st-c2 { background: rgba(74, 222, 128, .8); }
.sw.st-clip { background: rgba(251, 146, 60, .85); }
.fx-toggle {
  border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700; cursor: pointer;
  background: #071023; border: 1px solid #1e3a8a; color: #93c5fd;
}
.fx-toggle.on { background: #facc15; border-color: #facc15; color: #111; }

/* Take controls (Visualize) */
.take-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ba-switch { display: flex; border: 1px solid #1e3a8a; border-radius: 8px; overflow: hidden; }
.ba-switch button {
  background: #050a14; border: 0; color: #93c5fd; padding: 5px 14px; font-weight: 700; font-size: 12px; cursor: pointer;
}
.ba-switch button + button { border-left: 1px solid #1e3a8a; }
.ba-switch button.sel:first-child { background: #1d4ed8; color: #fff; }
.ba-switch button.sel:last-child { background: #facc15; color: #111; }
.face.viz .btn.take-play { min-width: 82px; font-weight: 700; }
.face.viz .btn.take-play.live { background: #facc15; color: #111; border-color: #facc15; }
.drag-out {
  margin-left: auto; padding: 5px 12px; border-radius: 8px; border: 1px dashed #facc15; color: #fde68a;
  font-size: 12px; cursor: grab; user-select: none; -webkit-user-select: none;
}
.drag-out:active { cursor: grabbing; background: rgba(250, 204, 21, .12); }
.take-note { color: var(--muted); font-size: 11.5px; }
.mic-top { font-variant-numeric: tabular-nums; }
.mic-top.live { background: #c9302c; border-color: #c9302c; color: #fff; }

/* "+ Add effect" button + menu */
.add-wrap { position: relative; order: 91; margin-left: 6px; display: flex; }
.add-btn {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 38px; border-radius: 10px; cursor: pointer;
  font-weight: 700; letter-spacing: .04em; color: var(--text);
  background: linear-gradient(180deg, #2a1745, #0d0717); border: 1px solid #5b2d91;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 14px rgba(168, 85, 247, .25);
}
.add-btn:hover, .add-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 18px rgba(168, 85, 247, .45), inset 0 1px 0 rgba(255, 255, 255, .15); }
.add-btn .plus {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-size: 14px;
  background: var(--accent); color: #12051f; box-shadow: 0 0 8px var(--accent);
}
.add-btn .count { font-size: 10.5px; font-weight: 600; color: var(--muted); padding-left: 6px; border-left: 1px solid #3a2458; }
.add-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: 300px; padding: 6px;
  background: linear-gradient(180deg, #140b20, #05030a); border: 1px solid #3a2458; border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .85), 0 0 24px rgba(168, 85, 247, .2);
}
.menu-head { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 8px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px; border-radius: 8px;
  background: none; border: 1px solid transparent; cursor: pointer; color: var(--text);
}
.menu-item:hover:not(:disabled) { background: #1c1030; border-color: #4b2a6e; }
.menu-item:disabled { cursor: default; opacity: .55; }
.mi-icon {
  flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 18px;
  background: radial-gradient(circle at 35% 30%, #4b2a6e, #12081e); border: 1px solid #5b2d91; color: #e9d5ff;
}
.mi-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mi-text b { font-size: 13px; }
.mi-text small { font-size: 11px; color: var(--muted); line-height: 1.3; }

.add-btn { white-space: nowrap; flex: none; }

/* ------------------------------------------------------------- tracklist */
.tl-top.on { border-color: var(--accent); color: var(--text); box-shadow: 0 0 12px rgba(168, 85, 247, .4); }
.tracklist {
  margin: 12px 0 4px; border: 1px solid #2a1a44; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #0d0716, #030205); box-shadow: 0 10px 30px rgba(0, 0, 0, .8);
}
.tl-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #22163a; }
.tl-group { display: flex; gap: 4px; align-items: center; }
/* tools, edit and add: one row (on phones it slides sideways instead of wrapping) */
.tl-row { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; }
.tl-right { margin-left: auto; }
.tl-btn {
  background: linear-gradient(180deg, #170f22, #07040b); border: 1px solid #2a1a44; border-radius: 7px; color: var(--text);
  padding: 5px 10px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.tl-btn:hover { border-color: #5b2d91; }
.tl-btn:disabled { opacity: .4; cursor: default; pointer-events: none; }
.tl-btn.sel, .tl-btn.on { border-color: var(--accent); background: linear-gradient(180deg, #2a1745, #12081e); box-shadow: 0 0 10px rgba(168, 85, 247, .3); }
.tl-play { min-width: 38px; font-size: 14px; }
.tl-time { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 64px; color: #e9d5ff; padding-left: 4px; }
.tl-send { border-color: var(--accent); font-weight: 700; }
.tl-body { display: flex; min-height: 220px; }
.tl-master { flex: none; width: 150px; border-right: 1px solid #22163a; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.tl-master-head { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.tl-slots { display: flex; flex-direction: column; gap: 3px; }
.tl-slot {
  display: flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 6px; border-radius: 6px;
  border: 1px dashed #22163a; font-size: 11px; color: var(--muted);
}
.tl-slot b { display: block; font-size: 11.5px; color: var(--text); }
.tl-slot small { font-size: 10px; color: var(--muted); }
.tl-slot.filled { border-style: solid; border-color: #3a2458; background: #0f0818; }
.tl-slot-num { width: 12px; text-align: center; opacity: .6; }
.tl-slot-led { width: 12px; height: 12px; border-radius: 50%; border: 0; background: var(--led-off); cursor: pointer; flex: none; padding: 0; }
.tl-slot.on .tl-slot-led { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.tl-scroll { flex: 1; overflow: auto; position: relative; }
.tl-canvas { position: relative; min-width: 100%; }
.tl-ruler { position: relative; height: 24px; border-bottom: 1px solid #22163a; cursor: text; background: #07040b; }
.tl-ruler span {
  position: absolute; top: 5px; font-size: 10px; color: #8f7bb0; transform: translateX(-50%);
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.tl-lanes { position: relative; }
.tl-lane { display: flex; border-bottom: 1px solid #170e26; }  /* bar/beat lines: .tl-grid */
.tl-lane.muted { opacity: .55; }
.tl-lane-head {
  position: sticky; left: 0; z-index: 2; flex: none; width: 90px; display: flex; align-items: center; gap: 4px; padding: 0 6px;
  font-size: 11px; color: var(--muted); background: #0a0610; border-right: 1px solid #22163a;
}
.tl-lane-head span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-mute, .tl-lane-del {
  border: 1px solid #2a1a44; background: #07040b; color: var(--muted); border-radius: 5px; font-size: 10px; padding: 2px 5px; cursor: pointer;
}
.tl-mute.on { background: #facc15; color: #111; border-color: #facc15; }
.tl-lane-del:hover { color: #ff4fd8; }
.tl-clip {
  position: absolute; z-index: 1; border-radius: 6px; overflow: hidden; cursor: grab;
  background: linear-gradient(180deg, rgba(124, 58, 237, .55), rgba(76, 29, 149, .55)); border: 1px solid #a855f7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}
.tl-clip:active { cursor: grabbing; }
.tl-clip.sel { border-color: #facc15; box-shadow: 0 0 0 1px #facc15, 0 0 12px rgba(250, 204, 21, .35); }
.tl-clip.muted { filter: grayscale(.8); opacity: .6; }
.tl-clip canvas { position: absolute; inset: 14px 0 0 0; width: 100%; height: calc(100% - 14px); }
.tl-clip-name {
  position: absolute; left: 6px; top: 1px; right: 6px; font-size: 10.5px; font-weight: 600; color: #f3e8ff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.tl-clip { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }  /* a finger on a clip moves it */
.tl-clip.dragging { z-index: 5; cursor: grabbing; box-shadow: 0 0 0 1px #facc15, 0 8px 20px rgba(0, 0, 0, .8); }
.tl-clip.missing { border-style: dashed; opacity: .6; }
/* crop handles: thin on a mouse, finger-sized grips on touch (selected clip) */
.tl-clip-h {
  position: absolute; top: 0; bottom: 0; width: min(8px, 25%); z-index: 2; cursor: ew-resize; background: transparent;
}
.tl-clip-h.l { left: 0; border-radius: 6px 0 0 6px; }
.tl-clip-h.r { right: 0; border-radius: 0 6px 6px 0; }
.tl-clip:hover .tl-clip-h, .tl-clip.sel .tl-clip-h { background: rgba(250, 204, 21, .35); }
.tl-clip-h::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 2px; height: 14px; margin: -7px 0 0 -1px; border-radius: 1px;
  background: rgba(17, 17, 17, .55); opacity: 0;
}
.tl-clip.sel .tl-clip-h::after { opacity: 1; }
@media (pointer: coarse) {
  .tl-clip:not(.sel) .tl-clip-h { display: none; }
  .tl-clip.sel .tl-clip-h { width: min(20px, 30%); background: rgba(250, 204, 21, .55); }
  .tl-clip.sel .tl-clip-h::after { height: 20px; margin-top: -10px; }
}
.tracklist.cutting .tl-clip { cursor: crosshair; }
.tracklist.deleting .tl-clip { cursor: not-allowed; }
.tracklist.deleting .tl-clip:hover { border-color: #ff3b30; }
.tl-playhead { position: absolute; top: 0; bottom: 0; width: 2px; background: #facc15; box-shadow: 0 0 8px #facc15; pointer-events: none; z-index: 3; }
.tl-empty { margin: 0; padding: 8px 12px 12px; color: var(--muted); font-size: 12px; }
.face.viz .btn.to-tl { border-color: #a855f7; color: #e9d5ff; background: linear-gradient(180deg, #2a1745, #0d0717); }

/* ------------------------------------------------------------- Parametric EQ */
.face.eq { display: flex; gap: 16px; align-items: stretch; min-height: 420px; }
.eq-main { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.eq-right { flex: none; }
.face.eq .fader-meter { width: 92px; }
.face.eq .fm-track { width: 40px; min-height: 300px; }
.eq-bands { display: flex; gap: 6px; flex-wrap: wrap; }
.eq-chip {
  display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border-radius: 999px; cursor: pointer;
  background: #07040b; border: 1px solid #2a1a44; color: var(--muted); font-size: 12px; font-weight: 600;
}
.eq-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.eq-chip.off i { background: #2a1a3a; box-shadow: none; }
.eq-chip.sel { color: var(--text); border-color: var(--c); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 40%, transparent); }
.eq-graph {
  position: relative; height: 280px; border-radius: 12px; overflow: hidden; touch-action: none;
  background: radial-gradient(120% 120% at 50% 0%, #0f0a1a, #020103); border: 1px solid #2a1a44;
  box-shadow: inset 0 0 30px rgba(168, 85, 247, .12);
}
.eq-graph canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.eq-handle {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; cursor: grab;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #0a0510;
  background: var(--c); box-shadow: 0 0 0 2px #05030a, 0 0 12px var(--c); touch-action: none; user-select: none;
}
.eq-handle.sel { box-shadow: 0 0 0 2px #fff, 0 0 18px var(--c); z-index: 2; }
.eq-handle.off { background: #2a1a3a; color: var(--muted); box-shadow: 0 0 0 2px #05030a; }
.eq-handle:active { cursor: grabbing; }
.eq-controls { display: flex; justify-content: center; }
.eq-band-panel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.eq-type .switch button { padding: 5px 9px; font-size: 10.5px; }
.eq-type .switch-cap { display: none; }
.eq-sc-note { font-size: 11px; color: var(--muted); text-align: center; }

/* ------------------------------------------------------------- EQ sidechain */
.eq-band-sc { display: flex; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid #22163a; }
.src-picker { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 120px; }
.sp-label { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sp-row { display: flex; align-items: center; gap: 4px; }
.sp-btn { width: 22px; height: 26px; border-radius: 6px; border: 1px solid #2a1a44; background: #07040b; color: var(--text); cursor: pointer; font-size: 10px; }
.sp-value {
  min-width: 78px; max-width: 120px; padding: 4px 8px; border-radius: 6px; text-align: center; cursor: ns-resize; touch-action: none;
  background: #030205; border: 1px solid #2a1a44; font-size: 12px; font-weight: 700; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none;
}
.src-picker.on .sp-value { color: #fde68a; border-color: #a16207; }
.src-picker.live .sp-value { color: #111; background: #facc15; border-color: #facc15; box-shadow: 0 0 10px rgba(250, 204, 21, .35); }
.eq-handle.has-sc::after {
  content: attr(data-sc); position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 800; color: #111; background: #facc15; padding: 1px 5px; border-radius: 4px; white-space: nowrap;
}
.eq-sc {
  display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; padding: 10px 12px; border-radius: 12px;
  background: #07040b; border: 1px solid #22163a;
}
.eq-sc-knobs { display: flex; gap: 4px; }
.sc-meter { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.scm-well { position: relative; height: 10px; border-radius: 5px; background: #120b1c; overflow: hidden; border: 1px solid #22163a; }
.scm-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #a16207, #facc15); }
.scm-base { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #ff4fd8; box-shadow: 0 0 6px #ff4fd8; }
.scm-text { font-size: 10.5px; color: var(--muted); }
.sc-sources { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; margin-left: auto; }
.scs-list { display: flex; flex-wrap: wrap; gap: 4px; }
.scs-chip {
  position: relative; display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; overflow: hidden;
  background: #0d0816; border: 1px solid #3a2458; color: var(--text); font-size: 11.5px; cursor: pointer;
}
.scs-chip b { color: #facc15; }
.scs-chip i { position: absolute; left: 0; bottom: 0; height: 2px; background: #facc15; }
.scs-chip:hover { border-color: #facc15; }
.scs-empty { font-size: 11px; color: var(--muted); }

.eq-tilt { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: -4px; }
.eq-tilt .switch button { padding: 3px 8px; font-size: 10px; }
.eq-band-panel { row-gap: 8px; }
.eq-slope .switch button, .eq-chan .switch button { padding: 4px 7px; }

/* ------------------------------------------------------------- tracklist master FX */
.tl-slot { position: relative; }
.tl-slot-add, .tl-slot-name, .tl-slot-x {
  background: none; border: 0; color: inherit; cursor: pointer; padding: 0; text-align: left; font-size: 11px;
}
.tl-slot-add { display: flex; gap: 6px; width: 100%; color: var(--muted); }
.tl-slot-add:hover { color: var(--text); }
.tl-slot-name { flex: 1; min-width: 0; }
.tl-slot-name b { display: block; font-size: 11.5px; color: var(--text); }
.tl-slot-name small { font-size: 10px; color: var(--muted); }
.tl-slot-x { color: var(--muted); padding: 0 2px; }
.tl-slot-x:hover { color: #ff4fd8; }
.tl-slot.sel { border-color: var(--accent); box-shadow: 0 0 10px rgba(168, 85, 247, .3); }
.tl-slot-menu {
  position: absolute; left: 100%; top: 0; z-index: 20; margin-left: 6px; display: flex; flex-direction: column; min-width: 110px;
  background: #0d0716; border: 1px solid #3a2458; border-radius: 8px; padding: 4px; box-shadow: 0 10px 24px rgba(0, 0, 0, .8);
}
.tl-slot-menu button { background: none; border: 0; color: var(--text); text-align: left; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.tl-slot-menu button:hover { background: #1c1030; }
.tl-editor { border-top: 1px solid #22163a; padding: 10px; }
.tl-editor-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tl-editor-head b { font-size: 12px; letter-spacing: .06em; }
.tl-editor-head span { flex: 1; font-size: 11px; color: var(--muted); }
.tl-editor .face { min-height: 0; }
.tl-editor-head .tl-btn:disabled { opacity: .4; cursor: default; }
.tl-editor-head { flex-wrap: wrap; }

/* ------------------------------------------------------------- tracklist tabs */
.tl-tabs {
  display: flex; align-items: flex-end; gap: 4px; padding: 6px 10px 0; border-bottom: 1px solid #22163a;
  overflow-x: auto; scrollbar-width: none; background: #07040b;
}
.tl-tabs::-webkit-scrollbar { display: none; }
.tl-tab {
  flex: none; display: flex; align-items: center; gap: 2px; max-width: 220px; padding: 0 4px 0 2px; margin-bottom: -1px;
  border: 1px solid #22163a; border-bottom-color: transparent; border-radius: 9px 9px 0 0;
  background: linear-gradient(180deg, #120b1c, #07040b); color: var(--muted);
}
.tl-tab.sel {
  color: var(--text); border-color: #3a2458; border-bottom-color: #0d0716;
  background: linear-gradient(180deg, #1e1230, #0d0716); box-shadow: inset 0 2px 0 var(--accent);
}
.tl-tab-name {
  background: none; border: 0; color: inherit; cursor: pointer; padding: 7px 8px; font: inherit; font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; -webkit-touch-callout: none; user-select: none;
}
.tl-tab-x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11px; padding: 4px 5px; border-radius: 5px; }
.tl-tab-x:hover { color: #ff4fd8; }
.tl-tab-input {
  width: 150px; margin: 3px 2px; padding: 4px 6px; font: inherit; font-size: 12px; font-weight: 600; color: var(--text);
  background: #030205; border: 1px solid var(--accent); border-radius: 6px;
}
.tl-tab.confirm { gap: 6px; padding: 0 6px; border-color: #a16207; color: #fde68a; }
.tl-tab-q { font-size: 12px; font-weight: 600; white-space: nowrap; }
.tl-tab-yes, .tl-tab-no {
  border-radius: 6px; padding: 3px 9px; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; margin: 4px 0;
}
.tl-tab-yes { background: #ff3b6b; border: 1px solid #ff3b6b; color: #fff; }
.tl-tab-no { background: #07040b; border: 1px solid #3a2458; color: var(--text); }
.tl-tab-add {
  flex: none; align-self: center; width: 28px; height: 26px; margin: 0 0 4px 2px; border-radius: 7px; cursor: pointer;
  background: none; border: 1px dashed #4b2a6e; color: var(--text); font-size: 14px; line-height: 1; padding: 0;
}
.tl-tab-add:hover { border-color: var(--accent); box-shadow: 0 0 10px rgba(168, 85, 247, .3); }

/* ------------------------------------------------------------- tempo + grid */
.tl-bbt { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--muted); min-width: 34px; }
.tl-bpm-box {
  display: flex; align-items: center; gap: 0; border: 1px solid #2a1a44; border-radius: 7px; overflow: hidden;
  background: linear-gradient(180deg, #170f22, #07040b);
}
.tl-bpm {
  width: 52px; padding: 4px 2px 4px 8px; border: 0; background: transparent; color: #fde68a; font: inherit; font-size: 13px;
  font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; -moz-appearance: textfield; appearance: textfield;
}
.tl-bpm::-webkit-inner-spin-button, .tl-bpm::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tl-bpm:focus { outline: none; }
.tl-bpm-box:focus-within { border-color: var(--accent); }
.tl-bpm-lbl {
  padding: 5px 8px 5px 4px; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--muted);
  cursor: ns-resize; touch-action: none; user-select: none;
}
.tl-sync { display: none; margin-right: 6px; padding: 1px 6px; border-radius: 99px; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; background: #22c55e; color: #052e12; }
.tl-bpm-box.synced { border-color: #166534; }
.tl-bpm-box.synced .tl-bpm { color: #86efac; cursor: default; }
.tl-bpm-box.synced .tl-bpm-lbl { cursor: default; }
.tl-bpm-box.synced .tl-sync { display: inline-block; }
.tl-ruler { position: relative; }
.tl-mark {
  position: absolute; top: 0; bottom: 0; padding: 4px 0 0 4px; font-size: 10px; color: #8f7bb0; font-variant-numeric: tabular-nums;
  pointer-events: none; border-left: 1px solid #3a2d52; box-sizing: border-box; overflow: hidden; white-space: nowrap;
  background: linear-gradient(90deg, #2c2140 1px, transparent 1px) 0 100% / var(--beat, 60px) 6px repeat-x;
}
.tl-ruler .tl-mark { transform: none; top: 0; }
.tl-grid { position: absolute; left: 0; right: 0; top: 24px; bottom: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.tl-grid i {
  position: absolute; top: 0; bottom: 0; box-sizing: border-box; border-left: 1px solid rgba(255, 255, 255, .07);
  background: linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px) 0 0 / var(--beat, 60px) 100% repeat-x;
}
html[data-theme="sunset"] .tl-tabs { background: #3a2210; }
html[data-theme="sunset"] .tl-tab { background: #fff6ea; border-color: #e3bf93; }
html[data-theme="sunset"] .tl-tab.sel { background: #fff; border-bottom-color: #fff; }
html[data-theme="sunset"] .tl-bpm-box { background: #fffaf3; border-color: #e3bf93; }
html[data-theme="sunset"] .tl-bpm { color: #9a4a12; }

/* ------------------------------------------------------------- lane FX racks */
/* One row of effect tabs per lane, pinned to the right edge of the timeline;
   they use the chain tabs' look (.tab, .tab-num, .power, .tab-x). */
.tl-rack {
  position: sticky; right: 0; z-index: 4; margin-left: auto; flex: none; display: flex; align-items: center; gap: 4px;
  max-width: min(440px, 46vw); padding: 0 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
  background: linear-gradient(90deg, rgba(7, 4, 11, .82), #07040b 14px); border-left: 1px solid #22163a;
}
.tl-rack .tab.tl-ftab {
  flex: none; min-height: 32px; gap: 4px; padding: 0 6px 0 4px; border-radius: 8px; font-size: 11.5px;
}
.tl-ftab .tab-num { min-width: 16px; height: 16px; font-size: 9.5px; }
.tl-ftab .power { width: 20px; height: 20px; }
.tl-ftab .power::before { width: 8px; height: 8px; }
.tl-ftab .name { padding: 6px 0; font-size: 11.5px; white-space: nowrap; color: var(--text); }
.tl-ftab.off .name { color: var(--muted); }
.tl-ftab .tab-x { display: none; margin-left: 0; padding: 0 2px; }
.tl-ftab.sel .tab-x, .tl-ftab:hover .tab-x { display: block; }
.tl-ftab-add {
  flex: none; min-height: 32px; min-width: 32px; padding: 0 9px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, #1e1230, #08040e); border: 1px dashed #4b2a6e; color: var(--text); font-weight: 600; font-size: 12px;
}
.tl-ftab-add:hover { border-color: var(--accent); box-shadow: 0 0 12px rgba(168, 85, 247, .3); }
html[data-theme="sunset"] .tl-rack { background: linear-gradient(90deg, rgba(255, 246, 234, .85), #fff6ea 14px); border-color: #e3bf93; }
html[data-theme="sunset"] .tl-ftab-add { background: #fff8ee; border-color: #e3bf93; }
@media (pointer: coarse) {
  .tl-rack .tab.tl-ftab, .tl-ftab-add { min-height: 44px; }
  .tl-ftab .power { width: 30px; height: 30px; }
  .tl-ftab .name { padding: 12px 2px; }
  .tl-ftab-add { min-width: 44px; }
  .tl-tab-name { padding: 10px 10px; }
  .tl-tab-x { padding: 8px 8px; }
  .tl-tab-add { width: 40px; height: 34px; }
}

/* Touch screens: words instead of little symbols, and buttons a finger can hit. */
.tl-word { display: none; }
.tl-more-tools { display: none; }
@media (pointer: coarse) {
  .tl-ico { display: none; }
  .tl-word, .tl-btn .tl-long.tl-keep { display: inline; }
  .tl-bar .tl-btn { min-height: 46px; min-width: 46px; padding: 0 16px; font-size: 16px; font-weight: 700; border-radius: 10px; }
  .tl-bar .tl-play { min-width: 60px; font-size: 20px; }
  .tl-bar .tl-zoomout, .tl-bar .tl-zoomin { font-size: 22px; padding: 0; }
  .tl-time { font-size: 16px; }
  .tl-zoom-lbl { font-size: 14px; }
  /* lane head: the name on top, Mute and remove under it, all inside the 90 px column (clips start right after it) */
  .tl-lane-head { flex-wrap: wrap; align-content: center; gap: 3px 4px; padding: 0 4px; font-size: 12px; }
  .tl-lane-head > span { flex: 1 0 100%; line-height: 1.1; }
  .tl-mute, .tl-lane-del { min-width: 38px; min-height: 34px; font-size: 14px; }
}

/* ------------------------------------------------------------- tracklist on phones */
@media (max-width: 640px) {
  .tl-bar { gap: 6px 8px; padding: 8px; }
  .tl-right { margin-left: 0; flex-wrap: wrap; }
  .tl-row { flex: 1 0 100%; min-width: 0; flex-wrap: wrap; gap: 6px 8px; }
  .tl-row::-webkit-scrollbar { display: none; }
  .tl-row .tl-group { flex: none; }
  .tl-row .tl-btn { padding: 7px 8px; }
  @media (pointer: coarse) {
    .tl-row .tl-btn { padding: 0 14px; }
    /* fewer rows: tempo, snap and zoom share one; the last four buttons fit one */
    .tl-bar > .tl-group:first-child { order: 1; flex: 1 0 100%; }
    .tl-bar > .tl-tempo { order: 2; }
    .tl-bar > .tl-zoom { order: 2; margin-left: auto; }
    .tl-bar > .tl-row { order: 3; }
    .tl-bar > .tl-right { order: 4; flex: 1 0 100%; flex-wrap: nowrap; gap: 6px; }
    .tl-right .tl-btn { padding: 0 10px; font-size: 15px; flex: 1 1 auto; }
    /* three rows instead of six: the less-used tools wait behind Edit */
    .tl-more-tools { display: inline-flex; align-items: center; order: 9; }
    .tl-row { align-items: center; }
    .tracklist:not(.tools-open) .tl-edit, .tracklist:not(.tools-open) .tl-row > .tl-group:last-child, .tracklist:not(.tools-open) .tl-bar > .tl-zoom { display: none; }
  }
  .tl-long { display: none; }
  .tl-body { flex-direction: column; }
  .tl-master { width: auto; border-right: 0; border-bottom: 1px solid #22163a; }
  .tl-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .tl-slot-menu { position: fixed; left: 10px; right: 10px; top: auto; bottom: 10px; margin: 0; max-height: 70vh; overflow: auto; }
  .tl-scroll { min-height: 220px; }
  .tl-rack { max-width: 52vw; }
  .tl-bpm { font-size: 16px; width: 56px; }  /* no zoom-in on focus */
  .tl-tab-input { font-size: 16px; }
}

/* chain order numbers + drag to reorder */
.tab-num {
  flex: none; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 800; color: #111; background: #facc15; box-shadow: 0 0 6px rgba(250, 204, 21, .5);
}
.viz-tab .tab-num { display: none; }
.tab[draggable="true"] { cursor: grab; }
.tab.dragging { opacity: .45; }
.tab.drop-before { box-shadow: inset 3px 0 0 #facc15; }
.tab.drop-after { box-shadow: inset -3px 0 0 #facc15; }

/* Overdrive / Saturator / Multiband */
.face.fx-strip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.strip-row { display: flex; align-items: center; justify-content: center; gap: 8px 16px; flex-wrap: wrap; }
.strip-row.small { gap: 18px; }
.strip-note { margin: 0; font-size: 11px; color: var(--muted); }
.vu-wrap { display: flex; align-items: flex-end; gap: 10px; }
.vu { position: relative; width: 220px; height: 122px; cursor: pointer; border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, #f3e7c4, #d8c48f); box-shadow: inset 0 2px 10px rgba(0,0,0,.55), 0 0 0 2px #1d1230; }
.vu svg { width: 100%; height: 100%; }
.vu-arc { fill: none; stroke: #2a1d0c; stroke-width: 1.5; }
.vu-red { fill: none; stroke: #c81e1e; stroke-width: 4; }
.vu-ticks line { stroke: #2a1d0c; stroke-width: 1.2; }
.vu-ticks text { font: 700 8px system-ui, sans-serif; fill: #2a1d0c; text-anchor: middle; }
.vu-needle { stroke: #111; stroke-width: 1.6; }
.vu-hub { fill: #111; }
.vu-label { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); font: 800 12px system-ui; color: #2a1d0c; letter-spacing: .1em; pointer-events: none; }
.face.off .vu { filter: grayscale(.8) brightness(.55); }
.vu-mode { min-width: 48px; }
.mb-disp { position: relative; width: min(100%, 640px); }
.mb-disp svg { width: 100%; height: 130px; display: block; border-radius: 10px; background: #07030c; border: 1px solid #1d1230; touch-action: none; }
.mb-band { opacity: .14; transition: opacity .15s; }
.mb-band.sel { opacity: .3; }
.mb-gr { opacity: .75; }
.mb-grid { stroke: rgba(255,255,255,.06); }
.mb-x { stroke: #fff; stroke-width: 2; opacity: .8; }
.mb-labels span { position: absolute; top: 6px; transform: translateX(-50%); font-size: 11px; font-weight: 800; pointer-events: none; white-space: nowrap; }
.mb-labels b { margin-left: 5px; color: #fff; }
.mb-tabs { display: flex; align-items: center; gap: 8px; }
.mb-tab { background: #120a1c; color: var(--c); border: 1px solid #2a1d40; border-radius: 8px; padding: 5px 14px; font-weight: 800; cursor: pointer; }
.mb-tab.on { background: var(--c); color: #111; box-shadow: 0 0 10px var(--c); }
.mb-panel { border-top: 2px solid var(--c); padding-top: 10px; }
.mb-sw { display: flex; flex-direction: column; gap: 6px; }

/* Denoise */
.dn-row { gap: 12px 36px; }
.face.dn .strip-note { font-size: 12px; text-align: center; max-width: 340px; }

/* Vocals: slider over each knob, Boy / Girl in the middle */
.vox-row { gap: 14px 22px; align-items: center; }
.vox-pair { display: flex; gap: 18px; }
.vox-col { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 132px; }
.fx-slider { display: flex; flex-direction: column; gap: 4px; width: 100%; cursor: pointer; }
.fx-slider-ends { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.fx-slider input { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.fx-slider input::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: #120a1c; border: 1px solid #2a1d40; }
.fx-slider input::-moz-range-track { height: 8px; border-radius: 4px; background: #120a1c; border: 1px solid #2a1d40; }
.fx-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: #facc15; border: 2px solid #111; box-shadow: 0 0 8px rgba(250, 204, 21, .5); }
.fx-slider input::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #facc15; border: 2px solid #111; box-shadow: 0 0 8px rgba(250, 204, 21, .5); }
.fx-slider input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.vox-voice .switch button { min-width: 64px; min-height: 44px; font-size: 15px; font-weight: 800; }
@media (max-width: 640px) {
  .vox-row { flex-direction: column; }
  .vox-pair { width: 100%; justify-content: space-evenly; gap: 10px; }
  .vox-col { width: 46%; max-width: 160px; }
  .fx-slider input { height: 36px; }
  .fx-slider input::-webkit-slider-thumb { width: 30px; height: 30px; margin-top: -12px; }
  .fx-slider-ends { font-size: 12px; }
}
.face.off .fx-slider { opacity: .45; }

/* Delay / Tune */
.dly-row { align-items: flex-start; gap: 14px; }
.dly-group { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid #241638; border-radius: 12px; background: rgba(255,255,255,.02); }
.dly-title { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #facc15; }
/* Delay / Reverb / Chorus: four big knobs, the rest under "More" */
.big-row { gap: 10px 22px; align-items: flex-start; }
.dly-time { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mini-switch .switch button { padding: 2px 9px; font-size: 10px; }
.mini-switch .switch-cap { display: none; }
.dly-mode .switch button { padding: 6px 14px; font-weight: 700; }
.dly-mode .switch-cap { display: none; }
.fx-more { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.fx-more-btn { font-size: 11px; padding: 3px 12px; border-radius: 999px; color: var(--muted); }
.fx-more-btn[aria-expanded="true"] { color: var(--text); }
.fx-more-row { gap: 6px 14px; padding: 10px 12px 4px; border-top: 1px solid var(--line); max-width: 640px; }
.fx-more-row[hidden] { display: none; }
.knob.dim, .strip-note.dim { opacity: .38; }
.bpm { width: 56px; background: #120a1c; color: #fff; border: 1px solid #2a1d40; border-radius: 6px; padding: 2px 6px; }
.tune-disp { width: min(100%, 420px); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tune-note { font-size: 40px; font-weight: 900; color: #fff; text-shadow: 0 0 18px rgba(168, 85, 247, .7); line-height: 1; }
.tune-note.idle { opacity: .3; }
.tune-bar { position: relative; width: 100%; height: 12px; border-radius: 6px; background: #07030c; border: 1px solid #1d1230; overflow: hidden; }
.tune-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #fff; opacity: .6; }
.tune-fill { position: absolute; top: 0; bottom: 0; }
.tune-fill.sharp { background: #fb923c; }
.tune-fill.flat { background: #38bdf8; }
.tune-scale { width: 100%; display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.tune-keys .switch button { min-width: 30px; padding-left: 4px; padding-right: 4px; }

/* Samples (account) */
.samples-face { display: block; min-height: 230px; }
.cloud-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cloud-site { font-size: 11px; color: var(--muted); }
.cloud-tabs { display: flex; gap: 6px; margin: 10px 0 4px; }
.cloud-tab { background: #120a1c; color: var(--muted); border: 1px solid #2a1d40; border-radius: 8px; padding: 5px 12px; font-weight: 700; cursor: pointer; }
.cloud-tab.on { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.cloud-row input[type=text] { flex: 1; min-width: 160px; background: #0b0612; color: #fff; border: 1px solid #2a1d40; border-radius: 8px; padding: 7px 10px; font: inherit; }
.cloud-head b { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; }
.net { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #1a1026; color: var(--muted); }
.net::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: currentColor; vertical-align: 1px; }
.net.on { color: #4ade80; } .net.wait { color: #facc15; } .net.off { color: #f87171; }
.cloud-login { display: flex; flex-direction: column; gap: 8px; max-width: 320px; }
.cloud-login input { background: #0b0612; color: #fff; border: 1px solid #2a1d40; border-radius: 8px; padding: 8px 10px; font: inherit; }
.cloud-title { margin: 0 0 4px; font-weight: 700; }
.cloud-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cloud-user { color: var(--muted); font-size: 12px; margin-right: auto; }
.cloud-note { color: var(--muted); font-size: 12px; margin: 6px 0; }
.cloud-list { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow: auto; }
.cloud-item { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,.03); }
.cloud-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud-name small { color: var(--muted); margin-left: 4px; }
.btn.ghost { background: transparent; }
.menu-samples { border-top: 1px solid #241638; }

.strip-note:empty { display: none; }
.mi-text small:empty { display: none; }

.viz-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; background: #facc15; color: #111; font-size: 10.5px; font-weight: 800; vertical-align: 1px; }
.viz-count.pop { animation: vizpop .35s ease-out; }
@keyframes vizpop { 0% { transform: scale(.4); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* Save popup */
.save-back { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(5, 2, 10, .7); backdrop-filter: blur(4px); }
.save-box { width: min(360px, 100%); background: #0e0716; border: 1px solid #3b1d5e; border-radius: 16px; padding: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.6); display: flex; flex-direction: column; gap: 8px; }
.save-head { display: flex; align-items: center; justify-content: space-between; }
.save-head b { font-size: 15px; letter-spacing: .1em; text-transform: uppercase; }
.save-x { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; }
.save-box input { width: 100%; box-sizing: border-box; background: #0b0612; color: #fff; border: 1px solid #2a1d40; border-radius: 8px; padding: 9px 10px; font: inherit; margin-bottom: 6px; }
.save-login { display: flex; flex-direction: column; gap: 6px; }
.save-go { width: 100%; background: var(--accent-strong) !important; color: #fff !important; border-color: var(--accent-strong) !important; font-weight: 800; padding: 10px; }
.save-who { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.save-file { background: none; border: 0; color: var(--muted); font-size: 11px; text-decoration: underline; cursor: pointer; align-self: center; }

/* Samples browser (first tab) */
.samples-face { display: flex; flex-direction: column; gap: 10px; min-height: 320px; }
.sb-head { display: flex; align-items: center; gap: 10px; }
.sb-title { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; }
.sb-account { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sb-user { color: #facc15; font-weight: 700; font-size: 12px; }
.sb-signin { background: var(--neutral-fill) !important; color: var(--neutral-ink) !important; border-color: var(--neutral-fill) !important; font-weight: 800; }
.sb-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.sb-tab { background: #120a1c; color: var(--muted); border: 1px solid #2a1d40; border-radius: 99px; padding: 6px 14px; font-weight: 700; cursor: pointer; }
.sb-tab.on { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.sb-tools { display: flex; flex-direction: column; gap: 8px; }
.sb-row { display: flex; gap: 8px; }
.sb-search { flex: 1; min-width: 0; background: #0b0612; color: #fff; border: 1px solid #2a1d40; border-radius: 10px; padding: 9px 12px; font: inherit; }
.sb-sort { background: #0b0612; color: #fff; border: 1px solid #2a1d40; border-radius: 10px; padding: 0 10px; font: inherit; }
.sb-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sb-chip { background: transparent; color: #d8c8f5; border: 1px solid #3b1d5e; border-radius: 99px; padding: 4px 11px; font-size: 12px; cursor: pointer; }
.sb-chip.on { background: #facc15; color: #111; border-color: #facc15; font-weight: 700; }
.sb-list { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow: auto; }
.sb-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid transparent; }
.sb-item:hover { border-color: #3b1d5e; background: rgba(124,58,237,.08); }
.sb-play { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #7c3aed; color: #fff; cursor: pointer; font-size: 12px; }
.sb-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-meta { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-wave { flex: none; width: 120px; height: 28px; opacity: .85; }
.sb-stats { flex: none; display: flex; gap: 10px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.sb-add { flex: none; min-width: 34px; font-weight: 800; }
.sb-more { align-self: center; }
/* Sound rows: play button, and the loop's tempo and key under its name */
.sb-play { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid #3b1d5e; background: #120a1c; color: #fff; font-size: 13px; cursor: pointer; }
.sb-name.playing + .sb-like, .sb-item:has(.sb-name.playing) .sb-play { border-color: #facc15; }
.sb-item:has(.sb-name.playing) .sb-play { color: #facc15; }
.sb-facts { font-style: normal; font-weight: 800; color: #facc15; }
.tl-lane-del.sure { width: auto; min-width: 0; padding: 0 5px; color: #fff; background: #b91c1c; border-color: #b91c1c; font-size: 11px; font-weight: 800; }
@media (pointer: coarse) {
  .sb-play { width: 46px; height: 46px; font-size: 16px; }
  .sb-like, .sb-add { min-height: 44px; min-width: 44px; }
  /* the whole name shows (two lines), so loops that differ only at the end can be told apart */
  .sb-name b { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; line-height: 1.25; }
  .sb-meta { font-size: 12px; }
  /* finger-sized secondary buttons */
  .sb-tab, .sb-chip, .sb-more, .sb-signin, .sb-sort, .sb-search { min-height: 44px; }
  .sb-chip { padding: 0 14px; font-size: 14px; }
  .sb-signin { padding: 0 16px; font-size: 15px; }
}
/* Fit to tempo switch */
.sb-fit-sw { min-width: 58px; height: 34px; border-radius: 17px; border: 1px solid #3b1d5e; background: #120a1c; color: #d8c8f5; font-weight: 800; font-size: 14px; cursor: pointer; }
.sb-fit-sw.on { background: #facc15; border-color: #facc15; color: #111; }
.sb-fit-note { font-size: 12px; color: var(--muted); }
@media (pointer: coarse) { .sb-fit-sw { height: 46px; min-width: 72px; font-size: 16px; } .sb-fit-note { flex-basis: 100%; } }
/* Start a beat */
.sb-beat { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px; border-radius: 12px; background: linear-gradient(180deg, rgba(250, 204, 21, .14), rgba(250, 204, 21, .04)); border: 1px solid rgba(250, 204, 21, .45); }
.sb-beat-lbl { font-size: 15px; font-weight: 800; color: #facc15; margin-right: 4px; }
.sb-beat-btn { flex: 1 1 0; min-width: 96px; height: 40px; border-radius: 10px; border: 0; background: #facc15; color: #111; font-weight: 800; font-size: 15px; cursor: pointer; }
.sb-beat-btn.busy { opacity: .55; pointer-events: none; }
@media (pointer: coarse) { .sb-beat-btn { height: 52px; font-size: 17px; } .sb-beat-lbl { flex-basis: 100%; font-size: 16px; } }
/* Drop as: one hit or a drum pattern */
.sb-drop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border-radius: 10px; border: 1px solid #3b1d5e; background: rgba(255, 255, 255, .03); }
.sb-drop.on { border-color: #facc15; }
.sb-drop-lbl { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sb-drop-sel, .sb-drop-bars { height: 34px; padding: 0 8px; border-radius: 8px; background: #120a1c; color: #fff; border: 1px solid #3b1d5e; font-weight: 700; font-size: 14px; }
.sb-drop-sel { flex: 1 1 150px; min-width: 0; }
.sb-drop-hint { font-size: 12px; color: #facc15; }
@media (pointer: coarse) { .sb-drop-sel, .sb-drop-bars { height: 46px; font-size: 16px; } .sb-drop-hint { flex-basis: 100%; font-size: 13px; } }
/* Key bar: stays at the bottom of the Samples panel while the list scrolls */
.sb-key { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px; border-radius: 10px; border: 1px solid #3b1d5e; background: rgba(255, 255, 255, .03); }
.sb-key.on { border-color: #facc15; }
.sb-key-root, .sb-key-mode { height: 36px; padding: 0 10px; border-radius: 9px; background: #120a1c; color: #fff; border: 1px solid #3b1d5e; font-weight: 700; font-size: 14px; cursor: pointer; }
.sb-key-notes { display: flex; gap: 6px; flex: 1 1 auto; }
.sb-key-note { flex: 1 1 0; min-width: 34px; height: 36px; padding: 0; border-radius: 9px; background: #120a1c; color: #d8c8f5; border: 1px solid #3b1d5e; font-weight: 800; font-size: 14px; cursor: pointer; }
.sb-key-note.on { background: #facc15; color: #111; border-color: #facc15; }
@media (pointer: coarse) {
  .sb-key-root, .sb-key-mode, .sb-key-note { height: 46px; font-size: 16px; }
  .sb-key-notes { flex-basis: 100%; }
}
@media (max-width: 640px) { .sb-wave, .sb-stats span { display: none; } }

.sb-name { background: none; border: 0; color: inherit; text-align: left; padding: 0; cursor: pointer; font: inherit; }
.sb-name.playing b { color: #facc15; }
.sb-name.playing b::before { content: "■ "; }
.sb-like, .sb-add { flex: none; border: 1px solid #3b1d5e; background: #120a1c; color: #d8c8f5; border-radius: 99px; padding: 6px 12px; font-weight: 800; cursor: pointer; }
.sb-like.on { color: #f43f5e; border-color: #f43f5e; }
.sb-add { background: #facc15; color: #111; border-color: #facc15; min-width: 40px; }
.tabs .samples-tab { order: -1; margin-left: 0; }

/* ===================================================== Sunset theme (light: orange + tan) */
html[data-theme="sunset"] {
  --bg: #f4e3c9; --plate: #fff6ea; --plate-2: #fde4c4; --line: #e3bf93; --text: #3a2210; --muted: #8b6544;
  --accent: #f97316; --accent-soft: rgba(249, 115, 22, .18); --led-off: #ead3b6; --meter: #ea580c;
  color-scheme: light;
}
html[data-theme="sunset"] body { background: radial-gradient(120% 80% at 50% 0%, #fde7c8, #efd3ad 70%); }
html[data-theme="sunset"] .unit { background: linear-gradient(160deg, #fff1de, #f6dcb9 55%, #f1cf9f); border-bottom-color: #e3bf93; }
html[data-theme="sunset"] .face { background: radial-gradient(120% 140% at 30% 0%, #fffaf2, #f7e2c4 70%); border-color: #e3bf93; box-shadow: 0 8px 24px rgba(160, 90, 30, .18); }
html[data-theme="sunset"] .face::before { background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0)); }
html[data-theme="sunset"] .tab { background: linear-gradient(180deg, #fff7ec, #fbe6c9); border-color: #e7c497; box-shadow: none; }
html[data-theme="sunset"] .tab.sel { background: linear-gradient(180deg, #fff, #fde8cb); box-shadow: inset 0 -2px 0 var(--accent), 0 0 12px rgba(249, 115, 22, .25); }
html[data-theme="sunset"] .btn, html[data-theme="sunset"] .tl-btn, html[data-theme="sunset"] .add-btn { background: linear-gradient(180deg, #fff8ee, #fbe3c3); border-color: #e3bf93; color: var(--text); box-shadow: 0 2px 6px rgba(160, 90, 30, .15); }
html[data-theme="sunset"] .btn:hover { border-color: #f97316; box-shadow: 0 0 10px rgba(249, 115, 22, .3); }
html[data-theme="sunset"] .btn.accent { background: linear-gradient(180deg, #fdba74, #f97316); border-color: #f97316; color: #3a1a05; }
html[data-theme="sunset"] .switch { background: #f3dcbd; }
html[data-theme="sunset"] .switch button.sel, html[data-theme="sunset"] .tl-btn.sel, html[data-theme="sunset"] .tl-btn.on { background: linear-gradient(180deg, #fff, #fde2bf); color: var(--accent); }
html[data-theme="sunset"] .add-menu { background: linear-gradient(180deg, #fff8ee, #f9e3c6); border-color: #e3bf93; box-shadow: 0 18px 40px rgba(120, 60, 20, .25); }
html[data-theme="sunset"] .menu-item:hover:not(:disabled) { background: #fde2bf; }
html[data-theme="sunset"] .bigmeter { border-color: #e3bf93; box-shadow: inset 0 0 24px rgba(249, 115, 22, .15), 0 6px 18px rgba(120, 60, 20, .2); }
html[data-theme="sunset"] .fm-track, html[data-theme="sunset"] .livestrip, html[data-theme="sunset"] .clip-card canvas,
html[data-theme="sunset"] .tl-ruler, html[data-theme="sunset"] .tl-slot.filled { background: #3a2210; }
html[data-theme="sunset"] .clip-card, html[data-theme="sunset"] .face.viz .clip-card { background: #fff6ea; }
html[data-theme="sunset"] .face.viz .btn, html[data-theme="sunset"] .face.viz .btn.to-tl { background: linear-gradient(180deg, #fff8ee, #fbe3c3); }
html[data-theme="sunset"] .knob svg, html[data-theme="sunset"] .power, html[data-theme="sunset"] .tab-num { filter: hue-rotate(115deg) saturate(1.2); }
html[data-theme="sunset"] .sb-search, html[data-theme="sunset"] .sb-sort, html[data-theme="sunset"] .save-box input,
html[data-theme="sunset"] .cloud-login input, html[data-theme="sunset"] .cloud-row input[type=text], html[data-theme="sunset"] .bpm { background: #fffaf3; color: var(--text); border-color: #e3bf93; }
html[data-theme="sunset"] .sb-tab, html[data-theme="sunset"] .sb-like, html[data-theme="sunset"] .sb-chip, html[data-theme="sunset"] .mb-tab, html[data-theme="sunset"] .cloud-tab { background: #fff6ea; color: var(--muted); border-color: #e3bf93; }
html[data-theme="sunset"] .sb-tab.on, html[data-theme="sunset"] .cloud-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
html[data-theme="sunset"] .sb-item, html[data-theme="sunset"] .cloud-item { background: rgba(255, 255, 255, .55); }
html[data-theme="sunset"] .sb-play { background: var(--accent); }
html[data-theme="sunset"] .save-box { background: #fff6ea; border-color: #e3bf93; }
html[data-theme="sunset"] .dly-group { background: rgba(255, 255, 255, .5); border-color: #e3bf93; }
html[data-theme="sunset"] .mb-disp svg, html[data-theme="sunset"] .tune-bar { background: #3a2210; }

/* theme switch: a small sun/moon next to the logo (uncluttered corner) */
.theme-btn { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--plate-2); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; display: grid; place-items: center; }
.theme-btn:hover { border-color: var(--accent); }

/* ===================================================== Phone layout (website on phones only) */
@media (max-width: 640px) {
  body:not(.in-plugin) .unit { padding: 10px 10px 16px; }
  body:not(.in-plugin) .top { gap: 6px; }
  body:not(.in-plugin) .top .byline, body:not(.in-plugin) .top .badge, body:not(.in-plugin) .top .spacer { display: none; }
  body:not(.in-plugin) .top .btn { padding: 8px 10px; font-size: 13px; }
  /* tabs: the grid wraps (chrome.css); finger-sized */
  body:not(.in-plugin) .tab { min-height: 42px; }
  body:not(.in-plugin) .add-wrap { flex: none; }
  body:not(.in-plugin) .add-menu { position: fixed; left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; max-height: 70vh; overflow: auto; }
  /* effect screens stack instead of squashing */
  body:not(.in-plugin) .face { display: flex; flex-direction: column; align-items: stretch; padding: 14px 10px; }
  body:not(.in-plugin) .face .bigmeter { max-width: none; min-width: 0; }
  body:not(.in-plugin) .face-row, body:not(.in-plugin) .strip-row { flex-wrap: wrap; justify-content: center; }
  body:not(.in-plugin) .side-col { align-items: center; }
  /* Samples: big search, big rows */
  body:not(.in-plugin) .sb-search { font-size: 16px; padding: 12px 14px; }
  body:not(.in-plugin) .sb-sort { font-size: 15px; }
  body:not(.in-plugin) .sb-list { max-height: none; }
  body:not(.in-plugin) .sb-item { padding: 12px; }
  body:not(.in-plugin) .sb-like, body:not(.in-plugin) .sb-add { padding: 9px 14px; font-size: 14px; }
  body:not(.in-plugin) .sb-tab { padding: 8px 14px; }
  body:not(.in-plugin) input, body:not(.in-plugin) select { font-size: 16px; }  /* no zoom-in on focus */
}

.tune-presets { display: flex; gap: 8px; justify-content: center; }
.tune-preset { min-width: 82px; font-weight: 800; padding: 8px 14px; }
.tune-preset.on { background: var(--accent-strong) !important; color: #fff !important; border-color: var(--accent-strong) !important; }

/* in-ears: knob + FX light, left of Record / Mic */
.in-ear { display: inline-flex; align-items: center; gap: 6px; }
.ie-knob { --a: 45deg; position: relative; width: 28px; height: 28px; border-radius: 50%; cursor: ns-resize; touch-action: none;
  background: radial-gradient(circle at 35% 30%, #3a2a55, #0c0614 70%); border: 1px solid var(--line); box-shadow: 0 0 8px rgba(168, 85, 247, .35); }
.ie-knob i { position: absolute; left: 50%; top: 3px; width: 2px; height: 10px; margin-left: -1px; border-radius: 1px; background: #facc15;
  transform-origin: 50% 11px; transform: rotate(var(--a)); }
.ie-fx { width: 30px; height: 22px; border-radius: 11px; border: 1px solid var(--line); background: #120a1c; color: var(--muted); font-size: 9.5px; font-weight: 800; cursor: pointer; padding: 0; }
.ie-fx.on { background: #22c55e; color: #052e12; border-color: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, .6); }
html[data-theme="sunset"] .ie-knob { background: radial-gradient(circle at 35% 30%, #fff, #f3d2a6 70%); }

/* + Add effect docked in the top bar; its menu floats (fixed) */
.top .add-wrap { order: 0; margin-left: 0; }
.add-menu { position: fixed !important; overflow: auto; }
/* phone top bar: one compact block */
@media (max-width: 640px) {
  body:not(.in-plugin) .top { row-gap: 6px; }
  body:not(.in-plugin) .top .wordmark { font-size: 15px; }
  body:not(.in-plugin) .top .btn, body:not(.in-plugin) .top .add-btn { padding: 6px 8px; font-size: 12px; min-height: 0; }
  body:not(.in-plugin) .top .add-btn .plus { width: 18px; height: 18px; }
}
.save-device { width: 100%; padding: 9px; font-weight: 700; margin-top: 2px; }

.qm-row { gap: 22px 34px; padding: 18px 0; }

/* The pulsing glow cross-fades two fixed shadows with opacity: the compositor
   runs it, instead of repainting an animated box-shadow every frame. */
.audio-start { position: relative; background: #facc15; color: #111; border: 0; border-radius: 99px; padding: 7px 14px; font-weight: 800; cursor: pointer; }
.audio-start::before, .audio-start::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  animation: audiopulse 1.6s ease-in-out infinite;
}
.audio-start::before { box-shadow: 0 0 14px rgba(250, 204, 21, .5); }
.audio-start::after { box-shadow: 0 0 4px rgba(250, 204, 21, .2); opacity: 0; animation-name: audiopulse-in; }
@keyframes audiopulse { 50% { opacity: 0; } }
@keyframes audiopulse-in { 50% { opacity: 1; } }

.update-badge { background: #facc15; color: #111; border-radius: 99px; padding: 3px 10px; font-size: 11px; font-weight: 800; text-decoration: none; }

/* our own symbols: a small purple droplet (like the logo) */
.drop { display: inline-block; width: 9px; height: 9px; margin: 0 3px 0 1px; vertical-align: -1px;
  background: linear-gradient(135deg, #c084fc, #7c3aed); border-radius: 50% 0 50% 50%; transform: rotate(-45deg); box-shadow: 0 0 6px rgba(168, 85, 247, .6); }
html[data-theme="sunset"] .drop { background: linear-gradient(135deg, #fdba74, #f97316); box-shadow: 0 0 6px rgba(249, 115, 22, .5); }
/* Samples tip (website) */
.sb-tip { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 12px 14px; border-radius: 12px;
  background: rgba(124, 58, 237, .14); border: 1px solid #3b1d5e; color: var(--text); font-weight: 600; }
.sb-tip span { flex: 1; }
.sb-tip-x { background: none; border: 0; color: var(--muted); font-size: 15px; cursor: pointer; padding: 2px 6px; }
html[data-theme="sunset"] .sb-tip { background: rgba(249, 115, 22, .1); border-color: #e3bf93; }
/* Tune: key row + Detect key */
.tune-keyrow { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.tune-detect { font-weight: 800; }
.tune-detect.on { background: var(--accent-strong) !important; color: #fff !important; border-color: var(--accent-strong) !important; }

/* Plugin slot */
.plug-body { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(100%, 460px); }
.plug-drop { width: 100%; padding: 42px 16px; border: 2px dashed #7c3aed; border-radius: 16px; text-align: center;
  font-weight: 900; letter-spacing: .14em; color: #d8c8f5; background: rgba(124, 58, 237, .08); }
.plug-drop.over { background: rgba(250, 204, 21, .14); border-color: #facc15; color: #facc15; }
.plug-pick { flex: 1; min-width: 200px; background: #0b0612; color: var(--text); border: 1px solid #2a1d40; border-radius: 8px; padding: 7px 10px; }
.plug-name { font-size: 22px; font-weight: 900; }
.plug-open { background: var(--accent-strong) !important; color: #fff !important; border-color: var(--accent-strong) !important; font-weight: 800; }
.plug-note { color: var(--muted); text-align: center; margin: 0; }
html[data-theme="sunset"] .plug-drop { border-color: #f97316; color: #9a4a12; background: rgba(249, 115, 22, .08); }
html[data-theme="sunset"] .plug-pick { background: #fffaf3; border-color: #e3bf93; }

.scs-self { margin-left: 8px; background: none; border: 1px solid currentColor; border-radius: 999px; color: var(--muted); font: inherit; font-size: 11px; padding: 1px 8px; cursor: pointer; }
.scs-self:empty { display: none; }

/* Continue with Google (web version) */
.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.google-btn:hover { background: #f6f6f6; }
.google-g { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 800 12px/1 Arial, sans-serif; color: #fff; background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.cloud-or { margin: 2px 0; text-align: center; font-size: 12px; opacity: .65; }
.code-box { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.code-box input { flex: 1 1 140px; }
.linkish { background: none; border: 0; color: inherit; text-decoration: underline; opacity: .8; cursor: pointer; padding: 4px 0; font: inherit; font-size: 12px; }
.linkish:hover { opacity: 1; }

/* ===================================================== Skins: a still picture behind the whole window */
/* One fixed layer painted once (no animation). A veil tied to the theme keeps text and knobs readable. */
:root { --skin-veil: rgba(0, 0, 0, .5); }
html[data-theme="sunset"] { --skin-veil: rgba(255, 241, 222, .55); }
html[data-skin] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(var(--skin-veil), var(--skin-veil)), var(--skin) center / cover no-repeat;
}
html[data-skin] .unit, html[data-skin] body.in-plugin .unit { background: transparent; }

/* stock skins (pure CSS); the same values paint the little tiles in the menu */
[data-skin="galaxy"] { --skin:
  radial-gradient(1px 1px at 14% 22%, #fff, transparent 60%), radial-gradient(1px 1px at 33% 71%, #fff, transparent 60%),
  radial-gradient(1.5px 1.5px at 52% 14%, #fff, transparent 60%), radial-gradient(1px 1px at 68% 58%, #fff, transparent 60%),
  radial-gradient(1.5px 1.5px at 84% 32%, #fff, transparent 60%), radial-gradient(1px 1px at 91% 83%, #fff, transparent 60%),
  radial-gradient(1px 1px at 7% 88%, #fff, transparent 60%), radial-gradient(1px 1px at 44% 44%, #fff, transparent 60%),
  radial-gradient(60% 45% at 30% 35%, rgba(168, 85, 247, .55), transparent 70%),
  radial-gradient(50% 40% at 72% 65%, rgba(56, 120, 255, .45), transparent 70%),
  radial-gradient(35% 30% at 60% 25%, rgba(255, 80, 200, .3), transparent 70%),
  linear-gradient(160deg, #05030f, #0b0620 50%, #020108); }
[data-skin="aurora"] { --skin:
  radial-gradient(70% 30% at 30% 30%, rgba(52, 245, 170, .55), transparent 70%),
  radial-gradient(60% 25% at 70% 22%, rgba(80, 200, 255, .45), transparent 70%),
  radial-gradient(50% 30% at 55% 45%, rgba(170, 90, 255, .35), transparent 70%),
  linear-gradient(180deg, #020d14 0%, #04202a 55%, #01070a 100%); }
[data-skin="ocean"] { --skin:
  repeating-radial-gradient(120% 60% at 50% 120%, rgba(255, 255, 255, 0) 0 22px, rgba(255, 255, 255, .05) 24px, rgba(255, 255, 255, 0) 27px),
  radial-gradient(80% 50% at 50% 0%, rgba(90, 220, 255, .45), transparent 70%),
  linear-gradient(180deg, #0a4a6e, #062a45 50%, #021220); }
[data-skin="lava"] { --skin:
  radial-gradient(40% 30% at 20% 75%, rgba(255, 120, 20, .75), transparent 70%),
  radial-gradient(35% 28% at 75% 30%, rgba(255, 50, 30, .7), transparent 70%),
  radial-gradient(30% 22% at 55% 85%, rgba(255, 190, 40, .55), transparent 70%),
  radial-gradient(25% 20% at 35% 20%, rgba(200, 20, 40, .6), transparent 70%),
  linear-gradient(160deg, #1a0302, #2a0804 50%, #0d0101); }
[data-skin="neon"] { --skin:
  repeating-linear-gradient(90deg, rgba(255, 60, 220, .22) 0 1px, transparent 1px 48px),
  repeating-linear-gradient(0deg, rgba(60, 220, 255, .18) 0 1px, transparent 1px 48px),
  radial-gradient(60% 35% at 50% 100%, rgba(255, 60, 220, .5), transparent 70%),
  radial-gradient(40% 30% at 50% 0%, rgba(60, 220, 255, .35), transparent 70%),
  linear-gradient(180deg, #0c0220, #1a0535 60%, #2a0640); }
[data-skin="carbon"] { --skin:
  repeating-linear-gradient(45deg, rgba(255, 255, 255, .045) 0 4px, transparent 4px 8px),
  repeating-linear-gradient(-45deg, rgba(0, 0, 0, .35) 0 4px, transparent 4px 8px),
  radial-gradient(80% 60% at 30% 10%, rgba(255, 255, 255, .1), transparent 70%),
  linear-gradient(160deg, #1b1d22, #0c0d10); }

/* the Skins button (next to the sun) and its menu */
.skin-btn::before {
  content: ""; width: 12px; height: 10px; border-radius: 3px; border: 1px solid var(--muted);
  background: linear-gradient(160deg, transparent 55%, var(--accent) 56%), radial-gradient(circle at 30% 35%, var(--meter) 0 1.5px, transparent 2px);
}
.skin-menu { width: 286px; }
.skin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 4px 8px; }
.skin-tile { display: flex; flex-direction: column; gap: 4px; align-items: stretch; padding: 3px; border-radius: 9px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--muted); font-size: 10.5px; }
.skin-tile i { display: block; height: 38px; border-radius: 6px; border: 1px solid var(--line); background: var(--skin, var(--plate)) center / cover no-repeat; }
.skin-tile:not([data-skin]) i { background: repeating-linear-gradient(45deg, var(--plate) 0 5px, var(--plate-2) 5px 10px); }
.skin-tile:hover { border-color: var(--line); color: var(--text); }
.skin-tile.sel { border-color: var(--accent); color: var(--text); }
.skin-up { display: block; width: calc(100% - 8px); margin: 0 4px 4px; }

/* Visualize legend knobs: click = colours -> hidden -> lines -> colours */
.legend .lg {
  display: flex; align-items: center; gap: 5px; padding: 2px 6px 2px 3px; border: 0; border-radius: 6px;
  background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.legend .lg:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.legend .lg .sw { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px var(--c); }
.legend .lg.m-hidden { opacity: .6; }
.legend .lg.m-hidden .sw { background: transparent; }
.legend .lg.m-lines .sw { background: linear-gradient(var(--c), var(--c)) center / 100% 2px no-repeat; }
