:root {
  color-scheme: dark;
  --bg: #07060c;
  --bg-2: #0c0b12;
  --panel: rgba(255, 255, 255, .03);
  --line: rgba(255, 255, 255, .08);
  --text: #f3f0e8;
  --muted: #a8a2b8;
  --cream: #f3f0e8;
  --ink: #0c0b10;
  --em: #34d399;
  --warn: #fbbf24;
  --danger: #fb7185;
  --get: #38bdf8;
  --post: #34d399;
  --side: 272px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
::selection { background: rgba(243, 240, 232, .22); }
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 20px;
  background: rgba(7, 6, 12, .88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; letter-spacing: -.045em;
}
.logo svg { border-radius: 8px; border: 1px solid rgba(243,240,232,.08); }
.search {
  flex: 1; max-width: 420px; position: relative;
}
.search input {
  width: 100%; height: 38px; padding: 0 12px 0 36px;
  background: #0c0b14; border: 1px solid var(--line); border-radius: 10px;
  outline: 0;
}
.search input:focus { border-color: rgba(243,240,232,.28); }
.search svg {
  position: absolute; left: 11px; top: 10px; opacity: .5;
}
.top-links { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ghost, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 12px; border-radius: 10px; font-weight: 700; font-size: 13px;
}
.ghost { border: 1px solid rgba(243,240,232,.28); color: var(--cream); }
.ghost:hover { background: rgba(243,240,232,.06); }
.btn { background: var(--cream); color: var(--ink); border: 0; }
.btn:hover { background: #fff; }
.burger {
  display: none; width: 40px; height: 36px; border: 1px solid var(--line);
  background: transparent; border-radius: 10px; cursor: pointer;
}
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: calc(100vh - 60px); }
.side {
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow: auto;
  padding: 18px 14px 40px;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
}
.side a {
  display: block; padding: 7px 10px; border-radius: 8px;
  color: var(--muted); font-size: 13px; font-weight: 500;
}
.side a:hover { color: var(--text); background: rgba(255,255,255,.03); }
.side a.on { color: var(--cream); background: rgba(243,240,232,.08); }
.side .grp {
  margin: 16px 10px 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: #6f6a7c;
}
.main { min-width: 0; }
.page { width: min(860px, 100%); margin: 0 auto; padding: 36px 28px 96px; }
h1 { margin: 0 0 10px; font-size: 34px; letter-spacing: -.04em; }
.lead { color: var(--muted); font-size: 16px; line-height: 1.55; margin: 0 0 22px; }
h2 {
  margin: 48px 0 12px; padding-top: 12px;
  font-size: 22px; letter-spacing: -.03em;
  scroll-margin-top: 80px;
}
h3 { margin: 28px 0 10px; font-size: 16px; scroll-margin-top: 80px; }
p, li { color: var(--muted); line-height: 1.6; font-size: 15px; }
p { margin: 0 0 12px; }
ul { margin: 0 0 16px; padding-left: 18px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
p code, li code, td code {
  font-size: 13px; padding: 1px 6px; border-radius: 6px;
  background: rgba(243,240,232,.07); color: var(--cream);
}
.hero-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted); font-weight: 600;
}
.chip b { color: var(--cream); font-weight: 700; }
.endpoint {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px 0 16px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.verb {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px;
  border-radius: 7px; font-size: 11px; font-weight: 800; letter-spacing: .04em;
}
.verb.get { background: rgba(56,189,248,.14); color: var(--get); }
.verb.post { background: rgba(52,211,153,.14); color: var(--post); }
.path { font-size: 13px; color: var(--cream); word-break: break-all; }
.note, .warn, .ok {
  padding: 12px 14px; border-radius: 12px; margin: 14px 0 18px;
  font-size: 14px; line-height: 1.5;
}
.note { background: rgba(56,189,248,.08); color: #cfe9fb; }
.warn { background: rgba(251,191,36,.1); color: #fde68a; }
.ok { background: rgba(52,211,153,.1); color: #a7f3d0; }
.table-wrap { overflow-x: auto; margin: 10px 0 20px; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: #8b8598; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; background: rgba(255,255,255,.02); }
td { color: var(--muted); }
td:first-child { color: var(--cream); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.tabs { display: flex; gap: 6px; margin: 12px 0 0; }
.tabs button {
  height: 32px; padding: 0 10px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 650; font-size: 12px;
}
.tabs button.on { background: var(--cream); color: var(--ink); border-color: transparent; }
.code {
  position: relative; margin: 8px 0 20px;
  background: #0a0910; border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden;
}
.code pre {
  margin: 0; padding: 16px 16px 18px; overflow: auto;
  font-size: 12.5px; line-height: 1.55; color: #e8e4d8;
}
.copy {
  position: absolute; top: 8px; right: 8px;
  height: 28px; padding: 0 10px; border-radius: 8px; cursor: pointer;
  background: rgba(243,240,232,.08); border: 1px solid var(--line);
  color: var(--cream); font-size: 12px; font-weight: 650;
}
.copy.on { background: #059669; border-color: transparent; }
.flow {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; margin: 16px 0 22px;
}
.flow article {
  padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.flow b { display: block; font-size: 13px; margin-bottom: 4px; }
.flow span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.k { color: #7dd3fc; }
.s { color: #86efac; }
.n { color: #fde68a; }
.c { color: #6f6a7c; }
.scrim { display: none; }
@media (max-width: 980px) {
  .flow { grid-template-columns: 1fr 1fr; }
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; left: 0; top: 60px; z-index: 20; width: min(86vw, 320px);
    transform: translateX(-110%); transition: transform .18s ease;
  }
  .side.open { transform: none; }
  .scrim.show {
    display: block; position: fixed; inset: 60px 0 0; z-index: 15;
    background: rgba(0,0,0,.5);
  }
  .burger { display: inline-flex; align-items: center; justify-content: center; }
  .search { max-width: none; }
  .top-links .ghost { display: none; }
  .page { padding: 24px 16px 80px; }
  h1 { font-size: 28px; }
}
@media (max-width: 560px) {
  .flow { grid-template-columns: 1fr; }
  .top-links .btn { display: none; }
}
