.sig {
    padding-bottom: 8px;
}
.field-list {
    padding-bottom: 8px;
}
.class {
    padding-bottom: 12px;
    padding-top: 4px;
}
.function {
    padding-bottom: 12px;
    padding-top: 12px;
}
.data {
    padding-bottom: 12px;
    padding-top: 12px;
}
.method {
    padding-bottom: 12px;
    padding-top: 12px;
}
.attribute {
    padding-bottom: 12px;
    padding-top: 12px;
}
.exception {
    padding-bottom: 12px;
    padding-top: 12px;
}
.property {
    padding-bottom: 12px;
    padding-top: 12px;
}

/* Long constant names (MAX_CONSECUTIVE_DECODE_FAILURES) must wrap inside the sidebar. */
div.sphinxsidebar code span.pre {
    white-space: normal;
    overflow-wrap: anywhere;
}

div.body div.admonition.seealso {
    padding: 0.6rem 0.95rem;
    margin: 0.9rem 0;
}
div.body div.admonition.seealso p.admonition-title {
    display: none;
}
div.body div.admonition.seealso p {
    margin: 0;
}
div.body div.admonition.seealso ul {
    margin-top: 0.4em;
    margin-bottom: 0;
}

/* Index page: the Command Line and Python API lists side by side (stacked below alabaster's
   breakpoint). */
div.surfaces {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 1.75rem;
    margin: 1.15rem 0 1.5rem 0;
}
div.surfaces div.surface {
    min-width: 0;
    padding: 1rem 1.15rem;
    border: 1px solid var(--psd-border);
    border-radius: 0.55rem;
    background: var(--psd-surface);
}
div.body div.surfaces div.surface p.rubric {
    font-family: var(--psd-font-heading);
    font-size: 1.12rem;
    font-weight: 700;
    margin: 0 0 0.7rem 0;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--psd-border);
    color: var(--psd-fg);
}
div.body div.surfaces ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
div.body div.surfaces div.surface > ul > li + li {
    margin-block-start: 0.42rem;
}
div.body div.surfaces div.surface li > ul {
    list-style: none;
    margin: 0.22rem 0 0.5rem 0.25rem;
    padding-inline-start: 0.8rem;
    border-inline-start: 1px solid var(--psd-border);
}
div.body div.surfaces div.surface li:has(> p > strong:only-child) > ul {
    margin: 0.14rem 0 0.48rem 0;
    padding-inline-start: 0;
    border-inline-start: none;
}
div.body div.surfaces li + li {
    margin-block-start: 0.16rem;
}
div.body div.surfaces li:has(> p > strong:only-child) + li:has(> p > strong:only-child) {
    margin-block-start: 0.45rem;
}
div.body div.surfaces li p {
    margin: 0;
    line-height: 1.48;
}
div.body div.surfaces div.surface a {
    text-decoration: none;
}
div.body div.surfaces div.surface a:hover,
div.body div.surfaces div.surface a:focus-visible {
    text-decoration: underline;
    text-decoration-color: var(--psd-brand);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.2em;
}
div.body div.surfaces div.surface > ul > li > p > a {
    font-weight: 600;
}
div.body div.surfaces li > p > strong:only-child {
    display: inline-block;
    font-family: var(--psd-font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--psd-muted);
    margin-block: 0.22rem 0.06rem;
}
div.surfaces li li a {
    white-space: nowrap;
}

/* Generated tables. Per-detector option tables: automatic layout; the option and parameter
   names (first two columns) never break, other code may wrap so the Default column takes the
   slack; the container scrolls sideways when the table cannot fit (narrow screens, see below).
   Config key tables: fixed layout, and code is allowed to wrap because the [split-video] args
   default is a long single token. basic.css makes `span.pre` nowrap, so every override has
   to name it. */
table.detector-options,
table.config-keys {
    width: 100%;
    font-size: 0.9rem;
}
div.table-scroll {
    overflow-x: auto;
}
div.body table.detector-options code span.pre,
table.config-keys code span.pre {
    white-space: normal;
    overflow-wrap: anywhere;
}
div.body table.detector-options td:nth-child(-n+2) code span.pre {
    white-space: nowrap;
    overflow-wrap: normal;
}
table.config-keys {
    table-layout: fixed;
}
/* Cross-link boxes: keep each link (e.g. [detect-content]) on one line. */
div.body div.admonition.seealso a {
    white-space: nowrap;
}
/* Long inline code (config file paths) and URLs wrap instead of widening the page. The 1120px
   bound matches the fluid-width query below. */
@media screen and (max-width: 1120px) {
    div.body code.literal span.pre,
    div.body a.reference.external {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

@media screen and (max-width: 875px) {
    div.surfaces {
        grid-template-columns: 1fr;
    }
}
@media screen and (max-width: 700px) {
    /* Too narrow for four columns: keep the table readable and let its container scroll. */
    div.table-scroll table.detector-options {
        min-width: 560px;
    }
}

/* ==========================================================================
   Harmonized Modern-Web Theme Layer (Unified Noto Sans + Style A Tokens)
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }
}

:root {
    --psd-bg: light-dark(oklch(99.2% 0.002 250), oklch(15.5% 0.012 255));
    --psd-surface: light-dark(oklch(96.8% 0.005 250), oklch(19.5% 0.015 255));
    --psd-surface-elevated: light-dark(oklch(100% 0 0), oklch(22% 0.016 255));
    --psd-fg: light-dark(oklch(21% 0.02 255), oklch(94% 0.008 250));
    --psd-muted: light-dark(oklch(44% 0.02 255), oklch(72% 0.015 250));
    --psd-border: light-dark(oklch(87.5% 0.01 250), oklch(29.5% 0.018 255));
    --psd-brand: light-dark(oklch(44% 0.12 248), oklch(75% 0.12 240));
    --psd-code-bg: light-dark(oklch(96.2% 0.006 250), oklch(13.5% 0.012 255));

    --psd-syn-kw: light-dark(oklch(38% 0.14 295), oklch(78% 0.14 295));
    --psd-syn-fn: light-dark(oklch(38% 0.13 240), oklch(79% 0.12 235));
    --psd-syn-str: light-dark(oklch(38% 0.12 155), oklch(78% 0.13 155));
    --psd-syn-num: light-dark(oklch(42% 0.13 45), oklch(80% 0.13 65));

    --psd-warn: light-dark(oklch(58% 0.15 70), oklch(78% 0.15 75));
    --psd-danger: light-dark(oklch(52% 0.19 25), oklch(72% 0.18 25));
    --psd-success: light-dark(oklch(45% 0.14 150), oklch(76% 0.15 150));

    --psd-font-sans: "Noto Sans", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --psd-font-heading: var(--psd-font-sans);
    --psd-font-mono: "JetBrains Mono", "Cascadia Code", "Cascadia Mono", "Consolas", ui-monospace, monospace;

    color-scheme: light dark;
    accent-color: var(--psd-brand);
    &:has(> head > meta[name="color-scheme"][content="dark"]) {
        color-scheme: dark;
    }
    &:has(> head > meta[name="color-scheme"][content="light"]) {
        color-scheme: light;
    }
}

html {
    scroll-padding-block-start: 4.5rem;
}

body {
    background-color: var(--psd-bg);
    color: var(--psd-fg);
    font-family: var(--psd-font-sans);
    font-size-adjust: from-font;
    font-size: 1rem;
    line-height: 1.72;
    text-align: start;
    margin: 0;
}

@supports not (font-size-adjust: from-font) {
    body {
        line-height: 1.75;
    }
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--psd-brand);
    outline-offset: 2px;
}

.psd-sr-only {
    position: absolute;
    clip-path: inset(50%);
    overflow: hidden;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    white-space: nowrap;
}

/* Harmonized top bar with backlink to scenedetect.com and version switcher */
header.psd-topbar {
    position: sticky;
    inset-block-start: 0;
    z-index: 30;
    background: color-mix(in oklab, var(--psd-bg) 90%, transparent);
    backdrop-filter: blur(8px);
    border-block-end: 1px solid var(--psd-border);
    font-family: var(--psd-font-sans);
    font-size: 0.875rem;
}
.psd-topbar-inner {
    max-inline-size: 1080px;
    margin-inline: auto;
    padding: 0.55rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    box-sizing: border-box;
}
.psd-topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem 1.1rem;
    flex-wrap: wrap;
}
.psd-topbar-nav a {
    color: var(--psd-muted);
    text-decoration: none;
    border-bottom: none;
    font-weight: 500;
    padding-block: 0.15rem;
}
.psd-topbar-nav a:hover {
    color: var(--psd-fg);
}
.psd-topbar-nav a.psd-backlink {
    color: var(--psd-fg);
    font-weight: 600;
}
.psd-topbar-nav a.current {
    color: var(--psd-brand);
    font-weight: 600;
    border-block-end: 2px solid var(--psd-brand);
}
.psd-sep {
    color: var(--psd-border);
}
.psd-topbar-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

/* Version switcher button + top-layer popover */
.psd-version-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.psd-version-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-block-size: 2rem;
    padding: 0.22rem 0.65rem;
    border: 1px solid var(--psd-border);
    border-radius: 99rem;
    background: var(--psd-surface);
    color: var(--psd-fg);
    font-family: var(--psd-font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}
.psd-version-btn:hover {
    background: color-mix(in oklab, var(--psd-fg) 6%, var(--psd-surface));
    border-color: color-mix(in oklab, var(--psd-fg) 25%, var(--psd-border));
}
.psd-version-btn[aria-expanded="true"] {
    background: color-mix(in oklab, var(--psd-brand) 12%, var(--psd-surface));
    border-color: var(--psd-brand);
    color: var(--psd-brand);
}
.psd-version-chevron {
    flex: none;
    color: var(--psd-muted);
    transition: transform 150ms ease-out, color 120ms ease-out;
}
.psd-version-btn[aria-expanded="true"] .psd-version-chevron {
    transform: rotate(180deg);
    color: currentColor;
}
.psd-version-menu {
    min-inline-size: 13rem;
    max-inline-size: min(18rem, calc(100dvw - 1rem));
    max-block-size: min(24rem, calc(100dvh - 4rem));
    padding: 0.35rem;
    border: 1px solid var(--psd-border);
    border-radius: 0.55rem;
    background: var(--psd-surface-elevated);
    color: var(--psd-fg);
    box-shadow: 0 12px 30px oklch(0% 0 0 / 0.18);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    transform-origin: top right;
}
.psd-version-menu:not(:is(:popover-open, .\:popover-open)) {
    display: none;
}
.psd-version-menu[popover]:is(:popover-open, .\:popover-open) {
    display: block;
}
@supports (position-area: block-end) {
    .psd-version-menu {
        inset: auto;
        margin: 0.35rem 0 0 0;
        height: auto;
        position-area: block-end span-inline-start;
        position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
    }
}
@supports not (position-area: block-end) {
    .psd-version-menu {
        position: fixed;
        inset: auto;
        margin: 0;
        height: auto;
    }
}
@media (prefers-reduced-motion: no-preference) {
    .psd-version-menu[popover]:is(:popover-open, .\:popover-open) {
        animation: psd-menu-in 130ms ease-out both;
    }
}
@keyframes psd-menu-in {
    from {
        opacity: 0;
        scale: 0.96;
    }
}
.psd-version-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.12rem;
}
.psd-version-divider {
    block-size: 1px;
    background: var(--psd-border);
    margin: 0.25rem 0.2rem;
}
.psd-version-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    min-block-size: 1.95rem;
    padding: 0.28rem 0.6rem;
    border-radius: 0.38rem;
    color: var(--psd-fg);
    text-decoration: none;
    border-bottom: none;
    font-family: var(--psd-font-mono);
    font-size: 0.8rem;
    line-height: 1.35;
    box-sizing: border-box;
}
.psd-version-list a.psd-version-all {
    font-family: var(--psd-font-sans);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--psd-muted);
}
.psd-version-list a:hover,
.psd-version-list a:focus-visible {
    background: color-mix(in oklab, var(--psd-brand) 12%, var(--psd-surface));
    color: var(--psd-brand);
    text-decoration: none;
}
.psd-version-list a[aria-current="true"] {
    background: color-mix(in oklab, var(--psd-brand) 12%, var(--psd-surface));
    color: var(--psd-brand);
    font-weight: 600;
}
.psd-version-check {
    flex: none;
    opacity: 0;
}
.psd-version-list a[aria-current="true"] .psd-version-check {
    opacity: 1;
}

.psd-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-inline-size: 2rem;
    min-block-size: 2rem;
    padding: 0;
    border: 1px solid var(--psd-border);
    border-radius: 0.4rem;
    background: var(--psd-surface);
    color: var(--psd-fg);
    cursor: pointer;
}
@media (pointer: coarse) {
    .psd-version-btn,
    .psd-theme-toggle {
        min-inline-size: 2.5rem;
        min-block-size: 2.5rem;
    }
}
.psd-theme-toggle:hover {
    background: color-mix(in oklab, var(--psd-fg) 8%, var(--psd-surface));
    color: var(--psd-brand);
}
.psd-theme-toggle .psd-icon-moon {
    display: block;
}
.psd-theme-toggle .psd-icon-sun,
.psd-theme-toggle .psd-label-light {
    display: none;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .psd-theme-toggle .psd-icon-moon,
:root:has(> head > meta[name="color-scheme"][content="dark"]) .psd-theme-toggle .psd-label-dark {
    display: none;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .psd-theme-toggle .psd-icon-sun {
    display: block;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .psd-theme-toggle .psd-label-light {
    display: inline;
}
@media (prefers-color-scheme: dark) {
    :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .psd-theme-toggle .psd-icon-moon,
    :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .psd-theme-toggle .psd-label-dark {
        display: none;
    }
    :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .psd-theme-toggle .psd-icon-sun {
        display: block;
    }
    :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .psd-theme-toggle .psd-label-light {
        display: inline;
    }
}
.psd-gh-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--psd-fg);
    text-decoration: none;
    font-weight: 500;
}
.psd-gh-link:hover {
    color: var(--psd-brand);
    text-decoration: none;
}

/* Main document shell & editorial serif headings */
div.document {
    width: 1080px;
    margin: 1.75rem auto 0 auto;
}
div.documentwrapper {
    background: transparent;
}
div.bodywrapper {
    margin: 0 0 0 255px;
}
div.body {
    color: var(--psd-fg);
    background: transparent;
    max-width: 730px;
    font-size: 1rem;
    line-height: 1.72;
}
div.body h1,
div.body h2,
div.body h3,
div.body h4 {
    font-family: var(--psd-font-heading);
    font-size-adjust: from-font;
    font-weight: 600;
    line-height: 1.25;
    color: var(--psd-fg);
    text-wrap: balance;
}
div.body h1 {
    font-size: 2.02rem;
    font-weight: 700;
    letter-spacing: -0.018em;
    margin: 0 0 0.75rem 0;
}
div.body h2 {
    font-size: 1.52rem;
    letter-spacing: -0.01em;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--psd-border);
    margin: 2rem 0 0.75rem 0;
}
div.body h3 {
    font-size: 1.24rem;
    margin: 1.6rem 0 0.55rem 0;
}
div.body h4 {
    font-size: 1.08rem;
    margin: 1.25rem 0 0.45rem 0;
}
div.body h1 code,
div.body h2 code,
div.body h3 code,
div.body h4 code {
    font-size: 0.84em;
    font-weight: 600;
}
div.body p,
div.body dd,
div.body li {
    line-height: 1.72;
    text-wrap: pretty;
}
div.body li + li {
    margin-block-start: 0.28rem;
}
hr {
    border-color: var(--psd-border);
}
div.sphinxsidebar hr {
    color: var(--psd-border);
    background: var(--psd-border);
}

/* Body links & clickable monospace hover feedback */
div.body a,
div.body a:visited {
    color: var(--psd-brand);
    border-bottom: none;
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, var(--psd-brand) 42%, transparent);
    text-underline-offset: 0.2em;
}
div.body a:hover {
    color: var(--psd-brand);
    border-bottom: none;
    text-decoration-color: var(--psd-brand);
    text-decoration-thickness: 1.5px;
}
div.body a.headerlink {
    color: var(--psd-muted);
    text-decoration: none;
    border-bottom: none;
}
div.body a.headerlink:hover {
    color: var(--psd-fg);
    background: var(--psd-surface);
    text-decoration: none;
}

/* Sidebar logo, search, TOC scale, larger monospace, & unmistakable row hover */
div.sphinxsidebar {
    width: 255px;
    font-family: var(--psd-font-sans);
    font-size: 0.92rem;
    line-height: 1.5;
}
.psd-logo-light {
    display: block;
    max-width: 185px;
    height: auto;
}
.psd-logo-dark {
    display: none;
    max-width: 185px;
    height: auto;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .psd-logo-light { display: none; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) .psd-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .psd-logo-light { display: none; }
    :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .psd-logo-dark { display: block; }
}

div.sphinxsidebar p.psd-sidebar-subtitle {
    font-size: 0.82rem;
    color: var(--psd-muted);
    margin: 0.35rem 0 0.9rem 0;
}
div.sphinxsidebar h3,
div.sphinxsidebar h4 {
    font-family: var(--psd-font-sans);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--psd-muted);
    margin: 1rem 0 0.35rem 0.45rem;
}
div.sphinxsidebar p.caption {
    font-family: var(--psd-font-sans);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--psd-muted);
    margin: 1.15rem 0 0.3rem 0.5rem;
}
div.sphinxsidebar nav.psd-sidebar-toc > p.caption:first-child {
    margin-top: 0.65rem;
}
div.sphinxsidebar ul {
    list-style: none;
    margin: 0.35rem 0;
    padding: 0;
}
div.sphinxsidebar ul ul {
    list-style: none;
    margin: 0.12rem 0 0.28rem 0.6rem;
    padding-inline-start: 0.55rem;
    border-inline-start: 1px solid var(--psd-border);
}
div.sphinxsidebar li {
    color: var(--psd-muted);
    margin-block: 0.08rem;
}
div.sphinxsidebar a {
    color: var(--psd-muted);
    text-decoration: none;
    border-bottom: none;
}
div.sphinxsidebar ul li > a,
div.sphinxsidebar ul li.toctree-l1 > a,
div.sphinxsidebar ul li.toctree-l2 > a,
div.sphinxsidebar ul li.toctree-l3 > a,
div.sphinxsidebar ul li.toctree-l4 > a {
    display: block;
    padding: 0.22rem 0.5rem;
    border-radius: 0.35rem;
    font-size: 0.9rem;
    line-height: 1.42;
    color: var(--psd-muted);
    text-decoration: none;
    border-bottom: none;
    transition: background-color 110ms ease-out, color 110ms ease-out;
}
div.sphinxsidebar ul li.toctree-l1 > a {
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--psd-fg);
}
div.sphinxsidebar ul li.toctree-l3 > a,
div.sphinxsidebar ul li.toctree-l4 > a {
    font-size: 0.88rem;
}
div.sphinxsidebar ul li.current > a {
    color: var(--psd-fg);
    font-weight: 600;
}
div.sphinxsidebar ul li.current > a.current {
    color: var(--psd-brand);
    background: color-mix(in oklab, var(--psd-brand) 12%, var(--psd-surface));
    font-weight: 600;
}
div.sphinxsidebar ul li > a:hover,
div.sphinxsidebar ul li > a:focus-visible {
    color: var(--psd-brand);
    background: color-mix(in oklab, var(--psd-brand) 13%, var(--psd-surface));
    border-bottom: none;
    text-decoration: none;
}
div.sphinxsidebar p.logo a,
div.sphinxsidebar p.logo a:hover {
    background: transparent;
    border: none;
}
/* TOC monospace: larger x-height, uncramped (no inner border box), inherits hover color */
div.sphinxsidebar code,
div.sphinxsidebar tt,
div.sphinxsidebar a code,
div.sphinxsidebar a code span.pre {
    font-family: var(--psd-font-mono);
    font-size: 0.96em;
    font-size-adjust: from-font;
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
}

.psd-searchbox {
    margin-bottom: 0.85rem;
}
.psd-searchbox input[type="search"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.44rem 0.65rem;
    border: 1px solid var(--psd-border);
    border-radius: 0.4rem;
    background: var(--psd-surface);
    color: var(--psd-fg);
    font-family: inherit;
    font-size: 0.875rem;
}
.psd-searchbox input[type="search"]::placeholder {
    color: var(--psd-muted);
}

/* Code blocks, inline literals, Pygments tokens, & sphinx-copybutton */
div.highlight, .highlight {
    background: transparent;
}
.highlight .hll {
    background-color: color-mix(in oklab, var(--psd-brand) 16%, var(--psd-code-bg));
}
div.body pre {
    background: var(--psd-code-bg);
    color: var(--psd-fg);
    border: 1px solid var(--psd-border);
    border-radius: 0.45rem;
    padding: 0.9rem 1.05rem;
    font-family: var(--psd-font-mono);
    font-size: 0.875rem;
    line-height: 1.62;
    overflow-x: auto;
}
div.body code,
div.body tt,
div.body code.xref,
div.body div.admonition code.xref {
    font-family: var(--psd-font-mono);
    font-size-adjust: from-font;
    background: var(--psd-surface);
    color: var(--psd-fg);
    border: 1px solid var(--psd-border);
    border-radius: 0.25rem;
    padding: 0.08em 0.34em;
    font-size: 0.88em;
}
@supports not (font-size-adjust: from-font) {
    div.body code,
    div.body tt,
    div.body code.xref,
    :is(div.body, .related) a[href*="#command-"] > span.std-ref,
    :is(div.body, .related) a[href*="#config-"] > span.std-ref {
        font-size: 0.86em;
    }
}
:is(div.body, div.body div.admonition, .related) a :is(code, tt, code.xref),
:is(div.body, .related) a[href*="#command-"] > span.std-ref,
:is(div.body, .related) a[href*="#config-"] > span.std-ref {
    font-family: var(--psd-font-mono);
    font-size: 0.88em;
    font-weight: 500;
    font-size-adjust: from-font;
    color: var(--psd-brand);
    background: color-mix(in oklab, var(--psd-brand) 6%, var(--psd-surface));
    border: 1px solid color-mix(in oklab, var(--psd-brand) 30%, var(--psd-border));
    border-radius: 0.25rem;
    padding: 0.08em 0.34em;
    transition: background-color 110ms ease-out, border-color 110ms ease-out, color 110ms ease-out;
}
:is(div.body, div.body div.admonition, .related) a:is(:hover, :focus-visible) :is(code, tt, code.xref),
:is(div.body, .related) a[href*="#command-"]:is(:hover, :focus-visible) > span.std-ref,
:is(div.body, .related) a[href*="#config-"]:is(:hover, :focus-visible) > span.std-ref {
    color: var(--psd-brand);
    background: color-mix(in oklab, var(--psd-brand) 18%, var(--psd-surface));
    border-color: var(--psd-brand);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.18em;
}

/* Reference TOC cards: keep monospace links evenly spaced and clean highlight on hover/focus. */
div.body div.surfaces div.surface a :is(code, tt, code.xref),
div.body div.surfaces div.surface a[href*="#command-"] > span.std-ref {
    display: inline-block;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.28rem;
    padding: 0.05rem 0.34rem;
    margin-inline-start: -0.34rem;
    line-height: 1.38;
}
div.body div.surfaces div.surface > ul > li > p > a[href*="#command-"] > span.std-ref {
    font-weight: 600;
    padding-inline: 0.18rem;
    margin-inline-start: -0.18rem;
}
div.body div.surfaces div.surface a:is(:hover, :focus-visible) {
    text-decoration: none;
}
div.body div.surfaces div.surface a:not(:has(code, tt, code.xref, span.std-ref)):is(:hover, :focus-visible),
div.body div.surfaces div.surface a[href*="#cli-"]:is(:hover, :focus-visible) {
    text-decoration: underline;
    text-decoration-color: var(--psd-brand);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.2em;
}
div.body div.surfaces div.surface a:is(:hover, :focus-visible) :is(code, tt, code.xref),
div.body div.surfaces div.surface a[href*="#command-"]:is(:hover, :focus-visible) > span.std-ref {
    background: color-mix(in oklab, var(--psd-brand) 12%, var(--psd-bg));
    border-color: color-mix(in oklab, var(--psd-brand) 28%, var(--psd-border));
    text-decoration: none;
}
div.body pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: inherit;
}

/* Accessible light/dark Pygments token overrides via :root custom properties */
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn,
.highlight .kp, .highlight .kr, .highlight .ow, .highlight .nb,
.highlight .bp, .highlight .ne, .highlight .cp {
    color: var(--psd-syn-kw);
}
.highlight .nf, .highlight .fm, .highlight .nc, .highlight .nn,
.highlight .nt, .highlight .nl, .highlight .kt, .highlight .no {
    color: var(--psd-syn-fn);
}
.highlight .s, .highlight .sa, .highlight .sb, .highlight .sc,
.highlight .dl, .highlight .sd, .highlight .s2, .highlight .se,
.highlight .sh, .highlight .si, .highlight .sx, .highlight .sr,
.highlight .s1, .highlight .ss, .highlight .na {
    color: var(--psd-syn-str);
}
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh,
.highlight .mi, .highlight .mo, .highlight .il, .highlight .gp,
.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi, .highlight .vm {
    color: var(--psd-syn-num);
}
.highlight .c, .highlight .ch, .highlight .cm,
.highlight .cpf, .highlight .c1, .highlight .cs {
    color: var(--psd-muted);
    background: transparent;
}
.highlight .o, .highlight .p, .highlight .go, .highlight .nd {
    color: var(--psd-fg);
}

/* sphinx-copybutton styling against --psd-code-bg */
.highlight button.copybtn {
    background-color: var(--psd-surface);
    color: var(--psd-muted);
    border: 1px solid var(--psd-border);
}
.highlight button.copybtn:hover {
    background-color: color-mix(in oklab, var(--psd-fg) 10%, var(--psd-surface));
    color: var(--psd-fg);
    border-color: color-mix(in oklab, var(--psd-fg) 25%, var(--psd-border));
}
.highlight button.copybtn:active {
    background-color: color-mix(in oklab, var(--psd-fg) 18%, var(--psd-surface));
}
.highlight button.copybtn:focus-visible {
    opacity: 1;
    outline: 2px solid var(--psd-brand);
    outline-offset: 2px;
}
.highlight button.copybtn.success {
    border-color: var(--psd-success);
    color: var(--psd-success);
}
.o-tooltip--left::after {
    background: var(--psd-surface);
    color: var(--psd-fg);
    border: 1px solid var(--psd-border);
}

/* API signatures, tables, admonitions, & footer */
dt:target, div.viewcode-block:target {
    background: color-mix(in oklab, var(--psd-brand) 16%, var(--psd-surface));
}
span.highlighted {
    background-color: color-mix(in oklab, var(--psd-warn) 32%, var(--psd-surface));
    color: var(--psd-fg);
    border-radius: 0.2rem;
    padding: 0 0.15em;
}
table.indextable tr.cap {
    background-color: var(--psd-surface);
    color: var(--psd-fg);
}
div.genindex-jumpbox,
div.modindex-jumpbox {
    border-top: 1px solid var(--psd-border);
    border-bottom: 1px solid var(--psd-border);
}
dl.py > dt.sig {
    background: var(--psd-surface);
    border-inline-start: 3px solid var(--psd-brand);
    padding: 0.45rem 0.75rem;
    border-radius: 0 0.35rem 0.35rem 0;
    overflow-wrap: anywhere;
}
dl.py > dt.sig span.pre {
    white-space: pre-wrap;
}
table.docutils {
    border-collapse: collapse;
    border: 1px solid var(--psd-border);
    box-shadow: none;
}
table.docutils th, table.docutils td {
    border: 1px solid var(--psd-border);
    padding: 0.48rem 0.68rem;
}
table.docutils th {
    background: var(--psd-surface);
    color: var(--psd-fg);
}
table.footnote, div.topic {
    background: var(--psd-surface);
    border-color: var(--psd-border);
}
div.body div.admonition {
    background: var(--psd-surface);
    border: 1px solid var(--psd-border);
    border-inline-start: 3px solid var(--psd-brand);
    border-radius: 0.4rem;
    box-shadow: none;
}
div.body div.admonition.warning,
div.body div.admonition.caution,
div.body div.admonition.attention {
    border-inline-start-color: var(--psd-warn);
}
div.body div.admonition.danger,
div.body div.admonition.error {
    border-inline-start-color: var(--psd-danger);
}
div.admonition p.admonition-title,
div.body p.admonition-title {
    font-family: var(--psd-font-sans);
    color: var(--psd-fg);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}
.related {
    color: var(--psd-muted);
}
.related.top, .related.bottom {
    border-color: var(--psd-border);
}
.related a,
.related a:visited {
    color: var(--psd-brand);
    border-bottom: none;
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, var(--psd-brand) 42%, transparent);
    text-underline-offset: 0.2em;
}
.related a:hover {
    color: var(--psd-brand);
    border-bottom: none;
    text-decoration-color: var(--psd-brand);
    text-decoration-thickness: 1.5px;
}
div.footer {
    width: 1080px;
    color: var(--psd-muted);
    border-top: 1px solid var(--psd-border);
    padding-top: 1rem;
    margin-top: 2.5rem;
}
.psd-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.25rem;
}
.psd-footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1rem;
}
div.footer a,
div.footer a:visited {
    color: var(--psd-muted);
    border-bottom: none;
    text-decoration: none;
}
div.footer a:hover {
    color: var(--psd-brand);
    text-decoration: underline;
}

/* Responsive fluid layout below 1120px and mobile <= 875px */
@media screen and (min-width: 876px) and (max-width: 1120px) {
    div.document,
    div.footer {
        max-inline-size: 100%;
        width: auto;
        margin-inline: 1.25rem;
    }
}
@media (max-width: 875px) {
    body {
        padding: 0;
    }
    .psd-topbar-inner,
    div.document,
    div.footer {
        max-inline-size: 100%;
        width: auto;
        padding-inline: 1rem;
        box-sizing: border-box;
    }
    div.document {
        margin-block-start: 1.25rem;
    }
    div.documentwrapper,
    div.bodywrapper,
    div.body {
        max-inline-size: 100%;
        min-inline-size: 0;
        width: auto;
        margin: 0;
        box-sizing: border-box;
    }
    div.documentwrapper {
        background: transparent;
    }
    div.body {
        padding: 0;
        overflow-wrap: anywhere;
    }
    div.body :not(pre) > code span.pre {
        white-space: pre-wrap;
    }
    div.body table.docutils {
        display: block;
        max-inline-size: 100%;
        overflow-x: auto;
    }
    div.sphinxsidebar {
        max-inline-size: 100%;
        width: auto;
        margin: 2rem 0 1.5rem 0;
        padding: 1rem;
        box-sizing: border-box;
        background: var(--psd-surface);
        color: var(--psd-fg);
        border: 1px solid var(--psd-border);
        border-radius: 0.5rem;
    }
    div.sphinxsidebar h3,
    div.sphinxsidebar h4,
    div.sphinxsidebar p.caption {
        color: var(--psd-muted);
    }
    div.sphinxsidebar p,
    div.sphinxsidebar h3 a {
        color: var(--psd-fg);
    }
    div.sphinxsidebar ul li > a {
        color: var(--psd-fg);
    }
    div.sphinxsidebar p.psd-sidebar-subtitle {
        color: var(--psd-muted);
    }
    div.sphinxsidebar ul li.current > a.current {
        color: var(--psd-brand);
        background: color-mix(in oklab, var(--psd-brand) 14%, var(--psd-bg));
    }
    div.sphinxsidebar ul li > a:hover,
    div.sphinxsidebar ul li > a:focus-visible {
        color: var(--psd-brand);
        background: color-mix(in oklab, var(--psd-brand) 14%, var(--psd-bg));
    }
}

/* Forced Colors Mode (Windows High Contrast) safe boundaries */
@media (forced-colors: active) {
    header.psd-topbar {
        border-block-end: 1px solid CanvasText;
    }
    .psd-topbar-nav a.current {
        border-block-end: 2px solid Highlight;
    }
    .psd-version-btn,
    .psd-version-menu,
    .psd-theme-toggle,
    .psd-searchbox input[type="search"],
    div.body pre,
    div.body div.admonition,
    table.docutils,
    table.docutils th,
    table.docutils td,
    .highlight button.copybtn {
        border: 1px solid CanvasText;
    }
    dl.py > dt.sig,
    div.body div.admonition {
        border-inline-start: 3px solid Highlight;
    }
    div.sphinxsidebar ul li.current > a.current,
    .psd-version-list a[aria-current="true"] {
        outline: 2px solid Highlight;
        outline-offset: -2px;
    }
    span.highlighted {
        background-color: Mark;
        color: MarkText;
    }
}
