[data-lang-block][hidden] { display: none !important; }
.api-doc { display: grid; gap: 18px; max-width: 1080px; margin: 0 auto; }
.api-doc .market-crumbs { display: flex; margin-bottom: 0; }
.api-doc .market-back { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 600; text-decoration: none; transition: border-color .16s; }
.api-doc .market-back:hover { border-color: var(--soft); }

.api-hero { position: relative; overflow: hidden; display: grid; gap: 14px; padding: 34px 34px 30px; border-radius: var(--r-xl); background: radial-gradient(90% 120% at 100% 0, color-mix(in srgb, var(--blue) 16%, transparent), transparent 62%), var(--paper); box-shadow: var(--shadow); animation: api-rise .55s cubic-bezier(.16, 1, .3, 1) both; }
.api-hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--blue) 22%, transparent), transparent 70%); pointer-events: none; animation: api-glow 9s ease-in-out infinite alternate; }
.api-eyebrow { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.api-hero h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.02em; }
.api-lead { max-width: 760px; margin: 0; color: var(--soft); font-size: 17px; line-height: 1.6; }
.api-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 0; padding: 0; list-style: none; }
.api-facts li { padding: 7px 14px; border-radius: 999px; background: var(--bg); color: var(--ink); font-size: 13.5px; font-weight: 600; animation: api-rise .5s cubic-bezier(.16, 1, .3, 1) both; }
.api-facts li:nth-child(2) { animation-delay: .05s; } .api-facts li:nth-child(3) { animation-delay: .1s; } .api-facts li:nth-child(4) { animation-delay: .15s; }
.api-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.api-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 600; text-decoration: none; transition: transform .18s cubic-bezier(.2, .8, .2, 1), border-color .18s, background .18s; }
.api-btn:hover { transform: translateY(-1px); border-color: var(--soft); }
.api-btn--primary { border-color: transparent; background: var(--inv-bg); color: var(--inv-fg); }
.api-btn--primary:hover { border-color: transparent; background: var(--inv-hover, var(--inv-bg)); }

.api-toc { position: sticky; top: 84px; z-index: 20; display: flex; gap: 4px; overflow-x: auto; padding: 6px; border-radius: 999px; background: color-mix(in srgb, var(--paper) 88%, transparent); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); scrollbar-width: none; animation: api-rise .55s .08s cubic-bezier(.16, 1, .3, 1) both; }
.api-toc::-webkit-scrollbar { display: none; }
.api-toc a { flex: none; position: relative; padding: 9px 16px; border-radius: 999px; color: var(--soft); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: color .2s, background .2s; }
.api-toc a:hover { color: var(--ink); background: var(--bg); }
.api-toc a[aria-current] { background: var(--inv-bg); color: var(--inv-fg); }
.api-toc a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.api-card { display: grid; gap: 14px; min-width: 0; padding: 28px 30px; border-radius: var(--r-xl); background: var(--paper); box-shadow: var(--shadow); scroll-margin-top: 52px; }
.api-card > h2 { display: flex; align-items: center; gap: 12px; margin: 0; font-size: clamp(22px, 2.4vw, 28px); }
.api-card > h2::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 18%, transparent); }
.api-card h3 { margin: 10px 0 0; font-size: 18px; }
.api-card p, .api-card li { margin: 0; color: var(--ink); line-height: 1.65; }
.api-card ul, .api-card ol { display: grid; gap: 8px; margin: 0; padding-left: 22px; }
.api-card ol { counter-reset: api-step; padding-left: 0; list-style: none; }
.api-card ol > li { position: relative; padding-left: 44px; counter-increment: api-step; }
.api-card ol > li::before { content: counter(api-step); position: absolute; left: 0; top: 0; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); font-size: 14px; font-weight: 800; }
.api-card a { color: var(--blue); font-weight: 600; text-underline-offset: 3px; }
.api-card code { padding: 2px 6px; border-radius: 6px; background: var(--bg); font: .9em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.api-card b, .api-card strong { color: var(--ink); }
.api-doc .api-note { padding: 14px 18px; border-radius: 14px; background: color-mix(in srgb, #f59e0b 13%, transparent); }

.api-code { position: relative; overflow: hidden; border-radius: 16px; background: #0f1117; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); }
.api-code-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 16px; border-bottom: 1px solid rgb(255 255 255 / .07); }
.api-code-bar span { display: inline-flex; align-items: center; gap: 6px; color: #8b93a7; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.api-code-bar span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 14px 0 0 #fbbf24, 28px 0 0 #f87171; margin-right: 30px; }
.api-copy { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border: 1px solid rgb(255 255 255 / .12); border-radius: 999px; background: rgb(255 255 255 / .04); color: #e5e7eb; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .18s, border-color .18s, color .18s; }
.api-copy:hover { background: rgb(255 255 255 / .1); }
.api-copy:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.api-copy.is-done { border-color: rgb(52 211 153 / .5); color: #6ee7b7; }
.api-doc pre { margin: 0; padding: 16px 18px; overflow: auto; border-radius: 16px; background: #0f1117; color: #e6e9f0; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.api-code pre { border-radius: 0; background: transparent; }

.api-wide { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.api-card table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
.api-card th { position: sticky; top: 0; padding: 11px 14px; background: var(--bg); color: var(--soft); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.api-card td { padding: 11px 14px; border-top: 1px solid var(--line); color: var(--ink); line-height: 1.5; text-align: left; vertical-align: top; }
.api-card tbody tr { transition: background .15s; }
.api-card tbody tr:hover { background: color-mix(in srgb, var(--blue) 5%, transparent); }
.api-card td:nth-child(2) code { white-space: nowrap; }
.api-card td:last-child { color: var(--soft); white-space: nowrap; }
.api-method { display: inline-grid; min-width: 62px; padding: 4px 8px; place-items: center; border-radius: 8px; font: 800 11.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; }
.api-method[data-method="get"] { background: rgb(16 185 129 / .14); color: #047857; }
.api-method[data-method="post"] { background: rgb(37 99 235 / .14); color: #1d4ed8; }
.api-method[data-method="patch"], .api-method[data-method="put"] { background: rgb(245 158 11 / .16); color: #b45309; }
.api-method[data-method="delete"] { background: rgb(239 68 68 / .14); color: #b91c1c; }
:root[data-theme="dark"] .api-method[data-method="get"] { color: #6ee7b7; }
:root[data-theme="dark"] .api-method[data-method="post"] { color: #93c5fd; }
:root[data-theme="dark"] :is(.api-method[data-method="patch"], .api-method[data-method="put"]) { color: #fcd34d; }
:root[data-theme="dark"] .api-method[data-method="delete"] { color: #fca5a5; }

.api-page.is-ready .api-card.is-waiting { opacity: 0; transform: translateY(24px); }
.api-page.is-ready .api-card { transition: opacity .6s cubic-bezier(.16, 1, .3, 1), transform .6s cubic-bezier(.16, 1, .3, 1); }
@keyframes api-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes api-glow { from { transform: translate(0, 0) scale(1); } to { transform: translate(-30px, -20px) scale(1.15); } }

@media (max-width: 760px) {
  .api-hero { padding: 24px 20px 22px; }
  .api-card { padding: 22px 18px; scroll-margin-top: 44px; }
  .api-toc { top: 76px; border-radius: 18px; }
  .api-actions .api-btn { flex: 1 1 auto; }
  .api-card ol > li { padding-left: 40px; }
  .api-wide { overflow: visible; }
  .api-card table, .api-card tbody, .api-card tr, .api-card td { display: block; }
  .api-card table { min-width: 0; }
  .api-card thead { display: none; }
  .api-card tbody tr { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--line); }
  .api-card tbody tr:first-child { border-top: 0; }
  .api-card tbody tr:has(.api-method) { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .api-card tbody tr:has(.api-method) td:nth-child(n+3) { grid-column: 1 / -1; }
  .api-card td { padding: 0; border: 0; }
  .api-card td:last-child { white-space: normal; font-size: 13px; }
  .api-card td:nth-child(2) code { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .api-hero, .api-facts li, .api-toc { animation: none; }
  .api-hero::after { animation: none; }
  .api-page.is-ready .api-card, .api-page.is-ready .api-card.is-waiting { opacity: 1; transform: none; transition: none; }
}
