/* Vigil — UI styles. Dark by default via OS preference; toggle stored per browser. */
:root {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0efeb;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.18);
  --text: #111110;
  --text-2: #52514e;
  --muted: #7d7b75;
  --accent: #c77700;
  --accent-hover: #a86400;
  --accent-soft: rgba(199, 119, 0, 0.12);
  --accent-ink: #ffffff;
  --good: #0a8a0a;
  --warn: #b77900;
  --serious: #d4662f;
  --crit: #d03b3b;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --grid: #e7e6e0;
  --axis: #898781;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px -12px rgba(0,0,0,.12);
  --radius: 12px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0d0f;
    --surface: #15161a;
    --surface-2: #1d1f24;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #f3f2ee;
    --text-2: #c3c2b7;
    --muted: #8b8a84;
    --accent: #f5a524;
    --accent-hover: #ffb84a;
    --accent-soft: rgba(245, 165, 36, 0.13);
    --accent-ink: #1a1203;
    --good: #22c55e;
    --warn: #fab219;
    --serious: #ec835a;
    --crit: #ef5b5b;
    --series-1: #3987e5;
    --series-2: #d95926;
    --grid: #25272c;
    --axis: #898781;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px -16px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0d0f;
  --surface: #15161a;
  --surface-2: #1d1f24;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f2ee;
  --text-2: #c3c2b7;
  --muted: #8b8a84;
  --accent: #f5a524;
  --accent-hover: #ffb84a;
  --accent-soft: rgba(245, 165, 36, 0.13);
  --accent-ink: #1a1203;
  --good: #22c55e;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #ef5b5b;
  --series-1: #3987e5;
  --series-2: #d95926;
  --grid: #25272c;
  --axis: #898781;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px -16px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 60px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark { width: 28px; height: 28px; color: var(--accent); flex: none; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  text-decoration: none; color: var(--text-2); padding: 6px 12px; border-radius: 8px; font-weight: 500;
}
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a.active { color: var(--text); background: var(--surface-2); }
.nav-spacer { flex: 1; }
.nav-user { display: flex; align-items: center; gap: 8px; position: relative; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px;
  border: 1px solid var(--border); cursor: pointer;
}
.menu {
  position: absolute; right: 0; top: 42px; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: var(--shadow); padding: 6px;
}
.menu .menu-head { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu button {
  display: flex; width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--text-2);
}
.menu button:hover { background: var(--surface-2); color: var(--text); }

/* ------------------------------------------------------------------ layout */
.page { max-width: 1320px; margin: 0 auto; padding: 28px 24px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumb { color: var(--muted); text-decoration: none; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.crumb:hover { color: var(--text); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card-title { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.section { margin-top: 24px; }

/* ------------------------------------------------------------------ buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s, transform .06s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger { color: var(--crit); }
.btn-danger:hover { background: color-mix(in srgb, var(--crit) 12%, transparent); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn svg { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { color: var(--crit); font-size: 13px; min-height: 20px; margin: -4px 0 10px; }

/* ------------------------------------------------------------------ auth pages */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.auth-glow {
  position: absolute; inset: auto; width: 720px; height: 720px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 65%);
  top: -260px; left: 50%; transform: translateX(-50%); pointer-events: none;
}
.auth-card { width: 100%; max-width: 400px; padding: 36px 32px 28px; position: relative; }
.auth-card .brand { justify-content: center; font-size: 24px; margin-bottom: 6px; }
.auth-card .brand-mark { width: 38px; height: 38px; }
.auth-sub { text-align: center; color: var(--muted); margin: 0 0 28px; }
.auth-card .btn { width: 100%; height: 42px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ------------------------------------------------------------------ stats row */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 16px 18px; }
.stat-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.stat-sub { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ server grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.server-card {
  display: flex; flex-direction: column; gap: 14px; padding: 18px;
  text-decoration: none; transition: border-color .15s, transform .15s;
}
.server-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.server-card { cursor: pointer; }
.server-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sc-head .web-links { margin-top: 3px; }
.sc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sc-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-host { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-desc { color: var(--text-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 39px; }
.sc-desc.empty { color: var(--muted); font-style: italic; }
.sc-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }

.meter { display: grid; grid-template-columns: 42px 1fr 48px; align-items: center; gap: 10px; font-size: 12px; }
.meter-label { color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.meter-track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 3px; background: var(--series-1); transition: width .4s ease; }
.meter-fill.warn { background: var(--warn); }
.meter-fill.crit { background: var(--crit); }
.meter-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.meters { display: flex; flex-direction: column; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.online { color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); }
.pill.online .dot { box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
.pill.offline { color: var(--crit); background: color-mix(in srgb, var(--crit) 10%, transparent); }
.pill.pending { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.pill.admin { color: var(--accent); background: var(--accent-soft); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 236px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
  background: transparent; cursor: pointer; color: var(--text-2); transition: all .15s;
}
.add-card:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.add-card .plus {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-2); font-size: 26px; font-weight: 300;
}
.add-card:hover .plus { background: var(--accent); color: var(--accent-ink); }
.add-card strong { font-size: 15px; }
.add-card span { font-size: 12px; color: var(--muted); }

.empty-state { text-align: center; padding: 56px 24px; }
.empty-state h2 { margin: 12px 0 6px; font-size: 20px; }
.empty-state p { color: var(--muted); margin: 0 auto 20px; max-width: 420px; }

/* ------------------------------------------------------------------ modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 16px; animation: fade .15s;
}
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; padding: 24px; animation: rise .18s ease; }
.modal h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.01em; }
.modal .modal-sub { color: var(--muted); margin: 0 0 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.codebox {
  position: relative; background: #0a0b0d; color: #e8e6df; border-radius: 10px;
  border: 1px solid var(--border-strong); padding: 14px 14px 14px 16px; padding-right: 90px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; word-break: break-all;
}
.codebox .copy { position: absolute; top: 10px; right: 10px; }
.codebox .btn { background: #1d1f24; color: #e8e6df; border-color: rgba(255,255,255,.14); }
.steps { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.steps .n {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px;
}
.waiting { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.waiting.ok { color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.callout { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* ------------------------------------------------------------------ server detail */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-head h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-desc { color: var(--text-2); margin: 8px 0 0; max-width: 760px; white-space: pre-wrap; }
.detail-desc.empty { color: var(--muted); font-style: italic; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.facts b { color: var(--text-2); font-weight: 500; }

.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 16px 18px; }
.tile .stat-value { font-size: 26px; }
.tile .meter-track { margin-top: 10px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 28px 0 14px; flex-wrap: wrap; }
.toolbar h2 { margin: 0; font-size: 18px; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.segmented button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.15); }

.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-card { padding: 16px 18px 12px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 8px; }
.chart-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.chart-head .now { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-box { position: relative; height: 200px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap; user-select: none;
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text); }
th.sorted { color: var(--accent); }
td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td.cmd { font-family: var(--mono); font-size: 12px; color: var(--text-2); max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inline-bar { display: inline-block; width: 60px; height: 5px; background: var(--surface-2); border-radius: 3px; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.inline-bar i { display: block; height: 100%; background: var(--series-1); border-radius: 3px; }
.table-tools { display: flex; gap: 10px; align-items: center; padding: 14px; border-bottom: 1px solid var(--border); }
.table-tools .input { max-width: 280px; height: 34px; }

.danger-zone { border-color: color-mix(in srgb, var(--crit) 35%, var(--border)); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }

/* ------------------------------------------------------------------ toast */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow); font-size: 13px; animation: rise .18s;
  max-width: 360px;
}
.toast.error { border-left-color: var(--crit); }
.toast.ok { border-left-color: var(--good); }

/* ------------------------------------------------------------------ v0.2: tabs, alerts, security, capacity, terminal */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 8px 0 20px; overflow-x: auto; }
.tabs button, .tabs a {
  border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-count { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.tab-count.bad { background: color-mix(in srgb, var(--crit) 16%, transparent); color: var(--crit); }

.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin-bottom: 20px;
  border: 1px solid color-mix(in srgb, var(--crit) 40%, var(--border));
  background: color-mix(in srgb, var(--crit) 8%, var(--surface));
}
.banner .icon { color: var(--crit); font-weight: 800; }
.banner ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.banner a { color: var(--text); font-weight: 600; }
.banner.info { border-color: var(--border-strong); background: var(--surface); }
.banner.info .icon { color: var(--accent); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-2);
}
.badge.fail { background: color-mix(in srgb, var(--crit) 14%, transparent); color: var(--crit); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.pass { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.sc-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.checks { display: flex; flex-direction: column; }
.check { border-bottom: 1px solid var(--border); }
.check:last-child { border-bottom: 0; }
.check summary {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 13px 18px; cursor: pointer; list-style: none;
}
.check summary::-webkit-details-marker { display: none; }
.check summary:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.check-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.check-icon.pass { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.check-icon.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.check-icon.fail { background: color-mix(in srgb, var(--crit) 15%, transparent); color: var(--crit); }
.check-icon.info { background: var(--surface-2); color: var(--muted); }
.check-title { font-weight: 600; }
.check-sum { color: var(--text-2); font-size: 13px; }
.check-cat { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.check-body { padding: 0 18px 16px 56px; font-size: 13px; }
.check-body ul { margin: 0 0 10px; padding-left: 16px; color: var(--text-2); font-family: var(--mono); font-size: 12px; }
.fix-label { font-size: 12px; font-weight: 700; color: var(--text-2); margin: 6px 0 6px; }
pre.output, .fix pre {
  background: #0a0b0d; color: #e8e6df; border-radius: 9px; padding: 12px 14px; margin: 0;
  font-family: var(--mono); font-size: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  max-height: 360px; overflow: auto; border: 1px solid var(--border-strong);
}
.fix { position: relative; }
.fix .btn { position: absolute; top: 8px; right: 8px; background: #1d1f24; color: #e8e6df; border-color: rgba(255,255,255,.14); }

.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 16px; font-size: 13px; align-items: center; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.secret-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.secret-val { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 3px 8px; border-radius: 6px; max-width: 100%; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.radio-row { display: flex; gap: 8px; }
.radio-row label {
  flex: 1; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--border-strong);
  border-radius: 9px; cursor: pointer; font-weight: 500; color: var(--text); font-size: 13px;
}
.radio-row input { accent-color: var(--accent); }
.radio-row label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }

.rule-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.rule-row:last-child { border-bottom: 0; }
.rule-row .input { width: 76px; height: 34px; display: inline-block; text-align: center; padding: 0 6px; }
.rule-row .muted { font-size: 12px; }

/* capacity */
.capacity { margin-bottom: 24px; }
.cap-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.cap-cell { padding: 18px 20px; border-right: 1px solid var(--border); }
.cap-cell:last-child { border-right: 0; }
.cap-big { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0 8px; font-variant-numeric: tabular-nums; }
.cap-big small { font-size: 14px; color: var(--muted); font-weight: 500; }
.sizing { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 20px 20px; }
.sizing-col { background: var(--surface-2); border-radius: 10px; padding: 14px 16px; }
.sizing-col.rec { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.sizing-col h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sizing-col.rec h4 { color: var(--accent); }
.sizing-col div { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; font-variant-numeric: tabular-nums; }
.sizing-col b { font-weight: 700; }
details.more > summary { cursor: pointer; padding: 12px 20px; color: var(--text-2); font-size: 13px; border-top: 1px solid var(--border); }

/* activity */
.act-ok { color: var(--good); }
.act-bad { color: var(--crit); font-weight: 600; }
td.when { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px; border-bottom: 1px solid var(--border); }
.filters .input { height: 34px; width: auto; }
.filters input.input { min-width: 220px; }

/* terminal page */
.term-page { display: flex; flex-direction: column; height: calc(100vh - 60px); }
.term-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.term-bar .title { font-weight: 700; }
.term-wrap { flex: 1; min-height: 0; background: #0a0b0d; padding: 8px 4px 4px 10px; }
#term { height: 100%; }
.term-msg { padding: 24px; color: #e8e6df; font-family: var(--mono); font-size: 13px; }

.icon-btn {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.web-link { color: var(--series-1); text-decoration: none; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; max-width: 100%; vertical-align: bottom; }
.web-link:hover { text-decoration: underline; }
.web-link.unverified { color: var(--muted); font-weight: 500; }
.web-links { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 12px; }

/* v0.3: pickers, results, jobs, keys, vultr */
.picker { display: flex; flex-direction: column; max-height: 280px; overflow: auto; border: 1px solid var(--border-strong); border-radius: 10px; margin-bottom: 16px; }
.picker label { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.picker label:last-child { border-bottom: 0; }
.picker label:hover { background: var(--surface-2); }
.picker input { accent-color: var(--accent); width: 16px; height: 16px; }
.picker .picker-all { background: var(--surface-2); position: sticky; top: 0; z-index: 1; grid-template-columns: 20px 1fr; }
.results { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.result { display: grid; grid-template-columns: 18px auto minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 13px; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); }
.result.ok > span:first-child { color: var(--good); font-weight: 800; }
.result.bad > span:first-child { color: var(--crit); font-weight: 800; }
.result ul { grid-column: 2 / -1; margin: 2px 0 0; padding-left: 16px; color: var(--text-2); font-size: 12px; }
.job-head { display: flex; gap: 10px; align-items: center; margin: 12px 0 8px; font-size: 13px; }
.jobs-list > div + div { margin-top: 16px; }
.modal.wide { max-width: 760px; }
.key-type { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.fp { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); overflow-wrap: anywhere; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.updates-list { max-height: 240px; overflow: auto; font-family: var(--mono); font-size: 12px; margin: 0; padding: 0 20px 14px; list-style: none; columns: 2; column-gap: 24px; }
.updates-list li { padding: 2px 0; break-inside: avoid; color: var(--text-2); }
.updates-list li.sec { color: var(--crit); }
.vultr-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.power { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.power .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.power.running .dot { background: var(--good); }
.power.stopped .dot { background: var(--crit); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .charts, .two-col, .form-grid, .sizing { grid-template-columns: 1fr; }
  .vultr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .updates-list { columns: 1; }
  .cap-grid { grid-template-columns: 1fr; }
  .cap-cell { border-right: 0; border-bottom: 1px solid var(--border); }
  .nav-links { overflow-x: auto; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .nav { padding: 0 16px; gap: 12px; }
  .nav .brand span { display: none; }
  .page { padding: 20px 16px 48px; }
  .grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 22px; }
  .modal { padding: 20px; }
  .toasts { left: 16px; right: 16px; }
}
