:root {
  --bg: #f5f6f8; --surface: #fff; --text: #1a1d23; --muted: #626a77; --line: #e2e5ea;
  --accent: #0b5cad; --accent-ink: #fff; --ok: #1d7a46; --ok-bg: #e5f4eb; --warn: #8a5a00; --warn-bg: #fff4dc;
  --err: #b42318; --err-bg: #fdecea; --code-bg: #eef1f5; --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --surface: #171b21; --text: #e6e9ee; --muted: #9aa3b0; --line: #2a3039;
    --accent: #4b9be8; --accent-ink: #08111c; --ok: #5cc98a; --ok-bg: #12301f; --warn: #f0b84a; --warn-bg: #33270e;
    --err: #f2786d; --err-bg: #3a1714; --code-bg: #222831;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: .95rem; margin: 1.25rem 0 .5rem; color: var(--muted); }
code { background: var(--code-bg); padding: .1em .4em; border-radius: 5px; font-size: .9em; word-break: break-all; }
.mono, code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

.top { display: flex; align-items: center; gap: 2rem; padding: .75rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.top nav { display: flex; gap: 1.25rem; flex: 1; }
.top nav a { color: var(--text); font-weight: 500; }
.who { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .9rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); }
.brand.big { font-size: 1.2rem; margin-bottom: 1.25rem; }
.logo { display: inline-grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font-weight: 800; }

.page { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.narrow { width: 100%; max-width: 380px; }
.narrow-left { max-width: 520px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.crumbs { color: var(--muted); margin: 0 0 .5rem; font-size: .9rem; }
.slug { font-size: .8rem; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: .85rem; font-weight: 400; }
.empty { text-align: center; padding: 2.5rem; }

.stack { display: grid; gap: 1rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; align-items: end; margin-top: 1rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.tight { gap: .35rem; flex-wrap: nowrap; }
label { display: grid; gap: .35rem; font-weight: 500; font-size: .9rem; }
small { color: var(--muted); font-weight: 400; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: .5rem .65rem; width: 100%; }
.row input, .row select { width: auto; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

button, .button { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 7px; padding: .5rem 1rem; cursor: pointer; display: inline-block; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover, .button.primary:hover { filter: brightness(1.08); text-decoration: none; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; font-weight: 500; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.25rem; }
.card table { border: 0; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.compact td { padding: .45rem .8rem; font-size: .92rem; }
.num { text-align: right; }
.actions { text-align: right; white-space: nowrap; }

.badge { display: inline-block; padding: .1em .55em; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--code-bg); color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }

.alert { border-radius: var(--radius); padding: .85rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.error { background: var(--err-bg); color: var(--err); }
.secret { display: block; margin: .5rem 0; padding: .5rem .75rem; user-select: all; color: var(--text); }
.secret.big { font-size: 1.1rem; }
.qr { display: block; margin: 1rem auto; background: #fff; padding: 8px; border-radius: 8px; }

.steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; counter-reset: step; flex-wrap: wrap; }
.steps li { counter-increment: step; flex: 1; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; }
.steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; border-radius: 50%; background: var(--code-bg); margin-right: .5rem; font-weight: 700; font-size: .85rem; }
.steps li.done::before { content: "✓"; background: var(--ok-bg); color: var(--ok); }
.steps a { color: var(--text); font-weight: 500; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0 0 .5rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--accent); margin: .75rem 0 .25rem; }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: .75rem; padding: .75rem 1rem; }
  .page { padding: 1rem; }
  dl.kv { grid-template-columns: 1fr; }
  dl.kv dd { margin-bottom: .5rem; }
  table { display: block; overflow-x: auto; }
}

pre.script { background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; max-height: 420px; overflow: auto; font: 12.5px/1.45 ui-monospace, "Cascadia Code", Consolas, monospace; white-space: pre; user-select: all; }
ol.howto { padding-left: 1.25rem; margin: 0 0 1rem; }
ol.howto li { margin-bottom: .3rem; }
label.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
label.check input { width: auto; margin-top: .25rem; }
.actions form { display: inline; margin-left: .75rem; }
.row.spaced { margin-bottom: .5rem; }
.nas { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: .75rem; }
.nas-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.nas-head .badge { margin-left: .35rem; }
form.inline { display: inline; }
fieldset.vpn { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; margin: .75rem 0; display: grid; gap: .75rem; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem; }
label.field { margin: .75rem 0 0; max-width: 420px; }
.activation { width: 100%; max-width: 520px; }
ol.progress { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; counter-reset: s; }
ol.progress li { flex: 1; counter-increment: s; font-size: .85rem; color: var(--muted); border-top: 3px solid var(--line); padding-top: .4rem; }
ol.progress li::before { content: counter(s) ". "; }
ol.progress li.current { color: var(--text); font-weight: 600; border-color: var(--accent); }
ol.progress li.done { color: var(--ok); border-color: var(--ok); }
.invite-link { display: flex; gap: .5rem; align-items: center; }
.invite-link code { flex: 1; }
button.link.danger { color: var(--err); }
.spaced-top { margin-top: 1rem; }
