:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --text: #16191f;
  --muted: #5d6573;
  --accent: #2f6fde;
  --ok: #1f9d55;
  --warn: #c98a04;
  --bad: #d64545;
  --track: #e7eaef;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161a21;
    --surface-2: #1c212a;
    --border: #262c36;
    --text: #e8ebf0;
    --muted: #97a0ad;
    --accent: #6ea0ff;
    --ok: #3ccf7e;
    --warn: #f0b429;
    --bad: #ff6b6b;
    --track: #262c36;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { border-bottom: 1px solid var(--border); background: var(--surface); }
.top-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; }
h1 { margin: 0; font-size: 1.5rem; letter-spacing: -0.01em; }
.sub { margin: 4px 0 0; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 0.875rem; background: var(--surface-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.live.ok .dot, .dot.ok { background: var(--ok); }
.live.stale .dot, .dot.stale { background: var(--warn); }
.dot.down { background: var(--bad); }

main { padding-top: 24px; padding-bottom: 16px; }
section { margin-bottom: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
h2 { margin: 0; font-size: 1.05rem; }
.meta { margin: 0; color: var(--muted); font-size: 0.875rem; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.tile .label { color: var(--muted); font-size: 0.8rem; }
.tile .value { font-size: 1.35rem; font-weight: 600; margin-top: 2px; }
.tile .hint { color: var(--muted); font-size: 0.8rem; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 8px; }
.card-head h3 { margin: 0; font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-head .uptime { margin-left: auto; color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.role { margin: 2px 0 10px; color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bars { display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; font-size: 0.8rem; }
.bar .name { color: var(--muted); }
.bar .num { color: var(--muted); white-space: nowrap; min-width: 9ch; text-align: right; }
.track { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.fill { height: 100%; border-radius: 3px; background: var(--accent); width: 0; transition: width .4s ease; }
.fill.warn { background: var(--warn); }
.fill.bad { background: var(--bad); }

.guests { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); display: grid; gap: 10px; }
.guest { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.guest .role { margin-bottom: 8px; }
.empty { color: var(--muted); font-size: 0.875rem; }

.foot { color: var(--muted); font-size: 0.8rem; padding-bottom: 32px; }
.foot p { margin: 0; border-top: 1px solid var(--border); padding-top: 16px; }

@media (prefers-reduced-motion: reduce) { .fill { transition: none; } }
