/* Cnamio reading pages (docs, quickstart, providers, security, agents, legal). Builds on site.css (same tokens);
   only the reading layout lives here. */
.docs { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 56px; padding-top: 56px; padding-bottom: 96px; }
.toc { position: sticky; top: 24px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.toc a { text-decoration: none; color: var(--ink-2); padding: 6px 12px; border-radius: var(--r-pill); }
.toc a:hover { color: var(--ink); background: var(--sunken); }
.toc a:focus-visible { outline-offset: -2px; border-radius: var(--r-pill); }
.toc-label { margin: 16px 0 4px; padding: 0 12px; font: 500 11.5px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.toc-label:first-child { margin-top: 0; }
.toc a[aria-current="true"] { color: var(--accent-strong); background: var(--accent-soft); font-weight: 600; }
.toc .toc-out::after { content: "\2192"; margin-left: 6px; color: var(--ink-3); }

.prose { max-width: 760px; min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: clamp(32px, 3.9vw, 44px); line-height: 1.06; letter-spacing: -0.035em; margin-bottom: 16px; scroll-margin-top: 24px; }
.prose h2 { font-size: 26px; line-height: 1.2; letter-spacing: -0.025em; margin: 56px 0 12px; scroll-margin-top: 24px; }
.prose h3 { font-size: 19px; line-height: 1.3; font-weight: 600; margin: 32px 0 8px; letter-spacing: -0.015em; scroll-margin-top: 24px; }
/* Running text stays under about 70 characters a line; code, tables and cards may use the full column. */
.prose p, .prose li { max-width: 36em; }
.prose p { margin: 0 0 14px; color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent-strong); text-underline-offset: 3px; }
.prose ul { margin: 0 0 14px; padding-left: 20px; color: var(--ink-2); }
.prose ol { margin: 0 0 14px; padding-left: 22px; color: var(--ink-2); }
.prose ol li::marker { font: 500 13px var(--mono); color: var(--accent-strong); }
.prose li { margin-bottom: 8px; }
.prose .intro { font-size: 18px; line-height: 1.55; }
.step-n { margin-right: 10px; font: 500 13px var(--mono); color: var(--accent-strong); vertical-align: 3px; letter-spacing: .06em; }
.updated, .prose .updated { font-size: 14px; color: var(--ink-3); }

/* Inline values are record chips; blocks are surfaces with a hairline. */
.prose code { font: 0.84em var(--mono); background: var(--sunken); box-shadow: inset 0 0 0 1px var(--line); border-radius: 6px; padding: 2px 6px; color: var(--ink); overflow-wrap: break-word; }
@media (prefers-color-scheme: dark) { .prose code { background: var(--surface); } .callout code { background: var(--sunken); } }
.prose pre { margin: 16px 0 20px; padding: 18px 20px; background: var(--surface); color: var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-card); font: 13px/1.7 var(--mono); overflow-x: auto; }
.prose pre code { font: inherit; background: none; box-shadow: none; padding: 0; color: inherit; overflow-wrap: normal; }
.prose pre.wrap { max-width: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.codeblock { position: relative; }
.codeblock pre { padding-top: 48px; }
.copy-btn { position: absolute; top: 9px; right: 9px; height: 30px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-strong);
  font: 600 12.5px/1 var(--font); cursor: pointer; }
.copy-btn:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.copy-btn.done { background: var(--accent); color: var(--accent-ink); }
.prose .code { margin: 16px 0 20px; }
.prose .code pre { margin: 0; border-radius: 0; background: transparent; box-shadow: none; }

.table-wrap { margin: 16px 0 20px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th { text-align: left; font: 500 12px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); background: var(--sunken); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.prose td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { white-space: nowrap; }
.prose td:first-child code { overflow-wrap: normal; }
.help { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }

.callout { margin: 20px 0; padding: 16px 20px; border-radius: var(--r-md); background: var(--accent-soft); }
.callout p { color: var(--ink); }
.callout p:last-child { margin-bottom: 0; }
.callout code { background: var(--surface); }

.prov { margin: 16px 0; padding: 24px; border-radius: var(--r-lg); background: var(--mist); }
.prov h3 { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.prov > :last-child { margin-bottom: 0; }
.badge { padding: 4px 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-strong); font: 500 11.5px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.badge-soft { background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.prose .chips { padding: 0; margin: 14px 0 18px; }
.prose .chips li { margin: 0; }

.next { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.prose .next a { display: block; padding: 20px 24px; border-radius: var(--r-lg); background: var(--mist); color: var(--ink); text-decoration: none; font-weight: 600; transition: box-shadow .15s; }
.prose .next a:hover { box-shadow: inset 0 0 0 1px var(--control-line); }
.next a span { display: block; margin-bottom: 6px; font: 500 12px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent-strong); }

@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 28px; padding-bottom: 72px; }
  /* The index becomes one row of pills that scrolls sideways instead of a cloud of chips above the text. */
  .toc { position: static; max-height: none; flex-direction: row; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -32px; padding: 2px 32px; }
  .toc::-webkit-scrollbar { display: none; }
  .toc a { flex: none; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line-2); }
  .toc-label { display: none; }
  /* Legal pages: short sections read in order; the index would only push the title down. */
  .legal .toc { display: none; }
  .prose h2 { font-size: 23px; margin-top: 44px; }
}
@media (max-width: 640px) {
  .toc { margin: 0 -16px; padding: 2px 16px; }
  .next { grid-template-columns: minmax(0, 1fr); }
  .prov { padding: 20px; }
  /* Endpoint tables become stacked rows: the path on its own line, the description under it. */
  .prose thead { display: none; }
  .prose table, .prose tbody, .prose tr, .prose td { display: block; }
  .prose tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .prose tr:last-child { border-bottom: 0; }
  .prose td { padding: 0; border: 0; }
  .prose td:first-child { white-space: normal; margin-bottom: 6px; }
  .prose td:first-child code { overflow-wrap: anywhere; }
  .prose pre { font-size: 12px; }
}
