:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --border: #e2e1dc;
  --text: #0b0b0b;
  --text-2: #52514e;
  --muted: #7a7974;
  --accent: #2a78d6;
  --m-ysf: #2a78d6;
  --m-wx: #eb6834;
  --m-dmr: #1baf7a;
  --good: #0ca30c;
  --good-text: #006300;
  --fair: #fab219;
  --fair-text: #8a5a00;
  --poor: #d03b3b;
  --poor-text: #b02a2a;
  --live: #d03b3b;
  --grid: #e8e7e3;
  --seq-0: #f0efec;
  --seq-1: #cde2fb;
  --seq-2: #9ec5f4;
  --seq-3: #6da7ec;
  --seq-4: #3987e5;
  --seq-5: #256abf;
  --seq-6: #184f95;
  --seq-7: #0d366b;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211;
    --surface: #1a1a19;
    --surface-2: #232321;
    --border: #2e2e2b;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --muted: #8f8e86;
    --accent: #3987e5;
    --m-ysf: #3987e5;
    --m-wx: #d95926;
    --m-dmr: #199e70;
    --good-text: #3fc23f;
    --fair-text: #fab219;
    --poor-text: #ef6b6b;
    --grid: #2a2a28;
    --seq-0: #232321;
    --seq-1: #0d366b;
    --seq-2: #184f95;
    --seq-3: #1c5cab;
    --seq-4: #2a78d6;
    --seq-5: #5598e7;
    --seq-6: #86b6ef;
    --seq-7: #b7d3f6;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --border: #2e2e2b;
  --text: #f0efec; --text-2: #c3c2b7; --muted: #8f8e86; --accent: #3987e5;
  --m-ysf: #3987e5; --m-wx: #d95926; --m-dmr: #199e70;
  --good-text: #3fc23f; --fair-text: #fab219; --poor-text: #ef6b6b; --grid: #2a2a28;
  --seq-0: #232321; --seq-1: #0d366b; --seq-2: #184f95; --seq-3: #1c5cab;
  --seq-4: #2a78d6; --seq-5: #5598e7; --seq-6: #86b6ef; --seq-7: #b7d3f6; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 13px; }
h1, h2 { margin: 0; }
h2 { font-size: 17px; font-weight: 650; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 36px; height: 36px; flex: none; }
.logo circle { fill: var(--accent); }
.logo path { stroke: var(--accent); stroke-width: 3; fill: none; stroke-linecap: round; }
h1 { font-size: 22px; letter-spacing: .02em; }
.sub { margin: 0; color: var(--text-2); font-size: 13px; }
.sub b { color: var(--text); font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.ok .dot { background: var(--good); }
.status.bad .dot { background: var(--poor); }

main { padding-top: 20px; padding-bottom: 24px; display: grid; gap: 16px; }

/* on the air */
.onair { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; min-height: 108px; }
.onair .label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.idle-text { font-size: 24px; font-weight: 650; margin-top: 4px; }
.idle-last { color: var(--text-2); margin-top: 2px; }
.onair.active .onair-idle { display: none; }
.onair-list { display: grid; gap: 14px; }
.talker { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 16px; align-items: center; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--live); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; }
.live-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .live-pill::before { animation: none; } }
.talker .who { min-width: 0; }
.talker .call { font-size: 30px; font-weight: 750; letter-spacing: .02em; line-height: 1.1; }
.talker .call small { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.talker .meta { color: var(--text-2); }
.talker .timer { font-size: 28px; font-weight: 600; text-align: right; }
.talker .rx { font-size: 13px; color: var(--text-2); text-align: right; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.tile-k { font-size: 13px; color: var(--text-2); }
.tile-v { font-size: 28px; font-weight: 650; margin-top: 2px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.hint { color: var(--text-2); font-size: 14px; margin: 0 0 12px; max-width: 80ch; }
.hint.small { font-size: 13px; margin: 12px 0 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip:focus-visible, .search:focus-visible, .more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.m-ysf { background: var(--m-ysf); } .m-wx { background: var(--m-wx); } .m-dmr { background: var(--m-dmr); }
.search { font: inherit; font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; width: 200px; max-width: 100%; text-transform: uppercase; }
.search::placeholder { text-transform: none; color: var(--muted); }

/* tables */
.table-scroll { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--grid); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
td.num { white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.heard td:first-child { white-space: nowrap; color: var(--text-2); }
.heard .ago { display: block; font-size: 12px; color: var(--muted); }
.stn b { font-weight: 650; letter-spacing: .01em; }
.stn .suffix { color: var(--muted); }
.stn .nm { display: block; font-size: 13px; color: var(--text-2); }
.via { display: flex; gap: 8px; align-items: flex-start; }
.via .sw { margin-top: 5px; }
.via .d { font-size: 13px; color: var(--muted); display: block; }
tr.flagged td { background: color-mix(in srgb, var(--fair) 8%, transparent); }
.flag { display: inline-block; font-size: 12px; color: var(--fair-text); margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.badge b { width: 16px; height: 16px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: 10px; font-weight: 800; }
.badge.good { color: var(--good-text); } .badge.good b { background: var(--good); }
.badge.fair { color: var(--fair-text); } .badge.fair b { background: var(--fair); color: #3a2a00; }
.badge.poor { color: var(--poor-text); } .badge.poor b { background: var(--poor); }
.badge.na { color: var(--muted); font-weight: 400; }
.mob { font-size: 12px; color: var(--fair-text); white-space: nowrap; }
.more { font: inherit; font-size: 14px; display: block; margin: 10px auto 0; background: none; border: 1px solid var(--border); color: var(--text-2); border-radius: 8px; padding: 6px 16px; cursor: pointer; }
tr.hl td { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* heatmap */
.heat-wrap { overflow-x: auto; }
.heat { display: grid; grid-template-columns: 40px repeat(24, minmax(22px, 1fr)); gap: 2px; min-width: 620px; font-size: 11px; color: var(--muted); }
.heat .cell { aspect-ratio: 1.6; border-radius: 3px; background: var(--seq-0); }
.heat .cell:hover { outline: 2px solid var(--text); outline-offset: 1px; }
.heat .rl { display: flex; align-items: center; }
.heat .cl { text-align: center; }
.heat-legend { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.heat-legend i { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }

/* daily chart */
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); margin-bottom: 6px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart { width: 100%; height: 220px; position: relative; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .ax { font-size: 11px; fill: var(--muted); }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--border); stroke-width: 1; }
.chart .hov { fill: var(--text); opacity: .06; }
details.tbl { margin-top: 10px; font-size: 14px; }
details.tbl summary { cursor: pointer; color: var(--text-2); }
details.tbl table { margin-top: 8px; max-width: 560px; }

/* lists */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; align-items: center; font-size: 14px; }
.bars .bn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .bn b { font-weight: 650; }
.bars .bt { height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bars .bt i { display: block; height: 100%; background: var(--m-ysf); border-radius: 0 4px 4px 0; }
.bars .bv { text-align: right; color: var(--text-2); font-size: 13px; }
.linked { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.linked li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 14px; }
.linked li b { font-weight: 650; }
.linked li span { display: block; font-size: 12px; color: var(--muted); }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.events li { display: grid; grid-template-columns: 80px 1fr; gap: 10px; }
.events time { color: var(--muted); }
.events .none { color: var(--muted); display: block; }

.foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; padding-bottom: 28px; }

.tip { position: fixed; z-index: 10; pointer-events: none; background: var(--text); color: var(--surface); font-size: 13px; line-height: 1.4; padding: 8px 10px; border-radius: 8px; max-width: 260px; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.tip b { font-weight: 650; }
.tip .tr { display: flex; align-items: center; gap: 6px; }

@media (max-width: 820px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .talker { grid-template-columns: 1fr auto; }
  .talker .live-pill { grid-column: 1 / -1; justify-self: start; }
  .talker .call { font-size: 24px; }
  .tile-v { font-size: 22px; }
  .heard th:nth-child(5), .heard td:nth-child(5) { display: none; }
  .bars li { grid-template-columns: 90px 1fr 56px; }
}
