:root {
  --bg: #0b1220;
  --bg-2: #10192b;
  --surface: #162033;
  --surface-2: #1b2740;
  --line: #2a3b5c;
  --text: #e8eef7;
  --muted: #8b9bb4;
  --accent: #4aa3f0;
  --accent-2: #2d7fd4;
  --ok: #3ecf8e;
  --warn: #e6b84d;
  --bad: #e85d5d;
  --shadow: 0 18px 40px rgba(0, 0, 0, .35);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
code { font-family: ui-monospace, Consolas, monospace; font-size: .92em; color: #c9e4ff; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 500px at 20% -10%, #1b3a66 0%, transparent 55%), var(--bg);
}
.login-card, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.login-card { width: min(420px, 100%); }
.eyebrow { letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-size: 11px; margin: 0 0 8px; }
h1, h2, h3 { margin: 0 0 8px; font-weight: 650; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
.lede, .hint, .fine { color: var(--muted); line-height: 1.5; }
.fine { font-size: 12px; margin-top: 18px; }
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, textarea, select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}
textarea { resize: vertical; }
.btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font: inherit;
}
.btn.primary { background: var(--accent-2); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { background: #4a1f27; border-color: #7a303c; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .4; cursor: default; filter: none; }
.banner.error, .flash.error { background: #3a1820; border: 1px solid #7a303c; color: #ffd4d8; padding: 10px 12px; border-radius: 10px; }
.flash.ok { background: #143326; border: 1px solid #2e7a55; color: #d4ffe8; padding: 10px 12px; border-radius: 10px; margin-bottom: 16px; }
.flash { margin-bottom: 16px; }

.app.wizard {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 20px 96px;
}
.wiz-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.wiz-head .brand { margin-right: auto; }
.wiz-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  background: linear-gradient(transparent, var(--bg) 30%);
}
.stepper {
  list-style: none;
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 0 0 20px;
  flex-wrap: wrap;
}
.stepper li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.stepper li span {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); font-size: 12px;
}
.stepper li.is-active { border-color: var(--accent); color: var(--text); }
.stepper li.is-active span { background: var(--accent-2); }
.stepper li.is-done { color: var(--ok); }
.stepper li.is-done span { background: #1e4d38; }
hr.split { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.brand { display: flex; gap: 10px; align-items: center; }
.mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-2); font-weight: 700;
}
.brand small { display: block; color: var(--muted); }
.nav-btn {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--muted);
  padding: 9px 10px; border-radius: 8px; cursor: pointer; font: inherit;
}
.nav-btn.is-active, .nav-btn:hover { background: var(--surface); color: var(--text); }
.logout { margin-top: auto; }
.top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
main { padding: 28px 32px 48px; }
.status-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.panel { display: none; }
.panel.is-active { display: block; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.checks, .hashes, .posts, .steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li, .hashes li, .posts li {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.meta { display: grid; gap: 8px; }
.meta div { display: grid; gap: 2px; }
.meta dt { color: var(--muted); font-size: 12px; }
.steps { padding-left: 18px; list-style: decimal; color: var(--muted); }
.steps li { margin: 8px 0; }
.secret {
  background: #071018;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  color: #d7ecff;
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 18px; }
.table td, .table th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.space-row { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.space-head { display: flex; gap: 8px; align-items: flex-end; }
.space-head label { flex: 1; }
.space-remove { margin-bottom: 2px; }
.cmd-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chk { display: flex; flex-direction: row; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.chk input { width: auto; }
.hash { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); }
.playbook { margin: 0 0 16px; padding-left: 22px; color: var(--muted); line-height: 1.55; }
.playbook li { margin: 10px 0; }
.playbook strong { color: var(--text); }
.callout {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.5;
}
.callout.warn { background: #2a2214; border-color: #7a6230; color: #f3e2b0; }
.callout.warn strong { color: var(--warn); }
.linkish {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.plain { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; color: var(--muted); }
.plain li { display: flex; gap: 8px; align-items: flex-start; }
.checks li.jump { cursor: pointer; }
.checks li.jump:hover { border-color: var(--accent); }

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  align-items: center;
}
.admin-nav .nav-btn { width: auto; padding: 8px 12px; }
.app.is-admin .stepper,
.app.is-admin .wiz-foot { display: none; }
.app.is-admin #admin-shell { display: block; }
#admin-shell { display: none; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}
.stat-grid div {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.stat-grid small { display: block; color: var(--muted); font-size: 12px; }
#activity-table { font-size: 13px; }
#activity-table td:first-child { white-space: nowrap; color: var(--muted); }

@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stepper li { font-size: 12px; }
}
