* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.4 -apple-system, system-ui, sans-serif; background: #111; color: #eee;
  display: flex; flex-direction: column; align-items: center; }
a { color: #7cf; }
.wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; }
.device { position: relative; }
.device svg { display: block; width: 100%; height: 100%; }
.device .screen { position: absolute; overflow: hidden; background: #b9c2b0; }
.device canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.btn { cursor: pointer; }
.btn:active { opacity: .6; }
.bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
button.act, label.act { background: #2a2a2a; color: #eee; border: 1px solid #444; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font: inherit; }
button.act:hover, label.act:hover { background: #333; }
.hint { color: #999; font-size: 13px; text-align: center; max-width: 520px; }
.samples { gap: 6px; max-width: min(720px, 94vw); }
button.act.sample { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 8px 5px;
  font-size: 12px; color: #bbb; }
button.act.sample canvas { width: 60px; height: 36px; border-radius: 3px; background: #fff; display: block; }
button.act.sample.on { border-color: #e8622a; color: #fff; background: #33261f; }
.status { color: #ddd; font-size: 14px; text-align: center; max-width: 560px; min-height: 20px; margin: 0; }

.topnav { display: flex; margin: 14px 0 0; background: #222; border: 1px solid #444;
  border-radius: 10px; overflow: hidden; }
.topnav a { padding: 8px 18px; color: #bbb; text-decoration: none; font-weight: 600; font-size: 14px; }
.topnav a + a { border-left: 1px solid #444; }
.topnav a:hover { background: #2c2c2c; color: #eee; }
.topnav a.tx.active { background: #e8622a; color: #fff; }
.topnav a.rx.active { background: #f4c20a; color: #111; }

/* receiver diagnostics: a card with a header (mic, sample rate) and a row of labelled tiles;
   tabular figures and fixed tile widths so nothing shifts while the numbers change */
.hud { width: min(620px, 94vw); background: #181818; border: 1px solid #333; border-radius: 12px;
  padding: 10px 12px 12px; font-size: 12px; }
.hud[hidden] { display: none; }
button.act.on { border-color: #888; color: #fff; }
.hud-head { display: flex; justify-content: space-between; gap: 12px; color: #888; margin-bottom: 8px; }
.hud-head b { color: #ccc; font-weight: 600; letter-spacing: .02em; }
.hud-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
@media (max-width: 600px) { .hud-grid { grid-template-columns: repeat(4, 1fr); } }
.hud-cell { background: #222; border: 1px solid #2c2c2c; border-radius: 8px; padding: 5px 8px; min-width: 0; }
.hud-cell .k { color: #888; font-size: 11px; }
.hud-cell .v { color: #eee; font: 600 14px/1.3 ui-monospace, SFMono-Regular, monospace; font-variant-numeric: tabular-nums;
  white-space: nowrap; }
.hud-cell .v.bad { color: #f87; }
.hud-meter { height: 4px; background: #333; border-radius: 2px; margin-top: 4px; overflow: hidden; }
.hud-meter > i { display: block; height: 100%; width: 0; background: #6c6; border-radius: 2px; }
