/* The title and summary use the same columns as the contents and article. The gap is
 * the home page's gutter, and the headings are style.css's one type scale. */
body {
  --frame-top: 0px;
  --reading-columns: clamp(13rem, 22vw, 21rem) minmax(0, 1fr);
  --reading-gap: clamp(24px, 3vw, 56px);
}

.prose { max-width: none; line-height: 1.6; }
.page-intro, .reading-layout, .docs-layout {
  display: grid;
  grid-template-columns: var(--reading-columns);
  column-gap: var(--reading-gap);
}
.page-intro {
  align-items: baseline;
  row-gap: 8px;
  margin: 0 0 clamp(16px, 1.8vw, 24px);
  padding-block: clamp(20px, 2.2vw, 34px);
  border-bottom: 1px solid var(--line);
}
.page-intro h1 {
  margin: 0;
  max-width: none;
  font: 400 var(--type-h1)/1.04 var(--serif);
  letter-spacing: -0.042em;
}
.page-intro .lead {
  max-width: 70ch;
  margin: 0;
  color: var(--ink-2);
  font-size: clamp(0.95rem, 1.05vw, 1.08rem);
  line-height: 1.5;
  text-wrap: pretty;
}
.reading-layout, .docs-layout, .pricing-layout { align-items: start; }
.page-intro > *, .reading-layout > *, .docs-layout > *, .pricing-layout > * { min-width: 0; }
.prose h2, .docs h2, .setup h2 {
  margin: 1.65rem 0 0.65rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: var(--type-h2);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.prose h3, .docs h3 { margin: 1.2rem 0 0.4rem; font-size: 1.08rem; }
.prose h4 { margin-top: 1rem; }
.prose :is(p, ol, ul, dl, .table-wrap) { margin-bottom: 0.8rem; }
.prose p, .docs p, .prose li, .prose dd { overflow-wrap: anywhere; }
.reading-body > p:not(.doc-meta), .reading-body > section > p,
.reading-body > :is(ul, ol):not(.clauses), .clauses li > p,
.clauses li > ol, .prose section > ol, .single-reading > :is(p, ul):not(.doc-meta),
.single-reading > section > p, .prose .facts dd { max-width: 78ch; }
.prose .facts > div { padding-block: 0.6rem; }
.prose .facts dd { margin: 0; }
.prose .doc-meta {
  gap: 4px 18px;
  margin: 0 0 1rem;
  padding: 0 0 0.75rem;
  border-top: 0;
  font-size: 0.85rem;
}
.reading-body > h2:first-child, .single-reading > .page-intro + h2,
.prose .price-catalog h2 { margin-top: 0; padding-top: 0; border: 0; }
.prose .steps { gap: 12px; margin-block: 1rem; }
.prose .steps > li { padding-left: 2.75rem; }
.prose .steps > li:not(:last-child)::after { bottom: -8px; }

/* A sticky contents list fits even a short window. */
.toc, .docs-side {
  position: sticky;
  top: 12px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
  scrollbar-width: thin;
  margin: 0;
  padding: 0 4px 0 0;
  border: 0;
  background: none;
  font-size: 0.9rem;
  line-height: 1.4;
}
.prose .toc-title, .docs-side .group {
  font: 500 0.82rem/1.5 var(--font);
  color: var(--ink-3);
  margin: 0 0 4px;
}
.prose .toc ol, .prose .toc ul { columns: auto; list-style: none; padding: 0; margin: 0; }
.prose .toc li + li { margin: 0; }
.toc a, .docs-side a { display: block; color: var(--ink-2); padding: 4px 0; text-decoration: none; }
.toc a:hover, .docs-side a:hover { color: var(--accent); background: none; text-decoration: underline; }
.docs-side .group:not(:first-child) { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }

.docs .reading-body { line-height: 1.6; container-type: inline-size; }
.docs .doc-section + .doc-section { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.docs h2 { margin: 0 0 12px; padding: 0; border: 0; }
.docs h3 { font-family: var(--font); font-weight: 550; font-size: 1rem; }
.docs p, .docs ol, .docs ul { margin: 0 0 0.8rem; }
.docs li + li { margin-top: 0.35rem; }
.docs .doc-label { color: var(--ink-3); font: 0.75rem/1.4 var(--mono); margin-bottom: 5px; }
.doc-split, .doc-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(16px, 2vw, 32px); align-items: start; }
.doc-split + .doc-split { margin-top: 20px; }
.doc-split > *, .doc-grid > * { min-width: 0; }
.doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.doc-card { padding-top: 12px; border-top: 1px solid var(--line-2); }
.doc-card > :first-child, .doc-split > div > :first-child { margin-top: 0; }
.doc-card > :last-child, .doc-split > div > :last-child { margin-bottom: 0; }
.doc-endpoint { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 7px 12px; margin-bottom: 14px; border-left: 2px solid var(--accent); background: var(--paper-2); }
.doc-method { color: var(--accent); font: 600 0.76rem var(--mono); }
.doc-code { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper-2); overflow: hidden; }
.doc-code + .doc-code, .doc-code + .table-wrap { margin-top: 12px; }
.doc-code-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); font: 0.75rem/1.4 var(--mono); color: var(--ink-3); }
.doc-code-head .btn { font-family: var(--font); }
.docs .doc-code pre { border: 0; border-radius: 0; margin: 0; padding: 12px; background: transparent; }
.docs .doc-code pre code { font-size: 0.82rem; }
.docs .table-wrap { font-size: 0.88rem; margin-bottom: 14px; }
.docs table { width: 100%; }
.docs th, .docs td { padding: 8px 10px; vertical-align: top; }
.docs td code { overflow-wrap: anywhere; }
.docs .doc-note { border-left: 2px solid var(--line-2); padding-left: 12px; color: var(--ink-2); font-size: 0.9rem; }
@container (max-width: 740px) {
  .doc-split, .doc-grid { grid-template-columns: minmax(0, 1fr); }
}

/* The plan table, setup commands and contact directory keep their full columns. */
.pricing-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--reading-gap); }
.price-catalog { position: sticky; top: 12px; margin: 0; }
.price-catalog .notice { padding: 12px; margin: 0; }
.pricing-layout .actions { margin-block: 1rem; }
.single-reading section > h3 { margin: 1.4rem 0 0.6rem; }
.setup .agent-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--reading-gap); }
.setup section { min-width: 0; }
.setup section > h2 { margin-top: 1.25rem; }
.setup .agent-options h2 { border: 0; padding: 0; margin-top: 0; }
.setup .copy-row { margin: 0 0 8px; }
.setup .field { max-width: 36rem; }
.setup .copy-row pre { max-height: 24rem; }
.setup #first-prompt { max-width: 78ch; }

@media (max-width: 759px) {
  .page-intro, .reading-layout, .docs-layout, .pricing-layout, .setup .agent-options { grid-template-columns: minmax(0, 1fr); }
  .reading-layout, .docs-layout, .pricing-layout { gap: 18px; }
  .setup .agent-options { gap: 10px; }
  .toc, .docs-side, .price-catalog { position: static; max-height: none; }
  .toc, .docs-side { margin: 0; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
  .prose .toc ol, .prose .toc ul { columns: 2 10rem; column-gap: 16px; }
  .prose .toc li { break-inside: avoid; }
  .docs-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 0 16px; }
  .docs-side .group { grid-column: 1 / -1; }
  .toc a, .docs-side a { padding-block: 6px; }
  .prose ol.clauses ol > li { padding-left: 2.6rem; }
}
@media print {
  .reading-layout, .docs-layout, .pricing-layout, .doc-split, .doc-grid { display: block; }
  .toc, .docs-side, .doc-code-head .btn { display: none; }
  .price-catalog { position: static; }
}
