:root {
  --bg: #f8fafc; --card: #ffffff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --up: #15803d; --down: #b91c1c; --warn: #b45309; --accent: #1d4ed8; --chip: #f1f5f9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a; --card: #111c33; --text: #e2e8f0; --muted: #94a3b8; --line: #1e293b;
    --up: #4ade80; --down: #f87171; --warn: #fbbf24; --accent: #60a5fa; --chip: #1e293b;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; }
.status { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.live { background: var(--up); } .dot.stale { background: var(--warn); } .dot.down { background: var(--down); }
.pill { padding: 2px 8px; border-radius: 999px; background: var(--chip); font-size: 12px; text-transform: capitalize; }
.pill.open { background: var(--up); color: #fff; }
main { padding: 12px 16px calc(84px + env(safe-area-inset-bottom)); max-width: 960px; margin: 0 auto; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs a { flex: 1; text-align: center; padding: 12px 4px; color: var(--muted); text-decoration: none; font-size: 13px; }
.tabs a.active { color: var(--accent); font-weight: 600; }
h2 { font-size: 16px; margin: 18px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stat .label { color: var(--muted); font-size: 12px; } .stat .value { font-size: 18px; font-weight: 600; }
.up { color: var(--up); } .down { color: var(--down); } .muted { color: var(--muted); }
.row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.list > .card { cursor: default; }
.alert { border-left: 4px solid var(--warn); } .alert.critical { border-left-color: var(--down); }
.bar { height: 6px; background: var(--chip); border-radius: 3px; position: relative; margin-top: 6px; }
.bar > span { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { background: var(--chip); border-radius: 999px; padding: 2px 8px; font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
.scroll { overflow-x: auto; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
button { padding: 10px 14px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
button.secondary { background: var(--chip); color: var(--text); }
button:disabled { opacity: .5; }
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 12px;
  border-radius: 10px; background: var(--text); color: var(--bg); text-align: center; z-index: 10; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
.err { color: var(--down); font-size: 13px; }
details summary { cursor: pointer; color: var(--muted); }
.sub { font-size: 12px; }
td .sub { white-space: nowrap; }

.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl td { padding: 6px 4px; border-bottom: 1px solid rgba(148,163,184,.15); }
