/* Docs. Same paper, same window furniture, one column of prose and a rail. */
body.docs { background: var(--paper); }
.docs-frame { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

.docs-bar { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.docs-bar-in { display: flex; align-items: center; gap: 14px; padding: 18px 24px; }
.docs-tag { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.docs-bar-right { margin-left: auto; display: flex; gap: 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.docs-bar-right a:hover { text-decoration: underline; text-underline-offset: 4px; }
.docs-toc-toggle { display: none; margin-left: auto; padding: 8px 12px; font-size: 11px; }

.docs-shell { display: grid; grid-template-columns: 214px 1fr; gap: 56px; padding-top: 44px; padding-bottom: 110px; align-items: start; }

/* ---------- contents rail ---------- */
.toc { position: sticky; top: 92px; display: grid; gap: 2px; font-size: 12.5px; }
.toc a { color: var(--muted); padding: 3px 0 3px 12px; border-left: 1px solid var(--line); }
.toc a:hover { color: var(--ink); border-left-color: var(--ink); }
.toc a.on { color: var(--ink); border-left: 2px solid var(--blue); padding-left: 11px; }
.toc-head { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 16px 0 4px; }

/* ---------- prose ---------- */
.docs-body { max-width: 74ch; min-width: 0; }
.docs-body section { scroll-margin-top: 88px; padding-bottom: 8px; }
.docs-body section + section { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 44px; }

.docs-body h1 { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -0.02em; line-height: 1.1; }
.docs-body h2 { font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.01em; line-height: 1.2; }
.docs-body h3 { font-family: var(--display); font-weight: 700; font-size: .98rem; margin-top: 28px; }
.docs-body p { margin-top: 14px; font-size: 14.5px; line-height: 1.62; }
.docs-body p.lead { font-size: 16px; line-height: 1.6; margin-top: 18px; }
.docs-body b { font-weight: 700; }
.docs-body i { font-style: italic; }
.docs-body a[href^="/"], .docs-body a[href^="#"] { border-bottom: 1px solid var(--blue); }
.docs-body a[href^="/"]:hover, .docs-body a[href^="#"]:hover { background: var(--blue); }

.docs-body code {
  font-family: var(--body);
  font-size: .92em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  word-break: break-word;
}
.docs-body pre {
  margin-top: 18px;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.72;
}
.docs-body pre code { background: none; border: 0; padding: 0; font-size: inherit; word-break: normal; white-space: pre; }

/* numbered steps: the number is the only ornament */
.steps { counter-reset: step; margin-top: 18px; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding-left: 34px; font-size: 14.5px; line-height: 1.6; }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 1px 5px;
}

/* two-column reference tables, no zebra, no rounded anything */
table.api { width: 100%; border-collapse: collapse; margin-top: 18px; border: 1px solid var(--ink); }
table.api td { border-top: 1px solid var(--line); padding: 11px 14px; font-size: 13.5px; line-height: 1.55; vertical-align: top; }
table.api tr:first-child td { border-top: 0; }
table.api td:first-child { width: 34%; background: var(--paper-2); border-right: 1px solid var(--line); }
table.api td:first-child code { background: none; border: 0; padding: 0; font-size: 13px; }

.callout { margin-top: 20px; border: 2px solid var(--ink); border-left-width: 6px; background: var(--paper-2); padding: 14px 16px; }
.callout p { margin-top: 0; font-size: 13.5px; }
.callout p + p { margin-top: 10px; }

.docs-foot { border-top: 2px solid var(--ink); padding: 44px 0 64px; }
.docs-foot p { margin-top: 10px; font-size: 13px; color: var(--muted); max-width: 56ch; }

@media (max-width: 900px) {
  .docs-shell { grid-template-columns: 1fr; gap: 0; }
  .docs-bar-right { display: none; }
  .docs-toc-toggle { display: inline-flex; }
  .toc { position: static; display: none; border: 2px solid var(--ink); background: var(--paper-2); padding: 14px 16px; margin-bottom: 34px; }
  .toc.open { display: grid; }
  .docs-body { max-width: none; }
  table.api td:first-child { width: 40%; }
}
