:root {
  color-scheme: dark;
  --display: "Futura", "Futura PT", "Century Gothic", "Avenir Next", "Trebuchet MS", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --body: #24211d;
  --body-hi: #2f2b26;
  --body-lo: #1a1815;
  --print: #d9ccb2;
  --print-dim: #8a8174;
  --cream: #efe4cc;
  --muted: #a1978a;
  --amber: #ffb547;
  --phos: #ffc266;
  --phos-dim: #b5824a;
  --phos-faint: #6e4c27;
  --glow: rgba(255, 166, 56, .5);
  --screen: #0f0a05;
  --screen-h: 420px;
  --key-h: 44px;
  font-family: var(--display);
  font-size: 13px;
  color: var(--cream);
  background: #0c0b09;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 40px 28px;
  background:
    radial-gradient(1200px 600px at 50% -10%, #3a2c1c 0%, transparent 60%),
    radial-gradient(900px 500px at 50% 110%, #1b1611 0%, transparent 70%),
    #0c0b09;
}

a { color: var(--amber); }
button, input, select { font: inherit; color: inherit; }
button { margin: 0; padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation; }

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Chassis ---------- */

.chassis {
  position: relative;
  max-width: 1120px;
  margin: auto;
  padding: 36px 40px 0;
  border: 1.5px solid transparent;
  border-radius: 30px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 240, 215, .012) 0 1px, transparent 1px 3px) padding-box,
    radial-gradient(140% 70% at 50% 0%, rgba(255, 236, 200, .06), transparent 60%) padding-box,
    linear-gradient(180deg, var(--body-hi), var(--body) 30%, var(--body-lo)) padding-box,
    linear-gradient(180deg, #7b7163 0%, #3a352e 18%, #1c1a16 70%, #4a4339 100%) border-box;
  box-shadow:
    inset 0 2px 0 rgba(255, 240, 215, .07),
    inset 0 -6px 18px rgba(0, 0, 0, .35),
    0 0 0 6px #121110,
    0 0 0 7px #2e2a24,
    0 40px 80px -30px rgba(0, 0, 0, .9),
    0 18px 40px rgba(0, 0, 0, .5);
}

.screw {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background:
    linear-gradient(45deg, transparent 44%, #15130f 45% 55%, transparent 56%),
    radial-gradient(circle at 35% 30%, #8a8070, #3b362f 70%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 240, 215, .08);
}
.screw-tl { top: 15px; left: 15px; }
.screw-tr { top: 15px; right: 15px; transform: rotate(60deg); }
.screw-bl { bottom: 15px; left: 15px; transform: rotate(25deg); }
.screw-br { bottom: 15px; right: 15px; transform: rotate(-30deg); }

/* ---------- Printing ---------- */

.silkscreen {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 12px;
  color: var(--print-dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
h1, h2 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; }
.silkscreen h1, .silkscreen h2 { color: var(--print); font-family: var(--display); }

.print {
  color: var(--print);
  font-family: var(--display);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* ---------- Bottom strip ---------- */

.speaker-grille {
  flex: 1;
  min-width: 40px;
  height: 30px;
  border-radius: 10px;
  background:
    radial-gradient(circle, #050403 1.7px, transparent 2.3px) 3px 3px / 9px 9px,
    linear-gradient(180deg, #1a1815, #24211d);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .8), 0 1px 0 rgba(255, 240, 215, .07);
}

#connection {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 10px;
  font-size: 0;
}
#connection:before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffeccc, var(--amber) 60%);
  box-shadow: 0 0 0 2px #0e0d0b, 0 0 0 3px #4a443a, 0 0 12px var(--amber);
}
#connection:after {
  content: "Link";
  color: var(--print);
  font-family: var(--display);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}
#connection.stale:before {
  animation: blink 1s steps(2, start) infinite;
}

/* ---------- Layout ---------- */

.workspace {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 36px;
}
.console-column, .network-column { display: flex; flex-direction: column; min-width: 0; }
.network-column { position: relative; }
.network-column:before {
  content: "";
  position: absolute;
  left: -19px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(0, 0, 0, .55);
  box-shadow: 1px 0 0 rgba(255, 240, 215, .05);
}

/* ---------- Displays ---------- */

.screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  height: var(--screen-h);
  border: 8px solid #0f0e0c;
  border-radius: 24px;
  background: radial-gradient(120% 90% at 50% 35%, #2a1907 0%, #160e06 55%, var(--screen) 100%);
  color: var(--phos);
  font-family: var(--mono);
  text-shadow: 0 0 7px var(--glow);
  box-shadow:
    0 0 0 1px #5a5246,
    0 2px 0 1px rgba(255, 240, 215, .05),
    0 -2px 0 1px rgba(0, 0, 0, .5),
    inset 0 0 0 1px #000,
    inset 0 0 50px rgba(0, 0, 0, .85);
}
.screen:before, .screen:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
}
.screen:before {
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .26) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.screen:after {
  background:
    radial-gradient(90% 55% at 28% -8%, rgba(255, 238, 210, .1), transparent 60%),
    radial-gradient(130% 110% at 50% 50%, transparent 62%, rgba(0, 0, 0, .55) 100%);
}

/* Transceiver display */

.transmit-area { display: flex; flex-direction: column; padding: 18px 22px 0; }

.screen-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--phos-faint);
  color: var(--phos-dim);
  font-size: 10px;
  letter-spacing: .18em;
}
.screen-top strong {
  margin-left: 6px;
  color: var(--phos);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: .08em;
  text-shadow: 0 0 10px var(--glow), 0 0 2px var(--phos);
}
#receive-readout { padding: 3px 9px; border: 1px solid var(--phos-faint); border-radius: 4px; }

.signal-art {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 -22px;
  background:
    linear-gradient(0deg, transparent calc(50% - .5px), rgba(255, 170, 60, .2) 50%, transparent calc(50% + .5px)),
    repeating-linear-gradient(90deg, rgba(255, 170, 60, .06) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(0deg, rgba(255, 170, 60, .06) 0 1px, transparent 1px 24px);
  background-position: center;
}
.signal-art span {
  width: 5px;
  height: calc(var(--h, 10) * 1px);
  border-radius: 3px;
  background: linear-gradient(180deg, #ffe0a8, var(--amber) 40%, #e98b23);
  box-shadow: 0 0 10px var(--glow), 0 0 2px var(--amber);
  animation: idle 2.8s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -.17s);
}

.signal-art span:nth-child(1) { --h: 8; --i: 0; }
.signal-art span:nth-child(2) { --h: 14; --i: 1; }
.signal-art span:nth-child(3) { --h: 10; --i: 2; }
.signal-art span:nth-child(4) { --h: 22; --i: 3; }
.signal-art span:nth-child(5) { --h: 16; --i: 4; }
.signal-art span:nth-child(6) { --h: 34; --i: 5; }
.signal-art span:nth-child(7) { --h: 28; --i: 6; }
.signal-art span:nth-child(8) { --h: 52; --i: 7; }
.signal-art span:nth-child(9) { --h: 72; --i: 8; }
.signal-art span:nth-child(10) { --h: 52; --i: 9; }
.signal-art span:nth-child(11) { --h: 28; --i: 10; }
.signal-art span:nth-child(12) { --h: 34; --i: 11; }
.signal-art span:nth-child(13) { --h: 16; --i: 12; }
.signal-art span:nth-child(14) { --h: 22; --i: 13; }
.signal-art span:nth-child(15) { --h: 10; --i: 14; }
.signal-art span:nth-child(16) { --h: 14; --i: 15; }
.signal-art span:nth-child(17) { --h: 8; --i: 16; }

#voice-state {
  overflow: hidden;
  padding: 4px 0;
  font-size: 15px;
  letter-spacing: .14em;
  line-height: 1.6;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.screen-notes {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  height: 40px;
  overflow: hidden;
  font-size: 10px;
  letter-spacing: .06em;
  line-height: 1.5;
  text-align: center;
}
.voice-notice { color: #ff9a6a; text-shadow: 0 0 6px rgba(255, 91, 46, .45); }
.voice-notice:empty { display: none; }
.secure-setup { color: var(--phos); }
.screen-hint { color: var(--phos-dim); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; text-shadow: none; }
.is-recording .screen-hint:before { content: "Record sends · Cancel discards"; }
.is-draft .screen-hint:before { content: "Record retries · Cancel discards"; }

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 11px 0 14px;
  border-top: 1px dashed var(--phos-faint);
}
.summary div { display: flex; flex-direction: column; gap: 3px; }
.summary div + div { padding-left: 14px; border-left: 1px dotted var(--phos-faint); }
.summary span { color: var(--phos-dim); font-size: 8px; letter-spacing: .18em; text-transform: uppercase; text-shadow: none; }
.summary strong { font-size: 16px; font-weight: 400; letter-spacing: .04em; }

.transmit-area.is-recording {
  --glow: rgba(255, 80, 40, .55);
  background: radial-gradient(120% 90% at 50% 35%, #2e1006 0%, #170904 55%, #0e0603 100%);
}
.transmit-area.is-recording #voice-state,
.transmit-area.is-recording .screen-top strong { color: #ff8a5c; }
.transmit-area.is-recording .signal-art span {
  background: linear-gradient(180deg, #ffd0b0, #ff6a3d 40%, #d33a18);
  box-shadow: 0 0 12px rgba(255, 80, 40, .7);
  animation: signal .5s ease-in-out infinite alternate;
  animation-delay: calc(var(--i, 0) * -.09s);
}

/* Network display */

.network-screen { display: flex; flex-direction: column; }

.tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px dashed var(--phos-faint);
}
.tabs [role=tab] {
  flex: 1;
  height: 30px;
  border: 1px solid var(--phos-faint);
  border-radius: 4px;
  color: var(--phos-dim);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-shadow: inherit;
}
.tabs [role=tab]:hover { color: var(--phos); }
.tabs [role=tab][aria-selected=true] {
  border-color: var(--phos);
  background: var(--phos);
  color: #1a0f04;
  text-shadow: none;
  box-shadow: 0 0 14px -2px var(--glow);
}
#web-count { margin-left: 4px; opacity: .75; }

.pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 16px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--phos-faint) transparent;
}

.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: 32px;
  flex-shrink: 0;
  padding: 0 16px;
  border-top: 1px dashed var(--phos-faint);
  color: var(--phos-dim);
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.statusbar strong { margin-left: 6px; color: var(--phos); font-weight: 400; }
#toast { overflow: hidden; color: #ffd08a; letter-spacing: .06em; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }

.radios { display: flex; flex-direction: column; }

.card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  margin: 0 -8px;
  padding: 9px 8px 4px;
  border-radius: 8px;
  cursor: pointer;
}
.card + .card:after {
  content: "";
  position: absolute;
  top: 0;
  left: 8px;
  right: 8px;
  border-top: 1px dotted var(--phos-faint);
}
.card.selected { background: rgba(255, 170, 60, .1); }
.card.selected:after, .card.selected + .card:after { display: none; }
.card:focus-visible { outline: 1px dashed var(--phos); outline-offset: -2px; }

.identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.identity-text { min-width: 0; }
.radio-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: 1px solid var(--phos-dim);
  border-radius: 50%;
  font-size: 11px;
}
.card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h2 { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em; }
.badge {
  padding: 1px 6px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 8px;
  letter-spacing: .16em;
  line-height: 1.4;
  text-transform: uppercase;
}
.meta { margin-top: 4px; color: var(--phos-dim); font-size: 9px; letter-spacing: .04em; line-height: 1.5; overflow-wrap: anywhere; text-shadow: none; }

.metrics { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.metric span { display: block; margin-bottom: 3px; color: var(--phos-dim); font-size: 7.5px; letter-spacing: .18em; text-transform: uppercase; text-shadow: none; }
.metric strong { font-size: 12px; font-weight: 400; white-space: nowrap; }

.offline .identity, .offline .card h2 { color: #9a7449; text-shadow: none; }
.offline .badge { color: var(--phos-faint); }
.offline .radio-avatar { border-color: var(--phos-faint); border-style: dashed; color: #8a6640; }
.offline .meta { color: #7a5a36; }
.offline .metrics { display: none; }

.details { grid-column: 1 / -1; margin-left: 42px; color: var(--phos-dim); font-size: 9px; text-shadow: none; }
.details summary { display: flex; align-items: center; gap: 9px; min-height: 20px; font-size: 8.5px; letter-spacing: .18em; list-style: none; text-transform: uppercase; }
.details summary::-webkit-details-marker { display: none; }
.details summary:before { content: "+"; width: 8px; }
.details[open] summary:before { content: "−"; }
.details summary:hover { color: var(--phos); }
.detail-hint { display: none; }
.detail-text { padding: 0 0 6px 17px; font-size: 9.5px; letter-spacing: .03em; line-height: 1.8; overflow-wrap: anywhere; }
.offline .details { color: #7a5a36; }

.command { grid-column: 1 / -1; margin-left: 42px; color: #ffd08a; font-size: 9.5px; letter-spacing: .05em; line-height: 1.6; }
.command:before { content: "▸ "; color: var(--amber); }
.command:empty { display: none; }

.web-client {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px dotted var(--phos-faint);
  font-size: 10.5px;
}
.web-client:last-child { border-bottom: 0; }
.web-client strong { min-width: 0; font-weight: 500; letter-spacing: .08em; overflow-wrap: anywhere; }
.web-client span { color: var(--phos-dim); font-size: 9px; text-align: right; text-shadow: none; }
.empty-clients { margin: 0; padding: 12px 0; color: var(--phos-dim); font-size: 9.5px; }

#events:not(:has(.event)) { padding: 12px 0; color: var(--phos-dim); font-size: 9.5px; }
.event {
  display: flex;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px dotted var(--phos-faint);
  font-size: 10px;
  letter-spacing: .03em;
  line-height: 1.6;
}
.event:last-child { border-bottom: 0; }
.event time { color: var(--phos-dim); font-size: 9.5px; white-space: nowrap; text-shadow: none; }

.field { padding: 12px 0 14px; border-bottom: 1px dotted var(--phos-faint); }
.field label { display: block; margin-bottom: 8px; color: var(--phos-dim); font-size: 8.5px; letter-spacing: .2em; text-transform: uppercase; text-shadow: none; }
.field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--phos-faint);
  border-radius: 4px;
  background: rgba(255, 170, 60, .04);
  color: var(--phos);
  font-family: var(--mono);
  letter-spacing: .06em;
  text-shadow: inherit;
}
.field input:focus { border-color: var(--phos); outline: 0; }
.field input::placeholder { color: var(--phos-faint); }
.readout-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px dotted var(--phos-faint);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.readout-row > span:first-child { color: var(--phos-dim); text-shadow: none; }
.readout-row a { color: var(--phos); }

/* ---------- Key trays ---------- */

.tray {
  flex: 1;
  display: grid;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 0 0 4px;
}
.control-bank { grid-template-columns: auto minmax(0, 1fr) 92px 92px; }
.network-controls { grid-template-columns: 1fr 1fr; }

/* ---------- Keys ---------- */

.key {
  --face-hi: #47433d;
  --face-lo: #3b3732;
  --wall: #26231f;
  --legend: #e2d8c3;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: var(--key-h);
  min-width: 0;
  padding: 0 14px;
  border-radius: 7px;
  background:
    radial-gradient(110% 80% at 50% 115%, rgba(0, 0, 0, .1), transparent 60%),
    linear-gradient(180deg, var(--face-hi), var(--face-lo));
  color: var(--legend);
  font-family: var(--display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 225, .1),
    inset 0 -1px 0 rgba(0, 0, 0, .2),
    0 0 0 1px rgba(0, 0, 0, .6),
    0 2px 0 0 var(--wall),
    0 2px 0 1px rgba(0, 0, 0, .6),
    0 4px 3px rgba(0, 0, 0, .35),
    0 8px 12px -6px rgba(0, 0, 0, .6);
  transition: transform .05s, box-shadow .05s;
}
.key:active:not(:disabled), .key[aria-pressed=true] {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 225, .07),
    inset 0 -1px 0 rgba(0, 0, 0, .2),
    0 0 0 1px rgba(0, 0, 0, .6),
    0 0 0 1px rgba(0, 0, 0, .6),
    0 1px 2px rgba(0, 0, 0, .4);
}
.key:disabled { cursor: default; }

.key:before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #2e2720;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 245, 225, .08);
  transition: background .15s, box-shadow .15s;
}
.key-cancel:not(:disabled):before,
#locate-radio:not(:disabled):before,
#update-radio:not(:disabled):before,
.key-listen[aria-pressed=true]:before {
  background: radial-gradient(circle at 35% 35%, #ffe7c0, var(--amber) 65%);
  box-shadow: 0 0 6px rgba(255, 181, 71, .7);
}

.key-record {
  --face-hi: #d98a45;
  --face-lo: #cb7634;
  --wall: #7f4019;
  --legend: #2a1607;
}
.key-record:before { background: #6e2c12; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .5), 0 1px 0 rgba(255, 245, 225, .2); }
.key-record.recording:before {
  background: radial-gradient(circle at 35% 35%, #ffd6c8, #ff3b1a 65%);
  box-shadow: 0 0 6px #ff3b1a;
  animation: blink 1s steps(2, start) infinite;
}

/* ---------- Channel knob ---------- */

.channel-picker { display: grid; justify-items: center; gap: 8px; width: 92px; }
.channel-picker > label { order: 1; }
.knob-scale { position: relative; width: 92px; height: 72px; }
.knob-scale [data-ch] {
  position: absolute;
  width: 14px;
  color: var(--print);
  font-family: var(--mono);
  font-size: 9px;
  text-align: center;
  cursor: pointer;
}
.knob-scale [data-ch="1"] { left: 6px; top: 23px; }
.knob-scale [data-ch="2"] { left: 26px; top: 3px; }
.knob-scale [data-ch="3"] { left: 52px; top: 3px; }
.knob-scale [data-ch="4"] { left: 72px; top: 23px; }
.knob {
  position: absolute;
  left: 20px;
  top: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: repeating-conic-gradient(#25221e 0 5deg, #46413a 5deg 10deg);
  box-shadow:
    0 0 0 1px #0b0a08,
    0 4px 0 #141210,
    0 4px 0 1px #0b0a08,
    0 9px 12px rgba(0, 0, 0, .6);
  cursor: pointer;
}
.knob-cap {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #6a6258, #3a352f 55%, #2b2723);
  box-shadow: inset 0 1px 0 rgba(255, 245, 225, .25), 0 0 0 1px rgba(0, 0, 0, .6);
}
.knob-pointer {
  position: absolute;
  inset: 0;
  transform: rotate(var(--turn, -60deg));
  transition: transform .22s cubic-bezier(.3, 1.6, .5, 1);
}
.knob-pointer:before {
  content: "";
  position: absolute;
  top: 8px;
  left: calc(50% - 1.5px);
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--cream);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .5);
}
#voice-channel:focus-visible ~ .knob-scale .knob { outline: 2px solid var(--amber); outline-offset: 4px; }

/* ---------- Slide switch ---------- */

.slide-switch { display: grid; justify-items: center; gap: 7px; padding: 0 4px; cursor: pointer; }
.slide-switch input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 60px;
  height: 26px;
  margin: 0;
  border-radius: 6px;
  background: #0b0a09;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .95), 0 1px 0 rgba(255, 240, 215, .08);
  cursor: pointer;
}
.slide-switch input:before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 20px;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, transparent 0 5px, rgba(0, 0, 0, .35) 5px 6px, rgba(255, 245, 225, .08) 6px 7px) 6px 4px / 16px 12px no-repeat,
    linear-gradient(180deg, #5d574e, #3c3731);
  box-shadow: inset 0 1px 0 rgba(255, 245, 225, .2), 0 2px 3px rgba(0, 0, 0, .7);
  transition: left .15s ease-out;
}
.slide-switch input:checked:before { left: 29px; }
.switch-scale {
  display: flex;
  justify-content: space-between;
  width: 60px;
  color: var(--print-dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

/* ---------- Footer ---------- */

.footer { align-items: center; gap: 28px; padding: 24px 4px 28px; }
/* ---------- Dialog, drawn on the network display ---------- */

dialog {
  position: absolute;
  inset: auto;
  margin: 0;
  max-width: none;
  max-height: none;
  padding: 26px;
  border: 0;
  border-radius: 16px;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .26) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 35%, #2a1907 0%, #160e06 55%, var(--screen) 100%);
  color: var(--phos);
  font-family: var(--mono);
  text-shadow: 0 0 7px var(--glow);
}
dialog[open] { display: flex; flex-direction: column; justify-content: center; }
dialog::backdrop { background: transparent; }
.eyebrow { color: var(--phos-dim); font-size: 9px; letter-spacing: .22em; text-transform: uppercase; }
dialog h2 { margin: 12px 0; font-family: var(--mono); font-size: 16px; letter-spacing: .1em; }
dialog p { margin: 0; color: var(--phos-dim); font-size: 11px; line-height: 1.7; }
.dialog-actions { display: flex; gap: 10px; margin-top: 24px; }
.touch {
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--phos-dim);
  border-radius: 4px;
  color: var(--phos);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-shadow: inherit;
}
.touch.primary { border-color: var(--phos); background: var(--phos); color: #1a0f04; text-shadow: none; }

/* ---------- Setup page ---------- */

.setup {
  max-width: 660px;
  margin: auto;
  padding: 34px 38px;
  border: 1.5px solid transparent;
  border-radius: 30px;
  background:
    linear-gradient(180deg, var(--body-hi), var(--body-lo)) padding-box,
    linear-gradient(180deg, #7b7163, #2a2620 30%, #4a4339) border-box;
  box-shadow: 0 0 0 6px #121110, 0 30px 70px rgba(0, 0, 0, .7);
  color: var(--cream);
  line-height: 1.75;
}
.setup h1 { margin: 18px 0 8px; color: var(--amber); font-size: 22px; letter-spacing: .06em; text-transform: none; }
.setup li { margin: 14px 0; }
.setup .download {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f7a74c, #dc7c1f);
  color: #2b1503;
  font-weight: 700;
  text-decoration: none;
}
.fingerprint {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--screen);
  color: var(--phos);
  font-family: var(--mono);
  font-size: 11px;
  overflow-wrap: anywhere;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .9), 0 0 0 1px #4b443a;
}

/* ---------- Motion ---------- */

@keyframes idle { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.78); } }
@keyframes signal { from { transform: scaleY(1.05); } to { transform: scaleY(.35); } }
@keyframes blink { to { opacity: .25; } }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  body { padding: 26px 16px; }
  .chassis { padding: 32px 28px 0; }
  .workspace { gap: 30px; }
  .network-column:before { left: -16px; }
  .control-bank {
    grid-template-columns: auto 1fr 1fr;
    grid-template-areas: "knob rec rec" "knob listen cancel";
  }
  .channel-picker { grid-area: knob; }
  .key-record { grid-area: rec; }
  .key-listen { grid-area: listen; }
  .key-cancel { grid-area: cancel; }
  .metrics { gap: 10px; }
  .metric:last-child { display: none; }
}

@media (max-width: 740px) {
  :root { --screen-h: 318px; --key-h: 44px; }
  body { padding: 14px 10px; }
  .chassis {
    max-width: 520px;
    padding: 24px 18px 0;
    border-radius: 26px;
    box-shadow: inset 0 2px 0 rgba(255, 240, 215, .07), 0 0 0 4px #121110, 0 0 0 5px #2e2a24, 0 20px 40px rgba(0, 0, 0, .6);
  }
  .screw { width: 8px; height: 8px; }
  .screw-tl, .screw-bl { left: 10px; }
  .screw-tr, .screw-br { right: 10px; }
  .screw-tl, .screw-tr { top: 10px; }
  .screw-bl, .screw-br { bottom: 10px; }
  .workspace { display: block; }
  .network-column { margin-top: 26px; padding-top: 24px; }
  .network-column:before { left: -18px; right: -18px; top: 0; bottom: auto; width: auto; height: 2px; box-shadow: 0 1px 0 rgba(255, 240, 215, .05); }
  .network-screen { height: 480px; }
  .transmit-area { padding: 15px 18px 0; }
  .signal-art { margin: 0 -18px; gap: 5px; }
  .signal-art span { width: 4px; height: calc(var(--h, 10) * .8px); }
  #voice-state { font-size: 13px; }
  .summary strong { font-size: 14px; }
  .tray { margin-top: 18px; gap: 10px; }
  .metrics { grid-column: 1 / -1; justify-content: flex-start; gap: 22px; margin-left: 42px; }
  .metric:last-child { display: block; }
  .identity { grid-column: 1 / -1; }
  .web-client { flex-wrap: wrap; gap: 4px; }
  .web-client span { text-align: left; }
  .footer { gap: 16px; padding: 20px 2px 24px; }
  .speaker-grille { height: 26px; }
}

@media (max-width: 380px) {
  body { padding: 10px 6px; }
  .chassis { padding: 20px 14px 0; }
  .network-column:before { left: -14px; right: -14px; }
  .control-bank { gap: 8px; }
  .channel-picker { width: 84px; }
  .key { padding: 0 10px; font-size: 9.5px; letter-spacing: .1em; }
  .network-controls { grid-template-columns: 1fr 1fr; }
  .tabs [role=tab] { font-size: 8.5px; letter-spacing: .1em; }
  .transmit-area { padding-inline: 14px; }
  .signal-art { margin: 0 -14px; }
  .summary div + div { padding-left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; }
}

.network-controls .slide-switch { grid-column: 1 / -1; }

.invitations{margin-top:16px}.invitations input{width:100%;box-sizing:border-box;padding:12px}.invitations .readout-row{display:flex;justify-content:space-between;padding:8px}.network-controls [aria-pressed="true"]{outline:2px solid #8f974a}
