:root {
  --bg: #0e0f12;
  --bg2: #17191e;
  --panel: #1b1e24;
  --line: #2d3139;
  --text: #ebe8e2;
  --muted: #979aa2;
  --acc: #ff8a1f;
  --acc2: #ffb35c;
  --ok: #4fd67a;
  --bad: #ff4d3d;
  --amb: #ffb347;
  --fx: #e8742a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -200px, #2a2219 0%, var(--bg) 70%) no-repeat, var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--acc2); }
button, select, input { font: inherit; color: inherit; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; }
.err { color: var(--bad); font-size: 13px; margin: 6px 0 0; }
.help { color: var(--muted); font-size: 12px; margin: 6px 2px 0; }

.btn {
  background: #262a32; border: 1px solid #3a3f49; border-radius: 7px; padding: 6px 12px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover:not(:disabled) { background: #2f343e; border-color: #4a505c; }
.btn:disabled, .ib:disabled { opacity: .4; cursor: default; }
.btn.main { background: var(--acc); border-color: var(--acc); color: #1a1004; font-weight: 700; }
.btn.main:hover:not(:disabled) { background: var(--acc2); }
.btn.danger { background: #a3241a; border-color: var(--bad); color: #fff; font-weight: 700; }
.btn.danger:hover:not(:disabled) { background: #c42d20; }
.btn.live { border-color: var(--ok); color: var(--ok); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.ib { background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 7px; cursor: pointer; color: var(--muted); }
.ib:hover:not(:disabled) { color: var(--text); border-color: var(--line); }
select { background: #20242b; border: 1px solid #3a3f49; border-radius: 7px; padding: 5px 8px; max-width: 100%; }
input[type=range] { accent-color: var(--acc); }

.seg { display: inline-flex; border: 1px solid #3a3f49; border-radius: 8px; overflow: hidden; }
.seg.wrap { flex-wrap: wrap; }
.seg button { background: #20242b; border: 0; border-right: 1px solid #3a3f49; padding: 5px 11px; cursor: pointer; font-size: 13px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--acc); color: #1a1004; font-weight: 700; }

.sw { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 4px 0; }
.sw input { accent-color: var(--acc); width: 16px; height: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.row.end { justify-content: flex-end; }
.mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.mini input { width: 90px; }
.lbl { margin: 10px 0 4px; font-size: 12px; color: var(--muted); }

/* ---------- top bar ---------- */
.bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 16px;
  background: rgba(10, 11, 14, .85); border-bottom: 1px solid #22252c; position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px);
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 600; letter-spacing: .08em; font-size: 13px; }
.logo b { color: var(--acc); }
.presets { display: flex; align-items: center; gap: 4px; }
.presets select { min-width: 170px; font-weight: 600; }
.dirty { color: var(--acc); font-size: 12px; margin: 0 2px; }
.lang { color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; font-size: 12px; }

main {
  display: grid; gap: 14px; padding: 14px 16px 6px; max-width: 1680px; margin: 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.7fr);
  grid-template-areas: "unit unit unit unit" "chain chain chain chain" "src loop drum studio";
}
.unit { grid-area: unit; }
.chainbox { grid-area: chain; }
.deck { display: contents; }
.deck > .panel:nth-child(1) { grid-area: src; }
.deck > .panel:nth-child(2) { grid-area: loop; }
.deck > .panel:nth-child(3) { grid-area: drum; }
.studio { grid-area: studio; }

@media (max-width: 1400px) {
  main { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "unit unit unit" "chain chain chain" "src loop drum" "studio studio studio"; }
}
@media (max-width: 860px) {
  .presets select { flex: 1; }
  .presets { flex: 1 1 100%; order: 5; }
  .bar { gap: 8px; padding: 8px 10px; }
  main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "unit" "chain" "src" "loop" "drum" "studio"; padding: 10px 8px; }
  .presets select { min-width: 0; width: 0; }
  .presets { min-width: 0; }
}

/* ---------- the unit ---------- */
.unit {
  border-radius: 16px; padding: 12px 18px 18px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, rgba(0,0,0,.02) 1px 3px),
    linear-gradient(180deg, #4a4e56 0%, #2e3137 18%, #24272c 60%, #1c1e22 100%);
  border: 1px solid #555a63;
  box-shadow: 0 14px 40px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.18), inset 0 -2px 0 rgba(0,0,0,.4);
  position: relative;
}
.unit::after { content: ""; position: absolute; left: 18px; right: 18px; top: 46px; height: 3px; border-radius: 2px; background: var(--fx); opacity: .85; box-shadow: 0 0 14px var(--fx); }
.plate { display: flex; align-items: center; gap: 12px; height: 30px; margin-bottom: 22px; }
.screw { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #aab0b9, #4b4f56); box-shadow: inset 0 0 0 1px rgba(0,0,0,.4); }
.plate .kh { margin-left: auto; }
.kh { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px 10px; font-size: 11px; color: var(--muted); }
.kh span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.kh kbd { font: 700 10.5px ui-monospace, Consolas, monospace; min-width: 18px; padding: 1px 5px; text-align: center; color: #e5e2dc; background: #2a2e36; border: 1px solid #454b56; border-bottom-width: 2px; border-radius: 4px; }
.phead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.phead h2 { margin: 0; }
@media (pointer: coarse), (max-width: 860px) { .kh { display: none; } }
.model { font-weight: 800; font-size: 20px; letter-spacing: .12em; color: #f1ede6; text-shadow: 0 1px 0 #000; }
.sub { font-size: 10px; letter-spacing: .22em; color: #b9bcc3; }

.face { display: grid; grid-template-columns: auto minmax(330px, 1.25fr) minmax(0, 1.4fr) auto; grid-template-areas: "left lcd ctl sw"; gap: 22px; align-items: center; }
.uleft { grid-area: left; display: flex; align-items: center; gap: 18px; }
.lcdwrap { grid-area: lcd; }
.controls { grid-area: ctl; }
.ubtns { grid-area: sw; }
@media (max-width: 1560px) { .face { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "left lcd sw" "ctl ctl ctl"; } }
@media (max-width: 1100px) { .face { grid-template-columns: minmax(0, 1fr); grid-template-areas: "left" "lcd" "ctl" "sw"; } .uleft { justify-content: center; flex-wrap: wrap; } }

.knob.big { width: 116px; }
.knob.big .kn { width: 96px; height: 96px; }
.uleft .kn svg { overflow: visible; }
.uleft .kn .va { stroke: var(--acc); filter: drop-shadow(0 0 4px var(--acc)); }
.knob.big output { font-size: 13px; }
.ucol { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 132px; }
.ucol .btn.ubig { width: 100%; min-height: 48px; }
.btn.ubig { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 10px; font-weight: 700; font-size: 13px; line-height: 1.2; text-align: left; }
.ubig .led { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #14301d; box-shadow: inset 0 0 0 1px #000; }
.ubig.on .led { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.umeters { display: flex; align-items: flex-start; gap: 6px; cursor: pointer; user-select: none; }
.mgrp { display: grid; grid-template-columns: auto auto; gap: 0 4px; justify-items: center; }
.mgrp em { grid-column: 1 / -1; font-style: normal; font-size: 9.5px; letter-spacing: .12em; color: #b9bcc3; margin-top: 1px; }
.mb { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mt { position: relative; width: 12px; height: 150px; border-radius: 3px; overflow: hidden; border: 1px solid #0b0c0e;
  background: linear-gradient(0deg, #2bb35a 0%, #4fd67a 60%, #e6c73c 80%, #ff8a1f 90%, #ff3b2a 97%); }
.mt i { position: absolute; left: 0; right: 0; top: 0; height: 100%; background: #15171b; }
.mt b { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #fff; opacity: 0; }
.mb.clip .mt { box-shadow: 0 0 8px var(--bad); border-color: var(--bad); }
.mb output { font: 600 9.5px ui-monospace, Consolas, monospace; color: #d9d6cf; width: 30px; text-align: center; }
.mb.clip output { color: var(--bad); }
.mb > span { font-size: 9px; color: var(--muted); }
.mscale { position: relative; width: 18px; height: 150px; font: 9px ui-monospace, Consolas, monospace; color: var(--muted); }
.mscale span { position: absolute; right: 0; transform: translateY(50%); }
.mscale span:nth-child(1) { bottom: 100%; }
.mscale span:nth-child(2) { bottom: 90%; }
.mscale span:nth-child(3) { bottom: 80%; }
.mscale span:nth-child(4) { bottom: 60%; }
.mscale span:nth-child(5) { bottom: 20%; }

.lcdwrap { display: flex; align-items: stretch; gap: 6px; }
.nav { background: #1d1f24; border: 1px solid #3c4048; border-radius: 6px; color: #b6b9c0; cursor: pointer; width: 28px; }
.nav:hover { color: #fff; }
.lcd {
  flex: 1; min-width: 0; border-radius: 8px; padding: 8px 10px; position: relative; min-height: 200px;
  background: radial-gradient(120% 140% at 50% 0%, #251a08 0%, #120d05 70%);
  border: 2px solid #0a0a0a; box-shadow: inset 0 0 22px rgba(0,0,0,.85), 0 1px 0 rgba(255,255,255,.15);
  color: var(--amb); font-family: ui-monospace, Consolas, monospace; text-shadow: 0 0 6px rgba(255,179,71,.45);
}
.lcd.off { opacity: .55; }
.lcd-head { display: flex; align-items: baseline; gap: 10px; font-size: 12px; border-bottom: 1px solid rgba(255,179,71,.2); padding-bottom: 4px; }
.lcd-head b { font-size: 17px; text-transform: uppercase; letter-spacing: .04em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcd-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 6px; }
.lcd canvas { width: 100%; height: 150px; display: block; }
.lcd-params { font-size: 12.5px; min-width: 132px; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.lp { display: flex; justify-content: space-between; gap: 10px; opacity: .78; }
.lp b { font-weight: 600; }
.lp.act { opacity: 1; background: rgba(255,179,71,.14); }
.lcd-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 10px; font-size: 13px; }

.controls { display: flex; flex-wrap: wrap; gap: 6px 10px; justify-content: center; align-items: flex-start; min-height: 120px; }
.knob { display: flex; flex-direction: column; align-items: center; width: 88px; user-select: none; }
.kn { width: 76px; height: 76px; cursor: ns-resize; touch-action: none; border-radius: 50%; outline: none; }
.kn:focus-visible { box-shadow: 0 0 0 2px var(--acc2); }
.kn svg { width: 100%; height: 100%; display: block; }
.kn .tr { fill: none; stroke: #121316; stroke-width: 5; stroke-linecap: round; }
.kn .va { fill: none; stroke: var(--fx); stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 3px var(--fx)); }
.kn .cap { fill: #2b2e34; stroke: #0b0c0e; stroke-width: 1.5; }
.kn .ptr { stroke: #f0ece4; stroke-width: 3; stroke-linecap: round; }
.knob output { font: 600 12px ui-monospace, Consolas, monospace; color: #f0ece4; margin-top: -2px; }
.knob span { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #b9bcc3; text-align: center; line-height: 1.2; }
.knob.act output { color: var(--acc2); }

.controls.eq { gap: 4px; }
.band { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 46px; font-size: 11px; }
.band output { font: 600 11px ui-monospace, Consolas, monospace; }
.band span { font-weight: 700; font-size: 10.5px; color: #b9bcc3; }
.band input { writing-mode: vertical-lr; direction: rtl; width: 22px; height: 140px; margin: 0; }
.band:last-child { border-left: 1px solid rgba(255,255,255,.12); padding-left: 6px; }
.chooser { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.chooser > span { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #b9bcc3; }

.ubtns { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 190px; }
.uid { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; max-width: 100%; }
.uid .ic { flex: none; width: 28px; height: 28px; fill: none; stroke: var(--fx); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; filter: brightness(1.5) drop-shadow(0 0 6px color-mix(in srgb, var(--fx) 60%, transparent)); }
.uid b { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: #f1ede6; line-height: 1.2; text-align: left; text-shadow: 0 1px 0 #000; }
.urow { display: flex; gap: 6px; }
.fsw {
  width: 92px; height: 92px; border-radius: 50%; cursor: pointer; position: relative; padding: 0;
  background: radial-gradient(circle at 40% 35%, #d9dce1, #7f848c 45%, #3d4046 100%);
  border: 4px solid #2a1512; box-shadow: 0 0 0 3px #15161a, 0 6px 14px rgba(0,0,0,.6), inset 0 -3px 6px rgba(0,0,0,.4);
  transition: border-color .15s, box-shadow .15s;
}
.fsw:active { transform: translateY(1px); }
.fsw i { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #3a1410; box-shadow: inset 0 0 0 1px #000, inset 0 2px 3px rgba(0,0,0,.6); transition: background .15s, box-shadow .15s; }
.fsw.on { border-color: #ff3b2a; box-shadow: 0 0 0 3px #15161a, 0 0 22px rgba(255,59,42,.75), 0 6px 14px rgba(0,0,0,.6), inset 0 -3px 6px rgba(0,0,0,.4); }
.fsw.on i { background: #ff3b2a; box-shadow: 0 0 12px #ff3b2a, 0 0 3px #fff inset; }
.ubtns .fsw:disabled { opacity: .4; }

/* ---------- chain ---------- */
.chainbox { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 8px; }
.chainscroll { overflow-x: auto; }
.chain { display: inline-flex; min-width: 100%; min-height: 110px; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 2px 10px; position: relative; }
.chain::before { content: ""; position: absolute; left: 20px; right: 20px; top: 50%; height: 3px; margin-top: -6px; background: #3b3f47; border-radius: 2px; z-index: 0; }
.jack { z-index: 1; flex: none; position: relative; display: flex; align-items: center; margin-top: -6px; }
.jack b { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: #e5e2dc; background: #121317; border: 1px solid #4a505b; border-radius: 10px; padding: 2px 9px; }
.jk { width: 112px; height: 42px; display: block; filter: drop-shadow(0 3px 4px rgba(0,0,0,.7)); }
#jOut .jk { transform: scaleX(-1); }
.jk .cb { stroke: #08090a; stroke-width: 5; stroke-linecap: round; }
.jk .bt { fill: #3a3e46; stroke: #8a8f98; stroke-width: .8; }
.jk .gr { stroke: #1c1e22; stroke-width: 1.4; }
.jk .sl { fill: #d7dadf; stroke: #9aa0a8; stroke-width: .6; }
.jk .ir { fill: #0b0c0e; }
.jk .tp { fill: #f1f3f5; stroke: #9aa0a8; stroke-width: .6; }
.irrow { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 4px; }
.irrow select { max-width: 220px; }
.irmiss { flex-basis: 100%; text-align: center; margin: 2px 0 0; font-size: 12px; color: var(--amb); }
.seg.cabs { flex-wrap: wrap; justify-content: center; max-width: 100%; }
@media (max-width: 560px) { .cabs button { padding: 5px 6px 4px; font-size: 10.5px; } .cabs svg { width: 34px; height: 34px; } .irrow select { max-width: 100%; flex: 1 1 100%; } }
.cabs button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 10px 5px; font-size: 11.5px; }
.cabs svg { width: 46px; height: 46px; display: block; }
.cabs .box { fill: #17191d; stroke: currentColor; stroke-width: 1.6; }
.cabs .spk { fill: #0c0d0f; stroke: currentColor; stroke-width: 1.2; }
.cabs .dc { fill: currentColor; opacity: .55; }
.cabs .wave { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.cabs .port { fill: #0c0d0f; stroke: currentColor; stroke-width: 1; }
.cabs button.on .box { fill: #3a2408; }
.empty { z-index: 1; color: var(--muted); font-size: 12px; background: var(--panel); padding: 0 6px; }
.pd {
  z-index: 1; flex: none; width: 78px; height: 96px; border-radius: 9px; cursor: grab; position: relative; touch-action: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px 4px 6px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 92%, #fff 8%), color-mix(in srgb, var(--c) 70%, #000 30%));
  border: 1px solid rgba(0,0,0,.6); box-shadow: 0 4px 10px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.2);
  color: #fff; transition: transform .12s, box-shadow .12s, opacity .12s; user-select: none;
}
.pd:not(.on) { filter: saturate(.35) brightness(.7); }
.pd .ic { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.pd span { font-size: 11px; font-weight: 700; text-align: center; line-height: 1.1; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.pd .led { position: absolute; top: 6px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #3a1410; box-shadow: inset 0 0 0 1px rgba(0,0,0,.6); }
.pd.on .led { background: #ff3b2a; box-shadow: 0 0 8px #ff3b2a; }
.pd.sel { outline: 2px solid #fff; outline-offset: 3px; }
.pd.drag { z-index: 3; cursor: grabbing; transition: none; opacity: .92; box-shadow: 0 12px 26px rgba(0,0,0,.7); }
.pd.ins, .add.ins { box-shadow: -8px 0 0 -4px var(--acc2), 0 4px 10px rgba(0,0,0,.45); }
.add { z-index: 1; flex: none; width: 52px; height: 52px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 2px dashed #5a606b; background: #15171b; color: var(--acc2); cursor: pointer; }
.add svg { width: 26px; height: 26px; display: block; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.add:hover { border-color: var(--acc2); }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.panel h2 { margin: 0 0 6px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: #cfccc5; }
.file { position: relative; overflow: hidden; display: inline-block; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.lp { display: flex; align-items: center; gap: 14px; }
.lpbtn {
  flex: none; width: 92px; height: 92px; border-radius: 50%; cursor: pointer; font-weight: 800; letter-spacing: .06em; font-size: 14px;
  background: radial-gradient(circle at 40% 35%, #3a3e46, #1b1d22); border: 3px solid #444a54; color: #e5e2dc;
  box-shadow: 0 6px 14px rgba(0,0,0,.5);
}
.lpbtn[data-s=EMPTY] { border-color: #a3332b; color: #ff7a6d; }
.lpbtn[data-s=REC] { border-color: #ff3b2a; background: radial-gradient(circle at 40% 35%, #7a1d16, #3a0d0a); color: #fff; box-shadow: 0 0 22px rgba(255,59,42,.55); }
.lpbtn[data-s=PLAY] { border-color: var(--ok); color: var(--ok); box-shadow: 0 0 18px rgba(79,214,122,.3); }
.lpbtn[data-s=DUB] { border-color: var(--acc); background: radial-gradient(circle at 40% 35%, #6a3a0c, #2c1804); color: #fff; box-shadow: 0 0 22px rgba(255,138,31,.5); }
.lpbtn[data-s=STOP] { border-color: #6b717c; }
.lpbtn[data-s=ARM_REC], .lpbtn[data-s=ARM_END] { border-color: #ff3b2a; animation: blink .5s steps(2) infinite; }
@keyframes blink { 50% { border-color: #3a1410; } }
.lpinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lpinfo b { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.lpbar { height: 8px; background: #121317; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.lpbar i { display: block; height: 100%; width: 0; background: var(--acc); }

.bpmrow .bpm { font: 700 26px ui-monospace, Consolas, monospace; min-width: 52px; text-align: center; color: var(--acc2); cursor: ns-resize; }
.steps { display: grid; grid-template-columns: repeat(16, 1fr); gap: 3px; margin-top: 12px; }
.steps i { height: 14px; border-radius: 3px; background: #23262d; border: 1px solid #30343c; }
.steps i.beat { background: #2e323a; }
.steps i.now { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.drums select { flex: 1; min-width: 140px; }

.studio { display: flex; flex-direction: column; min-height: 260px; }
.shead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shead h2 { margin: 0; }
.scv { position: relative; flex: 1; min-height: 240px; margin-top: 8px; background: #0c0d10; border-radius: 8px; border: 1px solid #23262d; overflow: hidden; }
.scv canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.legend { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; margin-left: 6px; }
.legend .li { background: rgba(160,170,190,.6); }
.legend .lo { background: var(--acc); }

footer.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 10px 0 22px; }

.flash { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #262a32; border: 1px solid var(--acc); color: var(--text); padding: 8px 16px; border-radius: 8px; z-index: 20; }

/* ---------- dialogs ---------- */
.dlg { background: #1c1f25; color: var(--text); border: 1px solid #3a3f49; border-radius: 14px; padding: 18px 20px; max-width: min(520px, 94vw); }
.dlg:not(.full) { width: min(640px, 94vw); max-width: none; height: min(460px, 90vh); max-height: none; padding: 22px 26px; }
.dlg:not(.full) form { height: 100%; display: flex; flex-direction: column; }
.dlg:not(.full) form > .row.end { margin-top: auto; padding-top: 14px; }
.dlg:not(.full) h2 { font-size: 20px; margin-bottom: 14px; }
.dlg:not(.full) p { font-size: 14.5px; line-height: 1.5; }
.dlg .menu .btn { padding: 9px 14px; }
.dlg::backdrop { background: rgba(0,0,0,.6); }
.dlg h2 { margin: 0 0 10px; font-size: 17px; }
.dlg h3 { margin: 14px 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dlg input[type=text] { width: 100%; background: #121317; border: 1px solid #3a3f49; border-radius: 7px; padding: 8px 10px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.grid select { color: var(--text); }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.menu { display: flex; flex-direction: column; gap: 6px; }
.menu .btn { text-align: left; }
.dlg.full { width: 96vw; max-width: 1400px; height: 94vh; max-height: none; padding: 0; overflow: hidden; }
.dlg.full form { height: 100%; display: flex; flex-direction: column; }
.dhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #2d3139; }
.dhead h2 { margin: 0; font-size: 20px; }
#addGrid { flex: 1; overflow-y: auto; padding: 4px 20px 20px; }
.dlg.full h3 { margin: 18px 0 10px; font-size: 13px; }
.addrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.addb {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer; color: var(--text);
  background: #23272e; border: 1px solid #3a3f49; border-radius: 12px; padding: 16px 12px 14px; transition: background .12s, border-color .12s, transform .12s;
}
.addb:hover:not(:disabled) { background: #2b3038; border-color: var(--c); transform: translateY(-2px); }
.addb:disabled { opacity: .4; cursor: default; }
.addb .pd { width: 88px; height: 108px; cursor: inherit; transition: none; pointer-events: none; }
.addb .pd .ic { width: 36px; height: 36px; }
.addb b { font-size: 15px; }
.addb em { font-style: normal; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #1a1004; background: var(--acc2); border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 2px; }
.addb small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
@media (max-width: 560px) { .dlg.full { width: 100vw; height: 100vh; border-radius: 0; } .addrow { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; } #addGrid { padding: 0 12px 14px; } }
