@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("../fonts/barlow-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --sans: "Barlow Condensed", "Avenir Next Condensed", "Avenir Next", sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --phosphor: #ffd48a;
  --amber: #ffb703;
  --fault: #e07068;
  --good: #3dd68c;
  --lit: #7eb6ff;
  --lit-glow: rgba(90, 160, 255, 0.9);
  --paper: #efe6d6;
  --brass: #c6a15a;
  --muted: #8d8476;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  min-height: 100lvh;
  overflow: hidden;
  background: #262c32;
  overscroll-behavior: none;
}

html {
  position: fixed;
  inset: 0;
}

body {
  position: fixed;
  inset: 0;
  font-family: var(--sans);
  color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-touch-callout: none;
  touch-action: none;
}

button, input { font: inherit; color: inherit; touch-action: manipulation; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

@media (min-width: 560px) {
  html, body {
    background:
      radial-gradient(900px 520px at 50% 20%, #2c2924 0%, #0c0d10 58%);
  }

  body {
    display: grid;
    place-items: center;
  }
}

.cap, .bezel, .dock, .deck { position: relative; z-index: 1; }

.handset {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  min-height: 100lvh;
  max-height: none;
  margin: 0;
  overflow: hidden;
  padding:
    calc(12px + env(safe-area-inset-top))
    0
    calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, #30363c, #262c32);
  user-select: none;
}

.cap, .dock, .deck { flex: none; }

@media (min-width: 560px) {
  .handset {
    position: relative;
    inset: auto;
    width: min(430px, calc(100% - 36px));
    height: min(920px, calc(100% - 36px));
    min-height: 0;
    border-radius: 42px;
    overflow: hidden;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.22),
      0 28px 70px rgba(0, 0, 0, 0.5);
  }
}

.screw-row {
  display: grid;
  grid-template-columns: 14px 1fr 14px;
  gap: 10px;
  align-items: center;
  margin: 2px 18px 0;
}

.screw {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background:
    linear-gradient(#1a1c1f, #1a1c1f) center / 8px 1.5px no-repeat,
    conic-gradient(from 30deg, #8a8170, #e4dcc8, #6e6758, #d5ccb8, #8a8170);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45), 0 1px 1px rgba(0, 0, 0, 0.55);
}

.grille {
  height: 22px;
  border-radius: 7px;
  background:
    repeating-linear-gradient(90deg, #0c0e10 0 2px, #24282c 2px 5px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.65), 0 1px 0 rgba(255, 255, 255, 0.08);
}

.plate {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 18px 20px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(198, 161, 90, 0.5);
}

.plate-kicker {
  margin: 0 0 2px;
  color: var(--brass);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.plate h1 {
  margin: 0;
  font-size: 38px;
  line-height: 0.8;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.serial {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  padding: 10px 0 2px 12px;
  cursor: default;
}

.jewels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 4px;
  padding: 0 22px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lamp-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.code-red {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  color: var(--lit);
  text-shadow: 0 0 8px var(--lit-glow);
  white-space: nowrap;
}

.code-red[hidden] { display: none !important; }

.code-red span {
  font-size: 9px;
  letter-spacing: 0.14em;
}

#codeRedTime {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.code-red[data-hot="yes"] {
  color: #ff3b30;
  text-shadow: 0 0 10px rgba(255, 59, 48, 0.95);
}

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

.jewel i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a2422;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.85);
}

[data-lamp="power"] i {
  background: #efe6d6;
  box-shadow: 0 0 7px rgba(239, 230, 214, 0.8);
}

.handset[data-link="alert"] [data-lamp="link"] i,
.handset[data-link="online"] [data-lamp="link"] i,
.handset[data-link="restoring"] [data-lamp="link"] i {
  background: var(--good);
  box-shadow: 0 0 8px var(--good);
}

.handset[data-link="offline"] [data-lamp="link"] i,
.handset[data-link="dropping"] [data-lamp="link"] i {
  background: #ff3b30;
  box-shadow: 0 0 8px #ff3b30;
}

.handset[data-link="dropping"] [data-lamp="link"] i {
  animation: blink 0.18s steps(2) infinite;
}

.handset[data-link="alert"] [data-lamp="alert"] i {
  background: #ff2a1a;
  box-shadow: 0 0 8px #ff2a1a;
  animation: blink 1.05s steps(2) infinite;
}

.handset[data-playing="yes"] [data-lamp="alert"] i {
  animation: none;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.bezel {
  flex: 1;
  min-height: 0;
  margin: 0 16px;
  padding: 10px;
  border-radius: 22px;
  background: #070808;
  box-shadow:
    inset 0 0 0 1px #3a3124,
    inset 0 0 0 4px #101113,
    0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
}

.crt {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, #3a2c16 0%, #16110b 55%, #0c0a08 100%);
}

.handset[data-link="offline"] .crt,
.handset[data-link="dropping"] .crt {
  background: #050607;
}

#noise {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.handset[data-mode="scan"] #noise,
.handset[data-mode="radio"] #noise,
.handset[data-mode="log"] #noise,
.handset[data-mode="arc"] #noise { opacity: 0.1; }
.handset[data-link="offline"] #noise { opacity: 0.46; }
.handset[data-link="dropping"] #noise { opacity: 0.62; }
.handset[data-scanning="yes"] #noise,
.handset[data-sonar="yes"] #noise { opacity: 0.05; }

.handset[data-sonar="yes"] .crt {
  background: radial-gradient(circle at 50% 42%, #143d28 0%, #062016 58%, #03140c 100%);
}

.handset[data-sonar="yes"] .crt-ui { color: #c8ffb0; }

.handset[data-preview="yes"] .radar-panel { pointer-events: none; }

.crt-ui {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  color: var(--phosphor);
  transform-origin: center;
}

.handset[data-link="offline"] .crt-ui,
.handset[data-link="dropping"] .crt-ui {
  color: var(--fault);
}

.handset[data-link="dropping"] .crt-ui {
  animation: crt-die 0.9s cubic-bezier(0.45, 0, 0.2, 1) forwards;
}

.readout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.meter {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 12px;
}

.meter i {
  display: block;
  width: 3px;
  background: currentColor;
  opacity: 0.22;
}

.meter i:nth-child(1) { height: 3px; }
.meter i:nth-child(2) { height: 5px; }
.meter i:nth-child(3) { height: 7px; }
.meter i:nth-child(4) { height: 9px; }
.meter i:nth-child(5) { height: 12px; }

.handset[data-link="alert"] .meter i:nth-child(-n + 3),
.handset[data-link="online"] .meter i:nth-child(-n + 4),
.handset[data-link="restoring"] .meter i:nth-child(-n + 4) {
  opacity: 0.95;
}

.handset[data-link="online"] .meter i:nth-child(4) {
  animation: pulse 1.8s ease-in-out infinite;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

.stage > section { height: 100%; }
.stage > section[hidden] { display: none !important; }

.stop-note {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: inherit;
  padding: 8px 14px 7px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stop-note[hidden] { display: none !important; }

.permit {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 24px 32px;
  background: #262c32;
}

.permit[hidden] { display: none !important; }

.permit-continue {
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.72;
}

.permit-continue[hidden] { display: none !important; }

.home-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 18px 22px;
}

.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.72;
}

h2 {
  margin: 3px 0 8px;
  font-size: 42px;
  line-height: 0.88;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.lede {
  margin: 0;
  max-width: 26ch;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  opacity: 0.86;
}

.handset[data-link="offline"] h2 {
  animation: flicker 3.6s infinite;
}

#wave {
  width: 100%;
  height: 64px;
  margin-top: 14px;
}

.time {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.screen-key {
  width: 100%;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  background: var(--amber);
  color: #1a1206;
  padding: 13px 16px 12px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 8px 18px rgba(0, 0, 0, 0.28);
}

.screen-key:active { transform: translateY(1px); }
.screen-key:disabled { opacity: 0.7; }

.warn {
  margin: 8px 0 0;
  font-size: 15px;
}

.viewfinder {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  background: #050607;
}

.gate {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 14px;
  padding: 18px 18px 22px;
}

.gate .screen-key { margin-top: 0; }

.offline-copy {
  margin: 0;
  color: #ffd2cb;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
}

.qr-glyph {
  width: 64px;
  height: 64px;
  margin: 2px auto 0;
}

.gate[hidden],
#scanLive[hidden],
#radioLive[hidden],
#finder[hidden],
#logPlayer[hidden],
#logList[hidden] {
  display: none !important;
}

.radio-live {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 8px;
}

.radio-live::after {
  content: "";
  flex: 1 1 0;
  min-height: 0;
}

.compass-bay {
  flex: 1.4 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
}

.corner-compass {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 52px;
}

.arrowhead {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 16px solid #ff3b30;
  filter: drop-shadow(0 0 4px rgba(255, 59, 48, 0.55));
}

.bearing {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
}

.corner-compass .lede {
  display: none;
  width: 14ch;
  margin: 4px 0 0;
  font-size: 11px;
  text-align: center;
}

.corner-compass .lede:not([hidden]) { display: block; }

.band { width: min(250px, 74%); }

.band-window {
  position: relative;
  height: 52px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(#241c12, #100e0b);
  box-shadow:
    inset 0 0 0 1px rgba(255, 212, 138, 0.4),
    inset 0 10px 14px rgba(0, 0, 0, 0.35);
}

.band-scale {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 260%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 4px 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  background-image: repeating-linear-gradient(90deg, transparent 0 15px, currentColor 15px 16px);
  background-repeat: repeat-x;
  background-size: 100% 16px;
  background-position: center top 8px;
}

.band-scale span {
  position: relative;
}

.band-scale span::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: 1px;
  height: 18px;
  background: currentColor;
  opacity: 0.7;
}

.band-hair {
  position: absolute;
  left: 50%;
  top: 4px;
  bottom: 4px;
  width: 2px;
  margin-left: -1px;
  background: #ff4b3a;
  box-shadow: 0 0 8px #ff4b3a;
}

.band-freq {
  margin: 8px 0 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 28px;
  letter-spacing: 0.14em;
}

.radio-live .wheel { margin-top: 16px; }

.wheel {
  position: relative;
  width: min(180px, 48vw);
  aspect-ratio: 1;
  border-radius: 50%;
  touch-action: none;
  background: conic-gradient(
    from var(--tune, 51deg),
    #f4f1ea,
    #b7b1a4 22%,
    #f7f4ee 48%,
    #8a8478 74%,
    #f4f1ea
  );
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 10px 18px rgba(0, 0, 0, 0.28);
}

.wheel-core {
  position: absolute;
  inset: 27%;
  display: flex;
  flex-direction: column;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6a645b, #1a1714 68%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.2);
}

.wheel-core::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-0.5px);
  pointer-events: none;
  z-index: 1;
}

.tune-nudge {
  flex: 1 1 0;
  display: grid;
  place-items: center;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #f4f1ea;
  appearance: none;
  border-radius: 0;
  -webkit-tap-highlight-color: transparent;
}

.tune-nudge:first-child { clip-path: ellipse(50% 100% at 50% 100%); }
.tune-nudge:last-child { clip-path: ellipse(50% 100% at 50% 0%); }

.tune-nudge:focus { outline: none; }

.tune-nudge svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tune-nudge:first-child svg { transform: translateY(3px); }
.tune-nudge:last-child svg { transform: translateY(-3px); }

.tune-nudge:active { background: rgba(255, 255, 255, 0.14); }

.reject-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(196, 28, 22, 0.5);
  animation: reject-flash 0.55s ease-out both;
}

.reject-scrim[hidden] { display: none !important; }

@keyframes reject-flash {
  0% { opacity: 0; }
  12% { opacity: 1; }
  62% { opacity: 1; }
  100% { opacity: 0; }
}

.corners {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.viewfinder video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #050607;
}

.back-online {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 14px 18px 13px;
  border: 1px solid var(--good);
  border-radius: 12px;
  background: rgba(5, 6, 7, 0.88);
  color: var(--good);
  box-shadow: 0 0 18px rgba(61, 214, 140, 0.45);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.back-online[hidden] { display: none !important; }

.corners i {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid var(--phosphor);
}

.corners i:nth-child(1) { top: 16px; left: 16px; border-right: 0; border-bottom: 0; }
.corners i:nth-child(2) { top: 16px; right: 16px; border-left: 0; border-bottom: 0; }
.corners i:nth-child(3) { bottom: 52px; left: 16px; border-right: 0; border-top: 0; }
.corners i:nth-child(4) { bottom: 52px; right: 16px; border-left: 0; border-top: 0; }

.corners::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  box-shadow: 0 0 12px var(--amber);
  animation: sweep 2.2s ease-in-out infinite;
}

#scanStatus {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 28px 16px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.radar-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 18px 18px 22px;
  text-align: center;
}

.ornament {
  position: relative;
  width: min(240px, 68%);
}

.ornament-cap {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 2;
  width: 28%;
  height: auto;
  transform: translate(-50%, -68%);
  overflow: visible;
  fill: rgba(186, 255, 206, 0.92);
  stroke: none;
  filter: drop-shadow(0 0 6px rgba(70, 220, 120, 0.35));
  pointer-events: none;
}

.radar {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle, rgba(180, 255, 196, 0.9) 0 2px, transparent 3px),
    repeating-radial-gradient(circle, transparent 0 26px, rgba(140, 255, 170, 0.45) 27px 28px);
  box-shadow:
    inset 0 0 0 1px rgba(170, 255, 190, 0.75),
    0 0 28px rgba(70, 220, 120, 0.16);
}

.radar span {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(150, 255, 176, 0.38);
  transform-origin: center;
}

.radar span:nth-child(2) { transform: rotate(60deg); }
.radar span:nth-child(3) { transform: rotate(120deg); }

.sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 292deg,
    rgba(160, 255, 184, 0.08) 328deg,
    rgba(210, 255, 220, 0.9) 360deg
  );
  animation: spin 2.6s linear infinite;
}

.sonar-read {
  margin: 12px 0 0;
  min-height: 1.2em;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

[data-panel="log"] {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#logPlayer { flex: 1; min-height: 0; }
#logPlayer[hidden] { display: none !important; }

.tag-read {
  margin: 12px 0 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

#logList[hidden] { display: none !important; }

#logList {
  flex: 1;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 18px 18px 22px;
  -webkit-overflow-scrolling: touch;
}

.clue {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 212, 138, 0.16);
}

.clue header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.66;
}

.clue h3 {
  margin: 5px 0 4px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.clue p {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

.replay {
  margin-top: 8px;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 5px 12px 4px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 600;
}

.empty {
  margin: 28px 0 0;
  font-size: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.compass {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px 16px;
}

.dial-wrap {
  position: relative;
  width: min(220px, 64vw);
  height: min(220px, 64vw);
}

.dial {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid currentColor;
  background:
    repeating-conic-gradient(from -1deg, currentColor 0 1.2deg, transparent 1.2deg 30deg);
  position: relative;
  transition: transform 0.12s linear;
}

.dial b {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: #16110b;
  padding: 0 3px;
}

.handset[data-link="offline"] .dial b { background: #050607; }
.dial b:nth-child(1) { transform: translate(-50%, -50%) translateY(-78px); }
.dial b:nth-child(2) { transform: translate(-50%, -50%) translateX(78px); }
.dial b:nth-child(3) { transform: translate(-50%, -50%) translateY(78px); }
.dial b:nth-child(4) { transform: translate(-50%, -50%) translateX(-78px); }

.lubber {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 11px solid var(--amber);
}

.deg {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 28px;
  letter-spacing: 0.12em;
}

.cardinal, .fix {
  margin: 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
}

.fix {
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0.7;
}

.glass {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 26%),
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.14) 0 1px, transparent 1px 3px);
}

.power-line {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 2px;
  z-index: 4;
  background: #fff6df;
  opacity: 0;
  box-shadow: 0 0 12px #fff;
  pointer-events: none;
}

.handset[data-link="dropping"] .power-line {
  animation: line 0.9s ease forwards;
}

.handset[data-link="restoring"] .crt {
  animation: warm 1.05s ease;
}

.dock { margin: 0 16px; }

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

.keys button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(#343a40, #22272b);
  color: #d9d3c8;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.01em;
  line-height: 1.05;
  padding: 6px 4px;
  text-transform: none;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 2px 0 #0a0c0e,
    0 6px 10px rgba(0, 0, 0, 0.28);
}

.keys button svg {
  width: 22px;
  height: 22px;
  display: block;
  flex: none;
}

.keys button .badge {
  position: absolute;
  top: 4px;
  right: 3px;
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: #e23b2f;
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  box-shadow: 0 0 0 2px #22272b;
}

.keys button[aria-pressed="true"] .badge { box-shadow: 0 0 0 2px #1a1e22; }
.badge[hidden] { display: none !important; }

.keys button:active,
.keys button[aria-pressed="true"] {
  transform: translateY(2px);
  background: linear-gradient(#2a3035, #1a1e22);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.55);
}

.knob { display: none; }

.deck {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 20px 2px;
}

.knob {
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #4a515a, #1a1e22 62%, #0d0f12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 2px 0 #090b0d,
    0 8px 14px rgba(0, 0, 0, 0.35);
  position: relative;
}

.knob::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 2px;
  height: 12px;
  border-radius: 2px;
  background: var(--brass);
  transform: translateX(-50%);
}

.handset[data-playing="yes"] .knob {
  animation: wag 1.6s ease-in-out infinite;
}

#deckNote {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b7b1a6;
}

dialog {
  border: 0;
  padding: 0;
  max-height: calc(100% - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  background: transparent;
  color: var(--paper);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.62); }

.bench {
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  border-radius: 18px;
  background: #1b1e22;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.bench h3 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bench p {
  margin: 0 0 14px;
  color: #b7b1a6;
  font-size: 16px;
  line-height: 1.3;
}

.bench label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.bench input {
  border: 0;
  border-radius: 8px;
  background: #0e1012;
  color: var(--phosphor);
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 18px;
  letter-spacing: 0;
  text-transform: none;
}

.bench menu {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.bench button {
  border: 0;
  border-radius: 10px;
  background: #2a3036;
  padding: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.bench button:first-child { background: #6d2420; }
.bench button:last-child { background: transparent; color: #b7b1a6; }

@keyframes blink {
  50% { opacity: 0.25; }
}

@keyframes pulse {
  50% { opacity: 0.45; }
}

@keyframes flicker {
  0%, 19%, 21%, 100% { opacity: 1; }
  20% { opacity: 0.55; }
}

@keyframes crt-die {
  0% { transform: scaleY(1) scaleX(1); filter: brightness(1); opacity: 1; }
  45% { transform: scaleY(0.015) scaleX(1.04); filter: brightness(2.6); opacity: 1; }
  100% { transform: scaleY(0); opacity: 0; }
}

@keyframes line {
  0% { opacity: 0; transform: scaleX(0.2); }
  35% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(0.05); }
}

@keyframes warm {
  0% { filter: brightness(0.25) contrast(1.3); }
  40% { filter: brightness(1.55); }
  100% { filter: none; }
}

@keyframes sweep {
  0% { top: 18%; }
  100% { top: 72%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes wag {
  50% { transform: rotate(26deg); }
}

@media (prefers-reduced-motion: reduce) {
  .handset[data-link="dropping"] .crt-ui,
  .handset[data-link="dropping"] .power-line,
  .handset[data-link="restoring"] .crt,
  .handset[data-link="offline"] h2,
  .corners::after,
  .sweep,
  .knob,
  .jewel i,
  .meter i {
    animation: none !important;
  }
}
