/* Extra tones layered over site.css's token set; dark follows the site toggle. */
:root {
  --ink-2: #3a4051;
  --line-soft: #eceef4;
  --accent-ink: #312e81;
  --accent-tint: var(--tint);
  --accent-line: #c7cbf7;
  --warn-ink: #7c4a05;
  --warn-bg: #fdf6e9;
  --warn-line: #f0dcb4;
  --docs-radius: 10px;
  --docs-measure: 44rem;
}
:root[data-theme="dark"] {
  --ink-2: #c3c9d6;
  --line-soft: #232837;
  --accent-ink: #c7d0ff;
  --accent-line: #3c4170;
  --warn-ink: #f0cd8f;
  --warn-bg: #2c2418;
  --warn-line: #4a3c22;
}

/* --- reading layout --- */

.docs-wrap { width: 100%; }

.docs-shell {
  padding: 1.75rem 0 4rem;
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 15rem minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 1180px) {
  .docs-shell.docs-with-rail { grid-template-columns: 15rem minmax(0, 1fr) 13rem; }
}
@media (max-width: 860px) {
  .docs-shell, .docs-shell.docs-with-rail { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
}

/* The source order is content, sidebar, rail (content first for readers who cannot see the
   layout); a wide window puts the sidebar back in the left column. */
.docs-content { min-width: 0; }
@media (min-width: 861px) {
  .docs-content { grid-column: 2; grid-row: 1; }
  .docs-nav { grid-column: 1; grid-row: 1; }
  .docs-rail { grid-column: 3; grid-row: 1; }
}

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

.docs-nav { position: sticky; top: calc(var(--nav-h) + 1.25rem); font-size: 0.92rem; }
@media (max-width: 860px) {
  .docs-nav { position: static; border-top: 1px solid var(--line); padding-top: 1.5rem; }
}

.docs-nav-section {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 1.35rem 0 0.4rem;
  font-weight: 650;
}
.docs-nav-title + .docs-nav-section { margin-top: 0; }
.docs-nav-title { display: none; margin: 0 0 1rem; font-weight: 650; color: var(--ink); }
/* On a phone the sidebar comes after the article; this link at the top jumps to it. */
.docs-nav-jump { display: none; }
@media (max-width: 860px) {
  .docs-nav-title { display: block; }
  .docs-nav-jump { display: inline-block; margin: 0 0 1rem; font-size: 0.9rem; font-weight: 600; }
}
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav li { margin: 0; }
.docs-nav a {
  display: block;
  padding: 0.24rem 0.55rem;
  margin-left: -0.55rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink-2);
}
.docs-nav a:hover { background: var(--line-soft); color: var(--ink); }
.docs-nav a[aria-current="page"] {
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-weight: 600;
}

/* --- prose --- */

.docs-prose { max-width: var(--docs-measure); }
.docs-prose h1 {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
}
.docs-prose h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 2.3rem 0 0.7rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--line-soft);
}
.docs-prose h3 { font-size: 1.06rem; margin: 1.7rem 0 0.5rem; }
.docs-prose h4, .docs-prose h5, .docs-prose h6 { font-size: 1rem; margin: 1.4rem 0 0.4rem; }
.docs-prose p { margin: 0 0 1rem; }
.docs-prose ul, .docs-prose ol { margin: 0 0 1rem; padding-left: 1.35rem; }
.docs-prose li { margin: 0.3rem 0; }
.docs-prose li > ul, .docs-prose li > ol { margin: 0.35rem 0 0.15rem; }
.docs-prose strong { font-weight: 640; color: var(--ink); }
.docs-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.docs-prose figure.shot { margin: 1.25rem 0 1.5rem; }
.docs-prose figure.shot a {
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--docs-radius);
  overflow: hidden;
  line-height: 0;
}
.docs-prose figure.shot picture { display: block; }
.docs-prose figure.shot img { display: block; max-width: 100%; height: auto; }

.docs-prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--line-soft);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}
.docs-prose pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--docs-radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
}
.docs-prose pre code { background: none; padding: 0; font-size: 0.85rem; }

.docs-prose blockquote {
  margin: 1.2rem 0;
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--accent-line);
  background: var(--accent-tint);
  border-radius: 0 var(--docs-radius) var(--docs-radius) 0;
}
.docs-prose blockquote > :last-child { margin-bottom: 0; }

.table-scroll { overflow-x: auto; margin: 0 0 1.25rem; }
.docs-prose table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
.docs-prose th, .docs-prose td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
.docs-prose th { background: var(--line-soft); font-weight: 640; }

/* --- cross references (classes emitted by markdown.ts; no site.css equivalent) --- */

.xref { font-style: italic; }
.xref-off {
  font-style: italic;
  color: var(--muted);
  white-space: normal;
}
.xref-badge {
  font-style: normal;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 640;
  color: var(--warn-ink);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  margin-left: 0.1rem;
  white-space: nowrap;
}

/* --- capability notice --- */

.docs-notice {
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: var(--docs-radius);
  padding: 0.95rem 1.15rem;
  margin: 0 0 1.75rem;
  max-width: var(--docs-measure);
}
.docs-notice h2 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  border: 0;
  padding: 0;
  letter-spacing: 0;
}
.docs-notice p { margin: 0 0 0.5rem; font-size: 0.92rem; }
.docs-notice p:last-child { margin-bottom: 0; }
.docs-notice ul { margin: 0.5rem 0 0; padding-left: 1.2rem; font-size: 0.92rem; }
.docs-notice li { margin: 0.25rem 0; }
.docs-notice .docs-notice-title { font-weight: 640; }
.docs-notice a { color: inherit; }
.docs-notice-compact { padding: 0.7rem 1rem; }
.docs-notice-compact p { font-size: 0.88rem; }
.docs-notice-compact .docs-notice-headline { margin: 0 0 0.4rem; font-size: 0.9rem; font-weight: 700; }

/* --- index --- */

.docs-lede { font-size: 1.1rem; color: var(--ink-2); max-width: var(--docs-measure); margin: 0 0 1.75rem; }
.docs-section-block { margin: 0 0 2.5rem; max-width: var(--docs-measure); }
.docs-section-block h2 {
  font-size: 1.15rem;
  margin: 0 0 0.9rem;
  letter-spacing: -0.01em;
}
.docs-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.docs-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--docs-radius);
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
}
.docs-card:hover { border-color: var(--accent-line); background: var(--accent-tint); }
.docs-card-title { font-weight: 640; color: var(--ink); display: block; }
.docs-card-summary { color: var(--muted); font-size: 0.92rem; display: block; margin-top: 0.15rem; }

/* --- article chrome --- */

.docs-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 640;
  margin: 0 0 0.6rem;
}
.docs-article-meta {
  margin: 2.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  max-width: var(--docs-measure);
}

/* --- on this page --- */

.docs-rail { position: sticky; top: calc(var(--nav-h) + 1.25rem); font-size: 0.87rem; }
.docs-rail h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.5rem;
  font-weight: 650;
}
.docs-rail ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.docs-rail li { margin: 0; }
.docs-rail a {
  display: block;
  padding: 0.2rem 0 0.2rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
}
.docs-rail a:hover { color: var(--accent-ink); }
@media (max-width: 1179px) { .docs-rail { display: none; } }

@media print {
  .docs-nav, .docs-rail { display: none; }
  .docs-shell, .docs-shell.docs-with-rail { display: block; }
}
