:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --soft: #f5f5f7;
  --line: #e5e5ea;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --green: #1d9d57;
  --orange: #d97706;
  --red: #d92d20;
  --purple: #7257d5;
  --code: #111216;
  --radius: 20px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .08);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select { font: inherit; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.skip-link { position: fixed; z-index: 1000; left: 16px; top: -60px; padding: 12px 16px; color: #fff; background: var(--ink); border-radius: 10px; transition: top .2s; }
.skip-link:focus { top: 14px; }

.topbar { position: sticky; z-index: 100; top: 0; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 34px; border-bottom: 1px solid rgba(0,0,0,.08); background: rgba(255,255,255,.84); backdrop-filter: saturate(180%) blur(22px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand strong { color: var(--muted); font-weight: 500; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 9px; }
.brand-mark svg { width: 19px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.brand.small { font-size: 15px; }
.brand.small .brand-mark { width: 24px; height: 24px; border-radius: 7px; }
.brand.small svg { width: 16px; }
.version-pill { padding: 4px 8px; color: #515154; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; font: 600 11px/1 -apple-system, sans-serif; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 13px; font-weight: 500; }
.top-actions a { color: #515154; }
.panel-link { padding: 8px 13px; color: #fff !important; background: var(--ink); border-radius: 999px; }
.panel-link:hover { text-decoration: none; background: #333336; }

.layout { display: grid; grid-template-columns: 230px minmax(0, 820px) 170px; gap: 56px; max-width: 1360px; margin: 0 auto; padding: 0 32px; }
.sidebar { border-right: 1px solid var(--line); }
.sidebar-inner { position: sticky; top: 64px; max-height: calc(100vh - 64px); overflow: auto; padding: 34px 28px 50px 2px; }
.nav-label { margin: 25px 0 8px 12px; color: #a1a1a6; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.nav-label:first-child { margin-top: 0; }
.side-link { display: block; margin: 2px 0; padding: 7px 12px; color: #515154; border-radius: 8px; font-size: 13px; line-height: 1.25; }
.side-link:hover { color: var(--ink); background: var(--soft); text-decoration: none; }
.side-link.is-active { color: var(--blue); background: #edf5ff; font-weight: 600; }
.on-this-page { position: sticky; top: 98px; align-self: start; padding-top: 36px; font-size: 12px; }
.on-this-page p { margin: 0 0 12px; color: var(--ink); font-weight: 650; }
.on-this-page a { display: block; margin: 9px 0; color: #86868b; }
.on-this-page a:hover { color: var(--ink); text-decoration: none; }
.mobile-section-picker { display: none; }

.content { min-width: 0; padding: 0 0 80px; }
.doc-section { padding: 82px 0 18px; border-bottom: 1px solid var(--line); }
.doc-section:last-of-type { border-bottom: 0; }
.hero { padding-top: 96px; }
.hero h1 { max-width: 760px; margin: 18px 0 20px; font-size: clamp(48px, 7vw, 78px); line-height: .98; letter-spacing: -.058em; }
.hero h1 span { color: #86868b; }
.hero-copy { max-width: 690px; margin: 0; color: var(--muted); font-size: 21px; line-height: 1.48; letter-spacing: -.012em; }
.eyebrow, .section-kicker { color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 8px; }
.live-dot { width: 7px; height: 7px; background: #2cc66d; border-radius: 50%; box-shadow: 0 0 0 5px rgba(44,198,109,.12); }
.hero-actions { display: flex; gap: 12px; margin: 32px 0; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 19px; border-radius: 999px; font-size: 14px; font-weight: 600; transition: transform .15s, background .15s; }
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--blue); }
.button.primary:hover { background: var(--blue-hover); }
.button.secondary { color: var(--ink); background: var(--soft); border: 1px solid var(--line); }
.base-url { display: flex; align-items: center; gap: 14px; max-width: 650px; padding: 14px 16px; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; }
.base-url > span { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.base-url code { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; }
.base-url .copy-button { margin-left: auto; }

.doc-section h2 { max-width: 720px; margin: 12px 0 18px; font-size: clamp(34px, 5vw, 48px); line-height: 1.05; letter-spacing: -.042em; }
.doc-section h3 { margin: 34px 0 14px; font-size: 19px; letter-spacing: -.022em; }
.doc-section > p, .lead { max-width: 735px; color: var(--muted); font-size: 16px; line-height: 1.65; }
.lead { font-size: 18px !important; }
.doc-section p code, td code, .notice code { padding: 2px 5px; color: #3b3b3d; background: var(--soft); border: 1px solid #ececef; border-radius: 5px; font-size: .88em; }

.notice { display: flex; gap: 15px; margin: 30px 0; padding: 19px 21px; border-radius: 16px; }
.notice.important { margin-top: 52px; color: #15365d; background: #eef6ff; border: 1px solid #d8eaff; }
.notice.subtle { background: var(--soft); border: 1px solid var(--line); }
.notice.warning { color: #5d3800; background: #fff8e9; border: 1px solid #f7e6bc; }
.notice-icon { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 50%; font-size: 13px; font-weight: 800; }
.warning .notice-icon { background: var(--orange); }
.notice-icon.lock { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.notice h2, .notice h3 { margin: 0 0 5px; font-size: 15px; letter-spacing: -.01em; }
.notice p { margin: 0; font-size: 14px; line-height: 1.55; }

.steps { display: grid; gap: 0; margin: 34px 0; padding: 0; list-style: none; counter-reset: steps; }
.steps li { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 17px; padding: 0 0 28px; }
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 39px; bottom: 2px; left: 20px; width: 1px; background: var(--line); }
.step-number { position: relative; z-index: 1; width: 40px; height: 40px; display: grid; place-items: center; color: var(--blue); background: #fff; border: 1px solid #cfe4fa; border-radius: 50%; font-size: 13px; font-weight: 700; }
.steps strong { display: block; margin: 2px 0 5px; font-size: 17px; }
.steps p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.code-card { overflow: hidden; margin: 24px 0; color: #ebebf0; background: var(--code); border: 1px solid #2c2d32; border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.11); }
.code-head { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 14px; color: #98989f; background: #191a1f; border-bottom: 1px solid #2b2c32; font-size: 11px; font-weight: 600; }
.code-head > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.traffic-lights { display: flex; gap: 6px; }
.traffic-lights i { width: 8px; height: 8px; background: #494a50; border-radius: 50%; }
.traffic-lights i:first-child { background: #ff5f57; }
.traffic-lights i:nth-child(2) { background: #febc2e; }
.traffic-lights i:nth-child(3) { background: #28c840; }
.copy-button { margin-left: auto; padding: 6px 9px; color: #bebec4; background: transparent; border: 1px solid #3a3b42; border-radius: 7px; cursor: pointer; font-size: 11px; }
.copy-button:hover { color: #fff; border-color: #5a5b63; }
.copy-button.compact { color: #515154; border-color: #d2d2d7; }
.copy-button.compact:hover { color: var(--ink); background: #fff; }
.code-card pre { margin: 0; overflow: auto; padding: 20px; font-size: 12.5px; line-height: 1.65; tab-size: 2; }
.code-card code { color: inherit; }
.response-card { border-color: #303237; box-shadow: none; }

.endpoint-line { min-height: 48px; display: flex; align-items: center; gap: 12px; margin: 20px 0; padding: 10px 13px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.endpoint-line.prominent { padding: 13px; }
.endpoint-line code { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.method { flex: 0 0 auto; min-width: 54px; padding: 6px 8px; text-align: center; border-radius: 7px; font: 700 10px/1 "SFMono-Regular", monospace; letter-spacing: .04em; }
.method.post { color: #05603a; background: #dff8ea; }
.method.get { color: #075fa9; background: #e1f0ff; }
.method.delete { color: #a42820; background: #fee9e7; }
.method.neutral { color: #554697; background: #eee9ff; }
.auth-chip { margin-left: auto; color: #77777c; font-size: 10px; font-weight: 650; text-transform: uppercase; }
.endpoint-stack { display: grid; gap: 16px; margin-top: 28px; }
.endpoint-stack article { padding: 4px 18px 13px; border: 1px solid var(--line); border-radius: 16px; }
.endpoint-stack .endpoint-line { margin: 12px 0 6px; padding-left: 0; background: transparent; border: 0; }
.endpoint-stack p { margin: 0 0 4px; color: var(--muted); font-size: 14px; line-height: 1.5; }

.tabs { margin-top: 28px; }
.tab-list { display: inline-flex; padding: 3px; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; }
.tab { padding: 8px 13px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 600; }
.tab.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.tab-panel .code-card { margin-top: 13px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 15px; color: #77777c; background: var(--soft); text-align: left; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
td { padding: 14px 15px; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
td:nth-child(2) { color: var(--muted); white-space: nowrap; }
.status-code { display: inline-block; margin-left: 6px; color: var(--green); font-size: 11px; font-weight: 700; vertical-align: middle; }
.small-note { color: #86868b !important; font-size: 13px !important; line-height: 1.55 !important; }

.state-flow { display: flex; align-items: center; gap: 8px; margin: 26px 0; overflow-x: auto; padding-bottom: 4px; }
.state-flow span { flex: 0 0 auto; padding: 8px 11px; background: var(--soft); border: 1px solid var(--line); border-radius: 9px; font: 600 11px "SFMono-Regular", monospace; }
.state-flow .terminal { color: var(--purple); background: #f1edff; border-color: #ded5ff; }
.state-flow i { color: #b1b1b6; font-style: normal; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.status-grid article { display: grid; grid-template-columns: 12px 1fr; gap: 11px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; }
.status-grid code { font-size: 12px; font-weight: 700; }
.status-grid p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.status-dot { width: 8px; height: 8px; margin-top: 4px; background: #aaa; border-radius: 50%; }
.status-dot.pending { background: #9b9ba1; }.status-dot.progress { background: var(--blue); }.status-dot.processing { background: var(--purple); }.status-dot.verified { background: var(--green); }.status-dot.rejected { background: var(--red); }.status-dot.review { background: var(--orange); }.status-dot.cancelled { background: #73737a; }.status-dot.expired { background: #b0b0b6; }

.header-list { margin: 25px 0; border: 1px solid var(--line); border-radius: 14px; }
.header-list > div { display: grid; grid-template-columns: 210px 1fr; gap: 18px; padding: 13px 15px; border-top: 1px solid var(--line); }
.header-list > div:first-child { border-top: 0; }
.header-list code { color: var(--blue); font-size: 11px; }
.header-list span { color: var(--muted); font-size: 12px; }
.formula { margin: 18px 0; padding: 15px; overflow-x: auto; color: #4f3da1; background: #f4f0ff; border: 1px solid #e4dcff; border-radius: 12px; font-size: 12px; }

.download-card { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 20px; padding: 28px; background: linear-gradient(145deg, #f5f5f7, #fbfbfc); border: 1px solid var(--line); border-radius: var(--radius); }
.download-card h2 { margin: 0 0 8px; font-size: 30px; }
.download-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.download-icon { width: 56px; height: 56px; display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 15px; font: 700 15px "SFMono-Regular", monospace; }
.feature-grid, .security-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 26px 0; }
.feature-grid article, .security-grid article { min-height: 170px; padding: 20px; background: var(--soft); border: 1px solid var(--line); border-radius: 16px; }
.feature-grid span { color: var(--blue); font-size: 11px; font-weight: 700; }
.feature-grid h3, .security-grid h3 { margin: 24px 0 8px; font-size: 16px; }
.feature-grid p, .security-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.48; }
.security-grid { grid-template-columns: 1fr 1fr; }
.security-grid article { min-height: 160px; }
.security-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--blue); background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.security-grid h3 { margin-top: 18px; }

.release { display: grid; grid-template-columns: 160px 1fr; gap: 30px; padding: 26px 0; border-top: 1px solid var(--line); }
.release-meta { display: flex; flex-direction: column; gap: 8px; }
.release-version { width: fit-content; padding: 5px 8px; color: #fff; background: var(--ink); border-radius: 7px; font-size: 11px; font-weight: 700; }
.release time { color: var(--muted); font-size: 11px; }
.release h3 { margin: 0 0 12px; }
.release ul { margin: 0; padding-left: 19px; color: var(--muted); font-size: 14px; line-height: 1.7; }

.docs-footer { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 28px; padding: 46px 0 10px; color: #86868b; font-size: 11px; }
.docs-footer p { margin: 0; }
.toast { position: fixed; z-index: 200; bottom: 22px; left: 50%; padding: 10px 15px; color: #fff; background: rgba(29,29,31,.92); border-radius: 999px; box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 20px); pointer-events: none; font-size: 12px; transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1120px) {
  .layout { grid-template-columns: 210px minmax(0, 820px); gap: 42px; max-width: 1120px; }
  .on-this-page { display: none; }
}

@media (max-width: 780px) {
  html { scroll-padding-top: 118px; }
  .topbar { height: 58px; padding: 0 17px; }
  .top-actions > a:first-child, .version-pill { display: none; }
  .panel-link { padding: 7px 11px; }
  .layout { display: block; padding: 0 19px; }
  .sidebar { display: none; }
  .mobile-section-picker { position: sticky; z-index: 80; top: 58px; display: flex; align-items: center; gap: 10px; margin: 0 -19px; padding: 10px 19px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
  .mobile-section-picker label { color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; }
  .mobile-section-picker select { flex: 1; min-width: 0; padding: 8px 30px 8px 10px; color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
  .hero { padding-top: 64px; }
  .hero h1 { font-size: 50px; }
  .hero-copy { font-size: 18px; }
  .doc-section { padding-top: 68px; }
  .base-url { align-items: flex-start; flex-wrap: wrap; }
  .base-url code { order: 3; width: 100%; }
  .status-grid, .feature-grid, .security-grid { grid-template-columns: 1fr; }
  .header-list > div { grid-template-columns: 1fr; gap: 5px; }
  .download-card { grid-template-columns: 48px 1fr; padding: 21px; }
  .download-icon { width: 46px; height: 46px; }
  .download-card .button { grid-column: 1 / -1; }
  .release { grid-template-columns: 1fr; gap: 16px; }
  .release-meta { flex-direction: row; align-items: center; }
  .docs-footer { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 42px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .code-card { margin-left: -8px; margin-right: -8px; border-radius: 13px; }
  .code-card pre { padding: 17px; font-size: 11.5px; }
  .auth-chip { display: none; }
  .tab-list { width: 100%; }
  .tab { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media print {
  .topbar, .sidebar, .on-this-page, .mobile-section-picker, .copy-button, .hero-actions, .toast { display: none !important; }
  .layout { display: block; max-width: none; padding: 0; }
  .content { max-width: none; }
  .doc-section { break-inside: avoid; padding-top: 30px; }
  .code-card { box-shadow: none; }
}
