/* Documentation (/docs/). Builds on the tokens of /style.css, so light and dark follow the site. */
.docs-body { --hh: 62px; --sw: 272px; --tw: 224px; --edge: color-mix(in srgb, var(--fg) 9%, transparent); --soft: color-mix(in srgb, var(--fg) 5%, transparent); font-size: 1rem; }
.docs-body .ic { flex: none; }

/* header */
.dhead { position: sticky; top: 0; z-index: 60; height: var(--hh); background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px); border-bottom: 1px solid var(--edge); }
.dhead-in { height: 100%; max-width: 1480px; margin-inline: auto; padding-inline: 16px; display: flex; align-items: center; gap: 12px; }
.docs-body .brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font: 700 1.1rem/1 var(--font-head); letter-spacing: -0.02em; white-space: nowrap; }
.docs-body .brand .mark { width: 30px; height: auto; color: var(--fg); }
.docs-tag { color: var(--muted); text-decoration: none; font: 600 0.78rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 8px; border: 1px solid var(--edge); border-radius: 8px; }
.docs-tag:hover { color: var(--fg); }
.ibtn { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--edge); background: transparent; color: var(--fg); cursor: pointer; }
.ibtn:hover { background: var(--soft); }
.dlinks { display: none; gap: 2px; margin-left: auto; }
.dlinks a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-size: 0.93rem; font-weight: 500; }
.dlinks a:hover { color: var(--fg); background: var(--soft); }
.dcta.btn { min-height: 40px; --pad: 0 16px; font-size: 0.93rem; border-radius: 11px; margin-left: auto; }
.ds-head { margin-left: auto; }

/* search */
.ds { position: relative; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px; border: 1px solid var(--edge); border-radius: 11px; background: var(--soft); color: var(--muted); }
.ds:focus-within { border-color: color-mix(in srgb, var(--violet) 70%, transparent); background: var(--bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--violet) 22%, transparent); }
.ds-in { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--fg); font: 400 0.95rem var(--font-body); }
.ds-in::placeholder { color: var(--muted); }
.ds-in::-webkit-search-cancel-button { display: none; }
.ds-key { font: 500 0.75rem/1 var(--font-mono); color: var(--muted); border: 1px solid var(--edge); border-radius: 6px; padding: 3px 7px; }
.ds-head { width: min(380px, 34vw); display: none; }
.ds-out { position: absolute; left: 0; right: 0; top: calc(100% + 8px); max-height: min(70vh, 460px); overflow-y: auto; background: var(--glass-solid); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 80; color: var(--fg); }
.ds-head .ds-out { width: max(100%, 440px); left: auto; right: 0; }
.ds-out a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--fg); }
.ds-out a:hover, .ds-out a.on { background: color-mix(in srgb, var(--violet) 14%, transparent); }
.r-s { font: 600 0.7rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--link); }
.r-t { font-weight: 600; font-size: 0.97rem; }
.r-h { color: var(--muted); font-weight: 400; }
.r-h::before { content: "\203A  "; }
.r-b { color: var(--muted); font-size: 0.84rem; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ds-none { padding: 14px; color: var(--muted); font-size: 0.93rem; }

/* layout */
.dlayout { max-width: 1480px; margin-inline: auto; display: grid; grid-template-columns: minmax(0, 1fr); padding-inline: 16px; }
.dmain { min-width: 0; padding: 28px 0 64px; max-width: 780px; width: 100%; margin-inline: auto; }
.dtoc { display: none; }
.dside { position: fixed; inset: var(--hh) auto 0 0; z-index: 70; width: min(86vw, 320px); transform: translateX(-102%); transition: transform .22s ease; background: var(--bg); border-right: 1px solid var(--edge); padding: 16px 14px 28px 16px; overflow-y: auto; overscroll-behavior: contain; visibility: hidden; }
.nav-open .dside { transform: none; visibility: visible; }
.nav-open { overflow: hidden; }
.scrim { position: fixed; inset: var(--hh) 0 0 0; z-index: 65; background: rgba(5, 5, 15, 0.55); }
.scrim[hidden] { display: none; }
.ds-side { margin-bottom: 18px; }
.ds-side .ds-key { display: none; }
.menu-btn { display: inline-flex; }
@media (max-width: 899px) { .dcta.btn { display: none; } .ds-head { display: none; } .dhead-in { gap: 10px; } .docs-tag { margin-left: auto; } }

/* sidebar */
.sg { margin-bottom: 22px; }
.sh { display: flex; align-items: center; gap: 9px; margin: 0 0 8px; padding: 0 10px; font: 600 0.78rem/1.2 var(--font-body); letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg); }
.sh .ic { color: var(--link); }
.dside ul { list-style: none; margin: 0; padding: 0; }
.sl { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 1px 0; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 0.93rem; line-height: 1.35; border-left: 2px solid transparent; }
.sl:hover { color: var(--fg); background: var(--soft); }
.sl[aria-current="page"] { color: var(--fg); font-weight: 600; background: color-mix(in srgb, var(--violet) 13%, transparent); border-left-color: var(--violet); }
.sl.nested { padding-left: 24px; }
.sl .ext { font-size: 0.72rem; color: var(--muted); border: 1px solid var(--edge); border-radius: 6px; padding: 1px 6px; margin-left: auto; }

/* page head */
.crumb { display: flex; gap: 8px; align-items: center; font-size: 0.85rem; color: var(--muted); margin-bottom: 14px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--fg); }
.phead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.phead h1 { margin: 0; font-size: clamp(2rem, 5.2vw, 2.7rem); letter-spacing: -0.035em; }
.pact { display: flex; gap: 8px; flex-wrap: wrap; }
.pbtn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--edge); background: var(--soft); color: var(--fg); font: 500 0.83rem var(--font-body); text-decoration: none; cursor: pointer; }
.pbtn:hover { border-color: color-mix(in srgb, var(--violet) 60%, transparent); }
.pbtn.done { color: var(--ok); border-color: var(--ok); }
.plead { font-size: 1.1rem; color: var(--muted); margin: 8px 0 28px; max-width: 62ch; }

/* content */
.doc { font-size: 1rem; line-height: 1.72; }
.doc > :first-child { margin-top: 0; }
.doc p, .doc li { color: color-mix(in srgb, var(--fg) 86%, var(--muted)); }
.doc strong { color: var(--fg); }
.doc h2 { font-size: 1.55rem; margin: 2.3em 0 0.6em; padding-top: 1.4em; border-top: 1px solid var(--edge); letter-spacing: -0.03em; }
.doc > h2:first-child, .doc h1 + h2 { border-top: 0; padding-top: 0; margin-top: 1.6em; }
.doc h3 { font-size: 1.15rem; margin: 1.9em 0 0.5em; letter-spacing: -0.02em; }
.doc h2, .doc h3 { position: relative; scroll-margin-top: calc(var(--hh) + 20px); }
.anchor { position: absolute; left: -1.1em; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.doc h2:hover .anchor, .doc h3:hover .anchor, .anchor:focus { opacity: 1; }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc li { margin: 0.4em 0; }
.doc li::marker { color: var(--link); }
.doc a { text-underline-offset: 3px; }
.doc :not(pre) > code { background: var(--soft); border: 1px solid var(--edge); border-radius: 6px; padding: 0.1em 0.38em; font-size: 0.86em; overflow-wrap: anywhere; }
.doc p, .doc li, .doc td { overflow-wrap: anywhere; }
.tablewrap { overflow-x: auto; margin: 1.3em 0; border: 1px solid var(--edge); border-radius: 12px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.doc th { text-align: left; font: 600 0.74rem/1.2 var(--font-mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); background: var(--soft); padding: 11px 14px; white-space: nowrap; }
.doc td { padding: 12px 14px; border-top: 1px solid var(--edge); vertical-align: top; }
.doc td:first-child { min-width: 9rem; }

/* code blocks */
.cb { margin: 1.3em 0; border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; background: var(--code-bg); }
.cb-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; background: var(--soft); border-bottom: 1px solid var(--edge); font: 500 0.74rem/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cb-copy { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); font: 500 0.78rem var(--font-body); text-transform: none; letter-spacing: 0; cursor: pointer; }
.cb-copy:hover { color: var(--fg); border-color: var(--edge); background: var(--soft); }
.cb-copy.done { color: var(--ok); }
.cb pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 400 0.86rem/1.65 var(--font-mono); color: var(--fg); tab-size: 2; }
.cb pre code { background: none; border: 0; padding: 0; font: inherit; white-space: pre; }

/* callouts, steps, cards, facts */
.callout { display: flex; gap: 12px; margin: 1.5em 0; padding: 14px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--cyan) 40%, transparent); background: color-mix(in srgb, var(--cyan) 8%, transparent); }
.callout .ic { margin-top: 3px; color: var(--cyan); }
.callout.warn { border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.08); }
.callout.warn .ic { color: #F59E0B; }
@media (prefers-color-scheme: light) { .callout .ic { color: #0E7490; } }
.callout > div { min-width: 0; }
.callout .cl { display: block; font: 600 0.78rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.callout p { margin: 0; color: var(--fg); }
.steps { list-style: none; counter-reset: s; padding: 0 !important; margin: 1.4em 0; }
.steps li { counter-increment: s; position: relative; padding: 4px 0 18px 46px; margin: 0; border-left: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 0.88rem var(--font-head); color: var(--fg); background: color-mix(in srgb, var(--violet) 16%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 55%, transparent); }
.steps li::after { content: ""; position: absolute; left: 14.5px; top: 36px; bottom: 4px; width: 1px; background: var(--edge); }
.steps li:last-child::after { display: none; }
.cards2 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin: 1.5em 0; }
@media (min-width: 620px) { .cards2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card2 { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--edge); border-radius: 14px; background: var(--soft); text-decoration: none; color: var(--fg); transition: border-color .2s, transform .2s; }
.card2:hover { border-color: color-mix(in srgb, var(--violet) 65%, transparent); transform: translateY(-2px); }
.card2-t { display: flex; align-items: center; justify-content: space-between; font: 600 1.02rem var(--font-head); }
.card2-t .ic { color: var(--link); }
.card2-d { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.facts { list-style: none; padding: 0 !important; margin: 1.4em 0; border: 1px solid var(--edge); border-radius: 14px; overflow: hidden; }
.facts li { display: flex; align-items: center; gap: 12px; margin: 0; padding: 12px 16px; }
.facts li + li { border-top: 1px solid var(--edge); }
.facts .ic { color: var(--ok); }
.facts span { flex: 1; min-width: 0; color: var(--fg); }
.facts a { flex: none; font-size: 0.85rem; }

/* prev, next */
.pnav { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--edge); }
.pn { display: grid; gap: 3px; padding: 14px 16px; border: 1px solid var(--edge); border-radius: 12px; text-decoration: none; color: var(--fg); }
.pn:hover { border-color: color-mix(in srgb, var(--violet) 65%, transparent); }
.pn.next { text-align: right; grid-column: 2; }
.pn-l { font: 500 0.75rem/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pn-t { font: 600 1rem var(--font-head); color: var(--link); overflow-wrap: anywhere; }

/* on this page */
.otp { position: sticky; top: calc(var(--hh) + 28px); font-size: 0.86rem; }
.otp h2 { font: 600 0.75rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.otp ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--edge); }
.otp a { display: block; padding: 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
.otp .l3 a { padding-left: 24px; font-size: 0.83rem; }
.otp a:hover { color: var(--fg); }
.otp a.on { color: var(--fg); border-left-color: var(--violet); }

/* footer sits below the layout */
.docs-body .footer { margin-top: 0; }

@media (min-width: 900px) {
  .ibtn, .menu-btn { display: none; }
  .ds-head { display: flex; }
  .dlinks { display: flex; margin-left: 4px; }
  .ds-head { margin-left: auto; }
  .dcta.btn { margin-left: 0; }
  .dlayout { grid-template-columns: var(--sw) minmax(0, 1fr); column-gap: 40px; padding-inline: 20px; }
  .dside { position: sticky; top: var(--hh); inset: auto; height: calc(100vh - var(--hh)); transform: none; visibility: visible; width: auto; border-right: 0; padding: 28px 8px 40px 0; align-self: start; background: none; transition: none; }
  .ds-side { display: none; }
  .scrim { display: none; }
  .dmain { padding-top: 40px; margin-inline: 0; }
}
@media (min-width: 1240px) {
  .dlayout { grid-template-columns: var(--sw) minmax(0, 1fr) var(--tw); column-gap: 48px; }
  .dtoc { display: block; padding-top: 44px; }
}
@media (max-width: 520px) {
  .dlayout { padding-inline: 16px; }
  .phead h1 { font-size: 1.9rem; }
  .pnav { grid-template-columns: minmax(0, 1fr); }
  .pn.next { grid-column: 1; }
  .docs-body .brand span { font-size: 1.02rem; }
}
.docs-body .footer .foot-grid { max-width: 1480px; }
