/*
 * nextPYP brand system.
 *
 * Both Material and sphinx-design expose their colors as CSS custom properties.
 * sphinx-immaterial sets `data-md-color-scheme` on <body>, so every token below is
 * scoped to that attribute. Defining them on `:root` instead would land on <html>
 * and win over the theme's own per-scheme rules, forcing a single palette on both
 * light and dark mode.
 */

/* ------------------------------------------------------------------ *
 * Brand constants
 * ------------------------------------------------------------------ */

:root {
	/* the blue used in the nextPYP logo (_static/nextPYP_logo.svg) */
	--nextpyp-blue: #057cff;
	--nextpyp-blue-dark: #0a5bbf;
	--nextpyp-blue-deep: #073e80;
	--nextpyp-blue-light: #4da3ff;
	--nextpyp-blue-pale: #e9f2ff;

	--nextpyp-radius: 8px;
	--nextpyp-radius-lg: 14px;
	--nextpyp-motion: 160ms ease;
}

/* ------------------------------------------------------------------ *
 * Self-hosted fonts
 *
 * html_theme_options.font is False so Sphinx does not fetch Google Fonts at
 * build time. These files live under _static/fonts/ and ship with the docs.
 * Inter is variable (one file covers all weights); JetBrains Mono uses a short
 * static set for code.
 * ------------------------------------------------------------------ */

@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("fonts/InterVariable.woff2") format("woff2");
}

@font-face {
	font-family: "Inter";
	font-style: italic;
	font-weight: 100 900;
	font-display: swap;
	src: url("fonts/InterVariable-Italic.woff2") format("woff2");
}

@font-face {
	font-family: "JetBrains Mono";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("fonts/JetBrainsMono-Regular.woff2") format("woff2");
}

@font-face {
	font-family: "JetBrains Mono";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("fonts/JetBrainsMono-Medium.woff2") format("woff2");
}

@font-face {
	font-family: "JetBrains Mono";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("fonts/JetBrainsMono-Bold.woff2") format("woff2");
}

@font-face {
	font-family: "JetBrains Mono";
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url("fonts/JetBrainsMono-Italic.woff2") format("woff2");
}

/* ------------------------------------------------------------------ *
 * Light scheme
 * ------------------------------------------------------------------ */

[data-md-color-scheme="default"] {
	/* header, sidebar highlights, buttons */
	--md-primary-fg-color: var(--nextpyp-blue-dark);
	--md-primary-fg-color--light: var(--nextpyp-blue);
	--md-primary-fg-color--dark: var(--nextpyp-blue-deep);
	--md-primary-bg-color: #ffffff;
	--md-primary-bg-color--light: rgba(255, 255, 255, 0.7);

	/* interactive accents: link hover, focused search, scrollbars */
	--md-accent-fg-color: var(--nextpyp-blue);
	--md-accent-fg-color--transparent: rgba(5, 124, 255, 0.1);
	--md-accent-bg-color: #ffffff;

	/* body links */
	--md-typeset-a-color: var(--nextpyp-blue-dark);

	--nextpyp-surface: #ffffff;
	--nextpyp-surface-alt: #f6f9fd;
	--nextpyp-border: rgba(9, 30, 66, 0.12);
	--nextpyp-border-strong: rgba(9, 30, 66, 0.22);
	--nextpyp-shadow: 0 1px 2px rgba(9, 30, 66, 0.06), 0 4px 12px rgba(9, 30, 66, 0.06);
	--nextpyp-shadow-hover: 0 2px 4px rgba(9, 30, 66, 0.08), 0 12px 28px rgba(9, 30, 66, 0.12);
}

/* ------------------------------------------------------------------ *
 * Dark scheme
 *
 * The Material header is always filled with the primary color, so in dark mode
 * the primary has to be a dark tone rather than the brand blue. That is also why
 * `html_logo` stays the white logo variant in both schemes.
 * ------------------------------------------------------------------ */

[data-md-color-scheme="slate"] {
	--md-primary-fg-color: #101c2e;
	--md-primary-fg-color--light: #1b3a5c;
	--md-primary-fg-color--dark: #0a1220;
	--md-primary-bg-color: #e9f0fa;
	--md-primary-bg-color--light: rgba(233, 240, 250, 0.7);

	--md-accent-fg-color: var(--nextpyp-blue-light);
	--md-accent-fg-color--transparent: rgba(77, 163, 255, 0.15);
	--md-accent-bg-color: #0a1220;

	--md-typeset-a-color: #7cbcff;

	--nextpyp-surface: rgba(255, 255, 255, 0.03);
	--nextpyp-surface-alt: rgba(255, 255, 255, 0.05);
	--nextpyp-border: rgba(255, 255, 255, 0.14);
	--nextpyp-border-strong: rgba(255, 255, 255, 0.28);
	--nextpyp-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
	--nextpyp-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.5), 0 12px 28px rgba(0, 0, 0, 0.45);
}

/* ------------------------------------------------------------------ *
 * sphinx-design tokens
 *
 * sphinx-design ships light-only defaults, so these need a per-scheme pass too
 * or every card and tab set renders with light borders on a dark background.
 * ------------------------------------------------------------------ */

[data-md-color-scheme="default"] {
	--sd-color-primary: var(--nextpyp-blue-dark);
	--sd-color-primary-highlight: var(--nextpyp-blue-deep);
	--sd-color-primary-text: #ffffff;
	--sd-color-secondary: #5a6472;
	--sd-color-secondary-highlight: #46505c;
	--sd-color-secondary-text: #ffffff;
	--sd-color-success: #1f8a4c;
	--sd-color-success-highlight: #19703d;
	--sd-color-success-text: #ffffff;
	--sd-color-info: var(--nextpyp-blue);
	--sd-color-info-highlight: var(--nextpyp-blue-dark);
	--sd-color-info-text: #ffffff;
	--sd-color-warning: #d98324;
	--sd-color-warning-highlight: #b56b1c;
	--sd-color-warning-text: #ffffff;
	--sd-color-danger: #d3341f;
	--sd-color-danger-highlight: #b02a19;
	--sd-color-danger-text: #ffffff;
	--sd-color-light: var(--nextpyp-surface-alt);
	--sd-color-light-highlight: #e7eef8;
	--sd-color-light-text: #172b4d;
	--sd-color-muted: #5a6472;
	--sd-color-muted-highlight: #46505c;
	--sd-color-muted-text: #ffffff;
	--sd-color-dark: #172b4d;
	--sd-color-dark-highlight: #0f1d34;
	--sd-color-dark-text: #ffffff;

	--sd-color-shadow: rgba(9, 30, 66, 0.12);
	--sd-color-card-border: var(--nextpyp-border);
	--sd-color-card-border-hover: var(--nextpyp-blue);
	--sd-color-card-background: var(--nextpyp-surface);
	--sd-color-card-text: inherit;
	--sd-color-card-header: transparent;
	--sd-color-card-footer: transparent;

	--sd-color-tabs-label-active: var(--nextpyp-blue-dark);
	--sd-color-tabs-label-hover: var(--nextpyp-blue);
	--sd-color-tabs-label-inactive: #6b7684;
	--sd-color-tabs-underline-active: var(--nextpyp-blue-dark);
	--sd-color-tabs-underline-hover: rgba(5, 124, 255, 0.4);
	--sd-color-tabs-underline-inactive: transparent;
	--sd-color-tabs-overline: var(--nextpyp-border);
	--sd-color-tabs-underline: var(--nextpyp-border);
}

[data-md-color-scheme="slate"] {
	--sd-color-primary: var(--nextpyp-blue);
	--sd-color-primary-highlight: var(--nextpyp-blue-light);
	--sd-color-primary-text: #ffffff;
	--sd-color-secondary: #8b95a3;
	--sd-color-secondary-highlight: #a3acb8;
	--sd-color-secondary-text: #0a1220;
	--sd-color-success: #3ecf7a;
	--sd-color-success-highlight: #5fdb92;
	--sd-color-success-text: #0a1220;
	--sd-color-info: var(--nextpyp-blue-light);
	--sd-color-info-highlight: #7cbcff;
	--sd-color-info-text: #0a1220;
	--sd-color-warning: #f0a758;
	--sd-color-warning-highlight: #f5bb7c;
	--sd-color-warning-text: #0a1220;
	--sd-color-danger: #ff6b5b;
	--sd-color-danger-highlight: #ff8a7d;
	--sd-color-danger-text: #0a1220;
	--sd-color-light: var(--nextpyp-surface-alt);
	--sd-color-light-highlight: rgba(255, 255, 255, 0.1);
	--sd-color-light-text: #e9f0fa;
	--sd-color-muted: #8b95a3;
	--sd-color-muted-highlight: #a3acb8;
	--sd-color-muted-text: #0a1220;
	--sd-color-dark: #e9f0fa;
	--sd-color-dark-highlight: #ffffff;
	--sd-color-dark-text: #0a1220;

	--sd-color-shadow: rgba(0, 0, 0, 0.5);
	--sd-color-card-border: var(--nextpyp-border);
	--sd-color-card-border-hover: var(--nextpyp-blue-light);
	--sd-color-card-background: var(--nextpyp-surface);
	--sd-color-card-text: inherit;
	--sd-color-card-header: transparent;
	--sd-color-card-footer: transparent;

	--sd-color-tabs-label-active: var(--nextpyp-blue-light);
	--sd-color-tabs-label-hover: #7cbcff;
	--sd-color-tabs-label-inactive: #8b95a3;
	--sd-color-tabs-underline-active: var(--nextpyp-blue-light);
	--sd-color-tabs-underline-hover: rgba(77, 163, 255, 0.4);
	--sd-color-tabs-underline-inactive: transparent;
	--sd-color-tabs-overline: var(--nextpyp-border);
	--sd-color-tabs-underline: var(--nextpyp-border);
}

:root {
	--sd-fontsize-tabs-label: 0.72rem;
	--sd-fontsize-dropdown-title: 1rem;
	--sd-fontweight-dropdown-title: 700;
}

/* ------------------------------------------------------------------ *
 * Typography
 *
 * `font` is set to False in html_theme_options so the theme does not download web
 * fonts at build time. The @font-face rules above load Inter and JetBrains Mono
 * from _static/fonts/; the stacks below keep system fallbacks for print and
 * offline edge cases.
 * ------------------------------------------------------------------ */

:root {
	--md-text-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;
	--md-code-font: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
		Consolas, "Liberation Mono", monospace;
}

.md-typeset {
	font-feature-settings: "ss01" on, "cv11" on;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
	font-weight: 650;
	letter-spacing: -0.01em;
}

.md-typeset h1 {
	color: var(--md-default-fg-color);
}

.md-typeset h2 {
	margin-top: 2rem;
	padding-bottom: 0.3rem;
	border-bottom: 1px solid var(--nextpyp-border);
}

/* Section hubs (start/, tutorials/, guide/, ...) wrap the lede in
 * .nextpyp-hub-lede so the title and intro get a little more presence than a
 * plain content page, without needing a per-page body class. */
.md-typeset:has(> .nextpyp-hub-lede) > h1 {
	margin-bottom: 0.6rem;
	font-size: 2rem;
	letter-spacing: -0.02em;
}

.nextpyp-hub-lede {
	max-width: 46em;
	margin: 0 0 2rem;
	padding: 0.85rem 1rem 0.85rem 1.05rem;
	border-left: 3px solid var(--nextpyp-blue);
	border-radius: 0 var(--nextpyp-radius) var(--nextpyp-radius) 0;
	background: var(--nextpyp-surface-alt);
	font-size: 0.88rem;
	line-height: 1.7;
	color: var(--md-default-fg-color--light);
}

.nextpyp-hub-lede p:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------ *
 * Cards
 * ------------------------------------------------------------------ */

.sd-card {
	border-radius: var(--nextpyp-radius);
	box-shadow: var(--nextpyp-shadow);
	transition:
		box-shadow var(--nextpyp-motion),
		border-color var(--nextpyp-motion),
		transform var(--nextpyp-motion);
}

.sd-card:hover {
	box-shadow: var(--nextpyp-shadow-hover);
	border-color: var(--sd-color-card-border-hover);
}

/* sphinx-design adds sd-card-hover only to cards that carry a link */
.sd-card-hover:hover {
	transform: translateY(-2px);
}

.nextpyp-cards .sd-card-title {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	font-size: 1.02rem;
	font-weight: 650;
	line-height: 1.3;
}

.nextpyp-cards .sd-card-title .fa,
.nextpyp-cards .sd-card-title .fas,
.nextpyp-cards .sd-card-title .fab,
.nextpyp-cards .sd-card-title .far {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.7rem;
	height: 1.7rem;
	margin-right: 0;
	border-radius: 6px;
	background: var(--md-accent-fg-color--transparent);
	color: var(--md-accent-fg-color);
	font-size: 0.78rem;
}

.nextpyp-cards .sd-card-body {
	font-size: 0.8rem;
	line-height: 1.65;
}

/* card link text should not look like a body link */
.sd-card a.reference.internal {
	color: inherit;
	text-decoration: none;
}

/* ------------------------------------------------------------------ *
 * Team cards
 *
 * The About page lists team members as compact cards: avatar on the left, name and
 * badges on the right. sphinx-design emits the `img-top` image as a sibling of the
 * card body inside a column flexbox, so switching the card to a row is enough to
 * get the horizontal layout without changing the markup.
 *
 * The lab site publishes photographs only for current members, so past contributors
 * use generated initials avatars (see images/team/avatar_*.svg) to keep the same
 * shape without sourcing photographs from elsewhere.
 * ------------------------------------------------------------------ */

.nextpyp-person {
	flex-direction: row;
	align-items: center;
	gap: 0.7rem;
	padding: 0.5rem 0.7rem;
}

.nextpyp-person .sd-card-img-top {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	margin: 0;
	border-radius: 50%;
	/* the sources are already square, but this keeps any future replacement
	   from being stretched */
	object-fit: cover;
}

.nextpyp-person .sd-card-body {
	flex: 1 1 auto;
	/* without this a long name overflows the card instead of wrapping */
	min-width: 0;
	padding: 0;
	text-align: left;
}

.nextpyp-person .sd-card-title {
	font-size: 0.75rem;
	font-weight: 650;
	margin-bottom: 0.15rem;
}

.nextpyp-person .sd-card-body p:last-child {
	margin-bottom: 0;
	line-height: 1;
}

/* ------------------------------------------------------------------ *
 * Admonitions
 * ------------------------------------------------------------------ */

.md-typeset .admonition,
.md-typeset details {
	margin: 1.35em 0;
	padding-bottom: 0.2rem;
	border-radius: var(--nextpyp-radius);
	border: 1px solid var(--nextpyp-border);
	border-left: 3px solid currentcolor;
	box-shadow: none;
	background-color: var(--nextpyp-surface-alt);
}

.md-typeset .admonition-title,
.md-typeset summary {
	padding-top: 0.7em;
	padding-bottom: 0.55em;
	font-weight: 650;
	background-color: transparent;
	border-radius: calc(var(--nextpyp-radius) - 1px) 0 0 0;
}

.md-typeset .admonition.note,
.md-typeset details.note {
	border-left-color: var(--nextpyp-blue);
}

.md-typeset .admonition.tip,
.md-typeset .admonition.hint,
.md-typeset .admonition.important,
.md-typeset details.tip,
.md-typeset details.hint,
.md-typeset details.important {
	border-left-color: #1f8a4c;
}

.md-typeset .admonition.warning,
.md-typeset .admonition.caution,
.md-typeset .admonition.attention,
.md-typeset details.warning,
.md-typeset details.caution,
.md-typeset details.attention {
	border-left-color: #d98324;
}

.md-typeset .admonition.danger,
.md-typeset .admonition.error,
.md-typeset details.danger,
.md-typeset details.error {
	border-left-color: #d3341f;
}

.md-typeset .admonition.nextpyp,
.md-typeset details.nextpyp {
	border-left-color: var(--nextpyp-blue);
}

.md-typeset .admonition > :last-child,
.md-typeset details > :last-child {
	margin-bottom: 0.55em;
}

/* sphinx-design dropdowns. The theme already draws an icon (::before) and a
 * chevron (::after) on every <summary>, and sphinx-design adds a second chevron
 * and a narrower, inline-flex title that ignores the icon's space, so the icon
 * lands on the first letter and two chevrons show. Keep the theme's chrome and
 * give the title the same padding as the other admonitions. */
.md-typeset details.sd-dropdown > summary.sd-summary-title {
	display: block;
	padding: 0.7em 1.8rem 0.55em 2rem;
	border-bottom: none;
}

.md-typeset details.sd-dropdown > summary.sd-summary-title::before,
.md-typeset details.sd-dropdown > summary.sd-summary-title::after {
	top: calc(50% - 0.5rem);   /* both are 1rem tall; the title font is larger than the theme expects */
}

.md-typeset details.sd-dropdown > summary.sd-summary-title .sd-summary-state-marker {
	display: none;
}

.md-typeset details.sd-dropdown > summary.sd-summary-title .sd-summary-text {
	padding-right: 0;
}

/* ------------------------------------------------------------------ *
 * Code
 * ------------------------------------------------------------------ */

.md-typeset code {
	padding: 0.12em 0.38em;
	border-radius: 4px;
	font-size: 0.84em;
	background-color: var(--nextpyp-surface-alt);
	box-shadow: inset 0 0 0 1px var(--nextpyp-border);
}

.md-typeset a code {
	color: inherit;
}

[data-md-color-scheme="default"] .md-typeset code {
	color: #12325c;
}

[data-md-color-scheme="slate"] .md-typeset code {
	color: #cfe3ff;
	background-color: rgba(255, 255, 255, 0.06);
}

/* Inside boxes (admonitions, dropdowns, nextpyp blocks) the box background is
 * the same pale tint as inline code, so give inline code a contrasting fill. */
[data-md-color-scheme="default"] .md-typeset :is(.admonition, details) :not(pre) > code {
	color: #0a3a80;
	font-weight: 500;
	background-color: #ffffff;
	box-shadow: inset 0 0 0 1px rgba(5, 124, 255, 0.45);
}

[data-md-color-scheme="slate"] .md-typeset :is(.admonition, details) :not(pre) > code {
	background-color: rgba(255, 255, 255, 0.12);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

/*
 * Sphinx wraps blocks as .highlight > pre > code. Put the single frame on
 * .highlight (or a bare pre), and strip borders/backgrounds from the inner
 * layers so they do not stack into a double box.
 */
.md-typeset .highlight,
.md-typeset > pre {
	border-radius: var(--nextpyp-radius-lg);
	border: 1px solid var(--nextpyp-border);
	background-color: var(--nextpyp-surface-alt);
	box-shadow: none;
}

.md-typeset .highlight:hover,
.md-typeset > pre:hover {
	border-color: var(--nextpyp-border-strong);
}

.md-typeset .highlight pre {
	margin: 0;
	background: transparent;
	border: none;
	box-shadow: none;
}

.md-typeset pre > code,
.md-typeset .highlight > pre > code {
	padding: 0.85em 1em;
	border-radius: 0;
	box-shadow: none;
	background-color: transparent;
	font-size: 0.78em;
	line-height: 1.65;
}

/* sphinx-copybutton affordance */
button.copybtn {
	opacity: 0.45;
	transition: opacity var(--nextpyp-motion), transform var(--nextpyp-motion);
}

.highlight:hover button.copybtn,
pre:hover button.copybtn,
button.copybtn:focus {
	opacity: 1;
}

button.copybtn:hover {
	transform: scale(1.05);
}

/* ------------------------------------------------------------------ *
 * Tables
 * ------------------------------------------------------------------ */

.md-typeset .table-wrapper {
	overflow-x: auto;
	border-radius: var(--nextpyp-radius);
	border: 1px solid var(--nextpyp-border);
}

.md-typeset table:not([class]) {
	display: table;
	width: 100%;
	border-radius: var(--nextpyp-radius);
	border: 1px solid var(--nextpyp-border);
	box-shadow: none;
	overflow: hidden;
}

.md-typeset table:not([class]) th {
	background-color: var(--nextpyp-surface-alt);
	font-weight: 650;
	white-space: nowrap;
}

.md-typeset table:not([class]) tr:nth-child(even) td {
	background-color: var(--nextpyp-surface-alt);
}

.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th {
	border-color: var(--nextpyp-border);
	padding: 0.55em 0.85em;
}

/* Sticky first column on wide parameter / reference tables */
@media screen and (min-width: 60em) {
	.md-typeset table:not([class]) th:first-child,
	.md-typeset table:not([class]) td:first-child {
		position: sticky;
		left: 0;
		z-index: 1;
		background-color: var(--md-default-bg-color);
		box-shadow: 1px 0 0 var(--nextpyp-border);
	}

	.md-typeset table:not([class]) th:first-child {
		background-color: var(--nextpyp-surface-alt);
		z-index: 2;
	}

	.md-typeset table:not([class]) tr:nth-child(even) td:first-child {
		background-color: var(--nextpyp-surface-alt);
	}
}

/* ------------------------------------------------------------------ *
 * Figures
 *
 * Most figures in these docs are UI screenshots, which need a frame to read as
 * distinct from the page background.
 * ------------------------------------------------------------------ */

.md-typeset figure {
	margin: 1.5em 0 1.75em;
}

.md-typeset figure img,
.md-typeset figure .align-center {
	border-radius: var(--nextpyp-radius);
	border: 1px solid var(--nextpyp-border);
	background-color: var(--nextpyp-surface-alt);
}

.md-typeset figcaption {
	max-width: 100%;
	margin-top: 0.65rem;
	padding-top: 0.55rem;
	border-top: 1px solid var(--nextpyp-border);
	font-size: 0.78rem;
	line-height: 1.55;
	color: var(--md-default-fg-color--light);
}

/* inline icon images (ORCID, GitLab, LinkedIn badges on the About page)
 * must not get a frame */
.md-typeset a > img[alt^="ORCID"],
.md-typeset a > img[alt^="GitLab"],
.md-typeset a > img[alt^="LinkedIn"] {
	border: none;
	background: none;
	border-radius: 0;
}

/* ------------------------------------------------------------------ *
 * Header
 * ------------------------------------------------------------------ */

/*
 * html_logo is a wordmark that already reads "nextPYP", so the site name printed
 * next to it is redundant. html_title still needs to be set for browser tab titles
 * and search results, so hide just that text.
 *
 * Only the label span is hidden, not the containing topic: the theme injects the
 * version dropdown into that element at runtime, and hiding the whole topic would
 * take the version selector with it. The second topic (the current page title,
 * which slides in on scroll) is left alone.
 */
.md-header__topic:not([data-md-component="header-topic"]) > .md-ellipsis {
	display: none;
}

/*
 * The theme appends the version selector to the first .md-header__topic, which it
 * styles at font-weight: 700 so the site name reads as a title. The dropdown entries
 * pick that weight up by inheritance and render bold, unlike the sidebar and tab
 * menus. Reset the whole widget to the body weight; the trigger is a button, which
 * the theme's reset leaves at the browser's own normal weight.
 *
 * The list is capped at a short max-height with overflow:auto, and with ~16
 * releases that produces a thick OS scrollbar against the white panel. Restyle
 * the panel to match the rest of the chrome and replace the scrollbar with a
 * thin branded one (Firefox via scrollbar-* properties; Chromium/Safari via
 * ::-webkit-scrollbar).
 */
.md-version {
	font-weight: 400;
}

.md-version__current {
	display: inline-flex;
	align-items: center;
	margin-left: 0.6rem !important;
	margin-right: 0 !important;
	padding: 0.15rem 0.55rem 0.15rem 0.65rem;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	font-size: 0.72rem;
	letter-spacing: 0.01em;
	transition: background-color var(--nextpyp-motion), border-color var(--nextpyp-motion);
}

.md-version__current:hover,
.md-version:focus-within .md-version__current {
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.45);
}

/*
 * Do NOT raise max-height here. The theme collapses the closed panel with
 * max-height: 0 and hides it with opacity: 0, and an opacity: 0 box still
 * hit-tests, so forcing a height in the base rule leaves an invisible panel
 * covering the navigation tabs and stealing their clicks. The taller panel is
 * applied only in the open state below. pointer-events is belt-and-braces for
 * the same failure mode.
 */
.md-version__list {
	width: max-content;
	min-width: 3.6rem;
	max-width: 6rem;
	/* left margin must track .md-version__current's margin-left: the list is
	   absolutely positioned with left: auto, so its left edge resolves to the
	   .md-version content edge rather than to the pill. */
	margin: 0.35rem 0 0 0.6rem !important;
	padding: 0.3rem 0;
	border: 1px solid var(--nextpyp-border);
	border-radius: var(--nextpyp-radius) !important;
	background-color: var(--md-default-bg-color);
	box-shadow: var(--nextpyp-shadow-hover);
	pointer-events: none;
	/* thin branded scrollbar; hide until the list is hovered so a thick OS bar
	   does not dominate the closed-looking panel */
	scrollbar-width: thin;
	scrollbar-color: transparent transparent;
}

/* Matches the theme's own open-state selector, and wins on load order. */
.md-version:is(:focus-within, :hover) .md-version__list {
	max-height: 15rem;
	pointer-events: auto;
}

.md-version__list:hover,
.md-version__list:focus-within {
	scrollbar-color: var(--nextpyp-border-strong) transparent;
}

.md-version__list::-webkit-scrollbar {
	width: 6px;
}

.md-version__list::-webkit-scrollbar-track {
	background: transparent;
	margin: 0.3rem 0;
}

.md-version__list::-webkit-scrollbar-thumb {
	border-radius: 999px;
	background-color: transparent;
}

.md-version__list:hover::-webkit-scrollbar-thumb,
.md-version__list:focus-within::-webkit-scrollbar-thumb {
	background-color: var(--nextpyp-border-strong);
}

.md-version__list:hover::-webkit-scrollbar-thumb:hover {
	background-color: var(--nextpyp-blue);
}

.md-version__item {
	line-height: 1.7rem;
}

.md-version__link {
	padding: 0.15rem 0.6rem !important;
	font-size: 0.72rem;
	font-weight: 400;
	border-radius: 0;
	transition: background-color var(--nextpyp-motion), color var(--nextpyp-motion);
}

.md-version__link:is(:focus, :hover) {
	background-color: var(--md-accent-fg-color--transparent);
	color: var(--md-accent-fg-color);
}

/*
 * The theme fills the announcement bar with the footer colors. In the light scheme
 * that is a near-black bar, which reads clearly against a white page, but the dark
 * scheme footer sits within a few percent lightness of both the slate background and
 * the header, so the bar recedes into the top of the page. Fill it with the brand
 * blue instead. The dark variant is deliberate: it holds white 0.7rem text at about
 * 6.4:1, where the brighter --nextpyp-blue would fall to 3.9:1 and miss the 4.5:1
 * floor for normal-size text. Sizing and link styling live in landing.css.
 */
[data-md-color-scheme="slate"] .md-banner {
	background-color: var(--nextpyp-blue-dark);
	color: #ffffff;
}

/* ------------------------------------------------------------------ *
 * Navigation
 * ------------------------------------------------------------------ */

/* Tighten the gap between the top tabs and the page / sidebars. */
.md-main__inner {
	margin-top: 1rem;
}

.md-content__inner {
	padding-top: 0.4rem;
}

.md-content__inner::before {
	height: 0.2rem;
}

.md-sidebar {
	padding-top: 0.85rem;
	padding-bottom: 1.2rem;
}

.md-nav__title {
	font-weight: 650;
}

/*
 * On a section landing page (start/, guide/, reference/, ...) the theme appends a
 * second copy of the page's own table of contents to the bottom of the left
 * sidebar, where it shows up as a stray duplicate of the section title. The theme
 * already intends to hide it above 60em, but that rule loses to a style applied at
 * runtime, so it has to be reasserted. Below 60em the copy is left alone: that is
 * where it does its real job, inside the collapsed "hamburger" navigation.
 */
@media screen and (min-width: 60em) {
	.md-nav__current-toc {
		display: none !important;
	}
}

.md-tabs__link--active {
	font-weight: 650;
}

/*
 * Right-hand page TOC (`.md-nav--secondary`). Match the left nav: same link
 * padding / rail, no sticky title glow, and the same air after the title
 * (and after nested parent headings) before the first child.
 */
.md-sidebar--secondary .md-nav--secondary > .md-nav__title {
	font-weight: 650;
	padding-block: 0.25rem;
	padding-inline: 0.5rem 0.35rem;
	margin-bottom: 0;
	background: var(--md-default-bg-color);
	box-shadow: none;
}

.md-sidebar--secondary .md-nav--secondary > .md-nav__list {
	padding-top: 0.05rem;
}

.md-sidebar--secondary .md-nav--secondary .md-nav__item {
	margin: 0;
}

/*
 * line-height 1.35 + overflow:hidden on .md-ellipsis clipped glyph bottoms
 * (Inter ink sits slightly outside the em box). A flush active fill on the
 * next item then painted over that overflow, so "Download the installer"
 * looked truncated along the top edge of "Run it". Give the line box and
 * the inter-item gap enough room that neighboring fills cannot cover ink.
 */
.md-sidebar--secondary .md-nav--secondary .md-nav__link {
	margin-block: 0.05rem;
	margin-inline: 0;
	padding-block: 0.25rem;
	padding-inline: 0.5rem 0.35rem;
	border-inline-start: 2px solid transparent;
	border-radius: 0 var(--nextpyp-radius) var(--nextpyp-radius) 0;
	line-height: 1.45;
	box-sizing: border-box;
	transition:
		background-color var(--nextpyp-motion),
		border-color var(--nextpyp-motion),
		color var(--nextpyp-motion);
}

.md-sidebar--secondary .md-nav--secondary .md-nav__link .md-ellipsis {
	overflow: visible;
}

.md-sidebar--secondary .md-nav--secondary .md-nav__link:is(:hover, :focus) {
	background-color: var(--md-accent-fg-color--transparent);
	border-inline-start-color: var(--md-accent-fg-color);
}

.md-sidebar--secondary .md-nav--secondary .md-nav__link--active {
	font-weight: inherit;
	color: var(--md-typeset-a-color);
	background-color: var(--md-accent-fg-color--transparent);
	border-inline-start-color: var(--md-primary-fg-color);
}

/* Nested TOC parents: same caption → first-child gap as left section titles. */
.md-sidebar--secondary .md-nav--secondary .md-nav__item > .md-nav__link:has(+ .md-nav) {
	margin-bottom: 0.1rem;
}

.md-sidebar--secondary .md-nav--secondary .md-nav__item > .md-nav > .md-nav__list {
	padding-top: 0.1rem;
}

.md-sidebar--secondary .md-nav--secondary .md-nav__item > .md-nav > .md-nav__list > .md-nav__item:first-child > .md-nav__link {
	margin-top: 0.05rem;
}

/*
 * Left navigation sidebar: match the right-hand TOC treatment (padding, left
 * rail, hover / active fill). Scoped to ≥60em so the mobile drawer keeps the
 * theme's denser, full-bleed hit targets.
 */
@media screen and (min-width: 60em) {
	.md-sidebar--primary .md-nav--primary :is(.md-nav__title, .md-nav__item) {
		font-size: 0.7rem;
		line-height: 1.45;
	}

	.md-sidebar--primary .md-nav--primary .md-nav__item {
		border-top: none;
	}

	.md-sidebar--primary .md-nav--primary .md-nav__link {
		margin-block: 0.05rem;
		margin-inline: 0;
		padding-block: 0.25rem;
		padding-inline: 0.5rem 0.35rem;
		border-inline-start: 2px solid transparent;
		border-radius: 0 var(--nextpyp-radius) var(--nextpyp-radius) 0;
		line-height: 1.45;
		box-sizing: border-box;
		transition:
			background-color var(--nextpyp-motion),
			border-color var(--nextpyp-motion),
			color var(--nextpyp-motion);
	}

	.md-sidebar--primary .md-nav--primary .md-nav__link .md-ellipsis {
		overflow: visible;
	}

	.md-sidebar--primary .md-nav--primary .md-nav__link:is(:hover, :focus) {
		background-color: var(--md-accent-fg-color--transparent);
		border-inline-start-color: var(--md-accent-fg-color);
		box-shadow: none;
	}

	/*
	 * Active fill only on the current page link — not on ancestor section
	 * headers. Applying it to `.md-nav__item--active > .md-nav__link` painted
	 * "Streaming sessions" and "Single-particle session" as one contiguous
	 * bar, which clipped the first child highlight at the join.
	 */
	.md-sidebar--primary .md-nav--primary .md-nav__link--active {
		font-weight: inherit;
		color: var(--md-typeset-a-color);
		background-color: var(--md-accent-fg-color--transparent);
		border-inline-start-color: var(--md-primary-fg-color);
		box-shadow: none;
	}

	/* Section captions read like the TOC title: weight, no rail / fill. */
	.md-sidebar--primary .md-nav--primary .md-nav__item--section > .md-nav__link,
	.md-sidebar--primary .md-nav--primary .md-nav__item--section > .md-nav__link:is(:hover, :focus) {
		font-weight: 650;
		color: var(--md-default-fg-color);
		background-color: transparent;
		border-inline-start-color: transparent;
		box-shadow: none;
		padding-block: 0.25rem;
		margin-bottom: 0.1rem;
	}

	/*
	 * Air between a section caption and its first child so the active /
	 * hover fill is not flush against the caption baseline (reads as a
	 * truncated top edge).
	 */
	.md-sidebar--primary .md-nav--primary .md-nav__item--section > .md-nav > .md-nav__list {
		padding-top: 0.1rem;
	}

	.md-sidebar--primary .md-nav--primary .md-nav__item--section > .md-nav > .md-nav__list > .md-nav__item:first-child > .md-nav__link {
		margin-top: 0.05rem;
	}

	/* Lifted sticky section header: keep it sticky, drop the theme's heavy
	   glow-shadow so it reads like the TOC title rather than a floating bar. */
	.md-sidebar--primary .md-nav--lifted > .md-nav__list > .md-nav__item--active > .md-nav__link {
		font-weight: 650;
		padding-block: 0.3rem;
		background: var(--md-default-bg-color);
		box-shadow: none;
		border-inline-start-color: transparent;
	}
}

/*
 * When the right-hand TOC sidebar is present, hide the duplicate toc-toggle
 * label inside the left nav. Leaving it visible stacks two `.md-nav__link--active`
 * boxes (label + anchor) and the upper one collapses, which clips the highlight.
 */
@media screen and (min-width: 76.25em) {
	.md-sidebar--primary .md-nav__link[for="__toc"] {
		display: none !important;
	}

	.md-sidebar--primary .md-nav__link[for="__toc"] + .md-nav__link {
		display: flex !important;
	}

	.md-sidebar--primary .md-nav__link[for="__toc"] ~ .md-nav.md-nav--secondary {
		display: none !important;
	}
}

/* ------------------------------------------------------------------ *
 * Search dropdown
 * ------------------------------------------------------------------ */

.md-search-result__meta {
	font-size: 0.65rem;
	color: var(--md-default-fg-color--light);
}

.md-search-result__title {
	font-weight: 650;
}

.md-search-result__teaser {
	font-size: 0.72rem;
	color: var(--md-default-fg-color--light);
}

.md-search-result mark {
	color: var(--md-accent-fg-color);
	background: var(--md-accent-fg-color--transparent);
	box-shadow: none;
}

.md-search-result__article--document .md-search-result__title {
	font-size: 0.82rem;
}

.md-search-result__more > summary {
	color: var(--md-typeset-a-color);
}

.md-search__form {
	border-radius: var(--nextpyp-radius);
}

.md-search__input {
	font-family: var(--md-text-font);
}

/* ------------------------------------------------------------------ *
 * Footer
 *
 * The meta bar sits on the theme's dark footer background. Use the footer
 * foreground tokens (near-white), not the page body muted gray — that gray is
 * meant for light surfaces and disappears on the dark bar.
 * ------------------------------------------------------------------ */

.md-footer-meta {
	background-color: transparent;
}

.md-footer-meta__inner {
	align-items: flex-start;
	gap: 1rem;
	padding-top: 1.1rem;
	padding-bottom: 1.1rem;
}

.md-copyright {
	font-size: 0.72rem;
	line-height: 1.55;
	color: var(--md-footer-fg-color--light);
}

.md-footer-copyright__highlight {
	color: var(--md-footer-fg-color);
}

.nextpyp-footer-links {
	margin-top: 0.35rem;
	font-size: 0.72rem;
	color: var(--md-footer-fg-color--light);
}

.nextpyp-footer-links a {
	color: var(--md-footer-fg-color);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.nextpyp-footer-links a:hover {
	color: #ffffff;
}

.md-social__link {
	opacity: 0.85;
	transition: opacity var(--nextpyp-motion);
}

.md-social__link:hover {
	opacity: 1;
}

/* ------------------------------------------------------------------ *
 * Motion
 *
 * Keep transitions short: presence, not ornament. Respect reduced-motion.
 * ------------------------------------------------------------------ */

.md-typeset .nextpyp-cta:focus-visible {
	outline: 2px solid var(--md-accent-fg-color);
	outline-offset: 3px;
}

/*
 * Do not animate .md-banner. A fade/slide-in with fill-mode:both starts every
 * page at opacity 0, so the bar flashes (or stays blank) on each navigation
 * even with announce.dismiss off.
 */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
