/*
 * Gradient theme for Zensical.
 *
 * Color schemes: "gradient-dark" and "gradient-light" (set as the theme's
 * default palette). Accents use an animated rainbow gradient, which stops when
 * the reader asks for reduced motion.
 */

/* MARK: - Brand palette */

:root {
    /* Brand palette */
    --black: #261230;
    --white: #ffffff;
    --radiate: #d7ff64;
    --flare: #6340ac;
    --rock: #78876e;
    --galaxy: #261230;
    --space: #30173d;
    --comet: #6f5d6f;
    --cosmic: #de5fe9;
    --sun: #ffac2f;
    --electron: #46ebe1;
    --aurora: #46eb74;
    --constellation: #5f6de9;
    --neutron: #cff3cf;
    --proton: #f6afbc;
    --nebula: #cdcbfb;
    --supernova: #f1aff6;
    --starlight: #f4f4f1;
    --lunar: #fbf2fc;
    --asteroid: #e3cee3;
    --crater: #f0dfdf;

    /* Gradient-bars icon used for note admonitions */
    --md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<?xml version="1.0" encoding="UTF-8"?><svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1 {stroke-width: 0px;}</style></defs><path id="gradient_icon" class="cls-1" d="m21.16.94H2.84c-1.05,0-1.9.85-1.9,1.9v18.32c0,1.05.85,1.9,1.9,1.9h18.32c1.05,0,1.9-.85,1.9-1.9V2.84c0-1.05-.85-1.9-1.9-1.9Zm1.4,18.1H1.44v-.19h21.13v.19Zm0-3.09H1.44v-.3h21.13v.3Zm0-3.1H1.44v-.5h21.13v.5Zm0-3H1.44v-.9h21.13v.9Zm0-2.9H1.44v-1.4h21.13v1.4Zm0-2.9H1.44v-1.21c0-.25.06-.48.18-.69h20.76c.12.21.18.44.18.69v1.21Z" /></svg>');
}

/* MARK: - Tables */

[data-md-color-scheme="gradient-dark"] table {
    border-collapse: collapse;
    border-spacing: 0;
    color: #eeeeee;
}

table.params {
    border-collapse: collapse;
    border-spacing: 0;
    color: #eeeeee;
    width: 100%;
    font-family: "Inter", sans-serif;
}

[data-md-color-scheme="gradient-dark"] table.params th {
    color: #2d183b;
    background: #cccccc;
    font-size: 2.25em;
    text-align: left;
    padding: 10px 30px;
}

[data-md-color-scheme="gradient-dark"] table.params td {
    color: #cccccc;
    background: #2d183b;
    font-size: 2em;
    font-family: "Inter", sans-serif;
    text-align: left;
    width: 30%;
    padding: 10px 30px;
}

table.params th:nth-child(even) {
    width: 30%;
}

table.params th:nth-child(even) {
    width: 70%;
}

[data-md-color-scheme="gradient-dark"] tr:nth-child(even) {
    background: #321744;
}

/* MARK: - Light scheme */

[data-md-color-scheme="gradient-light"] {
    /* Base colors */
    --md-default-bg-color: #ffffff;
    --md-default-bg-color--dark: #f6f7fb;
    --md-default-fg-color: #2d183b;
    /* deep purple text */
    --md-default-fg-color--light: #443057;
    --md-default-fg-color--lighter: #6a5780;

    /* Brand accents */
    --md-primary-fg-color: var(--galaxy);
    --md-primary-bg-color: #ffffff;
    --md-accent-fg-color: var(--cosmic);
    --md-typeset-a-color: var(--flare);

    /* Body and code */
    --md-typeset-color: #2d183b;
    --md-typeset-mark-color: #fff2a8;

    --md-code-fg-color: #2d183b;
    --md-code-bg-color: #f6f8fa;
    /* neutral light code background */

    /* Code highlight tokens (ensure good contrast in light mode) */
    --md-code-hl-comment-color: #6e7781;
    --md-code-hl-punctuation-color: #6e7781;
    --md-code-hl-generic-color: #8e63c7;
    --md-code-hl-variable-color: #1f2328;
    --md-code-hl-string-color: #0a7b83;
    /* teal-ish */
    --md-code-hl-keyword-color: #7c3aed;
    /* purple */
    --md-code-hl-operator-color: #7c3aed;
    --md-code-hl-number-color: #b45309;
    /* warm brown */
    --md-code-hl-special-color: #b45309;
    --md-code-hl-function-color: #14532d;
    /* green */
    --md-code-hl-constant-color: #a21caf;
    /* magenta */
    --md-code-hl-name-color: #111827;
    /* headings/idents */

    /* Tables */
    --md-typeset-table-color: rgba(0, 0, 0, 0.08);
    --md-typeset-table-color--light: rgba(0, 0, 0, 0.035);

    /* The base theme computes these on :root from its own default colors, so
       each scheme has to restate them to pick up its own palette. */
    --md-admonition-fg-color: var(--md-default-fg-color);
    --md-admonition-bg-color: var(--md-default-bg-color);
    --md-footer-bg-color: var(--galaxy);
    --md-footer-bg-color--dark: var(--black);
}

/* Light-only adjustments for tables and stripes */
[data-md-color-scheme="gradient-light"] table {
    color: #2d183b;
}

[data-md-color-scheme="gradient-light"] tr:nth-child(even) {
    background: #f5f2fb;
    /* very light lilac */
}

[data-md-color-scheme="gradient-light"] table.params td {
    color: #2d183b;
    background: #f7f7f9;
}

/* MARK: - Dark scheme */

[data-md-color-scheme="gradient-dark"] {
    --md-default-bg-color: var(--galaxy);
    --md-default-fg-color: var(--white);
    --md-default-fg-color--light: var(--white);
    --md-default-fg-color--lighter: var(--white);
    --md-primary-fg-color: var(--space);
    --md-primary-bg-color: var(--white);
    --md-accent-fg-color: var(--radiate);

    --md-typeset-color: var(--white);
    --md-typeset-a-color: var(--radiate);
    --md-typeset-mark-color: var(--sun);

    --md-code-fg-color: var(--white);
    --md-code-bg-color: var(--space);

    --md-code-hl-comment-color: var(--asteroid);
    --md-code-hl-punctuation-color: var(--asteroid);
    --md-code-hl-generic-color: var(--supernova);
    --md-code-hl-variable-color: var(--starlight);
    --md-code-hl-string-color: var(--radiate);
    --md-code-hl-keyword-color: var(--supernova);
    --md-code-hl-operator-color: var(--supernova);
    --md-code-hl-number-color: var(--electron);
    --md-code-hl-special-color: var(--electron);
    --md-code-hl-function-color: var(--neutron);
    --md-code-hl-constant-color: var(--radiate);
    --md-code-hl-name-color: var(--md-code-fg-color);

    --md-typeset-del-color: hsla(6, 90%, 60%, 0.15);
    --md-typeset-ins-color: hsla(150, 90%, 44%, 0.15);

    --md-typeset-table-color: hsla(0, 0%, 100%, 0.12);
    --md-typeset-table-color--light: hsla(0, 0%, 100%, 0.035);

    /* The base theme computes these on :root from its light defaults, which
       left admonitions white and kbd keys pale in dark mode. */
    --md-default-fg-color--lightest: hsla(0, 0%, 100%, 0.12);
    --md-default-bg-color--light: rgba(38, 18, 48, 0.7);
    --md-default-bg-color--lighter: rgba(38, 18, 48, 0.3);
    --md-default-bg-color--lightest: rgba(38, 18, 48, 0.12);
    --md-code-bg-color--light: rgba(48, 23, 61, 0.7);
    --md-code-bg-color--lighter: rgba(48, 23, 61, 0.3);
    --md-typeset-kbd-color: var(--space);
    --md-typeset-kbd-accent-color: var(--comet);
    --md-typeset-kbd-border-color: var(--black);
    --md-admonition-fg-color: var(--md-default-fg-color);
    --md-admonition-bg-color: var(--md-default-bg-color);
    --md-footer-bg-color: #1a0c22;
    --md-footer-bg-color--dark: #12081a;
    --md-shadow-z1: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.2), 0 0 0.05rem rgba(0, 0, 0, 0.35);
    --md-shadow-z2: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.3), 0 0 0.05rem rgba(0, 0, 0, 0.45);
    --md-shadow-z3: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.4), 0 0 0.05rem rgba(0, 0, 0, 0.5);
}

/* MARK: - Light/dark-only images */

[data-md-color-scheme="gradient-light"] img[src$="#only-dark"],
[data-md-color-scheme="gradient-light"] img[src$="#gh-dark-mode-only"] {
    display: none;
    /* Hide dark images in light mode */
}

[data-md-color-scheme="gradient-light"] img[src$="#only-light"],
[data-md-color-scheme="gradient-light"] img[src$="#gh-light-mode-only"] {
    display: inline;
    /* Show light images in light mode */
}

[data-md-color-scheme="gradient-dark"] img[src$="#only-light"],
[data-md-color-scheme="gradient-dark"] img[src$="#gh-light-mode-only"] {
    display: none;
    /* Hide light images in dark mode */
}

[data-md-color-scheme="gradient-dark"] img[src$="#only-dark"],
[data-md-color-scheme="gradient-dark"] img[src$="#gh-dark-mode-only"] {
    display: inline;
    /* Show dark images in dark mode */
}

/* MARK: - Table layout fixes */

/* See: https://github.com/squidfunk/mkdocs-material/issues/175#issuecomment-616694465 */
.md-typeset__table {
    min-width: 100%;
}

.md-typeset table:not([class]) {
    display: table;
}

/* MARK: - Copy toast */

/* Toast for copy-to-clipboard: an animated rainbow border (the same layering
   as the gradient admonitions) around rainbow text. The JS wraps the message in
   a span so the text can clip its own gradient layer. The toast lives on
   <body>, which carries data-md-color-scheme, so --gradient-rainbow resolves. */
.gradient-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    border: 2px solid transparent;
    background:
        linear-gradient(var(--md-code-bg-color, #2e2e2e), var(--md-code-bg-color, #2e2e2e)) padding-box,
        var(--gradient-rainbow, linear-gradient(90deg, #f0f, #0ff)) border-box;
    background-size: 100% 100%, 200% 100%;
    color: var(--md-typeset-color, #ffffff);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    box-shadow: var(--md-shadow-z2, 0 4px 12px rgba(0, 0, 0, .3));
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 9999;
    font-weight: 600;
    animation: gradient-admonition-shift 8s linear infinite;
}

.gradient-toast__text {
    background-image: var(--gradient-rainbow);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: gradient-rainbow-shift 8s linear infinite;
}

.gradient-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* MARK: - Page background */

/* Let the theme colours drive the page background */
html,
body {
    background: var(--md-default-bg-color);
}

/* MARK: - Animated rainbow accent */

[data-md-color-scheme="gradient-light"] {
    /* darken the spectrum so it stays readable on white */
    --gradient-keep: 68%;
}

[data-md-color-scheme="gradient-dark"] {
    --gradient-keep: 100%;
}

[data-md-color-scheme] {
    --gradient-rainbow: linear-gradient(90deg,
            color-mix(in srgb, #FF0000 var(--gradient-keep), #000),
            color-mix(in srgb, #FF5500 var(--gradient-keep), #000),
            color-mix(in srgb, #FF9900 var(--gradient-keep), #000),
            color-mix(in srgb, #FFCC00 var(--gradient-keep), #000),
            color-mix(in srgb, #FFFF00 var(--gradient-keep), #000),
            color-mix(in srgb, #AAFF00 var(--gradient-keep), #000),
            color-mix(in srgb, #00FF00 var(--gradient-keep), #000),
            color-mix(in srgb, #00FF99 var(--gradient-keep), #000),
            color-mix(in srgb, #00FFFF var(--gradient-keep), #000),
            color-mix(in srgb, #00CCFF var(--gradient-keep), #000),
            color-mix(in srgb, #0099FF var(--gradient-keep), #000),
            color-mix(in srgb, #5066FF var(--gradient-keep), #000),
            color-mix(in srgb, #8055FF var(--gradient-keep), #000),
            color-mix(in srgb, #B033FF var(--gradient-keep), #000),
            color-mix(in srgb, #FF00FF var(--gradient-keep), #000),
            color-mix(in srgb, #FF00AA var(--gradient-keep), #000),
            color-mix(in srgb, #FF0055 var(--gradient-keep), #000),
            color-mix(in srgb, #FF0000 var(--gradient-keep), #000));
}

@keyframes gradient-rainbow-shift {
    to {
        background-position: -200% 0;
    }
}

/* Gradient-filled text for accent elements */
.md-typeset a:not(.headerlink):not(.md-button):not(.md-annotation__index),
.md-nav__link--active,
.md-nav__item--active>.md-nav__link,
.md-nav__link:is(:hover, :focus),
.md-header__title .md-ellipsis,
.md-typeset .headerlink:is(:hover, :focus) {
    background-image: var(--gradient-rainbow);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: gradient-rainbow-shift 8s linear infinite;
}

/* Gradient rule under headings and a gradient scrollbar thumb / selection */
.md-typeset h1::after {
    content: "";
    display: block;
    height: 3px;
    margin-top: .4em;
    border-radius: 2px;
    background: var(--gradient-rainbow);
    background-size: 200% 100%;
    animation: gradient-rainbow-shift 8s linear infinite;
}

.md-search__form:focus-within {
    outline: 2px solid transparent;
    border-radius: .1rem;
    background-image: linear-gradient(var(--md-default-bg-color), var(--md-default-bg-color)), var(--gradient-rainbow);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border: 2px solid transparent;
}

@media (prefers-reduced-motion: reduce) {

    .md-typeset a,
    .md-nav__link,
    .md-header__title .md-ellipsis,
    .md-typeset h1::after,
    .gradient-toast,
    .gradient-toast__text {
        animation: none;
    }
}

/* MARK: - Inline code in links */

/* Inline code inside a link: plain text normally, rainbow on hover.
   The code element paints its own background and inherits the link's
   transparent text fill, which hid the text. Keep the normal text color, and
   on hover fade the fill to transparent so a rainbow layer clipped to the text
   shows through while it animates. */
.md-typeset a:not(.headerlink):not(.md-button)>code {
    background-image: var(--gradient-rainbow),
        linear-gradient(var(--md-code-bg-color), var(--md-code-bg-color));
    background-size: 200% 100%, auto;
    background-clip: text, border-box;
    -webkit-background-clip: text, border-box;
    -webkit-text-fill-color: var(--md-typeset-color);
    color: var(--md-typeset-color);
    animation: gradient-rainbow-shift-code 4s linear infinite paused;
    transition: -webkit-text-fill-color 0.35s ease;
}

.md-typeset a:not(.headerlink):not(.md-button):is(:hover, :focus-visible)>code {
    -webkit-text-fill-color: transparent;
    animation-play-state: running;
}

@keyframes gradient-rainbow-shift-code {
    to {
        background-position: -200% 0, 0 0;
    }
}

/* MARK: - Gradient admonitions */

/* Every admonition and collapsible block gets an animated gradient border, a
   title bar tinted with that gradient, and an icon filled with it. Each type
   has its own three-color gradient around its usual hue (warning stays orange,
   danger red, ...) so the type still reads at a glance. Notes, and any type
   without its own colors, use the full rainbow.

   Each type only sets --gradient-stop-1..3. --gradient-admonition is declared
   on the same element, so it picks up that element's stops. The first stop is
   repeated at the end so the 200%-wide gradient loops without a seam, and
   color-mix applies --gradient-keep to darken the colors in the light scheme.

   The scheme attribute raises specificity to match the base theme's
   per-type rules (.md-typeset .admonition.note), and this sheet loads later. */
[data-md-color-scheme] .md-typeset :is(.admonition, details) {
    --gradient-admonition: linear-gradient(90deg,
            color-mix(in srgb, var(--gradient-stop-1) var(--gradient-keep), #000),
            color-mix(in srgb, var(--gradient-stop-2) var(--gradient-keep), #000),
            color-mix(in srgb, var(--gradient-stop-3) var(--gradient-keep), #000),
            color-mix(in srgb, var(--gradient-stop-1) var(--gradient-keep), #000));
    border: 0.075rem solid transparent;
    background:
        linear-gradient(var(--md-admonition-bg-color), var(--md-admonition-bg-color)) padding-box,
        var(--gradient-admonition) border-box;
    background-size: 100% 100%, 200% 100%;
    animation: gradient-admonition-shift 8s linear infinite;
}

/* MARK: Per-type gradient stops */

/* abstract, summary, tldr: sky to aqua */
[data-md-color-scheme] .md-typeset :is(.admonition, details).abstract,
[data-md-color-scheme] .md-typeset :is(.admonition, details).summary,
[data-md-color-scheme] .md-typeset :is(.admonition, details).tldr {
    --gradient-stop-1: #00B0FF;
    --gradient-stop-2: #00E5FF;
    --gradient-stop-3: #1DE9B6;
}

/* info, todo: cyan to blue */
[data-md-color-scheme] .md-typeset :is(.admonition, details).info,
[data-md-color-scheme] .md-typeset :is(.admonition, details).todo {
    --gradient-stop-1: #00B8D4;
    --gradient-stop-2: #2979FF;
    --gradient-stop-3: #00E5FF;
}

/* tip, hint, important: teal to mint */
[data-md-color-scheme] .md-typeset :is(.admonition, details).tip,
[data-md-color-scheme] .md-typeset :is(.admonition, details).hint,
[data-md-color-scheme] .md-typeset :is(.admonition, details).important {
    --gradient-stop-1: #00BFA5;
    --gradient-stop-2: #64FFDA;
    --gradient-stop-3: #00E676;
}

/* success, check, done: green to lime */
[data-md-color-scheme] .md-typeset :is(.admonition, details).success,
[data-md-color-scheme] .md-typeset :is(.admonition, details).check,
[data-md-color-scheme] .md-typeset :is(.admonition, details).done {
    --gradient-stop-1: #00C853;
    --gradient-stop-2: #76FF03;
    --gradient-stop-3: #1DE9B6;
}

/* question, help, faq: lime to chartreuse */
[data-md-color-scheme] .md-typeset :is(.admonition, details).question,
[data-md-color-scheme] .md-typeset :is(.admonition, details).help,
[data-md-color-scheme] .md-typeset :is(.admonition, details).faq {
    --gradient-stop-1: #64DD17;
    --gradient-stop-2: #C6FF00;
    --gradient-stop-3: #AEEA00;
}

/* warning, caution, attention: amber to orange */
[data-md-color-scheme] .md-typeset :is(.admonition, details).warning,
[data-md-color-scheme] .md-typeset :is(.admonition, details).caution,
[data-md-color-scheme] .md-typeset :is(.admonition, details).attention {
    --gradient-stop-1: #FF9100;
    --gradient-stop-2: #FFC400;
    --gradient-stop-3: #FF3D00;
}

/* failure, fail, missing: coral to pink */
[data-md-color-scheme] .md-typeset :is(.admonition, details).failure,
[data-md-color-scheme] .md-typeset :is(.admonition, details).fail,
[data-md-color-scheme] .md-typeset :is(.admonition, details).missing {
    --gradient-stop-1: #FF5252;
    --gradient-stop-2: #FF4081;
    --gradient-stop-3: #FF1744;
}

/* danger, error: crimson to ember */
[data-md-color-scheme] .md-typeset :is(.admonition, details).danger,
[data-md-color-scheme] .md-typeset :is(.admonition, details).error {
    --gradient-stop-1: #FF1744;
    --gradient-stop-2: #D50000;
    --gradient-stop-3: #FF6D00;
}

/* bug: magenta to violet */
[data-md-color-scheme] .md-typeset :is(.admonition, details).bug {
    --gradient-stop-1: #F50057;
    --gradient-stop-2: #FF4081;
    --gradient-stop-3: #D500F9;
}

/* example: violet to lavender */
[data-md-color-scheme] .md-typeset :is(.admonition, details).example {
    --gradient-stop-1: #7C4DFF;
    --gradient-stop-2: #B388FF;
    --gradient-stop-3: #651FFF;
}

/* quote, cite: silver */
[data-md-color-scheme] .md-typeset :is(.admonition, details).quote,
[data-md-color-scheme] .md-typeset :is(.admonition, details).cite {
    --gradient-stop-1: #9E9E9E;
    --gradient-stop-2: #E0E0E0;
    --gradient-stop-3: #757575;
}

/* MARK: Title tint, icon fill and rainbow fallback */

/* Notes and custom types have no stops of their own: use the rainbow.
   The :not() list adds specificity, so this beats the base rule above. */
[data-md-color-scheme] .md-typeset :is(.admonition, details):not(.abstract, .summary, .tldr, .info, .todo, .tip, .hint, .important,
    .success, .check, .done, .question, .help, .faq, .warning, .caution,
    .attention, .failure, .fail, .missing, .danger, .error, .bug, .example,
    .quote, .cite) {
    --gradient-admonition: var(--gradient-rainbow);
}

[data-md-color-scheme] .md-typeset :is(.admonition, details)> :is(.admonition-title, summary) {
    background-color: transparent;
    /* A mostly opaque layer of the page color over the gradient gives a tint. */
    background-image:
        linear-gradient(color-mix(in srgb, var(--md-admonition-bg-color) 80%, transparent),
            color-mix(in srgb, var(--md-admonition-bg-color) 80%, transparent)),
        var(--gradient-admonition);
}

/* Fill every icon with its type's gradient. The base theme already masks the
   icon shape onto ::before, so only the fill changes; notes swap in the
   gradient-bars icon. */
[data-md-color-scheme] .md-typeset :is(.admonition, details)> :is(.admonition-title, summary)::before {
    background-color: transparent;
    background-image: var(--gradient-admonition);
    background-size: 200% 100%;
    animation: gradient-rainbow-shift 8s linear infinite;
}

[data-md-color-scheme] .md-typeset :is(.note > .admonition-title, .note > summary)::before {
    -webkit-mask-image: var(--md-admonition-icon--note);
    mask-image: var(--md-admonition-icon--note);
}

/* MARK: Admonition animation */

@keyframes gradient-admonition-shift {
    to {
        background-position: 0 0, -200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .md-typeset a>code {
        animation: none;
        transition: none;
    }

    /* Placed after the admonition rules: same specificity, so order decides. */
    [data-md-color-scheme] .md-typeset :is(.admonition, details),
    [data-md-color-scheme] .md-typeset :is(.admonition, details)> :is(.admonition-title, summary)::before {
        animation: none;
    }
}

/* MARK: - API reference (mkdocstrings) and helpers */

/* MARK: Typography */

.badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: .4rem;
    align-items: center;
    justify-content: center;
}

.badges .badge {
    height: 20px;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
    font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.md-typeset h1 {
    margin-top: 0.25rem;
    margin-bottom: 0.75rem;
}

.md-typeset h2.doc.doc-heading {
    /* Signatures / member headings */
    margin: 1.25rem 0 0.25rem;
    padding: 0;
    font-size: 1.15rem;
    line-height: 1.4;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.md-typeset h2.doc.doc-heading code {
    font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    background: var(--md-code-bg-color);
    display: block;
    /* make signature block-like */
    white-space: pre-wrap;
    /* preserve spaces, allow wrapping */
    overflow-wrap: anywhere;
    /* wrap long tokens if needed */
    padding: .5rem .6rem;
    border-radius: 6px;
    border: 1px solid var(--md-typeset-table-color);
}

.md-typeset h2.doc.doc-heading .headerlink {
    color: var(--md-default-fg-color--light);
}

/* MARK: Code and inline code */

.md-typeset code {
    font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background-color: var(--md-code-bg-color);
    padding: .15rem .35rem;
    border-radius: 4px;
}

.md-typeset pre code {
    /* block background comes from the theme's code colour */
    background: var(--md-code-bg-color);
    padding: 1rem 1.25rem;
}

/* MARK: Object cards */

/* Card-like containers for objects */
.md-typeset .doc.doc-object {
    margin: 0.75rem 0 1rem;
    border: 1px solid var(--md-typeset-table-color);
    border-radius: 8px;
    background-color: var(--md-typeset-table-color--light);
}

.md-typeset .doc.doc-object>.doc.doc-contents {
    padding: 0.5rem 0.9rem 0.9rem;
}

.md-typeset .doc.doc-object>.doc.doc-heading {
    margin: 0;
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid var(--md-typeset-table-color);
    background: transparent;
}

/* Base/parent class line */
.md-typeset .doc.doc-class-bases {
    color: var(--md-default-fg-color--light);
    margin: 0.2rem 0 0.6rem;
}

/* Children (methods, attributes) spacing */
.md-typeset .doc.doc-children {
    margin-top: 0.5rem;
    padding: 0.25rem 0.1rem 0.1rem;
}

.md-typeset .doc.doc-children>.doc.doc-object {
    margin: 0.5rem 0 0.75rem;
}

/* MARK: Parameter tables */

/* Parameter/return tables created by mkdocstrings */
.md-typeset .doc table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--md-typeset-table-color);
    border-radius: 6px;
    overflow: hidden;
    font-size: 0.95rem;
}

/* Turn only the 4-column "Parameters" table into an "Args:" list */
.md-typeset .doc p:has(> .doc-section-title)+table:has(thead th:nth-child(4))::before {
    content: "Args:";
    display: block;
    font-weight: 700;
    margin: .4rem .6rem 0;
}

.md-typeset .doc p:has(+ table:has(thead th:nth-child(4))) {
    display: none;
}

.md-typeset .doc table:has(thead th:nth-child(4)) thead {
    display: none;
}

.md-typeset .doc thead th {
    background: var(--md-typeset-table-color);
    color: var(--md-default-fg-color);
    text-align: left;
    font-weight: 700;
    padding: .5rem .75rem;
}

.md-typeset .doc tbody td {
    border-top: 1px solid var(--md-typeset-table-color--light);
    padding: .5rem .75rem;
    vertical-align: top;
}

.md-typeset .doc table:has(thead th:nth-child(4)) tbody tr {
    display: block;
    padding: .45rem .35rem;
}

.md-typeset .doc table:has(thead th:nth-child(4)) tbody tr+tr {
    border-top: 1px solid var(--md-typeset-table-color);
}

.md-typeset .doc table:has(thead th:nth-child(4)) tbody tr:nth-child(odd) {
    background: transparent;
}

/* Param name */
.md-typeset .doc table:has(thead th:nth-child(4)) tbody td:nth-child(1) {
    display: block;
    padding-bottom: .1rem;
    font-weight: 700;
}

/* Param type */
.md-typeset .doc table:has(thead th:nth-child(4)) tbody td:nth-child(2) {
    display: block;
    color: var(--md-default-fg-color--light);
    font-size: .9rem;
    padding-top: 0;
}

/* Description */
.md-typeset .doc table:has(thead th:nth-child(4)) tbody td:nth-child(3) {
    display: block;
    margin-top: .15rem;
}

/* Default value */
.md-typeset .doc table:has(thead th:nth-child(4)) tbody td:nth-child(4) {
    display: block;
    margin-top: .15rem;
}

.md-typeset .doc table:has(thead th:nth-child(4)) tbody td:nth-child(4)::before {
    content: "Defaults to ";
    color: var(--md-default-fg-color--light);
}

/* MARK: Labels */

/* Pills for labels (e.g., staticmethod, property) */
.md-typeset .doc .doc-labels {
    display: inline-flex;
    gap: .35rem;
}

.md-typeset .doc .doc-label {
    display: inline-block;
    padding: .1rem .4rem;
    border-radius: 999px;
    font-size: .75rem;
    line-height: 1.2;
    background: color-mix(in srgb, var(--md-accent-fg-color) 20%, transparent);
    border: 1px solid color-mix(in srgb, var(--md-accent-fg-color) 50%, transparent);
    color: var(--md-accent-fg-color);
}

/* MARK: Source code blocks */

/* Source code details block */
.md-typeset details.quote>summary {
    background: var(--md-typeset-table-color--light);
    border: 1px solid var(--md-typeset-table-color);
    padding: .4rem .6rem;
    border-radius: 6px;
}

.md-typeset details.quote[open]>summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.md-typeset details.quote>.highlight,
.md-typeset details.quote>.language-python.highlight {
    border: 1px solid var(--md-typeset-table-color);
    border-top: 0;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

/* Muted section labels like "Parameters:" and "Returns:" */
.md-typeset .doc .doc-section-title {
    color: var(--md-default-fg-color--light);
    font-weight: 600;
}

/* MARK: Helpers */

/* Keep versions and banners subtle if used */
.version {
    color: var(--md-accent-fg-color);
    font-weight: 600;
}

.banner {
    width: 100%;
}

.copy-link img {
    cursor: pointer;
    display: block;
    max-width: 100%;
}