:root {
  --ink: #101820;
  --body: #3a4250;
  --muted: #667085;
  --faint: #8a93a0;
  --blue: #3457f1;
  --blue-hover: #2440c8;
  --blue-soft: #e9eeff;
  --blue-border: #d6defa;
  --page: #fdfdfb;
  --surface: #fff;
  --surface-soft: #f3f3ee;
  --border: #e7e7e2;
  --border-soft: #ededE8;
  --code: #0e1420;
  --code-border: #232b3a;
  --code-text: #c6cedd;
  --green: #1a7a3e;
  --green-soft: #e7f5ec;
  --red: #b4231f;
  --red-soft: #fdecec;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }
button, input { font: inherit; }
button { cursor: pointer; }
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
}
.skip-link:focus { transform: none; }

.docs-header {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(253, 253, 251, .94);
  backdrop-filter: blur(8px);
}
.docs-header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1440px;
  height: 60px;
  margin: 0 auto;
  padding: 0 24px;
}
.docs-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}
.docs-brand:hover { color: var(--ink); }
.docs-brand-context { margin-left: 2px; color: var(--muted); font-weight: 400; }
.logo-mark {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: var(--blue);
}
.logo-mark::after {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #fff;
  content: "";
  transform: rotate(45deg);
}
.docs-search {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: var(--surface-soft);
  color: var(--faint);
  font-size: 13.5px;
  text-align: left;
}
.search-box:hover, .search-box:focus { border-color: #c9cfdd; }
.search-shortcut {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font-size: 10.5px;
}
.header-actions { display: flex; align-items: center; gap: 18px; font-size: 13.5px; }
.header-actions > a:not(.header-button) { color: var(--body); }
.header-actions > a:not(.header-button):hover { color: var(--ink); }
.version-pill {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--body);
  font-size: 11.5px;
}
.header-button {
  padding: 7px 14px;
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  font-weight: 500;
}
.header-button:hover { background: var(--blue-hover); color: #fff; }
.mobile-nav-button {
  display: none;
  width: 36px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

.docs-shell { display: flex; align-items: flex-start; max-width: 1440px; margin: 0 auto; }
.docs-sidebar {
  position: sticky;
  top: 60px;
  flex: 0 0 260px;
  width: 260px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 32px 20px 48px 24px;
  border-right: 1px solid var(--border-soft);
  font-size: 13.5px;
}
.reference-sidebar { flex-basis: 280px; width: 280px; }
.nav-group { margin-bottom: 26px; }
.nav-label, .eyebrow, .section-label {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.nav-label { margin-bottom: 10px; }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-list a {
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--body);
}
.nav-list a:hover { background: var(--surface-soft); color: var(--ink); }
.nav-list a.active { background: var(--blue-soft); color: var(--blue); font-weight: 500; }
.endpoint-nav { gap: 3px; }
.endpoint-nav a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
.endpoint-nav .endpoint-short { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }

.docs-main {
  flex: 1;
  min-width: 0;
  max-width: 760px;
  padding: 44px clamp(24px, 4vw, 64px) 80px;
}
.reference-main { max-width: 920px; }
.eyebrow { margin-bottom: 14px; color: var(--blue); font-family: "JetBrains Mono", monospace; letter-spacing: .08em; }
h1 { margin: 0 0 16px; font-size: 38px; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; }
.reference-main h1 { margin-bottom: 12px; font-size: 36px; }
.lead { margin: 0 0 16px; color: var(--body); font-size: 16px; line-height: 1.7; text-wrap: pretty; }
.sandbox-note { margin: 0 0 32px; color: var(--faint); font-size: 13px; }
.doc-section { padding-top: 16px; border-top: 1px solid var(--border-soft); margin-top: 36px; }
.doc-section h2, .reference-section h2 { margin: 0 0 14px; font-size: 27px; font-weight: 600; letter-spacing: -.02em; }
.doc-section > p, .reference-section > p { margin: 0 0 18px; color: var(--body); font-size: 15.5px; line-height: 1.7; }

.quick-links, .guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 28px 0 44px; }
.quick-card, .guide-card, .concept-card, .pager-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  transition: border-color .16s ease, transform .16s ease;
}
.quick-card { padding: 18px; }
.quick-card:hover, .guide-card:hover, .pager-card:hover { border-color: var(--blue); color: var(--ink); transform: translateY(-1px); }
.card-title { margin-bottom: 5px; font-size: 14.5px; font-weight: 600; }
.card-copy { color: var(--muted); font-size: 13px; line-height: 1.5; }
.code-card { overflow: hidden; margin-bottom: 36px; border: 1px solid var(--code-border); border-radius: 12px; background: var(--code); }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid #1c2433; }
.code-tabs { display: flex; gap: 4px; }
.code-tab {
  padding: 4px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #8a93a6;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}
.code-tab.active { border-color: #2a3345; background: #1a2231; color: #e8ecf6; }
.copy-button {
  padding: 3px 12px;
  border: 1px solid #2a3345;
  border-radius: 6px;
  background: transparent;
  color: #8a93a6;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}
.copy-button:hover { border-color: #3b475e; color: #e8ecf6; }
pre { margin: 0; overflow-x: auto; }
.code-card pre, .dark-code {
  padding: 18px;
  color: var(--code-text);
  background: var(--code);
  font-size: 12.5px;
  line-height: 1.7;
}
.inline-code { padding: 1px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-soft); font-size: 13px; }
.auth-code { margin: 0 0 14px; border: 1px solid var(--code-border); border-radius: 12px; }
.callout { margin-bottom: 36px; padding: 14px 18px; border: 1px solid var(--blue-border); border-radius: 10px; background: var(--blue-soft); color: var(--body); font-size: 14px; line-height: 1.6; }
.callout strong { color: var(--blue); }
.data-table { overflow: hidden; margin-bottom: 36px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font-size: 14px; }
.table-row { display: grid; grid-template-columns: 120px 1fr 1.4fr; padding: 13px 18px; border-top: 1px solid var(--border-soft); gap: 0; }
.table-row:first-child { border: 0; background: var(--surface-soft); color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.table-row code { color: var(--blue); font-size: 12px; }
.steps { margin: 0 0 36px; padding-left: 22px; color: var(--body); font-size: 15.5px; line-height: 1.8; }
.concepts { display: flex; flex-direction: column; gap: 14px; margin-bottom: 36px; }
.concept-card { padding: 16px 20px; }
.concept-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.concept-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.guide-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 0 0 36px; }
.guide-card { padding: 16px 18px; }
.page-footer { display: flex; justify-content: flex-end; padding-top: 24px; border-top: 1px solid var(--border-soft); }
.pager-card { min-width: 200px; padding: 14px 18px; text-align: right; }
.pager-card small { display: block; margin-bottom: 3px; color: var(--faint); }
.pager-card strong { color: var(--blue); font-size: 14.5px; }
.docs-toc { position: sticky; top: 60px; flex: 0 0 210px; width: 210px; padding: 44px 24px 48px 8px; font-size: 13px; }
.toc-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-left: 14px; border-left: 1px solid var(--border-soft); }
.toc-list a { color: var(--muted); }
.toc-list a:hover, .toc-list a.active { color: var(--blue); }

.method-badge {
  display: inline-block;
  flex: 0 0 auto;
  min-width: 40px;
  padding: 2px 8px;
  border-radius: 5px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-align: center;
}
.method-get { background: var(--green-soft); color: var(--green); }
.method-post { background: var(--blue-soft); color: var(--blue); }
.method-delete { background: var(--red-soft); color: var(--red); }
.reference-section { padding: 36px 0 8px; border-top: 1px solid var(--border-soft); margin-bottom: 20px; }
.endpoint-heading { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.endpoint-heading code { font-size: 15px; font-weight: 500; }
.endpoint-purpose { max-width: 640px; margin: 0 0 6px; color: var(--body); font-size: 15px; line-height: 1.65; }
.auth-note { margin: 0 0 18px; color: var(--faint); font-size: 12.5px; }
.section-label { margin-bottom: 8px; font-size: 12px; }
.param-table { overflow: hidden; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.param-row { display: flex; align-items: baseline; gap: 14px; padding: 11px 16px; border-bottom: 1px solid #f0f0eb; flex-wrap: wrap; }
.param-row:last-child { border: 0; }
.param-name { min-width: 150px; font-size: 12.5px; font-weight: 600; }
.param-type { min-width: 60px; color: var(--faint); font-size: 11px; }
.requirement { min-width: 64px; padding: 1px 8px; border-radius: 99px; font-family: "JetBrains Mono", monospace; font-size: 10.5px; text-align: center; }
.required { background: var(--red-soft); color: var(--red); }
.optional { background: #f0f0eb; color: var(--faint); }
.param-description { flex: 1; min-width: 200px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.example-grid { display: flex; gap: 16px; flex-wrap: wrap; }
.example { flex: 1 1 320px; min-width: 280px; }
.example-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.example-header .section-label { margin: 0; }
.example-copy { padding: 2px 10px; border: 1px solid var(--border); border-radius: 5px; background: none; color: var(--faint); font-family: "JetBrains Mono", monospace; font-size: 10.5px; }
.example-copy:hover { border-color: #c9cfdd; color: var(--ink); }
.example pre { min-height: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); color: var(--body); font-size: 11.5px; line-height: 1.65; }
.example.request pre { border-color: var(--code-border); background: var(--code); color: var(--code-text); }
.endpoint-errors { margin-top: 12px; color: var(--faint); font-size: 12.5px; }
.error-table { overflow: hidden; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: 13.5px; }
.error-row { display: flex; align-items: baseline; gap: 16px; padding: 11px 16px; border-bottom: 1px solid #f0f0eb; flex-wrap: wrap; }
.error-row:last-child { border: 0; }
.error-status { min-width: 44px; font-size: 12.5px; font-weight: 600; }
.error-code { min-width: 200px; color: var(--blue); font-size: 12px; }
.error-description { flex: 1; min-width: 200px; color: var(--muted); }
.error-example { padding: 14px 16px; border: 1px solid var(--code-border); border-radius: 10px; background: var(--code); color: var(--code-text); font-size: 11.5px; line-height: 1.65; }

.search-panel {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  background: rgba(16, 24, 32, .28);
  backdrop-filter: blur(3px);
}
.search-panel.open { display: flex; }
.search-dialog { width: min(560px, calc(100% - 32px)); overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 20px 70px rgba(16, 24, 32, .16); }
.search-input { width: 100%; padding: 16px 18px; border: 0; border-bottom: 1px solid var(--border); outline: 0; font-size: 15px; }
.search-results { max-height: 340px; overflow-y: auto; padding: 8px; }
.search-result { display: block; padding: 10px 12px; border-radius: 7px; color: var(--body); font-size: 14px; }
.search-result:hover { background: var(--blue-soft); color: var(--blue); }
.search-empty { padding: 20px; color: var(--faint); font-size: 13px; text-align: center; }

@media (max-width: 1080px) {
  .docs-toc { display: none; }
  .docs-main { max-width: none; }
}
@media (max-width: 800px) {
  .docs-search { display: none; }
  .header-actions .version-pill, .header-actions > a:not(.header-button) { display: none; }
  .mobile-nav-button { display: inline-flex; align-items: center; justify-content: center; }
  .docs-sidebar {
    position: fixed;
    z-index: 45;
    top: 60px;
    bottom: 0;
    left: 0;
    max-height: none;
    transform: translateX(-105%);
    background: var(--page);
    box-shadow: 18px 0 40px rgba(16, 24, 32, .08);
    transition: transform .2s ease;
  }
  .docs-sidebar.open { transform: none; }
  .docs-main { width: 100%; padding: 36px 24px 64px; }
}
@media (max-width: 560px) {
  .docs-header-inner { gap: 10px; padding: 0 16px; }
  .docs-brand-context { display: none; }
  .header-actions { gap: 8px; margin-left: auto; }
  .header-button { padding: 7px 10px; }
  h1 { font-size: 34px; }
  .table-row { grid-template-columns: 1fr; gap: 6px; }
  .table-row:first-child { display: none; }
  .example { min-width: 100%; }
  .code-tabs { overflow-x: auto; }
  .code-tab { padding-inline: 9px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
