:root{
  --bg:#fff;
  --fg:#000;
  --muted:rgba(0,0,0,.55);
  --line:rgba(0,0,0,.9);
  --hair:rgba(0,0,0,.12);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow:hidden;
}

.toolbar{
  position:fixed;
  right:14px;
  top:14px;
  z-index:20;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  pointer-events:auto;
}

.transportbar{
  position:fixed;
  left:50%;
  top:14px;
  z-index:20;
  display:flex;
  gap:8px;
  transform:translateX(-50%);
  pointer-events:auto;
}

.transportbtn{
  min-width:44px;
  height:36px;
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  letter-spacing:0;
}

.banner{
  position:fixed;
  left:12px;
  right:12px;
  top:12px;
  z-index:10;
  border:1px solid rgba(0,0,0,.25);
  border-radius:14px;
  background:rgba(255,255,255,.96);
  padding:10px 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
}
.banner__title{font-weight:900; letter-spacing:.06em}
.banner__text{margin-top:4px; font-size:13px; opacity:.85}
.banner a{color:#000; text-decoration:underline}

#viz{
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  background:#fff;
  z-index:0;
  pointer-events:none;
}

.header{
  position:fixed;
  left:0;
  top:0;
  right:0;
  height:60px;
  display:flex;
  align-items:center;
  padding:0 18px;
  z-index:2;
  pointer-events:none;
}
.title{
  font-weight:800;
  letter-spacing:0.12em;
  font-size:18px;
  text-transform:uppercase;
}
.titlebtn{
  pointer-events:auto;
  border:none;
  background:transparent;
  padding:0;
  cursor:pointer;
  color:inherit;
}
.titlebtn:hover{text-decoration:underline}
.titlebtn:focus-visible{outline:2px solid rgba(0,0,0,.75); outline-offset:4px; border-radius:8px}

.sidebar{
  position:fixed;
  left:0;
  top:60px;
  bottom:0;
  width:360px;
  z-index:3;
}
.sidebar__inner{
  height:100%;
  padding:14px 12px 14px 14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.sidebar__hint{
  font-size:12px;
  color:var(--muted);
  line-height:1.25;
}

.slots{
  display:flex;
  flex-direction:column;
  gap:8px;
  overflow:auto;
  padding-right:6px;
}

.slot{
  border:1px solid var(--hair);
  border-radius:10px;
  padding:8px;
  background:rgba(255,255,255,.75);
  backdrop-filter: blur(4px);
  display:grid;
  grid-template-columns: 1fr auto auto auto auto auto auto;
  gap:8px;
  align-items:center;
}
.slot:hover{border-color:rgba(0,0,0,.22)}
.slot.is-playing{border-color:rgba(0,0,0,.5)}
.slot.is-drop{border-color:rgba(0,0,0,.70); background:rgba(0,0,0,.04)}

.slot input{
  width:100%;
  border:1px solid var(--hair);
  border-radius:8px;
  padding:7px 8px;
  background:#fff;
  outline:none;
}
.slot input:focus{border-color:rgba(0,0,0,.35)}

.slot__namewrap{display:flex; flex-direction:column; gap:4px; min-width:0}
.slot__meta{font-size:11px; color:var(--muted); letter-spacing:.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

.btn{
  border:1px solid var(--hair);
  background:#fff;
  border-radius:8px;
  padding:7px 10px;
  cursor:pointer;
  color:var(--fg);
  font-weight:600;
}
.btn:hover{border-color:rgba(0,0,0,.25)}
.seqbtn.active{
  border-color:#000;
  background:rgba(0,0,0,.06);
}
.btn:disabled{opacity:.5;cursor:not-allowed}

.dot{
  width:10px;
  height:10px;
  border-radius:50%;
  border:1px solid rgba(0,0,0,.25);
  background:transparent;
}
.dot.has-audio{background:rgba(0,0,0,.9)}

.toast{
  position:fixed;
  left:380px;
  top:74px;
  z-index:5;
  font-size:12px;
  color:rgba(0,0,0,.8);
  background:rgba(255,255,255,.92);
  border:1px solid var(--hair);
  border-radius:10px;
  padding:8px 10px;
  max-width:520px;
  display:none;
}
.toast.show{display:block}

/* Ensure the HTML `hidden` attribute actually hides elements.
  (Author CSS can override the UA stylesheet otherwise.) */
[hidden]{display:none !important}

body.modal-open{overflow:hidden}

/* --- Sequencer track add buttons ---------------------------------------- */
.seq__addtracks{
  margin-top:10px;
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.seq__addtracks .seqbtn{min-width:110px}

/* --- Synth keyboard ----------------------------------------------------- */
.seq__keys{
  margin-top:12px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.synthkb{
  position:relative;
  flex: 1 1 520px;
  min-width: 320px;
  height: 104px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:14px;
  background:rgba(255,255,255,.92);
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  padding:10px 10px 10px;
}
.synthkb__inner{
  position:relative;
  height: 82px;
  width: max-content;
}
.pkey{
  position:relative;
  display:inline-flex;
  align-items:flex-end;
  justify-content:center;
  font-size:10px;
  letter-spacing:.05em;
  vertical-align: top;
  user-select:none;
  cursor:pointer;
  border:1px solid rgba(0,0,0,.18);
  border-radius:6px;
  margin-right:2px;
}
.pkey--white{
  width:18px;
  height:78px;
  background:#fff;
}
.pkey--black{
  width:14px;
  height:50px;
  background:#111;
  color:rgba(255,255,255,.85);
  border-color:rgba(0,0,0,.4);
  margin-left:-9px;
  margin-right:-9px;
  z-index:3;
}
.pkey.is-on{
  background: rgba(0,0,0,.10);
}
.pkey--black.is-on{
  background: rgba(255,255,255,.18);
}
.pkey.is-root{
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35);
}

/* --- Sample editor overlay ---------------------------------------------- */
.sedit{
  position:fixed;
  inset:0;
  z-index:80;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding:78px 16px 16px;
  background:rgba(255,255,255,.55);
  backdrop-filter: blur(3px);
}
.sedit__panel{
  width:min(980px, calc(100vw - 32px));
  border:1px solid rgba(0,0,0,.18);
  border-radius:16px;
  background:rgba(255,255,255,.98);
  box-shadow: 0 18px 60px rgba(0,0,0,.10);
  overflow:hidden;
}
.sedit__head{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 12px; border-bottom:1px solid rgba(0,0,0,.10)}
.sedit__title{font-weight:900; letter-spacing:.18em}
.sedit__body{padding:12px}
.sedit__canvas{width:100%; height:260px; border:1px solid rgba(0,0,0,.12); border-radius:12px; background:#fff}
.sedit__info{margin-top:8px; font-size:12px; color:rgba(0,0,0,.75)}
.sedit__controls{margin-top:10px; display:flex; flex-wrap:wrap; gap:8px; align-items:center}
.sedit__hint{margin-top:10px; font-size:12px; color:var(--muted)}

/* --- Help overlay ------------------------------------------------------- */
.help{
  position:fixed;
  inset:0;
  z-index:70;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding:78px 16px 16px;
  background:rgba(255,255,255,.50);
  backdrop-filter: blur(3px);
}
.help__panel{
  width:min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 100px);
  overflow:auto;
  border:1px solid rgba(0,0,0,.18);
  border-radius:16px;
  background:rgba(255,255,255,.96);
  box-shadow: 0 18px 60px rgba(0,0,0,.12);
}
.help__head{
  position:sticky;
  top:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid rgba(0,0,0,.10);
  background:rgba(255,255,255,.98);
  border-radius:16px 16px 0 0;
}
.help__title{font-weight:900; letter-spacing:.12em; font-size:12px; text-transform:uppercase; opacity:.85}
.help__tools{display:flex; align-items:center; gap:8px}
.help__body{padding:10px 12px 12px; font-size:13px; color:rgba(0,0,0,.82); line-height:1.35}
.help__hint{font-size:12px; opacity:.75; margin-bottom:8px}
.help__body h3{margin:12px 0 6px; font-size:12px; letter-spacing:.12em; text-transform:uppercase}
.help__body ul{margin:0 0 8px 18px}
.help__body li{margin:4px 0}
.help__body code{font-size:12px}

/* --- Busy overlay ------------------------------------------------------- */
.busy{
  position:fixed;
  inset:0;
  z-index:60;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding-top:90px;
  background:rgba(255,255,255,.45);
  backdrop-filter: blur(2px);
}
.busy__panel{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid rgba(0,0,0,.18);
  border-radius:14px;
  background:rgba(255,255,255,.94);
  padding:10px 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,.12);
  max-width:min(680px, calc(100vw - 30px));
}
.busy__spin{
  width:16px;
  height:16px;
  border-radius:999px;
  border:2px solid rgba(0,0,0,.18);
  border-top-color:#000;
  animation: busyspin 0.8s linear infinite;
}
@keyframes busyspin{to{transform:rotate(360deg)}}
.busy__text{font-size:12px; font-weight:900; letter-spacing:.10em; color:rgba(0,0,0,.8)}

/* --- FX Sidebar (dock right) ------------------------------------------- */
.fxside{
  --tabW:46px;
  position:fixed;
  top:74px;
  right:0;
  bottom:14px;
  width: clamp(320px, 34vw, 520px);
  z-index:30;
  pointer-events:auto;
  transform: translateX(calc(100% - var(--tabW)));
  transition: transform 180ms ease;
}
.fxside.is-open{ transform: translateX(0); }

.fxside__flag{
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width: var(--tabW);
  border:1px solid rgba(0,0,0,.18);
  border-right:none;
  background:rgba(255,255,255,.92);
  border-radius: 14px 0 0 14px;
  cursor:pointer;
  font-weight:900;
  letter-spacing:.18em;
  color:#000;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}
.fxside__flag:hover{ border-color:rgba(0,0,0,.32) }

.fxside__content{
  height:100%;
  margin-left: var(--tabW);
  border:1px solid rgba(0,0,0,.12);
  border-radius: 16px 0 0 16px;
  background:rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  box-shadow: 0 18px 60px rgba(0,0,0,.10);
  overflow:auto;
  padding:10px;
}

.fxpanel{
  border:1px solid rgba(0,0,0,.12);
  border-radius:14px;
  background:rgba(255,255,255,.92);
  padding:10px;
  margin-bottom:10px;
}
.fxpanel__title{font-weight:900; letter-spacing:.12em; font-size:12px; margin-bottom:8px}

/* --- DRUMS Sidebar (small screens) -------------------------------------- */
.drumside__flag{display:none}
.win[data-win="drums"].is-drumside{
  --tabW:46px;
  position:fixed !important;
  left:0 !important;
  top:74px !important;
  bottom:14px !important;
  height:auto !important;
  /* Wide enough to show the full 32-step pattern grid */
  width: clamp(880px, 92vw, 1400px) !important;
  max-width: calc(100vw - 8px) !important;
  min-width: 260px;
  resize: none;
  border-radius: 0 16px 16px 0;
  transform: translateX(calc(-100% + var(--tabW)));
  transition: transform 180ms ease;
  z-index:25;
}
.win[data-win="drums"].is-drumside.is-drumside-open{ transform: translateX(0); }

.win[data-win="drums"].is-drumside .win__head,
.win[data-win="drums"].is-drumside .win__body{
  margin-right: var(--tabW);
}

.win[data-win="drums"].is-drumside .win__head{display:none}
.win[data-win="drums"].is-drumside .win__body{
  max-height: 100%;
}

.win[data-win="drums"].is-drumside .win__min,
.win[data-win="drums"].is-drumside .win__close{
  display:none;
}

.win[data-win="drums"].is-drumside .drumside__flag{
  display:block;
  position:absolute;
  right:0;
  top:0;
  bottom:0;
  width: var(--tabW);
  border:1px solid rgba(0,0,0,.18);
  border-left:none;
  background:rgba(255,255,255,.92);
  border-radius: 0 14px 14px 0;
  cursor:pointer;
  font-weight:900;
  letter-spacing:.18em;
  color:#000;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}
.win[data-win="drums"].is-drumside .drumside__flag:hover{ border-color:rgba(0,0,0,.32) }

/* --- Windows ------------------------------------------------------------- */
.windows{
  position:fixed;
  inset:0;
  z-index:4;
  pointer-events:none;
}

.win{
  position:absolute;
  width:420px;
  max-width: calc(100vw - 24px);
  min-width: 260px;
  min-height: 140px;
  border:1px solid rgba(0,0,0,.12);
  border-radius:16px;
  background:rgba(255,255,255,.92);
  box-shadow: 0 18px 60px rgba(0,0,0,.10);
  backdrop-filter: blur(6px);
  color:#000;
  pointer-events:auto;
  overflow:hidden;
  resize: both;
}

.win[data-win="slots"]{ width:360px; }
.win[data-win="seq"]{ width:620px; }
.win[data-win="drums"]{ width:620px; }
.win[data-win="bass"]{ width:420px; }
.win[data-win="fx"]{ width:420px; }
.win[data-win="voicefx"]{ width:420px; }
.win[data-win="theremin"]{ width:420px; }
.win[data-win="basstool"]{ width:520px; }

.win__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-bottom:1px solid rgba(0,0,0,.08);
  cursor:grab;
  user-select:none;
}
.win__head:active{ cursor:grabbing; }
.win__title{ font-weight:900; letter-spacing:.12em; font-size:12px; }
.win__btns{display:flex;align-items:center;gap:8px}
.win__min,
.win__close{
  border:1px solid rgba(0,0,0,.16);
  background:rgba(255,255,255,.85);
  border-radius:10px;
  width:34px;
  height:30px;
  cursor:pointer;
  font-weight:900;
  line-height:1;
}
.win__min:hover,
.win__close:hover{ border-color:rgba(0,0,0,.32) }

.win.is-collapsed{resize: horizontal; overflow:hidden; min-height:0 !important}
.win.is-collapsed .win__body{display:none}

.win__body{
  padding:10px 12px 12px 12px;
  overflow:auto;
  max-height: calc(100% - 44px);
}

.knobgrid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
  align-items:start;
  justify-items:center;
}

/* DRUMS: put MIX + DRUMS FX knobs into a single row */
.win[data-win="drums"] .knobgrid{
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* give drums window a bit more default room for 6 knobs */
.win[data-win="drums"]{ width:760px; }

.knob-hidden{
  position:absolute;
  opacity:0;
  pointer-events:none;
  width:1px;
  height:1px;
}

/* --- Sequencer ---------------------------------------------------------- */
.seq{
  position:fixed;
  left:360px;
  right:0;
  bottom:0;
  padding:10px 14px 14px 14px;
  z-index:4;
  pointer-events:auto;
}
.seq__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.seq__controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.seq__banksRow{display:flex;align-items:center;gap:10px;justify-content:flex-end;flex-wrap:nowrap;margin-bottom:10px}
.bankbar{display:flex;align-items:center;gap:6px;flex-wrap:nowrap;overflow-x:auto;max-width:100%;padding-bottom:2px;-webkit-overflow-scrolling:touch}
.bankbtn-wrap{display:inline-grid;grid-template-columns:1fr;justify-items:center;gap:1px;vertical-align:middle}
.bankbtn__rep{font-size:9px;line-height:1;color:rgba(0,0,0,.45);cursor:pointer;user-select:none;min-width:30px;text-align:center;padding:1px 0}
.bankbtn__rep:hover{color:rgba(0,0,0,.85)}
.setbtn{min-width:34px;cursor:pointer}
.setbtn.is-selected{box-shadow:0 0 0 2px rgba(0,0,0,.55) inset}
.setbtn.is-muted{opacity:.32}
.setbtn.is-muted.is-selected{opacity:1}
.setbtn.is-solo{border-color:rgba(0,120,0,.85)}
.bankbtn{min-width:34px; cursor:grab}
.bankbtn:active{cursor:grabbing}
.bankbtn.is-dragging{opacity:.55}
.bankbtn.is-drop-target{outline:2px solid rgba(0,0,0,.45); outline-offset:2px}
.bankbtn.active{border-color:#000;background:transparent}
.bankbtn.active.is-filled{background:rgba(0,0,0,.06)}
.bankbtn.is-selected{box-shadow:0 0 0 2px rgba(0,0,0,.55) inset}
.bankbtn:not(.is-filled):not(.is-selected){opacity:.55}
.bankbtn.is-filled{position:relative}
.bankbtn.is-muted{opacity:.32}
.bankbtn.is-muted.is-selected{opacity:1}
.bankbtn.is-solo{border-color:rgba(0,120,0,.85)}
.bankbtn.is-locked{outline:2px solid rgba(180,0,0,.42); outline-offset:2px}
.bankbtn.is-filled::after{
  content:"";
  position:absolute;
  right:6px;
  bottom:5px;
  width:6px;
  height:6px;
  border-radius:99px;
  background:rgba(0,0,0,.65);
}

.bankmenu{
  position:fixed;
  left:0;
  top:0;
  z-index:9999;
  padding:6px;
  min-width:170px;
  border:1px solid rgba(0,0,0,.14);
  border-radius:14px;
  background:rgba(255,255,255,.96);
  box-shadow:0 14px 34px rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
}
.bankmenu__item{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 10px;
  border:0;
  border-radius:12px;
  background:transparent;
  cursor:pointer;
  font-weight:900;
  letter-spacing:.09em;
  font-size:12px;
  color:#000;
}
.bankmenu__item:hover{background:rgba(0,0,0,.06)}
.bankmenu__item.active{background:rgba(0,0,0,.10)}
.bankmenu__item:disabled{opacity:.5;cursor:not-allowed}
.seqbtn{
  border:1px solid rgba(0,0,0,.18);
  background:rgba(255,255,255,.9);
  border-radius:10px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:800;
  letter-spacing:.08em;
  color:#000;
}
.seqbtn:hover{border-color:rgba(0,0,0,.32)}
.seqbtn:disabled{opacity:.5;cursor:not-allowed}
.seqlabel{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);letter-spacing:.12em}
.seqlabel.disabled{opacity:.45}
.seqnum{
  width:86px;
  border:1px solid rgba(0,0,0,.18);
  border-radius:10px;
  padding:7px 8px;
  background:rgba(255,255,255,.92);
}
.seqsel{
  border:1px solid rgba(0,0,0,.18);
  border-radius:10px;
  padding:7px 8px;
  background:rgba(255,255,255,.92);
}
.seqsel--mini{padding:6px 8px;font-size:11px;letter-spacing:.12em}
.seq__ms .seqsel--mini{max-width:96px}
.seqstatus{font-size:12px;color:rgba(0,0,0,.75);letter-spacing:.12em;font-weight:800}
.seqloop{opacity:.75;font-variant-numeric:tabular-nums;min-width:92px;text-align:left}

.seq__grid{
  display:grid;
  grid-template-columns: 64px 1fr auto;
  gap:8px 10px;
  align-items:center;
}

.seq__extras{
  margin-top:12px;
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:10px;
}

.panel{
  border:1px solid rgba(0,0,0,.12);
  border-radius:14px;
  padding:10px;
  background:rgba(255,255,255,.92);
}
.panel__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.panel__title{font-weight:900; letter-spacing:.12em; font-size:12px}
.panel__tools{display:flex; align-items:center; gap:8px; flex-wrap:wrap}

.presetbar{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.presetbtn{padding:6px 8px;font-size:11px;letter-spacing:.10em}

.drums{
  display:grid;
  grid-template-columns:92px 72px 1fr auto;
  gap:8px 10px;
  align-items:center;
}

.drumvolcell{display:flex;align-items:center;justify-content:center}
.drumvol{width:72px; accent-color:#000}

.seq__ms{display:flex;align-items:center;justify-content:flex-end;gap:6px}
.seqbtn--mini{padding:6px 8px;min-width:30px;font-size:11px;letter-spacing:.12em}
.seqbtn--mini.active{background:rgba(0,0,0,.10)}

.fxbar{
  display:flex;
  flex-wrap:wrap;
  gap:8px 10px;
  align-items:center;
}
.fx{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:11px;
  letter-spacing:.10em;
  color:rgba(0,0,0,.7);
}
.fx input[type="range"]{width:120px}

.theremin{
  position:relative;
  height:120px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,.16);
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.01));
  overflow:hidden;
  user-select:none;
  touch-action:none;
}
.theremin__hint{position:absolute; left:10px; top:10px; font-size:12px; opacity:.6}
.theremin__guides{
  position:absolute;
  inset:0;
  pointer-events:none;
}
.theremin__guide{
  position:absolute;
  top:0;
  bottom:0;
  width:1px;
  background:rgba(0,0,0,.14);
}
.theremin__guide--center{background:rgba(0,0,0,.26)}
.theremin__dot{
  position:absolute;
  width:16px;
  height:16px;
  border-radius:999px;
  border:2px solid #000;
  background:rgba(255,255,255,.9);
  transform: translate(-50%, -50%);
  left:50%;
  top:50%;
}
.theremin__readout{margin-top:8px; font-size:12px; opacity:.8}
.seq__rowlabel{font-size:12px;color:rgba(0,0,0,.65);letter-spacing:.18em;font-weight:900;white-space:nowrap}
.seq__rowlabel[data-drumkey]{cursor:pointer;user-select:none}
.seq__rowlabel[data-drumkey]:hover{color:rgba(0,0,0,.95);text-decoration:underline dotted}
.seq__row{display:grid;grid-template-columns: repeat(var(--seq-steps, 32), var(--seq-step-px, minmax(18px, 1fr)));gap:6px;min-width:0;overflow-x:auto}
.drums .seq__row{grid-template-columns: repeat(var(--seq-steps, 32), var(--drum-step-px, minmax(18px, 1fr)))}
.seq__row.is-muted{opacity:.38}
.seq__row.is-solo{outline:2px solid rgba(0,0,0,.18);outline-offset:3px;border-radius:10px}
.step{
  height:28px;
  border:1px solid rgba(0,0,0,.18);
  border-radius:8px;
  background:rgba(255,255,255,.92);
  cursor:pointer;
  position:relative;
  isolation:isolate;
  font-size:11px;
  font-weight:900;
  letter-spacing:.06em;
  display:flex;
  align-items:center;
  justify-content:center;
  user-select:none;
}

/* VOICE: sample length in steps (small badge) */
.step[data-track="voice"][data-vlen]::after{
  content: attr(data-vlen);
  position:absolute;
  right:5px;
  bottom:3px;
  font-size:9px;
  font-weight:900;
  letter-spacing:0;
  opacity:.62;
  pointer-events:none;
}
.step:hover{border-color:rgba(0,0,0,.32)}
.step.is-on{background:rgba(0,0,0,.06)}
.step.is-missing{
  border-color: rgba(160,0,0,.45);
  background: rgba(160,0,0,.06);
}
.step.is-hold{background:rgba(0,0,0,.03); opacity:.75}
.step.is-playing{outline:2px solid rgba(0,0,0,.65);outline-offset:1px}
.step.is-edit{box-shadow: inset 0 0 0 2px rgba(0,0,0,.28)}

/* Visual: first step of each 4-step group */
.step.is-barstart::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  background:rgba(0,0,0,.035);
  z-index:-1;
}

/* Synth drag & drop feedback */
.step.is-drop{outline:2px dashed rgba(0,0,0,.60);outline-offset:1px}
.step.is-dragging{opacity:.78}

/* --- TAKT (bar markers) row -------------------------------------------- */
.seq__row--markers{gap:6px}
.step--marker{
  height:14px;
  border-radius:4px;
  background:transparent;
  border:1px solid rgba(0,0,0,.15);
  cursor:pointer;
  transition:background .12s,border-color .12s;
}
.step--marker.is-barmarker{
  background:rgba(0,0,0,.13);
  border-color:rgba(0,0,0,.35);
}
.step--marker:hover{
  border-color:rgba(0,0,0,.38);
  background:rgba(0,0,0,.06);
}
.seq__rowlabel--takt{
  font-size:10px;
  color:rgba(0,0,0,.45);
  align-self:center;
}

/* --- Bass overlay ------------------------------------------------------- */
.bass{
  position:fixed;
  inset:0;
  z-index:6;
  display:none;
  background:transparent;
  pointer-events:none;
}
.bass.open{display:block}
.bass__panel{
  position:absolute;
  left:380px;
  top:86px;
  width:min(940px, calc(100vw - 420px));
  max-height: calc(100vh - 120px);
  overflow:auto;
  pointer-events:auto;
  border:1px solid rgba(0,0,0,.18);
  border-radius:14px;
  background:rgba(255,255,255,.98);
  padding:12px;
}
.bass__head{display:flex;align-items:center;justify-content:space-between;gap:10px; cursor:grab; user-select:none}
.bass__head:active{cursor:grabbing}
.bass.dragging{user-select:none}
.bass__title{font-weight:900;letter-spacing:.18em}
.bass__hint{margin-top:6px;font-size:12px;color:var(--muted)}
.bass__keys{margin-top:12px}

/* Piano DnD: on-drop MOVE/COPY chooser (cursor between buttons) */
.dndChoice{
  position:fixed;
  z-index:9999;
  display:flex;
  gap:10px;
  transform: translate(-50%, -50%);
  pointer-events:auto;
  padding:8px 10px;
  border-radius:12px;
  background: rgba(255,255,255,.92);
  border:1px solid rgba(0,0,0,.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}
.dndChoice__btn{min-width:70px}
.keyboard{position:relative;width:100%;max-width:840px;height:140px}
.white-keys{display:flex;height:140px}
.white-key{flex:1;border:1px solid rgba(0,0,0,.18);border-right:none;background:#fff;position:relative;cursor:pointer}
.white-key:last-child{border-right:1px solid rgba(0,0,0,.18)}
.white-key.active{background:rgba(0,0,0,.06)}
.black-keys{position:absolute;left:0;top:0;width:100%;height:140px;pointer-events:none}
.black-key{position:absolute;top:0;height:86px;background:#111;border:1px solid rgba(0,0,0,.4);border-radius:0 0 6px 6px;transform:translateX(-50%);pointer-events:auto;cursor:pointer}
.black-key.active{background:#333}
.label{position:absolute;bottom:10px;left:0;right:0;text-align:center;font-weight:900;letter-spacing:.08em;font-size:12px;color:#111}
.black-key .label{bottom:8px;color:#fff;font-size:11px}

/* keep it visually minimal */

/* Scrollbar (standard properties; mainly Firefox) */
*{scrollbar-width:thin; scrollbar-color: rgba(0,0,0,.14) transparent}
