:root {
  color-scheme: dark;
  --bg: #1A1A1A; --panel: #232226; --well: #141416; --line: #3A3644;
  --text: #F6F6F4; --muted: #BEADD6; --violet: #AB8CF0; --violet-mid: #574777; --violet-deep: #2D253A;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 14px/1.4 var(--f-text); padding: 10px 12px; -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
::selection { background: var(--violet-mid); color: var(--text); }
p { margin: 0; }

/* top line: help text and page tools */
.top { display: flex; gap: 10px; align-items: stretch; max-width: 1400px; margin: 0 auto 8px; }
.help { flex: 1; min-width: 0; height: 46px; padding: 6px 10px; font-size: 12px; line-height: 1.4; overflow: hidden;
  background: var(--violet-deep); border: 1px solid var(--violet-mid); border-radius: 8px; }
.help__key { color: var(--violet); font-weight: 600; white-space: nowrap; }
.top__tools { flex: none; display: flex; gap: 8px; align-items: center; }

.btn { font: 500 14px/1 var(--f-text); color: var(--text); background: transparent; border: 1px solid var(--line);
  border-radius: 8px; min-height: 40px; padding: 0 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  touch-action: manipulation; user-select: none; }
.btn[aria-pressed="true"] { background: var(--violet-deep); border-color: var(--violet); color: var(--violet); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn--main { background: var(--violet); border-color: var(--violet); color: #1A1A1A; font-weight: 600; }
.btn--small { min-height: 36px; min-width: 36px; padding: 0 10px; font-size: 13px; }
.btn:active:not(:disabled) { background: var(--violet-deep); }
.btn--main:active:not(:disabled) { background: var(--muted); }
@media (hover: hover) { .btn:not(:disabled):hover { border-color: var(--violet); } }
.link { justify-self: start; min-height: 24px; padding: 0; background: none; border: 0; color: var(--violet); font: inherit; font-size: 12px;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:disabled { opacity: 0.4; cursor: default; }

/* scrolling waveforms */
.waves { max-width: 1400px; margin: 0 auto 8px; display: grid; gap: 4px; }
.wave { position: relative; background: var(--well); border-radius: 8px; overflow: hidden; }
.wave canvas { display: block; width: 100%; height: 48px; }
.wave__tag { position: absolute; left: 8px; top: 4px; font-weight: 600; font-size: 12px; color: var(--muted); z-index: 1; }

/* the board: deck A, mixer, deck B */
.board { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 224px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.board > div { display: grid; min-width: 0; }
.deck, .mixer { background: var(--panel); border-radius: var(--radius); padding: 12px; min-width: 0; }
.deck { display: grid; gap: 8px; align-content: start; }
.deck.is-over { outline: 2px dashed var(--violet); outline-offset: -4px; }

.deck__head { display: flex; gap: 10px; align-items: center; min-width: 0; }
.deck__tag { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 600;
  background: var(--violet-deep); color: var(--violet); }
.deck__meta { flex: 1; min-width: 0; }
.deck__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck__sub { display: flex; gap: 10px; min-width: 0; font-size: 12px; color: var(--muted); }
.deck__time { flex: none; font-variant-numeric: tabular-nums; }
.deck__status, .deck__credit { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck__status:empty { display: none; }
.deck__status.is-error { color: #FFB4A8; }
.deck__credit a, dialog a { color: var(--violet); }
.deck__loadbtn { flex: none; min-height: 36px; padding: 0 12px; font-size: 13px; }
.chev { width: 7px; height: 7px; margin-left: 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.over { display: block; width: 100%; height: 36px; background: var(--well); border-radius: 6px; cursor: pointer; touch-action: none; }

.deck__body { display: grid; gap: 8px; }
.deck__mid { display: flex; gap: 14px; align-items: stretch; }
.deck--b .deck__mid { flex-direction: row-reverse; }
.deck__stack { flex: 1; min-width: 0; display: grid; gap: 6px; align-content: start; }
.deck__stack > .btn { justify-content: space-between; }
.bpm { display: flex; align-items: baseline; gap: 6px; }
.bpm__value { font: 600 30px/1 var(--f-text); font-variant-numeric: tabular-nums; }
.bpm__unit { color: var(--muted); font-size: 12px; }
.fx { display: flex; gap: 18px; padding-top: 2px; }

.row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.row__label { color: var(--muted); flex-basis: 100%; font-size: 12px; }
.transport { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; }
.round { width: 56px; height: 56px; min-height: 0; border-radius: 50%; padding: 0; font-weight: 600; flex-direction: column; gap: 3px; }
.pair { display: grid; grid-template-columns: auto auto; gap: 2px 6px; }
.pair .row__label { grid-column: 1 / -1; }
.pair .btn { flex-direction: column; gap: 3px; min-height: 42px; padding: 3px 8px; }
.transport { gap: 8px 10px; }
.transport .round { width: 52px; height: 52px; }
.spots { display: flex; gap: 8px; align-items: center; }
.spots .row__label { flex: none; flex-basis: auto; }
.pads { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pad { min-width: 0; font-weight: 600; }

.tempo { flex: none; display: grid; justify-items: center; align-content: start; gap: 3px; color: var(--muted); font-size: 12px; }
.tempo > span:first-child { font-size: 13px; color: var(--text); }
.tempo output { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text); min-width: 52px; text-align: center; }
input[type=range] { accent-color: var(--violet); margin: 0; }
input[type=range].v { writing-mode: vertical-lr; width: 28px; height: 132px; }
input[type=range].v.up { direction: rtl; }
.tempo input[type=range].v { height: 138px; }

/* knobs */
.knob-wrap { display: grid; justify-items: center; gap: 2px; }
.knob { width: 34px; height: 34px; border-radius: 50%; background: var(--well); border: 1px solid var(--line); position: relative;
  cursor: ns-resize; touch-action: none; user-select: none; transform: rotate(calc(var(--turn, 0) * 135deg)); }
.knob::after { content: ""; position: absolute; left: 50%; top: 4px; width: 2px; height: 10px; margin-left: -1px; border-radius: 1px; background: var(--violet); }
.knob-wrap span { font-size: 12px; text-align: center; line-height: 1.2; }

/* mixer: deck A on the left, the name of each control in the middle, deck B on the right */
.mixer { display: grid; align-content: space-between; gap: 10px; }
.mix { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 8px; align-items: center; justify-items: center; }
.strip { display: contents; }
#strip-a > * { grid-column: 1; }
#strip-b > * { grid-column: 3; }
.strip > :nth-child(1) { grid-row: 1; } .strip > :nth-child(2) { grid-row: 2; } .strip > :nth-child(3) { grid-row: 3; } .strip > :nth-child(4) { grid-row: 4; }
.strip > :nth-child(5) { grid-row: 5; } .strip > :nth-child(6) { grid-row: 6; } .strip > :nth-child(7) { grid-row: 7; } .strip > :nth-child(8) { grid-row: 8; }
.strip__name { font-weight: 600; font-size: 12px; color: var(--muted); }
.mix__label { grid-column: 2; text-align: center; font-size: 12px; line-height: 1.15; }
.mix__label small { display: block; font-size: 10px; color: var(--muted); }
.strip__pfl { min-width: 60px; padding: 0 8px; }
.strip__level { display: flex; gap: 5px; align-items: flex-start; justify-content: center; }
#strip-b .strip__level { flex-direction: row-reverse; }
.strip__vol { display: grid; justify-items: center; gap: 4px; }
.strip__vol input[type=range].v { height: 84px; }
.meter { position: relative; width: 8px; height: 84px; border-radius: 3px; overflow: hidden;
  background: linear-gradient(to top, var(--violet-mid) 0%, var(--violet) 70%, var(--violet) 88%, #FF8A78 90%); }
.meter i { position: absolute; inset: 0; background: var(--well); transform-origin: top; transform: scaleY(calc(1 - var(--lvl, 0))); }
.meter::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to top, transparent 0 5px, var(--panel) 5px 7px); }
.cross__label { text-align: center; font-size: 12px; }
.cross__label .key { color: var(--muted); margin-left: 2px; }
.cross { display: flex; align-items: center; gap: 8px; margin-top: -4px; color: var(--muted); font-weight: 600; }
.cross input { flex: 1; min-width: 0; height: 28px; }

/* key hints */
.key { font: 500 10px/1 var(--f-text); min-width: 16px; padding: 2px 4px; text-align: center; white-space: nowrap; border: 1px solid currentColor; border-radius: 4px; opacity: 0.7; }
.keys { display: flex; gap: 3px; color: var(--muted); }
.btn.is-key { border-color: var(--violet); background: var(--violet-deep); }
.btn--main.is-key { background: var(--text); border-color: var(--text); }
@media (hover: none) { .key, .keys { display: none; } }

/* platter */
.platter { flex: none; align-self: center; width: 132px; height: 132px; border-radius: 50%; padding: 4px; background: var(--well); border: 1px solid var(--line);
  cursor: grab; touch-action: none; user-select: none; }
.platter.is-held { cursor: grabbing; border-color: var(--violet); }
.platter__disc { position: relative; width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: repeating-radial-gradient(circle, #19181c 0 2px, #222126 2px 4px); }
.platter__disc::before { content: ""; position: absolute; left: 50%; top: 3px; width: 3px; height: 30px; margin-left: -1.5px; border-radius: 2px; background: var(--text); }
.platter__disc span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; background: var(--violet-deep); color: var(--violet); }

/* small menus that open next to their button */
.menu { position: fixed; inset: auto; margin: 0; padding: 6px; min-width: 230px; max-width: 300px; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); overscroll-behavior: contain; }
.menu__item { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 6px; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer; }
.menu__item:focus-within { outline: 2px solid var(--violet); outline-offset: -2px; }
.menu__item:active { background: var(--violet-deep); }
@media (hover: hover) { .menu__item:hover { background: var(--violet-deep); } }
.menu__note { margin: 6px 10px; font-size: 12px; color: var(--muted); }
.menu--fix { padding: 10px; }
.menu--fix:popover-open { display: grid; gap: 10px; }
.menu--fix .menu__note { margin: 0; }

/* dialogs */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; max-width: min(560px, calc(100vw - 32px)); overscroll-behavior: contain; }
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog h2 { font: 600 20px/1.2 var(--f-text); margin: 0 0 12px; text-wrap: balance; }
dialog h3 { font: 600 15px/1.3 var(--f-text); margin: 18px 0 6px; }
dialog p, dialog ul { margin: 0 0 8px; color: var(--muted); }
dialog ul { padding-left: 18px; }
dialog form { margin-top: 18px; }
dialog .key { color: var(--text); opacity: 1; }

/* Music window */
#music { width: min(880px, calc(100vw - 24px)); max-width: none; height: min(620px, calc(100vh - 24px)); padding: 20px; }
#music[open] { display: flex; flex-direction: column; gap: 10px; }
.music__head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.music__head h2 { margin: 0 0 4px; }
.music__head p, .music__head form { margin: 0; }
.music__tabs { display: flex; gap: 6px; }
.music__status { min-height: 20px; margin: 0; color: var(--text); }
.music__status:empty { display: none; }
.music__pane { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.music__pane[hidden] { display: none; }
.music__note { margin: 0; font-size: 12px; }
.music__choose { align-self: flex-start; }
label.btn:focus-within { outline: 2px solid var(--violet); outline-offset: 2px; }
.finder__form { display: flex; gap: 8px; }
.finder__form input { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; font: inherit; color: var(--text); background: var(--well); border: 1px solid var(--line); border-radius: 8px; }
.finder__picks { display: flex; flex-wrap: wrap; gap: 6px; }
dialog .tracks { flex: 1; min-height: 0; list-style: none; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; color: var(--text); }
.track { display: grid; grid-template-columns: 78px minmax(0, 1fr) 44px auto auto; gap: 8px; align-items: center; padding: 6px 4px 6px 0; border-top: 1px solid var(--line); }
.track__pv { width: 78px; }
.track__text { display: grid; min-width: 0; }
.track__text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track__text span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track__time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 560px) {
  .track { grid-template-columns: 78px minmax(0, 1fr) auto auto; }
  .track__time { display: none; }
}

/* keyboard picture in About and help */
.kbd-wrap { overflow-x: auto; margin: 0 0 8px; }
.kbd { display: grid; gap: 4px; min-width: 470px; padding-right: 42px; }
.kbd-row { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.kbd-row:nth-child(2) { margin-left: 14px; margin-right: -14px; }
.kbd-row:nth-child(3) { margin-left: 26px; margin-right: -26px; }
.kbd-row:nth-child(4) { margin-left: 42px; margin-right: -42px; }
.kbd-key { min-height: 44px; padding: 4px 2px; border-radius: 6px; border: 1px solid var(--line); background: var(--well); color: var(--violet-mid);
  display: grid; align-content: start; justify-items: center; gap: 2px; text-align: center; }
.kbd-key b { font-weight: 600; font-size: 13px; }
.kbd-key span { font-size: 9px; line-height: 1.1; }
.kbd-key.is-a, .kbd-swatch.is-a { background: var(--violet-deep); border-color: var(--violet); color: var(--violet); }
.kbd-key.is-b, .kbd-swatch.is-b { background: var(--violet-mid); border-color: var(--muted); color: var(--text); }
.kbd-legend { display: flex; align-items: center; gap: 6px; }
.kbd-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid; }
.kbd-swatch.is-b { margin-left: 12px; }

/* narrower windows: the decks sit side by side with the mixer under them, then everything stacks */
@media (max-width: 1099px) {
  .board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #deck-a { order: 1; } #deck-b { order: 2; }
  .mixer { order: 3; grid-column: 1 / -1; width: 100%; max-width: 320px; justify-self: center; }
}
@media (max-width: 700px) {
  .top { flex-wrap: wrap; }
  .help { flex-basis: 100%; order: 2; height: auto; min-height: 46px; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .mixer { order: 2; } #deck-b { order: 3; }
}

/* ---------- Studio silver: the board is one piece of gear on a dark desk ---------- */
:root {
  --desk: #0e0e10; --plate-hi: #f4f2f8; --plate: #dcd9e3; --plate-lo: #bdb9c8; --ink: #1A1A1A; --label: #3d3550;
  --cap-hi: #4c4a54; --cap: #232228; --cap-lo: #121215; --slot: #17161a; --lit-hi: #c9b3ff; --lit: #a98cf0; --lit-edge: #6a4fd0;
  --screw: radial-gradient(circle, #ffffff 0 1px, #8d899a 2px 4px, rgba(0, 0, 0, 0.35) 4px 5px, transparent 5px);
}
body { background: var(--desk); }
:focus-visible { outline-color: var(--lit-edge); }
.top :focus-visible, dialog :focus-visible, .menu :focus-visible { outline-color: var(--violet); }

/* faceplate with a screw in each corner; the mixer sits between two grooves */
.board { gap: 0; padding: 12px 14px; border-radius: 18px; color: var(--ink);
  background: var(--screw) 6px 6px / 10px 10px no-repeat, var(--screw) calc(100% - 6px) 6px / 10px 10px no-repeat,
    var(--screw) 6px calc(100% - 6px) / 10px 10px no-repeat, var(--screw) calc(100% - 6px) calc(100% - 6px) / 10px 10px no-repeat,
    linear-gradient(160deg, var(--plate-hi), var(--plate) 45%, var(--plate-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -2px 0 rgba(0, 0, 0, 0.3), 0 18px 40px rgba(0, 0, 0, 0.55); }
.deck, .mixer { background: none; border-radius: 0; padding: 8px 12px; }
.mixer { border-left: 1px solid rgba(0, 0, 0, 0.22); border-right: 1px solid rgba(0, 0, 0, 0.22); box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.6), 1px 0 0 rgba(255, 255, 255, 0.6); }
.deck.is-over { outline-color: var(--lit-edge); border-radius: 10px; }

/* words printed on the plate */
.board .row__label, .board .tempo, .board .bpm__unit, .board .strip__name, .board .cross, .board .cross__label, .board .mix__label small { color: var(--label); }
.board .tempo > span:first-child, .board .mix__label, .board .knob-wrap span { color: var(--ink); font-weight: 500; }
.board .keys, .board .cross__label .key { color: var(--label); }
.board .link { color: #4a31a8; }
.menu, .menu .row__label, .menu .menu__note { color: var(--muted); }
.menu .menu__item { color: var(--text); }

/* screens: dark glass set into the plate */
.deck__head { padding: 7px 10px; border-radius: 8px; color: var(--text); background: #111113; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.7); }
.over, .wave { box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.12); }
.board .over { box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.7); }
.bpm { justify-self: start; padding: 5px 10px 4px; border-radius: 7px; color: var(--text); background: #111113; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.7); }
.board .bpm__unit { color: var(--muted); }
.bpm__value { font-size: 28px; }
.tempo output { padding: 2px 4px; border-radius: 5px; color: var(--text); background: #111113; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9); }
.deck__tag { background: #26242c; }

/* buttons: dark rubber that lights up violet when it is on */
.btn { color: var(--text); background: linear-gradient(#3a3940, #232228); border: 1px solid #0b0b0d;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.btn[aria-pressed="true"], .btn--main { color: #1A1A1A; background: linear-gradient(var(--lit-hi), var(--lit)); border-color: var(--lit-edge);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35), 0 0 10px rgba(143, 111, 230, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.btn:active:not(:disabled), .btn.is-key { transform: translateY(1px); background: linear-gradient(#2c2b31, #1b1a1f); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(0, 0, 0, 0.6); }
.btn[aria-pressed="true"]:active:not(:disabled), .btn--main:active:not(:disabled), .btn--main.is-key, .btn[aria-pressed="true"].is-key { background: linear-gradient(#f1e9ff, var(--lit-hi)); border-color: var(--lit-edge); }
.btn:disabled { opacity: 0.45; }
@media (hover: hover) { .btn:not(:disabled):hover { border-color: #0b0b0d; filter: brightness(1.15); } }
.round { background: radial-gradient(circle at 35% 28%, var(--cap-hi), var(--cap) 65%, var(--cap-lo)); border: 0;
  box-shadow: 0 4px 7px rgba(0, 0, 0, 0.45), 0 0 0 3px var(--slot), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.round.btn--main { background: radial-gradient(circle at 35% 28%, #e3d8ff, var(--lit) 60%, #9f84e6); box-shadow: 0 4px 7px rgba(0, 0, 0, 0.45), 0 0 0 3px var(--slot), 0 0 14px rgba(143, 111, 230, 0.8); }
.pad { background: linear-gradient(#34333a, #1f1e23); }

/* knobs: a raised cap that stays lit from above while only its pointer turns */
.knob { transform: none; border: 0; background: radial-gradient(circle at 35% 28%, var(--cap-hi), var(--cap) 62%, var(--cap-lo));
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.45), 0 0 0 3px var(--slot), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.knob::after { width: 3px; margin-left: -1.5px; background: var(--text); transform-origin: 50% 13px; transform: rotate(calc(var(--turn, 0) * 135deg)); }
.mix { gap: 9px 8px; }

/* faders: a cap that rides in a slot */
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { background: var(--slot); border-radius: 3px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.55); }
input[type=range]::-moz-range-track { background: var(--slot); border-radius: 3px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.55); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; border: 0; border-radius: 4px; box-shadow: 0 3px 5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
input[type=range]::-moz-range-thumb { border: 0; border-radius: 4px; box-shadow: 0 3px 5px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
input[type=range].v::-webkit-slider-runnable-track { width: 6px; }
input[type=range].v::-moz-range-track { width: 6px; }
input[type=range].v::-webkit-slider-thumb { width: 30px; height: 18px; margin-left: -12px;
  background: linear-gradient(transparent 8px, var(--text) 8px 10px, transparent 10px), linear-gradient(var(--cap-hi), var(--cap) 45%, var(--cap-lo)); }
input[type=range].v::-moz-range-thumb { width: 30px; height: 18px;
  background: linear-gradient(transparent 8px, var(--text) 8px 10px, transparent 10px), linear-gradient(var(--cap-hi), var(--cap) 45%, var(--cap-lo)); }
#cross::-webkit-slider-runnable-track { height: 6px; }
#cross::-moz-range-track { height: 6px; }
#cross::-webkit-slider-thumb { width: 20px; height: 30px; margin-top: -12px;
  background: linear-gradient(90deg, transparent 9px, var(--text) 9px 11px, transparent 11px), linear-gradient(90deg, var(--cap-hi), var(--cap) 45%, var(--cap-lo)); }
#cross::-moz-range-thumb { width: 20px; height: 30px;
  background: linear-gradient(90deg, transparent 9px, var(--text) 9px 11px, transparent 11px), linear-gradient(90deg, var(--cap-hi), var(--cap) 45%, var(--cap-lo)); }
.cross input { height: 32px; }
input[type=range].v { width: 32px; }

/* level lights */
.meter { box-shadow: 0 0 0 2px var(--slot); background: linear-gradient(to top, #7a5fd0 0%, var(--lit) 70%, var(--lit) 88%, #FF8A78 90%); }
.meter i { background: var(--slot); }
.meter::after { background: repeating-linear-gradient(to top, transparent 0 5px, var(--slot) 5px 7px); }

/* platter: a metal ring round a dark record with a lit marker */
.platter { padding: 9px; border: 0; background: conic-gradient(from 20deg, #f7f6fa, #8f8b9c, #f7f6fa, #8f8b9c, #f7f6fa, #8f8b9c, #f7f6fa);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(0, 0, 0, 0.4); }
.platter.is-held { box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 0, 0, 0.4), 0 0 0 2px var(--lit-edge); }
.platter__disc { background: repeating-radial-gradient(circle, #121214 0 2px, #1b1a1e 2px 4px); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8), inset 0 0 0 2px var(--lit); }
.platter__disc::before { width: 4px; margin-left: -2px; top: 5px; background: var(--lit-hi); box-shadow: 0 0 8px var(--lit); }
.platter__disc span { background: radial-gradient(circle at 35% 30%, #4a4850, #1d1c20); color: var(--lit-hi); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }

@media (max-width: 1099px) {
  .mixer { border: 0; box-shadow: none; }
}

/* keep the gear on one screen */
.board { padding: 8px 14px; }
.deck, .mixer { padding: 6px 12px; }
.deck, .deck__body { gap: 7px; }
.mix { gap: 7px 8px; }
.wave canvas { height: 42px; }
.top { margin-bottom: 6px; } .waves { margin-bottom: 6px; }

/* controls that are switched off stay readable, and key hints are not too small */
.btn:disabled, .link:disabled { opacity: 0.62; }
.key { font-size: 11px; opacity: 0.85; }

/* ---------- Help: three sides you switch by lighting up a word, in the brand's "dim, then bright" ---------- */
#about { width: min(1040px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 24px); padding: 26px 30px 28px; background: var(--bg); border-color: var(--line); }
.ab__head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.ab__head form { margin: 0; flex: none; }
.ab__sides { display: flex; flex-wrap: wrap; gap: 4px 26px; }
.ab__sides button { padding: 0; border: 0; background: none; cursor: pointer; color: rgba(246, 246, 244, 0.42);
  font: 700 32px/1.05 var(--f-display); font-stretch: 118%; letter-spacing: -0.03em; transition: color 0.18s cubic-bezier(0.16, 1, 0.3, 1); }
.ab__sides button[aria-pressed="true"] { color: var(--text); }
@media (hover: hover) { .ab__sides button:hover { color: rgba(246, 246, 244, 0.8); } .ab__sides button[aria-pressed="true"]:hover { color: var(--text); } }
.ab__pane[hidden] { display: none; }
.dim { color: rgba(246, 246, 244, 0.46); }
.ab__steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 13px; }
.ab__steps li, .ab__line { font: 700 21px/1.22 var(--f-display); font-stretch: 118%; letter-spacing: -0.02em; color: var(--text); max-width: none; text-wrap: pretty; }
.ab__steps li { counter-increment: step; position: relative; padding-left: 44px; }
.ab__steps li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 28px; text-align: right;
  font: 500 16px/26px var(--f-data); font-stretch: normal; letter-spacing: 0; color: var(--violet); }
#about .ab__line { margin: 20px 0 0; padding: 18px 0 0 44px; border-top: 1px solid var(--line); color: var(--text); }
#about [data-pane="keys"] .ab__line { margin: 0 0 16px; padding: 0; border: 0; }
#about .ab__tip { margin: 16px 0 0; padding-left: 44px; max-width: 78ch; font-size: 14px; line-height: 1.5; color: var(--muted); }
.ab__print { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 36px; }
#about .ab__print h3 { margin: 0 0 6px; font-size: 15px; color: var(--text); }
#about .ab__print h3:not(:first-child) { margin-top: 18px; }
#about .ab__print p { margin: 0; max-width: 60ch; font-size: 14px; line-height: 1.55; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .ab__sides button { transition: none; } }

/* the keyboard, drawn as the same silver gear as the mixer */
.kbd-wrap { margin: 0; }
.kbd-plate { padding: 14px 18px 16px; border-radius: 16px; color: var(--ink);
  background: linear-gradient(160deg, var(--plate-hi), var(--plate) 45%, var(--plate-lo));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -2px 0 rgba(0, 0, 0, 0.3), 0 12px 28px rgba(0, 0, 0, 0.5); }
.kbd-hands { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; color: var(--ink); }
.kbd { min-width: 0; padding-right: 54px; gap: 6px; }
.kbd-row { gap: 6px; }
.kbd-row:nth-child(2) { margin-left: 18px; margin-right: -18px; }
.kbd-row:nth-child(3) { margin-left: 34px; margin-right: -34px; }
.kbd-row:nth-child(4) { margin-left: 54px; margin-right: -54px; }
.kbd-key { min-height: 62px; padding: 7px 3px; border-radius: 8px; gap: 4px; color: #4a4558; background: rgba(0, 0, 0, 0.06); border: 1px solid rgba(0, 0, 0, 0.14); }
.kbd-key b { font-size: 15px; }
.kbd-key span { font-size: 12px; line-height: 1.15; hyphens: manual; }
.kbd-key.is-a { color: #1A1A1A; border-color: var(--lit-edge); background: linear-gradient(var(--lit-hi), var(--lit));
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.55); }
.kbd-key.is-b { color: var(--text); border-color: #0b0b0d; background: linear-gradient(#3a3940, #232228);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.kbd-extra { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; font-size: 13px; color: var(--label); }
.kbd-extra span { display: inline-flex; align-items: center; gap: 6px; }
.kbd-cap { min-width: 26px; padding: 5px 7px; border-radius: 5px; font: 500 12px/1 var(--f-data); text-align: center; color: var(--text);
  background: linear-gradient(#3a3940, #232228); border: 1px solid #0b0b0d; }
@media (max-width: 860px) {
  #about { padding: 18px; }
  .ab__sides button { font-size: 24px; }
  .ab__steps li, .ab__line { font-size: 18px; }
  .ab__print { grid-template-columns: minmax(0, 1fr); }
  .kbd-wrap { overflow-x: auto; }
  .kbd-plate { min-width: 620px; }
}

/* ---------- fixes from the full check ---------- */
/* the track line can never run under the Load button */
.deck__meta { overflow: hidden; }
.tempo > label { font-size: 13px; font-weight: 500; color: var(--ink); }
.cross__label { display: block; }

/* switched off controls are flat and grey, and their words keep full contrast */
.btn:disabled { opacity: 1; color: #e4e1ea; background: #56545d; border-color: #47454d; box-shadow: none; }
.btn--main:disabled { color: #1A1A1A; background: #9a93ad; border-color: #827b96; box-shadow: none; }
.round:disabled { box-shadow: 0 0 0 3px #6d6a76; }
.link:disabled { opacity: 1; color: #5d576b; text-decoration: none; }
dialog .btn:disabled, .menu .btn:disabled { color: #c9c5d2; background: #3a3940; border-color: #2c2b31; }

/* touch screens get full size targets */
@media (pointer: coarse) {
  .btn, .btn--small, .link, .menu__item { min-height: 44px; }
  .cross input { height: 44px; }
}

/* phones: the platter and tempo fader share a row, and the buttons sit under them */
@media (max-width: 480px) {
  body { padding: 8px; }
  .board { padding: 8px; }
  .deck, .mixer { padding: 6px; }
  .deck__head { flex-wrap: wrap; }
  .deck__mid { flex-wrap: wrap; justify-content: space-between; }
  .deck__stack { order: 3; flex-basis: 100%; }
  .platter { width: 120px; height: 120px; }
  .spots { flex-wrap: wrap; }
  .pads { flex-basis: 100%; order: 2; }
  .spots > .btn { order: 3; }
  .top__tools { flex-wrap: wrap; }
  .track { grid-template-columns: minmax(0, 1fr) auto auto; }
  .track__pv { grid-column: 1 / -1; width: auto; justify-self: start; }
  #music { padding: 14px; }
}
.link:disabled { color: #4a4558; }
@media (max-width: 1099px) {
  .deck__sub { flex-wrap: wrap; gap: 0 10px; }
  .deck__status, .deck__credit { white-space: normal; }
}

/* the help line: larger words, a bright first sentence, and softer detail after it */
.help { height: 54px; padding: 6px 12px; font-size: 15px; line-height: 21px; color: #ddd6ec; background: #17141f; border-color: var(--violet-mid);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.help strong { font-size: inherit; font-weight: 600; color: #ffffff; }
.help__key { margin-left: 6px; padding: 1px 7px; border-radius: 5px; font-size: 13px; color: #1A1A1A; background: var(--lit); }
.wave canvas { height: 38px; }
@media (max-width: 700px) { .help { height: auto; min-height: 54px; display: block; } }

/* each saved spot has its own colour: the pad lights up in it, and its mark on the waveforms matches */
.pads .pad:nth-child(1) { --spot: #5BE08A; } .pads .pad:nth-child(2) { --spot: #FFC24A; }
.pads .pad:nth-child(3) { --spot: #4DC3FF; } .pads .pad:nth-child(4) { --spot: #FF7AB8; }
.pad[aria-pressed="true"], .pad[aria-pressed="true"].is-key, .pad[aria-pressed="true"]:active:not(:disabled) {
  color: #111113; border-color: color-mix(in srgb, var(--spot) 55%, #000);
  background: linear-gradient(color-mix(in srgb, var(--spot) 55%, #fff), var(--spot));
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35), 0 0 10px color-mix(in srgb, var(--spot) 75%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.5); }

/* ---------- Brand system: Archivo set wide for names and headings, Geist for words, Geist Mono for numbers ---------- */
:root {
  --f-display: "Archivo", "Arial Narrow", Arial, sans-serif; --f-text: "Geist", system-ui, sans-serif; --f-data: "Geist Mono", ui-monospace, Menlo, monospace;
  --bg: #131114; --desk: #131114; --panel: #1C1920; --well: #0d0c0e; --line: #3a3540; --text: #F6F6F4; --muted: #A8A3AE;
  --violet: #BFA6F2; --violet-mid: #5b4a80; --violet-deep: #2a2138; --accent: #8A2BE2; --accent-deep: #6420AD; --accent-text: #A762E7;
  --lit-hi: #ddd0f9; --lit: #BFA6F2; --lit-edge: #6420AD;
}
body { font-family: var(--f-text); letter-spacing: 0.005em; caret-color: var(--violet); }
input, select, textarea { font-family: var(--f-text); }
:focus-visible, .top :focus-visible, dialog :focus-visible, .menu :focus-visible { outline-color: var(--accent-text); }
::selection { background: var(--accent-deep); color: var(--text); }

/* Archivo, wide, for the things that have a name */
dialog h2, dialog h3, .deck__title, .strip__name, .deck__tag, .platter__disc span, .kbd-hands {
  font-family: var(--f-display); font-stretch: 118%; font-weight: 700; letter-spacing: -0.02em; }
dialog h2 { font-size: 22px; line-height: 1.05; letter-spacing: -0.03em; }
dialog h3 { font-size: 14px; line-height: 1.2; }
.deck__title { font-size: 14px; }
.strip__name { font-size: 12px; color: var(--ink); }
.board .strip__name { color: var(--ink); }

/* Geist Mono for times, speeds and keys */
.bpm__value, .deck__time, .tempo output, .track__time, .key, .kbd-key b, .kbd-cap { font-family: var(--f-data); font-weight: 500; letter-spacing: 0; }
.bpm__value { font-size: 28px; letter-spacing: -0.02em; }

/* purple: solid violet only on the main action, lilac light for anything that is switched on */
.btn--main { color: var(--text); background: linear-gradient(#9638E8, var(--accent)); border-color: var(--accent-deep);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35), 0 0 12px rgba(138, 43, 226, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.round.btn--main { background: radial-gradient(circle at 35% 28%, #b06cf2, var(--accent) 58%, var(--accent-deep)); box-shadow: 0 4px 7px rgba(0, 0, 0, 0.45), 0 0 0 3px var(--slot), 0 0 16px rgba(138, 43, 226, 0.75); }
.btn--main:active:not(:disabled), .btn--main.is-key { color: var(--text); background: linear-gradient(#a85cf0, #9638E8); border-color: var(--accent-deep); }
.btn--main:disabled { color: #1A1A1A; }
.deck__credit a, dialog a { color: var(--accent-text); }
.steps li::before { color: var(--violet); background: var(--violet-deep); font-family: var(--f-data); }
.help { background: #17141c; border-color: #3d3350; color: #d5d0dc; }
.help__key { font-family: var(--f-data); background: var(--lit); }
.meter { background: linear-gradient(to top, #7a5fd0 0%, var(--lit) 70%, var(--lit) 88%, #FF8A78 90%); }

/* the brand sparkle, set into the plate between the two decks like a lit jewel */
.mix__bling { grid-column: 2; grid-row: 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 0 2px var(--slot); }
.mix__bling i { width: 26px; height: 26px; background: radial-gradient(circle, #ffffff 0 22%, var(--lit) 100%);
  -webkit-mask: url(bling.svg) center / contain no-repeat; mask: url(bling.svg) center / contain no-repeat; filter: drop-shadow(0 0 4px rgba(191, 166, 242, 0.9)); }

/* contrast: Play keeps its words clear at every point of its light, on and off */
.round.btn--main { background: radial-gradient(circle at 35% 28%, #9638E8, var(--accent) 58%, var(--accent-deep)); }
.btn--main .key { opacity: 1; }
.round.btn--main:disabled { color: #1A1A1A; background: #9a93ad; box-shadow: 0 0 0 3px #6d6a76; }
.kbd-key { color: #4a4558; }
/* the help window keeps one size as you switch sides */
#about { height: min(560px, calc(100vh - 24px)); overflow-y: auto; }
/* more room between the lines of the help steps, and round the key tag in the help line */
.ab__steps li, .ab__line { line-height: 1.3; }
.help__key { padding: 2px 8px; }
#about { height: min(590px, calc(100vh - 24px)); }
/* the sparkle is a link to the maker's website */
a.mix__bling { cursor: pointer; transition: box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1); }
a.mix__bling i { transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1); }
@media (hover: hover) {
  a.mix__bling:hover { box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 0 2px var(--lit-edge), 0 0 14px rgba(191, 166, 242, 0.9); }
  a.mix__bling:hover i { transform: scale(1.12); }
}
a.mix__bling:active i { transform: scale(0.94); }
@media (pointer: coarse) { .mix__bling { width: 44px; height: 44px; } .mix__bling i { width: 32px; height: 32px; } }
@media (prefers-reduced-motion: reduce) { a.mix__bling, a.mix__bling i { transition: none; } }
