:root {
  --bg: #f6f7f9; --panel: #ffffff; --panel-2: #f1f3f6; --border: #e3e6eb;
  --text: #15181d; --muted: #6b7280; --faint: #9aa1ac;
  --up: #16a34a; --up-soft: #dcfce7; --down: #dc2626; --down-soft: #fee2e2;
  --warn: #d97706; --paused: #9ca3af; --accent: #2563eb; --accent-text: #fff;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.05);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* Dark colours: used when the device prefers dark (unless the visitor chose light), or when they chose dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1116; --panel: #161a21; --panel-2: #1d222b; --border: #262c36;
    --text: #e6e9ee; --muted: #9099a6; --faint: #687180;
    --up: #22c55e; --up-soft: #12301f; --down: #ef4444; --down-soft: #3a1618;
    --paused: #5b6472; --accent: #3b82f6; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1116; --panel: #161a21; --panel-2: #1d222b; --border: #262c36;
  --text: #e6e9ee; --muted: #9099a6; --faint: #687180;
  --up: #22c55e; --up-soft: #12301f; --down: #ef4444; --down-soft: #3a1618;
  --paused: #5b6472; --accent: #3b82f6; --shadow: none;
}
.theme-btn { border: 1px solid var(--border); background: var(--panel); border-radius: 8px; width: 36px; height: 34px; padding: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1; flex: none; }
.theme-btn:hover { background: var(--panel-2); }
.theme-corner { position: fixed; top: 12px; right: 12px; z-index: 20; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.mono { font-variant-numeric: tabular-nums; }

header.top { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--border); background: var(--panel); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.brand svg { color: var(--up); }
header .spacer { flex: 1; }

.btn { border: 1px solid var(--border); background: var(--panel); padding: 7px 13px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 550; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--down); }
.btn.sm { padding: 4px 9px; font-size: 13px; }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--paused); }
.dot.up { background: var(--up); box-shadow: 0 0 0 4px var(--up-soft); }
.dot.down { background: var(--down); box-shadow: 0 0 0 4px var(--down-soft); animation: pulse 1.6s infinite; }
.dot.pending { background: var(--warn); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px transparent; } }

.bars { display: flex; gap: 2px; align-items: stretch; height: 26px; }
.bars span { flex: 1; min-width: 2px; border-radius: 2px; background: var(--panel-2); }
.bars span.up { background: var(--up); }
.bars span.down { background: var(--down); }
.bars span.partial { background: var(--warn); }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }

/* Phones: 16px form text stops iOS zooming in on focus; no sideways scroll from stray wide content. */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px !important; }
  body { overflow-x: clip; }
}
