/* ═══════════════════════════════════════════════════════════════════════════
   Octet docs — layout + prose, built on octet.css tokens.
   The docs render inside the marketing shell (.masthead / .footer from octet.css);
   this file only adds the docs body: sidebar, content typography, code, callouts,
   tabs, on-page contents. Same paper ground, same type scale as the site.
   ═══════════════════════════════════════════════════════════════════════════ */

/* octet.css sets html,body{height:100%;background:#000} and only repaints the html
   background to paper for body.page. Docs use body.docs-body, so without this the
   paper only covers the first 100vh and everything below renders on the black html
   element. Paint html paper (this stylesheet is docs-only) and let the body grow. */
html { background: var(--paper); }
.docs-body { background: var(--paper); color: var(--paper-ink); min-height: 100vh; height: auto; }

/* ── 3-column shell: sidebar · content · on-this-page ───────────────────────── */
.docs-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 212px;
  gap: 52px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 44px 44px 96px;
  align-items: start;
}

/* ── Left sidebar ───────────────────────────────────────────────────────────── */
.docs-sidebar { position: sticky; top: 28px; max-height: calc(100vh - 56px); overflow-y: auto; }
.docs-nav { font-family: var(--body); }
.docs-nav-cat {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a8478;
  margin: 26px 0 10px;
}
.docs-nav-cat:first-child { margin-top: 0; }
.docs-nav ul { list-style: none; margin: 0 0 4px; padding: 0; }
.docs-nav li { margin: 0; }
.docs-nav a {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  color: #4a463e;
  text-decoration: none;
  padding: 6px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.docs-nav a:hover { color: #111; background: rgba(13, 13, 12, 0.04); }
.docs-nav a.active {
  color: #111;
  font-weight: 500;
  border-left-color: #0d0d0c;
  background: rgba(13, 13, 12, 0.05);
}

/* ── SDK switcher — jump between the Mobile and Browser doc sets ────────────── */
.docs-sdk-switch {
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
  padding: 3px;
  border: 1px solid rgba(13, 13, 12, 0.12);
  border-radius: 6px;
}
.docs-sdk-switch a {
  flex: 1;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6b665c;
  text-decoration: none;
  padding: 6px 4px;
  border-radius: 4px;
  transition: color .12s ease, background .12s ease;
}
.docs-sdk-switch a:hover { color: #111; background: rgba(13, 13, 12, 0.04); }
.docs-sdk-switch a.active {
  color: #111;
  font-weight: 500;
  background: rgba(160, 184, 10, 0.12);
}

/* ── Version selector — Mobile SDK docs (major.minor) ──────────────────────── */
.docs-version { margin: 0 0 18px; }
.docs-version-label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a8478;
  margin: 0 0 6px;
}
.docs-version-select {
  width: 100%;
  font-family: var(--mono);
  font-size: 12px;
  color: #111;
  background: #fff;
  border: 1px solid rgba(13, 13, 12, 0.18);
  border-radius: 6px;
  padding: 7px 28px 7px 10px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b665c' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.docs-version-select:hover { border-color: rgba(13, 13, 12, 0.35); }
.docs-version-select:focus { outline: none; border-color: var(--forest-a, #a0b80a); }

/* ── Old-version banner ─────────────────────────────────────────────────────── */
.docs-oldver {
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.45;
  color: #5a4a00;
  background: rgba(160, 184, 10, 0.10);
  border: 1px solid rgba(160, 184, 10, 0.35);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 0 0 22px;
}
.docs-oldver a { color: #111; font-weight: 500; }

/* ── Deprecated-version banner (security warning; stronger than .docs-oldver) ── */
.docs-deprecated {
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.45;
  color: #7a1f12;
  background: rgba(224, 99, 47, 0.10);
  border: 1px solid rgba(224, 99, 47, 0.45);
  border-left: 3px solid #e0632f;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 0 0 22px;
}
.docs-deprecated strong { color: #7a1f12; }
.docs-deprecated a { color: #111; font-weight: 600; text-decoration: underline; }

/* ── Main content ───────────────────────────────────────────────────────────── */
.docs-main { min-width: 0; }
.docs-ident {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, 0.55);
  margin: 0 0 22px;
}
.docs-ident a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.docs-ident a:hover { border-bottom-color: currentColor; }
.docs-ident .sep { color: rgba(13, 13, 12, 0.22); }
.docs-ident .here { color: var(--paper-ink); }

.docs-article { font-family: var(--body); font-size: 16px; line-height: 1.72; color: #1d1d1b; }
.docs-article > *:first-child { margin-top: 0; }

.docs-article h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  color: #111;
}
.docs-article h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.12;
  letter-spacing: -0.018em;
  margin: 52px 0 16px;
  padding-top: 14px;
  border-top: 1px solid var(--paper-rule);
  color: #111;
}
.docs-article h3 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.3;
  margin: 34px 0 12px;
  color: #111;
}
.docs-article h4 {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5b574e;
  margin: 28px 0 10px;
}
.docs-article p { margin: 0 0 18px; }
.docs-article a { color: #2f6a86; text-decoration: none; border-bottom: 1px solid rgba(47, 106, 134, 0.3); }
.docs-article a:hover { border-bottom-color: #2f6a86; }
.docs-article ul, .docs-article ol { margin: 0 0 18px; padding-left: 24px; }
.docs-article li { margin: 0 0 8px; }
.docs-article strong { font-weight: 600; color: #111; }
.docs-article hr { border: none; border-top: 1px solid var(--paper-rule); margin: 40px 0; }
.docs-article blockquote {
  margin: 0 0 18px;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--paper-rule);
  color: #5b574e;
}

/* Anchor offset so in-page links don't hide under nothing (no fixed header here,
   but keep a little breathing room). */
.docs-article :is(h1, h2, h3, h4)[id] { scroll-margin-top: 24px; }

/* ── Inline code + code blocks ──────────────────────────────────────────────── */
.docs-article code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(13, 13, 12, 0.06);
  padding: 0.12em 0.4em;
  border-radius: 3px;
}
.docs-article pre {
  background: var(--bg-stage, #0a0a0a);
  border-radius: 6px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid rgba(13, 13, 12, 0.12);
}
.docs-article pre code {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  background: none;
  padding: 0;
  color: #d8d3c8;
}

/* ── Tables ─────────────────────────────────────────────────────────────────── */
.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 14.5px;
}
.docs-article th, .docs-article td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--paper-rule);
  vertical-align: top;
}
.docs-article th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5b574e;
}

/* ── Callouts (admonitions) ─────────────────────────────────────────────────── */
.callout {
  position: relative;
  margin: 0 0 22px;
  padding: 16px 20px 16px 22px;
  border-radius: 5px;
  background: #faf8f3;
  border: 1px solid var(--paper-rule);
}
.callout::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(180deg, #7fb8d4, #3f8fbd);  /* note (default): single-family Octet blue — calm, crisp, on-brand */
}
.callout-note::before    { background: linear-gradient(180deg, #7fb8d4, #3f8fbd); }  /* blue — informational */
.callout-tip::before     { background: linear-gradient(180deg, #b6c93a, #7a9004); }  /* olive — positive */
.callout-caution::before { background: linear-gradient(180deg, #f0a24a, #e0632f); }  /* amber-coral — heads-up */
.callout-warning::before { background: linear-gradient(180deg, #e18ea3, #cf2f1e); }  /* bloom — strongest */
/* not yet shipped: dashed rail borrows the drafting convention for "declared, not built" */
.callout-building::before {
  background: repeating-linear-gradient(180deg, #645139 0 5px, transparent 5px 9px);
}
.callout-building { background: #f7f5ef; border-style: dashed; }

/* inline status badge — for headings, sidebar entries, and prose */
.badge-building {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
  color: #5b574e; border: 1px dashed rgba(13,13,12,.34); border-radius: 4px;
  padding: 3px 7px; vertical-align: 2px; margin-left: 8px; white-space: nowrap;
}
.badge-building::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: #645139; opacity: .85;
}
.callout-title {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5b574e;
  margin: 0 0 6px;
}
.callout-body > *:last-child { margin-bottom: 0; }
.callout-body p { margin: 0 0 10px; }

/* ── Tabs (MDX <Tabs>/<TabItem>) ────────────────────────────────────────────── */
.doc-tabs { margin: 0 0 22px; }
.doc-tablist {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--paper-rule);
  margin-bottom: 0;
}
.doc-tab {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8478;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 9px 14px;
  cursor: pointer;
  margin-bottom: -1px;
}
.doc-tab:hover { color: #111; }
.doc-tab.active { color: #111; border-bottom-color: #111; }
.doc-tabpanel { display: none; padding-top: 16px; }
.doc-tabpanel.active { display: block; }
.doc-tabpanel > *:last-child { margin-bottom: 0; }

/* ── Mermaid ────────────────────────────────────────────────────────────────── */
.docs-article pre.mermaid {
  background: #faf8f3;
  border: 1px solid var(--paper-rule);
  text-align: center;
  color: inherit;
}

/* ── Prev / next ────────────────────────────────────────────────────────────── */
.docs-prevnext {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--paper-rule);
}
.pn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  padding: 14px 18px;
  border: 1px solid var(--paper-rule);
  border-radius: 5px;
  min-width: 0;
  max-width: 48%;
}
.pn:hover { border-color: rgba(13, 13, 12, 0.3); }
.pn.next { text-align: right; margin-left: auto; }
.pn-k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: #8a8478; }
.pn-t { font-family: var(--body); font-size: 15px; color: #111; }

/* ── On-this-page (right rail) ──────────────────────────────────────────────── */
.docs-toc { position: sticky; top: 28px; max-height: calc(100vh - 56px); overflow-y: auto; }
.docs-toc-h {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8a8478;
  margin: 0 0 12px;
}
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--paper-rule); }
.docs-toc li { margin: 0; }
.docs-toc a {
  display: block;
  font-family: var(--body);
  font-size: 12.5px;
  line-height: 1.4;
  color: #6f6a60;
  text-decoration: none;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
}
.docs-toc a:hover { color: #111; border-left-color: #111; }
.docs-toc li.lvl3 a { padding-left: 26px; font-size: 12px; }

/* ── Mobile menu button ─────────────────────────────────────────────────────── */
.docs-menu-btn {
  display: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: #111;
  color: var(--paper);
  border: none;
  border-radius: 4px;
  padding: 9px 14px;
  cursor: pointer;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1120px) {
  .docs-shell { grid-template-columns: 230px minmax(0, 1fr); gap: 40px; }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  .docs-shell { grid-template-columns: 1fr; gap: 0; padding: 24px 20px 72px; }
  .docs-menu-btn { display: inline-block; margin-bottom: 18px; }
  .docs-sidebar {
    position: static;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    transition: max-height .2s ease;
  }
  .docs-sidebar.open { max-height: 2000px; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--paper-rule); }
  .pn { max-width: 49%; }
  /* wide tables scroll horizontally instead of breaking the layout on phones */
  .docs-article table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .docs-article h1 { font-size: clamp(28px, 8vw, 38px); }
}

/* Get-a-key CTA in the docs masthead nav */
.masthead nav a.nav-cta {
  background: var(--paper-ink);
  color: var(--paper);
  padding: 7px 15px;
  border-radius: 3px;
  border-bottom: none !important;
}
.masthead nav a.nav-cta:hover {
  background: #000;
  color: var(--paper);
  border-bottom: none !important;
}

/* Mobile: the masthead nav scrolls horizontally (octet.css), which would push the
   CTA off the right edge. Pull it to the front so "Get a license key" is the first,
   always-visible nav item on phones. */
@media (max-width: 768px) {
  .masthead nav a.nav-cta { order: -1; margin-right: 4px; }
}


/* ── Docs search (Pagefind): fit the sidebar, calm the defaults ─────────────── */
#docs-search, #docs-search * { box-sizing: border-box; }
#docs-search .pagefind-ui__form,
#docs-search .pagefind-ui__search-input { width: 100%; max-width: 100%; }
/* no bold text while typing; Octet surface gradient border (rounded), soft brand focus glow */
#docs-search .pagefind-ui__search-input {
  font-weight: 400;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background: linear-gradient(#f1ece3, #f1ece3) padding-box,
              linear-gradient(120deg, #645139 0%, #5ca6cd 100%) border-box;
}
#docs-search .pagefind-ui__search-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(92, 166, 205, 0.25); }
#docs-search .pagefind-ui__search-clear { font-weight: 400; }
/* keep results within the column, no horizontal overflow / cut-off buttons */
#docs-search .pagefind-ui__results, #docs-search .pagefind-ui__result { max-width: 100%; overflow-wrap: anywhere; }

/* page actions — copy page as markdown, view raw .md, hand to an assistant */
.docs-actions{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 22px}
.docs-actions .docs-act{font-family:var(--mono,ui-monospace,monospace);font-size:11px;letter-spacing:.04em;color:#5b574e;text-decoration:none;border:1px solid transparent;border-radius:5px;padding:6px 12px;cursor:pointer;line-height:1;background:linear-gradient(#f1ece3,#f1ece3) padding-box,linear-gradient(180deg,#645139 0%,#5ca6cd 100%) border-box;transition:color .15s,filter .15s}
.docs-actions .docs-act:hover{color:#111;filter:brightness(.98)}
