/* Bonus Round docs layout. Builds on /assets/ui.css tokens. */
.docs-top { position: sticky; top: 0; z-index: 60; background: rgba(10,11,16,.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.docs-top .in { display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 20px; max-width: 1440px; margin: 0 auto; }
.docs-top .logo { display: flex; align-items: center; gap: 10px; font: 800 17px var(--display); text-decoration: none; white-space: nowrap; }
.docs-top .logo .tag { font: 600 12px var(--font); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 8px; }
.docs-top .links { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.docs-top .links a.l { color: var(--text-2); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.docs-top .links a.l:hover { color: var(--text); background: var(--surface-1); }
.menu-btn { display: none; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text); border-radius: 10px; padding: 7px 10px; font: 600 13px var(--font); cursor: pointer; }

/* search */
.search { position: relative; flex: 1; max-width: 420px; }
.search input { padding: 8px 12px 8px 34px; font-size: 14px; border-radius: 10px; background: var(--surface-1); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 11px var(--mono); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; pointer-events: none; }
.search .results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #0d0f16; border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); max-height: min(70vh, 520px); overflow-y: auto; display: none; padding: 6px; }
.search .results.open { display: block; }
.search .results a { display: block; padding: 9px 11px; border-radius: 9px; text-decoration: none; }
.search .results a .t { font-weight: 650; font-size: 14px; color: var(--text); }
.search .results a .p { font-size: 12px; color: var(--muted); }
.search .results a .s { font-size: 13px; color: var(--text-2); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search .results a.sel, .search .results a:hover { background: var(--surface-2); }
.search .results mark { background: rgba(255,201,60,.22); color: var(--gold); border-radius: 3px; padding: 0 1px; }
.search .results .none { padding: 14px; color: var(--muted); font-size: 14px; }

/* layout */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 40px; max-width: 1440px; margin: 0 auto; padding: 0 20px; }
.docs-nav { position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; padding: 26px 4px 40px 0; }
.docs-nav .grp { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin: 18px 10px 6px; }
.docs-nav .grp:first-child { margin-top: 0; }
.docs-nav a { display: block; padding: 7px 10px; border-radius: 9px; color: var(--text-2); text-decoration: none; font-size: 14.5px; font-weight: 520; }
.docs-nav a:hover { background: var(--surface-1); color: var(--text); }
.docs-nav a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--gold); }
.toc { position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; padding: 30px 0; font-size: 13px; }
.toc .h { color: var(--muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.toc a { display: block; color: var(--muted); text-decoration: none; padding: 4px 0 4px 10px; border-left: 1px solid var(--line); }
.toc a:hover, .toc a.on { color: var(--text); border-left-color: var(--gold); }

/* article */
.doc { padding: 30px 0 90px; min-width: 0; max-width: 780px; }
.doc .eyebrow { color: var(--gold); font: 700 12.5px var(--font); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; }
.doc h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 14px; }
.doc .lede { font-size: 17.5px; color: var(--text-2); margin-bottom: 28px; }
.doc h2 { font-size: 25px; margin: 46px 0 14px; scroll-margin-top: 80px; padding-top: 6px; }
.doc h3 { font-size: 18px; margin: 30px 0 10px; scroll-margin-top: 80px; }
.doc h2 a.anchor, .doc h3 a.anchor { color: var(--muted); text-decoration: none; margin-left: 8px; opacity: 0; font-weight: 500; }
.doc h2:hover a.anchor, .doc h3:hover a.anchor { opacity: 1; }
.doc p, .doc li { color: var(--text-2); font-size: 15.5px; line-height: 1.7; }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 1.1em; }
.doc li { margin: 4px 0; }
.doc li::marker { color: var(--muted); }
.doc a:not(.btn):not(.anchor):not(.card-link) { color: #a996ff; text-decoration: none; border-bottom: 1px solid rgba(169,150,255,.35); }
.doc a:not(.btn):not(.anchor):not(.card-link):hover { color: #c7baff; border-bottom-color: #c7baff; }
.doc strong { color: var(--text); font-weight: 650; }
.doc :not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .86em; color: #e9dcff; overflow-wrap: anywhere; }
.doc table.data { margin: 6px 0 22px; }
.doc table.data td { color: var(--text-2); vertical-align: top; font-size: 14px; }
.doc table.data td code { white-space: nowrap; }
.doc .table-wrap { margin-bottom: 22px; }
.doc .table-wrap table.data { margin: 0; }
.doc hr { border: 0; height: 1px; background: var(--line); margin: 40px 0; }

/* code blocks */
.code { position: relative; margin: 0 0 20px; }
.code .lang { position: absolute; left: 14px; top: 0; transform: translateY(-50%); font: 600 10.5px var(--mono); color: var(--muted); background: #07080c; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; text-transform: uppercase; letter-spacing: .06em; }
.code pre { margin: 0; padding: 18px 16px 16px; font-size: 13.5px; line-height: 1.6; }
.doc pre, .doc code { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.code .copy { position: absolute; right: 8px; top: 8px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text-2); border-radius: 8px; font: 600 12px var(--font); padding: 5px 9px; cursor: pointer; box-shadow: -10px 0 12px #07080c; }
.code .copy:hover { color: var(--text); border-color: #4a5068; }
.code .copy.done { color: #7ee07e; border-color: #1f4d2a; }
.tok-c { color: #6f7a90; font-style: italic; } .tok-s { color: #9fe6a0; } .tok-k { color: #c4a6ff; } .tok-n { color: #ffcf7a; } .tok-t { color: #7cd7ff; } .tok-a { color: #ffb38a; }

/* callouts */
.callout { border: 1px solid var(--line-strong); background: var(--surface-1); border-radius: var(--r); padding: 14px 16px 14px 46px; margin: 0 0 22px; position: relative; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout::before { position: absolute; left: 16px; top: 13px; font-size: 17px; }
.callout.tip { border-color: #234a3b; background: #0d1a15; } .callout.tip::before { content: "✓"; color: var(--mint); font-weight: 800; }
.callout.note { border-color: #2f2a5a; background: #12112a; } .callout.note::before { content: "i"; color: #a996ff; font: 800 15px var(--display); left: 20px; }
.callout.warn { border-color: #5a4512; background: #1d1607; } .callout.warn::before { content: "!"; color: var(--gold); font: 800 17px var(--display); left: 21px; }
.callout .t { color: var(--text); font-weight: 650; display: block; margin-bottom: 4px; }

/* steps */
ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 46px; margin: 0 0 26px; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--grad-gold); color: var(--gold-ink); font: 800 14px/30px var(--display); text-align: center; }
ol.steps > li > h3 { margin: 3px 0 8px; }

/* tabs */
.tabs { margin: 0 0 22px; }
.tabs .tl { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs .tl button { background: none; border: 0; color: var(--muted); font: 600 14px var(--font); padding: 9px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs .tl button.on { color: var(--text); border-bottom-color: var(--gold); }
.tabs .tp { display: none; } .tabs .tp.on { display: block; }

/* cards grid on the quickstart */
.doc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
.doc-cards a.card-link { display: block; text-decoration: none; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; transition: border-color .2s; }
.doc-cards a.card-link:hover { border-color: var(--line-strong); }
.doc-cards a.card-link b { display: block; color: var(--text); font: 650 15.5px var(--display); margin-bottom: 4px; }
.doc-cards a.card-link span { color: var(--muted); font-size: 13.5px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); }
.pager a { text-decoration: none !important; border: 1px solid var(--line) !important; border-radius: var(--r); padding: 12px 16px; flex: 1; max-width: 50%; color: var(--text) !important; }
.pager a:hover { border-color: var(--line-strong) !important; }
.pager a small { display: block; color: var(--muted); font-size: 12px; }
.pager a.next { text-align: right; margin-left: auto; }
.method { display: inline-block; font: 700 11px var(--mono); padding: 2px 7px; border-radius: 6px; margin-right: 6px; vertical-align: 1px; }
.method.get { background: #0f2214; color: #7ee07e; } .method.post { background: #12112a; color: #a996ff; } .method.patch, .method.put { background: #261d08; color: #ffd27a; } .method.delete { background: #240f0f; color: #ff9b9b; }
.endpoint { font: 600 14.5px var(--mono); color: var(--text); margin: 26px 0 8px; scroll-margin-top: 80px; overflow-wrap: anywhere; }

@media (max-width: 1180px) { .docs { grid-template-columns: 230px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 16px; }
  .menu-btn { display: inline-flex; }
  .docs-nav { display: none; position: fixed; inset: 60px 0 0 0; height: auto; background: var(--bg); z-index: 55; padding: 18px 16px 40px; }
  body.nav-open .docs-nav { display: block; }
  body.nav-open { overflow: hidden; }
  .docs-top .in { padding: 0 16px; gap: 10px; }
  .docs-top .links a.l.hide-sm, .docs-top .logo .tag { display: none; }
  .search kbd { display: none; }
  .search .results { position: fixed; left: 12px; right: 12px; top: 64px; max-height: calc(100vh - 80px); }
  .doc { padding-top: 22px; }
  .doc-cards { grid-template-columns: 1fr; }
  .code pre { padding-top: 46px; }
  .code pre code.lang-text { white-space: pre-wrap; overflow-wrap: anywhere; }
  .code .copy { box-shadow: none; }
}
@media (max-width: 480px) {
  .docs-top .logo span.word, .docs-top .links .btn { display: none; }
  .docs-top .links { margin-left: 0; }
  .pager { flex-direction: column; } .pager a { max-width: none; }
  .doc table.data td code { white-space: normal; overflow-wrap: break-word; } /* break at the <wbr>s docs.js adds after . ( , not mid-word */
}
