:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1017;
  --paper: #141a24;
  --paper-2: #1a2230;
  --line: rgba(226, 232, 240, 0.09);
  --text: #e8edf5;
  --muted: #8b97ab;
  --cyan: #5eead4;
  --green: #4ade80;
  --amber: #fbbf24;
  --rose: #fb7185;
  --indigo: #a5b4fc;
  --code: #0a0e14;
  --shadow: none;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fb;
  --paper: #ffffff;
  --paper-2: #f1f4f9;
  --line: rgba(15, 23, 42, 0.08);
  --text: #111827;
  --muted: #5b6778;
  --cyan: #0f766e;
  --green: #15803d;
  --amber: #b45309;
  --rose: #be123c;
  --indigo: #4338ca;
  --code: #111827;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, -apple-system, Segoe UI, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--paper-2); border: 1px solid var(--line); color: var(--cyan);
}
.brand strong { display: block; font-size: 13px; letter-spacing: -0.02em; }
.brand small { display: block; color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.nav-link {
  color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px;
}
.nav-link:hover { color: var(--text); text-decoration: none; background: var(--paper-2); }
.layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 0;
  width: min(1240px, 100%);
  margin: 0 auto;
  min-height: calc(100vh - 53px);
}
.layout.hub { grid-template-columns: 248px minmax(0, 1fr); }
.side {
  position: sticky;
  top: 53px;
  align-self: start;
  height: calc(100vh - 53px);
  overflow: auto;
  padding: 20px 16px 48px;
  border-right: 1px solid var(--line);
}
.nav-group + .nav-group { margin-top: 18px; }
.side-label {
  margin: 0 0 8px;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav-item {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
}
.nav-item:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 5%, transparent);
  text-decoration: none;
}
.nav-item.is-on {
  color: var(--cyan);
  font-weight: 600;
  background: color-mix(in srgb, var(--cyan) 12%, transparent);
  border-color: color-mix(in srgb, var(--cyan) 22%, transparent);
}
.nav-item.is-on:hover {
  color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 16%, transparent);
  text-decoration: none;
}
.page-toc {
  margin-top: 22px;
  padding: 12px 10px 10px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.page-toc .side-label {
  margin: 0 0 8px;
  padding: 2px 8px 0;
}
.toc-list {
  display: flex;
  flex-direction: column;
}
.page-toc a {
  position: relative;
  display: block;
  margin: 0;
  padding: 6px 8px 6px 12px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  border-left: 2px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: transparent;
}
.page-toc a:hover {
  color: var(--text);
  text-decoration: none;
  background: transparent;
}
.page-toc a.active {
  color: var(--cyan);
  font-weight: 600;
  border-left-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 8%, transparent);
  border-radius: 0 8px 8px 0;
}
main {
  min-width: 0;
  padding: 36px 48px 96px;
  max-width: 860px;
}
.hero {
  margin-bottom: 36px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}
.kicker { margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); }
h1 { margin: 0; font-size: 34px; letter-spacing: -0.045em; line-height: 1.12; font-weight: 750; }
.lede { margin: 14px 0 0; color: var(--muted); font-size: 16px; max-width: 62ch; line-height: 1.65; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pill {
  display: inline-flex; align-items: center;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--paper-2); border: 1px solid var(--line); color: var(--text);
}
h2 { margin: 44px 0 12px; font-size: 20px; letter-spacing: -0.03em; padding-top: 8px; }
h3 { margin: 26px 0 8px; font-size: 15px; }
p, li { line-height: 1.65; color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.card {
  margin: 14px 0 22px;
  padding: 4px 0 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  overflow-x: auto;
}
.card table { min-width: 520px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 18px 0 8px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.tile, .product {
  padding: 16px 16px 14px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.product { display: block; color: inherit; text-decoration: none; }
.product:hover { text-decoration: none; border-color: color-mix(in srgb, var(--cyan) 45%, var(--line)); }
.product .tag { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); margin: 0 0 8px; }
.product b { display: block; font-size: 16px; letter-spacing: -0.03em; margin-bottom: 6px; }
.product span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.product .go { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 700; color: var(--cyan); }
.tile b { display: block; margin-bottom: 6px; font-size: 13px; }
.tile span { color: var(--muted); font-size: 12px; line-height: 1.5; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700; }
code, pre { font-family: "JetBrains Mono", ui-monospace, monospace; }
code { font-size: 12px; padding: 1px 5px; border-radius: 5px; background: var(--paper-2); }
.verb {
  display: inline-block;
  min-width: 48px;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 6px;
  border-radius: 5px;
}
.verb.post { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); }
.verb.put { background: color-mix(in srgb, var(--amber) 16%, transparent); color: var(--amber); }
.verb.get { background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green); }
.code {
  position: relative;
  margin: 12px 0 18px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--code);
  color: #e2e8f0;
  overflow: auto;
  font-size: 12px;
  line-height: 1.55;
  border: 1px solid var(--line);
}
[data-theme="light"] .code { color: #e2e8f0; background: #111827; }
.copy {
  position: absolute; top: 8px; right: 8px;
  border: 0; border-radius: 7px; padding: 5px 8px;
  background: rgba(255,255,255,0.08); color: #cbd5e1; font: inherit; font-size: 11px; cursor: pointer;
}
.arch {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0 22px;
}
.arch .tile { text-align: left; }
.pipeline {
  list-style: none;
  margin: 12px 0 22px;
  padding: 0;
  display: grid;
  gap: 0;
}
.pipeline li {
  position: relative;
  padding: 12px 14px 12px 52px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--paper);
  color: var(--text);
}
.pipeline li:first-child { border-radius: 12px 12px 0 0; }
.pipeline li:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.pipeline li::before {
  content: attr(data-n);
  position: absolute;
  left: 14px;
  top: 12px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 12%, transparent);
}
.pipeline .branch { color: var(--muted); font-size: 13px; }
.steps { display: grid; gap: 10px; margin: 12px 0 18px; }
.step {
  display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start;
  padding: 12px 14px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line);
}
.num {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); font-weight: 800;
}
.callout, .note {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  font-size: 13px;
  margin: 12px 0 18px;
  color: color-mix(in srgb, var(--text) 90%, var(--muted));
}
.callout strong, .note strong { color: var(--text); }
.callout.warn, .note {
  border-color: color-mix(in srgb, var(--amber) 35%, var(--line));
  background: color-mix(in srgb, var(--amber) 8%, transparent);
}
.callout.ok {
  border-color: color-mix(in srgb, var(--green) 35%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, transparent);
}
.status {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--paper-2);
}
.flow {
  margin: 8px 0 18px;
  padding: 8px;
  border-radius: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
}
.flow img { display: block; width: 100%; height: auto; }
@media (max-width: 960px) {
  .layout, .layout.hub { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .arch, .grid, .grid-3 { grid-template-columns: 1fr; }
  main { padding: 24px 20px 72px; }
  h1 { font-size: 28px; }
}
