:root {
  --black: #04070c; --white: #f3f2ee;
  --line: rgba(243, 242, 238, 0.16); --line-strong: rgba(243, 242, 238, 0.32);
  --muted: rgba(243, 242, 238, 0.54);
  --panel: rgba(6, 10, 16, 0.60); --panel-solid: rgba(5, 9, 14, 0.80);
  --hover-1: rgba(243, 242, 238, 0.035); --hover-2: rgba(243, 242, 238, 0.06); --hover-3: rgba(243, 242, 238, 0.07);
  --inset-highlight: rgba(243, 242, 238, 0.08);
  --overlay-1: rgba(4, 10, 16, 0.66); --overlay-2: rgba(4, 10, 16, 0.20); --overlay-3: rgba(4, 10, 16, 0.44); --overlay-4: rgba(4, 10, 16, 0.90);
  --shadow-1: rgba(0, 0, 0, 0.55);
  --surface: #0b0e13; --surface-2: #171c24;
  --radius: 14px; --radius-sm: 8px;
  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --get: #4fd18b; --post: #7aa2ff; --put: #f5b95c; --patch: #f5b95c; --delete: #f2708a;
}
html[data-theme="light"] {
  --black: #f2f3f0; --white: #12161c;
  --line: rgba(18, 22, 28, 0.14); --line-strong: rgba(18, 22, 28, 0.32);
  --muted: rgba(18, 22, 28, 0.60);
  --panel: rgba(255, 255, 255, 0.66); --panel-solid: rgba(255, 255, 255, 0.93);
  --hover-1: rgba(18, 22, 28, 0.035); --hover-2: rgba(18, 22, 28, 0.06); --hover-3: rgba(18, 22, 28, 0.06);
  --inset-highlight: rgba(255, 255, 255, 0.75);
  --overlay-1: rgba(255, 255, 255, 0.42); --overlay-2: rgba(255, 255, 255, 0.20); --overlay-3: rgba(255, 255, 255, 0.42); --overlay-4: rgba(255, 255, 255, 0.80);
  --shadow-1: rgba(20, 24, 32, 0.14);
  --surface: #ffffff; --surface-2: #ececeb;
  --get: #1f9d5c; --post: #3557c9; --put: #b3790a; --patch: #b3790a; --delete: #c22a4d;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; background: var(--black); color: var(--white); font-family: var(--font-body); -webkit-font-smoothing: antialiased; transition: background 0.2s ease, color 0.2s ease; }
body { min-height: 100vh; background-image: linear-gradient(180deg, var(--overlay-1) 0%, var(--overlay-2) 36%, var(--overlay-3) 68%, var(--overlay-4) 100%), url('/background.jpg'); background-size: cover; background-position: center; background-attachment: fixed; }
.page { display: flex; flex-direction: column; min-height: 100vh; }
header { border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 24px 40px; position: sticky; top: 0; z-index: 30; background: var(--surface); }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 26px; width: auto; display: block; }
.logo .logo-light { display: none; }
html[data-theme="light"] .logo .logo-dark { display: none; }
html[data-theme="light"] .logo .logo-light { display: block; }
.header-right { display: flex; align-items: center; gap: 28px; }
nav { display: flex; gap: 32px; }
nav a { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; letter-spacing: 0.01em; transition: color 0.15s ease; }
nav a:hover, nav a:focus-visible, nav a.active { color: var(--white); }
.social-links { display: flex; align-items: center; gap: 16px; padding-left: 20px; border-left: 1px solid var(--line); }
.social-links a { color: var(--muted); display: flex; transition: color 0.15s ease; }
.social-links a:hover, .social-links a:focus-visible { color: var(--white); }
.social-links svg { width: 16px; height: 16px; }
.theme-toggle { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease; }
.theme-toggle:hover, .theme-toggle:focus-visible { border-color: var(--white); color: var(--white); outline: none; }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 1px solid var(--white); outline-offset: 2px; }

.docs-shell { flex: 1; display: flex; align-items: flex-start; max-width: 1360px; width: calc(100% - 48px); margin: 24px auto 40px; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.docs-sidebar { position: sticky; top: 89px; align-self: flex-start; width: 280px; flex-shrink: 0; max-height: calc(100vh - 89px); overflow-y: auto; padding: 28px 16px 60px 16px; border-right: 1px solid var(--line); }
.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.side-search { width: 100%; padding: 9px 12px; margin-bottom: 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--white); font-family: var(--font-body); font-size: 13px; }
.side-search::placeholder { color: var(--muted); }
.side-search:focus { border-color: var(--line-strong); outline: none; }
.side-group-label { font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; padding: 0 8px; }
.side-group-label:first-child { margin-top: 0; }
.side-link { display: block; padding: 6px 8px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 13px; line-height: 1.4; transition: background 0.12s ease, color 0.12s ease; }
.side-link:hover { background: var(--hover-2); color: var(--white); }
.side-link.side-link-strong { font-weight: 600; color: var(--white); }
.side-link.side-category { font-weight: 600; color: var(--white); margin-top: 10px; }
.side-link.side-endpoint { padding-left: 18px; font-size: 12.5px; }
.side-link.side-endpoint::before { content: '·'; margin-right: 6px; color: var(--line-strong); }

.docs-main { flex: 1; min-width: 0; padding: 28px 48px 120px; }
.docs-content { max-width: 780px; }
.doc-section { padding-bottom: 56px; margin-bottom: 56px; border-bottom: 1px solid var(--line); }
.doc-section:last-child { border-bottom: none; }
.section-kicker { font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.doc-section h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin: 0 0 18px; letter-spacing: -0.01em; }
.doc-section header { all: unset; display: block; }
.doc-section h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 34px 0 12px; padding-top: 4px; }
.doc-section h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin: 26px 0 10px; }
.doc-section h4 { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; margin: 20px 0 8px; color: var(--white); }
.doc-section p { font-size: 14.5px; line-height: 1.72; color: var(--white); margin: 0 0 14px; }
.doc-section strong { font-weight: 600; }
.doc-section a { color: var(--white); text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.doc-section a:hover { text-decoration-color: var(--white); }
.doc-section ul, .doc-section ol { font-size: 14.5px; line-height: 1.7; color: var(--white); padding-left: 22px; margin: 0 0 14px; }
.doc-section li { margin-bottom: 5px; }
.doc-section li > ul, .doc-section li > ol { margin-top: 5px; }
.doc-section code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.doc-section pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; overflow-x: auto; margin: 0 0 16px; }
.doc-section pre code { background: none; border: none; padding: 0; font-size: 12.5px; line-height: 1.6; color: inherit; }
.doc-section table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 13px; }
.doc-section th, .doc-section td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-section th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.doc-section table.params-table code { white-space: nowrap; }
.doc-section admonition, .doc-section .admonition { display: block; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--white); border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 0 16px; font-size: 13.5px; }
.doc-section admonition p, .doc-section .admonition p { margin: 0; }
.api-method-badge { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.api-method { font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.05em; padding: 3px 8px; border-radius: 5px; color: #04070c; }
.api-method-badge .api-method { background: var(--get); }
.api-method-badge code { background: var(--surface-2); }
section[id^="doc-get-"] .api-method { background: var(--get); }
section[id^="doc-post-"] .api-method { background: var(--post); color: #04070c; }
section[id^="doc-put-"] .api-method { background: var(--put); }
section[id^="doc-patch-"] .api-method { background: var(--patch); }
section[id^="doc-delete-"] .api-method { background: var(--delete); }
.section-children { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.section-children a { font-size: 13px; color: var(--muted); text-decoration: none; }
.section-children a:hover { color: var(--white); }

@media (max-width: 900px) {
  .docs-shell { flex-direction: column; width: calc(100% - 32px); margin: 16px auto 24px; }
  .docs-sidebar { position: static; width: 100%; max-height: none; padding: 20px 16px; border-right: none; border-bottom: 1px solid var(--line); }
  .docs-main { padding: 24px 20px 100px; }
  .section-children { grid-template-columns: 1fr; }
  header { padding: 18px 20px; }
  nav { gap: 18px; }
}

.side-cta { background: var(--surface-2); border: 1px solid var(--line-strong); margin-top: 4px; padding: 10px 12px; font-weight: 600; }
.side-cta:hover { background: var(--hover-2); border-color: var(--white); }
.side-cta-sub { display: block; font-weight: 400; font-size: 11px; color: var(--muted); margin-top: 3px; }
.side-back { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; display: inline-block; }
.side-back:hover { color: var(--white); }
.rest-api-callout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 24px 28px; }
.rest-api-callout-text { flex: 1; min-width: 240px; }
.rest-api-callout-text h2 { margin: 0 0 8px; }
.rest-api-callout-text p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.rest-api-callout-btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; background: var(--white); color: var(--black); font-weight: 600; font-size: 13.5px; padding: 12px 20px; border-radius: var(--radius-sm); text-decoration: none; white-space: nowrap; transition: opacity 0.15s ease; }
.rest-api-callout-btn:hover { opacity: 0.85; text-decoration: none; }
.rest-api-callout-btn svg { width: 16px; height: 16px; }
@media (max-width: 560px) { .rest-api-callout { padding: 20px; } .rest-api-callout-btn { width: 100%; justify-content: center; } }
.flow-diagram { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 20px; margin: 0 0 16px; }
.flow-header, .flow-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.flow-header { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.flow-header span:first-child { text-align: left; }
.flow-header span:last-child { text-align: right; }
.flow-row + .flow-row { margin-top: 18px; }
.flow-box { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13px; line-height: 1.5; text-align: center; color: var(--white); }
.flow-arrows { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.flow-arrow { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; }
.flow-arrow code { background: none; border: none; padding: 0; color: var(--white); font-size: 11px; }
@media (max-width: 640px) {
  .flow-header, .flow-row { grid-template-columns: 1fr; text-align: center; }
  .flow-header span:nth-child(2) { display: none; }
  .flow-header span:first-child, .flow-header span:last-child { text-align: center; }
  .flow-arrows { min-width: 0; margin: 2px 0; }
}

.is-active { background: var(--hover-2); color: var(--white) !important; box-shadow: inset 2px 0 0 var(--white); }
.doc-section-solo { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.doc-pager { display: flex; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager-link { flex: 1; max-width: 48%; display: flex; flex-direction: column; gap: 5px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; background: var(--surface-2); transition: border-color 0.15s ease, background 0.15s ease; }
.pager-link:hover { border-color: var(--line-strong); background: var(--hover-2); text-decoration: none; }
.pager-next { margin-left: auto; align-items: flex-end; text-align: right; }
.pager-label { font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.pager-title { font-size: 14px; font-weight: 600; color: var(--white); }
@media (max-width: 640px) { .doc-pager { flex-direction: column; } .pager-link { max-width: 100%; } .pager-next { align-items: flex-start; text-align: left; } }

.is-active { background: var(--hover-2); color: var(--white) !important; box-shadow: inset 2px 0 0 var(--white); }
.doc-section-solo { padding-bottom: 0; margin-bottom: 0; border-bottom: none; }
.doc-pager { display: flex; gap: 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager-link { flex: 1; max-width: 48%; display: flex; flex-direction: column; gap: 5px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; background: var(--surface-2); transition: border-color 0.15s ease, background 0.15s ease; }
.pager-link:hover { border-color: var(--line-strong); background: var(--hover-2); text-decoration: none; }
.pager-next { margin-left: auto; align-items: flex-end; text-align: right; }
.pager-label { font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.pager-title { font-size: 14px; font-weight: 600; color: var(--white); }
@media (max-width: 640px) { .doc-pager { flex-direction: column; } .pager-link { max-width: 100%; } .pager-next { align-items: flex-start; text-align: left; } }
/* ---- header modals (FAQ / Terms / Privacy), same rules as the home stylesheet ---- */
.nav-link-btn { background: none; border: none; padding: 0; margin: 0; font: inherit; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; letter-spacing: 0.01em; cursor: pointer; transition: color 0.15s ease; }
.nav-link-btn:hover, .nav-link-btn:focus-visible { color: var(--white); }
.legal-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); align-items: center; justify-content: center; padding: 24px; z-index: 100; }
.legal-overlay.open { display: flex; }
.legal-modal { width: 100%; max-width: 480px; max-height: 80%; display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: var(--radius); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); box-shadow: 0 24px 60px -20px var(--shadow-2), inset 0 1px 0 var(--inset-highlight); }
.legal-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.legal-modal-head h2 { font-family: var(--font-display); font-size: 15px; font-weight: 600; margin: 0; }
.legal-close { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; flex-shrink: 0; }
.legal-close:hover, .legal-close:focus-visible { border-color: var(--white); color: var(--white); outline: none; }
.legal-close svg { width: 12px; height: 12px; }
.legal-modal-body { padding: 16px 18px 20px; overflow-y: auto; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.legal-modal-body h3 { font-family: var(--font-body); font-size: 12.5px; font-weight: 700; color: var(--white); margin: 16px 0 6px; }
.legal-modal-body h3:first-child { margin-top: 0; }
.legal-modal-body p { margin: 0 0 10px; }
.legal-modal-body ul { margin: 0 0 10px; padding-left: 18px; }
.legal-modal-body li { margin-bottom: 4px; }
.legal-modal-body strong { color: var(--white); }
.legal-modal-body a { color: var(--white); text-decoration: underline; text-underline-offset: 2px; }
