:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1c2330;
  --muted: #6b7484;
  --line: #e2e5ea;
  --accent: #1f6feb;
  --ok: #1a7f37;
  --bad: #cf222e;
  --cq: #9a6700;
  --new: #fff4d6;
  color-scheme: light dark;
}
/* Dark: by the system unless the switch says light, or always when it says dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1218;
    --panel: #171b23;
    --text: #e3e7ee;
    --muted: #8a93a3;
    --line: #262c37;
    --accent: #58a6ff;
    --ok: #3fb950;
    --bad: #f85149;
    --cq: #d29922;
    --new: #2b2410;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1218;
  --panel: #171b23;
  --text: #e3e7ee;
  --muted: #8a93a3;
  --line: #262c37;
  --accent: #58a6ff;
  --ok: #3fb950;
  --bad: #f85149;
  --cq: #d29922;
  --new: #2b2410;
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
header { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
h1 { margin: 0; font-size: 18px; }
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.credits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
a.bmc {
  background: #ffdd00; color: #000; font-weight: 600; border-radius: 6px; padding: 4px 10px; white-space: nowrap;
}
a.bmc:hover { background: #ffe74d; text-decoration: none; }
button.theme {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 10px; cursor: pointer; white-space: nowrap;
}
button.theme:hover { border-color: var(--accent); }
h2 { margin: 0 0 8px; font-size: 15px; }
h2 .count { color: var(--muted); font-weight: 400; }
h2.next { margin-top: 20px; }
h2.with-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; font-size: 12px; font-weight: 400; }
.switch button {
  font: inherit; color: var(--muted); background: var(--panel); border: 0; padding: 2px 8px; cursor: pointer; white-space: nowrap;
}
.switch button + button { border-left: 1px solid var(--line); }
.switch button[aria-pressed=true] { color: var(--text); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.muted { color: var(--muted); }

.channels { display: flex; flex-wrap: wrap; gap: 8px; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.times { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; }
.times b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.channel {
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-size: 13px;
  display: flex; gap: 8px; align-items: center;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); flex: none; }
.dot.ok { background: var(--ok); }

main { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; padding: 16px; }
@media (max-width: 900px) { main { grid-template-columns: minmax(0, 1fr); } }
footer { padding: 0 16px 16px; font-size: 12px; text-align: center; }
#build { font-variant-numeric: tabular-nums; }

.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 8px; }
.filters select, .filters input[type=search] {
  font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px;
}

.table-wrap, aside { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
aside { padding: 12px; align-self: start; overflow-x: visible; }
.dxcc td { white-space: normal; overflow-wrap: anywhere; }
.dxcc td.num, .dxcc td:first-child a { white-space: nowrap; overflow-wrap: normal; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 4px 8px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; background: var(--panel); font-weight: 600; color: var(--muted); font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.msg { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
tr.cq td.msg { color: var(--cq); }
tr.fresh { background: var(--new); }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
