:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #111914;
  color: #f1f4e9;
  --panel: #1a251e;
  --border: #34463a;
  --muted: #acbdb0;
  --accent: #d5f484;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, input { font: inherit; }
p, dl, dd { margin: 0; }

.shell {
  width: min(100% - 3rem, 58rem);
  margin-inline: auto;
  padding-block: clamp(2rem, 6vw, 4.5rem) 3rem;
  display: grid;
  gap: 1.25rem;
}

.masthead { display: flex; align-items: center; gap: 1rem; margin-bottom: .65rem; }
.wordmark { color: var(--accent); font: 700 .9rem var(--mono); letter-spacing: .19em; margin-bottom: .2rem; }
h1 { margin: 0; font-size: clamp(1.35rem, 4vw, 2.25rem); line-height: 1.13; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 1.25rem; line-height: 1.2; letter-spacing: -.025em; }

.radio-mark {
  flex: 0 0 3.25rem;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .19rem;
  color: #26351a;
  background: var(--accent);
  border-radius: .85rem;
}
.radio-mark i { width: .18rem; height: .6rem; border-radius: 1rem; background: currentColor; }
.radio-mark i:nth-child(2), .radio-mark i:nth-child(4) { height: 1rem; }
.radio-mark i:nth-child(3) { height: 1.5rem; }

.panel { min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 1.125rem; padding: 1.5rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.section-title { display: grid; gap: .25rem; }
.state {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .38rem .65rem;
  border: 1px solid var(--border);
  border-radius: 2rem;
  color: var(--muted);
  font: 600 .875rem var(--mono);
}
.state::before { content: ''; width: .42rem; aspect-ratio: 1; border-radius: 50%; background: currentColor; }
.state[data-tone='live'] { color: var(--accent); background: #2c3d24; border-color: #4b6040; }
.state[data-tone='paused'] { color: #ffd397; }
.statuses {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-block: 1.25rem;
  border-block: 1px solid var(--border);
}
.statuses > div { padding: 1rem; min-width: 0; }
.statuses > div:first-child { padding-inline-start: 0; }
.statuses > div + div { border-inline-start: 1px solid var(--border); }
dt { font-size: .875rem; color: var(--muted); margin-bottom: .45rem; }
dd { overflow-wrap: anywhere; }
.statuses dd:first-of-type { font-weight: 640; margin-bottom: .3rem; }
.detail { color: var(--muted); font-size: .875rem; line-height: 1.45; }
.controls { display: flex; flex-wrap: wrap; gap: .65rem; }
button {
  min-height: 2.8rem;
  padding: .6rem 1rem;
  border: 1px solid transparent;
  border-radius: .55rem;
  cursor: pointer;
  font-weight: 680;
  line-height: 1.2;
}
button:disabled { opacity: .48; cursor: default; }
.primary { color: #1c2a14; background: var(--accent); }
.primary:enabled:hover { background: #e2ffa0; }
.secondary { color: #f1f4e9; background: #233329; border-color: #465a4b; }
.secondary:enabled:hover { background: #314639; }
.controls button { min-width: 8.8rem; }
.capture-note { margin-top: .8rem; color: var(--muted); line-height: 1.45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.packet-total { display: flex; align-items: baseline; gap: .65rem; margin-block: 1.15rem .8rem; }
.packet-total strong { font: 600 clamp(2.25rem, 6vw, 3.25rem)/1 var(--mono); letter-spacing: -.09em; color: var(--accent); }
.packet-total span { color: var(--muted); }
.empty { border-block-start: 1px solid var(--border); padding-top: .95rem; color: var(--muted); line-height: 1.45; }
.error { padding: .7rem 0; color: #ffc0a3; }
.export-status { margin-block: .6rem; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { text-align: start; border-block-start: 1px solid var(--border); padding: .75rem .2rem .75rem 0; }
th { font-size: .875rem; color: var(--muted); font-weight: 500; }
th:first-child { width: 33%; }
th:last-child { width: 29%; }
td { font: .875rem var(--mono); }
td:last-child { font-family: system-ui, sans-serif; }
th small, td small { display: block; margin-top: .2rem; color: var(--muted); font: .8125rem system-ui, sans-serif; }
.located { color: var(--accent); }

.diagnostics { padding-block: 0; }
.diagnostics summary { padding-block: 1rem; cursor: pointer; font-weight: 630; }
.diagnostics dl { display: grid; gap: 1rem; margin-bottom: 1.25rem; }
.diagnostics samp { white-space: pre-wrap; }
.diagnostics[open] { padding-bottom: 1.25rem; }
.field { display: flex; align-items: center; gap: .65rem; margin-block: .4rem; }
input { width: 5rem; min-height: 2.75rem; padding: .4rem .6rem; background: #111914; color: inherit; border: 1px solid #546758; border-radius: .4rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 44rem) {
  .statuses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .statuses > div:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
  .statuses > div:nth-child(n+3) { border-block-start: 1px solid var(--border); }
}

@media (max-width: 30rem) {
  .shell { width: calc(100% - 1.5rem); }
  .panel { padding-inline: 1rem; }
  .controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls button { min-width: 0; }
  .statuses > div { padding-inline: .65rem 0; }
  .statuses > div:nth-child(odd) { padding-inline-end: .55rem; }
  .section-head button { font-size: .875rem; padding-inline: .65rem; }
}
