:root {
  --walnut-dark: #1d120c;
  --walnut-mid: #321f14;
  --yellow-top: #f2cb5d;
  --yellow-mid: #ebc04f;
  --yellow-bottom: #dfa835;
  --yellow-edge-hi: #fae08c;
  --yellow-edge-lo: #b47e18;
  --ink-brown: #3f2814;
  --ink-muted: #6e5030;
  --ruby-bg: #1f0405;
  --ruby-glow: #ff3a1f;
  --cream-btn: #f4e6c7;
  --cream-btn-lo: #d9be8d;
  --teal-cap: #166a65;
  --teal-cap-lo: #0e4a47;
  --coral-cap: #e17e52;
  --coral-cap-lo: #ba582d;
  --brass-hi: #edd482;
  --brass-mid: #c59b3c;
  --brass-lo: #7a5814;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  color: var(--ink-brown);
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 200, 110, 0.08), transparent 60%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.015) 0px,
      rgba(255, 255, 255, 0.015) 2px,
      rgba(0, 0, 0, 0.06) 2px,
      rgba(0, 0, 0, 0.06) 6px
    ),
    linear-gradient(180deg, #27170f 0%, #170d08 100%);
}

.studio-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 12px;
}

/* ---------------- BUTTER-YELLOW INDUSTRIAL CASING ---------------- */
.device-shell {
  position: relative;
  width: 100%;
  max-width: 398px;
  border-radius: 34px;
  padding: 18px 20px 20px;
  background: linear-gradient(175deg, var(--yellow-top) 0%, var(--yellow-mid) 52%, var(--yellow-bottom) 100%);
  border: 2px solid rgba(255, 236, 168, 0.65);
  box-shadow:
    inset 0 3px 4px var(--yellow-edge-hi),
    inset 0 -8px 14px rgba(138, 92, 14, 0.45),
    inset 4px 0 8px rgba(255, 235, 160, 0.28),
    inset -4px 0 8px rgba(138, 92, 14, 0.25),
    0 24px 48px rgba(0, 0, 0, 0.68),
    0 4px 10px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 11px;
  user-select: none;
}

.device-shell.is-fever {
  box-shadow:
    inset 0 3px 6px #fff1b8,
    inset 0 -8px 14px rgba(138, 92, 14, 0.45),
    0 0 36px rgba(255, 195, 70, 0.35),
    0 24px 48px rgba(0, 0, 0, 0.68);
}

/* Corner Phillips Screws */
.corner-screw {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5f5f5 0%, #c0c3c7 52%, #7d8085 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    0 1px 2px rgba(80, 50, 10, 0.6);
  z-index: 5;
}

.corner-screw::before,
.corner-screw::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #4e5054;
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(18deg);
}

.corner-screw::before { width: 9px; height: 2px; }
.corner-screw::after { width: 2px; height: 9px; }

.screw-tl { top: 11px; left: 11px; }
.screw-tr { top: 11px; right: 11px; }
.screw-bl { bottom: 11px; left: 11px; }
.screw-br { bottom: 11px; right: 11px; }

/* ---------------- TOP BEZEL & PILOT LAMP ---------------- */
.top-bezel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 16px 0;
}

.bezel-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pilot-lamp {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff3bd 0%, #ffb732 45%, #cc6200 100%);
  border: 2px solid #b67d18;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.85),
    0 0 10px rgba(255, 165, 35, 0.78);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.device-shell.is-charging .pilot-lamp {
  box-shadow:
    inset 0 1px 3px #ffffff,
    0 0 18px 4px rgba(255, 145, 20, 0.95);
  transform: scale(1.06);
}

.device-shell.is-fever .pilot-lamp {
  animation: lamp-strobe 0.35s ease-in-out infinite alternate;
}

@keyframes lamp-strobe {
  from { box-shadow: 0 0 10px rgba(255, 175, 45, 0.8); }
  to { box-shadow: 0 0 22px 5px rgba(96, 239, 175, 0.95); }
}

.device-title {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--ink-brown);
  text-shadow: 0 1px 0 rgba(255, 240, 180, 0.75);
}

.deluxe-badge {
  appearance: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #916920;
  background: linear-gradient(180deg, #e3d6b8 0%, #b7a47e 100%);
  color: var(--ink-brown);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}

.deluxe-badge:hover {
  filter: brightness(1.06);
}

.bezel-vents {
  display: flex;
  gap: 5px;
  align-items: center;
}

.bezel-vents span {
  display: block;
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #3c2612 0%, #5c3c1f 100%);
  transform: skewX(-24deg);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 238, 170, 0.5);
}

/* Service Hatch */
.service-hatch {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(48, 28, 12, 0.92);
  color: #fceec7;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(255, 210, 120, 0.35);
}

.service-hatch[hidden] {
  display: none;
}

.hatch-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hatch-btn {
  appearance: none;
  cursor: pointer;
  flex: 1;
  min-width: 90px;
  padding: 5px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 218, 140, 0.35);
  background: #4e3119;
  color: #fff2cf;
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
}

.hatch-btn:hover { background: #654122; }
.hatch-btn.is-warn { background: #6f261e; border-color: rgba(255, 130, 110, 0.45); }
.hatch-help { font-size: 10px; opacity: 0.8; line-height: 1.35; }

/* ---------------- RUBY DOT-MATRIX VFD ---------------- */
.vfd-bezel {
  border-radius: 14px;
  padding: 6px 8px;
  background: linear-gradient(180deg, #270406 0%, #150203 100%);
  border: 2px solid #966619;
  box-shadow:
    inset 0 4px 10px rgba(0, 0, 0, 0.95),
    inset 0 -1px 3px rgba(255, 90, 50, 0.2),
    0 1px 0 rgba(255, 238, 175, 0.65);
}

#vfdCanvas {
  display: block;
  width: 100%;
  height: 70px;
  border-radius: 8px;
}

/* ---------------- SCREEN PANELS ---------------- */
.screen-panel {
  display: none;
  flex-direction: column;
  gap: 11px;
}

.screen-panel.is-active {
  display: flex;
}

/* ---------------- BRUSHED ALUMINUM INSTRUMENT STRIP (1A) ---------------- */
.instrument-plate {
  position: relative;
  border-radius: 12px;
  padding: 11px 12px 10px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.05) 0px,
      rgba(255, 255, 255, 0.05) 1px,
      rgba(0, 0, 0, 0.03) 1px,
      rgba(0, 0, 0, 0.03) 3px
    ),
    linear-gradient(180deg, #e5e7ea 0%, #c8ccd2 55%, #b1b6bd 100%);
  border: 1.5px solid #8a8f96;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25),
    0 2px 5px rgba(90, 58, 10, 0.35);
  display: grid;
  grid-template-columns: 1.25fr 0.7fr 0.95fr;
  gap: 8px;
  align-items: center;
}

.plate-screw {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5f5f5 0%, #8f949a 100%);
  box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.55);
}
.ps-tl { top: 4px; left: 4px; }
.ps-tr { top: 4px; right: 4px; }
.ps-bl { bottom: 4px; left: 4px; }
.ps-br { bottom: 4px; right: 4px; }

.instrument-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.instrument-caption {
  font-size: 11px;
  font-weight: 800;
  color: #36393e;
  letter-spacing: 0.06em;
}

/* Split-Flap Counter */
.split-flap-housing {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #17181b;
  border: 1.5px solid #53565c;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.85);
}

.flap-digit {
  position: relative;
  width: 17px;
  height: 26px;
  border-radius: 3px;
  background: linear-gradient(180deg, #2d3036 0%, #1c1e22 49%, #141518 51%, #26292e 100%);
  color: #f9fafb;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.flap-digit::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, 0.85);
}

.flap-digit.is-flipping {
  animation: flap-bounce 0.24s ease;
}

@keyframes flap-bounce {
  0% { transform: scaleY(1); }
  45% { transform: scaleY(0.25); }
  100% { transform: scaleY(1); }
}

.flap-comma {
  color: #e5e7eb;
  font-weight: 800;
  font-size: 13px;
  margin: 0 0 2px;
  align-self: flex-end;
}

.flap-unit {
  color: #d1d5db;
  font-size: 11px;
  font-weight: 800;
  margin-left: 2px;
}

/* Rotary Mode Knob */
.instrument-center {
  display: flex;
  justify-content: center;
}

.rotary-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.mode-labels {
  display: flex;
  gap: 5px;
  align-items: flex-end;
}

.mode-label {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 9px;
  font-weight: 800;
  color: #545960;
  transition: color 0.15s ease;
}

.mode-label.is-active {
  color: #8c210e;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rotary-knob {
  appearance: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #767b82;
  padding: 4px;
  background: conic-gradient(
    from 0deg,
    #cfd3d8, #8c929a, #f1f3f5, #959ba3, #d6dade, #868c94, #cfd3d8
  );
  box-shadow:
    0 4px 7px rgba(0, 0, 0, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.75);
  transition: transform 0.22s cubic-bezier(0.22, 1.25, 0.36, 1);
}

.knob-cap {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5f6f8 0%, #c1c6cd 70%, #989ea6 100%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.knob-marker {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 2.5px;
  height: 11px;
  border-radius: 2px;
  background: #27292d;
  transform: translateX(-50%);
}

/* Toggles & VU Meter */
.instrument-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.toggles-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chrome-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 3px;
}

.toggle-tag {
  font-size: 9px;
  font-weight: 800;
  color: #3f4348;
}

.toggle-well {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #60646b 0%, #c9cdd2 65%, #777b82 100%);
  border: 1px solid #595d63;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-bat {
  width: 7px;
  height: 11px;
  border-radius: 4px;
  background: linear-gradient(90deg, #aeb3ba, #ffffff, #888d94);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.45);
  transform: translateY(2px);
  transition: transform 0.16s ease;
}

.chrome-toggle.is-on .toggle-bat {
  transform: translateY(-4px);
}

.vu-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.vu-caption {
  font-size: 9px;
  font-weight: 800;
  color: #33363b;
}

.vu-dial {
  position: relative;
  width: 58px;
  height: 36px;
  border-radius: 999px 999px 10px 10px;
  background: radial-gradient(circle at 50% 80%, #fffaf0 0%, #ead6b0 100%);
  border: 2px solid #2b2e33;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.device-shell.is-charging .vu-dial {
  background: radial-gradient(circle at 50% 80%, #ffe6b8 0%, #f0955a 100%);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45), 0 0 10px rgba(255, 115, 40, 0.8);
}

.device-shell.is-fever .vu-dial {
  background: radial-gradient(circle at 50% 80%, #e9ffef 0%, #8de5a9 100%);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.45), 0 0 10px rgba(80, 225, 145, 0.85);
}

.vu-scale {
  position: absolute;
  left: 7px;
  right: 7px;
  top: 7px;
  height: 28px;
  border-radius: 50%;
  border-top: 2px dashed #5d4732;
}

.vu-redzone {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 22px;
  height: 16px;
  border-radius: 0 40px 0 0;
  border-top: 2.5px solid #d42b1c;
}

.vu-vu-text {
  position: absolute;
  left: 50%;
  bottom: 9px;
  transform: translateX(-50%);
  font-size: 7px;
  font-weight: 800;
  color: #5b4834;
}

.vu-needle {
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 2px;
  height: 25px;
  background: #d82c1a;
  border-radius: 1px;
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(-42deg);
}

.vu-hub {
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2b2e33;
  transform: translateX(-50%);
}

/* ---------------- 2x3 SCULPTED KEYWELL & KEYCAPS (1A/1D/1E) ---------------- */
.keywell-tray {
  border-radius: 14px;
  padding: 9px;
  background: linear-gradient(180deg, #b88422 0%, #cf982d 100%);
  box-shadow:
    inset 0 4px 10px rgba(92, 56, 8, 0.58),
    inset 0 -2px 4px rgba(255, 228, 145, 0.45);
  transition: box-shadow 0.2s ease;
}

.device-shell.is-charging .keywell-tray {
  box-shadow:
    inset 0 4px 12px rgba(255, 130, 15, 0.85),
    0 0 16px rgba(255, 162, 42, 0.65);
}

.keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.keycap-btn {
  position: relative;
  appearance: none;
  cursor: pointer;
  height: 92px;
  border-radius: 13px;
  padding: 8px 5px 7px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
  overflow: hidden;
}

.keycap-btn::before {
  content: "";
  position: absolute;
  inset: 4px 5px 8px;
  border-radius: 9px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.04));
  pointer-events: none;
}

/* Material Variants */
.mat-cream_pbt {
  background: linear-gradient(180deg, #f8ecd2 0%, #e7cfa0 100%);
  color: var(--ink-brown);
  box-shadow: 0 5px 0 #b89861, 0 8px 12px rgba(60, 35, 5, 0.42);
}

.mat-teal_pbt {
  background: linear-gradient(180deg, #21857f 0%, #145e59 100%);
  color: #f3fbf8;
  border-color: rgba(155, 245, 232, 0.35);
  box-shadow: 0 5px 0 #0a3c39, 0 8px 12px rgba(10, 45, 42, 0.5);
}

.mat-coral_pbt {
  background: linear-gradient(180deg, #ea8b60 0%, #cf6538 100%);
  color: #fff8f2;
  box-shadow: 0 5px 0 #953e1b, 0 8px 12px rgba(85, 30, 10, 0.45);
}

.mat-amber_resin {
  background: radial-gradient(circle at 50% 35%, rgba(255, 224, 130, 0.92) 0%, rgba(217, 134, 24, 0.92) 70%, rgba(164, 88, 10, 0.96) 100%);
  color: #2f1a06;
  border-color: rgba(255, 232, 165, 0.72);
  box-shadow:
    inset 0 2px 6px rgba(255, 250, 210, 0.75),
    0 5px 0 #8a4b0b,
    0 8px 14px rgba(130, 65, 5, 0.48);
}

.mat-clear_capsule {
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.92) 0%, rgba(215, 226, 236, 0.72) 55%, rgba(165, 178, 192, 0.85) 100%);
  color: #252b33;
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 2px 7px rgba(255, 255, 255, 0.9),
    0 5px 0 #86929e,
    0 8px 12px rgba(45, 55, 65, 0.4);
}

.mat-brass {
  background: linear-gradient(135deg, #f3dc8d 0%, #c89d3c 50%, #f2d987 100%);
  color: #342105;
  border-color: #fff0b3;
  box-shadow: 0 5px 0 #7a5813, 0 8px 12px rgba(70, 48, 8, 0.48);
}

.mat-mint_glow {
  background: linear-gradient(180deg, #bff8dc 0%, #6cd3a6 100%);
  color: #0e3d2b;
  border-color: #e4fff2;
  box-shadow:
    inset 0 0 10px rgba(255, 255, 255, 0.65),
    0 5px 0 #398e6b,
    0 6px 14px rgba(70, 230, 160, 0.5);
}

.mat-kintsugi_wood {
  background: linear-gradient(155deg, #3b2a21 0%, #1d1410 100%);
  color: #f8e5b2;
  border-color: #d7ab4c;
  box-shadow: 0 5px 0 #0c0806, 0 8px 12px rgba(0, 0, 0, 0.55);
}

.mat-ice_soda {
  background: radial-gradient(circle at 30% 25%, #ffffff 0%, #cde8f6 58%, #90bfd8 100%);
  color: #16374b;
  border-color: #ffffff;
  box-shadow: 0 5px 0 #5b8ca8, 0 8px 12px rgba(30, 70, 95, 0.4);
}

.mat-daruma {
  background: radial-gradient(circle at 40% 30%, #f54a35 0%, #b51d11 100%);
  color: #fff3da;
  border-color: #ff9c8a;
  box-shadow: 0 5px 0 #6e0e07, 0 8px 12px rgba(90, 10, 5, 0.48);
}

.mat-quartz {
  background: linear-gradient(145deg, #f9f6fb 0%, #d2cbe0 52%, #a8a0bd 100%);
  color: #2f2842;
  border-color: #ffffff;
  box-shadow: 0 5px 0 #766d8c, 0 8px 12px rgba(55, 45, 80, 0.42);
}

.mat-ramen_resin {
  background: radial-gradient(circle at 50% 45%, #fbe8cb 0%, #d99762 75%, #9f5a2d 100%);
  color: #361807;
  border-color: #ffe2bd;
  box-shadow: 0 5px 0 #723b18, 0 8px 12px rgba(70, 35, 10, 0.45);
}

.mat-retro_calc {
  background: linear-gradient(180deg, #eae6cf 0%, #cbc5a4 100%);
  color: #2d3221;
  border-color: #faf7e8;
  box-shadow: 0 5px 0 #8a8466, 0 8px 12px rgba(50, 48, 30, 0.42);
}

.mat-tourbillon {
  background: linear-gradient(145deg, #f3da8a 0%, #8f6b24 100%);
  color: #fff6dc;
  border-color: #ffeeb3;
  box-shadow: 0 5px 0 #523b0d, 0 8px 12px rgba(55, 40, 8, 0.5);
}

.mat-obsidian {
  background: linear-gradient(145deg, #273245 0%, #0f141d 100%);
  color: #a9f7df;
  border-color: #5eead4;
  box-shadow: 0 5px 0 #070a10, 0 8px 14px rgba(45, 212, 191, 0.35);
}

.mat-lucky_cat {
  background: linear-gradient(160deg, #fff2c2 0%, #e7b54a 100%);
  color: #502708;
  border-color: #fff8df;
  box-shadow: 0 5px 0 #9f6f18, 0 8px 12px rgba(110, 70, 10, 0.45);
}

/* Pressed & Fever States */
.keycap-btn:active,
.keycap-btn.is-pressed {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45), 0 0 14px rgba(105, 255, 195, 0.65);
}

.device-shell.is-fever .keycap-btn {
  animation: fever-underglow 0.6s ease-in-out infinite alternate;
}

.device-shell.is-fever .keycap-btn:nth-child(2n) {
  animation-delay: 0.18s;
}

@keyframes fever-underglow {
  from { filter: brightness(1); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35), 0 0 12px rgba(80, 235, 165, 0.72); }
  to { filter: brightness(1.08); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35), 0 0 18px rgba(255, 200, 72, 0.85); }
}

.key-tally {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #2c251d;
  color: #f6ead0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
  z-index: 2;
}

.key-switch-tag {
  position: absolute;
  top: 4px;
  left: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0.8;
  z-index: 2;
}

.key-icon-box {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.key-icon-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.key-name {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.key-price {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  opacity: 0.92;
}

/* ---------------- HOLD-TO-SEAL BAR & VISIBLE COIL SPRING ---------------- */
.seal-dock {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.heavy-target-strip {
  display: flex;
  justify-content: center;
}

.heavy-target-pill {
  appearance: none;
  cursor: pointer;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(90, 56, 12, 0.35);
  background: rgba(255, 245, 208, 0.45);
  color: var(--ink-brown);
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
}

.heavy-target-pill:hover {
  background: rgba(255, 245, 208, 0.72);
}

.hold-bar-slot {
  padding: 3px;
  border-radius: 999px;
  background: #8e5f14;
  box-shadow: inset 0 2px 5px rgba(45, 24, 2, 0.7);
}

.hold-seal-bar {
  position: relative;
  appearance: none;
  cursor: pointer;
  touch-action: none;
  width: 100%;
  height: 40px;
  border-radius: 999px;
  border: 1.5px solid #e7eaef;
  background: linear-gradient(180deg, #e7eaee 0%, #b7bcc3 100%);
  color: #242629;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  overflow: hidden;
  box-shadow: 0 5px 0 #70757c, 0 8px 12px rgba(40, 22, 2, 0.45);
  transition: transform 0.06s linear, box-shadow 0.06s linear;
}

.hold-seal-bar.is-held {
  transform: translateY(var(--press-y, 4px));
  box-shadow: 0 1px 0 #575b61, 0 0 16px rgba(255, 145, 25, 0.85);
}

.hold-bar-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 155, 35, 0.42), rgba(255, 85, 25, 0.58));
  pointer-events: none;
}

.hold-bar-text {
  position: relative;
  z-index: 1;
}

.deck-bottom-row {
  display: grid;
  grid-template-columns: 1fr 72px 1fr;
  align-items: center;
  gap: 8px;
}

.spring-bay {
  position: relative;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(180deg, #2d1b0a 0%, #190e04 100%);
  border: 1.5px solid #8c5e14;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 3px;
  overflow: hidden;
}

.spring-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(255, 160, 32, 0.9), transparent 72%);
  opacity: 0;
  transition: opacity 0.1s ease;
  pointer-events: none;
}

.device-shell.is-charging .spring-glow {
  opacity: 1;
}

.coil-spring-wrap {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 29px;
  transform-origin: bottom center;
  transition: transform 0.06s linear;
}

.coil-spring-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.spring-foot-cap {
  position: relative;
  z-index: 2;
  width: 56px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, #eef0f3 0%, #8f959e 100%);
}

/* Tactile Cream Buttons */
.cream-pill-btn,
.cream-square-btn {
  position: relative;
  appearance: none;
  cursor: pointer;
  height: 36px;
  border-radius: 999px;
  border: 1.5px solid #fff3d5;
  background: linear-gradient(180deg, var(--cream-btn) 0%, var(--cream-btn-lo) 100%);
  color: var(--ink-brown);
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 3px 0 #9f7529, 0 5px 8px rgba(70, 42, 6, 0.35);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.cream-square-btn {
  border-radius: 10px;
  min-width: 48px;
  padding: 0 10px;
}

.cream-pill-btn:active,
.cream-square-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #9f7529;
}

.cream-pill-btn.is-wide,
.cream-pill-btn.is-full {
  width: 100%;
}

.new-key-badge {
  position: absolute;
  top: -7px;
  right: 4px;
  padding: 1px 5px;
  border-radius: 999px;
  background: #e12c1a;
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  box-shadow: 0 0 8px rgba(255, 50, 30, 0.85);
}

/* ---------------- SCREEN 2: FOUNDRY (1B) ---------------- */
.foundry-stage {
  border-radius: 14px;
  padding: 12px 10px 10px;
  background: linear-gradient(180deg, #cd972c 0%, #dcab3e 100%);
  box-shadow: inset 0 4px 10px rgba(95, 58, 8, 0.52);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.foundry-preview-bay {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.foundry-preview-key {
  width: 96px;
  height: 92px;
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transform: rotate(-7deg);
  transition: transform 0.2s ease, background 0.2s ease;
}

.foundry-preview-key.is-bouncing {
  transform: rotate(-7deg) scale(0.93) translateY(4px);
}

.exploded-arrow {
  font-size: 13px;
  color: #4f3112;
  opacity: 0.78;
}

.switch-dock {
  width: 100%;
  border-radius: 10px;
  padding: 8px 6px;
  background: linear-gradient(180deg, #dde0e4 0%, #b4b9c0 100%);
  border: 1px solid #82878e;
  box-shadow: inset 0 1px 1px #ffffff, 0 2px 4px rgba(0, 0, 0, 0.25);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.switch-cell {
  appearance: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 5px 2px;
  border: 1.5px solid transparent;
  background: rgba(255, 255, 255, 0.22);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #2c3035;
}

.switch-cell.is-selected {
  border-color: #2c6be2;
  background: rgba(65, 145, 255, 0.18);
  box-shadow: 0 0 10px rgba(65, 145, 255, 0.35);
}

.switch-svg-box {
  width: 40px;
  height: 40px;
}

.switch-svg-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.switch-label {
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.switch-feel {
  font-size: 9px;
  font-weight: 700;
  opacity: 0.85;
}

.material-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.swatch-btn {
  appearance: none;
  cursor: pointer;
  height: 40px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 3px 0 rgba(90, 56, 8, 0.45);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.swatch-btn.is-selected {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px #d95d24, 0 3px 0 rgba(90, 56, 8, 0.45);
  transform: translateY(-2px);
}

.icon-picker-row {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.icon-pick-btn {
  appearance: none;
  cursor: pointer;
  flex: 0 0 33px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid #b8882d;
  background: rgba(248, 232, 194, 0.72);
  color: var(--ink-brown);
  padding: 4px;
}

.icon-pick-btn.is-selected {
  background: #176a65;
  color: #ffffff;
  border-color: #0e4a47;
}

.icon-pick-btn svg {
  width: 100%;
  height: 100%;
  display: block;
}

.foundry-name-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f5ebd2;
  border: 1.5px solid #c59b45;
  box-shadow: inset 0 2px 4px rgba(100, 65, 10, 0.2);
}

.slot-label { font-size: 12px; font-weight: 800; color: var(--ink-muted); white-space: nowrap; }
.slot-sep { color: #c4a46b; font-weight: 700; }

.slot-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink-brown);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  outline: none;
}

.slot-target-btn {
  appearance: none;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid #a97b28;
  background: #e5cb94;
  color: var(--ink-brown);
  font-size: 10px;
  font-weight: 800;
  font-family: inherit;
}

/* Price Mechanical Drum */
.odometer-deck {
  border-radius: 11px;
  padding: 7px 10px;
  background: #2b2319;
  border: 1.5px solid #9e7322;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  gap: 8px;
}

.knurled-thumbwheel {
  appearance: none;
  cursor: ns-resize;
  width: 58px;
  height: 46px;
  border-radius: 6px;
  border: 1px solid #6b7078;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.25) 0px, rgba(0, 0, 0, 0.25) 2px, rgba(255, 255, 255, 0.1) 4px),
    linear-gradient(90deg, #8b9199, #eef1f4 50%, #7d838b);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.7), 0 2px 4px rgba(0, 0, 0, 0.6);
}

.price-drum-window {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.drum-wheel {
  appearance: none;
  cursor: pointer;
  height: 46px;
  border-radius: 5px;
  border: 1px solid #595d64;
  background: linear-gradient(180deg, #101214 0%, #3a3e45 48%, #101214 100%);
  color: #f8fafc;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 19px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  overflow: hidden;
  padding: 0;
}

.drum-wheel .adj {
  font-size: 8px;
  opacity: 0.35;
}

.drum-unit {
  color: #f6e7c4;
  font-size: 15px;
  font-weight: 800;
}

.foundry-actions {
  display: grid;
  grid-template-columns: 54px 48px 1fr;
  gap: 8px;
}

/* ---------------- SCREEN 3: THERMAL RECEIPT & DRAWER (1C) ---------------- */
.printer-bay {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.printer-slot {
  height: 18px;
  border-radius: 7px;
  padding: 5px 10px;
  background: linear-gradient(180deg, #b8bec6 0%, #80868e 100%);
  border: 1px solid #60656c;
  box-shadow: inset 0 1px 1px #ffffff, 0 2px 4px rgba(70, 42, 6, 0.35);
}

.printer-slot-lip {
  height: 5px;
  border-radius: 3px;
  background: #17120d;
}

.receipt-well {
  padding: 0 10px;
  margin-top: -5px;
  overflow: hidden;
}

.thermal-receipt {
  background: linear-gradient(180deg, #f3e4cb 0%, #fdf5e6 18%, #f8ebd4 100%);
  color: #362211;
  padding: 14px 14px 18px;
  box-shadow: 0 8px 14px rgba(55, 32, 6, 0.35);
  clip-path: polygon(
    0 0, 100% 0, 100% calc(100% - 8px),
    96% 100%, 92% calc(100% - 7px), 88% 100%, 84% calc(100% - 7px), 80% 100%,
    76% calc(100% - 7px), 72% 100%, 68% calc(100% - 7px), 64% 100%, 60% calc(100% - 7px),
    56% 100%, 52% calc(100% - 7px), 48% 100%, 44% calc(100% - 7px), 40% 100%,
    36% calc(100% - 7px), 32% 100%, 28% calc(100% - 7px), 24% 100%, 20% calc(100% - 7px),
    16% 100%, 12% calc(100% - 7px), 8% 100%, 4% calc(100% - 7px), 0 calc(100% - 8px)
  );
  animation: receipt-feed 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes receipt-feed {
  from { transform: translateY(-28px); opacity: 0.3; }
  to { transform: translateY(0); opacity: 1; }
}

.receipt-heading {
  margin: 0 0 6px;
  text-align: center;
  font-size: 17px;
  font-weight: 900;
}

.receipt-rule {
  height: 1.5px;
  background: #4e341c;
  margin-bottom: 8px;
}

.receipt-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 132px;
  overflow-y: auto;
}

.receipt-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 8px;
  padding-bottom: 5px;
  border-bottom: 1px dashed rgba(90, 56, 20, 0.35);
}

.receipt-row:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.r-time {
  font-size: 9.5px;
  line-height: 1.15;
  color: #6c4d2e;
  font-weight: 700;
}

.r-name {
  font-size: 13px;
  font-weight: 800;
}

.r-yen {
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.receipt-dots {
  border-top: 1.5px dashed rgba(90, 56, 20, 0.45);
  margin: 8px 0 9px;
}

.stamp-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 30px;
}

.hanko-stamp {
  padding: 2px 7px;
  border: 2px solid #c92f1e;
  border-radius: 4px;
  color: #c92f1e;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: rgba(201, 47, 30, 0.04);
  transform: rotate(var(--tilt, -6deg));
  animation: stamp-slam 0.25s ease-out;
}

@keyframes stamp-slam {
  from { transform: scale(1.45) rotate(var(--tilt, -6deg)); opacity: 0.2; }
  to { transform: scale(1) rotate(var(--tilt, -6deg)); opacity: 1; }
}

.mini-drawer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.drawer-caption {
  font-size: 11px;
  font-weight: 900;
  color: var(--ink-brown);
}

.mini-velvet-drawer {
  appearance: none;
  cursor: pointer;
  width: 100%;
  border-radius: 12px;
  padding: 10px;
  border: 2px solid #a6761f;
  background: radial-gradient(circle at 50% 30%, #2b2723 0%, #141210 100%);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.9);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-drawer-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #f6e7c4;
  font-size: 10px;
  font-weight: 800;
}

.mini-cap-thumb {
  width: 66px;
  height: 62px;
  border-radius: 11px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-cap-thumb.is-locked {
  border: 1.5px dashed rgba(246, 231, 196, 0.45);
  background: rgba(255, 255, 255, 0.04);
}

/* ---------------- SCREEN 4: 12-SLOT COMPENDIUM (2A) ---------------- */
.specimen-case {
  border-radius: 13px;
  padding: 8px;
  background: radial-gradient(circle at 50% 25%, #2a2520 0%, #15120f 100%);
  border: 2px solid #986b1a;
  box-shadow: inset 0 5px 12px rgba(0, 0, 0, 0.9);
}

.compendium-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.specimen-cell {
  appearance: none;
  cursor: pointer;
  border-radius: 9px;
  padding: 6px 4px 5px;
  border: 1.5px solid rgba(190, 148, 66, 0.35);
  background: rgba(28, 24, 20, 0.88);
  color: #f4e6c7;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.specimen-cell.is-selected {
  border-color: #f6c959;
  box-shadow: 0 0 12px rgba(246, 201, 89, 0.45);
  background: rgba(54, 42, 24, 0.92);
}

.specimen-cell:active {
  transform: scale(0.97);
}

.specimen-cap {
  width: 64px;
  height: 58px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.specimen-cap svg {
  width: 44px;
  height: 44px;
  display: block;
}

.specimen-socket {
  width: 64px;
  height: 58px;
  border-radius: 10px;
  border: 1.5px dashed rgba(220, 200, 155, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
}

.specimen-socket svg {
  width: 38px;
  height: 38px;
  opacity: 0.72;
}

.specimen-label {
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.plaque-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.aluminum-plaque {
  flex: 1;
  padding: 7px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e7eaef 0%, #bcc1c9 100%);
  border: 1px solid #868b92;
  color: #26292e;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 1px 1px #ffffff, 0 2px 4px rgba(60, 35, 5, 0.3);
}

.plaque-slot-btn {
  appearance: none;
  cursor: pointer;
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid #94681c;
  background: #f3e0b6;
  color: var(--ink-brown);
  font-size: 10px;
  font-weight: 900;
  font-family: inherit;
  white-space: nowrap;
}

.compendium-actions {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
}
