:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #1d4ed8;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --talk: #b91c1c;
  --talk-bg: #fee2e2;
  --off: #6b7280;
  --off-bg: #f3f4f6;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #2a2f3a;
    --accent: #60a5fa;
    --ok: #4ade80;
    --ok-bg: #14321f;
    --talk: #f87171;
    --talk-bg: #3b1515;
    --off: #9ca3af;
    --off-bg: #20242c;
    --warn: #fbbf24;
    --warn-bg: #3a2c0c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header, main, footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 24px;
  padding-bottom: 8px;
}

h1 { margin: 0; font-size: 1.9rem; letter-spacing: -0.01em; }
h2 { margin: 0 0 10px; font-size: 1.1rem; }
#description { margin: 4px 0 0; color: var(--muted); }

.status { display: flex; gap: 10px; align-items: center; }
.muted { color: var(--muted); }

section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
}

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.section-head p { margin: 0; }

.pill, .badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge { padding: 1px 8px; font-size: 0.78rem; }

.ok { color: var(--ok); background: var(--ok-bg); }
.talk { color: var(--talk); background: var(--talk-bg); }
.off { color: var(--off); background: var(--off-bg); }
.warn { color: var(--warn); background: var(--warn-bg); }

#onair { border-color: var(--talk); }
#talkers { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
#talkers li {
  background: var(--talk-bg);
  color: var(--talk);
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
}
#talkers .call { font-size: 1.25rem; margin-right: 8px; }
#talkers .meta { font-weight: 500; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
th button {
  all: unset;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
th button[aria-pressed="true"] { color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
tr.offline td { color: var(--muted); }
td.call { font-weight: 700; white-space: nowrap; }
td.call small { display: block; font-weight: 400; color: var(--muted); white-space: normal; }
td .sub { display: block; color: var(--muted); font-size: 0.85rem; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

#map { height: 420px; border-radius: 8px; }

.commands { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 8px 0 12px; }
.commands dt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.commands dd { margin: 0; }

footer { padding-top: 4px; padding-bottom: 32px; font-size: 0.85rem; }

@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  th, td { padding: 6px 6px; }
}
