/* THE RACK (Nov 2026): VU meter, graphic EQ, tape echo, spring reverb as
   rack-mounted hardware on the home deck. Markup and behaviour: js/home-rack.js.
   Everything is prefixed rk- so nothing here touches the frozen bundle styles. */

#tonePanel.rk-host {
  padding: 0; margin: 14px 0 0; border: 0; background: none; box-shadow: none; border-radius: 0;
  display: block;
}
#fxPanel { display: none !important; }

.rk-rack {
  --rk-green: #6ef08a; --rk-ink: #d9dfd6; --rk-dim: #8d968c;
  position: relative; padding: 10px 0; border-radius: 6px;
  /* the rack frame: two steel rails with square holes, dark inside */
  background:
    repeating-linear-gradient(180deg, transparent 0 10px, rgba(0,0,0,.55) 10px 15px, transparent 15px 22px) left 6px top 0 / 7px 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0 10px, rgba(0,0,0,.55) 10px 15px, transparent 15px 22px) right 6px top 0 / 7px 100% no-repeat,
    linear-gradient(90deg, #8e918b, #c9cbc5 9px, #8a8d87 19px, #0b0d0c 20px, #0b0d0c calc(100% - 20px), #8a8d87 calc(100% - 19px), #c9cbc5 calc(100% - 9px), #8e918b);
  box-shadow: inset 0 2px 5px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.45);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color: var(--rk-ink);
  -webkit-user-select: none; user-select: none;
}
.rk-unit { position: relative; margin: 0 0 4px; }
.rk-pair { display: grid; grid-template-columns: 4fr 3.2fr; gap: 0; }
.rk-pair .rk-unit--echo .rk-ear--r, .rk-pair .rk-unit--rev .rk-ear--l { display: none; }
.rk-pair .rk-unit--echo .rk-plate { margin-right: 2px; border-radius: 3px 0 0 3px; }
.rk-pair .rk-unit--rev .rk-plate { margin-left: 2px; border-radius: 0 3px 3px 0; }

/* faceplate: black anodised, brushed */
.rk-plate {
  position: relative; display: flex; align-items: center; gap: 14px;
  margin: 0; padding: 12px 34px; min-height: 96px; border-radius: 3px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.028) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #2b2e2c, #1a1c1b 45%, #121413);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(0,0,0,.8), 0 2px 3px rgba(0,0,0,.6);
}
/* rack ears with two screws each */
.rk-ear { position: absolute; top: 0; bottom: 0; width: 26px; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 9px 0; pointer-events: none; }
.rk-ear--l { left: 0; } .rk-ear--r { right: 0; }
.rk-ear i { width: 11px; height: 11px; border-radius: 50%;
  background: linear-gradient(45deg, transparent 44%, rgba(0,0,0,.75) 45% 55%, transparent 56%), radial-gradient(circle at 35% 30%, #f4f5f1, #9a9c97 60%, #5b5d59);
  box-shadow: 0 1px 1px rgba(0,0,0,.8), inset 0 0 0 1px rgba(0,0,0,.35); }
.rk-ear--r i { transform: rotate(70deg); }

.rk-brand { display: flex; flex-direction: column; gap: 3px; min-width: 86px; line-height: 1.1; }
.rk-brand b { font-size: .86rem; letter-spacing: .08em; color: #f2f5ef; }
.rk-brand span { font-size: .5rem; letter-spacing: .2em; color: var(--rk-green); }
.rk-brand small { font-size: .46rem; letter-spacing: .12em; color: var(--rk-dim); }
.rk-brand--r { min-width: 0; align-items: center; gap: 6px; margin-left: auto; }
.rk-legend { font-size: .5rem; letter-spacing: .16em; color: var(--rk-ink); white-space: nowrap; }
.rk-note { margin: 6px 26px 0; font: .58rem/1.4 ui-monospace, Menlo, monospace; letter-spacing: .04em; color: #aeb5ab; text-align: center; }

/* lamps */
.rk-lamp { width: 8px; height: 8px; border-radius: 50%; background: #1d2a1f; box-shadow: inset 0 0 2px #000, 0 0 0 1px #000; transition: background .08s, box-shadow .08s; }
.rk-lamp.is-lit { background: var(--rk-green); box-shadow: 0 0 9px var(--rk-green), 0 0 0 1px #000; }
.rk-lamp.is-lit.is-pulse { background: #eaffef; box-shadow: 0 0 14px #b8ffc8, 0 0 0 1px #000; }
.rk-lamp--amber { background: #2e2311; } .rk-lamp--amber.is-lit { background: #ffb13a; box-shadow: 0 0 9px #ffb13a, 0 0 0 1px #000; }
.rk-lamp--red { background: #2c1210; } .rk-lamp--red.is-lit { background: #ff4b3a; box-shadow: 0 0 10px #ff4b3a, 0 0 0 1px #000; }

/* ---------- VU ---------- */
.rk-vus { display: flex; gap: 14px; flex: 1; justify-content: center; }
.rk-vu { position: relative; width: min(230px, 46%); aspect-ratio: 200 / 124; border-radius: 5px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 105%, #fff3c9, #f1dc9c 55%, #cfae62);
  box-shadow: inset 0 0 0 2px #050505, inset 0 0 14px rgba(120,70,0,.45), 0 0 0 1px #3c3f3c, 0 0 18px rgba(255,190,90,.18); }
.rk-vu svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rk-vu svg line, .rk-vu svg path { stroke: #201a10; stroke-width: 1.3; fill: none; }
.rk-vu svg .r { stroke: #c2281c; fill: #c2281c; } .rk-vu svg path.thick { stroke-width: 4; }
.rk-vu svg text { font: 700 8.5px ui-monospace, Menlo, monospace; fill: #201a10; text-anchor: middle; dominant-baseline: middle; stroke: none; }
.rk-vu svg text.r { fill: #c2281c; }
.rk-vu svg text.vu { font-size: 13px; letter-spacing: 1px; } .rk-vu svg text.ch { font-size: 10px; }
.rk-vu__needle { position: absolute; left: 50%; bottom: 4.8%; width: 1.5px; height: 74%; margin-left: -.75px; background: #17120a; transform-origin: 50% 100%; transform: rotate(-48deg); box-shadow: 1px 1px 1px rgba(0,0,0,.3); }
.rk-vu__hub { position: absolute; left: 50%; bottom: -9%; width: 26%; aspect-ratio: 1; margin-left: -13%; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #3a3a38, #0c0c0c); }
.rk-vu__peak { position: absolute; right: 7%; top: 9%; width: 7px; height: 7px; }
.rk-vu__pk { position: absolute; right: 5%; top: 21%; font: 700 .38rem ui-monospace, Menlo, monospace; letter-spacing: .1em; color: #5d4a22; }

/* ---------- knobs ---------- */
.rk-knobs { display: flex; flex: 1; justify-content: space-around; gap: 12px; }
.rk-pair .rk-brand { min-width: 74px; }
.rk-pair .rk-plate { gap: 10px; padding-right: 30px; }
.rk-knobwrap { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.rk-knob { --k: 0; position: relative; width: 46px; height: 46px; border-radius: 50%; cursor: ns-resize; touch-action: none; outline: none; }
/* printed scale: 11 ticks over 270 degrees around the knob */
.rk-knob::before { content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(from 138deg, #1c1e1d 0 84deg, transparent 84deg), repeating-conic-gradient(from 224.2deg, rgba(217,223,214,.85) 0 1.6deg, transparent 1.6deg 27deg);
  -webkit-mask: radial-gradient(circle, transparent 0 77%, #000 79%); mask: radial-gradient(circle, transparent 0 77%, #000 79%); }
.rk-knob__cap { position: absolute; inset: 7px; border-radius: 50%; display: block;
  background: radial-gradient(circle at 35% 28%, #5a5e5a, #262927 55%, #0d0e0d);
  box-shadow: 0 2px 3px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.25), inset 0 0 0 1px #000;
  transform: rotate(calc(-135deg + var(--k) * 270deg)); }
.rk-knob__cap b { position: absolute; left: 50%; top: 2px; width: 2px; height: 10px; margin-left: -1px; border-radius: 1px; background: #f4f6f1; }
.rk-knob:focus-visible .rk-knob__cap, .rk-knob.is-held .rk-knob__cap { box-shadow: 0 0 0 2px var(--rk-green), 0 2px 3px rgba(0,0,0,.8); }
.rk-range { display: flex; justify-content: space-between; width: 58px; margin-top: -2px; font-size: .42rem; letter-spacing: .06em; color: var(--rk-dim); font-style: normal; }
.rk-range em { font-style: normal; }

/* ---------- switches ---------- */
.rk-switches { display: flex; gap: 10px; align-items: flex-end; }
.rk-swwrap { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.rk-sw { position: relative; width: 26px; height: 40px; min-height: 0; min-width: 0; padding: 0; border: 0; border-radius: 3px; cursor: pointer; touch-action: manipulation;
  background: linear-gradient(180deg, #0a0b0a, #232523); box-shadow: inset 0 0 0 1px #000, 0 1px 0 rgba(255,255,255,.12); }
.rk-sw i { position: absolute; left: 3px; right: 3px; top: 19px; height: 18px; border-radius: 2px;
  background: linear-gradient(180deg, #e9ebe6, #8d908a); box-shadow: 0 1px 2px #000; transition: top .07s; }
.rk-sw.is-on i { top: 3px; background: linear-gradient(180deg, #8d908a, #e9ebe6); }
.rk-sw:focus-visible, .rk-btn:focus-visible { outline: 2px solid var(--rk-green); outline-offset: 2px; }
.rk-btn { min-width: 48px; min-height: 0; height: 28px; padding: 0 8px; border-radius: 3px; border: 0; cursor: pointer; touch-action: manipulation;
  font: 700 .5rem ui-monospace, Menlo, monospace; letter-spacing: .14em; color: #101210;
  background: linear-gradient(180deg, #e9ebe6, #9da09a); box-shadow: 0 2px 0 #4a4c49, 0 3px 3px rgba(0,0,0,.7); }
.rk-btn:active { transform: translateY(2px); box-shadow: 0 0 0 #4a4c49, 0 1px 1px rgba(0,0,0,.7); }

/* ---------- graphic EQ ---------- */
.rk-unit--eq .rk-plate { align-items: stretch; }
.rk-eqside { display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 10px; min-width: 92px; }
.rk-eqside .rk-brand { align-self: flex-start; }
.rk-eqmid { display: flex; flex: 1; gap: 6px; min-width: 0; }
.rk-scale { display: flex; flex-direction: column; justify-content: space-between; height: 116px; padding: 3px 0; font-size: .42rem; color: var(--rk-dim); text-align: right; }
.rk-scale em { font-style: normal; line-height: 1; }
.rk-bands { display: grid; grid-template-columns: repeat(10, 1fr); flex: 1; gap: 2px; min-width: 0; }
.rk-band { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.rk-band span { font-size: .46rem; letter-spacing: .04em; color: var(--rk-ink); }
.rk-fader { --k: .5; position: relative; width: 100%; max-width: 34px; height: 116px; cursor: ns-resize; touch-action: none; outline: none;
  /* dB graduations either side of the slot, heavier at 0 */
  background:
    linear-gradient(#d9dfd6, #d9dfd6) center 50% / 70% 1.5px no-repeat,
    repeating-linear-gradient(180deg, rgba(217,223,214,.45) 0 1px, transparent 1px 12.5%) center 10px / 46% calc(100% - 20px) no-repeat; }
.rk-fader__slot { position: absolute; left: 50%; top: 4px; bottom: 4px; width: 4px; margin-left: -2px; border-radius: 2px; background: #000; box-shadow: inset 0 0 2px #000, 0 0 0 1px rgba(255,255,255,.08); }
.rk-fader__cap { position: absolute; left: 50%; width: 22px; height: 20px; margin-left: -11px; border-radius: 2px;
  top: calc((1 - var(--k)) * (100% - 20px));
  background: linear-gradient(180deg, #f1f3ee 0 3px, #6f726d 3px 4px, #c8cbc5 4px 9px, var(--rk-green) 9px 11px, #c8cbc5 11px 16px, #6f726d 16px 17px, #9a9d97 17px);
  box-shadow: 0 2px 3px rgba(0,0,0,.85), inset 0 0 0 1px rgba(0,0,0,.45); }
.rk-fader:focus-visible .rk-fader__cap, .rk-fader.is-held .rk-fader__cap { box-shadow: 0 0 0 2px var(--rk-green), 0 2px 3px rgba(0,0,0,.85); }

/* ---------- tablet ---------- */
@media (max-width: 900px) {
  .rk-pair { grid-template-columns: 1fr; }
  .rk-pair .rk-unit--echo .rk-ear--r, .rk-pair .rk-unit--rev .rk-ear--l { display: flex; }
  .rk-pair .rk-unit--echo .rk-plate, .rk-pair .rk-unit--rev .rk-plate { margin: 0; border-radius: 3px; }
}
/* ---------- phone ---------- */
@media (max-width: 640px) {
  .rk-rack { padding: 8px 0; background: #0b0d0c; }
  .rk-ear { display: none !important; }
  .rk-plate { padding: 12px 10px; gap: 10px; flex-wrap: wrap; justify-content: center; }
  .rk-brand { flex-direction: row; align-items: baseline; gap: 8px; min-width: 0; width: 100%; }
  .rk-brand--r { display: none; }
  .rk-vus { width: 100%; gap: 8px; } .rk-vu { width: 49%; }
  .rk-unit--eq .rk-plate { display: grid; grid-template-columns: 1fr 1fr; }
  .rk-eqmid { grid-column: 1 / -1; grid-row: 1; }
  .rk-eqside { flex-direction: row; justify-content: space-around; min-width: 0; }
  .rk-eqside .rk-brand { display: none; }
  .rk-fader { height: 132px; } .rk-scale { height: 132px; }
  .rk-fader__cap { width: 24px; margin-left: -12px; }
  .rk-knobs { flex: 1; min-width: 0; gap: 2px; }
  .rk-pair .rk-plate { padding-right: 10px; gap: 6px; }
  .rk-pair .rk-legend { letter-spacing: .08em; font-size: .46rem; }
  .rk-range { width: 50px; }
  .rk-knob { width: 52px; height: 52px; }
  .rk-note { margin: 6px 10px 0; }
}
@media (prefers-reduced-motion: reduce) { .rk-lamp, .rk-sw i { transition: none; } }

/* ====================================================================
   v2 (15 Nov 2026): the whole deck is one rack. The cassette deck, the
   recorder and the monitor speakers become rack units too, and three new
   units join: power distribution, a real-time spectrum analyser and
   nearfield monitors. Built by js/home-rack-v2.js.
   ==================================================================== */

/* ---------- the enclosure: .deck becomes the rack frame ---------- */
.deck.rk-deck {
  --rk-green: #6ef08a; --rk-ink: #d9dfd6; --rk-dim: #8d968c; --rk-light: 1;
  padding: 14px 0 12px; gap: 4px 0; border-bottom-color: #2a2c2a;
  background:
    repeating-linear-gradient(180deg, transparent 0 10px, rgba(0,0,0,.55) 10px 15px, transparent 15px 22px) left 6px top 0 / 7px 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0 10px, rgba(0,0,0,.55) 10px 15px, transparent 15px 22px) right 6px top 0 / 7px 100% no-repeat,
    linear-gradient(90deg, #8e918b, #c9cbc5 9px, #8a8d87 19px, #0b0d0c 20px, #0b0d0c calc(100% - 20px), #8a8d87 calc(100% - 19px), #c9cbc5 calc(100% - 9px), #8e918b);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.55);
}
.deck.rk-deck::before, .deck.rk-deck::after { display: none; }
.rk-deck .rk-rack { padding: 0; background: none; box-shadow: none; border-radius: 0; }
.rk-deck #tonePanel.rk-host { margin: 0; }
.rk-deck .rk-note { margin: 8px 30px 4px; }
/* warm rack light from the power unit */
.rk-plate, .rk-deckplate, .rk-deck .deck__recording.rk-unit--rec {
  background-image:
    linear-gradient(180deg, rgba(255,236,190, calc(.085 * var(--rk-light, 1))), transparent 46%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.028) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #2b2e2c, #1a1c1b 45%, #121413);
}
.rk-deck.rk-dark { --rk-light: 0; }

/* ---------- LL-C1 cassette deck ---------- */
.rk-deckplate { grid-row: screen-start / grilles-end; grid-column: 1 / -1; position: relative; z-index: 0; border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(0,0,0,.8), 0 2px 3px rgba(0,0,0,.6); }
.rk-deck > .deck__screen-wrap, .rk-deck > .deck__bay-wrap, .rk-deck > .deck__controls, .rk-deck > .deck__grilles { position: relative; z-index: 1; }
.rk-deck > .deck__screen-wrap { margin: 14px 36px 12px; padding: 7px; border-radius: 8px; background: linear-gradient(180deg, #050606, #1b1d1c); box-shadow: inset 0 0 0 1px #000, 0 1px 0 rgba(255,255,255,.14); }
.rk-deck > .deck__screen-wrap::before, .rk-deck > .deck__screen-wrap::after { inset: 7px; border-radius: 5px; }
.rk-deck .deck__screen { border-radius: 5px; }
.rk-deck .crt-roll { left: 7px; right: 7px; }
.rk-deck > .deck__bay-wrap { margin: 0 8px 16px 36px; padding: 10px; border-radius: 6px; background: linear-gradient(180deg, #0a0b0a, #1f2120); box-shadow: inset 0 0 0 1px #000, 0 1px 0 rgba(255,255,255,.13); }
.rk-deck .deck__bay { border-radius: 3px; background: linear-gradient(180deg, #191a18, #070807); box-shadow: inset 0 0 22px #000, inset 0 0 0 1px rgba(255,255,255,.06); }
/* the cassette door: smoked glass with a highlight and a printed legend */
.rk-deck > .deck__bay-wrap::after { content: ""; position: absolute; inset: 10px; border-radius: 3px; pointer-events: none; z-index: 3;
  background: linear-gradient(112deg, rgba(255,255,255,.10) 0 12%, rgba(255,255,255,.02) 26%, transparent 40%), linear-gradient(180deg, transparent 80%, rgba(0,0,0,.35));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.09); }
.rk-deck > .deck__bay-wrap::before { content: "STEREO CASSETTE · NORMAL / CrO\2082 / METAL"; position: absolute; left: 12px; bottom: 0; z-index: 4; font: .4rem/10px ui-monospace, Menlo, monospace; letter-spacing: .16em; color: #8d968c; }
.rk-deck > .deck__controls { margin: 0 36px 0 8px; gap: 12px; justify-content: flex-start; padding-top: 2px; }
.rk-deck > .deck__grilles { margin: 0 36px 16px 8px; align-self: stretch; align-items: stretch; gap: 12px; }

/* transport keys: black, legends in white, a lamp line that lights when latched */
.rk-deck .transport { gap: 6px; justify-content: space-between; }
.rk-deck .transport .btn { position: relative; flex: 1 1 48px; width: auto; min-height: 46px; border: 0; border-radius: 3px;
  font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: .1em; color: #e6ebe3;
  background: linear-gradient(180deg, #4a4e4b, #2a2d2b 30%, #171918);
  box-shadow: 0 3px 0 #050505, 0 5px 6px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.28), inset 0 0 0 1px #000; }
.rk-deck .transport .btn::before { content: ""; position: absolute; left: 22%; right: 22%; top: 6px; height: 3px; border-radius: 2px; background: #1d2a1f; box-shadow: inset 0 0 2px #000; }
.rk-deck .transport .btn.is-latched, .rk-deck .transport .btn:active, .rk-deck .transport .btn.is-down { transform: translateY(3px); background: linear-gradient(180deg, #2c2f2d, #1a1c1b); box-shadow: 0 0 0 #050505, 0 1px 2px rgba(0,0,0,.6), inset 0 2px 4px rgba(0,0,0,.7), inset 0 0 0 1px #000; }
.rk-deck .transport .btn.is-latched::before, .rk-deck .transport .btn[aria-pressed="true"]::before { background: var(--rk-green); box-shadow: 0 0 8px var(--rk-green); }
.rk-deck .transport .btn[aria-pressed="true"] { box-shadow: 0 0 0 #050505, inset 0 2px 4px rgba(0,0,0,.7), inset 0 0 0 1px #000; }
.rk-deck .transport .btn--rec { color: #fff; background: linear-gradient(180deg, #e2594b, #b3271b 40%, #7a160e); }
.rk-deck .transport .btn--rec::before { background: #3a100c; }
.rk-deck .transport .btn--rec[aria-pressed="true"]::before, .rk-deck .transport .btn--rec.is-latched::before { background: #ff5a48; box-shadow: 0 0 9px #ff5a48; }
.rk-deck .transport.is-inert .btn:disabled { filter: none; opacity: .45; box-shadow: 0 2px 0 #050505, inset 0 0 0 1px #000; transform: translateY(1px); }

/* volume + rec level knobs: black caps, white pointer, printed scale */
.rk-deck .deck__meters { justify-content: space-between; gap: 10px; padding: 0 4px; }
.rk-deck .knob { background: radial-gradient(circle at 35% 28%, #5a5e5a, #262927 55%, #0d0e0d); box-shadow: 0 2px 4px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.25), inset 0 0 0 1px #000; }
.rk-deck .knob__pointer { background: #f4f6f1; }
.rk-deck .knob__label { color: var(--rk-ink); letter-spacing: .16em; font-family: ui-monospace, Menlo, monospace; }
.rk-deck .knob-dial__tick { color: var(--rk-dim); }
.rk-deck .knob-dial__tick.is-active { color: var(--rk-green); text-shadow: 0 0 5px rgba(110,240,138,.7); }
.rk-deck .led { background: #2c1210; box-shadow: inset 0 0 2px #000, 0 0 0 1px #000; }
.rk-deck .led--signal { background: #1d2a1f; }

/* meter bridge + counter (replaces the two round grilles) */
.rk-bridge { display: flex; flex: 1; gap: 14px; align-items: center; min-width: 0; padding: 10px 12px; border-radius: 4px; background: linear-gradient(180deg, #060707, #131514); box-shadow: inset 0 0 0 1px #000, 0 1px 0 rgba(255,255,255,.12); }
.rk-ledms { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.rk-ledm { display: flex; align-items: center; gap: 6px; }
.rk-ledm > b { width: 8px; font: 700 .5rem ui-monospace, Menlo, monospace; color: var(--rk-ink); }
.rk-ledm > div { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; flex: 1; }
.rk-ledm i { height: 9px; border-radius: 1px; background: #16241a; box-shadow: inset 0 0 1px #000; }
.rk-ledm i.a { background: #2b2412; } .rk-ledm i.r { background: #2e1411; }
.rk-ledm i.on { background: var(--rk-green); box-shadow: 0 0 5px rgba(110,240,138,.8); }
.rk-ledm i.a.on { background: #ffc24a; box-shadow: 0 0 5px rgba(255,194,74,.8); }
.rk-ledm i.r.on { background: #ff4b3a; box-shadow: 0 0 6px rgba(255,75,58,.9); }
.rk-ledscale { display: flex; justify-content: space-between; margin-left: 14px; font: .38rem ui-monospace, Menlo, monospace; color: var(--rk-dim); }
.rk-count { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.rk-count__win { display: flex; gap: 1px; padding: 3px; border-radius: 3px; background: #000; box-shadow: inset 0 0 0 1px #333, 0 1px 0 rgba(255,255,255,.15); }
.rk-count__d { position: relative; width: 13px; height: 19px; overflow: hidden; border-radius: 1px; background: linear-gradient(180deg, #8f8c80, #f3f0e4 35% 65%, #8f8c80); }
.rk-count__d:last-child { background: linear-gradient(180deg, #7d241c, #e2483a 35% 65%, #7d241c); }
.rk-count__d span { position: absolute; left: 0; right: 0; top: 0; display: block; font: 700 13px/19px ui-monospace, Menlo, monospace; text-align: center; color: #151512; white-space: pre; }
.rk-count__d:last-child span { color: #fff; }
.rk-count button { min-height: 0; min-width: 0; width: 26px; height: 14px; padding: 0; border: 0; border-radius: 2px; cursor: pointer; background: linear-gradient(180deg, #e9ebe6, #8d908a); box-shadow: 0 2px 0 #3a3c39, 0 3px 3px rgba(0,0,0,.7); }
.rk-count button:active { transform: translateY(2px); box-shadow: 0 0 0 #3a3c39; }
.rk-count .rk-legend { font-size: .42rem; }
.rk-deckbrand { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; gap: 6px; min-width: 104px; }
.rk-deckbrand .rk-brand { align-items: flex-end; text-align: right; min-width: 0; }
.rk-deck .deck__engrave { flex: 0 0 auto; width: 104px; height: 34px; margin: 0; opacity: .9; }
.rk-deck .deck__engrave::before { display: none; }
.rk-deck .deck__engrave::after { transform: none; background: linear-gradient(180deg, #f2f5ef, #9aa39a); -webkit-mask-position: right center; mask-position: right center; }

/* the strip under the rack: loaded tape label, track list, notices */
.rk-deck > .deck__label, .rk-deck > .deck__tracks, .rk-deck > .deck__notice { margin-left: 26px; margin-right: 26px; }
.rk-deck > .deck__label { margin-top: 8px; background: linear-gradient(180deg, #1c1f1d, #101211); color: var(--rk-ink); box-shadow: inset 0 0 0 1px #000, 0 1px 0 rgba(255,255,255,.1); }
.rk-deck > .deck__tracks { background: linear-gradient(180deg, #171a18, #0e100f); color: var(--rk-ink); box-shadow: inset 0 0 0 1px #000; }
.rk-deck .deck-track { color: var(--rk-ink); } .rk-deck .deck-track:hover { background: rgba(110,240,138,.08); }
.rk-deck .deck-track__n, .rk-deck .deck-track:disabled { color: var(--rk-dim); }
.rk-deck .deck-track.is-current { background: linear-gradient(90deg, rgba(110,240,138,.22), rgba(110,240,138,.05)); box-shadow: inset 2px 0 0 var(--rk-green); }
.rk-deck > .deck__notice { color: #aeb5ab; }

/* ---------- LL-PWR power distribution ---------- */
.rk-unit--pwr .rk-plate { min-height: 44px; padding-top: 7px; padding-bottom: 7px; }
.rk-unit--pwr .rk-brand { flex-direction: row; align-items: baseline; gap: 8px; }
.rk-volt { display: flex; align-items: baseline; gap: 4px; padding: 3px 8px; border-radius: 3px; background: #050505; box-shadow: inset 0 0 0 1px #2a2a2a; font: 700 .9rem/1 ui-monospace, Menlo, monospace; color: #ff5a48; text-shadow: 0 0 7px rgba(255,90,72,.8); }
.rk-volt small { font-size: .46rem; letter-spacing: .1em; color: #b0463c; text-shadow: none; }
.rk-outlets { display: flex; gap: 7px; flex: 1; justify-content: center; }
.rk-outlets .rk-lamp { width: 6px; height: 6px; }
.rk-lightbar { flex: 1; max-width: 220px; height: 6px; border-radius: 3px; background: #2a2618; box-shadow: inset 0 0 2px #000; }
.rk-deck:not(.rk-dark) .rk-lightbar { background: linear-gradient(90deg, #ffe9b0, #fff6da, #ffe9b0); box-shadow: 0 0 12px rgba(255,225,150,.75), 0 6px 22px rgba(255,225,150,.25); }
.rk-unit--pwr .rk-swwrap { flex-direction: row; gap: 8px; }
.rk-unit--pwr .rk-sw { width: 34px; height: 20px; }
.rk-unit--pwr .rk-sw i { top: 3px; bottom: 3px; left: 17px; right: 3px; height: auto; transition: left .07s, right .07s; }
.rk-unit--pwr .rk-sw.is-on i { top: 3px; left: 3px; right: 17px; background: linear-gradient(180deg, #ffe9b0, #d9b45a); }

/* ---------- LL-RTA spectrum analyser ---------- */
.rk-unit--rta .rk-plate { align-items: stretch; }
.rk-rta { position: relative; flex: 1; min-width: 0; height: 118px; border-radius: 4px; background: #020403; box-shadow: inset 0 0 0 1px #000, inset 0 0 18px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.12); overflow: hidden; }
.rk-rta canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rk-rta::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, rgba(255,255,255,.07) 0 10%, transparent 30%); }
.rk-unit--rta .rk-switches { flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.rk-unit--rta .rk-swwrap { flex-direction: row; gap: 7px; }
.rk-unit--rta .rk-sw { width: 34px; height: 20px; }
.rk-unit--rta .rk-sw i { top: 3px; bottom: 3px; left: 17px; right: 3px; height: auto; }
.rk-unit--rta .rk-sw.is-on i { top: 3px; left: 3px; right: 17px; }
.rk-unit--rta .rk-legend { min-width: 54px; }

/* ---------- LL-R60 cassette recorder (the old recording bay) ---------- */
.rk-deck .deck__recording.rk-unit--rec { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand head side" "brand well side" "status status status" "actions actions actions"; gap: 6px 16px; align-items: center;
  margin: 0 0 4px; padding: 12px 36px; border-radius: 3px; color: var(--rk-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(0,0,0,.8), 0 2px 3px rgba(0,0,0,.6); }
.rk-unit--rec .rk-recbrand { grid-area: brand; }
.rk-unit--rec .recording-bay__head { grid-area: head; margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: .5rem; letter-spacing: .16em; color: var(--rk-dim); }
.rk-unit--rec .recording-bay__head strong { padding: 3px 8px; border-radius: 2px; background: #050505; box-shadow: inset 0 0 0 1px #2a2a2a; color: var(--rk-green); text-shadow: 0 0 6px rgba(110,240,138,.7); font-size: .62rem; letter-spacing: .08em; }
.rk-unit--rec.is-recording .recording-bay__head strong { color: #ff5a48; text-shadow: 0 0 7px rgba(255,90,72,.8); }
.rk-unit--rec .recording-bay__well { grid-area: well; min-height: 58px; padding: 9px 5%; border-radius: 4px; background: linear-gradient(180deg, #000 0 14%, #161817 15% 84%, #000 85%); box-shadow: inset 0 0 0 1px #000, inset 0 0 20px #000, 0 1px 0 rgba(255,255,255,.13); position: relative; }
.rk-unit--rec .recording-bay__well::after { content: ""; position: absolute; inset: 0; border-radius: 4px; pointer-events: none; background: linear-gradient(112deg, rgba(255,255,255,.09) 0 10%, transparent 30%); }
.rk-unit--rec .recording-slot { width: min(78%, 560px); }
.rk-unit--rec .rk-recside { grid-area: side; display: flex; align-items: center; gap: 14px; }
.rk-unit--rec .rk-recmeter { display: flex; flex-direction: column; gap: 4px; width: 150px; }
.rk-unit--rec .rk-reclamp { width: 13px; height: 13px; }
.rk-unit--rec.is-armed .rk-reclamp { animation: rk-blink 1s steps(2, start) infinite; background: #ff4b3a; box-shadow: 0 0 10px #ff4b3a, 0 0 0 1px #000; }
.rk-unit--rec.is-recording .rk-reclamp { animation: none; background: #ff4b3a; box-shadow: 0 0 14px #ff4b3a, 0 0 0 1px #000; }
@keyframes rk-blink { to { visibility: hidden; } }
.rk-unit--rec .rk-recbtn { width: 46px; height: 46px; min-height: 0; border-radius: 50%; border: 0; cursor: pointer; font: 700 .5rem ui-monospace, Menlo, monospace; letter-spacing: .1em; color: #fff;
  background: radial-gradient(circle at 38% 30%, #f07a6c, #b3271b 60%, #6d130c); box-shadow: 0 3px 0 #3d0a06, 0 5px 6px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.4), 0 0 0 3px #0b0c0b, 0 0 0 4px #3c3f3c; }
.rk-unit--rec .rk-recbtn:active, .rk-unit--rec.is-recording .rk-recbtn, .rk-unit--rec.is-armed .rk-recbtn { transform: translateY(2px); box-shadow: 0 1px 0 #3d0a06, inset 0 2px 5px rgba(0,0,0,.6), 0 0 0 3px #0b0c0b, 0 0 0 4px #3c3f3c; }
.rk-unit--rec .rk-recbtn:focus-visible { outline: 2px solid var(--rk-green); outline-offset: 5px; }
.rk-unit--rec .recording-bay__status { grid-area: status; margin: 2px 0 0; color: #8f978d; font: .56rem/1.45 ui-monospace, Menlo, monospace; letter-spacing: .02em; }
.rk-unit--rec .recording-bay__actions { grid-area: actions; margin: 0; }
.rk-unit--rec .recording-bay__actions:empty, .rk-unit--rec .recording-bay__status:empty { display: none; }
.rk-unit--rec .recording-bay__download { background: linear-gradient(180deg, #2f6b40, #1c4428); color: #eaffef; border-color: #000; box-shadow: 0 0 10px rgba(110,240,138,.25); }
.rk-unit--rec .recording-bay__actions button { color: var(--rk-ink); background: #232624; border-color: #000; }

/* ---------- LL-M5 nearfield monitors ---------- */
.rk-unit--mon .rk-plate { align-items: stretch; gap: 18px; padding-top: 16px; padding-bottom: 16px; }
.rk-spk { --x: 0; flex: 1; display: flex; align-items: center; justify-content: center; gap: 18px; min-width: 0; padding: 14px; border-radius: 6px;
  background: radial-gradient(120% 140% at 50% 0%, #1d1f1e, #0a0b0a); box-shadow: inset 0 0 0 1px #000, inset 0 2px 0 rgba(255,255,255,.08), 0 1px 0 rgba(255,255,255,.1); }
.rk-spk:last-of-type { flex-direction: row-reverse; }
.rk-woof { position: relative; width: min(150px, 58%); aspect-ratio: 1; border-radius: 50%;
  /* basket ring with four screws, then the rubber surround */
  background:
    radial-gradient(circle at 50% 4.5%, #cfd1cb 0 1.6%, #111 1.8% 2.8%, transparent 3%), radial-gradient(circle at 50% 95.5%, #cfd1cb 0 1.6%, #111 1.8% 2.8%, transparent 3%),
    radial-gradient(circle at 4.5% 50%, #cfd1cb 0 1.6%, #111 1.8% 2.8%, transparent 3%), radial-gradient(circle at 95.5% 50%, #cfd1cb 0 1.6%, #111 1.8% 2.8%, transparent 3%),
    radial-gradient(circle, #050505 0 41%, #2b2d2b 42% 44%, #0c0d0c 45% 46%, #3a3d3a 47%, #1c1e1d 50%);
  box-shadow: 0 2px 4px rgba(0,0,0,.8), inset 0 0 0 1px #000; }
.rk-woof i { position: absolute; inset: 10%; border-radius: 50%; will-change: transform; transform: scale(calc(1 + var(--x) * .045));
  background:
    radial-gradient(circle at 42% 36%, rgba(255,255,255,.22), transparent 30%),
    radial-gradient(circle, #2c2f2d 0 17%, #0a0b0a 18% 19%, #3b3f3c 20%, #1b1d1c 62%, #070807 78%, #262927 80% 88%, #0d0e0d 92%, #1a1c1b 100%);
  box-shadow: inset 0 0 14px rgba(0,0,0,.9), 0 0 0 1px #000; }
.rk-tweet { position: relative; width: min(58px, 22%); aspect-ratio: 1; border-radius: 50%; flex: 0 0 auto;
  background: radial-gradient(circle at 40% 34%, rgba(255,255,255,.5), transparent 26%), radial-gradient(circle, #6b6f6b 0 26%, #1a1c1b 28% 34%, #323532 36% 60%, #0b0c0b 62% 70%, #3a3d3a 72%);
  box-shadow: 0 2px 3px rgba(0,0,0,.8), inset 0 0 0 1px #000; }
.rk-moncenter { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 10px; min-width: 92px; }
.rk-moncenter .rk-brand { align-items: center; text-align: center; min-width: 0; }

/* ---------- tablet + phone ---------- */
@media (max-width: 860px) {
  .rk-deck > .deck__bay-wrap { margin: 0 36px; }
  .rk-deck > .deck__controls { margin: 8px 36px 0; }
  .rk-deck > .deck__grilles { margin: 0 36px 16px; }
}
@media (max-width: 640px) {
  .deck.rk-deck { padding: 8px 0; background: #0b0d0c; }
  .rk-deck > .deck__screen-wrap { margin: 10px 10px 8px; }
  .rk-deck > .deck__bay-wrap { margin: 0 10px; }
  .rk-deck > .deck__bay-wrap::before { display: none; }
  .rk-deck > .deck__controls { margin: 8px 10px 0; }
  .rk-deck > .deck__grilles { margin: 0 10px 12px; }
  .rk-deck .transport { gap: 6px; }
  .rk-bridge { flex-wrap: wrap; justify-content: space-between; }
  .rk-ledms { flex: 1 1 100%; }
  .rk-deckbrand { flex-direction: row; align-items: center; flex: 1; }
  .rk-deck > .deck__label, .rk-deck > .deck__tracks, .rk-deck > .deck__notice { margin-left: 8px; margin-right: 8px; }
  .rk-unit--pwr .rk-plate { flex-wrap: nowrap; } .rk-unit--pwr .rk-brand { width: auto; } .rk-outlets { display: none; }
  .rk-unit--rta .rk-plate { flex-direction: column; } .rk-rta { flex: none; width: 100%; height: 110px; }
  .rk-unit--rta .rk-switches { flex-direction: row; gap: 18px; }
  .rk-deck .deck__recording.rk-unit--rec { grid-template-columns: minmax(0, 1fr); grid-template-areas: "brand" "head" "well" "side" "status" "actions"; padding: 12px 10px; }
  .rk-unit--rec .rk-recside { justify-content: space-between; } .rk-unit--rec .rk-recmeter { flex: 1; width: auto; }
  .rk-unit--rec .recording-slot { width: 100%; }
  .rk-unit--mon .rk-plate { flex-wrap: wrap; gap: 10px; }
  .rk-spk { flex: 1 1 40%; flex-direction: column !important; gap: 10px; padding: 10px; }
  .rk-woof { width: 80%; } .rk-tweet { width: 30%; }
  .rk-moncenter { order: 3; flex: 1 1 100%; flex-direction: row; justify-content: space-around; }
  .rk-moncenter .rk-brand { width: auto; flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .rk-woof i { transform: none; } .rk-unit--rec.is-armed .rk-reclamp { animation: none; } }

/* the site gives every button a 44px minimum; these are drawn controls with their own sizes */
.rk-deck .rk-sw, .rk-deck .rk-btn, .rk-deck .rk-count button, .rk-deck .rk-recbtn, .rk-host .rk-sw, .rk-host .rk-btn { min-height: 0 !important; min-width: 0 !important; }

.rk-brand b, .rk-brand span, .rk-brand small { white-space: nowrap; }
@media (max-width: 640px) {
  .rk-unit--pwr .rk-brand span { display: none; }
  .rk-unit--pwr .rk-lightbar { min-width: 30px; }
  .rk-deckbrand { flex-direction: column; align-items: flex-end; justify-content: center; }
  .rk-deckbrand .rk-brand { flex-direction: column; width: auto; gap: 3px; }
  .rk-moncenter .rk-brand { flex-direction: column; }
}

/* Touch screens: the switches and small keys are drawn small on purpose, but a
   finger needs about 44 px. An invisible ring around each one catches the tap. */
@media (pointer: coarse) {
  .rk-btn, .rk-count button { position: relative; }
  .rk-sw::after, .rk-btn::after, .rk-count button::after { content: ""; position: absolute; inset: -9px -9px; }
}

/* ---- v3 (17 Nov 2026): two full-width effect units with more to play with ---- */
.rk-unit--fx3 .rk-plate { gap: 14px; padding-right: 18px; }
.rk-unit--fx3 .rk-brand { min-width: 96px; }
.rk-unit--fx3 .rk-knobs { justify-content: space-between; gap: 6px; }
.rk-unit--fx3 .rk-knob { width: 40px; height: 40px; }
.rk-unit--fx3 .rk-range { width: 52px; }
.rk-heads { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.rk-heads .rk-lamp { width: 7px; height: 7px; }
.rk-heads small, .rk-selval { font-size: .42rem; letter-spacing: .14em; color: var(--rk-dim); }
.rk-sel { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.rk-sel .rk-knob { cursor: ew-resize; }
.rk-selval { color: #ffcf7a; min-height: 1em; letter-spacing: .12em; }
@media (max-width: 767px) {
  .rk-unit--fx3 .rk-plate { flex-wrap: wrap; }
  .rk-unit--fx3 .rk-knobs { flex-wrap: wrap; justify-content: space-around; row-gap: 10px; flex-basis: 100%; }
  .rk-unit--fx3 .rk-knobwrap { width: 23%; }
}

/* ---- v4 (19 Nov 2026): three units with three big detented knobs each (EQ, echo, reverb) ---- */
.rk-unit--v4 .rk-plate { display: grid; grid-template-columns: minmax(120px, 160px) 1fr auto; align-items: center; gap: 18px; padding: 16px 26px; }
.rk-unit--v4 .rk-knobs { display: grid; grid-template-columns: repeat(3, 1fr); justify-items: center; gap: 10px; }
.rk-unit--v4 .rk-knob { width: 62px; height: 62px; }
.rk-unit--v4 .rk-knob__cap { inset: 8px; }
.rk-unit--v4 .rk-knob__cap b { top: 3px; height: 13px; width: 3px; margin-left: -1.5px; }
.rk-unit--v4 .rk-legend { font-size: .5rem; letter-spacing: .12em; }
.rk-unit--v4 .rk-range { width: 76px; font-size: .46rem; }
.rk-unit--v4 .rk-sel .rk-knob { cursor: ns-resize; }
.rk-unit--v4 .rk-selval { font-size: .5rem; }
.rk-unit--v4 .rk-swwrap { padding-left: 6px; }
.rk-unit--v4 .rk-sw { width: 30px; height: 46px; }
.rk-unit--v4 .rk-sw i { top: 22px; height: 21px; } .rk-unit--v4 .rk-sw.is-on i { top: 3px; }
.rk-unit--v4 .rk-knob, .rk-unit--v4 .rk-sel .rk-knob { touch-action: none; }
@media (max-width: 640px) {
  .rk-unit--v4 .rk-plate { grid-template-columns: 1fr auto; grid-template-areas: "brand brand" "knobs sw"; gap: 12px 8px; padding: 14px 12px 16px; }
  .rk-unit--v4 .rk-brand { grid-area: brand; }
  .rk-unit--v4 .rk-knobs { grid-area: knobs; gap: 4px; }
  .rk-unit--v4 .rk-swwrap { grid-area: sw; padding-left: 0; }
  .rk-unit--v4 .rk-knob { width: 66px; height: 66px; }
  .rk-unit--v4 .rk-legend { font-size: .52rem; letter-spacing: .06em; text-align: center; }
  .rk-unit--v4 .rk-range { width: 74px; }
}

/* LL-C1 tape counter: never squeezed (phone: it gets its own row next to the brand) */
.rk-count { flex: none; }
.rk-count__win { flex: none; }
@media (max-width: 640px) {
  .rk-bridge { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
  .rk-bridge .rk-ledms { grid-column: 1 / -1; }
  .rk-count { flex-direction: row; gap: 8px; }
}
/* the deck's own VOLUME / REC LEVEL knobs: a finger-sized target on touch screens */
@media (pointer: coarse) { .rk-deck .knobs .knob { width: 60px; height: 60px; } }

/* Touch screens (19 Nov 2026): no barrel distortion on the scrolling screen. The SVG displacement filter re-warps the
   whole page on every scroll frame, which on phones reads as the page bending and juddering. Scanlines and glass stay. */
@media (pointer: coarse) { body.has-crt .screen { filter: none !important; } }

/* LL-C1 counter, larger and easier to read (19 Nov 2026): one digit = the window height; the JS reads it from here */
.rk-count__d { width: 17px; height: 25px; }
.rk-count__d span { font-size: 17px; line-height: 25px; }
.rk-count__win { gap: 2px; padding: 4px; }
.rk-count button { width: 30px; height: 16px; }
.rk-count .rk-legend { font-size: .5rem; }

/* 19 Nov 2026 review: on phones the meter bridge got squeezed beside the LL-C1 badge and the meters ran
   underneath "STEREO CASSETTE DECK". The bridge now takes the full width and the badge sits on its own row. */
@media (max-width: 640px) {
  .rk-deck > .deck__grilles { flex-wrap: wrap; gap: 10px; }
  .rk-deck .rk-bridge { flex: 1 1 100%; grid-template-columns: minmax(0, 1fr) auto; }
  .rk-deck .rk-ledms { min-width: 0; }
  .rk-deck .rk-deckbrand { flex: 1 1 100%; flex-direction: row; align-items: center; justify-content: space-between; min-width: 0; }
  .rk-deck .rk-deckbrand .rk-brand { align-items: flex-start; text-align: left; }
}
/* the dial numbers round the deck's two knobs sat on top of each other at tablet widths (the old 37px radius
   is for a smaller knob); they now sit clear of the knob and of each other at every width */
.rk-deck .knob-dial { --knob-r: 42px; }
.rk-deck .knob-dial__tick { font-size: 9px; }
