/* BoomDog Lab — ModAud house style (see design/DESIGN_SPEC.md) */
:root {
  --bg: #101215; --panel: #191C21; --raised: #252A31; --stroke: #323840; --track: #30353D;
  --text: #ECEEF1; --muted: #8B929D; --dim: #5A616B;
  --acc: #FFB23F; --acc-ink: #1A1206;
  --ok: #5BD08A; --hot: #FF5A4E;
  --boom-ink: #1F0E02; --chuck-ink: #03141C;
  --r-card: 14px; --r-ctl: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);

  /* canvas tokens (read by app.js) */
  --bg-canvas: #0B0D10;
  --wave: #9AA3AF;
  --spec-lo: #0B0D10;
  --spec-hi: #C9D3E0;
  --strip: #14171B;
  --strip-win: #FFB23F;
  --boom: #FF8A3D;
  --chuck: #4FC3F7;
  --playhead: #ECEEF1;
  --sel: #FFFFFF;
  --grid: #1E2228;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font: 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
h1 { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: .1px; margin: 0 0 8px; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
button:disabled { opacity: .35; cursor: default; }
svg { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ---------- header ---------- */
.hdr {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: calc(var(--sat) + 8px) calc(var(--sar) + 16px) 8px calc(var(--sal) + 16px); min-height: calc(var(--sat) + 56px);
  background: linear-gradient(var(--panel), var(--bg));
  border-bottom: 1px solid rgba(50, 56, 64, .4);
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.logo em { font-style: normal; color: var(--acc); }
.mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--acc);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 0 12px rgba(255, 178, 63, .25);
}
.mark svg { width: 18px; height: 18px; }
.tag {
  font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--stroke); border-radius: 6px; padding: 1px 6px;
}
.who {
  margin-left: auto; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.who:not(:empty) { background: var(--raised); border: 1px solid var(--stroke); border-radius: 999px; padding: 4px 10px; }

/* ---------- banners ---------- */
.err {
  margin: 8px calc(var(--sar) + 16px) 0 calc(var(--sal) + 16px); padding: 10px 14px; border-radius: var(--r-ctl);
  background: rgba(255, 90, 78, .12); border: 1px solid rgba(255, 90, 78, .45); color: #FFC4BE; font-size: 14px; font-weight: 500;
}
.toast {
  position: fixed; left: 50%; top: calc(var(--sat) + 64px); z-index: 50; transform: translate(-50%, -12px);
  max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px;
  background: var(--raised); border: 1px solid var(--stroke); color: var(--text); font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- screens ---------- */
main {
  flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 1100px; margin: 0 auto;
  padding: 16px calc(var(--sar) + 16px) calc(var(--sab) + 16px) calc(var(--sal) + 16px);
}
.screen { flex: 1; display: flex; flex-direction: column; animation: in .22s ease-out; }
.narrow { width: 100%; max-width: 520px; margin: 0 auto; }
.center { align-items: center; justify-content: center; text-align: center; gap: 14px; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.hint { color: var(--muted); font-size: 13px; text-align: center; }
.gt {
  display: flex; align-items: center; height: 24px; margin: 28px 0 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted);
}
.gt::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); opacity: .85; margin-right: 7px; }

/* ---------- buttons ---------- */
.btn {
  min-height: 48px; padding: 0 20px; border-radius: var(--r-card);
  background: var(--raised); border: 1px solid var(--stroke); color: var(--text); font-size: 16px; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 2px 3px rgba(0, 0, 0, .4);
}
.btn.block { width: 100%; }
.btn.primary {
  background: linear-gradient(#FFBC55, var(--acc)); border-color: var(--acc); color: var(--acc-ink); font-weight: 700; font-size: 17px;
  box-shadow: 0 0 0 1.5px rgba(255, 178, 63, .22), 0 0 16px rgba(255, 178, 63, .25), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn.primary:disabled { background: var(--raised); border-color: var(--stroke); color: var(--muted); box-shadow: none; opacity: 1; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn.danger { background: rgba(255, 90, 78, .1); border-color: rgba(255, 90, 78, .4); color: var(--hot); box-shadow: none; }
.btn:active:not(:disabled), .tool:active:not(:disabled), .tgl:active, .icon-btn:active { transform: scale(.97); }

.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: var(--r-ctl); display: flex; align-items: center; justify-content: center;
  background: var(--raised); border: 1px solid var(--stroke); color: var(--text); padding: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.icon-btn svg, .tool svg, .filelink svg, .zoom svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- gate ---------- */
.gate-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--panel); border: 1px solid var(--stroke); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.gate-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
#s-gate h1 { font-size: 19px; font-weight: 600; }

/* ---------- consent ---------- */
#s-consent { gap: 18px; justify-content: center; }
.lead { color: var(--muted); font-size: 16px; margin-top: -10px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.leg {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center;
  padding: 12px 14px; border-radius: var(--r-card); background: var(--panel); border: 1px solid var(--stroke);
}
.leg i { grid-row: span 2; width: 14px; height: 14px; border-radius: 50%; }
.leg b { font-size: 16px; }
.leg span { font-size: 12px; color: var(--muted); }
.leg.boom i { background: var(--boom); box-shadow: 0 0 10px var(--boom); }
.leg.boom b { color: var(--boom); }
.leg.chuck i { background: var(--chuck); box-shadow: 0 0 10px var(--chuck); }
.leg.chuck b { color: var(--chuck); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps .n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--raised); border: 1px solid var(--stroke); color: var(--text); font-size: 12px; }
.check {
  position: relative; display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 14px; border-radius: var(--r-card); background: var(--panel); border: 1px solid var(--stroke);
  font-size: 14px; line-height: 1.45; color: #C7CCD3;
}
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box {
  flex: none; width: 26px; height: 26px; border-radius: 8px; margin-top: -2px;
  background: var(--raised); border: 1.5px solid var(--dim); position: relative; transition: background .12s, border-color .12s;
}
.check input:checked + .box { background: var(--acc); border-color: var(--acc); box-shadow: 0 0 12px rgba(255, 178, 63, .35); }
.check input:checked + .box::after {
  content: ""; position: absolute; left: 8px; top: 3px; width: 6px; height: 12px;
  border: solid var(--acc-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.check input:focus-visible + .box { outline: 2px solid var(--acc); outline-offset: 2px; }
.check:has(input:checked) { border-color: rgba(255, 178, 63, .45); }

/* ---------- home ---------- */
.hero-rec {
  display: flex; align-items: center; gap: 18px; width: 100%; min-height: 112px; padding: 20px 22px; margin-top: 8px;
  border-radius: 20px; text-align: left; color: var(--text);
  background: linear-gradient(160deg, #22262D, var(--panel)); border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 6px 20px rgba(0, 0, 0, .35);
}
.hero-dot {
  flex: none; width: 68px; height: 68px; border-radius: 50%; position: relative;
  background: var(--bg); box-shadow: 0 0 0 3px var(--hot), 0 0 22px rgba(255, 90, 78, .35);
}
.hero-dot::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #FF7A70, var(--hot)); }
.hero-txt { display: flex; flex-direction: column; }
.hero-txt b { font-size: 24px; line-height: 1.15; }
.hero-txt small { font-size: 14px; color: var(--muted); }
.hero-rec:active { transform: scale(.985); }

.filelink {
  align-self: center; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; margin-top: 6px;
  color: var(--muted); font-size: 15px; font-weight: 600; border-radius: var(--r-ctl); cursor: pointer;
}
.filelink svg { width: 18px; height: 18px; }
.filelink input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.filelink:has(input:focus-visible) { outline: 2px solid var(--acc); outline-offset: 2px; }

.takes { display: flex; flex-direction: column; gap: 8px; }
.take {
  display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  padding: 10px 10px 10px 14px; border-radius: var(--r-card); background: var(--panel); border: 1px solid var(--stroke);
  background-image: linear-gradient(rgba(255, 255, 255, .02), transparent);
}
.take .title { grid-column: 1; grid-row: 1; font-weight: 600; font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.take .sub { grid-column: 1; grid-row: 2; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.take .open, .take .del { grid-row: 1 / span 2; height: 44px; border-radius: var(--r-ctl); font-size: 15px; font-weight: 600; }
.take .open { grid-column: 2; padding: 0 18px; background: var(--acc); border: 1px solid var(--acc); color: var(--acc-ink); }
.take .del { grid-column: 3; min-width: 44px; padding: 0 10px; background: transparent; border: 1px solid transparent; color: var(--dim); }
.take .del:active { color: var(--hot); border-color: rgba(255, 90, 78, .4); }
.empty { color: var(--dim); font-size: 14px; text-align: center; padding: 22px 0; border: 1px dashed var(--stroke); border-radius: var(--r-card); }

/* ---------- record ---------- */
.rec-screen { gap: 16px; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { position: relative; display: block; }
.chip-select { grid-column: 1 / -1; }
.chip input, .chip select {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 999px; font-size: 16px; font-weight: 500;
  background: var(--raised); border: 1px solid var(--stroke); color: var(--text); outline: none;
  -webkit-appearance: none; appearance: none;
}
.chip input::placeholder { color: var(--dim); }
.chip input:focus, .chip select:focus { border-color: var(--acc); }
.chip select { padding-right: 36px; text-align: center; text-align-last: center; }
.chip-select::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -6px; pointer-events: none;
  border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.rec-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 12px 0; }
.rec-time { font-size: 48px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 1px; line-height: 1; color: var(--muted); transition: color .2s; }
.meter { width: 260px; max-width: 100%; height: 8px; border-radius: 4px; background: var(--track); overflow: hidden; }
#meter-fill {
  height: 100%; width: 0; border-radius: 4px; transition: width 60ms linear;
  background: linear-gradient(90deg, var(--ok) 0, var(--ok) 65%, var(--acc) 85%, var(--hot) 100%); background-size: 260px 100%;
}
.rec-btn {
  position: relative; width: 136px; height: 136px; border-radius: 50%; padding: 0;
  background: var(--bg); border: 4px solid var(--raised);
  box-shadow: 0 0 0 1px var(--stroke), 0 10px 30px rgba(0, 0, 0, .5);
}
.rec-btn::before {
  content: ""; position: absolute; inset: 14px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #FF7A70, var(--hot));
  box-shadow: 0 0 24px rgba(255, 90, 78, .45);
  transition: inset .2s ease, border-radius .2s ease;
}
.rec-btn::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid var(--hot); opacity: 0; }
.rec-btn.live { border-color: rgba(255, 90, 78, .35); }
.rec-btn.live::before { inset: 40px; border-radius: 12px; }
.rec-btn.live::after { animation: ring 1.4s ease-out infinite; }
@keyframes ring { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.28); } }
.rec-cue { font-size: 13px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.rec-cue .busy { display: none; color: var(--hot); }
.rec-btn.live + .rec-cue .idle { display: none; }
.rec-btn.live + .rec-cue .busy { display: inline; }
.rec-stage:has(.rec-btn.live) .rec-time { color: var(--text); }
.rec-screen:has(.rec-btn.live) .chips { opacity: .4; pointer-events: none; }
#rec-cancel { align-self: center; }

/* ---------- edit ---------- */
.edit { gap: 10px; min-height: 0; }
/* app-like fixed layout while editing: canvas takes all spare height, toolbar sits under the thumb */
body:has(#s-edit:not([hidden])) { height: 100vh; height: 100dvh; overflow: hidden; }
body:has(#s-edit:not([hidden])) main { min-height: 0; padding-top: 10px; padding-bottom: calc(var(--sab) + 10px); }

.ed-top { display: flex; align-items: center; gap: 8px; flex: none; }
.ed-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.counts { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.counts .b { color: var(--boom); } .counts .c { color: var(--chuck); }
.save-state { font-size: 11px; color: var(--muted); min-height: 14px; }
.btn.save { flex: none; min-height: 44px; padding: 0 18px; border-radius: var(--r-ctl); font-size: 16px; }

.more { position: relative; flex: none; }
.more summary { list-style: none; cursor: pointer; }
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { border-color: var(--acc); color: var(--acc); }
.more-panel {
  position: absolute; right: 0; top: 52px; z-index: 20; width: min(320px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: var(--r-card);
  background: var(--panel); border: 1px solid var(--stroke); box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.field input {
  height: 44px; padding: 0 12px; border-radius: var(--r-ctl); font-size: 16px;
  background: var(--bg); border: 1px solid var(--stroke); color: var(--text); outline: none;
}
.field input:focus { border-color: var(--acc); }

.view {
  position: relative; flex: 0 0 auto; height: clamp(210px, 36vh, 300px); border-radius: var(--r-card); overflow: hidden;
  background: var(--bg-canvas); border: 1px solid var(--stroke);
  box-shadow: inset 0 10px 14px -10px rgba(0, 0, 0, .6);
  touch-action: none;
}
#cv { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* without :has() (old browsers) the page scrolls and the canvas keeps a fixed height */
@supports not selector(:has(a)) { .view { flex: none; height: 52vh; min-height: 280px; } }

.ed-info { flex: none; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 44px; }
.pos { color: var(--text); font-weight: 600; min-width: 70px; }
.sel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sel.boom { color: var(--boom); } .sel.chuck { color: var(--chuck); }
.zoom { flex: 0 1 160px; display: flex; align-items: center; gap: 6px; color: var(--muted); min-width: 96px; }
.zoom svg { flex: none; width: 18px; height: 18px; }
.ed-hint { flex: none; margin-top: -6px; font-size: 12px; color: var(--dim); }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--track); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--track); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #3A4049, #1F2329); border: 2px solid var(--acc); box-shadow: 0 2px 4px rgba(0, 0, 0, .6);
}
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #2A2F36; border: 2px solid var(--acc); }

/* bottom dock */
.dock {
  margin-top: 12px; flex: none; display: flex; flex-direction: column; gap: 8px; padding: 8px;
  border-radius: 18px; background: var(--panel); border: 1px solid var(--stroke);
  background-image: linear-gradient(rgba(255, 255, 255, .025), transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 -6px 20px rgba(0, 0, 0, .25);
}
.marks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tool {
  height: 56px; min-width: 0; padding: 0 2px; border-radius: var(--r-ctl);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: var(--raised); border: 1px solid var(--stroke); color: var(--text);
  font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 2px 3px rgba(0, 0, 0, .35);
}
.tool svg { width: 22px; height: 22px; }
.tool.boom { background: rgba(255, 138, 61, .14); border-color: rgba(255, 138, 61, .5); color: var(--boom); }
.tool.chuck { background: rgba(79, 195, 247, .13); border-color: rgba(79, 195, 247, .5); color: var(--chuck); }
.tool.boom svg, .tool.chuck svg { stroke-width: 2.6; }
.tool.flip .fa { stroke: var(--boom); } .tool.flip .fb { stroke: var(--chuck); }

.transport { display: grid; grid-template-columns: 1fr 1fr 1.3fr .8fr; gap: 6px; }
.transport > :nth-child(3) { order: 0; }
.tgl.seg { color: var(--text); }
.tgl.seg.drums { color: var(--boom); border-color: rgba(255, 138, 61, .5); }
.tgl.seg.both { color: var(--chuck); border-color: rgba(79, 195, 247, .5); }
.tgl {
  height: 56px; border-radius: var(--r-ctl); display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--raised); border: 1px solid var(--stroke); color: var(--muted); font-size: 14px; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 2px 3px rgba(0, 0, 0, .35);
}
.tgl .led { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.tgl.on {
  background: linear-gradient(#FFBC55, var(--acc)); border-color: var(--acc); color: var(--acc-ink);
  box-shadow: 0 0 0 1.5px rgba(255, 178, 63, .22), 0 0 14px rgba(255, 178, 63, .3);
}
.tgl.on .led { background: var(--acc-ink); }
.play {
  height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; padding: 0;
  background: var(--text); border: 1px solid var(--text); color: var(--bg);
  box-shadow: 0 0 18px rgba(236, 238, 241, .15), inset 0 -2px 0 rgba(0, 0, 0, .12);
}
.play svg { width: 30px; height: 30px; fill: currentColor; }
.play .i-pause { display: none; }
.play.playing .i-play { display: none; }
.play.playing .i-pause { display: block; }

/* ---------- desktop / wide ---------- */
@media (min-width: 760px) {
  main { padding-left: calc(var(--sal) + 24px); padding-right: calc(var(--sar) + 24px); }
  h1 { font-size: 28px; }
  .hero-rec { min-height: 128px; }
  .view { height: clamp(240px, 40vh, 340px); }
  .ed-hint { font-size: 12px; }
  .dock { flex-direction: row; align-items: center; gap: 12px; padding: 8px 10px; }
  .transport { flex: 0 0 auto; grid-template-columns: 92px 92px 120px 64px; order: -1; }
  .marks { flex: 1; grid-template-columns: repeat(5, minmax(0, 104px)); justify-content: end; }
  .tool { flex-direction: row; gap: 7px; height: 48px; font-size: 12px; }
  .tool svg { width: 18px; height: 18px; }
  .tgl, .play { height: 48px; }
  .play svg { width: 26px; height: 26px; }
}
@media (hover: hover) {
  .btn:hover:not(:disabled), .tool:hover:not(:disabled), .tgl:hover, .icon-btn:hover { filter: brightness(1.12); }
  .take .del:hover { color: var(--hot); }
  .filelink:hover { color: var(--text); }
}
/* very short landscape phones: keep the canvas usable */
@media (max-height: 500px) and (orientation: landscape) {
  .ed-hint { display: none; }
  .view { height: clamp(150px, 48vh, 220px); }
  .rec-time { font-size: 32px; }
  .rec-btn { width: 96px; height: 96px; }
  .rec-btn.live::before { inset: 28px; }
}

/* phones: keep the dock at the bottom, under the thumb */
@media (max-width: 759px) and (pointer: coarse) { .dock { margin-top: auto; } }

/* tap mode: two big pads replace the mark tools */
.pads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pad {
  height: 88px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 20px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; touch-action: none;
  -webkit-user-select: none; user-select: none; transition: transform .05s, filter .05s;
}
.pad small { font-size: 11px; font-weight: 700; opacity: .6; }
.pad.boom { background: rgba(255, 138, 61, .16); border: 1.5px solid var(--boom); color: var(--boom); }
.pad.chuck { background: rgba(79, 195, 247, .14); border: 1.5px solid var(--chuck); color: var(--chuck); }
.pad.hit { transform: scale(.96); filter: brightness(1.6); }
.tapbtn.on { background: linear-gradient(#FF7468, var(--hot)); border-color: var(--hot); color: #fff; box-shadow: 0 0 14px rgba(255, 90, 78, .35); }
.tapbtn.on .led { background: #fff; }
.more-panel .tgl { height: 44px; }
@media (min-width: 760px) { .pads { flex: 1; } .pad { height: 48px; flex-direction: row; gap: 10px; font-size: 15px; } }

/* keyboard hints (hidden on touch-only devices) */
kbd {
  display: inline-block; min-width: 18px; padding: 1px 5px; margin-left: 6px; border-radius: 5px; vertical-align: middle;
  font: 600 10px/1.5 ui-monospace, Menlo, monospace; text-align: center; letter-spacing: 0; text-transform: none;
  color: var(--muted); background: rgba(255, 255, 255, .06); border: 1px solid var(--stroke); border-bottom-width: 2px;
}
.tgl.on kbd, .btn.primary kbd { color: inherit; background: rgba(0, 0, 0, .12); border-color: rgba(0, 0, 0, .2); }
.play kbd { position: absolute; bottom: 4px; right: 6px; margin: 0; }
.play { position: relative; }
.tool kbd { margin: 0; font-size: 9px; padding: 0 4px; }
.keys-btn { width: 32px; height: 32px; font-weight: 700; color: var(--muted); }
.keys { max-width: min(760px, calc(100vw - 32px)); width: 100%; border: 1px solid var(--stroke); border-radius: var(--r-card); background: var(--panel); color: var(--text); padding: 20px; }
.keys::backdrop { background: rgba(0, 0, 0, .55); }
.keys h2 { margin: 0 0 12px; font-size: 18px; }
.keys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 24px; margin-bottom: 16px; }
.keys h3 { margin: 0 0 6px; font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.keys p { display: flex; align-items: center; gap: 6px; margin: 4px 0; font-size: 14px; }
.keys p kbd { margin: 0; }
.keys p kbd:last-of-type { margin-right: 8px; }
@media (hover: none) and (pointer: coarse) { kbd, .keys-btn { display: none !important; } }

/* people (admin) */
.invite-row, .invite-out { display: flex; gap: 8px; margin-bottom: 8px; }
.invite-row input, .invite-out input { flex: 1; min-width: 0; height: 48px; padding: 0 12px; border-radius: var(--r-ctl); background: var(--panel); border: 1px solid var(--stroke); color: var(--text); font-size: 16px; }
.invite-out input { font: 13px ui-monospace, Menlo, monospace; color: var(--acc); }
.invite-hint { text-align: left; margin-bottom: 10px; }
.take.off .title, .take.off .sub { opacity: .45; }
.take .switch { min-width: 64px; }

.rec-prompt { text-align: center; font-size: 18px; font-weight: 600; color: var(--muted); margin: 8px 0 4px; }
.rec-prompt .b { color: var(--boom); } .rec-prompt .c { color: var(--chuck); }
.mic-pick { display: flex; align-items: center; gap: 8px; align-self: center; max-width: 100%; margin: 6px auto 0; padding: 0 12px; height: 40px;
  border-radius: 999px; background: var(--panel); border: 1px solid var(--stroke); color: var(--muted); }
.mic-pick svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mic-pick select { background: transparent; border: 0; color: var(--text); font-size: 15px; max-width: 260px; text-overflow: ellipsis; outline: none; }
.rec-taps { text-align: center; font-size: 13px; color: var(--muted); min-height: 22px; margin: 6px 0; }
.rec-taps .counts { font-weight: 700; font-size: 15px; } .rec-taps .counts .b { color: var(--boom); } .rec-taps .counts .c { color: var(--chuck); }
.rec-taps.flash-b .counts .b, .rec-taps.flash-c .counts .c { filter: brightness(1.8); }
@media (hover: none) and (pointer: coarse) { .kb-only { display: none; } }

/* tempo + count-in */
.tempo { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 6px; flex-wrap: wrap; }
.bpm-box { display: flex; align-items: baseline; gap: 6px; height: 44px; padding: 0 12px; border-radius: var(--r-ctl); background: var(--panel); border: 1px solid var(--stroke); }
.bpm-box input { width: 64px; background: transparent; border: 0; color: var(--text); font: 700 24px/44px var(--font); text-align: center; outline: none; -moz-appearance: textfield; }
.bpm-box input::-webkit-inner-spin-button, .bpm-box input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bpm-box span { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--muted); }
.tempo .icon-btn { font-size: 22px; font-weight: 700; }
.tap-tempo { min-height: 44px; }
.tap-tempo.hit { filter: brightness(1.5); }
.click-opt { align-self: center; height: 36px; padding: 0 14px; margin-bottom: 4px; font-size: 13px; }
.rec-time.counting { color: var(--acc); font-size: 72px; }
.rec-cue .count { display: none; }
.rec-screen.counting .rec-cue .busy { display: none; } .rec-screen.counting .rec-cue .count { display: inline; }

/* record screen while recording: controls give way to the boom / chuck pads */
.rec-pads { display: none; width: 100%; margin: 10px 0 4px; }
.rec-screen.live .rec-pads { display: grid; }
.rec-screen.live .tempo, .rec-screen.live .mic-pick, .rec-screen.live .click-opt, .rec-screen.live > .hint, .rec-screen.live .kb-only { display: none; }
.rec-pads .pad { height: 104px; font-size: 22px; touch-action: none; -webkit-touch-callout: none; }
@media (min-width: 760px) { .rec-pads .pad { height: 72px; flex-direction: column; } }
