:root {
  color-scheme: light;
  --bg: #f6f7f9; --surface: #ffffff; --border: #e3e6ea;
  --text: #191919; --text-2: #5f6368; --accent: #1f6fd1; --accent-ink: #ffffff;
  --series-1: #257de0; --nodata: #eceef1;
  --good: #0a7d24; --warn: #a15c00; --bad: #c62828;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111214; --surface: #1b1c1f; --border: #2e3035;
    --text: #efefef; --text-2: #a0a4aa; --accent: #4b93ee; --accent-ink: #0b0b0b;
    --series-1: #338ced; --nodata: #24262a;
    --good: #3fbf5d; --warn: #e0a040; --bad: #ef6b6b;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0.2rem 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.6rem 0 0.7rem; }
h3 { font-size: 1rem; margin: 1.4rem 0 0.5rem; }
code { font-size: 0.85em; background: var(--nodata); padding: 1px 5px; border-radius: 4px; word-break: break-all; }
.muted { color: var(--text-2); }
.small { font-size: 0.85rem; }
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: 0.7rem 1.5rem; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); }
.tabs { display: flex; gap: 1rem; }
.tabs a { color: var(--text-2); padding: 0.3rem 0; border-bottom: 2px solid transparent; }
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.me { margin-left: auto; display: flex; gap: 1rem; align-items: center; }
.page { max-width: 1180px; margin: 0 auto; padding: 1.5rem; }
.center { max-width: 460px; margin: 10vh auto; padding: 1rem; }
.card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.4rem; }
.panel { margin: 1rem 0; }
.narrow { max-width: 520px; }
.cards { list-style: none; padding: 0; display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.link-card { display: flex; justify-content: space-between; align-items: center; color: var(--text); }
.heading-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.period { display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; }
.period a { padding: 0.25rem 0.7rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text-2); background: var(--surface); }
.period a[aria-current] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.period span { margin-left: 0.5rem; }
.notice { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 0.7rem 1rem; border-radius: 6px; }
.error { color: var(--bad); }
.button { display: inline-block; padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.button:hover { text-decoration: none; border-color: var(--accent); }
.button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button.wide { display: block; width: 100%; text-align: center; margin: 0.6rem 0; }
button.link { background: none; border: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }
button.link.danger { color: var(--bad); }
form.inline { display: inline; }
label { display: block; font-weight: 600; margin: 0.9rem 0 0.3rem; font-size: 0.9rem; }
input, select { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); font: inherit; }
form .button { margin-top: 1rem; }
.row-form { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.row-form > div { flex: 1 1 200px; }
.row-form label { margin-top: 0; }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { padding: 0.55rem 0.8rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { font-size: 0.8rem; color: var(--text-2); font-weight: 600; background: var(--bg); }
table.data tr:last-child td { border-bottom: none; }
table.compact td, table.compact th { padding: 0.4rem 0.7rem; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-block; font-size: 0.75rem; padding: 0.05rem 0.5rem; border-radius: 999px; background: var(--nodata); color: var(--text-2); }
.pill.enabled { color: var(--good); }
.pill.paused, .pill.removed, .pill.hidden { color: var(--text-2); }
.needs { list-style: none; padding: 0; margin: 0; }
.needs li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); display: flex; gap: 0.7rem; align-items: baseline; }
.needs li:last-child { border-bottom: none; }
.needs .tag { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; min-width: 4.2rem; }
.needs .setup .tag { color: var(--accent); }
.needs .warning .tag { color: var(--warn); }
.channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.6rem; margin: 0.5rem 0 1rem; }
.channel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.7rem 0.9rem; display: flex; flex-direction: column; gap: 0.2rem; }
.channel.on { border-color: var(--accent); }
.channel.off strong { color: var(--text-2); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.8rem; margin: 0.8rem 0; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; display: flex; flex-direction: column; }
.tile .label { color: var(--text-2); font-size: 0.85rem; }
.tile .value { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--text-2); font-size: 0.8rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1rem; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
figure { margin: 0; }
figcaption { font-weight: 600; margin-bottom: 0.5rem; }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .bar { fill: var(--series-1); }
svg.chart .nodata { fill: var(--nodata); }
svg.chart .hit { fill: transparent; }
svg.chart .hit:hover { fill: var(--text-2); fill-opacity: 0.08; }
svg.chart .axis { stroke: var(--border); stroke-width: 1; }
svg.chart .tick { fill: var(--text-2); font-size: 11px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.card > h1:first-child, .card > h2:first-child { margin-top: 0; }
table.data + .card, table.data + section, table.data + p { margin-top: 1.2rem; }
@media (max-width: 640px) { table.data { display: block; overflow-x: auto; } .page { padding: 1rem; } }
