:root {
  --bg: #000;
  --bg-2: #0a0a0a;
  --surface: #0a0a0a;
  --surface-2: #111;
  --border: #242424;
  --border-strong: #333;
  --text: #ededed;
  --muted: #a1a1a1;
  --faint: #6b6b6b;
  --accent: #fff;
  --accent-text: #000;
  --link: #52a8ff;
  --green: #45d483;
  --amber: #f5a524;
  --red: #ff6166;
  --grad-a: #7928ca;
  --grad-b: #ff0080;
  --grad-c: #0070f3;
  --radius: 10px;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --bg-2: #fff;
    --surface: #fff;
    --surface-2: #f5f5f5;
    --border: #eaeaea;
    --border-strong: #d4d4d4;
    --text: #171717;
    --muted: #666;
    --faint: #8f8f8f;
    --accent: #171717;
    --accent-text: #fff;
    --link: #0068d6;
    --green: #1a9e55;
    --amber: #b86e00;
    --red: #d8333a;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 32px; font-weight: 700; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 600; margin: 0; }
h3 { font-size: 14px; font-weight: 600; margin: 22px 0 8px; }
p { margin: 10px 0; }
code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
pre {
  margin: 0;
  padding: 14px 16px;
  font: 12.5px/1.65 var(--mono);
  overflow-x: auto;
  white-space: pre;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.hint { color: var(--faint); font-size: 12.5px; }
.right { text-align: right; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.bar { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand .slash { color: var(--border-strong); font-weight: 300; font-size: 20px; }
.brand .scope { color: var(--muted); font-weight: 500; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a { color: var(--muted); padding: 6px 12px; border-radius: 6px; font-size: 13.5px; }
.tabs a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.tabs a.active { color: var(--text); background: var(--surface-2); }
.account { display: flex; align-items: center; gap: 10px; }
.account form { margin: 0; }
.who { color: var(--muted); font-size: 13px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--grad-c), var(--grad-a) 60%, var(--grad-b));
}

/* Buttons and inputs */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 6px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text);
  font: 500 13.5px var(--sans); cursor: pointer; white-space: nowrap;
  transition: opacity .15s, background .15s, border-color .15s;
}
.btn:hover, button:hover { opacity: .88; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--surface-2); opacity: 1; }
.btn.danger { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 12%, transparent); opacity: 1; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14.5px; }
input[type=text], input:not([type]), input[type=number] {
  height: 36px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text);
  font: 13.5px var(--sans); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 14%, transparent); }
input::placeholder { color: var(--faint); }
input[type=number] { width: 150px; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.actions form { margin: 0; }
.row-form { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.row-form input:not([type=hidden]):not([type=checkbox]):not([type=number]) { flex: 1; min-width: 220px; }
.row-form.tight { margin: 0; align-items: center; }

/* Page structure */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 40px 0 28px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.card, .callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.callout { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 8%, transparent); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid2 .card { margin: 0; }
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--border); gap: 1px; margin-bottom: 20px;
}
.stat { background: var(--surface); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat .label, .small-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.small-label { display: block; margin: 14px 0 6px; }
.stat .value { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.stat .value.small { font-size: 17px; padding: 6px 0 3px; }
.stat .value small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.center { display: grid; place-items: center; padding: 80px 0; }
.narrow { max-width: 520px; width: 100%; }
.narrow h1 { font-size: 24px; margin-top: 14px; }

/* Progress */
progress {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border: 0; border-radius: 999px;
  background: var(--surface-2); overflow: hidden; margin: 6px 0 2px;
}
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--grad-c), var(--grad-a)); border-radius: 999px; }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--grad-c), var(--grad-a)); border-radius: 999px; }
.meter { margin-top: 18px; }
.meter-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface-2);
}
.badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.badge.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); background: color-mix(in srgb, var(--green) 9%, transparent); }
.badge.ok i { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.badge.warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 35%, transparent); background: color-mix(in srgb, var(--amber) 9%, transparent); }
.badge.warn i { background: var(--amber); animation: pulse 1.4s ease-in-out infinite; }
.badge.err { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); background: color-mix(in srgb, var(--red) 9%, transparent); }
.badge.err i { background: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }
.tag { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--border-strong); color: var(--muted); vertical-align: 1px; }
.pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface);
}

/* Tables */
.table { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; 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:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; }
td progress { max-width: 180px; display: block; }
td code.key { background: none; border: 0; padding: 0; color: var(--muted); }
.empty { text-align: center; color: var(--faint); padding: 28px 0; }
.member { display: flex; align-items: center; gap: 10px; }

/* Code blocks */
.code { border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); overflow: hidden; margin: 12px 0; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font: 12px var(--mono);
}
.copy {
  height: 26px; padding: 0 10px; font-size: 12px; background: transparent; color: var(--muted);
  border: 1px solid var(--border-strong); border-radius: 5px;
}
.copy:hover { color: var(--text); background: var(--surface); opacity: 1; }
.copy.done { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.field {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg-2); padding: 4px 4px 4px 12px;
}
.field code { background: none; border: 0; padding: 0; overflow-x: auto; white-space: nowrap; }
#new-key { font-size: 14px; color: var(--text); white-space: pre-wrap; word-break: break-all; }

/* Landing */
.hero { position: relative; text-align: center; padding: 96px 0 64px; }
.hero::before {
  content: ""; position: absolute; inset: -40px 0 auto; height: 420px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 60% at 30% 30%, color-mix(in srgb, var(--grad-c) 30%, transparent), transparent 70%),
    radial-gradient(35% 55% at 70% 25%, color-mix(in srgb, var(--grad-b) 22%, transparent), transparent 70%),
    radial-gradient(30% 50% at 50% 60%, color-mix(in srgb, var(--grad-a) 25%, transparent), transparent 70%);
  filter: blur(30px);
}
.hero h1 { font-size: clamp(40px, 7vw, 68px); letter-spacing: -0.045em; line-height: 1.04; margin: 22px 0 18px; }
.gradient { background: linear-gradient(90deg, var(--grad-c), var(--grad-a), var(--grad-b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 17px; max-width: 620px; margin: 0 auto; }
.hero .actions { justify-content: center; margin-top: 30px; }
.features {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--border); gap: 1px; overflow: hidden;
}
.feature { background: var(--surface); padding: 24px; }
.feature h3 { margin: 0 0 6px; }
.feature p { color: var(--muted); margin: 0; }
.preview { max-width: 760px; margin: 48px auto 0; }

/* Docs */
.docs { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; }
.toc { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.toc-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.toc a { color: var(--muted); font-size: 13px; padding: 4px 0; }
.toc a:hover { color: var(--text); text-decoration: none; }
article section { padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--border); scroll-margin-top: 80px; }
article section:last-child { border-bottom: 0; }
article h2 { font-size: 22px; display: inline; }
.step {
  display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px; vertical-align: 3px;
  border-radius: 50%; border: 1px solid var(--border-strong); font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 16px; }
.note { border: 1px solid var(--border); border-left: 3px solid var(--link); border-radius: 6px; padding: 12px 16px; margin: 16px 0; background: var(--surface); }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.mini { border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; background: var(--surface); }
.mini h3 { margin: 0 0 4px; }
.mini p { color: var(--muted); margin: 0; }

.foot { width: 100%; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--faint); font-size: 12.5px; padding-top: 48px; padding-bottom: 40px; }
.foot a { color: var(--muted); margin-left: 16px; }

@media (max-width: 760px) {
  .bar { gap: 12px; }
  .who, .brand .slash, .brand .scope { display: none; }
  .docs { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 24px; }
  .toc-title { width: 100%; }
  .hero { padding-top: 64px; }
}
