@font-face { font-family: Inter; src: url("fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Oswald; src: url("fonts/oswald-latin.woff2") format("woff2"); font-weight: 200 700; font-display: swap; }

:root {
  --navy: #0C1A36;
  --navy-2: #102247;
  --navy-deep: #081329;
  --line: rgba(251, 246, 240, 0.10);
  --bone: #FBF6F0;
  --silk: #C9D3E6;
  --muted: #8B97B0;
  --orange: #FD6815;
  --amber: #FFB25B;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --wd: min(222px, calc(100vw - 110px));
  --ks: 46px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%;
  background: #091530;
  color: var(--bone);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; }

/* ---------- faceplate ---------- */
.plate {
  position: relative;
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 10px) calc(var(--safe-r) + 10px) calc(var(--safe-b) + 10px) calc(var(--safe-l) + 10px);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "top top"
    "disp vu"
    "wheel wheel"
    "knobs knobs"
    "pitch pitch"
    "scene scene"
    "transport transport"
    "foot foot";
  gap: 8px;
  align-content: start;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.016) 0 1px, rgba(0,0,0,0) 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0 2px, rgba(0,0,0,0) 2px 7px),
    radial-gradient(120% 70% at 50% 0%, #15295A 0%, var(--navy) 55%, #0A1630 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), inset 0 -1px 0 rgba(0,0,0,0.4);
}
.screw {
  position: absolute; width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #EEF0F3 0%, #A7ADB8 45%, #5D6573 100%);
  box-shadow: 0 1px 1px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(0,0,0,0.25);
}
.screw::after {
  content: ""; position: absolute; left: 1px; right: 1px; top: 4.5px; height: 2px;
  background: rgba(40,46,58,0.85); border-radius: 1px; transform: rotate(var(--rot, 35deg));
}
.s-tl { top: calc(var(--safe-t) + 4px); left: 4px; }
.s-tr { top: calc(var(--safe-t) + 4px); right: 4px; --rot: -20deg; }
.s-bl { bottom: calc(var(--safe-b) + 4px); left: 4px; --rot: 80deg; }
.s-br { bottom: calc(var(--safe-b) + 4px); right: 4px; --rot: 10deg; }

.eng, .lamp-lbl, .klabel, .sector {
  font-family: Oswald, Inter, sans-serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--silk);
  text-shadow: 0 1px 0 rgba(0,0,0,0.55), 0 -1px 0 rgba(255,255,255,0.05);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- header ---------- */
.top {
  grid-area: top;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 6px 8px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.35);
}
.brand h1 {
  margin: 0; font-family: Oswald, Inter, sans-serif; font-weight: 500; font-size: 24px;
  letter-spacing: 0.1em; line-height: 1; color: var(--bone);
}
.brand h1 span { color: var(--orange); }
.tag { margin: 4px 0 0; font-size: 8.5px; letter-spacing: 0.24em; font-weight: 600; color: var(--muted); }
.lamps { display: flex; gap: 12px; }
.lamp-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lamp {
  width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #5A4A3A, #2A2420 70%);
  box-shadow: 0 0 0 2px #1A2236, 0 0 0 3px rgba(255,255,255,0.12), inset 0 -1px 2px rgba(0,0,0,0.6);
  transition: background 120ms, box-shadow 120ms;
}
.lamp.on {
  background: radial-gradient(circle at 40% 35%, #FFF1D6, var(--amber) 45%, var(--orange) 100%);
  box-shadow: 0 0 0 2px #1A2236, 0 0 0 3px rgba(255,255,255,0.12), 0 0 10px rgba(255,170,80,0.9);
}
.lamp-rec.on {
  background: radial-gradient(circle at 40% 35%, #FFE0D6, #FF5A3A 50%, #C2260F 100%);
  box-shadow: 0 0 0 2px #1A2236, 0 0 0 3px rgba(255,255,255,0.12), 0 0 12px rgba(255,80,50,0.95);
}
.lamp-lbl { font-size: 8.5px; letter-spacing: 0.16em; }

/* ---------- display ---------- */
.disp { grid-area: disp; display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.lcd {
  flex: 1 1 auto; min-width: 0;
  background: linear-gradient(180deg, #060E1F, #0A1630);
  border-radius: 6px;
  padding: 7px 10px 8px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.75), 0 1px 0 rgba(255,255,255,0.08), 0 0 0 1px #050B18;
  color: var(--amber);
}
.lcd-row { display: flex; justify-content: space-between; gap: 8px; }
.lcd-small { font-size: 8.5px; letter-spacing: 0.16em; font-weight: 600; color: rgba(255,178,91,0.72); white-space: nowrap; }
.lcd-name {
  display: block; width: 100%; margin: 3px 0 2px; padding: 0; border: 0; background: none; text-align: left;
  font-family: Oswald, Inter, sans-serif; font-weight: 500; font-size: 19px; letter-spacing: 0.08em;
  color: var(--amber); text-shadow: 0 0 10px rgba(255,150,60,0.45);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.lcd-desc { margin: 0; font-size: 10.5px; line-height: 1.3; color: rgba(255,214,170,0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disp-btns { display: flex; flex-direction: column; gap: 6px; }

.vu-wrap { grid-area: vu; display: flex; align-items: center; }
#vu {
  width: 120px; height: 66px; display: block; border-radius: 5px;
  box-shadow: 0 0 0 2px #1B2742, 0 0 0 3px rgba(255,255,255,0.10), inset 0 0 6px rgba(0,0,0,0.6);
}

/* ---------- buttons ---------- */
.hw-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 0 10px;
  border: 0; border-radius: 6px; cursor: pointer; text-decoration: none;
  font-family: Oswald, Inter, sans-serif; font-weight: 500; font-size: 11px; letter-spacing: 0.16em;
  color: var(--silk);
  background: linear-gradient(180deg, #24365E 0%, #172848 55%, #122140 100%);
  box-shadow: 0 4px 0 #050B19, 0 6px 9px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.18), inset 0 0 0 1px rgba(255,255,255,0.05);
  margin-bottom: 3px;
  white-space: nowrap;
  transition: transform 60ms, box-shadow 60ms, color 120ms;
}
.hw-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #050B19, 0 2px 3px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.1); }
.hw-btn:disabled, .hw-btn.is-off { opacity: 0.42; cursor: default; pointer-events: none; }
.hw-btn.sq { width: 34px; padding: 0; font-size: 10px; flex: 1 1 0; }
.hw-btn.mini { min-height: 28px; width: 28px; padding: 0; font-size: 9px; }
.hw-btn.big { min-height: 42px; font-size: 13px; flex: 1 1 0; }
.hw-btn.is-on { color: var(--bone); background: linear-gradient(180deg, #FF8A45 0%, var(--orange) 50%, #E0570C 100%); box-shadow: 0 4px 0 #7A2E05, 0 6px 14px rgba(253,104,21,0.4), inset 0 1px 0 rgba(255,255,255,0.35); }
.hw-btn.rec.is-on { background: linear-gradient(180deg, #FF6A4E, #D8341A); box-shadow: 0 2px 0 #6A1406, 0 0 16px rgba(255,70,40,0.6), inset 0 1px 0 rgba(255,255,255,0.3); }

/* ---------- pitch row ---------- */
.pitch {
  grid-area: pitch;
  display: grid; grid-template-columns: 1fr 1fr auto; grid-template-areas: "key voices retune" "scale scale scale";
  align-items: end; gap: 6px 10px;
  padding: 14px 10px 8px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(5,12,28,0.30));
  box-shadow: 2px 4px 10px rgba(2,6,16,0.55), inset 1px 1px 0 rgba(255,255,255,0.09), inset -1px -2px 3px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.25);
}
.pitch > .ctl:nth-child(1) { grid-area: key; }
.pitch > .ctl:nth-child(2) { grid-area: voices; }
.pitch > .ctl-knob { grid-area: retune; }
.pitch > .ctl-scale { grid-area: scale; flex-direction: row; gap: 10px; align-items: center; }
.pitch > .ctl-scale .seg { max-width: none; }
.ctl { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.stepper { display: flex; align-items: center; gap: 4px; }
.key-val {
  width: 34px; text-align: center; font-family: Oswald, Inter, sans-serif; font-size: 17px; color: var(--amber);
  background: #070F22; border-radius: 4px; padding: 3px 0; box-shadow: inset 1px 2px 3px rgba(0,0,0,0.8);
  text-shadow: 0 0 8px rgba(255,150,60,0.45);
}
.seg {
  display: flex; width: 100%; max-width: 230px;
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 2px 0 #060D1C, inset 0 0 0 1px rgba(255,255,255,0.06);
}
.seg button {
  flex: 1 1 0; min-width: 0; min-height: 30px; padding: 0 2px; border: 0; cursor: pointer;
  font-family: Oswald, Inter, sans-serif; font-weight: 500; font-size: 10px; letter-spacing: 0.08em;
  color: var(--silk);
  background: linear-gradient(180deg, #22345B, #142545);
  border-right: 1px solid rgba(0,0,0,0.45);
}
.seg button:last-child { border-right: 0; }
.seg button.is-on { color: var(--bone); background: linear-gradient(180deg, #FF8A45, var(--orange) 55%, #E0570C); }

/* ---------- knobs (frontal; light from the top-left everywhere) ---------- */
.knobs { grid-area: knobs; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px 4px; padding: 10px 6px 6px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(5,12,28,0.30));
  box-shadow: 2px 4px 10px rgba(2,6,16,0.55), inset 1px 1px 0 rgba(255,255,255,0.09), inset -1px -2px 3px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.25); }
.kcell { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.kcell .klabel { margin-top: 7px; }
.knob { position: relative; width: var(--ks); height: var(--ks); margin: 5px 0 0; cursor: grab; touch-action: none; outline: none; --rot: 0deg; border-radius: 50%; }
.knob:focus-visible { box-shadow: 0 0 0 2px var(--orange); }
.knob > * { position: absolute; border-radius: 50%; pointer-events: none; }
.ticks { left: -24%; top: -24%; width: 148%; height: 148%; border-radius: 0 !important; overflow: visible; }
.ticks line { stroke: rgba(201, 211, 230, 0.55); stroke-width: 1.3; stroke-linecap: round; }
.ticks line.major { stroke: rgba(201, 211, 230, 0.95); stroke-width: 1.8; }
.kwell { inset: -10%; background: radial-gradient(circle, #050B1B 0 72%, #0D1A38 100%); box-shadow: inset 2px 3px 5px rgba(0,0,0,0.9), 1px 1px 0 rgba(255,255,255,0.13), -1px -1px 0 rgba(0,0,0,0.5); }
.kshadow { inset: 0; box-shadow: 3px 5px 7px rgba(0,0,0,0.7), 1px 1px 2px rgba(0,0,0,0.6); }
.kring { inset: 0; background: repeating-conic-gradient(from var(--rot), #E3E6EB 0deg 3.4deg, #8B929E 3.4deg 6.8deg); }
.klight { inset: 0;
  background:
    radial-gradient(circle, rgba(0,0,0,0) 0 84%, rgba(0,0,0,0.38) 100%),
    conic-gradient(from 0deg, rgba(255,255,255,0.10) 0deg, rgba(0,0,0,0.22) 80deg, rgba(0,0,0,0.58) 135deg, rgba(0,0,0,0.26) 200deg, rgba(255,255,255,0.12) 270deg, rgba(255,255,255,0.42) 315deg, rgba(255,255,255,0.10) 360deg);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4), inset 1px 1px 1px rgba(255,255,255,0.6); }
.kcap { inset: 15%;
  background: radial-gradient(circle at 32% 28%, #FFFFFF 0, #DFE2E7 28%, #B0B6BF 68%, #868D98 100%);
  box-shadow: inset 1.5px 2px 2px rgba(255,255,255,0.95), inset -2px -3px 4px rgba(0,0,0,0.42), 2px 3px 5px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.38); }
.kcap::after { content: ""; position: absolute; inset: 20%; border-radius: 50%;
  background: radial-gradient(circle at 68% 72%, #EDEFF3, #BCC2CB 62%, #98A0AB);
  box-shadow: inset 1px 2px 3px rgba(0,0,0,0.38), 0 1px 0 rgba(255,255,255,0.7); }
.krot { inset: 0; transform: rotate(var(--rot)); }
.kptr { position: absolute; left: 50%; top: 6%; width: 3.5px; height: 36%; margin-left: -1.75px; border-radius: 2px; background: var(--orange); box-shadow: 0 0 4px rgba(253,104,21,0.7), 1px 1px 1px rgba(0,0,0,0.4); }
.kspec { inset: 6%; background: radial-gradient(ellipse 36% 24% at 30% 22%, rgba(255,255,255,0.55), rgba(255,255,255,0) 100%); }
.klabel {
  font-family: Oswald, Inter, sans-serif; font-weight: 500; font-size: 9.5px; letter-spacing: 0.16em; color: var(--silk);
  text-shadow: 0 1px 0 rgba(0,0,0,0.55); text-transform: uppercase; white-space: nowrap; pointer-events: none; text-align: center;
}
.klabel.is-val { color: var(--amber); }

/* ---------- wheel (frontal) ---------- */
.wheel-sec { grid-area: wheel; justify-self: center; width: 100%; display: flex; justify-content: center; padding: 10px 0; }
.wheel-stage { position: relative; width: var(--wd); height: var(--wd); touch-action: none; cursor: crosshair; outline: none; --rot: 0deg; border-radius: 50%; }
.wheel-stage:focus-visible { box-shadow: 0 0 0 2px var(--orange); }
.wheel-stage > * { position: absolute; border-radius: 50%; }
.well { inset: -9%; background: radial-gradient(circle, #040A1A 0 80%, #0E1D40 100%); box-shadow: inset 4px 6px 12px rgba(0,0,0,0.92), 1px 2px 0 rgba(255,255,255,0.14), -1px -1px 0 rgba(0,0,0,0.55); }
.wcast { inset: 0; box-shadow: 8px 14px 22px rgba(0,0,0,0.72), 2px 3px 4px rgba(0,0,0,0.6); }
.wring { inset: 0; background: repeating-conic-gradient(from var(--rot), #DEE1E7 0deg 1.7deg, #8A919D 1.7deg 3.4deg); }
.wlight { inset: 0; pointer-events: none;
  background:
    radial-gradient(circle, rgba(0,0,0,0) 0 92%, rgba(0,0,0,0.5) 100%),
    conic-gradient(from 0deg, rgba(255,255,255,0.10) 0deg, rgba(0,0,0,0.25) 80deg, rgba(0,0,0,0.62) 135deg, rgba(0,0,0,0.30) 200deg, rgba(255,255,255,0.12) 270deg, rgba(255,255,255,0.48) 315deg, rgba(255,255,255,0.10) 360deg);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.45), inset 2px 2px 2px rgba(255,255,255,0.65); }
.dface {
  inset: 10%; overflow: hidden; pointer-events: none;
  background: radial-gradient(circle at 62% 68%, #2A4784 0%, #14284F 50%, #08132B 100%);
  box-shadow: inset 5px 7px 14px rgba(0,0,0,0.9), inset -2px -3px 6px rgba(255,255,255,0.07), 0 0 0 2px rgba(0,0,0,0.5), 1px 2px 0 2px #C3C8D1;
}
.dface > * { pointer-events: none; }
.wspec { inset: 0; pointer-events: none;
  background: conic-gradient(from 270deg, rgba(255,255,255,0) 0deg, rgba(255,255,255,0.65) 40deg, rgba(255,255,255,0) 85deg, rgba(255,255,255,0) 360deg);
  -webkit-mask: radial-gradient(circle, transparent 0 74%, #000 76% 100%); mask: radial-gradient(circle, transparent 0 74%, #000 76% 100%);
  mix-blend-mode: screen; }
.orbits { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0 !important; }
.orbits circle { fill: none; stroke: rgba(201,211,230,0.16); stroke-width: 1; }
.orbits line { stroke: rgba(253,104,21,0.6); stroke-width: 1.5; }
.sector { position: absolute; border-radius: 0 !important; font-family: Oswald, Inter, sans-serif; font-weight: 500; font-size: 8px; letter-spacing: 0.2em; color: rgba(201,211,230,0.8); text-shadow: 0 1px 0 rgba(0,0,0,0.6); white-space: nowrap; }
.s-n { top: 13%; left: 50%; transform: translateX(-50%); }
.s-s { bottom: 13%; left: 50%; transform: translateX(-50%); }
.s-e { right: 13%; top: 50%; transform: translate(50%, -50%) rotate(90deg); transform-origin: center; }
.s-w { left: 13%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); transform-origin: center; }
.readout { position: absolute; border-radius: 0 !important; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.note { font-family: Oswald, Inter, sans-serif; font-weight: 500; font-size: 36px; line-height: 1; color: var(--bone); letter-spacing: 0.04em; text-shadow: 0 0 14px rgba(253,104,21,0.4); }
.cents { margin-top: 4px; font-size: 9px; letter-spacing: 0.16em; color: var(--muted); font-weight: 600; }
.puck {
  position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 34% 30%, #FFEBD8, var(--orange) 52%, #A93D08);
  box-shadow: 0 0 14px rgba(253,104,21,0.85), 0 0 0 2px rgba(251,246,240,0.35), 2px 4px 5px rgba(0,0,0,0.6);
}
.wnotch-rot { inset: 0; transform: rotate(var(--rot)); pointer-events: none; }
.wnotch { position: absolute; left: 50%; top: 1.4%; width: 5px; height: 4.6%; margin-left: -2.5px; border-radius: 2px; background: var(--orange); box-shadow: 0 0 6px rgba(253,104,21,0.9), 1px 1px 1px rgba(0,0,0,0.4); }

/* ---------- scene + transport ---------- */
.scene {
  grid-area: scene; display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(5,12,28,0.30));
  box-shadow: 0 5px 12px rgba(2,6,16,0.55), inset 0 1px 0 rgba(255,255,255,0.09), inset 0 -2px 4px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.25);
}
.scene-name {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: Oswald, Inter, sans-serif; font-size: 13px; letter-spacing: 0.12em; color: var(--amber);
  background: #070F22; border-radius: 4px; padding: 6px 8px; box-shadow: inset 0 1px 3px rgba(0,0,0,0.8);
}
.scene.is-off .scene-name { color: var(--muted); font-size: 10px; }
.scene.is-off .hw-btn { opacity: 0.42; pointer-events: none; }
.transport { grid-area: transport; display: flex; gap: 6px; }
.transport .hw-btn.big { font-size: 11px; letter-spacing: 0.08em; padding-left: 4px; padding-right: 4px; }
.foot { display: none; grid-area: foot; margin: 0; text-align: center; font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; }

.info { display: none; }
/* ---------- presets (sheet on mobile) ---------- */
.presets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  max-height: 84vh; overflow: hidden; display: flex; flex-direction: column;
  padding: 12px 12px calc(var(--safe-b) + 14px);
  background: linear-gradient(180deg, #13264F, #0C1A36);
  border-top: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -12px 30px rgba(0,0,0,0.6);
  transform: translateY(105%); transition: transform 220ms ease;
}
.presets.is-open { transform: none; }
.presets-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pcount { margin-left: 8px; color: var(--amber); letter-spacing: 0.1em; }
.psearch {
  width: 100%; box-sizing: border-box; height: 34px; margin: 0 0 8px; padding: 0 12px; border: 0; border-radius: 6px;
  font: 500 12px Oswald, Inter, sans-serif; letter-spacing: 0.12em; color: var(--amber); caret-color: var(--orange);
  background: #070F22; box-shadow: inset 0 1px 3px rgba(0,0,0,0.8), 0 1px 0 rgba(255,255,255,0.06);
  -webkit-appearance: none; appearance: none;
}
.psearch::placeholder { color: var(--muted); }
.psearch:focus { outline: 1px solid var(--orange); }
.ptabs { display: flex; gap: 5px; margin: 0 0 8px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; flex: 0 0 auto; }
.ptabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; border: 0; cursor: pointer; white-space: nowrap; height: 26px; padding: 0 10px; border-radius: 13px;
  font: 500 10px Oswald, Inter, sans-serif; letter-spacing: 0.14em; color: var(--silk);
  background: linear-gradient(180deg, #1A2D55, #13234A); box-shadow: 0 1px 0 #060D1C, inset 0 1px 0 rgba(255,255,255,0.08);
}
.tab.is-on { color: var(--navy); background: var(--amber); box-shadow: 0 1px 0 #060D1C, inset 0 0 0 1px var(--orange); }
.pempty { margin: 14px 0; text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; }
.preset-list { list-style: none; margin: 0; padding: 0 2px 4px 0; display: grid; gap: 6px; align-content: start; overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2A3F6E transparent; }
.preset-list button {
  width: 100%; text-align: left; border: 0; cursor: pointer;
  display: grid; grid-template-columns: 26px 1fr; column-gap: 8px; row-gap: 2px; align-items: baseline;
  padding: 9px 10px; border-radius: 7px;
  background: linear-gradient(180deg, #1A2D55, #13234A);
  box-shadow: 0 2px 0 #060D1C, inset 0 1px 0 rgba(255,255,255,0.08);
}
.preset-list .pn { grid-row: span 2; font-family: Oswald, Inter, sans-serif; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }
.preset-list .pt { font-family: Oswald, Inter, sans-serif; font-size: 14px; letter-spacing: 0.1em; color: var(--bone); }
.preset-list .pd { font-size: 11px; color: var(--muted); line-height: 1.3; }
.preset-list .badge.fav { background: transparent; color: var(--amber); padding: 0; font-size: 11px; letter-spacing: 0; margin-left: 6px; vertical-align: 0; }
.preset-list .badge { margin-left: 8px; font-size: 8.5px; letter-spacing: 0.16em; color: var(--navy); background: var(--amber); border-radius: 3px; padding: 1px 5px; vertical-align: 2px; }
.preset-list button.is-on { background: linear-gradient(180deg, #2A2A3E, #1E2240); box-shadow: 0 2px 0 #060D1C, inset 0 0 0 1px var(--orange); }
.preset-list button.is-on .pt { color: var(--orange); }
.scrim { position: fixed; inset: 0; z-index: 19; background: rgba(4,9,20,0.55); display: none; }
.scrim.is-open { display: block; }

/* ---------- overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(6, 12, 28, 0.86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.overlay.is-hidden { display: none; }
.ov-card {
  width: 100%; max-width: 340px; text-align: center; padding: 26px 22px 22px; border-radius: 14px;
  background: radial-gradient(120% 90% at 50% 0%, #17306A, var(--navy) 70%);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
}
.ov-card h2 { margin: 0; font-family: Oswald, Inter, sans-serif; font-weight: 500; letter-spacing: 0.1em; font-size: 30px; }
.ov-card h2 span { color: var(--orange); }
.ov-sub { margin: 6px 0 16px; color: var(--silk); font-size: 13px; letter-spacing: 0.04em; }
.ov-warn { margin: 0 0 18px; font-size: 13px; line-height: 1.45; color: var(--bone); background: rgba(253,104,21,0.12); border: 1px solid rgba(253,104,21,0.45); border-radius: 8px; padding: 10px 12px; }
.ov-go { width: 100%; }
.ov-test { width: 100%; margin-top: 10px; }
.ov-err { margin: 12px 0 0; font-size: 12px; color: #FFB4A0; line-height: 1.4; }

/* ---------- desktop ---------- */
@media (min-width: 980px) {
  :root { --wd: 320px; --ks: 58px; }
  body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 6px; }
  .plate {
    width: 1180px; min-height: 0; border-radius: 10px; padding: 20px 28px 22px;
    grid-template-columns: 300px 1fr 300px;
    height: 788px;
    grid-template-rows: auto 92px 128px 1fr auto auto;
    align-items: start;
    grid-template-areas:
      "top top top"
      "disp wheel presets"
      "vu wheel presets"
      "pitch wheel presets"
      "info knobs presets"
      "scene knobs transport"
      "foot foot foot";
    column-gap: 26px; row-gap: 12px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.1), inset 0 -2px 0 rgba(0,0,0,0.4);
  }
  .s-tl, .s-tr { top: 8px; } .s-bl, .s-br { bottom: 8px; }
  .s-tl, .s-bl { left: 8px; } .s-tr, .s-br { right: 8px; }
  .vu-wrap { justify-content: center; }
  #vu { width: 220px; height: 120px; }
  .pitch { align-self: start; }
  .seg { max-width: none; }
  .scene { flex-wrap: wrap; }
  .scene .eng { flex-basis: 100%; }
  .transport { flex-wrap: wrap; align-self: end; }
  .transport .hw-btn.big { flex: 1 1 30%; font-size: 12px; }
  .disp .lcd { min-height: 84px; }
  .presets { grid-area: presets; position: static; transform: none; max-height: none; overflow: hidden; padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; align-self: stretch; contain: size; min-height: 0; }
  .ptabs { flex-wrap: wrap; overflow: visible; gap: 4px; }
  .tab { height: 22px; padding: 0 8px; font-size: 9px; }
  .psearch { height: 30px; margin-bottom: 6px; }
  .presets .close { display: none; }
  .preset-list { gap: 4px; }
  .preset-list button { padding: 4px 10px; }
  .preset-list .pd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .preset-list button:not(.is-on) .pd { display: none; }
  .preset-list button:not(.is-on) { padding: 6px 10px; }
  .preset-list button:not(.is-on) .pn { grid-row: auto; }
  .foot { display: block; }
  .scrim { display: none !important; }
  .info {
    grid-area: info; align-self: stretch; display: flex; flex-direction: column; gap: 8px;
    padding: 8px 12px; border-radius: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(5,12,28,0.30));
    box-shadow: 0 5px 12px rgba(2,6,16,0.55), inset 0 1px 0 rgba(255,255,255,0.09), inset 0 -2px 4px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.25);
  }
  .info dl { margin: 0; display: grid; gap: 4px; }
  .info dl div { display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(201,211,230,0.12); padding-bottom: 2px; }
  .info dt { font-size: 10px; letter-spacing: 0.14em; color: var(--muted); font-weight: 600; }
  .info dd { margin: 0; font-family: Oswald, Inter, sans-serif; font-size: 12px; letter-spacing: 0.08em; color: var(--amber); }
  .wheel-sec { align-self: start; padding-top: 24px; }
  .knobs { align-self: stretch; padding: 12px 10px 8px; gap: 12px 6px; align-content: space-evenly; }
}

/* v7: manual links */
.man-link { color: var(--orange); text-decoration: none; letter-spacing: inherit; font-weight: 700; margin-left: 6px; border-bottom: 1px solid rgba(253,104,21,0.5); }
.man-link:hover, .man-link:focus-visible { color: var(--bone); border-bottom-color: var(--bone); outline: none; }
.ov-man { margin: 14px 0 0; font-size: 12px; letter-spacing: 0.06em; }
.ov-man .man-link { margin-left: 0; }
