/* drums.css — ManyHand Online Drums: a dark console on the cream site page. */

:root{
  --cream:#faf5ec; --paper:#fffdf8; --ink:#221a12; --inksoft:#6f6152;
  --brand:#0e386d; --brand2:#0b7d74; --line:#e8ddc9;

  --bg:#0b0d12; --panel:#11141b; --panel2:#171b24; --panel3:#1e2330;
  --edge:#252b37; --edge2:#323a4a; --edge3:#465066;
  --text:#e8ecf3; --dim:#8b94a7; --faint:#5d6679;
  --amber:#ffb02e; --amber2:#ffcb6b; --red:#ff4f4f; --green:#3ddc97;
  --c-kick:#ff6b4a; --c-snare:#ffb02e; --c-hat:#4fd1c5; --c-perc:#b38cff; --c-tom:#5aa9ff; --c-cym:#f3d36b;
  --mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --r:14px;
}

*{ box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
html,body{ height:100%; }
body{ font-family:"Hanken Grotesk",system-ui,-apple-system,sans-serif; background:var(--cream); color:var(--ink);
  line-height:1.5; display:flex; flex-direction:column; min-height:100%; }
button,select,input{ font:inherit; color:inherit; }
button{ cursor:pointer; }
svg{ display:block; }

header.site{ display:flex; align-items:center; justify-content:space-between; padding:12px 18px;
  border-bottom:1.5px solid var(--line); background:var(--paper); }
header.site .brand{ font-family:"Fraunces",Georgia,serif; font-weight:900; font-size:20px; letter-spacing:-.02em;
  color:var(--brand); text-decoration:none; display:flex; align-items:center; gap:8px; }
header.site .brand img{ width:24px; height:24px; }
header.site .brand span{ color:var(--brand2); }
header.site .back{ font-size:13px; font-weight:700; color:var(--brand); text-decoration:none; }

main{ width:100%; max-width:1240px; margin:0 auto; padding:16px 14px calc(36px + env(safe-area-inset-bottom)); }
h1.title{ font-family:"Fraunces",Georgia,serif; font-weight:900; font-size:30px; letter-spacing:-.02em; text-align:center; margin:2px 0 0; }
.sub{ text-align:center; color:var(--inksoft); font-size:15px; margin:2px auto 14px; max-width:640px; }

/* ===================================================================== */
/* The console                                                            */
/* ===================================================================== */
.console{ position:relative; background:var(--bg); color:var(--text); border-radius:22px; padding:10px;
  box-shadow:0 30px 60px -36px rgba(10,12,18,.75), 0 0 0 1px #000 inset; isolation:isolate; }
.console .lbl{ font-size:10.5px; font-weight:800; letter-spacing:.13em; text-transform:uppercase; color:var(--faint); }
.console .sp{ flex:1 1 auto; }
.console select{ appearance:none; -webkit-appearance:none; background:var(--panel2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b94a7' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border:1px solid var(--edge2); border-radius:10px; padding:7px 28px 7px 11px; font-size:13.5px; font-weight:700; color:var(--text); cursor:pointer; }
.console select:focus-visible, .console button:focus-visible, .console input:focus-visible{ outline:2px solid var(--amber); outline-offset:2px; }

/* top bar */
.topbar{ display:flex; align-items:center; gap:8px; padding:2px 2px 10px; flex-wrap:wrap; }
.kitpick{ display:flex; align-items:center; gap:8px; }
.kitpick select{ font-size:15px; font-weight:800; padding:8px 32px 8px 12px; min-width:128px; }
.seg{ display:inline-flex; background:var(--panel); border:1px solid var(--edge); border-radius:11px; padding:3px; gap:2px; }
.seg button{ border:0; background:transparent; color:var(--dim); font-size:13px; font-weight:800; padding:6px 12px; border-radius:8px; white-space:nowrap; }
.seg button[aria-selected="true"], .seg button[aria-checked="true"], .seg button[aria-pressed="true"]{ background:var(--panel3); color:var(--text); box-shadow:0 1px 0 rgba(255,255,255,.06) inset, 0 2px 6px -2px #000; }
.seg.sm button{ padding:4px 10px; }
.tbtn{ display:inline-flex; align-items:center; gap:7px; border:1px solid var(--edge2); background:var(--panel2); border-radius:11px;
  padding:7px 12px; font-size:13.5px; font-weight:800; color:var(--text); }
.tbtn svg{ width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.tbtn svg .k{ fill:currentColor; stroke:none; }
.tbtn:hover{ border-color:var(--edge3); background:var(--panel3); }
.tbtn.icon span{ display:none; }
.tbtn[aria-pressed="true"]{ border-color:var(--green); color:var(--green); }
@media (min-width:900px){ .tbtn.icon span{ display:inline; } #setBtn span, #fullBtn span{ display:none; } }
.loadbar{ position:relative; display:inline-flex; align-items:center; height:24px; min-width:150px; border-radius:12px; overflow:hidden;
  background:var(--panel); border:1px solid var(--edge); font-size:11.5px; font-weight:700; color:var(--dim); padding:0 10px; }
.loadbar .fill{ position:absolute; left:0; top:0; bottom:0; width:0; background:linear-gradient(90deg, rgba(255,176,46,.18), rgba(255,176,46,.32)); transition:width .2s; }
.loadbar .txt{ position:relative; }
.loadbar[hidden]{ display:none; }

/* stage */
.stage{ position:relative; border-radius:16px; overflow:hidden; background:#07080b; border:1px solid var(--edge);
  height:clamp(300px, 54vh, 600px); }
.kit3d{ position:absolute; inset:0; touch-action:none; user-select:none; -webkit-user-select:none; }
.kit3d canvas{ position:absolute; inset:0; width:100%; height:100%; display:block; outline:none; }
.kit3d[hidden], .pads[hidden]{ display:none; }
.labels{ position:absolute; inset:0; pointer-events:none; }
.labels span{ position:absolute; transform:translate(-50%,-50%); font:700 11px/1 var(--mono); color:#fff; background:rgba(8,10,14,.62);
  border:1px solid rgba(255,255,255,.18); padding:3px 5px; border-radius:6px; letter-spacing:.02em; white-space:nowrap; transition:opacity .2s; }
.labels.off span{ opacity:0; }
.stage-hint{ position:absolute; left:50%; bottom:12px; transform:translateX(-50%); font-size:12.5px; font-weight:700; color:rgba(255,255,255,.72);
  background:rgba(8,10,14,.55); padding:6px 12px; border-radius:20px; pointer-events:none; transition:opacity .6s; white-space:nowrap; }
.stage-hint.gone{ opacity:0; }
.camsel{ position:absolute; right:10px; top:10px; display:flex; gap:4px; background:rgba(8,10,14,.5); padding:3px; border-radius:10px; backdrop-filter:blur(6px); }
.camsel button{ border:0; background:transparent; color:rgba(255,255,255,.66); font-size:11.5px; font-weight:800; padding:5px 9px; border-radius:7px; }
.camsel button[aria-pressed="true"]{ background:rgba(255,255,255,.14); color:#fff; }
.kit3d .fallback{ position:absolute; inset:0; display:grid; place-items:center; text-align:center; color:var(--dim); font-size:14px; padding:20px; }

/* pads */
.pads{ position:absolute; inset:0; display:grid; grid-template-columns:repeat(4, 1fr); grid-template-rows:repeat(4, 1fr); gap:clamp(6px, 1.2vw, 12px);
  padding:clamp(8px, 1.6vw, 16px); background:radial-gradient(120% 90% at 50% 0%, #1a1f2a 0%, #0b0d12 70%); touch-action:none; user-select:none; -webkit-user-select:none; }
.pad{ --c:#888; position:relative; border-radius:12px; border:1px solid #2b3240; overflow:hidden; display:flex; flex-direction:column; justify-content:flex-end;
  padding:8px 10px; text-align:left; color:var(--text);
  background:linear-gradient(180deg, #232836 0%, #1a1e28 60%, #161a22 100%);
  box-shadow:0 1px 0 rgba(255,255,255,.07) inset, 0 -2px 0 rgba(0,0,0,.35) inset, 0 4px 10px -6px #000;
  transition:transform .06s ease, box-shadow .12s ease, background .12s ease; }
.pad::before{ content:""; position:absolute; left:10px; right:10px; top:8px; height:3px; border-radius:2px; background:var(--c); opacity:.55; box-shadow:0 0 8px var(--c); }
.pad .nm{ font-size:clamp(11px, 1.5vw, 14px); font-weight:800; letter-spacing:-.01em; line-height:1.15; }
.pad .ky{ position:absolute; right:8px; top:12px; font:700 10.5px/1 var(--mono); color:var(--faint); border:1px solid #2f3646; padding:2px 4px; border-radius:4px; }
.pad .vel{ position:absolute; left:0; bottom:0; height:3px; width:0; background:var(--c); opacity:.9; transition:width .1s; }
.pad.hit{ transform:scale(.97); background:radial-gradient(90% 90% at var(--hx,50%) var(--hy,50%), color-mix(in oklab, var(--c) 55%, #1a1e28) 0%, #1a1e28 75%);
  box-shadow:0 0 0 1px var(--c) inset, 0 0 22px -4px var(--c); transition:none; }
.pad.hit::before{ opacity:1; }
.pad.seq{ box-shadow:0 0 0 1px color-mix(in oklab, var(--c) 60%, transparent) inset, 0 0 14px -6px var(--c); }
.pad.loading{ opacity:.45; }

/* transport */
.transport{ display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; padding:10px 4px 8px; }
.transport .grp{ display:flex; align-items:center; gap:6px; }
.play{ width:52px; height:44px; border-radius:12px; border:0; display:grid; place-items:center;
  background:linear-gradient(180deg, #ffc455, #ff9f1a); color:#1a1205; box-shadow:0 1px 0 rgba(255,255,255,.5) inset, 0 6px 16px -8px #ff9f1a; }
.play svg{ width:22px; height:22px; fill:currentColor; }
.play .i-stop{ display:none; }
.playing .play .i-play{ display:none; }
.playing .play .i-stop{ display:block; }
.rec{ display:inline-flex; align-items:center; gap:7px; height:44px; padding:0 13px; border-radius:12px; border:1px solid var(--edge2);
  background:var(--panel2); font-size:13.5px; font-weight:800; color:var(--text); }
.rec .dot{ width:11px; height:11px; border-radius:50%; background:#7a2b2b; box-shadow:0 0 0 2px #2a1414 inset; }
.rec[aria-pressed="true"]{ border-color:var(--red); color:#fff; background:#3a1414; }
.rec[aria-pressed="true"] .dot{ background:var(--red); box-shadow:0 0 10px var(--red); animation:blink 1s steps(2) infinite; }
@keyframes blink{ 50%{ opacity:.35; } }
.mini{ display:inline-flex; align-items:center; justify-content:center; gap:5px; height:34px; min-width:34px; padding:0 11px; border-radius:10px;
  border:1px solid var(--edge2); background:var(--panel2); font-size:12.5px; font-weight:800; color:var(--text); white-space:nowrap; }
.mini:hover{ border-color:var(--edge3); background:var(--panel3); }
.mini svg{ width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.mini.icon{ padding:0; width:34px; }
.mini.tog[aria-pressed="true"]{ border-color:var(--amber); color:var(--amber); background:rgba(255,176,46,.09); }
.mini.accent{ background:linear-gradient(180deg, #2a3242, #1f2633); border-color:#4a5672; }
.mini:disabled{ opacity:.4; cursor:default; }
.mini.armed{ border-color:var(--amber); color:#1a1205; background:var(--amber); animation:pulse .5s ease-in-out infinite alternate; }
@keyframes pulse{ to{ background:var(--amber2); } }
.tempo .step{ width:30px; height:34px; border-radius:9px; border:1px solid var(--edge2); background:var(--panel2); font-size:17px; font-weight:800; line-height:1; color:var(--text); }
.tempo input{ width:62px; height:38px; text-align:center; border-radius:10px; border:1px solid var(--edge2); background:#07080b;
  font:700 19px/1 var(--mono); color:var(--amber); -moz-appearance:textfield; }
.tempo input::-webkit-outer-spin-button, .tempo input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.tempo .lbl{ font-size:13px; letter-spacing:0; text-transform:none; color:var(--dim); font-weight:700; }
.pat{ width:34px; height:34px; border-radius:9px; border:1px solid var(--edge2); background:var(--panel2); font:800 14px/1 var(--mono); color:var(--dim); position:relative; }
.pat[aria-pressed="true"]{ background:var(--panel3); color:var(--text); border-color:var(--edge3); box-shadow:0 0 0 1px var(--amber) inset; }
.pat.has::after{ content:""; position:absolute; right:4px; top:4px; width:5px; height:5px; border-radius:50%; background:var(--faint); }
.pat.playing{ color:var(--amber); }
.pat.playing::after{ background:var(--amber); box-shadow:0 0 6px var(--amber); }
.pat.queued{ animation:pulse2 .45s ease-in-out infinite alternate; }
@keyframes pulse2{ to{ border-color:var(--amber); } }

/* knobs */
.knob{ display:flex; flex-direction:column; align-items:center; gap:2px; width:52px; user-select:none; -webkit-user-select:none; touch-action:none; cursor:ns-resize; }
.knob svg{ width:40px; height:40px; overflow:visible; }
.knob .trk{ fill:none; stroke:#2a3141; stroke-width:4; stroke-linecap:round; }
.knob .val{ fill:none; stroke:var(--amber); stroke-width:4; stroke-linecap:round; }
.knob .cap{ fill:url(#knobCap); stroke:#05060a; stroke-width:1; }
.knob .ptr{ stroke:#fff; stroke-width:2.2; stroke-linecap:round; }
.knob .kl{ font-size:10px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; color:var(--faint); line-height:1.2; }
.knob .kv{ font:700 10.5px/1 var(--mono); color:var(--dim); height:11px; }
.knob:focus-visible{ outline:2px solid var(--amber); outline-offset:3px; border-radius:8px; }
.knob.drag .kv{ color:var(--amber); }

/* song chain */
.chain{ display:flex; align-items:center; gap:8px; padding:6px 6px 8px; flex-wrap:wrap; border-top:1px solid var(--edge); }
.chain[hidden]{ display:none; }
.chain-list{ display:flex; gap:4px; flex-wrap:wrap; min-height:28px; align-items:center; }
.chain-list button{ height:28px; min-width:28px; border-radius:7px; border:1px solid var(--edge2); background:var(--panel2); font:800 12.5px/1 var(--mono); color:var(--text); }
.chain-list button.now{ border-color:var(--amber); color:var(--amber); }
.chain-list button:hover{ border-color:var(--red); text-decoration:line-through; }
.chain-add{ display:flex; gap:3px; }
.chain-add button{ height:28px; padding:0 8px; border-radius:7px; border:1px dashed var(--edge3); background:transparent; font:700 12px/1 var(--mono); color:var(--dim); }

/* sequencer */
.seqbar{ display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; padding:8px 4px; border-top:1px solid var(--edge); }
.brush{ display:flex; align-items:center; gap:4px; }
.brush button{ height:30px; padding:0 10px; border-radius:8px; border:1px solid var(--edge2); background:var(--panel2); font-size:12px; font-weight:800; color:var(--dim); display:inline-flex; align-items:center; gap:6px; }
.brush button::before{ content:""; width:10px; height:10px; border-radius:3px; background:var(--amber); }
.brush .b-ghost::before{ opacity:.32; }
.brush .b-norm::before{ opacity:.72; }
.brush .b-acc::before{ box-shadow:0 0 6px var(--amber); }
.brush button[aria-checked="true"]{ color:var(--text); border-color:var(--amber); background:rgba(255,176,46,.08); }
.sigpick{ display:flex; gap:8px; }
.sigpick label{ display:flex; align-items:center; gap:6px; }
.sigpick select{ padding:5px 24px 5px 9px; font-size:12.5px; background-position:right 8px center; }
.barpages{ display:flex; gap:3px; }
.barpages[hidden]{ display:none; }
.barpages button{ height:28px; padding:0 9px; border-radius:7px; border:1px solid var(--edge2); background:var(--panel2); font:700 11.5px/1 var(--mono); color:var(--dim); }
.barpages button[aria-pressed="true"]{ color:var(--text); border-color:var(--edge3); background:var(--panel3); }
.barpages button.ph{ box-shadow:0 -2px 0 var(--amber) inset; }

.grid-wrap{ overflow-x:auto; padding:2px 2px 8px; -webkit-overflow-scrolling:touch; }
.grid{ --lw:118px; --cell:minmax(14px,1fr); display:flex; flex-direction:column; gap:3px; min-width:min-content; }
.grow{ --c:#888; display:grid; grid-template-columns:var(--lw) 1fr; gap:6px; align-items:center; }
.grow.hidden{ display:none; }
.rl{ display:flex; align-items:center; gap:4px; height:26px; min-width:0; border-radius:7px; padding:0 3px 0 0; }
.rl .nmb{ flex:1 1 auto; min-width:0; display:flex; align-items:center; gap:7px; height:26px; padding:0 6px; border:0; border-radius:7px; background:transparent;
  font-size:12.5px; font-weight:700; color:var(--dim); text-align:left; white-space:nowrap; overflow:hidden; }
.rl .nmb::before{ content:""; flex:none; width:8px; height:8px; border-radius:2px; background:var(--c); opacity:.85; }
.rl .nmb span{ overflow:hidden; text-overflow:ellipsis; }
.rl .nmb:hover{ color:var(--text); background:var(--panel2); }
.grow.sel .rl .nmb{ color:var(--text); background:var(--panel3); box-shadow:0 0 0 1px var(--edge3) inset; }
.rl .ms{ flex:none; width:20px; height:20px; border-radius:5px; border:1px solid var(--edge2); background:transparent; font:800 9.5px/1 var(--mono); color:var(--faint); padding:0; }
.rl .ms.on.m{ background:#5a2121; border-color:#a33; color:#fff; }
.rl .ms.on.s{ background:#5a4614; border-color:var(--amber); color:#fff; }
.grow.muted .cells{ opacity:.35; }
.grow.hit .rl .nmb::before{ box-shadow:0 0 8px 2px var(--c); opacity:1; }
.cells{ display:grid; gap:3px; }
.cell{ position:relative; height:26px; border-radius:5px; background:#1a1e28; border:0; padding:0; box-shadow:0 1px 0 rgba(255,255,255,.03) inset; touch-action:none; }
.cell.beat{ background:#202533; }
.cell.gs{ margin-left:5px; }                    /* start of a beat group */
.cell.bs{ margin-left:10px; }                   /* start of a bar */
.cell::after{ content:""; position:absolute; inset:3px; border-radius:3px; background:var(--c); opacity:0; transform:scale(.6); transition:opacity .08s, transform .08s; }
.cell.v1::after{ opacity:.3; transform:scale(.62); }
.cell.v2::after{ opacity:.55; transform:scale(.8); }
.cell.v3::after{ opacity:.85; transform:scale(.92); }
.cell.v4::after{ opacity:1; transform:scale(1); box-shadow:0 0 10px -1px var(--c); }
.cell.roll::before{ content:""; position:absolute; z-index:1; left:20%; right:20%; bottom:4px; height:3px;
  background:repeating-linear-gradient(90deg, #0b0d12 0 2px, transparent 2px 5px); }
.cell.chance::after{ background:repeating-linear-gradient(135deg, var(--c) 0 3px, transparent 3px 6px); }
.cell.nudge-l::after{ left:1px; right:5px; }
.cell.nudge-r::after{ left:5px; right:1px; }
.cell.ph{ box-shadow:0 0 0 1.5px rgba(255,255,255,.55) inset; background:#2a3142; }
.cell.ph.v1::after, .cell.ph.v2::after, .cell.ph.v3::after, .cell.ph.v4::after{ filter:brightness(1.35); }
.cell:focus-visible{ outline:2px solid var(--amber); outline-offset:1px; z-index:2; }
.ghead{ display:grid; grid-template-columns:var(--lw) 1fr; gap:6px; }
.ghead .cells .cell{ height:16px; background:transparent; box-shadow:none; font:700 9.5px/16px var(--mono); color:var(--faint); text-align:center; pointer-events:none; }
.ghead .cells .cell.beat{ color:var(--dim); }
.ghead .cells .cell.ph{ color:var(--amber); box-shadow:none; background:transparent; }
.ghead .rl{ height:16px; }

/* desk: selected track + master */
.desk{ display:grid; grid-template-columns:1fr; gap:10px; padding:8px 2px 2px; border-top:1px solid var(--edge); }
@media (min-width:860px){ .desk{ grid-template-columns:1.25fr 1fr; } }
.track, .master{ background:var(--panel); border:1px solid var(--edge); border-radius:12px; padding:10px 12px; }
.track-head{ display:flex; align-items:center; gap:8px; margin-bottom:6px; }
.track-head b{ font-size:14px; font-weight:800; }
.track-head select{ padding:5px 24px 5px 9px; font-size:12.5px; background-position:right 8px center; }
.dotc{ width:10px; height:10px; border-radius:3px; background:var(--c-kick); box-shadow:0 0 8px currentColor; }
.trk-key{ font:700 10.5px/1 var(--mono); color:var(--faint); border:1px solid var(--edge2); padding:2px 5px; border-radius:4px; }
.knobrow{ display:flex; flex-wrap:wrap; gap:6px 4px; justify-content:space-between; }
.track-tools{ display:flex; align-items:center; gap:5px; flex-wrap:wrap; margin-top:8px; }
.chip{ height:26px; padding:0 9px; border-radius:7px; border:1px solid var(--edge2); background:var(--panel2); font-size:11.5px; font-weight:800; color:var(--dim); }
.chip:hover{ color:var(--text); border-color:var(--edge3); }
.master{ position:relative; }
.meter{ position:absolute; right:12px; top:14px; display:flex; gap:2px; height:12px; align-items:flex-end; }
.meter span{ width:46px; height:4px; border-radius:2px; background:#1c212c; position:relative; overflow:hidden; }
.meter span::after{ content:""; position:absolute; inset:0; transform-origin:left; transform:scaleX(var(--lv,0)); background:linear-gradient(90deg, var(--green) 70%, var(--amber) 88%, var(--red)); }
.master .track-head{ padding-right:100px; }

.keyhint{ text-align:center; font-size:12.5px; color:var(--inksoft); margin:10px 0 0; }
.keyhint kbd, .guide kbd{ font:700 11px/1 var(--mono); background:#fff; border:1.5px solid var(--line); border-bottom-width:2.5px; border-radius:5px; padding:2px 5px; color:var(--ink); }

/* ===================================================================== */
/* Dialogs                                                                */
/* ===================================================================== */
.sheet{ position:fixed; inset:0; z-index:60; display:grid; place-items:center; background:rgba(5,6,10,.6); backdrop-filter:blur(3px); padding:16px; }
.sheet[hidden]{ display:none; }
.sheet-card{ width:min(460px, 100%); max-height:min(86vh, 760px); overflow:auto; background:var(--panel); color:var(--text); border:1px solid var(--edge2);
  border-radius:18px; padding:16px; box-shadow:0 30px 70px -20px #000; }
.sheet-card.wide{ width:min(860px, 100%); }
.sheet-head{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.sheet-head h2{ font-family:"Fraunces",Georgia,serif; font-size:21px; font-weight:800; margin-right:auto; }
.sheet .x{ width:32px; height:32px; border-radius:9px; border:1px solid var(--edge2); background:var(--panel2); color:var(--dim); font-size:14px; }
.sheet .lbl{ font-size:10.5px; font-weight:800; letter-spacing:.13em; text-transform:uppercase; color:var(--faint); }
.sheet select{ appearance:none; background:var(--panel2); border:1px solid var(--edge2); border-radius:9px; padding:6px 10px; font-size:13px; font-weight:700; color:var(--text); }
.sheet .seg{ background:var(--bg); }
.sheet-note{ font-size:12.5px; color:var(--dim); margin-top:12px; }
.lib-genres{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
.lib-genres button{ height:30px; padding:0 11px; border-radius:15px; border:1px solid var(--edge2); background:var(--panel2); font-size:12.5px; font-weight:800; color:var(--dim); }
.lib-genres button[aria-pressed="true"]{ border-color:var(--amber); color:var(--amber); }
.lib-list{ display:grid; grid-template-columns:repeat(auto-fill, minmax(190px, 1fr)); gap:8px; }
.lib-item{ position:relative; text-align:left; border:1px solid var(--edge); background:var(--panel2); border-radius:12px; padding:10px 12px 10px; color:var(--text); }
.lib-item:hover{ border-color:var(--edge3); background:var(--panel3); }
.lib-item b{ display:block; font-size:14px; font-weight:800; }
.lib-item span{ display:block; font-size:11.5px; color:var(--dim); margin-top:2px; font-family:var(--mono); }
.lib-item.on{ border-color:var(--amber); box-shadow:0 0 0 1px var(--amber) inset; }
.lib-item .mini-grid{ display:grid; grid-template-columns:repeat(16, 1fr); gap:1px; margin-top:8px; }
.lib-item .mini-grid i{ height:4px; border-radius:1px; background:#232937; }
.lib-item .mini-grid i.on{ background:var(--c); }
.lib-item .del{ position:absolute; right:6px; top:6px; width:24px; height:24px; border-radius:6px; border:1px solid var(--edge2); background:var(--panel); color:var(--dim); font-size:11px; }
.exp-row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:10px 0; }
.exp-row .lbl{ min-width:70px; }
.exp-btns{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:14px; }
.big{ text-align:left; border:1px solid var(--edge2); background:var(--panel2); border-radius:12px; padding:12px 14px; color:var(--text); }
.big b{ display:block; font-size:15px; font-weight:800; }
.big span{ display:block; font-size:12px; color:var(--dim); margin-top:2px; }
.big:hover{ border-color:var(--amber); }
.big:disabled{ opacity:.5; }
.check{ display:inline-flex; align-items:center; gap:8px; font-size:13.5px; font-weight:700; color:var(--text); cursor:pointer; }
.check.row{ display:flex; padding:9px 0; border-bottom:1px solid var(--edge); }
.check input{ accent-color:var(--amber); width:16px; height:16px; }

.menu{ position:fixed; z-index:65; min-width:200px; background:var(--panel2); border:1px solid var(--edge2); border-radius:12px; padding:5px; box-shadow:0 20px 40px -14px #000; }
.menu[hidden]{ display:none; }
.menu button{ display:block; width:100%; text-align:left; border:0; background:transparent; color:var(--text); font-size:13px; font-weight:700; padding:8px 10px; border-radius:8px; }
.menu button:hover, .menu button:focus-visible{ background:var(--panel3); outline:none; }

.pop{ position:fixed; z-index:66; width:250px; background:var(--panel2); color:var(--text); border:1px solid var(--edge3); border-radius:14px; padding:10px 12px 12px; box-shadow:0 24px 50px -16px #000; }
.pop[hidden]{ display:none; }
.pop-head{ display:flex; align-items:center; margin-bottom:6px; }
.pop-head b{ font-size:13px; margin-right:auto; }
.pop .x{ width:26px; height:26px; border-radius:7px; border:1px solid var(--edge2); background:var(--panel); color:var(--dim); font-size:11px; }
.pr{ display:grid; grid-template-columns:62px 1fr 38px; align-items:center; gap:8px; margin:7px 0; font-size:12px; font-weight:700; color:var(--dim); }
.pr input[type=range]{ width:100%; accent-color:var(--amber); }
.pr output{ font:700 11px/1 var(--mono); color:var(--text); text-align:right; }
.pr .seg{ grid-column:2 / 4; justify-self:start; background:var(--bg); }
.pop .chip{ margin-top:6px; }

.toast{ position:fixed; left:50%; bottom:calc(22px + env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:70; background:#151922; color:#fff;
  border:1px solid var(--edge3); padding:10px 16px; border-radius:12px; font-size:13.5px; font-weight:700; box-shadow:0 14px 30px -10px #000; max-width:calc(100% - 32px); }
.toast[hidden]{ display:none; }

/* ===================================================================== */
/* Full screen: the stage takes the window                                */
/* ===================================================================== */
html.drums-full, html.drums-full body{ overflow:hidden; }
.console.full{ position:fixed; inset:0; z-index:50; border-radius:0; padding:calc(6px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) calc(8px + env(safe-area-inset-left));
  display:flex; flex-direction:column; }
.console.full .stage{ flex:1 1 auto; height:auto; min-height:0; }
.console.full .chain, .console.full .seqbar, .console.full .grid-wrap, .console.full .desk{ display:none; }
.console.full .transport{ padding:6px 2px 0; }
.console.full .topbar{ padding-bottom:6px; }

/* ===================================================================== */
/* The guide below the console                                            */
/* ===================================================================== */
.guide{ max-width:820px; margin:28px auto 0; background:var(--paper); border:1.5px solid var(--line); border-radius:var(--r); padding:22px 22px 18px;
  box-shadow:0 8px 24px -18px rgba(34,26,18,.5); color:var(--ink); }
.guide h2{ font-family:"Fraunces",Georgia,serif; font-size:22px; font-weight:800; letter-spacing:-.01em; margin:0 0 8px; }
.guide h2:not(:first-child){ margin-top:24px; }
.guide h3{ font-size:16px; font-weight:800; margin:18px 0 6px; }
.guide p, .guide li{ color:var(--inksoft); font-size:14.5px; }
.guide p{ margin:0 0 8px; }
.guide ul, .guide ol{ padding-left:20px; margin:4px 0 8px; }
.guide li{ margin:3px 0; }
.guide b{ color:var(--ink); }
.guide table.keys{ border-collapse:collapse; width:100%; margin:8px 0 10px; font-size:14px; }
.guide table.keys th, .guide table.keys td{ text-align:left; padding:7px 8px; border-bottom:1px solid var(--line); color:var(--inksoft); }
.guide table.keys th{ font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--brand2); }
.guide details{ border-top:1.5px solid var(--line); padding:11px 0; }
.guide details:last-of-type{ border-bottom:1.5px solid var(--line); }
.guide summary{ cursor:pointer; font-weight:700; font-size:14.5px; }
.guide details p{ margin-top:6px; font-size:14px; }
.guide .more{ font-size:13.5px; margin-top:14px; }
.guide a{ color:var(--brand); font-weight:700; }

footer{ text-align:center; color:var(--inksoft); font-size:13px; padding:24px 16px 30px; margin-top:auto; }
footer a{ color:var(--brand); }

/* ===================================================================== */
/* Small screens                                                          */
/* ===================================================================== */
@media (max-width:720px){
  main{ padding:10px 8px calc(30px + env(safe-area-inset-bottom)); }
  h1.title{ font-size:24px; }
  .sub{ font-size:13.5px; margin-bottom:10px; }
  .console{ border-radius:16px; padding:7px; }
  .stage{ height:clamp(260px, 76vw, 520px); border-radius:12px; }
  .grid{ --lw:84px; }
  .rl .ms{ display:none; }                   /* the track panel has M and S */
  .rl .nmb{ font-size:11.5px; padding:0 4px; gap:5px; }
  .cell{ height:24px; border-radius:4px; }
  .cell.gs{ margin-left:3px; }
  .cell.bs{ margin-left:6px; }
  .cells{ gap:2px; }
  .transport{ gap:8px 10px; }
  .knob{ width:46px; }
  .knob svg{ width:36px; height:36px; }
  .keyhint{ display:none; }
  .guide{ padding:18px 16px 14px; }
}
@media (max-width:420px){
  .grid{ --lw:70px; }
  .rl .nmb::before{ display:none; }
  .tempo .step{ width:26px; }
  .pat{ width:31px; }
  .seqbar .lbl{ display:none; }
}
@media (prefers-reduced-motion:reduce){
  .rec[aria-pressed="true"] .dot, .mini.armed, .pat.queued{ animation:none; }
}

/* ===================================================================== */
/* Notation: a sheet of paper inside the console                         */
/* ===================================================================== */
.notation{ margin:4px 2px 10px; background:#fbf7ee; color:#1b1612; border-radius:12px; padding:12px 14px 10px; box-shadow:0 1px 0 rgba(255,255,255,.4) inset; }
.notation[hidden]{ display:none; }
.nt-head{ display:flex; align-items:baseline; gap:10px; margin-bottom:4px; }
.nt-head b{ font-family:"Fraunces",Georgia,serif; font-size:17px; font-weight:800; }
.nt-head span{ font:600 13px/1 "Hanken Grotesk",sans-serif; color:#5d5246; }
.nt-head .chip{ background:#fff; color:#2b241c; border-color:#d9cfbd; }
.nt-sheet svg{ display:block; overflow:visible; }
.nt .sl{ stroke:#2a241d; stroke-width:.9; }
.nt .bl{ stroke:#2a241d; stroke-width:1.2; }
.nt .blk{ stroke:#2a241d; stroke-width:3.4; }
.nt .ink{ fill:#17130f; }
.nt .ts{ font:900 19px/1 "Fraunces",Georgia,serif; fill:#17130f; text-anchor:middle; }
.nt .stem{ stroke:#17130f; stroke-width:1.3; }
.nt .beam{ stroke:#17130f; stroke-width:4.2; }
.nt .flag{ fill:none; stroke:#17130f; stroke-width:2; stroke-linecap:round; }
.nt .hx{ stroke:#17130f; stroke-width:1.9; stroke-linecap:round; fill:none; }
.nt .hc{ fill:none; stroke:#17130f; stroke-width:1.4; }
.nt .open{ fill:none; stroke:#17130f; stroke-width:1.3; }
.nt .acc{ fill:none; stroke:#17130f; stroke-width:1.5; stroke-linejoin:round; }
.nt .trem{ stroke:#17130f; stroke-width:2.4; }
.nt .gh{ font:400 13px/1 Georgia,serif; fill:#17130f; }
.nt .rest{ fill:#17130f; }
.nt .rstk{ fill:none; stroke:#17130f; stroke-width:1.5; stroke-linecap:round; }
.nt .ph{ fill:rgba(255,160,40,.22); }
.nt-legend{ display:flex; flex-wrap:wrap; gap:4px 14px; margin-top:6px; font-size:12px; color:#4c4237; font-weight:600; }
.nt-legend span{ display:inline-flex; align-items:center; gap:5px; }
.nt-legend svg .hx{ stroke:#17130f; stroke-width:1.9; fill:none; } .nt-legend svg .ink{ fill:#17130f; } .nt-legend svg .hc{ fill:none; stroke:#17130f; stroke-width:1.4; }

/* ===================================================================== */
/* Practice: an overlay along the bottom of the stage                     */
/* ===================================================================== */
.practice{ position:absolute; left:8px; right:8px; bottom:8px; z-index:3; background:rgba(9,11,16,.86); backdrop-filter:blur(8px);
  border:1px solid var(--edge2); border-radius:14px; padding:8px 10px 10px; }
.practice[hidden]{ display:none; }
.pr-top{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.pr-parts{ display:flex; gap:4px; flex-wrap:wrap; }
.pr-parts button{ height:28px; padding:0 10px; border-radius:14px; border:1px solid var(--edge2); background:var(--panel2); font-size:12px; font-weight:800; color:var(--dim); }
.pr-parts button[aria-pressed="true"]{ border-color:var(--green); color:var(--green); background:rgba(61,220,151,.1); }
.practice .x{ margin-left:auto; width:28px; height:28px; border-radius:8px; border:1px solid var(--edge2); background:var(--panel2); color:var(--dim); font-size:12px; }
.practice .check{ font-size:12px; color:var(--dim); }
.pr-main{ display:grid; grid-template-columns:minmax(120px,190px) 1fr; gap:6px 14px; align-items:center; margin-top:8px; }
.pr-verdict{ font:800 19px/1.15 "Hanken Grotesk",sans-serif; color:var(--text); grid-row:span 2; }
.pr-verdict.perfect{ color:var(--green); } .pr-verdict.good{ color:#9be37a; } .pr-verdict.early, .pr-verdict.late{ color:var(--amber); } .pr-verdict.miss{ color:var(--red); }
.pr-verdict small{ display:block; font:600 12px/1.3 var(--mono); color:var(--dim); margin-top:3px; }
.pr-meter{ position:relative; height:22px; border-radius:11px; background:linear-gradient(90deg, rgba(255,176,46,.16), rgba(61,220,151,.18) 40% 60%, rgba(255,176,46,.16)); overflow:hidden; }
.pr-meter .z{ position:absolute; left:50%; top:3px; bottom:3px; width:2px; background:rgba(255,255,255,.6); }
.pr-meter i{ position:absolute; top:4px; font:700 9px/1 var(--mono); color:var(--faint); text-transform:uppercase; letter-spacing:.08em; font-style:normal; }
.pr-meter i:first-of-type{ left:8px; } .pr-meter i:last-of-type{ right:8px; }
#prDots span{ position:absolute; top:6px; width:10px; height:10px; margin-left:-5px; border-radius:50%; background:#fff; transition:opacity 1.6s linear; }
.pr-stats{ display:flex; gap:14px; flex-wrap:wrap; align-items:center; font-size:11.5px; color:var(--dim); }
.pr-stats b{ font:700 14px/1 var(--mono); color:var(--text); }
@media (max-width:560px){
  .pr-main{ grid-template-columns:1fr; }
  .pr-verdict{ grid-row:auto; font-size:16px; }
  .practice .check{ display:none; }
}

/* ===================================================================== */
/* Print: the notation only                                              */
/* ===================================================================== */
@media print{
  body.print-notation > *:not(main), body.print-notation main > *:not(.console), body.print-notation .console > *:not(.notation){ display:none !important; }
  body.print-notation, body.print-notation main, body.print-notation .console{ background:#fff !important; box-shadow:none !important; padding:0 !important; margin:0 !important; }
  body.print-notation .notation{ display:block !important; box-shadow:none; background:#fff; }
  body.print-notation .nt-head .chip{ display:none; }
}
