/* content.css — everything inside `.md-typeset` on content pages: heading scale,
   prose rhythm, links, lists, code (inline + blocks), tables, admonitions,
   pymdownx tabs, keys, footnotes, images/figures (.dg-figure, .dg-screenshot),
   Material card grids, .dg-links, definition lists, tooltips, search marks, 404.
   Colours, type, radii and spacing come from tokens.css roles only. Site chrome
   (header, nav, TOC, article panel) lives in chrome.css; home page and cards in
   components.css; diagrams in diagrams.css. */

/* --- Base prose ------------------------------------------------------------ */
.md-typeset {
  /* 13px sits between the 12/14 steps; used for code, captions and code labels. */
  --dg-size-13: calc((var(--font-size-12) + var(--font-size-14)) / 2);
  font-family: var(--type-body-large-family);
  font-size: var(--type-body-large-size);
  font-weight: var(--type-body-large-weight);
  line-height: var(--type-body-large-line-height);
  letter-spacing: var(--type-body-large-tracking);
  overflow-wrap: break-word;
}

.md-typeset p {
  margin: 0 0 var(--space-16);
}

.md-typeset strong {
  font-weight: var(--font-weight-semiBold);
}

.md-typeset small {
  font-size: var(--type-body-medium-size);
  color: var(--fg-secondary);
}

/* --- Headings -------------------------------------------------------------- */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  color: var(--fg-primary);
  text-wrap: balance;
}

.md-typeset h1 {
  font-family: var(--type-display-small-family);
  font-size: var(--type-display-small-size);
  font-weight: var(--type-display-small-weight);
  line-height: var(--type-display-small-line-height);
  letter-spacing: var(--type-display-small-tracking);
  margin: 0 0 var(--space-12);
}

.md-typeset h2 {
  font-family: var(--type-headline-small-family);
  font-size: var(--type-headline-small-size);
  font-weight: var(--type-headline-small-weight);
  line-height: var(--type-headline-small-line-height);
  letter-spacing: var(--type-headline-small-tracking);
  margin: var(--space-40) 0 var(--space-12);
}

.md-typeset h3 {
  font-family: var(--type-title-extra-large-family);
  font-size: var(--type-title-extra-large-size);
  font-weight: var(--type-title-extra-large-weight);
  line-height: var(--type-title-extra-large-line-height);
  letter-spacing: var(--type-title-extra-large-tracking);
  margin: var(--space-24) 0 var(--space-8);
}

.md-typeset h4 {
  font-family: var(--type-title-large-family);
  font-size: var(--type-title-large-size);
  font-weight: var(--type-title-large-weight);
  line-height: var(--type-title-large-line-height);
  letter-spacing: var(--type-title-large-tracking);
  margin: var(--space-24) 0 var(--space-8);
}

.md-typeset h5,
.md-typeset h6 {
  font-family: var(--type-title-medium-family);
  font-size: var(--type-title-medium-size);
  font-weight: var(--type-title-medium-weight);
  line-height: var(--type-title-medium-line-height);
  letter-spacing: var(--type-title-medium-tracking);
  text-transform: none;
  margin: var(--space-16) 0 var(--space-8);
}

/* Tighter when a heading follows the title or another heading directly. */
.md-typeset h1 + h2,
.md-typeset h2 + h3,
.md-typeset h3 + h4 {
  margin-top: var(--space-16);
}

.md-typeset h1 code,
.md-typeset h2 code,
.md-typeset h3 code,
.md-typeset h4 code {
  font-size: 0.8em;
  font-weight: var(--font-weight-medium);
  padding: 0 var(--space-6);
}

/* Lead paragraph: the page description under the title. */
.md-typeset h1 + p {
  font-size: var(--font-size-18);
  line-height: var(--line-height-28);
  color: var(--fg-secondary);
  margin-bottom: var(--space-24);
  text-wrap: pretty;
}

/* A lead that carries inline code is a working paragraph, not a tagline. */
.md-typeset h1 + p:has(code) {
  font-size: var(--type-body-large-size);
  line-height: var(--type-body-large-line-height);
}

/* --- Links ----------------------------------------------------------------- */
.md-typeset a {
  color: var(--fg-link);
  text-decoration: underline;
  text-decoration-thickness: var(--border-width-1);
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, currentcolor 40%, transparent);
  transition: color var(--dg-motion), text-decoration-color var(--dg-motion);
}

.md-typeset a:hover,
.md-typeset a:focus {
  color: var(--fg-link-hover);
  text-decoration-color: currentcolor;
}

.md-typeset a code {
  color: var(--fg-primary);
}

.md-typeset a:hover code,
.md-typeset a:focus code {
  color: var(--fg-primary);
  background-color: var(--bg-selection-container-hover);
}

/* Links on nested surfaces read in the text colour with a plain underline
   (--fg-link is not AA on --bg-surface-nested in every theme). */
.md-typeset :is(.admonition, details, .highlight, pre, blockquote, .dg-screenshot, .grid.cards) a {
  color: var(--fg-primary);
  text-decoration-color: color-mix(in srgb, currentcolor 50%, transparent);
}

.md-typeset :is(.admonition, details, .highlight, pre, blockquote, .dg-screenshot, .grid.cards) a:hover,
.md-typeset :is(.admonition, details, .highlight, pre, blockquote, .dg-screenshot, .grid.cards) a:focus {
  color: var(--fg-primary);
  text-decoration-color: currentcolor;
}

/* --- Lists ----------------------------------------------------------------- */
.md-typeset ul,
.md-typeset ol {
  margin: 0 0 var(--space-16) var(--space-8);
  padding: 0;
}

.md-typeset ul {
  list-style-type: disc;
}

.md-typeset ul li,
.md-typeset ol li {
  margin: 0 0 var(--space-6) var(--space-16);
}

.md-typeset ul li:last-child,
.md-typeset ol li:last-child {
  margin-bottom: 0;
}

.md-typeset li::marker {
  color: var(--fg-tertiary);
}

.md-typeset ol li::marker {
  color: var(--fg-secondary);
  font-variant-numeric: tabular-nums;
}

.md-typeset li > p {
  margin: 0 0 var(--space-6);
}

.md-typeset li > p:last-child {
  margin-bottom: 0;
}

.md-typeset li ul,
.md-typeset li ol {
  margin: var(--space-6) 0 var(--space-6) var(--space-4);
}

.md-typeset li .highlight,
.md-typeset li pre,
.md-typeset li .admonition,
.md-typeset li table:not([class]) {
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.md-typeset .task-list-indicator::before {
  background-color: var(--fg-tertiary);
}

.md-typeset [type="checkbox"]:checked + .task-list-indicator::before {
  background-color: var(--fg-success);
}

/* --- Rules and quotes ------------------------------------------------------ */
.md-typeset hr {
  border: 0;
  border-top: var(--border-width-1) solid var(--stroke-primary);
  margin: var(--space-32) 0;
}

.md-typeset blockquote {
  margin: var(--space-16) 0;
  padding: 0 0 0 var(--space-16);
  border-left: var(--border-width-2) solid var(--stroke-secondary);
  color: var(--fg-secondary);
}

.md-typeset blockquote > :last-child {
  margin-bottom: 0;
}

/* --- Inline code ------------------------------------------------------------ */
.md-typeset code {
  font-family: var(--type-code-medium-family);
  font-size: var(--dg-size-13);
  font-weight: var(--font-weight-regular);
  color: var(--fg-primary);
  background-color: var(--bg-surface-nested);
  border: var(--border-width-1) solid var(--stroke-primary);
  border-radius: var(--radius-4);
  padding: 1px var(--space-6);
  box-decoration-break: clone;
  word-break: break-word;
}

/* --- Code blocks ------------------------------------------------------------ */
.md-typeset pre {
  margin: var(--space-16) 0;
  line-height: var(--line-height-20);
  position: relative;
}

.md-typeset pre > code {
  /* The copy button floats on its own fade, so no lane is reserved; only touch,
     where the button is always on, keeps one. */
  --dg-code-lane: var(--space-16);
  display: block;
  font-size: var(--dg-size-13);
  line-height: var(--line-height-20);
  color: var(--fg-primary);
  background-color: var(--bg-surface-nested);
  border: var(--border-width-1) solid var(--stroke-primary);
  border-radius: var(--radius-8);
  padding: var(--space-14) var(--dg-code-lane) var(--space-14) var(--space-16);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--stroke-tertiary) 60%, transparent) transparent;
}

@media (hover: none) {
  .md-typeset pre > code {
    --dg-code-lane: calc(var(--space-40) + var(--space-8));
  }
}

.md-typeset pre > code:hover {
  scrollbar-color: color-mix(in srgb, var(--stroke-tertiary) 80%, transparent) transparent;
}

.md-typeset pre > code::-webkit-scrollbar {
  height: var(--space-8);
  width: var(--space-8);
}

.md-typeset pre > code::-webkit-scrollbar-thumb {
  background-color: color-mix(in srgb, var(--stroke-tertiary) 60%, transparent);
  border-radius: var(--radius-4);
}

/* Overflow cue for the two horizontal scrollers (code blocks, wide tables): a
   fade on the right edge that lifts once scrolled to the end. The base opacity
   is 0, so a block that does not overflow — whose timeline is inactive and whose
   animation therefore never applies — shows no fade at all. */
@supports (animation-timeline: scroll()) {
  .md-typeset pre {
    timeline-scope: --dg-code-x;
  }

  .md-typeset pre > code {
    scroll-timeline: --dg-code-x x;
  }

  .md-typeset .md-typeset__scrollwrap {
    timeline-scope: --dg-table-x;
  }

  .md-typeset .md-typeset__table {
    scroll-timeline: --dg-table-x x;
  }

  .md-typeset pre::after,
  .md-typeset .md-typeset__scrollwrap::after {
    content: "";
    position: absolute;
    top: var(--border-width-1);
    right: var(--border-width-1);
    bottom: var(--border-width-1);
    width: var(--space-40);
    opacity: 0;
    pointer-events: none;
    border-radius: 0 var(--radius-8) var(--radius-8) 0;
    animation: dg-scroll-fade linear both;
  }

  .md-typeset pre::after {
    background: linear-gradient(to right, transparent, var(--bg-surface-nested));
    animation-timeline: --dg-code-x;
  }

  .md-typeset .md-typeset__scrollwrap::after {
    background: linear-gradient(to right, transparent, var(--bg-surface-container));
    animation-timeline: --dg-table-x;
  }

  @keyframes dg-scroll-fade {
    from { opacity: 1; }
    to { opacity: 0; }
  }
}

/* Filename strip sits inside the same frame, above the code. */
.md-typeset .highlight span.filename {
  display: flow-root;
  margin: var(--space-16) 0 0;
  padding: var(--space-8) var(--space-16);
  font-family: var(--type-code-small-family);
  font-size: var(--type-code-small-size);
  line-height: var(--type-code-small-line-height);
  font-weight: var(--font-weight-medium);
  color: var(--fg-secondary);
  background-color: var(--bg-surface-nested);
  border: var(--border-width-1) solid var(--stroke-primary);
  border-bottom: 0;
  border-radius: var(--radius-8) var(--radius-8) 0 0;
}

.md-typeset .highlight span.filename + pre {
  margin-top: 0;
}

.md-typeset .highlight span.filename + pre > code {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

/* Secondary text on the nested surface: comments, operators, punctuation,
   filename strip, line numbers, screenshot captions. --dg-fg-on-nested
   (chrome.css) is fg-secondary, stepped up where that fails AA on nested. */
.md-typeset :is(
  .highlight :is(.c, .c1, .ch, .cm, .cs, .sd, .o, .ow, .p),
  .highlight span.filename,
  .highlighttable .linenos,
  .highlighttable .linenodiv pre,
  .highlighttable .linenos a,
  .dg-screenshot > figcaption,
  .dg-screenshot > .dg-figcaption
) {
  color: var(--dg-fg-on-nested);
}

/* Highlighted lines (hl_lines): colours are bridged in chrome.css. */
.md-typeset .highlight .hll {
  display: block;
  margin: 0 calc(-1 * var(--dg-code-lane)) 0 calc(-1 * var(--space-16));
  padding: 0 var(--dg-code-lane) 0 var(--space-16);
  background-color: var(--md-code-hl-color--light);
  box-shadow: 2px 0 0 0 var(--md-code-hl-color) inset;
}

/* Line-number tables (linenums): one frame around gutter + code. */
.md-typeset .highlighttable {
  margin: var(--space-16) 0;
  border: var(--border-width-1) solid var(--stroke-primary);
  border-radius: var(--radius-8);
  overflow: hidden;
  background-color: var(--bg-surface-nested);
}

.md-typeset .highlighttable pre > code,
.md-typeset .highlighttable span.filename {
  border: 0;
  border-radius: 0;
}

.md-typeset .highlighttable span.filename {
  border-bottom: var(--border-width-1) solid var(--stroke-primary);
  margin: 0;
}

.md-typeset .highlighttable .linenos {
  font-size: var(--dg-size-13);
  line-height: var(--line-height-20);
  padding: var(--space-14) 0 var(--space-14) var(--space-16);
  background-color: var(--bg-surface-nested);
  border-right: var(--border-width-1) solid var(--stroke-primary);
  color: var(--fg-secondary);
  user-select: none;
}

.md-typeset .highlighttable .linenodiv {
  box-shadow: none;
}

.md-typeset .highlighttable .linenodiv pre {
  color: var(--fg-secondary);
}

.md-typeset .highlighttable .linenos a,
.md-typeset .highlighttable .linenos a:hover {
  color: var(--fg-secondary);
  text-decoration: none;
}

/* Copy button (`.md-code__nav` > `.md-code__button`): 28px icon button, visible
   while the block is hovered/focused, always on touch. No lane is reserved for
   it, so the nav carries its own nested backing that ramps up over 24px and the
   button floats on top of it. */
.md-typeset .md-code__nav,
.md-typeset :hover > .md-code__nav {
  top: var(--border-width-1);
  right: var(--border-width-1);
  gap: var(--space-4);
  padding: calc(var(--space-8) - var(--border-width-1)) calc(var(--space-8) - var(--border-width-1)) 0 var(--space-24);
  background: linear-gradient(to right, transparent, var(--bg-surface-nested) var(--space-24));
  border-radius: 0 calc(var(--radius-8) - var(--border-width-1)) 0 0;
  opacity: 0;
  transition: opacity var(--dg-motion);
}

.md-typeset .md-code__button {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-6);
  color: var(--fg-secondary);
  background-color: var(--bg-surface-container);
  border: var(--border-width-1) solid var(--stroke-primary);
  transition: color var(--dg-motion), background-color var(--dg-motion);
}

.md-typeset .md-code__button::after {
  width: var(--space-16);
  height: var(--space-16);
}

.md-typeset pre:hover .md-code__nav,
.md-typeset .md-code__nav:focus-within {
  opacity: 1;
}

@media (hover: none) {
  .md-typeset .md-code__nav {
    opacity: 1;
  }
}

.md-typeset .md-code__button:hover,
.md-typeset .md-code__button.focus-visible {
  color: var(--fg-primary);
  background-color: var(--bg-action-secondary-hover);
}

.md-typeset .md-code__button--active {
  color: var(--fg-success) !important;
}

.md-typeset .md-code__button:focus-visible {
  outline: none;
  box-shadow: var(--dg-focus-ring);
}

/* Annotations (content.code.annotate): the (+) marker inherits the text colour. */
.md-typeset .md-annotation__index {
  color: var(--fg-secondary);
}

.md-typeset .md-annotation__index::after {
  background-color: var(--fg-secondary);
}

.md-typeset .md-annotation:hover .md-annotation__index::after,
.md-typeset .md-annotation:focus-within .md-annotation__index::after {
  background-color: var(--fg-primary);
}

/* --- Tables ---------------------------------------------------------------- */
.md-typeset table:not([class]) {
  display: table;
  width: 100%;
  font-size: var(--type-body-medium-size);
  line-height: var(--type-body-medium-line-height);
  color: var(--fg-primary);
  background-color: var(--bg-surface-container);
  border: var(--border-width-1) solid var(--stroke-primary);
  border-radius: var(--radius-8);
  border-spacing: 0;
  overflow: hidden;
  box-shadow: none;
}

.md-typeset table:not([class]) th {
  font-family: var(--type-label-medium-family);
  font-size: var(--type-label-medium-size);
  line-height: var(--type-label-medium-line-height);
  font-weight: var(--type-label-medium-weight);
  color: var(--fg-secondary);
  background-color: var(--bg-surface-container);
  padding: var(--space-8) var(--space-12);
  min-width: 0;
  vertical-align: middle;
}

.md-typeset table:not([class]) td {
  padding: var(--space-10) var(--space-12);
  border-top: var(--border-width-1) solid var(--stroke-primary);
  vertical-align: top;
}

/* Floor for a column, so a narrow viewport scrolls the table instead of
   shredding cells into one-character ribbons. Wide enough tables ignore it. */
.md-typeset table:not([class]) :is(th, td) {
  min-width: 5rem;
}

/* A package-name column needs more room than the floor above, or the chip
   wraps after two characters. */
.md-typeset table:not([class]) :is(th, td):has(> code:only-child) {
  min-width: 11rem;
}

.md-typeset table:not([class]) tbody tr {
  transition: background-color var(--dg-motion);
}

.md-typeset table:not([class]) tbody tr:hover {
  background-color: var(--bg-selection-container-hover);
  box-shadow: none;
}

/* Chips wrap like the prose around them: keeping them on one line pushes the
   min-content width of a column past the measure and starves the rest. A wrapped
   chip is sliced, so it reads as one continuous shape instead of two pills. */
.md-typeset table:not([class]) code {
  font-size: var(--type-code-small-size);
  white-space: normal;
  /* Break at the hyphens and slashes a package name already offers before
     splitting a word mid-token. */
  overflow-wrap: break-word;
  word-break: normal;
  box-decoration-break: slice;
}

.md-typeset table:not([class]) + * {
  margin-top: var(--space-16);
}

/* Material wraps wide tables for horizontal scrolling; the wrap carries the
   right-edge fade cue (see the @supports block above). */
.md-typeset .md-typeset__scrollwrap {
  position: relative;
  margin: var(--space-16) 0;
}

.md-typeset .md-typeset__table {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--stroke-tertiary) 60%, transparent) transparent;
}

.md-typeset .md-typeset__table::-webkit-scrollbar {
  height: var(--space-8);
}

.md-typeset .md-typeset__table::-webkit-scrollbar-thumb {
  background-color: color-mix(in srgb, var(--stroke-tertiary) 60%, transparent);
  border-radius: var(--radius-4);
}

/* --- Admonitions (app Alert idiom) ---------------------------------------- */
.md-typeset .admonition,
.md-typeset details {
  --dg-alert-tint: var(--fg-secondary);
  font-size: var(--type-body-medium-size);
  line-height: var(--type-body-medium-line-height);
  color: var(--fg-primary);
  background-color: var(--bg-surface-container);
  border: var(--border-width-1) solid var(--stroke-primary);
  border-radius: var(--radius-8);
  box-shadow: none;
  margin: var(--space-16) 0;
  padding: 0 var(--space-16);
}

.md-typeset .admonition > .admonition-title,
.md-typeset :is(details, .admonition) > summary {
  font-family: var(--type-body-medium-emphasized-family);
  font-size: var(--type-body-medium-emphasized-size);
  line-height: var(--type-body-medium-emphasized-line-height);
  font-weight: var(--type-body-medium-emphasized-weight);
  color: var(--fg-primary);
  background-color: transparent;
  border: 0;
  border-radius: var(--radius-8);
  margin: 0 calc(-1 * var(--space-16));
  padding: var(--space-12) var(--space-16) var(--space-4) calc(var(--space-16) + var(--space-16) + var(--space-12));
  position: relative;
}

.md-typeset .admonition > .admonition-title:last-child,
.md-typeset :is(details, .admonition):not([open]) > summary {
  padding-bottom: var(--space-12);
  border-radius: var(--radius-8);
}

.md-typeset .admonition > .admonition-title::before,
.md-typeset :is(details, .admonition) > summary::before {
  left: var(--space-16);
  top: calc(var(--space-12) + 2px);
  width: var(--space-16);
  height: var(--space-16);
  background-color: var(--dg-alert-tint);
}

.md-typeset .admonition > p:not(.admonition-title),
.md-typeset details > p {
  margin: 0 0 var(--space-8);
}

.md-typeset .admonition > :last-child,
.md-typeset details > :last-child {
  margin-bottom: var(--space-12);
}

.md-typeset .admonition > .admonition-title + *,
.md-typeset :is(details, .admonition) > summary + * {
  margin-top: var(--space-4);
}

.md-typeset .admonition ul,
.md-typeset .admonition ol,
.md-typeset details ul,
.md-typeset details ol {
  margin-bottom: var(--space-8);
}

.md-typeset .admonition pre,
.md-typeset details pre,
.md-typeset .admonition .highlighttable,
.md-typeset details .highlighttable {
  margin: var(--space-8) 0 var(--space-12);
}

.md-typeset .admonition code,
.md-typeset details code {
  font-size: var(--type-code-small-size);
}

.md-typeset .admonition table:not([class]),
.md-typeset details table:not([class]) {
  background-color: var(--bg-surface-container);
}

/* Per-type tint: icon only; borders stay neutral (danger keeps the app's error ring). */
.md-typeset :is(.admonition, details):is(.note, .info, .todo, .question, .help, .faq, .abstract, .summary, .tldr) {
  --dg-alert-tint: var(--fg-link);
  border-color: var(--stroke-primary);
}

.md-typeset :is(.admonition, details):is(.tip, .hint, .important, .success, .check, .done) {
  --dg-alert-tint: var(--fg-success);
  border-color: var(--stroke-primary);
}

.md-typeset :is(.admonition, details):is(.warning, .caution, .attention) {
  --dg-alert-tint: var(--fg-warning);
  border-color: var(--stroke-primary);
}

.md-typeset :is(.admonition, details):is(.danger, .error, .failure, .fail, .missing, .bug) {
  --dg-alert-tint: var(--fg-error);
  border-color: var(--stroke-error);
}

.md-typeset :is(.admonition, details):is(.example, .quote, .cite) {
  --dg-alert-tint: var(--fg-secondary);
  border-color: var(--stroke-primary);
}

/* No halo on the box: the focused element inside carries the ring. The pseudo
   is doubled to outrank Material's per-type `.admonition.note:focus-within`. */
.md-typeset :is(.admonition, details):focus-within:focus-within {
  box-shadow: none;
}

/* Collapsible details: summary is a full-width row with a chevron. */
.md-typeset :is(details, .admonition) > summary {
  cursor: pointer;
  padding-right: calc(var(--space-16) + var(--space-16) + var(--space-8));
  transition: background-color var(--dg-motion);
}

.md-typeset :is(details, .admonition) > summary:hover {
  background-color: var(--bg-selection-container-hover);
}

.md-typeset :is(details, .admonition)[open] > summary {
  border-radius: var(--radius-8) var(--radius-8) 0 0;
}

.md-typeset :is(details, .admonition) > summary::after {
  right: var(--space-16);
  top: calc(var(--space-12) + 2px);
  width: var(--space-16);
  height: var(--space-16);
  color: var(--fg-secondary);
  background-color: currentcolor;
  transition: transform var(--dg-motion);
}

.md-typeset :is(details, .admonition) > summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--fg-secondary);
}

/* --- Tabs (pymdownx.tabbed): app segmented control ------------------------ */
.md-typeset .tabbed-set {
  margin: var(--space-16) 0;
  border-radius: 0;
}

.md-typeset .tabbed-labels {
  width: fit-content;
  max-width: 100%;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-10);
  background-color: var(--bg-surface-nested);
  box-shadow: none;
}

.md-typeset .tabbed-labels > label {
  position: relative;
  z-index: 1;
  padding: var(--space-4) var(--space-12);
  border: 0;
  border-radius: var(--radius-6);
  font-family: var(--type-body-medium-emphasized-family);
  font-size: var(--type-body-medium-emphasized-size);
  line-height: var(--type-body-medium-emphasized-line-height);
  font-weight: var(--type-body-medium-emphasized-weight);
  color: var(--dg-fg-on-nested);
  transition: color var(--dg-motion);
}

.md-typeset .tabbed-labels > label:hover {
  color: var(--fg-primary);
}

.md-typeset .tabbed-labels--linked > label > a {
  padding: var(--space-4) var(--space-12);
  color: inherit;
  text-decoration: none;
}

/* Material moves this indicator under the checked label; it becomes the active segment. */
.js .md-typeset .tabbed-labels::before {
  top: var(--space-4);
  bottom: var(--space-4);
  height: auto;
  border-radius: var(--radius-6);
  background-color: var(--bg-action-primary-inverted);
  box-shadow: var(--dg-shadow-card);
  z-index: 0;
}

.md-typeset .tabbed-set > input.focus-visible ~ .tabbed-labels::before {
  background-color: var(--bg-action-primary-inverted);
  box-shadow: var(--dg-focus-ring), var(--dg-shadow-card);
}

.md-typeset .tabbed-block {
  padding-top: var(--space-12);
}

.md-typeset .tabbed-block > :first-child {
  margin-top: 0;
}

.md-typeset .tabbed-block > .highlight:first-child > pre,
.md-typeset .tabbed-block > .highlight:first-child > .highlighttable,
.md-typeset .tabbed-block > pre:first-child {
  margin-top: 0;
}

.md-typeset .tabbed-block > .highlight:first-child span.filename {
  margin-top: 0;
}

/* --- Keys (pymdownx.keys) --------------------------------------------------- */
.md-typeset kbd {
  font-family: var(--type-code-small-family);
  font-size: var(--type-code-small-size);
  line-height: var(--type-code-small-line-height);
  color: var(--fg-primary);
  background-color: var(--bg-surface-container);
  border: var(--border-width-1) solid var(--stroke-primary);
  border-radius: var(--radius-4);
  box-shadow: 0 1px 0 0 var(--stroke-secondary);
  padding: 1px var(--space-6);
  vertical-align: baseline;
}

.md-typeset .keys span {
  color: var(--fg-tertiary);
  padding: 0 var(--space-2);
}

/* --- Footnotes -------------------------------------------------------------- */
.md-typeset .footnote-ref {
  font-size: 0.75em;
  font-weight: var(--font-weight-medium);
  text-decoration: none;
}

.md-typeset .footnote {
  margin-top: var(--space-32);
  font-size: var(--type-body-medium-size);
  line-height: var(--type-body-medium-line-height);
  color: var(--fg-secondary);
}

.md-typeset .footnote > hr {
  margin: 0 0 var(--space-16);
}

.md-typeset .footnote > ol > li:target {
  color: var(--fg-primary);
}

.md-typeset .footnote-backref,
.md-typeset .footnote-backref:hover {
  color: var(--fg-link);
}

/* --- Images and figures ---------------------------------------------------- */
.md-typeset :is(p, li, figure, .dg-figure, .dg-screenshot) > img:not(.twemoji) {
  border-radius: var(--radius-8);
}

.md-typeset figure {
  margin: var(--space-24) auto;
}

.md-typeset figcaption {
  font-style: normal;
  font-size: var(--dg-size-13);
  line-height: var(--line-height-20);
  color: var(--fg-secondary);
  margin: var(--space-8) auto 0;
  max-width: none;
}

/* Hand-authored HTML/SVG figure: a widget card. */
.md-typeset .dg-figure {
  display: block;
  width: 100%;
  margin: var(--space-24) 0;
  padding: var(--space-16);
  background-color: var(--bg-surface-container);
  border: var(--border-width-1) solid var(--stroke-primary);
  border-radius: var(--radius-12);
  box-shadow: var(--dg-shadow-card);
  overflow: hidden;
  text-align: left;
}

.md-typeset .dg-figcaption {
  display: block;
  margin: 0 0 var(--space-8);
  font-family: var(--type-label-medium-family);
  font-size: var(--type-label-medium-size);
  line-height: var(--type-label-medium-line-height);
  font-weight: var(--type-label-medium-weight);
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg-secondary);
}

/* Reserved app-screenshot frame (+ phone variant). */
.md-typeset .dg-screenshot {
  display: block;
  width: 100%;
  margin: var(--space-24) 0;
  padding: var(--space-8);
  background-color: var(--bg-surface-nested);
  border: var(--border-width-1) solid var(--stroke-primary);
  border-radius: var(--radius-12);
  text-align: center;
}

.md-typeset .dg-screenshot > img,
.md-typeset .dg-screenshot > picture > img,
.md-typeset .dg-screenshot > video {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: var(--radius-8);
}

.md-typeset .dg-screenshot > figcaption,
.md-typeset .dg-screenshot > .dg-figcaption {
  margin: var(--space-8) 0 var(--space-2);
  font-family: var(--type-body-medium-family);
  font-size: var(--dg-size-13);
  line-height: var(--line-height-20);
  font-weight: var(--font-weight-regular);
  color: var(--fg-secondary);
}

.md-typeset .dg-screenshot--phone {
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Card grid (Material `grid cards`) ------------------------------------- */
.md-typeset .grid {
  gap: var(--space-12);
  margin: var(--space-16) 0 var(--space-24);
}

.md-typeset .grid.cards > ul > li,
.md-typeset .grid.cards > ol > li,
.md-typeset .grid > .card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: var(--space-16);
  font-size: var(--type-body-medium-size);
  line-height: var(--type-body-medium-line-height);
  color: var(--fg-secondary);
  background-color: var(--bg-surface-container);
  border: var(--border-width-1) solid var(--stroke-primary);
  border-radius: var(--radius-12);
  box-shadow: var(--dg-shadow-card);
  transition: border-color var(--dg-motion), background-color var(--dg-motion);
}

.md-typeset .grid.cards > ul > li:hover,
.md-typeset .grid.cards > ol > li:hover,
.md-typeset .grid > .card:hover {
  border-color: var(--stroke-secondary);
  background-color: var(--bg-selection-container-hover);
  box-shadow: var(--dg-shadow-card);
}

.md-typeset .grid.cards > ul > li:has(:focus-visible),
.md-typeset .grid.cards > ol > li:has(:focus-visible),
.md-typeset .grid > .card:has(:focus-visible) {
  border-color: var(--stroke-secondary);
  box-shadow: var(--dg-focus-ring);
}

.md-typeset .grid.cards > ul > li > p,
.md-typeset .grid.cards > ol > li > p,
.md-typeset .grid > .card > p {
  margin: 0 0 var(--space-8);
}

.md-typeset .grid.cards > ul > li > :last-child,
.md-typeset .grid.cards > ol > li > :last-child,
.md-typeset .grid > .card > :last-child {
  margin-bottom: 0;
}

/* Card title: the bold first line. */
.md-typeset .grid.cards > ul > li > p:first-child > strong,
.md-typeset .grid.cards > ol > li > p:first-child > strong,
.md-typeset .grid > .card > p:first-child > strong {
  display: block;
  font-family: var(--type-title-medium-family);
  font-size: var(--type-title-medium-size);
  line-height: var(--type-title-medium-line-height);
  font-weight: var(--type-title-medium-weight);
  color: var(--fg-primary);
}

.md-typeset .grid.cards > ul > li > p:first-child > strong > a,
.md-typeset .grid.cards > ol > li > p:first-child > strong > a,
.md-typeset .grid > .card > p:first-child > strong > a {
  text-decoration: none;
}

/* The card carries the ring for its title link. */
.md-typeset .grid.cards > ul > li > p:first-child > strong > a:focus-visible,
.md-typeset .grid.cards > ol > li > p:first-child > strong > a:focus-visible,
.md-typeset .grid > .card > p:first-child > strong > a:focus-visible {
  box-shadow: none;
}

.md-typeset .grid.cards > ul > li > p:first-child > strong > a:hover,
.md-typeset .grid.cards > ol > li > p:first-child > strong > a:hover,
.md-typeset .grid > .card > p:first-child > strong > a:hover {
  text-decoration: underline;
}

.md-typeset .grid.cards > ul > li > hr,
.md-typeset .grid.cards > ol > li > hr,
.md-typeset .grid > .card > hr {
  margin: var(--space-4) 0 var(--space-12);
}

.md-typeset .grid.cards > ul > li code,
.md-typeset .grid.cards > ol > li code,
.md-typeset .grid > .card code {
  font-size: var(--type-code-small-size);
}

/* --- Link lists (.dg-links) ------------------------------------------------ */
.md-typeset .dg-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 0 var(--space-16);
}

.md-typeset .dg-links a {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  min-height: 32px;
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-6);
  font-size: var(--type-body-medium-size);
  line-height: var(--type-body-medium-line-height);
  color: var(--fg-primary);
  text-decoration: none;
  transition: background-color var(--dg-motion), color var(--dg-motion);
}

.md-typeset .dg-links a::before {
  content: none;
}

/* Trailing chevron (Lucide chevron-right), tinted with the text colour. */
.md-typeset .dg-links a::after {
  content: "";
  flex: 0 0 auto;
  width: var(--space-16);
  height: var(--space-16);
  margin-left: auto;
  background-color: var(--fg-tertiary);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>') center / contain no-repeat;
  transition: background-color var(--dg-motion);
}

.md-typeset .dg-links a:hover,
.md-typeset .dg-links a:focus-visible {
  background-color: var(--bg-surface-nested);
  color: var(--fg-primary);
}

.md-typeset .dg-links a:hover::after,
.md-typeset .dg-links a:focus-visible::after {
  background-color: var(--fg-secondary);
}

.md-typeset .dg-links a:focus-visible {
  outline: none;
  box-shadow: var(--dg-focus-ring);
}

.md-typeset .dg-links a code {
  font-size: var(--type-code-small-size);
}

/* --- Definition lists ------------------------------------------------------ */
.md-typeset dl {
  margin: var(--space-16) 0;
}

.md-typeset dt {
  font-weight: var(--font-weight-semiBold);
  color: var(--fg-primary);
  margin-top: var(--space-12);
}

.md-typeset dt:first-child {
  margin-top: 0;
}

.md-typeset dd {
  margin: var(--space-4) 0 var(--space-12) 0;
  padding-left: var(--space-16);
  border-left: var(--border-width-1) solid var(--stroke-primary);
  color: var(--fg-secondary);
}

.md-typeset dd > :last-child {
  margin-bottom: 0;
}

/* --- Abbreviations and tooltips ------------------------------------------- */
.md-typeset abbr,
.md-typeset [data-preview] {
  text-decoration: none;
  border-bottom: var(--border-width-1) dotted var(--stroke-tertiary);
  cursor: help;
}

.md-tooltip {
  font-family: var(--type-body-medium-family);
  color: var(--fg-primary);
  background-color: var(--bg-surface-container);
  border: var(--border-width-1) solid var(--stroke-primary);
  border-radius: var(--radius-8);
  box-shadow: var(--dg-shadow-card);
}

.md-tooltip__inner {
  font-size: var(--type-body-medium-size);
  line-height: var(--type-body-medium-line-height);
  padding: var(--space-8) var(--space-12);
}

.md-tooltip--inline .md-tooltip__inner {
  font-size: var(--type-body-small-size);
  line-height: var(--type-body-small-line-height);
  font-weight: var(--font-weight-medium);
  padding: var(--space-4) var(--space-8);
}

/* --- Search highlight ------------------------------------------------------ */
.md-typeset mark {
  color: inherit;
  background-color: color-mix(in srgb, var(--bg-status-warning) 32%, transparent);
  border-radius: var(--radius-2);
  padding: 0 var(--space-2);
  box-decoration-break: clone;
}

/* --- 404 page (article holds only the title) ------------------------------ */
.md-typeset > h1:only-child {
  font-family: var(--type-headline-large-family);
  font-size: var(--type-headline-large-size);
  line-height: var(--type-headline-large-line-height);
  font-weight: var(--type-headline-large-weight);
  letter-spacing: var(--type-headline-large-tracking);
  color: var(--fg-secondary);
  text-align: center;
  margin: var(--space-40) 0;
}

/* --- Phones ---------------------------------------------------------------- */
@media screen and (max-width: 44.9375em) {
  .md-typeset h1 {
    font-size: var(--type-headline-large-size);
    line-height: var(--type-headline-large-line-height);
    letter-spacing: var(--type-headline-large-tracking);
  }

  .md-typeset h1 + p {
    font-size: var(--type-body-large-size);
    line-height: var(--type-body-large-line-height);
  }

  .md-typeset h2 {
    margin-top: var(--space-32);
  }

  .md-typeset pre > code {
    padding: var(--space-12) var(--dg-code-lane) var(--space-12) var(--space-14);
  }

  .md-typeset .highlight .hll {
    margin: 0 calc(-1 * var(--dg-code-lane)) 0 calc(-1 * var(--space-14));
    padding: 0 var(--dg-code-lane) 0 var(--space-14);
  }

  .md-typeset .admonition,
  .md-typeset details {
    padding: 0 var(--space-12);
  }

  .md-typeset .admonition > .admonition-title,
  .md-typeset :is(details, .admonition) > summary {
    margin: 0 calc(-1 * var(--space-12));
    padding-left: calc(var(--space-12) + var(--space-16) + var(--space-10));
    padding-right: var(--space-12);
  }

  .md-typeset .admonition > .admonition-title::before,
  .md-typeset :is(details, .admonition) > summary::before {
    left: var(--space-12);
  }

  .md-typeset :is(details, .admonition) > summary::after {
    right: var(--space-12);
  }

  .md-typeset .tabbed-labels {
    width: 100%;
  }

  .md-typeset .tabbed-labels > label {
    flex: 1 0 auto;
    text-align: center;
  }

  /* Phone columns need a wider floor, or a 4-column table wraps every cell to
     two or three characters instead of scrolling. */
  .md-typeset table:not([class]) :is(th, td) {
    min-width: 7rem;
  }
}

/* --- Motion ----------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .md-typeset *,
  .md-typeset *::before,
  .md-typeset *::after {
    transition-duration: 0.01ms !important;
  }
}
