.docs-page { background: var(--white); }
.docs-page .site-header { position: sticky; top: 0; }

.docs-bar { min-height: 58px; position: sticky; top: 72px; z-index: 20; padding: 0 max(24px, calc((100vw - 1440px) / 2)); display: grid; grid-template-columns: 1fr minmax(280px, 440px) 1fr; align-items: center; gap: 24px; background: rgba(251,250,246,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.docs-bar-title { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .025em; color: var(--muted); }
.docs-bar-title strong { color: var(--ink); font-family: var(--font-display); font-size: 14px; letter-spacing: -.02em; }
.docs-square { width: 9px; height: 9px; background: var(--signal); box-shadow: 0 0 0 5px rgba(101,244,207,.15); }
.docs-search-trigger { height: 36px; padding: 0 10px; display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 10px; text-align: left; color: var(--muted); background: var(--paper); border: 1px solid var(--line); cursor: pointer; }
.docs-search-trigger:hover { border-color: rgba(11,13,15,.4); }
.docs-search-trigger kbd, .docs-search-input kbd { padding: 3px 6px; color: var(--muted); background: var(--white); border: 1px solid var(--line); font-size: 9px; }
.search-glyph { width: 13px; height: 13px; position: relative; display: block; border: 1.5px solid currentColor; border-radius: 50%; }
.search-glyph::after { content: ""; width: 5px; height: 1.5px; position: absolute; right: -4px; bottom: -2px; background: currentColor; transform: rotate(45deg); }
.docs-reference-link { justify-self: end; display: inline-flex; gap: 18px; font-size: 12px; font-weight: 650; }

.docs-search-panel { width: min(620px, calc(100vw - 32px)); max-height: min(560px, calc(100svh - 120px)); position: fixed; top: 102px; left: 50%; z-index: 100; transform: translateX(-50%); padding: 20px; overflow: auto; background: var(--white); border: 1px solid var(--ink); box-shadow: 0 30px 90px rgba(11,13,15,.25); }
.docs-search-panel::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.docs-search-panel > label { display: block; margin-bottom: 10px; font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.docs-search-input { min-height: 48px; padding: 0 14px; display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--ink); }
.docs-search-input input { width: 100%; border: 0; outline: 0; background: transparent; font: 15px var(--font-sans); }
.docs-search-results { margin-top: 12px; }
.docs-search-results a { padding: 13px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 14px; }
.docs-search-results a:hover { background: var(--paper); }
.docs-search-results a span { color: var(--muted); font-family: var(--font-mono); font-size: 9px; }
.docs-search-empty { padding: 24px 12px; margin: 0; color: var(--muted); }

.docs-index-button { display: none; }
.docs-layout { width: min(100%, 1440px); margin: 0 auto; display: grid; grid-template-columns: 230px minmax(0, 860px) 220px; justify-content: center; align-items: start; }
.docs-sidebar { height: calc(100svh - 130px); position: sticky; top: 130px; padding: 42px 28px 70px 24px; overflow-y: auto; border-right: 1px solid var(--line); scrollbar-width: thin; }
.docs-nav-group { margin-bottom: 34px; }
.docs-nav-group p, .docs-toc > p { margin: 0 0 12px; font-family: var(--font-mono); font-size: 9px; line-height: 1; letter-spacing: .09em; color: #969891; text-transform: uppercase; }
.docs-nav-group a { min-height: 31px; padding: 5px 9px 5px 12px; display: flex; align-items: center; justify-content: space-between; position: relative; color: #5e615c; font-size: 12px; }
.docs-nav-group a:hover { color: var(--ink); background: var(--paper); }
.docs-nav-group a.active { color: var(--ink); font-weight: 650; background: rgba(118,103,255,.07); }
.docs-nav-group a.active::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 2px; background: #7667ff; }
.docs-nav-group a span { font-family: var(--font-mono); font-size: 8px; color: #999c96; }

.docs-article { min-width: 0; }
.docs-hero { padding: 72px clamp(36px, 5vw, 76px) 54px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent 49px, rgba(11,13,15,.035) 50px, transparent 51px), linear-gradient(transparent 49px, rgba(11,13,15,.035) 50px, transparent 51px); background-size: 50px 50px; }
.docs-kicker { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.docs-kicker span:first-child { color: #7667ff; }
.docs-hero h1 { margin: 35px 0 18px; font-size: clamp(64px, 7vw, 104px); line-height: .9; letter-spacing: -.065em; font-weight: 620; }
.docs-lede { max-width: 660px; margin: 0; color: #5c5f59; font-size: clamp(19px, 2vw, 25px); line-height: 1.45; letter-spacing: -.025em; }
.docs-meta-grid { margin-top: 46px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink); border-left: 1px solid var(--line); }
.docs-meta-grid > div { min-height: 92px; padding: 16px; display: grid; grid-template-columns: 1fr auto; align-content: space-between; gap: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(251,250,246,.74); }
.docs-meta-grid span { grid-column: 1 / -1; color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.docs-meta-grid code, .docs-meta-grid strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.docs-meta-grid strong { font-family: var(--font-mono); font-weight: 500; }
.docs-meta-grid button { padding: 0; color: #7667ff; border: 0; background: transparent; font-family: var(--font-mono); font-size: 9px; cursor: pointer; text-transform: uppercase; }
.docs-meta-grid i { align-self: end; color: var(--muted); font-family: var(--font-mono); font-size: 8px; font-style: normal; }
.docs-meta-grid .live-chip { color: #11725d; }

.docs-section { scroll-margin-top: 148px; padding: 62px clamp(36px, 5vw, 76px); display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 20px; border-bottom: 1px solid var(--line); }
.section-content { min-width: 0; }
.section-number { padding-top: 4px; color: #aaa9a3; font-family: var(--font-mono); font-size: 10px; }
.docs-page .section-heading { display: block; padding: 0; }
.docs-page .section-heading > span { display: block; margin-bottom: 14px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .09em; color: #7667ff; }
.docs-page .section-heading h2 { max-width: 680px; margin: 0; font-size: clamp(30px, 3.1vw, 42px); line-height: 1.06; letter-spacing: -.045em; font-weight: 610; text-wrap: balance; }
.docs-page .section-heading p { max-width: 590px; margin: 14px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; text-wrap: pretty; }
.code-card { margin-top: 30px; color: #dfe1dc; background: #0d1012; border: 1px solid #2f3435; box-shadow: 12px 12px 0 rgba(92,115,255,.06); }
.code-card, .code-card pre { min-width: 0; max-width: 100%; }
.code-toolbar { min-height: 42px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; color: #8d928d; border-bottom: 1px solid #2a2e2f; font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.code-toolbar button { min-width: 48px; padding: 6px 8px; color: var(--signal); background: transparent; border: 1px solid rgba(101,244,207,.22); font: inherit; cursor: pointer; }
.code-toolbar button:hover { background: rgba(101,244,207,.08); }
.code-card pre { margin: 0; padding: 24px; overflow: auto; font-size: 12px; line-height: 1.8; tab-size: 2; }
.code-card code { color: #dfe1dc; }
.code-command, .code-key { color: #7e8fff; }
.code-string { color: #74e9ca; }
.docs-callout { margin-top: 22px; padding: 18px 20px; display: grid; grid-template-columns: 110px 1fr; gap: 20px; background: rgba(101,244,207,.11); border-left: 3px solid var(--signal); }
.docs-callout span { color: #17745f; font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; }
.docs-callout p { margin: 0; font-size: 13px; line-height: 1.55; }
.endpoint-note { min-height: 54px; margin-top: 18px; padding: 0 15px; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 14px; border: 1px solid var(--line); font-size: 12px; }
.endpoint-note .method { padding: 5px 7px; color: #115e4d; background: rgba(101,244,207,.18); font-family: var(--font-mono); font-size: 9px; }
.endpoint-note > span:last-child { justify-self: end; color: var(--muted); }
.language-tabs { margin-top: 30px; display: flex; gap: 0; border-bottom: 1px solid var(--ink); }
.language-tabs button { padding: 10px 17px; position: relative; color: var(--muted); background: transparent; border: 0; font-family: var(--font-mono); font-size: 10px; cursor: pointer; }
.language-tabs button.active { color: var(--ink); }
.language-tabs button.active::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; background: #7667ff; }
.code-example { margin-top: 14px; }
.response-card .code-toolbar { color: var(--signal); }

.error-table { margin-top: 30px; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--ink); border-left: 1px solid var(--line); }
.error-table > div { min-height: 130px; padding: 18px; display: grid; grid-template-columns: 46px 1fr; align-content: start; gap: 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.error-table code { grid-row: 1 / 3; color: #7667ff; font-size: 18px; }
.error-table strong { font-size: 14px; }
.error-table p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.next-grid { margin-top: 30px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.next-grid a { min-height: 190px; padding: 18px; display: flex; flex-direction: column; position: relative; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .2s, color .2s; }
.next-grid a:first-child { border-left: 1px solid var(--line); }
.next-grid a:hover { background: var(--ink); color: var(--white); }
.next-grid span { margin-bottom: 40px; color: #7667ff; font-family: var(--font-mono); font-size: 9px; }
.next-grid strong { font-size: 15px; }
.next-grid p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.next-grid i { position: absolute; right: 18px; bottom: 16px; font-style: normal; }

.docs-toc { height: calc(100svh - 130px); position: sticky; top: 130px; padding: 44px 24px; border-left: 1px solid var(--line); }
.docs-toc > a { padding: 7px 0 7px 12px; display: block; position: relative; color: #777a74; font-size: 11px; }
.docs-toc > a:hover, .docs-toc > a.active { color: var(--ink); }
.docs-toc > a.active::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 2px; background: #7667ff; }
.toc-status { margin-top: 34px; padding: 15px; display: grid; grid-template-columns: 8px 1fr; gap: 4px 9px; border: 1px solid var(--line); }
.toc-status span { width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 5px rgba(101,244,207,.13); }
.toc-status strong { font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
.toc-status small { grid-column: 2; color: var(--muted); font-size: 9px; }
.docs-footer { position: relative; z-index: 2; }
.copy-toast { position: fixed; right: 22px; bottom: 22px; z-index: 120; padding: 11px 15px; color: var(--ink); background: var(--signal); border: 1px solid var(--ink); font-family: var(--font-mono); font-size: 10px; transform: translateY(80px); opacity: 0; transition: transform .25s var(--ease), opacity .25s; }
.copy-toast.visible { transform: translateY(0); opacity: 1; }

@media (max-width: 1180px) {
  .docs-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .docs-toc { display: none; }
}

@media (max-width: 820px) {
  .docs-bar { top: 64px; min-height: 54px; grid-template-columns: 1fr auto; padding-inline: 18px; }
  .docs-bar-title span:last-child, .docs-reference-link { display: none; }
  .docs-search-trigger { width: 40px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; }
  .docs-search-trigger > span:nth-child(2), .docs-search-trigger kbd { display: none; }
  .docs-index-button { width: 100%; min-height: 46px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 118px; z-index: 19; color: var(--ink); background: var(--paper); border: 0; border-bottom: 1px solid var(--line); font: 10px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
  .docs-layout { display: block; }
  .docs-sidebar { width: min(330px, 88vw); height: calc(100svh - 118px); position: fixed; top: 118px; left: 0; z-index: 30; padding: 26px 22px 70px; background: var(--white); box-shadow: 30px 0 70px rgba(11,13,15,.15); transform: translateX(-105%); transition: transform .3s var(--ease); }
  .docs-sidebar.open { transform: translateX(0); }
  .docs-hero { padding: 58px 22px 42px; }
  .docs-hero h1 { font-size: clamp(58px, 18vw, 88px); }
  .docs-lede { font-size: 18px; }
  .docs-meta-grid { grid-template-columns: 1fr; margin-top: 38px; }
  .docs-section { padding: 56px 22px; grid-template-columns: 1fr; gap: 12px; scroll-margin-top: 180px; }
  .section-number { padding: 0; }
  .docs-page .section-heading h2 { font-size: 32px; }
  .docs-page .section-heading p { margin-top: 11px; font-size: 15px; }
  .code-card { margin-left: -22px; margin-right: -22px; border-left: 0; border-right: 0; box-shadow: none; }
  .code-card pre { padding: 20px 22px; font-size: 11px; }
  .docs-callout { grid-template-columns: 1fr; gap: 8px; }
  .endpoint-note { grid-template-columns: auto 1fr; padding-block: 13px; }
  .endpoint-note > span:last-child { grid-column: 1 / -1; justify-self: start; }
  .error-table, .next-grid { grid-template-columns: 1fr; }
  .next-grid a { min-height: 145px; }
}

@media (max-width: 520px) {
  .docs-bar-title strong { font-size: 13px; }
  .docs-search-panel { top: 76px; padding: 14px; }
  .docs-meta-grid code, .docs-meta-grid strong { font-size: 10px; }
  .language-tabs button { padding-inline: 13px; }
  .error-table > div { min-height: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .docs-sidebar, .copy-toast { transition: none; }
}
