:root {
  color-scheme: dark;
  --bg: #101114;
  --card: #181b22;
  --line: #2c3340;
  --text: #e8edf5;
  --muted: #93a0b4;
  --accent: #5b8cff;
  --danger: #e15d66;
  --ok: #3dbe86;
  --font: ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
}

h1, h2, p { margin: 0; }
h1 { font-size: 1.45rem; font-weight: 650; }
h2 { font-size: 1.05rem; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
  word-break: break-all;
}

.top, .stack, .login-wrap {
  width: min(980px, calc(100% - 32px));
  margin-inline: auto;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 28px 0 8px;
}

.stack { display: grid; gap: 16px; padding-bottom: 40px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-card { width: min(420px, 100%); display: grid; gap: 12px; }
.login-card h1 { margin-bottom: 2px; }

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.muted { color: var(--muted); }

label { display: grid; gap: 6px; color: var(--muted); font-size: 0.86rem; }

input {
  width: 100%;
  border: 1px solid var(--line);
  background: #101218;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

button, .button-link {
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: var(--accent);
  color: #08101f;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

button.ghost, .button-link.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

button.danger { background: var(--danger); color: #fff; }
button.danger.ghost { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.section-head, .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.row { justify-content: flex-start; margin-top: 14px; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.facts dt { color: var(--muted); font-size: 0.8rem; }
.facts dd { margin: 2px 0 0; }

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.pill.on { color: var(--ok); border-color: var(--ok); }
.pill.off { color: var(--danger); border-color: var(--danger); }

.flash {
  border-radius: 8px;
  padding: 10px 12px;
  background: #142033;
}

.flash.error { background: #2a1518; color: #ffb4b8; }
.flash.ok { background: #13261d; color: #b7f0d4; }

.table-wrap { overflow-x: auto; margin-top: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.actions { text-align: right; width: 1%; white-space: nowrap; }
.actions form { display: inline; }

h3 { margin: 8px 0 4px; font-size: 0.95rem; }
.keys { list-style: none; padding: 0; display: grid; gap: 8px; }
.keys li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.keys input { width: min(420px, 100%); }

@media (max-width: 640px) {
  .top { align-items: flex-start; flex-direction: column; }
}
