/* missionarylane.org/docs: the documentation layout on the marketing identity (site.css supplies tokens, type and the header).
   Sidebar (groups pinned like a missions board) · article · "On this page". Light and dark; print. */
body.docs {
  --code-bg: #fff;
  --pre-bg: #17325C;
  --pre-text: #E6EDF7;
  --hover: var(--pin-deep);
  --mark: #FCE7A6;
  --side-w: 270px;
  --toc-w: 220px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) body.docs {
    --ink: #E8EEF7; --paper: #0E1828; --card: #16233A; --text: #CDD6E3; --muted: #9DABBE; --line: #2A3B57;
    --code-bg: #1B2A44; --pre-bg: #0A1220; --hover: #FF9B8F; --mark: #6B5414; color-scheme: dark;
  }
}
html[data-theme="dark"] body.docs {
  --ink: #E8EEF7; --paper: #0E1828; --card: #16233A; --text: #CDD6E3; --muted: #9DABBE; --line: #2A3B57;
  --code-bg: #1B2A44; --pre-bg: #0A1220; --hover: #FF9B8F; --mark: #6B5414; color-scheme: dark;
}
body.docs { background: var(--paper); color: var(--text); }
body.docs a:hover { color: var(--hover); }
body.docs code { background: var(--code-bg); color: var(--ink); }
body.docs .top { max-width: none; border-bottom: 1px solid var(--line); }
.top nav a[aria-current="page"] { color: var(--pin); }

/* ---------- shell ---------- */
.docs-shell { max-width: 1440px; margin: 0 auto; padding: 0 var(--gut); display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); gap: 0 clamp(24px, 3vw, 48px); }
@media (max-width: 1180px) { .docs-shell { grid-template-columns: var(--side-w) minmax(0, 1fr); } .docs-toc { display: none; } }
@media (max-width: 900px) { .docs-shell { grid-template-columns: minmax(0, 1fr); } }

/* ---------- sidebar ---------- */
.docs-side { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 24px 6px 40px 0; scrollbar-width: thin; }
@media (max-width: 900px) { .docs-side { position: static; max-height: none; overflow: visible; padding: 16px 0 0; } }
.docs-search { position: relative; margin-bottom: 18px; }
.docs-search label { display: block; font: 600 .78rem/1.2 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.docs-search input { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 400 .95rem/1.3 var(--display); }
.docs-search input:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.docs-search kbd { position: absolute; right: 10px; top: 33px; font: 500 .75rem/1 var(--display); color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; pointer-events: none; }
.docs-search input:focus ~ kbd, .docs-search input:not(:placeholder-shown) ~ kbd { display: none; }
@media (hover: none) { .docs-search kbd { display: none; } }
.search-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(10,20,40,.22); max-height: min(70vh, 520px); overflow-y: auto; padding: 6px; }
@media (max-width: 900px) { .search-results { position: static; box-shadow: none; } }
.search-results[hidden] { display: none; }
.search-results ul { list-style: none; margin: 0; padding: 0; }
.search-results a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
.search-results a:hover, .search-results a:focus-visible, .search-results a[aria-selected="true"] { background: var(--paper); outline-offset: -2px; }
.search-results b { display: block; font: 650 .95rem/1.3 var(--display); color: var(--ink); }
.search-results small { display: block; font: 500 .74rem/1.3 var(--display); color: var(--muted); margin-bottom: 2px; letter-spacing: .02em; }
.search-results span { display: block; font-size: .86rem; line-height: 1.45; color: var(--muted); margin-top: 2px; }
.search-results mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-results .empty { padding: 10px 12px; font-size: .9rem; color: var(--muted); }

.nav-toggle { display: none; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--card); color: var(--ink); font: 600 1rem/1.2 var(--display); cursor: pointer; text-align: left; }
  .nav-toggle::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
  .nav-toggle[aria-expanded="true"]::after { transform: rotate(-135deg) translateY(-2px); }
  html.js .docs-nav:not(.open) { display: none; }
  html.js .docs-nav:not(.open) + .theme-switch { display: none; }
  .theme-switch { margin: 10px 0 0; }
  .docs-nav { margin-top: 8px; padding: 6px 14px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
}
.docs-nav h2 { display: flex; align-items: center; gap: 8px; font: 700 .8rem/1.2 var(--display); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 22px 0 6px; }
.docs-nav h2::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--pin));
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.18); }
.docs-nav section:first-child h2 { margin-top: 6px; }
.docs-nav ul { list-style: none; margin: 0; padding: 0 0 0 4px; border-left: 2px solid var(--line); }
.docs-nav a { display: block; padding: 7px 10px 7px 14px; margin-left: -2px; border-left: 2px solid transparent; font: 500 .93rem/1.35 var(--display); color: var(--text); text-decoration: none; }
.docs-nav a:hover { color: var(--ink); border-left-color: var(--muted); }
.docs-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; border-left-color: var(--pin); }
.theme-switch { margin-top: 26px; display: flex; align-items: center; gap: 8px; font: 500 .85rem/1.2 var(--display); color: var(--muted); }
.theme-switch button { min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 500 .85rem/1 var(--display); cursor: pointer; }
.theme-switch button[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); font-weight: 650; }
html:not(.js) .theme-switch { display: none; }

/* ---------- article ---------- */
.docs-main { min-width: 0; padding: clamp(20px, 3vw, 40px) 0 64px; }
.doc { max-width: 46rem; }
.doc .kicker { font: 650 .82rem/1.2 var(--display); letter-spacing: .07em; text-transform: uppercase; color: var(--pin); margin: 0 0 .7em; }
.doc h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); line-height: 1.04; margin-bottom: .45em; }
.doc h2 { font-size: clamp(1.4rem, 2.8vw, 1.8rem); margin: 2.1em 0 .5em; padding-top: .9em; border-top: 2px solid var(--line); scroll-margin-top: 16px; }
.doc h3 { font-size: 1.12rem; margin: 1.7em 0 .4em; scroll-margin-top: 16px; }
.doc h2 a.anchor, .doc h3 a.anchor { margin-left: .35em; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.doc h2:hover a.anchor, .doc h3:hover a.anchor, .doc a.anchor:focus-visible { opacity: 1; }
.doc .lede { font-size: 1.12rem; color: var(--text); }
.doc p, .doc li { max-width: 40em; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.doc li { margin: .35em 0; }
.doc li::marker { color: var(--pin); font-family: var(--display); font-weight: 700; }
.doc strong { color: var(--ink); }
.doc img { max-width: 100%; height: auto; }
.doc figure { margin: 1.4em 0 1.6em; }
.doc figure img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.doc figure.phone img { max-width: 300px; }
.doc figcaption { margin-top: 8px; font: 400 .86rem/1.45 var(--display); color: var(--muted); }
.doc .figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.doc .figs figure { margin: 0; }
.doc pre { background: var(--pre-bg); color: var(--pre-text); padding: 14px 16px; border-radius: 12px; overflow-x: auto; font: 400 .84rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 0 0 1.3em; max-width: 100%; }
.doc pre code { background: none; border: 0; padding: 0; color: inherit; font: inherit; overflow-wrap: normal; }
.doc kbd { font: 500 .85em/1 var(--display); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: .1em .4em; background: var(--card); }
.code-wrap { position: relative; }
.copy-btn { position: absolute; top: 8px; right: 8px; min-height: 32px; padding: 4px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff;
  font: 500 .78rem/1 var(--display); cursor: pointer; }
.copy-btn:hover { background: rgba(255,255,255,.18); }

.table-wrap { overflow-x: auto; margin: .8rem 0 1.4rem; -webkit-overflow-scrolling: touch; }
.doc table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.45; background: var(--card); border-radius: 12px; overflow: hidden; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc thead th { font: 650 .88rem/1.3 var(--display); color: var(--ink); background: color-mix(in srgb, var(--card) 85%, var(--line)); }
.doc tbody th { font: 650 .92rem/1.35 var(--display); color: var(--ink); }
.doc tr:last-child > * { border-bottom: 0; }
.doc td.num, .doc th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.note { border-left: 4px solid var(--gold); background: var(--card); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 1.2em 0; max-width: 40em; }
.note.warn { border-left-color: var(--pin); }
.note.ok { border-left-color: var(--field); }
.note p { margin: 0; }
.note p + p, .note ul { margin-top: .6em; }
.note > b:first-child { font-family: var(--display); color: var(--ink); }
.badge { display: inline-block; vertical-align: .12em; font: 700 .68rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--gold) 26%, transparent); color: var(--ink); border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); white-space: nowrap; }
.badge.beta { background: color-mix(in srgb, var(--field) 20%, transparent); border-color: color-mix(in srgb, var(--field) 55%, transparent); }
.label-chip { display: inline-block; font: 650 .8rem/1 var(--display); padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); white-space: nowrap; }
.label-chip.traced { border-color: var(--field); }
.label-chip.estimated { border-color: var(--gold); border-style: dashed; }
.label-chip.pledge { border-color: var(--muted); border-style: dotted; }

/* Cards that point to other pages (overview, section starts) */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 14px; margin: 1.2rem 0 1.6rem; max-width: 52rem; }
.cards a { display: block; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--pin)); border-radius: 4px 14px 14px 4px; padding: 14px 16px; text-decoration: none; color: var(--text); }
.cards a:hover { border-color: var(--ink); border-left-color: var(--c, var(--pin)); color: var(--text); }
.cards b { display: block; font: 650 1.02rem/1.25 var(--display); color: var(--ink); margin-bottom: .25em; }
.cards span { display: block; font-size: .9rem; line-height: 1.5; color: var(--muted); }

/* Giving: the worked tracing example */
.trace { margin: 1.4rem 0 1.6rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 28px; max-width: 46rem; }
@media (max-width: 640px) { .trace { grid-template-columns: minmax(0, 1fr); } }
.trace h3 { margin: 0 0 6px; font-size: .82rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.trace ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.trace li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; max-width: none; margin: 0; }
.trace li b { font: 650 1rem/1.3 var(--display); color: var(--ink); }
.trace li .amt { float: right; font: 700 1rem/1.3 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.trace li small { display: block; font: 400 .86rem/1.45 var(--display); color: var(--muted); }
.trace li.waiting { border-style: dashed; }
.trace .to { display: block; margin-top: 6px; font: 500 .85rem/1.4 var(--display); color: var(--text); }
.trace .to i { font-style: normal; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: .05em; }

/* ---------- pager ---------- */
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 56px; max-width: 46rem; }
@media (max-width: 560px) { .pager { grid-template-columns: minmax(0, 1fr); } }
.pager a { display: block; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; text-decoration: none; background: var(--card); color: var(--text); }
.pager a:hover { border-color: var(--ink); color: var(--text); }
.pager a.next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .pager a.next { grid-column: 1; } }
.pager small { display: block; font: 500 .78rem/1.3 var(--display); color: var(--muted); letter-spacing: .03em; }
.pager b { display: block; font: 650 1rem/1.3 var(--display); color: var(--ink); }

/* ---------- on this page ---------- */
.docs-toc { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 40px 0; }
.docs-toc h2 { font: 700 .78rem/1.2 var(--display); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.docs-toc a { display: block; padding: 5px 0 5px 12px; margin-left: -2px; border-left: 2px solid transparent; font: 500 .86rem/1.35 var(--display); color: var(--muted); text-decoration: none; }
.docs-toc a:hover { color: var(--ink); }
.docs-toc a.active { color: var(--ink); border-left-color: var(--gold); }
.toc-inline { display: none; margin: 0 0 1.4rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card); max-width: 46rem; }
@media (max-width: 1180px) { .toc-inline { display: block; } }
.toc-inline summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 14px; font: 600 .95rem/1.2 var(--display); color: var(--ink); }
.toc-inline ul { margin: 0; padding: 0 14px 12px 32px; }
.toc-inline li { margin: .25em 0; font: 500 .92rem/1.4 var(--display); }

/* ---------- API and MCP reference (rendered by docs.js) ---------- */
.ref-loading { color: var(--muted); }
.ref-index { columns: 2 16rem; column-gap: 24px; padding-left: 0; list-style: none; }
.ref-index li { break-inside: avoid; margin: .2em 0; }
.ref-index a { text-decoration: none; font: 500 .9rem/1.4 var(--display); }
.op { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 16px 18px; margin: 16px 0 22px; max-width: 46rem; }
.op h4 { margin: 0 0 .4em; font: 650 1.02rem/1.35 var(--display); color: var(--ink); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; scroll-margin-top: 16px; }
.op h4 code { font-size: .92rem; background: none; border: 0; padding: 0; overflow-wrap: anywhere; }
.op .summary { margin: 0 0 .6em; }
.op h5 { margin: 1em 0 .4em; font: 650 .82rem/1.2 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.op pre { margin-bottom: .8em; }
.op table { font-size: .86rem; }
.method { display: inline-block; min-width: 3.6em; text-align: center; font: 700 .74rem/1 var(--display); letter-spacing: .05em; padding: 5px 7px; border-radius: 6px; color: #fff; background: var(--ink); }
body.docs .method { background: #17325C; }
.method.get { background: #2F7A52; } .method.post { background: #1D5FA8; } .method.put, .method.patch { background: #9A6410; } .method.delete { background: #B8302A; }
.scope { display: inline-block; font: 500 .78rem/1 ui-monospace, Menlo, monospace; padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); margin: 0 4px 4px 0; }
.req { color: var(--pin); font: 600 .78rem/1 var(--display); }

/* ---------- footer ---------- */
body.docs .foot { max-width: 1440px; }

/* ---------- print ---------- */
@media print {
  body.docs { --paper: #fff; --card: #fff; --ink: #000; --text: #111; --muted: #444; --line: #bbb; --pre-bg: #f3f3f3; --pre-text: #111; --code-bg: #f3f3f3; }
  .top nav, .docs-side, .docs-toc, .toc-inline, .pager, .skip, .copy-btn, .foot nav, .theme-switch, a.anchor { display: none !important; }
  .docs-shell { display: block; padding: 0; }
  .docs-main { padding: 0; }
  .doc { max-width: none; }
  .doc h2, .doc h3 { break-after: avoid; }
  .doc figure, .doc pre, .doc table, .note, .op { break-inside: avoid; }
  .doc a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; color: #444; overflow-wrap: anywhere; }
  .doc pre { white-space: pre-wrap; }
}
