/*
 * Ground Control — the console.
 *
 * The Louder tokens from styles/site.css, re-declared here rather than imported
 * because the game page must stay self-contained (one stylesheet, one request);
 * tools/check-ground-control.mjs asserts these values equal the site's so the
 * two cannot drift. Direction is the site's broadcast console: ink ground, a
 * VU scale for the one accent, system grotesque against tracked monospace.
 *
 * Two phones, one layout: portrait first, one column, real buttons with 44px
 * targets. Nothing here depends on landscape.
 */

:root {
  --ink: #0f0e0d;
  --panel: #1a1817;
  --edge: #2a2624;
  --paper: #f2ede4;
  --quiet: #6e6862;
  --lo: #7fb069;
  --mid: #e8b44a;
  --hot: #e2593a;
  --display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --gut: clamp(1rem, 4.5vw, 1.6rem);
  --maxw: 30rem;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
}

:focus-visible { outline: 2px solid var(--mid); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ── top bar ───────────────────────────────────────────────────────────── */

.top {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem var(--gut);
  border-bottom: 1px solid var(--edge);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-top: max(0.7rem, env(safe-area-inset-top));
}

.top__mark { color: var(--paper); text-decoration: none; }
.top__title { color: var(--quiet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top__role { color: var(--mid); white-space: nowrap; }
.top__role:empty { display: none; }
.top__code { color: var(--paper); font-variant-numeric: tabular-nums; letter-spacing: 0.22em; }
.top__code:empty { display: none; }

.top__link {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--edge);
  box-shadow: 0 0 0 2px var(--panel);
  transition: background 160ms;
}
.top__link[data-status="connected"] { background: var(--lo); }
.top__link[data-status="connecting"], .top__link[data-status="reconnecting"] { background: var(--mid); }
.top__link[data-status="error"], .top__link[data-status="closed"] { background: var(--hot); }

/* ── screens ───────────────────────────────────────────────────────────── */

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.2rem var(--gut) calc(1.2rem + env(safe-area-inset-bottom));
}

.screen { display: flex; flex-direction: column; gap: 0.9rem; flex: 1; }
.screen--story { justify-content: center; }
.screen--beat { justify-content: center; align-items: center; text-align: center; }

.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--quiet);
}

.title {
  margin: 0;
  font-size: clamp(2.6rem, 13vw, 4rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.h2 { margin: 0; font-size: 1.55rem; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
.body { margin: 0; color: var(--paper); font-size: 1.02rem; }
.note { margin: 0; color: var(--quiet); font-size: 0.86rem; }
.note--hot { color: var(--hot); }
.label { margin: 0; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--quiet); }

.how { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.55rem; }
.how li { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.5rem; align-items: baseline; }
.how li::before { content: attr(data-n); font-family: var(--mono); color: var(--mid); font-size: 0.75rem; letter-spacing: 0.1em; }

.challenge { margin: 0; padding: 0.6rem 0.8rem; border: 1px solid var(--edge); border-left: 3px solid var(--mid); border-radius: 8px; color: var(--paper); font-size: 0.92rem; }

/* ── buttons ───────────────────────────────────────────────────────────── */

.btn {
  appearance: none;
  border: 1px solid var(--edge);
  background: var(--panel);
  color: var(--paper);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.1rem;
  min-height: 48px;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: background 120ms, transform 80ms, opacity 120ms;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn--primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--ghost { background: transparent; }
.btn--wide { width: 100%; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

/* ── create: the two modes ─────────────────────────────────────────────── */

.modes { display: grid; gap: 0.7rem; }
.mode {
  appearance: none; text-align: left; font: inherit; color: var(--paper); cursor: pointer;
  display: grid; gap: 0.2rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--panel);
  -webkit-tap-highlight-color: transparent;
}
.mode[aria-checked="true"] { border-color: var(--mid); box-shadow: inset 0 0 0 1px var(--mid); }
.mode__title { font-weight: 800; font-size: 1.05rem; }
.mode__note { color: var(--quiet); font-size: 0.86rem; }

/* ── join ──────────────────────────────────────────────────────────────── */

.field { display: grid; gap: 0.35rem; }
.field__label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--quiet); }
.field__input {
  font: inherit; font-family: var(--mono); font-size: 1.5rem; letter-spacing: 0.3em; text-transform: uppercase;
  padding: 0.7rem 0.9rem; border-radius: var(--radius); border: 1px solid var(--edge);
  background: var(--panel); color: var(--paper); width: 100%;
}

/* ── lobby ─────────────────────────────────────────────────────────────── */

.code {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(2.2rem, 12vw, 3.2rem);
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-align: center;
  padding: 0.5rem 0;
  border: 1px dashed var(--edge);
  border-radius: var(--radius);
  font-variant-numeric: tabular-nums;
}

.partner {
  margin: 0.4rem 0 0;
  display: flex; align-items: center; gap: 0.6rem;
  color: var(--quiet); font-size: 0.95rem;
}
.partner::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--edge); flex: none;
  animation: blink 1.4s infinite;
}
.partner[data-here="1"] { color: var(--paper); }
.partner[data-here="1"]::before { background: var(--lo); animation: none; }
@keyframes blink { 50% { opacity: 0.35; } }

/* ── story cards ───────────────────────────────────────────────────────── */

.story { display: grid; gap: 0.9rem; }
.story p { margin: 0; font-size: 1.35rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; }
.story--small p { font-size: 1.1rem; }

.role { margin: 0; font-family: var(--mono); color: var(--mid); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.8rem; }

/* ── play ──────────────────────────────────────────────────────────────── */

.screen--play { gap: 0.6rem; }
.play-head { display: flex; align-items: center; justify-content: space-between; }
.play-head__room { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--quiet); }
.play-head__clock { font-family: var(--mono); font-size: 1.05rem; font-variant-numeric: tabular-nums; letter-spacing: 0.08em; color: var(--paper); margin-left: auto; margin-right: 0.8rem; }
.play-head__clock:empty { display: none; }
.play-head__clock[data-urgent="1"] { color: var(--hot); animation: blink 1s infinite; }

/* Lives: a lit dot is a life you still have; a hollow one is gone. */
.strikes { display: flex; gap: 6px; }
.strikes i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--hot); background: transparent; transition: background 120ms, border-color 120ms; }
.strikes i[data-on="1"] { background: var(--lo); border-color: var(--lo); }
body[data-lives="1"] .strikes i[data-on="1"] { background: var(--hot); border-color: var(--hot); animation: blink 1s infinite; }

.puzzle { display: flex; flex-direction: column; gap: 0.8rem; flex: 1; }

.toast {
  position: fixed; left: 50%; bottom: calc(1.4rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0; padding: 0.55rem 1rem; border-radius: 999px;
  background: var(--paper); color: var(--ink); font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / 45%);
  pointer-events: none; white-space: nowrap; z-index: 5;
}
.toast[data-kind="strike"] { background: var(--hot); color: var(--paper); }
.toast[data-kind="solved"] { background: var(--lo); color: var(--ink); }
body[data-comms="1"] .toast { bottom: calc(6.4rem + env(safe-area-inset-bottom)); }

/* ── beats ─────────────────────────────────────────────────────────────── */

.beat__title { margin: 0; font-size: clamp(2rem, 10vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; }
.beat__note { margin: 0; color: var(--quiet); font-size: 1rem; max-width: 22rem; }
body[data-beat="solved"] .beat__title { color: var(--lo); }
body[data-beat="reset"] .beat__title { color: var(--hot); }

/* ── result ────────────────────────────────────────────────────────────── */

.result__time { margin: 0.4rem 0 0; font-family: var(--mono); font-size: clamp(2.4rem, 14vw, 3.6rem); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.result__stars { margin: 0; color: var(--mid); font-size: 1.4rem; letter-spacing: 0.2em; }

.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.log li {
  display: grid; grid-template-columns: 1fr auto auto; gap: 0.6rem; align-items: center;
  padding: 0.45rem 0.7rem; border: 1px solid var(--edge); border-radius: 10px; background: var(--panel);
  font-size: 0.84rem;
}
.log__room { font-weight: 700; }
.log__hands { color: var(--quiet); font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; }
.log__time { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--paper); }
.log li[data-strikes="0"] .log__time { color: var(--lo); }

/* ── overlay ───────────────────────────────────────────────────────────── */

.overlay {
  position: fixed; inset: 0; z-index: 8;
  display: flex; align-items: center; justify-content: center;
  padding: var(--gut);
  background: rgb(15 14 13 / 78%);
  backdrop-filter: blur(3px);
}
.overlay__text {
  margin: 0; padding: 1rem 1.2rem; max-width: 20rem; text-align: center;
  background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius);
  font-weight: 600;
}

/* ── the ship panel (Airlock, Wiring…) ─────────────────────────────────── */

.panel-ship { display: grid; gap: 0.8rem; }

.lights { display: flex; gap: 0.6rem; }
.light {
  flex: 1; display: grid; justify-items: center; gap: 0.3rem;
  padding: 0.55rem 0.4rem; border: 1px solid var(--edge); border-radius: 10px; background: var(--panel);
}
.light i { width: 18px; height: 18px; border-radius: 50%; background: var(--edge); box-shadow: inset 0 0 0 2px var(--ink); }
.light b { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--quiet); font-weight: 400; }
.light--red[data-on="1"] i { background: var(--hot); box-shadow: 0 0 12px var(--hot); }
.light--amber[data-on="1"] i { background: var(--mid); box-shadow: 0 0 12px var(--mid); }
.light--green[data-on="1"] i { background: var(--lo); box-shadow: 0 0 12px var(--lo); }

.plate {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.8rem; border: 1px solid var(--edge); border-radius: 10px;
  background: repeating-linear-gradient(135deg, var(--panel) 0 6px, #1f1c1a 6px 12px);
  font-family: var(--mono);
}
.plate__label { font-size: 0.6rem; letter-spacing: 0.18em; color: var(--quiet); }
.plate__serial { font-size: 1.25rem; letter-spacing: 0.2em; }

.control { display: grid; gap: 0.35rem; }
.control__label { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.18em; color: var(--quiet); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border: 1px solid var(--edge); border-radius: 12px; background: var(--panel); }
.seg__btn {
  appearance: none; border: 0; border-radius: 9px; background: transparent; color: var(--quiet);
  font: inherit; font-family: var(--mono); font-weight: 700; font-size: 0.95rem; letter-spacing: 0.06em;
  min-height: 44px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.seg__btn[data-on="1"] { background: var(--paper); color: var(--ink); }

/* ── the manual page (eyes) ────────────────────────────────────────────── */

.manual {
  display: grid; gap: 0.8rem;
  padding: 1rem; border-radius: 6px;
  background: var(--paper); color: var(--ink);
  font-family: var(--mono);
}
.manual__head { margin: 0; font-size: 0.7rem; letter-spacing: 0.18em; border-bottom: 2px solid var(--ink); padding-bottom: 0.4rem; }
.manual__rules { margin: 0; padding-left: 1.4rem; display: grid; gap: 0.7rem; }
.manual__rule { font-size: 0.98rem; line-height: 1.45; font-family: var(--display); font-weight: 600; }
.manual__rule::marker { font-family: var(--mono); font-weight: 700; }
.manual__foot { margin: 0; font-size: 0.72rem; color: #4d4842; letter-spacing: 0.04em; }

/* ── comms bar (remote) ────────────────────────────────────────────────── */

.comms {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 0.7rem var(--gut) calc(0.7rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--ink) 70%, transparent);
}
body[data-comms="1"] .stage { padding-bottom: calc(6.6rem + env(safe-area-inset-bottom)); }

@media (min-width: 640px) {
  .stage { padding-top: 2rem; }
}

/* ── the sky grid (Tracking dish) ──────────────────────────────────────── */

.window, .dish { display: grid; gap: 0.7rem; }
.window { padding: 0.9rem; border-radius: 6px; background: var(--paper); color: var(--ink); font-family: var(--mono); }
.window__head, .dish__head { margin: 0; font-size: 0.66rem; letter-spacing: 0.18em; }
.window__head { border-bottom: 2px solid var(--ink); padding-bottom: 0.4rem; }
.dish__head { font-family: var(--mono); color: var(--quiet); }
.window__legend { margin: 0; font-size: 0.78rem; line-height: 1.5; }
.window__foot { margin: 0; font-size: 0.72rem; color: #4d4842; }

.sky {
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  gap: 3px;
  width: 100%;
  max-width: 22rem;
  margin: 0 auto;
  font-family: var(--mono);
}
.sky__corner, .sky__label { display: grid; place-items: center; font-size: 0.66rem; letter-spacing: 0.1em; color: #4d4842; }
.sky__cell {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 6px;
  background: #1f2a3a;
  color: var(--paper);
  font-size: 1.05rem;
  position: relative;
}
.window .sky__cell { background: #d9d2c6; color: var(--ink); }
.sky__cell[data-hazard="1"] { background: repeating-linear-gradient(45deg, #b8a99a 0 4px, #8f8072 4px 8px); }
.sky__cell[data-goal="1"]::after { content: "◎"; color: var(--hot); font-weight: 700; font-size: 1.2rem; }
.sky__cell[data-start="1"]::before { content: "⌖"; position: absolute; top: 1px; left: 3px; font-size: 0.7rem; color: #4d4842; }
.sky__cell[data-cursor="1"] { box-shadow: inset 0 0 0 3px var(--mid); background: #2c3a4f; }
.sky__cell[data-cursor="1"]::after { content: "⌖"; color: var(--mid); font-size: 1.3rem; font-weight: 700; }

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-areas: ". up ." "left . right" ". down .";
  gap: 6px;
  width: 11rem;
  margin: 0.2rem auto 0;
}
.dpad__btn { padding: 0; min-height: 52px; font-size: 1.2rem; }
.dpad__btn--up { grid-area: up; } .dpad__btn--down { grid-area: down; }
.dpad__btn--left { grid-area: left; } .dpad__btn--right { grid-area: right; }

/* ── the wire bundle (Wiring) ──────────────────────────────────────────── */

.bundle { display: grid; gap: 0.5rem; }
.wire {
  appearance: none; border: 1px solid var(--edge); background: var(--panel); color: var(--paper);
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.8rem; min-height: 52px; border-radius: 12px; cursor: pointer; font: inherit; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.wire__line { height: 10px; border-radius: 5px; background: var(--wire); box-shadow: inset 0 -2px 0 rgb(0 0 0 / 35%); }
.wire__tag { font-size: 1.1rem; color: var(--wire); width: 1.6rem; text-align: center; }
.wire[style*="--wire: #3a3532"] .wire__tag, .wire[style*="--wire:#3a3532"] .wire__tag { color: var(--quiet); }
.wire__name { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--quiet); min-width: 6.5rem; }
.wire[data-cut="1"] { opacity: 0.45; }
.wire[data-cut="1"] .wire__line { background: linear-gradient(90deg, var(--wire) 0 42%, transparent 42% 58%, var(--wire) 58%); box-shadow: none; }
.panel-hint { margin: 0; color: var(--quiet); font-size: 0.82rem; }
.manual__rules--plain { list-style: none; padding-left: 0; }

/* ── the beacon and the keypad (Uplink) ────────────────────────────────── */

.beacon { display: grid; gap: 0.8rem; padding: 0.9rem; border-radius: 6px; background: var(--paper); color: var(--ink); font-family: var(--mono); }
.beacon__head { margin: 0; font-size: 0.66rem; letter-spacing: 0.18em; border-bottom: 2px solid var(--ink); padding-bottom: 0.4rem; }
.beacon__foot { margin: 0; font-size: 0.72rem; color: #4d4842; }
.beacon__strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(4.2rem, 1fr)); gap: 0.5rem; }
.beacon__card {
  display: grid; justify-items: center; gap: 0.2rem; padding: 0.5rem 0.3rem;
  border: 2px solid var(--ink); border-radius: 8px; color: var(--ink);
  animation: pulse calc(var(--n) * 0.9s) infinite;
  animation-delay: calc(var(--i) * 0.9s);
}
.beacon__n { font-size: 0.66rem; letter-spacing: 0.1em; }
@keyframes pulse { 0%, 100% { background: transparent; } 8% { background: var(--mid); } 22% { background: transparent; } }

.keypad-wrap { display: grid; gap: 0.8rem; }
.entry { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 6px; }
.entry__slot { aspect-ratio: 1; display: grid; place-items: center; border: 1px dashed var(--edge); border-radius: 10px; color: var(--paper); }
.entry__slot[data-on="1"] { border-style: solid; background: var(--panel); }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.keypad__key {
  appearance: none; border: 1px solid var(--edge); background: var(--panel); color: var(--paper);
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.keypad__key:active { background: var(--edge); }

/* ── the cargo bay (Cargo) ─────────────────────────────────────────────── */

.cargo { display: grid; gap: 0.7rem; }
.bay { display: grid; grid-template-columns: auto repeat(calc(var(--n) - 1), 1fr); gap: 4px; }
.slot {
  appearance: none; border: 1px solid var(--edge); background: var(--panel); color: var(--paper);
  display: grid; place-items: center; padding: 0.3rem; border-radius: 10px; aspect-ratio: 1;
  cursor: pointer; font: inherit; position: relative; -webkit-tap-highlight-color: transparent;
}
.slot svg { width: 100%; height: auto; max-width: 64px; display: block; }
.slot__glyph { font-size: 1.5rem; color: var(--tint); line-height: 1; }
.slot[style*="#3a3532"] .slot__glyph { color: var(--quiet); }
.slot__count { position: absolute; top: 4px; right: 6px; font-family: var(--mono); font-size: 0.66rem; color: var(--paper); }
.slot__name { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--quiet); text-align: center; line-height: 1.2; }
.slot[data-marked="1"] { box-shadow: inset 0 0 0 3px var(--mid); }
.slot[data-marked="1"]::after { content: "✓"; position: absolute; top: 2px; left: 6px; color: var(--mid); font-weight: 700; }

/* ── re-entry ──────────────────────────────────────────────────────────── */

.reentry { display: grid; gap: 0.7rem; }
.reentry__head { display: flex; align-items: center; gap: 0.8rem; }
.hull { flex: 1; position: relative; height: 22px; border: 1px solid var(--edge); border-radius: 999px; background: var(--panel); overflow: hidden; }
.hull i { display: block; height: 100%; background: var(--lo); transition: width 240ms; }
.hull[data-low="1"] i { background: var(--hot); }
.hull__label { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.18em; color: var(--ink); font-weight: 700; z-index: 1; }
.reentry__clock { font-family: var(--mono); font-size: 1.4rem; font-variant-numeric: tabular-nums; min-width: 2.2rem; text-align: right; }
.feed { display: grid; gap: 0.4rem; min-height: 5.6rem; }
.feed__head { margin: 0; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.18em; color: var(--mid); }
.feed__list { display: grid; gap: 0.4rem; }
.cmd { position: relative; padding: 0.55rem 0.8rem 0.7rem; border: 1px solid var(--edge); border-radius: 10px; background: var(--panel); overflow: hidden; }
.cmd__text { font-weight: 700; font-size: 1.02rem; }
.cmd__fuse { position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--left, 1) * 100%); background: var(--mid); }
.cmd[data-urgent="1"] .cmd__fuse { background: var(--hot); }
.cmd[data-urgent="1"] { border-color: var(--hot); }
.rpanel { display: grid; gap: 0.6rem; }
.rpanel .seg__btn { font-size: 0.8rem; }

/* ── the comms bar (remote mode) ───────────────────────────────────────── */

.comms { display: grid; gap: 0.5rem; }
.comms__pill {
  justify-self: center; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.3rem 0.8rem; border-radius: 999px; border: 1px solid var(--edge); background: var(--panel);
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lo);
  visibility: hidden;
}
.comms__pill[data-on="1"] { visibility: visible; }
.comms__meter { width: 3.4rem; height: 6px; border-radius: 3px; background: var(--edge); overflow: hidden; position: relative; }
.comms__meter::after { content: ""; position: absolute; inset: 0; width: calc(var(--level, 0) * 100%); background: var(--lo); }
.comms__banner {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 0.6rem 0.9rem; border-radius: 12px; border: 1px solid var(--hot); background: var(--panel);
  font-size: 0.86rem;
}
.comms__retry { appearance: none; border: 0; background: transparent; color: var(--mid); font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; padding: 0.3rem 0; }
.ptt {
  appearance: none; border: 2px solid var(--paper); background: var(--paper); color: var(--ink);
  font: inherit; font-weight: 800; font-size: 1.1rem; letter-spacing: 0.04em;
  min-height: 64px; border-radius: 999px; width: 100%; cursor: pointer; user-select: none; touch-action: none;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none;
  transition: background 100ms, transform 80ms;
}
.ptt[data-state="talking"] { background: var(--hot); border-color: var(--hot); color: var(--paper); transform: scale(0.98); }
.ptt[data-state="busy"] { background: var(--panel); color: var(--quiet); border-color: var(--edge); }
.ptt[data-state="off"], .ptt:disabled { opacity: 0.4; }
.ptt[data-link="connecting"]::after { content: " ·"; color: var(--mid); }
