:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6573;
  --border: #e2e5ea;
  --accent: #3b5bdb;
  --accent-text: #ffffff;
  --ok: #2f9e44;
  --warn: #e8890c;
  --crit: #e03131;
  --bar-bg: #e9ecf1;
  --notice-bg: #e7f0ff;
  --error-bg: #ffe9e9;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #171a21;
    --text: #e6e8ec;
    --muted: #98a0ae;
    --border: #262b35;
    --accent: #6c8cff;
    --accent-text: #0f1115;
    --ok: #51cf66;
    --warn: #fcc419;
    --crit: #ff6b6b;
    --bar-bg: #262b35;
    --notice-bg: #1b2440;
    --error-bg: #3a1d1f;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 1.25rem 0 .5rem; }
code { font-family: var(--mono); }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.topbar nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

main { padding: 1.5rem 1rem 3rem; margin: 0 auto; }
main.page { max-width: 1100px; }
main.wide { max-width: 1280px; }
main.narrow { max-width: 420px; padding-top: 3rem; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1rem; min-width: 0;
}
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-bottom: 1rem; }
.grid > .card { margin-bottom: 0; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.center { text-align: center; }
.right { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.wrap { overflow-wrap: anywhere; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--muted); margin: 0 0 .25rem; }
.hero { margin: .5rem 0 1.5rem; }
.hero h1 { font-size: 2rem; }
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.host { margin: 0 0 .75rem; }

.stack { display: grid; gap: .9rem; }
label { display: grid; gap: .3rem; font-weight: 500; font-size: .9rem; }
input {
  font: inherit; color: var(--text); background: var(--bg); width: 100%;
  border: 1px solid var(--border); border-radius: 8px; padding: .6rem .7rem;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input.code { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .3em; text-align: center; }

.button, button {
  font: inherit; cursor: pointer; display: inline-block; text-decoration: none; text-align: center;
  border-radius: 8px; padding: .55rem 1rem; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 600;
}
.button.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.danger, button.danger { color: var(--crit); }
button.link { border: 0; background: none; padding: 0; color: var(--muted); font-weight: 400; }
button.link.danger { color: var(--crit); }
form.inline { display: inline; }

.notice, .error { border-radius: 8px; padding: .6rem .8rem; margin: 0 0 1rem; }
.notice { background: var(--notice-bg); }
.error { background: var(--error-bg); color: var(--crit); }

.pill {
  display: inline-block; font-size: .75rem; font-weight: 600; border-radius: 999px;
  padding: .05rem .5rem; border: 1px solid currentColor; vertical-align: middle;
}
.ok { color: var(--ok); } .warn { color: var(--warn); } .crit { color: var(--crit); }
.muted.dot, .dot.muted { color: var(--muted); }

.link-card { display: block; color: inherit; text-decoration: none; }
.link-card:hover { border-color: var(--accent); }
.tile .button { margin-top: .5rem; }
.kpis { display: flex; gap: 2rem; margin: .5rem 0; }
.kpis > div { display: grid; }
.kpi { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi.small-kpi { font-size: 1rem; text-align: right; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.steps { padding-left: 1.2rem; color: var(--muted); }
.qr { display: flex; justify-content: center; margin: 1rem 0 .5rem; }
.qr svg { width: 220px; height: 220px; border-radius: 8px; }
.secret { font-size: .95rem; letter-spacing: .05em; user-select: all; overflow-wrap: anywhere; }

.metric-head { display: flex; justify-content: space-between; align-items: baseline; }
.metric p { margin: .35rem 0 0; }
.bar { display: block; width: 100%; height: 8px; margin: .4rem 0; }
.bar-bg { fill: var(--bar-bg); }
.bar-fg.ok { fill: var(--ok); } .bar-fg.warn { fill: var(--warn); } .bar-fg.crit { fill: var(--crit); }
.spark { display: block; width: 100%; height: 48px; margin-top: .5rem; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.spark-area { fill: var(--accent); opacity: .12; }

.cores summary { cursor: pointer; font-weight: 600; }
.core-grid { display: grid; gap: .4rem 1rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-top: .75rem; }
.core { display: grid; grid-template-columns: 2.5rem 1fr 2.5rem; align-items: center; gap: .4rem; }
.core .bar { margin: 0; }

.fs { margin-bottom: .9rem; }
.fs p { margin: 0; }
.fs-head { display: flex; justify-content: space-between; }
.raid { margin-bottom: .6rem; }
.raid p { margin: .1rem 0 0; }

.services { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.services li { display: flex; gap: .6rem; align-items: flex-start; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; margin-top: .45rem; flex: none; }

.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented button { border: 0; border-radius: 0; padding: .3rem .8rem; font-weight: 500; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

.table-wrap { overflow-x: auto; margin: 0 -.25rem; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.cmd { font-family: var(--mono); font-size: .8rem; max-width: 28rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  main.narrow { padding-top: 1.5rem; }
  .topbar { flex-wrap: wrap; }
  .opt { display: none; }
}
