/* Proteus documentation theme.
 *
 * Reads the same --p-* brand tokens as the web GUI (brand/design-tokens.css loads
 * first and is never edited), so the docs cannot drift from the product.
 *
 * Light mode deliberately does NOT use the kit's raw #ffffff surface. Long-form
 * reading on full-luminance white is uncomfortable, so light sits on the same
 * tinted mint surfaces the GUI uses. Body text clears 12:1 on them.
 */

:root {
  --bg: #e8f1ea;
  --surface: #f6fbf7;
  --surface-alt: #dfeee4;
  --fg: var(--p-text);
  --fg-dim: color-mix(in srgb, var(--p-text) 72%, var(--p-muted));
  --fg-mute: var(--p-muted);
  --line: var(--p-border);
  --line-soft: color-mix(in srgb, var(--p-border) 55%, var(--surface));
  --accent: var(--p-accent);
  --accent-soft: color-mix(in srgb, var(--p-accent) 12%, transparent);
  --focus: var(--p-focus);
  --ok: #1a7f37;
  --warn: var(--p-warning);
  --danger: var(--p-danger);
  --info: var(--p-info);
  --radius: var(--p-radius-md);
  --radius-sm: var(--p-radius-sm);
  --font: var(--p-font);
  --mono: var(--p-mono);
  --measure: 74ch;
  --sidebar-w: 16.5rem;
  --toc-w: 14rem;
}

[data-theme="dark"] {
  --bg: var(--p-bg);
  --surface: var(--p-surface);
  --surface-alt: var(--p-surface-alt);
  --ok: var(--p-success);
  --line-soft: color-mix(in srgb, var(--p-border) 70%, var(--p-surface));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.68 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 20;
  background: var(--accent); color: var(--p-on-accent);
  padding: var(--p-space-2) var(--p-space-4); border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

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

.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--p-space-4);
  padding: var(--p-space-3) var(--p-space-6);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: var(--p-space-2); text-decoration: none; color: var(--fg); }
.brand img { display: block; border-radius: 7px; }
.brand-word { font: 700 17px/1 var(--font); letter-spacing: 0.14em; }
.brand-sub {
  font: 600 10px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); padding: 3px 6px; border: 1px solid var(--accent);
  border-radius: 999px;
}

.top-right { display: flex; align-items: center; gap: var(--p-space-3); }
.version { font: 500 12px var(--mono); color: var(--fg-mute); }
.top-link { font-size: 13px; color: var(--fg-dim); text-decoration: none; }
.top-link:hover { color: var(--accent); text-decoration: underline; }

.theme-toggle, .nav-toggle {
  background: var(--surface-alt); color: var(--fg-dim);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 5px 10px; font: 500 12px var(--mono); cursor: pointer;
}
.theme-toggle:hover, .nav-toggle:hover { color: var(--accent); border-color: var(--accent); }
.nav-toggle { display: none; }

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

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: var(--p-space-8);
  max-width: 96rem; margin: 0 auto;
  padding: var(--p-space-6) var(--p-space-6) var(--p-space-16);
}

.sidebar {
  position: sticky; top: 4.6rem; align-self: start;
  max-height: calc(100vh - 6rem); overflow-y: auto;
}

.nav-search {
  width: 100%; margin-bottom: var(--p-space-3);
  padding: 7px 10px; font: 400 13px var(--font);
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}

.nav { display: grid; gap: 2px; }
.nav-link {
  display: block; padding: 5px 10px; border-radius: var(--radius-sm);
  color: var(--fg-dim); text-decoration: none; font-size: 14px;
  border-left: 2px solid transparent;
}
.nav-link:hover { background: var(--surface-alt); color: var(--fg); }
.nav-link[aria-current="page"] {
  background: var(--accent-soft); color: var(--accent);
  border-left-color: var(--accent); font-weight: 600;
}
.nav-d1 { margin-left: var(--p-space-3); font-size: 13.5px; }

.nav-group { margin: var(--p-space-2) 0; }
.nav-group > summary {
  cursor: pointer; padding: 5px 10px; border-radius: var(--radius-sm);
  font: 600 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-mute); list-style: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::before {
  content: '\25B8'; display: inline-block; width: 1em;
  transition: transform 150ms ease;
}
.nav-group[open] > summary::before { transform: rotate(90deg); }
.nav-group > summary:hover { color: var(--accent); }

/* --- content ------------------------------------------------------------ */

.content { min-width: 0; }
.prose { max-width: var(--measure); }

.prose h1 {
  font: 700 clamp(1.9rem, 1.2rem + 2vw, 2.6rem)/1.15 var(--font);
  margin: 0 0 var(--p-space-2); letter-spacing: -0.02em;
}
.lede {
  margin: 0 0 var(--p-space-8); color: var(--fg-dim);
  font-size: 1.12rem; line-height: 1.6;
  padding-bottom: var(--p-space-4); border-bottom: 1px solid var(--line-soft);
}

.prose h2 {
  font: 650 1.55rem/1.25 var(--font); letter-spacing: -0.01em;
  margin: var(--p-space-12) 0 var(--p-space-3);
  padding-bottom: var(--p-space-2); border-bottom: 1px solid var(--line-soft);
}
.prose h3 { font: 650 1.2rem/1.3 var(--font); margin: var(--p-space-8) 0 var(--p-space-2); }
.prose h4 {
  font: 650 1rem/1.35 var(--font);
  margin: var(--p-space-6) 0 var(--p-space-2); color: var(--fg-dim);
}

.prose p, .prose li { color: var(--fg); }
.prose p { margin: 0 0 var(--p-space-4); }
.prose ul, .prose ol { margin: 0 0 var(--p-space-4); padding-left: var(--p-space-6); }
.prose li { margin-bottom: 6px; }
.prose li > ul, .prose li > ol { margin-top: 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: var(--p-space-12) 0; }

.heading-link {
  margin-left: 0.4em; color: var(--line); text-decoration: none;
  opacity: 0; transition: opacity 120ms ease;
}
.anchored:hover .heading-link { opacity: 1; color: var(--accent); }

/* Inline code in a heading inherits the heading's size through `em`, so it tracks
 * h2/h3/h4 instead of being pinned to one absolute size. The lighter border keeps a
 * bordered box from competing with the heading rule underneath it. */
.prose h1 code, .prose h2 code, .prose h3 code, .prose h4 code {
  font-size: 0.92em; font-weight: inherit;
  background: var(--surface-alt); border-color: var(--line-soft);
  padding: 1px 5px;
}

/* --- on-page contents --------------------------------------------------- */

.toc {
  position: sticky; top: 4.6rem; align-self: start;
  max-height: calc(100vh - 6rem); overflow-y: auto;
  font-size: 13px; display: grid; gap: 1px;
}
.toc h2 {
  font: 600 10px var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-mute); margin: 0 0 var(--p-space-2);
}
.toc-link {
  color: var(--fg-mute); text-decoration: none; padding: 3px 0 3px 10px;
  border-left: 2px solid var(--line-soft); line-height: 1.4;
}
.toc-link:hover, .toc-link.is-here { color: var(--accent); border-left-color: var(--accent); }
.toc-h3 { padding-left: var(--p-space-4); }
.toc-h4 { padding-left: var(--p-space-6); font-size: 12.5px; }

/* --- pager and footer --------------------------------------------------- */

.pager {
  display: flex; gap: var(--p-space-4); flex-wrap: wrap;
  margin: var(--p-space-12) 0 0; max-width: var(--measure);
}
.pager-link {
  flex: 1 1 14rem; display: grid; gap: 2px;
  padding: var(--p-space-3) var(--p-space-4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); text-decoration: none;
  color: var(--fg); font-weight: 600;
}
.pager-link:hover { border-color: var(--accent); }
.pager-link span {
  font: 600 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-mute);
}
.pager-next { text-align: right; }

.foot {
  margin-top: var(--p-space-12); padding-top: var(--p-space-4);
  border-top: 1px solid var(--line-soft);
  font-size: 13px; color: var(--fg-dim); max-width: var(--measure);
}
.foot p { margin: 0 0 4px; }
.foot-dim { color: var(--fg-mute); }

/* --- responsive --------------------------------------------------------- */

@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: var(--p-space-4); }
  .nav-toggle { display: inline-block; }
  .sidebar {
    display: none; position: static; max-height: none;
    padding-bottom: var(--p-space-4); border-bottom: 1px solid var(--line);
  }
  body.nav-open .sidebar { display: block; }
  .top { padding: var(--p-space-3) var(--p-space-4); }
  .brand-sub, .top-link { display: none; }
}


/* --- procedure step labels ---------------------------------------------- */

/* Troubleshooting is eleven entries of symptom / cause / fix / confirm, and
 * Operations states a goal and how to confirm it worked. Both shapes are required by
 * DOCSITE.md. Neither had any rendering: the label was a bold run at the head of an
 * ordinary paragraph, and these same pages use bold mid-sentence for emphasis, so the
 * two were indistinguishable. A reader arriving from the symptom table on a deep link
 * had to read the prose to find the fix.
 *
 * The label text is --fg, not the kind colour. --ok measures 4.40:1 on light's --bg,
 * which is under 4.5:1 for text this size, and the constraint is to get contrast from
 * the existing tokens rather than to pick a new green. --fg clears 9:1 in both themes
 * and the uppercase mono treatment is what makes the label findable anyway.
 *
 * The kind rides on the gutter rule instead, where it is a graphic at the 3:1 bar
 * rather than text at 4.5:1. It is redundant either way - the label says "FIX." - so
 * nothing here is carried by colour alone. */
.prose p.step {
  margin: var(--p-space-6) 0 var(--p-space-3);
  padding-left: var(--p-space-4);
  border-left: 3px solid var(--line);
}
.prose p.step > strong:first-child {
  display: inline-block;
  font: 700 11px/1.6 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  margin-right: 8px;
}

/* A bare `**Symptom.**` paragraph introduces the block beneath it, so it drops the
 * trailing space. The attribute is set by `passes.step_labels`, not matched in CSS:
 * `:has(> strong:only-child)` looks right and is not, because `:only-child` counts
 * element children and ignores text nodes - it matched 27 paragraphs where 3 are bare. */
.prose p.step[data-step-bare] { margin-bottom: var(--p-space-2); }

.prose p.step[data-step="symptom"] { border-left-color: var(--warn); }
.prose p.step[data-step="cause"] { border-left-color: var(--fg-mute); }
.prose p.step[data-step="fix"],
.prose p.step[data-step="goal"],
.prose p.step[data-step="steps"] { border-left-color: var(--accent); }
.prose p.step[data-step^="confirm"] { border-left-color: var(--ok); }

/* --- transcripts -------------------------------------------------------- */

/* A command and what it printed, as one panel. Fifteen places in these docs show
 * exactly this pair and every one of them was two bordered boxes with a gap: the
 * `doctor` run, every `--dry-run` plan, `rename`, `hunt reveal`, `hunt list`.
 *
 * The wrapper owns the border and the radius; both halves give theirs up. The seam
 * between them is `--line`, the same 1px the site uses for every other panel edge, and
 * it is not the boundary's only cue - the surface change and the OUTPUT label carry it.
 *
 * The output `pre` needs the `out-body` class to keep its plain surface. `.prose
 * pre:not(.hl):not(.mermaid)` styles a hand-written `<pre>` as its own bordered panel
 * and out-specifies `.transcript > .out > pre`, so without the exclusion the output
 * half rendered as a second panel nested inside this one. That was invisible in the
 * source and visible only by reading the composited background off the live DOM. */
.transcript {
  margin: 0 0 var(--p-space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.transcript > .code {
  margin: 0;
  border: 0;
  border-radius: 0;
}

/* Output is not source in a language and cannot be usefully pasted, so it gets
 * neither the language label nor a copy button - render.py emits neither. It keeps a
 * `pre`, so it stays whitespace-exact and selectable. */
.transcript > .out {
  position: relative;
  background: var(--surface-alt);
  border-top: 1px solid var(--line);
}
.transcript > .out::before {
  content: 'output';
  position: absolute; top: 0; left: 0;
  font: 600 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-mute); padding: 6px 10px;
}
.transcript > .out > pre {
  margin: 0;
  border: 0;
  background: none;
  padding: var(--p-space-8) var(--p-space-4) var(--p-space-4);
  overflow-x: auto;
  font: 400 13.5px/1.62 var(--mono);
  color: var(--fg);
}

/* Same visible scrollbar as `.code pre`: macOS hides overlay scrollbars until you
 * scroll, which makes an overflowing transcript look like a clipped one. */
.transcript > .out > pre { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.transcript > .out > pre::-webkit-scrollbar { height: 9px; }
.transcript > .out > pre::-webkit-scrollbar-track { background: transparent; }
.transcript > .out > pre::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 999px;
}
.transcript > .out > pre::-webkit-scrollbar-thumb:hover { background: var(--fg-mute); }

/* An `.out` that is not in a transcript cannot happen from Markdown - render.py only
 * emits one inside the wrapper - and a test asserts that across every page. This keeps
 * a hand-written one from reading as unstyled body text if one ever appears. */
.prose > .out > pre { margin: 0; font: 400 13.5px/1.62 var(--mono); }

/* --- definitions -------------------------------------------------------- */

/* CommonMark has no definition list. The docs write `**term** - description`, and
 * render.py tags those on the token stream. Without this they were ordinary
 * paragraphs, so a run of them read as prose rather than as a list of terms.
 *
 * A tight list item renders no `<p>` at all, so the class lands on the `li` in that
 * case and both selectors are needed. */
.prose p.defn {
  margin: 0 0 var(--p-space-3);
  padding-left: var(--p-space-4);
  border-left: 2px solid var(--line);
}
.prose p.defn > strong:first-child,
.prose li.defn > strong:first-child {
  color: var(--accent);
}
.prose li.defn { margin-bottom: var(--p-space-3); }

/* --- code --------------------------------------------------------------- */

.prose code {
  font: 500 0.88em var(--mono);
  background: var(--surface-alt); color: var(--fg);
  padding: 2px 5px; border-radius: 4px; border: 1px solid var(--line-soft);
}

.code {
  position: relative; margin: 0 0 var(--p-space-6);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.code::before {
  content: attr(data-lang);
  position: absolute; top: 0; left: 0;
  font: 600 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-mute); padding: 6px 10px;
}
.code pre {
  margin: 0; padding: var(--p-space-8) var(--p-space-4) var(--p-space-4);
  overflow-x: auto; font: 400 13.5px/1.62 var(--mono);
}
.code pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* An untagged fence has no label, so it must not reserve a label's worth of space. */
.code:not([data-lang])::before { content: none; }
.code:not([data-lang]) pre { padding-top: var(--p-space-4); }

/* A fence inside a list item still needs to sit clear of the surrounding text. */
.prose li > .code { margin: var(--p-space-2) 0; }

/* Long lines scroll rather than wrap, so a command stays copy-pasteable. The
 * scrollbar has to be visible for that to be discoverable: macOS hides overlay
 * scrollbars until you scroll, which makes a 12px overflow look like nothing. */
.code pre, .table-scroll { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.code pre::-webkit-scrollbar, .table-scroll::-webkit-scrollbar { height: 9px; }
.code pre::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track { background: transparent; }
.code pre::-webkit-scrollbar-thumb, .table-scroll::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 999px;
}
.code pre::-webkit-scrollbar-thumb:hover, .table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--fg-mute);
}

/* Dimmed rather than hidden. At opacity 0 the button did not exist for anyone on a
 * touch screen, where there is no hover to reveal it. */
.code-copy {
  position: absolute; top: 5px; right: 6px; z-index: 2;
  background: var(--surface-alt); color: var(--fg-mute);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 3px 9px; font: 500 11px var(--mono); cursor: pointer;
  opacity: 0.45; transition: opacity 120ms ease;
}
.code:hover .code-copy, .code-copy:focus-visible, .code-copy:hover { opacity: 1; }
.code-copy:hover { color: var(--accent); border-color: var(--accent); }

/* Raw-HTML `<pre>` only. Every fence is a `.code` panel now, but a hand-written pre
 * still has to look deliberate. A descendant selector, not a child one: the old
 * `.prose > pre` missed anything nested inside a list item. */
.prose pre:not(.hl):not(.mermaid):not(.out-body) {
  margin: 0 0 var(--p-space-6); padding: var(--p-space-4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow-x: auto;
  font: 400 13.5px/1.62 var(--mono);
}

/* --- diagrams ----------------------------------------------------------- */

/* Mermaid replaces the element's text with an SVG and sets `data-processed`. Until
 * that happens - and permanently, with JavaScript disabled - the source shows as an
 * ordinary code panel, so the reader gets something readable instead of a gap. */
.diagram { margin: 0 0 var(--p-space-6); }

.diagram pre.mermaid {
  margin: 0; padding: var(--p-space-8) var(--p-space-4) var(--p-space-4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow-x: auto;
  font: 400 13.5px/1.62 var(--mono); color: var(--fg);
  position: relative;
}
.diagram pre.mermaid::before {
  content: 'diagram source';
  position: absolute; top: 0; left: 0;
  font: 600 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-mute); padding: 6px 10px;
}

.diagram pre.mermaid[data-processed] {
  padding: var(--p-space-4); text-align: center;
  background: var(--surface); border: 1px solid var(--line);
}
.diagram pre.mermaid[data-processed]::before { content: none; }
.diagram pre.mermaid[data-processed] svg { max-width: 100%; height: auto; }

/* --- tables ------------------------------------------------------------- */

/* The scroll container is the wrapper, not the table. Setting `display: block` on the
 * table was the old way to get a scrollbar and it throws away the table layout
 * algorithm, so column widths stopped being negotiated across rows. */
.table-scroll {
  margin: 0 0 var(--p-space-6); overflow-x: auto; max-width: 100%;
}
.table-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.prose table {
  width: 100%; margin: 0;
  border-collapse: collapse; font-size: 14.5px;
}
.prose thead th {
  text-align: left; font: 600 11px var(--mono);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-mute);
  padding: 8px 12px; border-bottom: 2px solid var(--line); white-space: nowrap;
}
.prose tbody td {
  padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top;
}
.prose tbody tr:hover { background: var(--surface-alt); }

/* --- callouts ----------------------------------------------------------- */

blockquote {
  margin: 0 0 var(--p-space-6); padding: var(--p-space-3) var(--p-space-4);
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--fg-mute); border-radius: var(--radius-sm);
  color: var(--fg-dim);
}
blockquote > :last-child { margin-bottom: 0; }

.callout { border-left-width: 3px; }
.callout strong:first-child {
  display: inline-block; font: 600 11px var(--mono);
  letter-spacing: 0.1em; text-transform: uppercase; margin-right: 6px;
}
.callout-note { border-left-color: var(--info); background: color-mix(in srgb, var(--info) 7%, var(--surface)); }
.callout-note strong:first-child { color: var(--info); }
.callout-tip { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
.callout-tip strong:first-child { color: var(--ok); }
.callout-warning { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, var(--surface)); }
.callout-warning strong:first-child { color: var(--warn); }
.callout-cost { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.callout-cost strong:first-child { color: var(--danger); }

/* --- reduced motion ----------------------------------------------------- */

/* The two transitions in this file are both opacity reveals on hover. Neither is
 * large, but "no preference" is not the same as "it is fine", and an element that
 * fades in is still an element that moves for someone who asked it not to. The
 * hover state itself is unaffected - only the animation between states goes. */
@media (prefers-reduced-motion: reduce) {
  .heading-link, .code-copy { transition: none; }
}


/* --- syntax highlighting (Pygments) --- */
/* light: pygments 'friendly' */
td.linenos .normal { color: #666666; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #666666; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
[data-theme="light"] .hl .hll { background-color: #ffffcc }
[data-theme="light"] .hl .c { color: #60A0B0; font-style: italic } /* Comment */
[data-theme="light"] .hl .err { border: 1px solid #F00 } /* Error */
[data-theme="light"] .hl .k { color: #007020; font-weight: bold } /* Keyword */
[data-theme="light"] .hl .o { color: #666 } /* Operator */
[data-theme="light"] .hl .ch { color: #60A0B0; font-style: italic } /* Comment.Hashbang */
[data-theme="light"] .hl .cm { color: #60A0B0; font-style: italic } /* Comment.Multiline */
[data-theme="light"] .hl .cp { color: #007020 } /* Comment.Preproc */
[data-theme="light"] .hl .cpf { color: #60A0B0; font-style: italic } /* Comment.PreprocFile */
[data-theme="light"] .hl .c1 { color: #60A0B0; font-style: italic } /* Comment.Single */
[data-theme="light"] .hl .cs { color: #60A0B0; background-color: #FFF0F0 } /* Comment.Special */
[data-theme="light"] .hl .gd { color: #A00000 } /* Generic.Deleted */
[data-theme="light"] .hl .ge { font-style: italic } /* Generic.Emph */
[data-theme="light"] .hl .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
[data-theme="light"] .hl .gr { color: #F00 } /* Generic.Error */
[data-theme="light"] .hl .gh { color: #000080; font-weight: bold } /* Generic.Heading */
[data-theme="light"] .hl .gi { color: #00A000 } /* Generic.Inserted */
[data-theme="light"] .hl .go { color: #888 } /* Generic.Output */
[data-theme="light"] .hl .gp { color: #C65D09; font-weight: bold } /* Generic.Prompt */
[data-theme="light"] .hl .gs { font-weight: bold } /* Generic.Strong */
[data-theme="light"] .hl .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
[data-theme="light"] .hl .gt { color: #04D } /* Generic.Traceback */
[data-theme="light"] .hl .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
[data-theme="light"] .hl .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
[data-theme="light"] .hl .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
[data-theme="light"] .hl .kp { color: #007020 } /* Keyword.Pseudo */
[data-theme="light"] .hl .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
[data-theme="light"] .hl .kt { color: #902000 } /* Keyword.Type */
[data-theme="light"] .hl .m { color: #40A070 } /* Literal.Number */
[data-theme="light"] .hl .s { color: #4070A0 } /* Literal.String */
[data-theme="light"] .hl .na { color: #4070A0 } /* Name.Attribute */
[data-theme="light"] .hl .nb { color: #007020 } /* Name.Builtin */
[data-theme="light"] .hl .nc { color: #0E84B5; font-weight: bold } /* Name.Class */
[data-theme="light"] .hl .no { color: #60ADD5 } /* Name.Constant */
[data-theme="light"] .hl .nd { color: #555; font-weight: bold } /* Name.Decorator */
[data-theme="light"] .hl .ni { color: #D55537; font-weight: bold } /* Name.Entity */
[data-theme="light"] .hl .ne { color: #007020 } /* Name.Exception */
[data-theme="light"] .hl .nf { color: #06287E } /* Name.Function */
[data-theme="light"] .hl .nl { color: #002070; font-weight: bold } /* Name.Label */
[data-theme="light"] .hl .nn { color: #0E84B5; font-weight: bold } /* Name.Namespace */
[data-theme="light"] .hl .nt { color: #062873; font-weight: bold } /* Name.Tag */
[data-theme="light"] .hl .nv { color: #BB60D5 } /* Name.Variable */
[data-theme="light"] .hl .ow { color: #007020; font-weight: bold } /* Operator.Word */
[data-theme="light"] .hl .w { color: #BBB } /* Text.Whitespace */
[data-theme="light"] .hl .mb { color: #40A070 } /* Literal.Number.Bin */
[data-theme="light"] .hl .mf { color: #40A070 } /* Literal.Number.Float */
[data-theme="light"] .hl .mh { color: #40A070 } /* Literal.Number.Hex */
[data-theme="light"] .hl .mi { color: #40A070 } /* Literal.Number.Integer */
[data-theme="light"] .hl .mo { color: #40A070 } /* Literal.Number.Oct */
[data-theme="light"] .hl .sa { color: #4070A0 } /* Literal.String.Affix */
[data-theme="light"] .hl .sb { color: #4070A0 } /* Literal.String.Backtick */
[data-theme="light"] .hl .sc { color: #4070A0 } /* Literal.String.Char */
[data-theme="light"] .hl .dl { color: #4070A0 } /* Literal.String.Delimiter */
[data-theme="light"] .hl .sd { color: #4070A0; font-style: italic } /* Literal.String.Doc */
[data-theme="light"] .hl .s2 { color: #4070A0 } /* Literal.String.Double */
[data-theme="light"] .hl .se { color: #4070A0; font-weight: bold } /* Literal.String.Escape */
[data-theme="light"] .hl .sh { color: #4070A0 } /* Literal.String.Heredoc */
[data-theme="light"] .hl .si { color: #70A0D0; font-style: italic } /* Literal.String.Interpol */
[data-theme="light"] .hl .sx { color: #C65D09 } /* Literal.String.Other */
[data-theme="light"] .hl .sr { color: #235388 } /* Literal.String.Regex */
[data-theme="light"] .hl .s1 { color: #4070A0 } /* Literal.String.Single */
[data-theme="light"] .hl .ss { color: #517918 } /* Literal.String.Symbol */
[data-theme="light"] .hl .bp { color: #007020 } /* Name.Builtin.Pseudo */
[data-theme="light"] .hl .fm { color: #06287E } /* Name.Function.Magic */
[data-theme="light"] .hl .vc { color: #BB60D5 } /* Name.Variable.Class */
[data-theme="light"] .hl .vg { color: #BB60D5 } /* Name.Variable.Global */
[data-theme="light"] .hl .vi { color: #BB60D5 } /* Name.Variable.Instance */
[data-theme="light"] .hl .vm { color: #BB60D5 } /* Name.Variable.Magic */
[data-theme="light"] .hl .il { color: #40A070 } /* Literal.Number.Integer.Long */

/* dark: pygments 'github-dark' */
td.linenos .normal { color: #6e7681; background-color: #0d1117; padding-left: 5px; padding-right: 5px; }
span.linenos { color: #6e7681; background-color: #0d1117; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #e6edf3; background-color: #6e7681; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #e6edf3; background-color: #6e7681; padding-left: 5px; padding-right: 5px; }
[data-theme="dark"] .hl .hll { background-color: #6e7681 }
[data-theme="dark"] .hl .c { color: #8B949E; font-style: italic } /* Comment */
[data-theme="dark"] .hl .err { color: #F85149 } /* Error */
[data-theme="dark"] .hl .esc { color: #E6EDF3 } /* Escape */
[data-theme="dark"] .hl .g { color: #E6EDF3 } /* Generic */
[data-theme="dark"] .hl .k { color: #FF7B72 } /* Keyword */
[data-theme="dark"] .hl .l { color: #A5D6FF } /* Literal */
[data-theme="dark"] .hl .n { color: #E6EDF3 } /* Name */
[data-theme="dark"] .hl .o { color: #FF7B72; font-weight: bold } /* Operator */
[data-theme="dark"] .hl .x { color: #E6EDF3 } /* Other */
[data-theme="dark"] .hl .p { color: #E6EDF3 } /* Punctuation */
[data-theme="dark"] .hl .ch { color: #8B949E; font-style: italic } /* Comment.Hashbang */
[data-theme="dark"] .hl .cm { color: #8B949E; font-style: italic } /* Comment.Multiline */
[data-theme="dark"] .hl .cp { color: #8B949E; font-weight: bold; font-style: italic } /* Comment.Preproc */
[data-theme="dark"] .hl .cpf { color: #8B949E; font-style: italic } /* Comment.PreprocFile */
[data-theme="dark"] .hl .c1 { color: #8B949E; font-style: italic } /* Comment.Single */
[data-theme="dark"] .hl .cs { color: #8B949E; font-weight: bold; font-style: italic } /* Comment.Special */
[data-theme="dark"] .hl .gd { color: #FFA198; background-color: #490202 } /* Generic.Deleted */
[data-theme="dark"] .hl .ge { color: #E6EDF3; font-style: italic } /* Generic.Emph */
[data-theme="dark"] .hl .ges { color: #E6EDF3; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
[data-theme="dark"] .hl .gr { color: #FFA198 } /* Generic.Error */
[data-theme="dark"] .hl .gh { color: #79C0FF; font-weight: bold } /* Generic.Heading */
[data-theme="dark"] .hl .gi { color: #56D364; background-color: #0F5323 } /* Generic.Inserted */
[data-theme="dark"] .hl .go { color: #8B949E } /* Generic.Output */
[data-theme="dark"] .hl .gp { color: #8B949E } /* Generic.Prompt */
[data-theme="dark"] .hl .gs { color: #E6EDF3; font-weight: bold } /* Generic.Strong */
[data-theme="dark"] .hl .gu { color: #79C0FF } /* Generic.Subheading */
[data-theme="dark"] .hl .gt { color: #FF7B72 } /* Generic.Traceback */
[data-theme="dark"] .hl .g-Underline { color: #E6EDF3; text-decoration: underline } /* Generic.Underline */
[data-theme="dark"] .hl .kc { color: #79C0FF } /* Keyword.Constant */
[data-theme="dark"] .hl .kd { color: #FF7B72 } /* Keyword.Declaration */
[data-theme="dark"] .hl .kn { color: #FF7B72 } /* Keyword.Namespace */
[data-theme="dark"] .hl .kp { color: #79C0FF } /* Keyword.Pseudo */
[data-theme="dark"] .hl .kr { color: #FF7B72 } /* Keyword.Reserved */
[data-theme="dark"] .hl .kt { color: #FF7B72 } /* Keyword.Type */
[data-theme="dark"] .hl .ld { color: #79C0FF } /* Literal.Date */
[data-theme="dark"] .hl .m { color: #A5D6FF } /* Literal.Number */
[data-theme="dark"] .hl .s { color: #A5D6FF } /* Literal.String */
[data-theme="dark"] .hl .na { color: #E6EDF3 } /* Name.Attribute */
[data-theme="dark"] .hl .nb { color: #E6EDF3 } /* Name.Builtin */
[data-theme="dark"] .hl .nc { color: #F0883E; font-weight: bold } /* Name.Class */
[data-theme="dark"] .hl .no { color: #79C0FF; font-weight: bold } /* Name.Constant */
[data-theme="dark"] .hl .nd { color: #D2A8FF; font-weight: bold } /* Name.Decorator */
[data-theme="dark"] .hl .ni { color: #FFA657 } /* Name.Entity */
[data-theme="dark"] .hl .ne { color: #F0883E; font-weight: bold } /* Name.Exception */
[data-theme="dark"] .hl .nf { color: #D2A8FF; font-weight: bold } /* Name.Function */
[data-theme="dark"] .hl .nl { color: #79C0FF; font-weight: bold } /* Name.Label */
[data-theme="dark"] .hl .nn { color: #FF7B72 } /* Name.Namespace */
[data-theme="dark"] .hl .nx { color: #E6EDF3 } /* Name.Other */
[data-theme="dark"] .hl .py { color: #79C0FF } /* Name.Property */
[data-theme="dark"] .hl .nt { color: #7EE787 } /* Name.Tag */
[data-theme="dark"] .hl .nv { color: #79C0FF } /* Name.Variable */
[data-theme="dark"] .hl .ow { color: #FF7B72; font-weight: bold } /* Operator.Word */
[data-theme="dark"] .hl .pm { color: #E6EDF3 } /* Punctuation.Marker */
[data-theme="dark"] .hl .w { color: #6E7681 } /* Text.Whitespace */
[data-theme="dark"] .hl .mb { color: #A5D6FF } /* Literal.Number.Bin */
[data-theme="dark"] .hl .mf { color: #A5D6FF } /* Literal.Number.Float */
[data-theme="dark"] .hl .mh { color: #A5D6FF } /* Literal.Number.Hex */
[data-theme="dark"] .hl .mi { color: #A5D6FF } /* Literal.Number.Integer */
[data-theme="dark"] .hl .mo { color: #A5D6FF } /* Literal.Number.Oct */
[data-theme="dark"] .hl .sa { color: #79C0FF } /* Literal.String.Affix */
[data-theme="dark"] .hl .sb { color: #A5D6FF } /* Literal.String.Backtick */
[data-theme="dark"] .hl .sc { color: #A5D6FF } /* Literal.String.Char */
[data-theme="dark"] .hl .dl { color: #79C0FF } /* Literal.String.Delimiter */
[data-theme="dark"] .hl .sd { color: #A5D6FF } /* Literal.String.Doc */
[data-theme="dark"] .hl .s2 { color: #A5D6FF } /* Literal.String.Double */
[data-theme="dark"] .hl .se { color: #79C0FF } /* Literal.String.Escape */
[data-theme="dark"] .hl .sh { color: #79C0FF } /* Literal.String.Heredoc */
[data-theme="dark"] .hl .si { color: #A5D6FF } /* Literal.String.Interpol */
[data-theme="dark"] .hl .sx { color: #A5D6FF } /* Literal.String.Other */
[data-theme="dark"] .hl .sr { color: #79C0FF } /* Literal.String.Regex */
[data-theme="dark"] .hl .s1 { color: #A5D6FF } /* Literal.String.Single */
[data-theme="dark"] .hl .ss { color: #A5D6FF } /* Literal.String.Symbol */
[data-theme="dark"] .hl .bp { color: #E6EDF3 } /* Name.Builtin.Pseudo */
[data-theme="dark"] .hl .fm { color: #D2A8FF; font-weight: bold } /* Name.Function.Magic */
[data-theme="dark"] .hl .vc { color: #79C0FF } /* Name.Variable.Class */
[data-theme="dark"] .hl .vg { color: #79C0FF } /* Name.Variable.Global */
[data-theme="dark"] .hl .vi { color: #79C0FF } /* Name.Variable.Instance */
[data-theme="dark"] .hl .vm { color: #79C0FF } /* Name.Variable.Magic */
[data-theme="dark"] .hl .il { color: #A5D6FF } /* Literal.Number.Integer.Long */

/* --- print (last, so it can override everything above) --- */
@media print {
  .top, .sidebar, .toc, .pager, .code-copy, .skip { display: none; }
  .layout { grid-template-columns: 1fr; padding: 0; }
  body { background: #fff; color: #000; }

  /* INK, REGARDLESS OF THEME. `body { color: #000 }` is not enough: every content
   * rule sets `color: var(--fg)` and out-specifies it. The docs default to the dark
   * theme, so printing an unmodified page put #f0fbf5 body text on a #ffffff page -
   * measured at 1.06:1, which is invisible on paper. Headings escaped it only because
   * nothing sets their colour. Every element that pins --fg or --fg-dim has to be
   * named here. */
  .prose, .prose p, .prose li, .prose td, .prose th, .lede,
  .transcript > .out > pre { color: #000; }
  /* `:first-child` counts toward specificity, so the print override has to carry it
   * too - without it the content rule won and the label stayed near-white. */
  .prose p.step > strong:first-child { color: #000; }
  blockquote, .foot { color: #222; }

  /* A scroll container prints clipped, so let them all wrap onto the page instead. */
  .table-scroll { overflow: visible; }
  .code pre, .transcript > .out > pre { overflow: visible; white-space: pre-wrap; }

  /* The OUTPUT label and the seam are the only things telling the two halves of a
   * transcript apart once the surface tint is gone, so both survive the reset. */
  .transcript > .out { background: none; border-top: 1px solid #999; }
  .transcript > .out::before { color: #555; }

  /* `[data-step]` is needed, not just `p.step`: the per-kind rules carry an attribute
   * selector and out-specify a plainer print override, so the gutters kept their
   * screen colours. The dark theme's mint accent at 3px on white paper is close to
   * nothing, which is why these grey out rather than print as-is. */
  .prose p.step, .prose p.step[data-step] { border-left-color: #999; }
}
