/* API reference page. Builds on site.css (tokens, nav, buttons, footer). */

.docs-nav { gap: 16px; }
.docs-crumb { padding-left: 14px; border-left: 1px solid var(--line-2); color: var(--text-2); font-size: 14px; white-space: nowrap; }
.docs .nav-links { margin-left: 8px; }

.docs-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-top: 40px; }
.docs-side { position: relative; }
.docs-toc { position: sticky; top: calc(var(--nav-h) + 24px); max-height: calc(100vh - var(--nav-h) - 48px); overflow: auto; padding-bottom: 24px; scrollbar-width: thin; scrollbar-color: #2c2e36 transparent; }
.docs-toc summary { display: none; }
.toc-h { margin: 22px 0 8px; color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.toc-h:first-of-type { margin-top: 0; }
.docs-toc a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 7px; color: var(--text-2); font-size: 14px; text-decoration: none; transition: color .15s, background-color .15s; }
.docs-toc a:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.docs-toc a.on { color: var(--text); background: rgba(255, 255, 255, .06); }

.docs-main { min-width: 0; max-width: 860px; padding-bottom: 96px; }
.docs-head h1 { margin-top: 12px; font-size: clamp(2.2rem, 1.6rem + 2vw, 3rem); }
.docs-head .lead { margin-top: 16px; }

.guide { padding-top: 56px; margin-top: 8px; scroll-margin-top: calc(var(--nav-h) + 8px); }
.guide h2, .ref-head h2 { font-size: 26px; line-height: 1.2; letter-spacing: -0.022em; }
.guide p, .guide li { color: var(--text-2); font-size: 15.5px; line-height: 1.7; overflow-wrap: anywhere; }
.guide p { margin-top: 14px; }
.guide b { color: var(--text); font-weight: 600; }
.guide a { color: var(--accent-2); text-decoration: none; }
.guide a:hover { text-decoration: underline; text-underline-offset: 3px; }
.guide ul, .guide ol { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 8px; }
.guide li::marker { color: var(--text-3); }
.docs code { font-family: var(--mono); font-size: .86em; color: #d6d7dd; padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, .06); overflow-wrap: anywhere; }
.snip { margin-top: 16px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: #0f1013; white-space: pre; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #2c2e36 transparent; }
.snip code { padding: 0; background: none; font-size: 12.5px; line-height: 1.7; overflow-wrap: normal; }
.dt { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 14.5px; }
.dt td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; color: var(--text-2); line-height: 1.55; }
.dt tr:first-child td { border-top: 0; }
.dt td:first-child { width: 1%; white-space: nowrap; padding-left: 0; }
.dt td { overflow-wrap: anywhere; }
@media (max-width: 420px) { .dt td:first-child { white-space: normal; width: 38%; } .dt td { padding: 9px 8px; } }

.ref { margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--line-2); }
.ref-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; position: sticky; top: var(--nav-h); z-index: 5; padding: 14px 0; background: var(--bg); }
.ref-search { display: flex; align-items: center; gap: 8px; width: min(100%, 340px); height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-3); }
.ref-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ghost); }
.ref-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14.5px; }
.ref-search input::placeholder { color: var(--text-3); }
.ref-none { margin-top: 24px; color: var(--text-2); }
.ref-sec { padding-top: 36px; scroll-margin-top: calc(var(--nav-h) + 72px); }
.ref-sec h3 { display: flex; align-items: center; gap: 10px; font-size: 19px; }
.ref-count { padding: 1px 8px; border-radius: 99px; background: rgba(255, 255, 255, .06); color: var(--text-3); font-size: 12px; font-weight: 600; }
.ref-sum { margin-top: 6px; color: var(--text-3); font-size: 14px; }
.ep { margin-top: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); scroll-margin-top: calc(var(--nav-h) + 72px); }
.ep:target { border-color: rgba(139, 141, 255, .45); }
.ep-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.m { flex: none; min-width: 56px; padding: 2px 0; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text-2); font-family: var(--mono); font-size: 11.5px; font-weight: 600; text-align: center; }
.m-get { color: var(--accent-2); border-color: rgba(139, 141, 255, .35); background: rgba(139, 141, 255, .08); }
.ep-path { padding: 0; background: none; color: var(--text); font-size: 13px; }
.ep-name { margin-left: auto; color: var(--text-3); font-size: 13px; }
.ep p { margin-top: 8px; color: var(--text-2); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }

@media (max-width: 960px) {
  .docs .nav-links { display: none; }
  .docs-wrap { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 24px; }
  .docs-toc { position: static; max-height: none; padding: 0; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
  .docs-toc summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; cursor: pointer; font-weight: 600; list-style: none; }
  .docs-toc summary::-webkit-details-marker { display: none; }
  .docs-toc[open] { padding-bottom: 12px; }
  .docs-toc a, .toc-h { margin-left: 6px; margin-right: 6px; }
  .toc-h:first-of-type { margin-top: 8px; }
}
@media (max-width: 600px) {
  .docs-crumb { display: none; }
  .ep-name { margin-left: 0; width: 100%; }
  .nav-cta .btn-primary { display: none; }
}
