/* Documentation layout and illustrations. Shared controls are in site.css. */

.docs { min-height: 100vh; background:
  radial-gradient(900px 420px at 15% -10%, rgba(124, 58, 237, 0.30), transparent 65%),
  radial-gradient(700px 360px at 90% 0%, rgba(16, 185, 129, 0.14), transparent 60%), var(--bg); }
.docs-hero { padding: 56px 0 24px; }
.docs-hero h1 { margin: 12px 0 16px; font-family: var(--font-heading); font-size: 56px; line-height: 1.06; letter-spacing: -0.03em; max-width: 820px; }
.docs-hero .lead { margin: 0; max-width: 680px; font-size: 18px; line-height: 1.6; color: var(--text-2); }
.docs-steps { padding-top: 48px; }
.docs-steps > h2, .docs-layout h2 { margin: 0 0 12px; font-family: var(--font-heading); font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; }
.section-lead { margin: 0 0 28px; color: var(--muted); font-size: 16px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; }
.step { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.step-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: 240px; padding: 24px; box-sizing: border-box; border-bottom: 1px solid var(--border);
  background: radial-gradient(420px 200px at 50% 110%, rgba(124, 58, 237, 0.28), transparent 70%), var(--surface-sunken); }
.step-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 26px; }
.step-num { margin: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.step h3 { margin: 0; font-family: var(--font-heading); font-size: 22px; font-weight: 600; }
/* Keep context defaults below component typography, regardless of source order. */
:where(.step p) { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.step code { font-family: var(--font-mono); color: var(--text); }
.caption { margin: 16px 0 0; color: var(--muted); font-size: 13px; }
.mock-window { width: 100%; max-width: 400px; border-radius: 10px; overflow: hidden; background: var(--surface); border: 1px solid rgba(255, 255, 255, 0.10); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); font-size: 12px; }
.mock-bar { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; background: var(--surface-raised); border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.mock-bar > span { width: 8px; height: 8px; border-radius: 50%; background: #3A3350; }
.mock-bar > span:nth-child(1) { background: #FF5F57; } .mock-bar > span:nth-child(2) { background: #FEBC2E; } .mock-bar > span:nth-child(3) { background: #28C840; }
.mock-bar em { flex: 1; text-align: center; font-style: normal; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mock-body { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.mock-body p { margin: 0; }
.mock-center { align-items: center; text-align: center; padding: 26px 14px; }
.mock-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.mock-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.06); font-family: var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; }
.mock-row.is-hot { color: var(--text); border-color: var(--accent); background: rgba(52, 211, 153, 0.08); box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.14); }
.mock-cursor { color: var(--accent); font-weight: 700; }
.mock-pair { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 460px; }
.mock-pair .mock-window { flex: 1; min-width: 0; }
.mock-file { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2); }
.file-icon { display: flex; align-items: flex-end; justify-content: center; width: 56px; height: 70px; padding-bottom: 10px; box-sizing: border-box; border-radius: 8px; background: linear-gradient(160deg, var(--bubble), var(--surface-input)); border: 1px solid rgba(255, 255, 255, 0.14); font-family: var(--font-mono); font-weight: 500; color: var(--accent); }
.mock-hint { padding: 2px 8px; border-radius: 999px; background: rgba(52, 211, 153, 0.14); color: var(--accent-text); font-family: var(--font-mono); }
.mock-arrow { color: var(--muted); font-size: 20px; }
.mock-title { color: var(--text); font-weight: 600; font-size: 13px; }
.mock-text { color: var(--muted); }
.mock-body .mock-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.mock-btn { padding: 6px 12px; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-weight: 600; }
.mock-btn-ghost { padding: 6px 12px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.14); color: var(--text-2); }
.mock-progress { width: 80%; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mock-progress span { display: block; width: 62%; height: 100%; border-radius: 999px; background: var(--accent); }
.mock-bubble { align-self: flex-end; max-width: 85%; padding: 8px 12px; border-radius: 12px 12px 4px 12px; background: var(--bubble); color: var(--text); line-height: 1.45; }
.mock-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.1); font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.mock-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.mock-lines { display: flex; flex-direction: column; gap: 6px; }
.mock-lines span { height: 8px; border-radius: 4px; background: rgba(196, 181, 253, 0.22); }
.mock-lines span:nth-child(2) { width: 85%; } .mock-lines span:nth-child(3) { width: 60%; }
.agent-install { padding-top: 56px; }
.docs-layout { container: docs-layout / inline-size; display: flex; flex-wrap: wrap; gap: 48px; padding-top: 72px; padding-bottom: 96px; }
.toc { flex: 1 1 220px; align-self: flex-start; position: static; top: 24px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.toc-title { margin: 0 0 8px 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.toc a { padding: 8px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.toc a[aria-current="location"] { color: var(--accent-text); background: rgba(52, 211, 153, 0.10); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.prose { flex: 999 1 600px; min-width: 0; max-width: 840px; }
.prose > section { padding-top: 40px; margin-top: 40px; border-top: 1px solid var(--border); }
.prose > section:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.prose h3 { margin: 28px 0 10px; font-family: var(--font-heading); font-size: 20px; font-weight: 600; }
.prose h3 small { margin-left: 6px; font-family: var(--font-mono); font-size: 13px; font-weight: 400; color: var(--muted); }
.prose h4, .prose .tool-head h3 { margin: 0; font-family: var(--font-heading); font-size: 17px; font-weight: 600; }
.prose p, .prose li { color: var(--text-2); font-size: 16px; line-height: 1.7; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose a { color: var(--accent-text); }
.prose code, .prose kbd { font-family: var(--font-mono); font-size: 0.88em; padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); color: var(--text); }
.prose .term code, .prose .term pre { padding: 10px 0; background: none; font-size: 13px; }
.prose .examples { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.prose .examples li { margin: 0; align-self: flex-start; max-width: 100%; padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--bubble); color: var(--text); }
.note { margin: 16px 0; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.06); }
.note.warn { border-color: rgba(250, 204, 21, 0.35); background: rgba(250, 204, 21, 0.06); }
.note p { margin: 0; }
.table-wrap { overflow-x: auto; margin: 12px 0; border-radius: 10px; border: 1px solid var(--border); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.prose th { padding: 8px 12px; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-raised); }
.prose td { padding: 10px 12px; border-top: 1px solid var(--table-border); vertical-align: top; color: var(--text-2); line-height: 1.55; }
.prose td code { white-space: nowrap; }
.req { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(52, 211, 153, 0.14); color: var(--accent-text); font-size: 11px; }
/* The badge belongs to its name: never wrap it under the name with a stray indent. */
.ref-name { white-space: nowrap; }
.group { margin-top: 28px; }
.group > p { color: var(--muted); }
.tool { margin: 14px 0; padding: 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.tool-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 8px; }
.tool-head code { font-size: 13px; }
.tool details summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--accent-text); font-size: 14px; font-weight: 600; }
.docs-footer { border-top: 1px solid var(--border); padding: 32px 0 48px; font-size: 13px; color: var(--muted); }
.docs-footer p { margin: 0 0 8px; }
/* Only pin the TOC while both flex bases and their gap fit beside each other. */
@container docs-layout (min-width: 868px) {
  .toc { position: sticky; max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior-y: contain; }
  /* Keep keyboard focus inside the scrollport, including its first and last links. */
  .toc a:focus-visible { outline-offset: -2px; }
}
@media (max-width: 720px) {
  .docs-hero h1 { font-size: 38px; }
  .docs-steps > h2, .docs-layout h2, .agent-card .agent-copy h2 { font-size: 32px; }
  .docs-hero, .docs-steps, .agent-install { padding-top: 96px; }
  .mock-arrow { display: none; }
  .mock-pair { flex-direction: column; }
  .mock-pair .mock-window { width: 100%; }
  /* Phones stack each reference row: name, badge and type on one line, the description under them.
     The header stays for screen readers. Chromium and Firefox keep the table semantics under flex
     rows; Safari may read them as plain text (WebKit bug 257458), and ARIA roles that would fix it
     are not valid on table rows and cells. */
  .ref-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .ref-table, .ref-table tbody { display: block; }
  .ref-table tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; border-top: 1px solid var(--table-border); }
  .ref-table tbody tr:first-child { border-top: 0; }
  .prose .ref-table td { padding: 0; border-top: 0; }
  .ref-table .ref-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; white-space: normal; }
  .prose .ref-table .ref-name code { white-space: normal; overflow-wrap: break-word; }
  .ref-table .req { margin-left: 0; }
  .ref-table .ref-type { color: var(--muted); font-size: 13px; }
  .ref-table .ref-desc { flex-basis: 100%; }
}

.tool-head .tool-identifier { color: var(--theme); }
