/* Ramona MCAM docs, design system v4. Written from scratch: it styles the page shell in page.html and the
 * plain Sphinx/docutils markup in the article body, and depends on no other theme's CSS or JS.
 *
 * STRUCTURE follows a measured study of Vercel's docs (see the teardown in _consulting/tools/docs-redesign):
 * a 64px header, a 300px sidebar with a search field on top and 36px rows, a 768px article column, a 240px
 * on-this-page rail, a 40px article title, 24px and 20px section headings with no rules, a split "Copy page"
 * button, bordered code boxes with a copy button, and quiet one-box callouts.
 *
 * IDENTITY is the Ramona GTM Hub's, read from its stylesheet (app/icp.css): SQUARE corners, hairline #DDDDDD
 * borders, ink text, Inter, and green (#20CC4B) only as a small accent. Where the two disagree the hub wins:
 * square corners, Inter, the hub's greys. Sentence-case navigation labels are kept from the study, and uppercase
 * stays on chips and buttons. Spacing is on the 4px scale.
 *
 * PALETTE. Every colour in this file is a literal from the hub stylesheet, and check_palette.py fails the build
 * if any other appears. The hub defines no dark theme, so the dark variant is the same tokens turned over (ink as
 * the page, fill as the text) plus the hub's own #3D3D3D, #BBBBBB and #000000. Light is the default, and dark
 * applies only when the reader chooses it with the toggle.
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap");

/* ------------------------------------------------------------------ tokens */
:root {
  --ink: #1D1D1D; --muted: #767676; --line: #DDDDDD; --fill: #F2F2F2; --bg: #FFFFFF; --code: #F2F2F2; --codebg: #FFFFFF;
  --green: #20CC4B;
  --ok: #12683A; --ok-bg: #EEFBF3; --ok-line: #7ED4A4;
  --warn: #8A5A00; --warn-bg: #FDF3E0; --warn-line: #F0C674;
  --bad: #B3382C; --bad-bg: #FBEAEA; --bad-line: #E0A9A3;
  --syn-comment: #767676; --syn-keyword: #5B3EA8; --syn-name: #1A5282; --syn-string: #12683A; --syn-number: #8A5A00; --syn-error: #B3382C;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  --scrim: rgba(0, 0, 0, 0.35);
  --topbar: 64px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
html[data-theme="dark"] {
  --ink: #F2F2F2; --muted: #BBBBBB; --line: #3D3D3D; --fill: #3D3D3D; --bg: #1D1D1D; --code: #000000; --codebg: #000000;
  --ok: #7ED4A4; --ok-bg: #000000; --ok-line: #7ED4A4;
  --warn: #F0C674; --warn-bg: #000000; --warn-line: #F0C674;
  --bad: #E0A9A3; --bad-bg: #000000; --bad-line: #E0A9A3;
  --syn-comment: #BBBBBB; --syn-keyword: #C3B0EC; --syn-name: #A8CCF0; --syn-string: #7ED4A4; --syn-number: #F0C674; --syn-error: #E0A9A3;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

/* -------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 24px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.7; -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss03"; }
img, svg, video { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
::selection { background: #20CC4B44; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; padding: 8px 16px; background: var(--bg); border: 1px solid var(--ink); }
.skip:focus { left: 8px; }

/* Navigation labels are sentence case, as in the study. Uppercase stays on chips and buttons. */
.label { margin: 0 0 4px; padding: 8px 10px 4px; font-size: 0.8125rem; font-weight: 400; color: var(--muted); line-height: 1.25; }

.btn, .iconbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 0.875rem; font-weight: 500; line-height: 1.2; cursor: pointer; white-space: nowrap; border-radius: 0; }
.btn { padding: 0 12px; }
.btn:hover, .iconbtn:hover { border-color: var(--ink); }
.iconbtn { flex-shrink: 0; width: 32px; padding: 0; color: var(--muted); }
.iconbtn:hover { color: var(--ink); }
.iconbtn svg, .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
kbd { font: 500 0.6875rem/1 var(--font); padding: 3px 6px; background: var(--fill); color: var(--muted); border: 1px solid var(--line); }

/* ----------------------------------------------------------------- header */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; height: var(--topbar); padding: 0 max(24px, calc((100vw - 90rem) / 2 + 24px)); background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-self: stretch; align-items: center; gap: 10px; margin-right: 16px; color: var(--ink); font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.logo { height: 24px; width: auto; }
.logo-dark { display: none; }
html[data-theme="dark"] .logo-light { display: none; }
html[data-theme="dark"] .logo-dark { display: block; }
.logo, .brand-name { flex-shrink: 0; }
.brand-sep { color: var(--line); font-weight: 400; }
.brand-sub { color: var(--muted); font-weight: 500; }
.topbar-right { display: flex; flex-shrink: 0; align-items: center; gap: 8px; margin-left: auto; }
.version { padding: 1px 6px; background: var(--fill); color: var(--muted); font: 400 0.625rem/1.6 var(--mono); text-decoration: none; }
@media (max-width: 90em) { .version { display: none; } }
.searchicon, .menu { display: none; }

/* ------------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: 300px minmax(0, 1fr) 240px; align-items: start; max-width: 90rem; margin: 0 auto; padding-right: 16px; }

/* Sidebar: a search field on top, then the current section. The tabs above carry the rest of the site. */
.sidenav { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); height: calc(100dvh - var(--topbar)); overflow-y: auto; padding: 0 24px 48px 12px; }
.sidesearch { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 36px; margin: 8px 0 12px; padding: 0 10px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: 0.875rem; cursor: pointer; border-radius: 0; }
.sidesearch:hover { border-color: var(--ink); }
.sidenav .label { margin-top: 16px; }
.drawer-head { display: none; }
.scrim { display: none; }

/* Inside a section: a back row (to the docs home) and then that section's pages, as in the study. */
.back { display: flex; align-items: center; gap: 8px; min-height: 36px; margin: 0 0 4px; padding: 0 10px; background: var(--fill); color: var(--ink); font-size: 0.875rem; font-weight: 500; text-decoration: none; overflow-wrap: break-word; }
.back:hover { border-color: var(--ink); }
.back svg { flex-shrink: 0; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* On the docs home and other top-level pages the sidebar lists the sections; a chevron says each one opens. */
.tree--root a { justify-content: space-between; gap: 8px; }
.tree--root svg { flex-shrink: 0; width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree > li + li, .sub > li + li { margin-top: 1px; }
.tree .row { display: flex; align-items: stretch; }
.tree a { display: flex; align-items: center; flex: 1; min-width: 0; min-height: 36px; padding: 6px 4px 6px 10px; color: var(--ink); font-size: 0.875rem; line-height: 1.4; text-decoration: none; overflow-wrap: break-word; transition: background-color 0.1s; }
.tree a:hover { background: var(--fill); }
.tree a[aria-current="page"] { font-weight: 500; background: var(--fill); }
.tog { flex: 0 0 32px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.tog:hover { color: var(--ink); background: var(--fill); }
.tog svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.1s; }
.tog[aria-expanded="true"] svg { transform: rotate(90deg); }
/* Nested pages: indented under their group, on a hairline, a touch smaller. Group rows are heavier, and the current
 * page in a group gets a solid ink bar on the hairline so you can see where you are. (The selectors carry .tree so
 * they outrank the list reset above, which is what hid the indent before.) */
.tree li.has-children > .row > a { font-weight: 500; }
.tree .sub { margin: 2px 0 6px 16px; border-left: 1px solid var(--line); }
.tree .sub .sub { margin-left: 12px; }
.tree .sub a { padding-left: 12px; font-size: 0.8125rem; font-weight: 400; }
.tree .sub a[aria-current="page"] { font-weight: 500; box-shadow: inset 2px 0 0 var(--ink); }
.js .sub[data-open="false"] { display: none; }

/* ----------------------------------------------------------- document area */
.doc { min-width: 0; padding: 26px 24px 64px 40px; }
.doc > * { max-width: 768px; margin-left: 0; margin-right: auto; }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 20px; margin-bottom: 12px; }
/* Copy page and On this page sit in one row directly under the title (custom.js moves them there). */
.doc-tools { position: relative; display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.875rem; line-height: 1.4; color: var(--muted); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span { color: var(--line); }

/* Copy page: one control with an internal divider, and a compact menu. The border is on the group, so the
 * halves never mismatch, and it goes to ink as a whole on hover, focus and while the menu is open. */
.copygroup { position: relative; display: flex; flex-shrink: 0; border: 1px solid var(--line); background: var(--bg); }
.copygroup:hover, .copygroup:focus-within, .copygroup:has(.copymore[aria-expanded="true"]) { border-color: var(--ink); }
.copygroup:has(.btn[data-state="done"]) { border-color: var(--ok-line); }
.copygroup .btn { height: 30px; border: 0; background: transparent; }
.copygroup .btn:hover { background: var(--fill); }
.copygroup .copymore { width: 30px; padding: 0; border-left: 1px solid var(--line); color: var(--muted); }
.copygroup .btn[data-state="done"] { color: var(--ok); }
.copymenu { position: absolute; top: calc(100% + 6px); left: -1px; z-index: 30; width: max-content; min-width: calc(100% + 2px); margin: 0; padding: 4px; list-style: none; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.copymenu[hidden] { display: none; }
.copymenu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 12px 0 10px; border: 0; background: transparent; text-align: left; font-size: 0.875rem; font-weight: 400; white-space: nowrap; cursor: pointer; border-radius: 0; }
.copymenu button:hover { background: var(--fill); }
.copymenu svg { flex-shrink: 0; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* On this page */
.onpage { position: sticky; top: var(--topbar); max-height: calc(100vh - var(--topbar)); max-height: calc(100dvh - var(--topbar)); overflow-y: auto; padding: 26px 0 48px 16px; font-size: 0.875rem; }
.onpage .label { padding: 0 0 8px 12px; margin: 0; font-size: 0.875rem; font-weight: 500; color: var(--ink); }
.onpage ul { list-style: none; margin: 0; padding: 0; }
.onpage > ul { border-left: 1px solid var(--line); }
.onpage a { display: block; padding: 4px 0 4px 12px; color: var(--muted); line-height: 1.43; text-decoration: none; overflow-wrap: break-word; }
.onpage ul ul a { padding-left: 28px; }
.onpage ul ul ul a { padding-left: 44px; }
.onpage a:hover { color: var(--ink); }
.onpage a[aria-current="true"] { color: var(--ink); font-weight: 500; box-shadow: inset 2px 0 0 var(--ink); }
.onpage-m { display: none; }

/* ------------------------------------------------------------- typography */
.prose { line-height: 1.7; overflow-wrap: break-word; }
.prose p { margin: 0 0 20px; }
.prose h1 { margin: 0 0 16px; font-size: 2.5rem; font-weight: 600; line-height: 1.2; letter-spacing: -0.035em; }
.prose h2 { margin: 48px 0 12px; font-size: 1.5rem; font-weight: 600; line-height: 1.333; letter-spacing: -0.02em; }
.prose h3 { margin: 32px 0 8px; font-size: 1.25rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.prose h4, .prose h5, .prose h6 { margin: 24px 0 8px; font-size: 1rem; font-weight: 600; line-height: 1.5; }
.prose h1 + h2, .prose > section > section:first-of-type > h2:first-child { margin-top: 32px; }
.prose p.lead { font-size: 1.125rem; line-height: 1.6; }
.prose a { font-weight: 500; text-decoration: underline; text-decoration-color: var(--muted); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--ink); text-decoration-thickness: 2px; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 24px; }
.prose li { margin-bottom: 4px; }
.prose li > p { margin: 0 0 8px; }
.prose li > ul, .prose li > ol { margin: 4px 0 0; }
.prose blockquote { margin: 20px 0; padding: 4px 16px; border-left: 2px solid var(--ink); color: var(--muted); }
.prose hr { margin: 32px 0; border: 0; border-top: 1px solid var(--line); }
.prose strong { font-weight: 600; }
.prose figure { margin: 24px 0; }
.prose figcaption { margin-top: 8px; color: var(--muted); font-size: 0.875rem; }
.prose img { height: auto; }
.prose figure img, .prose .align-center img, .prose p > img { border: 1px solid var(--line); }
.prose .align-center { text-align: center; margin-left: auto; margin-right: auto; }
.prose video { display: block; border: 1px solid var(--line); }
.prose p.rubric { margin: 24px 0 8px; font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.prose .line-block { margin: 0 0 20px; }
.prose .toctree-wrapper ul { margin-bottom: 20px; }
.prose .headerlink { margin-left: 8px; color: var(--muted); font-size: 0.75em; font-weight: 400; text-decoration: none; opacity: 0; transition: opacity 0.1s; }
.prose :is(h1, h2, h3, h4, h5, h6, dt):hover > .headerlink, .prose .headerlink:focus-visible { opacity: 1; }
.prose .math { overflow-x: auto; }
.prose dl.footnote, .prose aside.footnote { font-size: 0.875rem; color: var(--muted); }

/* PDF download button: the icon and link are one bordered control, and all of it is clickable. */
.prose .workflow-pdf-download { margin: 0 0 20px; }
.prose .workflow-pdf-download > p { position: relative; display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 0 16px 0 12px; min-height: 36px; border: 1px solid var(--line); transition: border-color 0.1s, box-shadow 0.1s; }
.prose .workflow-pdf-download > p:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.prose .workflow-pdf-download svg { flex-shrink: 0; width: 1.25em; height: 1.25em; color: var(--green); fill: currentColor; }
.prose .workflow-pdf-download a { font-size: 0.875rem; font-weight: 500; text-decoration: none; }
.prose .workflow-pdf-download a::after { content: ""; position: absolute; inset: 0; }
.prose .workflow-pdf-download a code.literal { padding: 0; border: 0; background: none; font-family: inherit; font-size: inherit; font-weight: inherit; color: inherit; }

/* -------------------------------------------------------------------- code */
.prose code.literal, .prose code.docutils { padding: 1px 5px; border: 0; background: var(--code); font-family: var(--mono); font-size: 0.9em; }
.prose a code.literal { color: inherit; }
.prose .highlight { background: transparent; }
.prose pre { margin: 0 0 20px; padding: 16px; overflow-x: auto; background: var(--codebg); border: 1px solid var(--line); font: 400 0.8125rem/1.25rem var(--mono); tab-size: 4; }
.prose .highlight pre { margin: 0; }
.prose div[class*="highlight-"] { margin: 0 0 20px; }
/* A bordered box. The copy button sits in its own column beside the code, so nothing overlaps. */
.codebox { display: flex; align-items: stretch; border: 1px solid var(--line); background: var(--codebg); }
.codebox > .highlight { order: 1; flex: 1 1 auto; min-width: 0; }
.codebox pre, .codebox .highlight pre { margin: 0; border: 0; }
.codeactions { order: 2; flex: 0 0 auto; padding: 8px 8px 0 0; }
.codeactions .copy { position: relative; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; border-radius: 0; }
.codeactions .copy:hover { background: var(--fill); color: var(--ink); }
.codeactions .copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.codeactions .copy .i-done, .codeactions .copy[data-state="done"] .i-copy { display: none; }
.codeactions .copy[data-state="done"] .i-done { display: block; color: var(--ok); }

/* Syntax colours come from the palette tokens. */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .ch, .highlight .cp, .highlight .cpf { color: var(--syn-comment); }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .ow { color: var(--syn-keyword); font-weight: 600; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx { color: var(--syn-string); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: var(--syn-number); }
.highlight .nb, .highlight .bp { color: var(--syn-keyword); }
.highlight .nf, .highlight .nc, .highlight .nn, .highlight .nd, .highlight .fm { color: var(--syn-name); font-weight: 600; }
.highlight .err, .highlight .gr, .highlight .gt { color: var(--syn-error); background: transparent; }
.highlight .gp, .highlight .go { color: var(--muted); user-select: none; }
/* Line numbers (:linenos:) get a ruled gutter, and are left out of a mouse selection so code copied by hand
   comes without them (the copy button already strips them in docs.js). */
.highlight .linenos { display: inline-block; margin-right: 12px; padding-right: 12px; border-right: 1px solid var(--line); color: var(--muted); text-align: right; -webkit-user-select: none; user-select: none; }

/* ------------------------------------------------------------------ tables */
/* Dense (8px vertical, 12px horizontal, the workspace standard), wrapping, scrolling inside their own box. */
.table-wrapper { margin: 24px 0; overflow-x: auto; border: 1px solid var(--line); }
.prose table { width: 100%; margin: 0; border-collapse: collapse; font-size: 0.875rem; line-height: 1.55; }
.prose th { padding: 8px 12px; text-align: left; font-size: 0.875rem; font-weight: 400; color: var(--muted); background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.prose td { padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); vertical-align: top; white-space: normal; overflow-wrap: break-word; }
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover td { background: var(--fill); }
.prose td p, .prose th p { margin: 0; }
.prose td p + p, .prose td ul { margin-top: 8px; }
.prose .table-wrapper > table { margin: 0; }

/* --------------------------------------------------------------- callouts */
/* One quiet bordered box: a short title in sentence case, then the text. Colour appears only on the title and border. */
.prose .admonition { margin: 24px 0; padding: 12px 16px; border: 1px solid var(--line); background: var(--bg); font-size: 0.875rem; line-height: 1.55; }
.prose .admonition > .admonition-title { margin: 0 0 4px; padding: 0; background: none; font-size: 0.875rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink); }
.prose .admonition > *:last-child { margin-bottom: 0; }
.prose .admonition p { margin: 0 0 8px; }
.prose .admonition.tip, .prose .admonition.hint { border-color: var(--ok-line); }
.prose .admonition.tip > .admonition-title, .prose .admonition.hint > .admonition-title { color: var(--ok); }
.prose .admonition.warning, .prose .admonition.caution, .prose .admonition.attention { border-color: var(--warn-line); }
.prose .admonition.warning > .admonition-title, .prose .admonition.caution > .admonition-title, .prose .admonition.attention > .admonition-title { color: var(--warn); }
.prose .admonition.danger, .prose .admonition.error { border-color: var(--bad-line); }
.prose .admonition.danger > .admonition-title, .prose .admonition.error > .admonition-title { color: var(--bad); }
.prose .versionadded, .prose .versionchanged, .prose .deprecated, .prose .versionremoved { margin: 16px 0; padding: 8px 12px; border: 1px solid var(--line); background: var(--bg); font-size: 0.875rem; }
.prose .versionadded > p, .prose .versionchanged > p, .prose .deprecated > p { margin: 0; }
.prose .versionmodified { font-weight: 600; }
.prose .deprecated { border-color: var(--warn-line); }

/* --------------------------------------------- API signatures and field lists */
.prose dl.py > dt { padding: 8px 12px; background: var(--fill); border: 1px solid var(--line); border-left: 2px solid var(--ink); font: 500 0.8125rem/1.6 var(--mono); overflow-wrap: anywhere; }
.prose dl.py > dt .sig-name { font-weight: 700; color: var(--ink); }
.prose dl.py > dt .sig-prename { color: var(--muted); }
.prose dl.py > dt em { font-style: normal; }
.prose dl.py > dt .property, .prose dl.py > dt .sig-paren { color: var(--muted); }
.prose dl.py > dt .viewcode-link { margin-left: 8px; font-family: var(--font); font-size: 0.75rem; color: var(--muted); }
.prose dl.py > dd { margin: 8px 0 32px; padding-left: 16px; border-left: 1px solid var(--line); }
.prose dl.field-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0 0 20px; }
.prose dl.field-list > dt { min-width: 0; padding-top: 2px; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.prose dl.field-list > dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.prose dl.field-list > dd > p:last-child, .prose dl.field-list > dd > ul { margin-bottom: 0; }
.prose dl:not(.py):not(.field-list):not(.footnote) > dt { font-weight: 600; margin-top: 16px; }
.prose dl:not(.py):not(.field-list):not(.footnote) > dd { margin: 4px 0 0 16px; }

/* --------------------------------------------------- cards (grid of links) */
.prose .sd-container-fluid { width: auto; max-width: none; margin: 0 0 24px; padding: 0; }
.prose .sd-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 16px; margin: 0; padding: 0; }
.prose .sd-row > .sd-col { display: block; width: auto; max-width: none; margin: 0; padding: 0; }
.prose .sd-card { position: relative; display: flex; flex-direction: column; height: 100%; border: 1px solid var(--line); background: var(--bg); transition: border-color 0.1s, box-shadow 0.1s; }
.prose .sd-card.sd-card-hover:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.prose .sd-card-body { flex: 1; padding: 24px; }
.prose .sd-card-title { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1rem; font-weight: 600; line-height: 1.5; letter-spacing: -0.01em; }
.prose .sd-card-title:last-child { margin-bottom: 0; }
.prose .sd-card-text { margin: 0; color: var(--muted); font-size: 0.8125rem; line-height: 1.55; }
.prose .sd-card-text p { margin: 0 0 8px; }
.prose .sd-card-text ul { margin: 0; padding-left: 16px; }
.prose .sd-card-text li { margin-bottom: 8px; }
.prose .sd-octicon, .prose .sd-material-icon, .prose .sd-card-title svg { flex-shrink: 0; width: 1.25em; height: 1.25em; color: var(--green); fill: currentColor; }
/* 2026-09-22: card icons became Lucide (conf.py's :lucide: role), which draws as an outlined stroke
   rather than a filled shape — override just the fill/stroke half of the rule above so they don't
   render as solid green blobs. Same stroke treatment as .iconbtn svg in the header/sidebar. */
.prose .sd-card-title svg.lucide-icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.prose .sd-card a { text-decoration: none; }
.prose .sd-card-text a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.prose .sd-card a code.literal { padding: 0; border: 0; background: none; font-family: inherit; font-size: inherit; font-weight: 500; color: inherit; }
.prose .sd-stretched-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.prose .sd-hide-link-text { font-size: 0; }

/* -------------------------------------------------------------- pager, foot */
/* flex, not a fixed two-column grid: a solo card (root page has no "previous", the last page in the
 * whole site has no "next") used to be forced to fill its half of a 1fr/1fr grid regardless of how
 * short its title was, reading as an oversized, mostly-empty button. Capping each card's width and
 * letting the lone one size to its own content, pushed to its edge via margin-left: auto, fixes that
 * without changing the two-card case. */
.pager { display: flex; gap: 16px; margin-top: 48px; }
/* Each card is a label row (arrow and word) over the page title. Previous is left-aligned, Next is right-aligned,
 * and on a phone both are left-aligned so labels, titles and arrows share one left edge. */
/* Quiet fill background (no box-shadow-on-hover) distinguishes this as page navigation chrome
 * from the white, shadow-on-hover .sd-card content cards elsewhere on the page — Daphne's
 * reaction 2026-09-22: the two read as the same control with the same styling. Same --fill token
 * already used for the quiet-box treatment elsewhere (callouts, code chrome), no new color. */
.pager a { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 360px; padding: 16px 24px; border: 1px solid var(--line); background: var(--fill); color: var(--ink); text-decoration: none; transition: border-color 0.1s, background-color 0.1s; }
.pager a:hover { border-color: var(--ink); background: var(--bg); }
.pager-next { margin-left: auto; align-items: flex-end; text-align: right; }
.pager small { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; font-weight: 400; line-height: 1.5; color: var(--muted); }
.pager-next small { justify-content: flex-end; }
.pager strong { display: block; font-weight: 600; line-height: 1.5; overflow-wrap: break-word; }
.pager svg { flex-shrink: 0; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8125rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }

/* ------------------------------------------------------ search page, indexes */
.prose form { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.prose input[type="text"] { width: min(24rem, 100%); min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem; }
.prose input[type="submit"] { min-height: 44px; padding: 8px 16px; border: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: var(--bg); font: inherit; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; }
.prose ul.search { margin: 0; padding: 0; list-style: none; }
.prose ul.search li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.prose ul.search li > a { font-weight: 600; }
.prose ul.search p.context { margin: 4px 0 0; color: var(--muted); font-size: 0.875rem; }
.prose .highlighted { background: #20CC4B44; }
.prose table.indextable td { padding: 8px 12px; border: 0; vertical-align: top; }
.prose table.indextable ul { margin: 0; padding-left: 16px; }
.prose table.indextable tr:hover td { background: transparent; }
.prose table.indextable { table-layout: fixed; }
.prose .genindex-jumpbox { margin: 0 0 24px; }

/* --------------------------------------------------------- command palette */
.palette-backdrop { position: fixed; inset: 0; z-index: 100; display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 0; background: var(--scrim); }
.palette-backdrop[data-open="true"] { display: flex; }
.palette { display: flex; flex-direction: column; width: 100%; max-width: 36rem; max-height: 70vh; background: var(--bg); border: 1px solid var(--ink); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18); }
.palette input { width: 100%; padding: 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; outline: none; }
.results { margin: 0; padding: 4px 0; list-style: none; overflow-y: auto; }
.result { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0; padding: 8px 16px; font-size: 0.875rem; line-height: 1.4; cursor: pointer; }
.result[aria-selected="true"] { background: var(--fill); box-shadow: inset 2px 0 0 var(--ink); }
.result-title { min-width: 0; font-weight: 500; overflow-wrap: break-word; }
.result-where { flex-shrink: 0; max-width: 45%; color: var(--muted); font-size: 0.75rem; text-align: right; overflow-wrap: break-word; }
.group { margin: 0; padding: 8px 16px 4px; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
.palette-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.75rem; }
.palette-empty { padding: 16px; color: var(--muted); font-size: 0.875rem; }
.palette-close { display: none; }

/* --------------------------------------------------------------- responsive */
/* The rail needs 300 + 768 + 240 + gutters. Below that it becomes a disclosure and the article keeps its measure. */
@media (max-width: 85.75em) {
  .shell { grid-template-columns: 300px minmax(0, 1fr); padding-right: 0; }
  .onpage { display: none; }
  .onpage-m { display: block; position: relative; margin: 0 0 20px; }
  .doc-tools .onpage-m { margin: 0; }
  .onpage-m summary { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 0.875rem; font-weight: 500; list-style: none; cursor: pointer; }
  .onpage-m summary::-webkit-details-marker { display: none; }
  .onpage-m summary::after { content: ""; width: 6px; height: 6px; margin: -3px 0 0 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); }
  .onpage-m[open] summary { border-color: var(--ink); }
  .onpage-m[open] summary::after { margin-top: 3px; transform: rotate(225deg); }
  .onpage-m > ul { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: min(22rem, calc(100vw - 48px)); max-height: 60vh; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); font-size: 0.875rem; }
  .onpage-m ul ul { list-style: none; margin: 0; padding: 0; }
  .onpage-m ul ul a { padding-left: 28px; }
  .onpage-m a { display: flex; align-items: center; min-height: 36px; padding: 4px 10px; color: var(--ink); text-decoration: none; }
  .onpage-m a:hover { background: var(--fill); }
}
/* Below 1024 the sidebar becomes a drawer, as in the study. Phones get 44px targets and 16px inputs. */
@media (max-width: 63.99em) {
  .shell { display: block; padding-right: 0; }
  .menu, .searchicon { display: inline-flex; }
  .version { display: none; }
  .topbar { gap: 4px; padding: 0 8px; }
  .brand { margin-right: auto; padding-left: 4px; }
  .iconbtn { width: 44px; height: 44px; border-color: transparent; }
  .btn { min-height: 44px; }
  .copygroup .btn { min-height: 44px; }
  .copygroup .copymore { width: 44px; }
  .copymenu { left: auto; right: -1px; }
  .onpage-m summary { height: 44px; }
  .onpage-m a { min-height: 44px; }

  .sidenav { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; width: min(20rem, 86vw); height: auto; padding: 0 12px 32px; background: var(--bg); border-right: 1px solid var(--ink); transform: translateX(-100%); visibility: hidden; transition: transform 0.18s ease, visibility 0s linear 0.18s; }
  body.nav-open .sidenav { transform: none; visibility: visible; transition: transform 0.18s ease; }
  .scrim { position: fixed; inset: 0; z-index: 50; background: var(--scrim); }
  body.nav-open .scrim { display: block; }
  body.nav-open { overflow: hidden; }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; height: var(--topbar); margin: 0 -12px; padding: 0 8px 0 22px; border-bottom: 1px solid var(--line); }
  .drawer-head .label { margin: 0; padding: 0; }
  .drawer-head .iconbtn { border-color: transparent; }
  .sidesearch { min-height: 44px; margin-top: 12px; }
  .back { min-height: 44px; }
  .tree a { min-height: 44px; }
  .tog { flex-basis: 44px; }
  .doc { padding: 16px 24px 48px; }
  .doc-head { align-items: flex-start; }
  .crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
  .prose dl.field-list { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .prose dl.field-list > dd { margin-bottom: 8px; }
  .prose dl.py > dd { padding-left: 12px; }
  .codeactions .copy { width: 44px; height: 44px; }
  .codeactions { padding: 0; }
  .prose .workflow-pdf-download > p { min-height: 44px; }
  .prose .sd-card-body li { margin: 0; }
  .prose .sd-card-body li > p { margin: 0; }
  .prose .sd-card-body li a { display: flex; align-items: center; min-height: 44px; }
  .copymenu button { min-height: 44px; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
  .pager-next { margin-left: 0; align-items: flex-start; text-align: left; }
  .pager-next small { justify-content: flex-start; }
  .foot-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .prose input[type="text"], .palette input { font-size: 1rem; }
  .palette-backdrop { padding-top: 8px; }
  .palette { max-height: 80vh; }
  .result { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; min-height: 44px; }
  .result-where { max-width: 100%; text-align: left; }
  .palette-foot span { display: none; }
  .palette-close { display: block; width: 100%; min-height: 44px; border: 0; background: transparent; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
}
@media (max-width: 46em) {
  .brand-sep, .brand-sub { display: none; }
  .prose h1 { font-size: 1.5rem; line-height: 1.333; letter-spacing: -0.02em; }
  .prose h2 { font-size: 1.25rem; margin-top: 32px; }
  .prose h3 { font-size: 1.125rem; }
  div.highlight pre { padding: 12px; }
}
@media print {
  .topbar, .sidenav, .onpage, .onpage-m, .pager, .copygroup, .scrim, .preview-bar, .codeactions { display: none !important; }
  .shell { display: block; }
  .doc { padding: 0; }
}
