:root {
  --indigo: #1b2a6b;
  --indigo-soft: #273b8f;
  --cyan: #22d3ee;
  --amber: #f59e0b;
  --red: #ef4444;
  --green: #10b981;
  --bg: #070b18;
  --surface: #0f1630;
  --surface-2: #151d3d;
  --text: #eef2ff;
  --muted: #a5b0d0;
  --border: #26305a;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  font-family: Inter, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fc;
    --surface: #ffffff;
    --surface-2: #eef1fa;
    --text: #101735;
    --muted: #4b5677;
    --border: #d8deee;
    --shadow: 0 20px 50px rgba(27, 42, 107, 0.12);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(700px 400px at 0% 0%, rgba(27, 42, 107, 0.5), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 6px; font-size: 0.92em; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); font-weight: 700; letter-spacing: -0.02em; font-size: 1.1rem; }
.brand svg { color: var(--cyan); }
nav { display: flex; gap: clamp(0.75rem, 2vw, 1.5rem); flex-wrap: wrap; }
nav a { color: var(--muted); font-size: 0.92rem; }
nav a:hover { color: var(--text); }

main { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }

.hero { padding: clamp(3rem, 8vw, 6rem) 0 3rem; max-width: 820px; }
.eyebrow { color: var(--cyan); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 6vw, 4.1rem); line-height: 1.05; letter-spacing: -0.035em; margin: 0.6rem 0 1.2rem; }
h1 span { color: var(--cyan); }
.lede { color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); max-width: 660px; }

.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin: 2rem 0 1.6rem; }
.button { display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.2rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text); font-weight: 600; }
.button:hover { text-decoration: none; border-color: var(--cyan); }
.button.primary { background: var(--cyan); color: #041018; border-color: transparent; }

.status-card { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.9rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 0.9rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--green); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15); }
.dot.down { background: var(--red); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); }
.dot.pending { background: var(--amber); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; padding: 2rem 0 3rem; }
.grid h2 { grid-column: 1 / -1; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.legal { padding: 2rem 0 4rem; border-top: 1px solid var(--border); }
.legal h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }
.legal p { color: var(--muted); max-width: 820px; }

.site-footer { border-top: 1px solid var(--border); padding: 2rem clamp(1rem, 4vw, 3rem); color: var(--muted); font-size: 0.9rem; }
.site-footer p { margin: 0.2rem 0; }
.muted { color: var(--muted); }

/* Admin */
.admin-wrap { padding: 2rem 0 4rem; }
.admin-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1.5rem; }
.admin-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.9rem; margin-bottom: 1.5rem; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.metric .label { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.metric .value { font-size: 1.8rem; font-weight: 700; margin-top: 0.2rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.2rem; overflow: auto; }
.panel h2 { margin: 0 0 0.8rem; font-size: 1.15rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
tr:hover td { background: var(--surface-2); }
.pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.pill.PROTECTED { background: rgba(16, 185, 129, 0.15); color: var(--green); }
.pill.SUSPECT { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.pill.COMPROMISED { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.8rem; }
input, select, textarea { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 0.55rem 0.7rem; font: inherit; min-height: 44px; }
textarea { width: 100%; min-height: 300px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }
button { min-height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; padding: 0 1rem; cursor: pointer; }
button.primary { background: var(--cyan); color: #041018; border-color: transparent; }
button.danger { color: var(--red); border-color: rgba(239, 68, 68, 0.4); }
.notice { padding: 0.7rem 0.9rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 0.9rem; }
.notice.error { border-color: rgba(239, 68, 68, 0.5); color: var(--red); }
.hidden { display: none !important; }
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: 900px; width: calc(100% - 2rem); padding: 1.2rem; }
dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); padding: 1rem; border-radius: 10px; font-size: 0.8rem; max-height: 60vh; overflow: auto; }
@media (max-width: 640px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  th, td { padding: 0.45rem; }
}
