:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #667085;
  --border: #e1e5ea;
  --accent: #1b6ef3;
  --ok: #12805c;
  --warn: #b25e09;
  --bad: #c0392b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1a2029;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --border: #2a323d;
    --accent: #6ea4ff;
    --ok: #4cc9a0;
    --warn: #f0a04b;
    --bad: #ff7b6b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

h1 { margin: 0; font-size: 1.25rem; }
h2 { margin: 28px 0 8px; font-size: 1rem; }

nav { display: flex; gap: 16px; align-items: baseline; }
a { color: var(--accent); }

main { max-width: 1100px; margin: 0 auto; padding: 0 16px 48px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.card strong { font-size: 1.4rem; font-weight: 600; }
.label, .muted { color: var(--muted); font-size: 0.85rem; }

.scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
th { font-size: 0.8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty { color: var(--muted); text-align: center; }

.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.8rem;
}
.pill.ok { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.bad { color: var(--bad); }
.pill.off { color: var(--muted); }

/* Classes below set display, which would otherwise override the hidden attribute. */
[hidden] { display: none !important; }

.gate {
  margin-top: 16px;
  padding: 12px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.gate h2 { margin-top: 4px; }

.gate-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

input[type="password"] {
  flex: 1 1 260px;
  min-width: 0;
  padding: 8px 10px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

button {
  padding: 8px 14px;
  color: var(--bg);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}

button.link-button {
  padding: 0;
  color: var(--accent);
  background: none;
  text-decoration: underline;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.gate-error { min-height: 1.5em; margin: 8px 0 0; color: var(--bad); }
