@layer components {
  .docs-foot p {
    max-width: 72ch;
  }


/* /docs/conventions — layout and prose. Depends on the tokens and nav in site.css. */

.nav-links-always {
  display: flex;
  gap: 0;
}

.nav-links-always a[aria-current="page"] {
  color: var(--color-fg);
}

@media (max-width: 640px) {
  .nav-wide {
    display: none !important;
  }
}

.docs-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 96px;
}

@media (min-width: 960px) {
  .docs-shell {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 56px;
    padding-top: 48px;
  }
}

/* ---------------------------------------------------------------- sidebar */

.docs-toc {
  display: none;
}

.docs-toc-mobile {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
}

.docs-toc-mobile summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  color: var(--color-fg);
}

.docs-toc-mobile summary::-webkit-details-marker {
  display: none;
}

.docs-toc-mobile summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-right: 1.5px solid var(--color-muted);
  border-bottom: 1.5px solid var(--color-muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}

.docs-toc-mobile[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

@media (min-width: 960px) {
  .docs-toc {
    display: block;
    position: sticky;
    top: calc(var(--nav-h) + 32px);
    max-height: calc(100vh - var(--nav-h) - 48px);
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
  }

  .docs-toc-mobile {
    display: none;
  }
}

.toc {
  margin-top: 8px;
  border-left: 1px solid var(--color-border);
}

.toc li a,
.toc-top {
  display: block;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--color-muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc-top {
  margin-top: 10px;
  border-left-color: var(--color-border);
  font-weight: 500;
  color: var(--color-fg);
}

.toc li a:hover {
  color: var(--color-fg);
}

/* The section in view; components/toc-spy.x.html sets aria-current. */
.toc li a[aria-current="true"] {
  color: var(--color-fg);
  border-left-color: var(--color-fg);
  font-weight: 500;
}

/* ---------------------------------------------------------------- header */

.docs-main {
  min-width: 0;
  max-width: 780px;
}

.docs-head h1 {
  margin-top: 0;
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--color-fg);
}

.docs-lede {
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-body);
}

.docs-lede a {
  color: var(--color-link);
}

.docs-lede code {
  font-size: 0.875em;
  color: var(--color-fg);
  background: var(--color-subtle);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 1px 5px;
}

.docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13.5px;
}

/* ---------------------------------------------------------------- agent block */

.agents {
  margin-top: 48px;
  padding: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-subtle);
}

.agents h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-fg);
}

.agents h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-fg);
}

.agents > p {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-body);
}

.agents > h3 {
  margin-top: 36px;
}

.agent-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin-top: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-border);
  overflow: hidden;
}

@media (min-width: 640px) {
  .agent-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* The old page had no CSS reset, so these headings took the browser default (1.17em, bold);
   Tailwind's preflight resets headings, so the default is written out. */
.agent h3 {
  font-size: 1.17em;
  font-weight: 700;
}

.agent {
  padding: 18px;
  background: var(--color-surface);
}

.agent p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-muted);
}

.agent pre,
.prompt pre {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--color-fg);
}

.prompts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

@media (min-width: 760px) {
  .prompts {
    grid-template-columns: repeat(2, 1fr);
  }
}

.prompt {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.prompt figcaption {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--color-muted);
}

.prompt pre {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  white-space: pre-wrap;
  font-size: 13px;
  color: var(--color-fg);
}

/* ---------------------------------------------------------------- prose */

.prose {
  margin-top: 56px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-body);
}

.prose > * + * {
  margin-top: 1em;
}

.prose h2 {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--color-fg);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.prose h3 {
  margin-top: 40px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--color-fg);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.prose h4 {
  margin-top: 28px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-fg);
}

.prose a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-link) 35%, transparent);
  text-underline-offset: 2px;
}

.prose strong {
  font-weight: 600;
  color: var(--color-fg);
}

.prose code {
  font-size: 0.875em;
  color: var(--color-fg);
  background: var(--color-subtle);
  border: 1px solid var(--color-border);
  border-radius: 5px;
  padding: 1px 5px;
}

.prose pre {
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-subtle);
  font-size: 13px;
  line-height: 1.65;
  overflow-x: auto;
  tab-size: 2;
}

.prose p code,
.prose li code {
  overflow-wrap: anywhere;
}

.prose pre code {
  font-size: inherit;
  color: var(--color-fg);
  background: none;
  border: 0;
  padding: 0;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose li > ul,
.prose li > ol {
  margin-top: 0.35em;
}

.prose blockquote {
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--color-border-strong);
  color: var(--color-muted);
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--color-border);
  margin: 40px 0;
}

/* <markdown> writes a bare <table>, with no wrapper to scroll it. As a block the table scrolls
   itself; fit-content keeps the border on its columns when they are narrower than the text. */
.prose table {
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.prose th,
.prose td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  text-align: left;
}

.prose th {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: var(--color-subtle);
}

.prose tr:last-child td {
  border-bottom: 0;
}

.prose td code,
.prose th code {
  white-space: nowrap;
}

.docs-foot {
  margin-top: 72px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--color-muted);
}

/* ---------------------------------------------------------------- /agents */

.agents-page {
  padding-top: 32px;
  padding-bottom: 96px;
}

@media (min-width: 960px) {
  .agents-page {
    padding-top: 48px;
  }
}

.agents-page .agent-grid {
  margin-top: 40px;
}

.agents-h2 {
  margin-top: 56px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-fg);
}

.agents-page .docs-lede + .prompts,
.agents-h2 + .docs-lede {
  margin-top: 12px;
}

.toc-top {
  margin-top: 16px;
}

}
