/*
 * Theme tokens. Every color, the type family and weights, the radius and the header height are values of
 * the provenance-verified Beyond brand capture (see docs/implementation.md). The semantic names below are
 * this site's own; the pairs were chosen from the measured contrast table of that capture:
 * - body-size links use --primary-dark (#9e533e, 5.58:1 on white) in light mode and --accent-color
 *   (#ffa385, 9.31:1 on #101625) in dark mode, because --primary (#cb6245) only reaches 3.91:1 on white;
 * - --secondary-text-color (#99a3b1) fails on white, so muted text is --color-gray-70 (#5f5f5f) in light mode;
 * - filled controls with normal-size labels use --primary-dark.
 */
:root {
	--font: 'Rubik', sans-serif;
	--mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
	--weight-body: 300;
	--weight-strong: 500;

	--radius: 8px;
	--radius-small: 5px;
	--header: 60px;
	--measure: 46rem;
	--quick: 0.15s;

	--primary: #cb6245;
	--primary-dark: #9e533e;
	--primary-light: #e46f4e;
	--success: #6aac7d;
	--warning: #f7c700;
	--error: #f04141;

	/* The editor surface of the brand is the same navy in both modes */
	--code-bg: #1d2b3d;
	--code-text: #e8edf3;
	--code-muted: #99a3b1;
	--code-border: #2b3853;
	--code-accent: #ffa385;
	--code-green: #9ad4a9;
	--code-yellow: #f2cf66;
	--code-blue: #9cc7f5;

	--bg: #fff;
	--surface: #f5f5f5;
	--text: #000;
	--title: #121f36;
	--muted: #5f5f5f;
	--border: #e4e4e4;
	--border-strong: #c8c8c8;
	--link: #9e533e;
	--accent: #cb6245;
	--accent-wash: rgba(203, 98, 69, 0.1);
	--focus: #121f36;
	--filled: #9e533e;
	--on-filled: #fff;
	--note: #424f6e;
	--warning-text: #6b5600;
	--error-text: #b3261e;
	--proposal: #617096;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme='light']) {
		--bg: #101625;
		--surface: #112036;
		--text: #fff;
		--title: #fff;
		--muted: #99a3b1;
		--border: #2b3853;
		--border-strong: #424f6e;
		--link: #ffa385;
		--accent: #e46f4e;
		--accent-wash: rgba(255, 128, 86, 0.14);
		--focus: #ffa385;
		--note: #8e99bb;
		--warning-text: #f7c700;
		--error-text: #ff8a80;
		--proposal: #8e99bb;
		--code-bg: #0c1525;
		color-scheme: dark;
	}
}

:root[data-theme='dark'] {
	--bg: #101625;
	--surface: #112036;
	--text: #fff;
	--title: #fff;
	--muted: #99a3b1;
	--border: #2b3853;
	--border-strong: #424f6e;
	--link: #ffa385;
	--accent: #e46f4e;
	--accent-wash: rgba(255, 128, 86, 0.14);
	--focus: #ffa385;
	--note: #8e99bb;
	--warning-text: #f7c700;
	--error-text: #ff8a80;
	--proposal: #8e99bb;
	--code-bg: #0c1525;
	color-scheme: dark;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	font-size: 16px;
	scroll-padding-top: calc(var(--header) + 1.5rem);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-weight: var(--weight-body);
	font-size: 1.0625rem;
	line-height: 1.7;
	letter-spacing: 0.01em;
}

a {
	color: var(--link);
	text-decoration: none;
	text-underline-offset: 0.2em;
}

a:hover {
	text-decoration: underline;
}

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

h1,
h2,
h3,
h4 {
	color: var(--title);
	font-weight: var(--weight-strong);
	letter-spacing: 0.01em;
	text-wrap: balance;
}

strong,
b,
th {
	font-weight: var(--weight-strong);
}

code,
kbd,
pre {
	font-family: var(--mono);
	letter-spacing: 0;
}

img {
	max-width: 100%;
	height: auto;
}

button,
input,
select {
	font: inherit;
	color: inherit;
}

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

.skip-link {
	position: absolute;
	left: 1rem;
	top: -4rem;
	z-index: 100;
	padding: 0.5rem 1rem;
	background: var(--filled);
	color: var(--on-filled);
	border-radius: var(--radius-small);
	font-weight: var(--weight-strong);
}

.skip-link:focus {
	top: 0.6rem;
}

main:focus {
	outline: none;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--bg);
	border-bottom: 1px solid var(--border);
}

.site-header-inner {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	max-width: 1376px;
	min-height: var(--header);
	margin: 0 auto;
	padding: 0 1.5rem;
}

.site-title {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	color: var(--muted);
	font-size: 0.95rem;
}

.site-title:hover {
	text-decoration: none;
}

.site-title img {
	display: block;
	height: 1.5rem;
	width: auto;
}

.site-title-suffix {
	padding-left: 0.6rem;
	border-left: 1px solid var(--border-strong);
}

.site-sections {
	flex: 1;
	min-width: 0;
}

.site-sections ul,
.locale-selector ul {
	display: flex;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-sections a {
	display: block;
	padding: 0.35rem 0.75rem;
	border-radius: var(--radius-small);
	color: var(--muted);
}

.site-sections a:hover {
	color: var(--title);
	text-decoration: none;
}

.site-sections a[aria-current] {
	color: var(--title);
	font-weight: var(--weight-strong);
	box-shadow: inset 0 -2px 0 var(--accent);
	border-radius: 0;
}

.site-tools {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.icon-button {
	display: inline-grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	background: none;
	border: 1px solid transparent;
	border-radius: var(--radius-small);
	cursor: pointer;
}

.icon-button:hover {
	border-color: var(--border-strong);
}

/* A sun drawn with one element: the disc, and rays as a dashed ring. In dark mode it becomes a crescent. */
.theme-glyph {
	width: 0.8rem;
	height: 0.8rem;
	border-radius: 50%;
	background: var(--title);
	outline: 2px dotted var(--title);
	outline-offset: 3px;
}

:root[data-theme='dark'] .theme-glyph {
	background: none;
	outline: none;
	box-shadow: inset -0.28rem -0.12rem 0 0 var(--title);
	width: 1rem;
	height: 1rem;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme='light']) .theme-glyph {
		background: none;
		outline: none;
		box-shadow: inset -0.28rem -0.12rem 0 0 var(--title);
		width: 1rem;
		height: 1rem;
	}
}

.menu-button {
	display: none;
}

.menu-glyph,
.menu-glyph::before,
.menu-glyph::after {
	display: block;
	width: 1.1rem;
	height: 2px;
	background: var(--title);
}

.menu-glyph {
	position: relative;
}

.menu-glyph::before,
.menu-glyph::after {
	content: '';
	position: absolute;
	left: 0;
}

.menu-glyph::before {
	top: -6px;
}

.menu-glyph::after {
	top: 6px;
}

.locale-selector a {
	display: block;
	padding: 0.25rem 0.5rem;
	border: 1px solid transparent;
	border-radius: var(--radius-small);
	color: var(--muted);
	font-size: 0.85rem;
	font-weight: var(--weight-strong);
}

.locale-selector a[aria-current] {
	border-color: var(--border-strong);
	color: var(--title);
}

.site-main {
	display: grid;
	grid-template-columns: 17rem minmax(0, 1fr) 15rem;
	gap: 0 3rem;
	max-width: 1376px;
	margin: 0 auto;
	padding: 0 1.5rem;
}

.layout-plain .site-main {
	grid-template-columns: minmax(0, 1fr);
	max-width: 62rem;
}

main {
	grid-column: 2;
	min-width: 0;
	padding: 2.5rem 0 4rem;
}

.layout-plain main {
	grid-column: 1;
}

.sidebar,
.site-aside {
	position: sticky;
	top: var(--header);
	align-self: start;
	max-height: calc(100vh - var(--header));
	overflow-y: auto;
	padding: 2.5rem 0 3rem;
}

.site-footer {
	border-top: 1px solid var(--border);
	color: var(--muted);
	font-size: 0.9rem;
}

.site-footer-inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem 2rem;
	max-width: 1376px;
	margin: 0 auto;
	padding: 1.5rem;
}

.site-footer p {
	margin: 0;
	max-width: 44rem;
}

.site-footer ul {
	display: flex;
	flex-wrap: wrap;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.layout-root main {
	max-width: 30rem;
	margin: 20vh auto 0;
	padding: 0 1.5rem;
}

.root-locales {
	padding: 0;
	list-style: none;
	font-size: 1.25rem;
}

@media (max-width: 1180px) {
	.site-main {
		grid-template-columns: 16rem minmax(0, 1fr);
	}

	.site-aside {
		display: none;
	}
}

@media (max-width: 900px) {
	.site-header-inner {
		flex-wrap: wrap;
		gap: 0 0.75rem;
		padding: 0 1rem;
	}

	.menu-button {
		display: inline-grid;
	}

	.site-title-suffix {
		display: none;
	}

	.site-tools {
		margin-left: auto;
	}

	.site-sections {
		order: 5;
		flex-basis: 100%;
		overflow-x: auto;
		border-top: 1px solid var(--border);
	}

	.site-main {
		display: block;
		padding: 0 1rem;
	}

	main {
		padding-top: 1.5rem;
	}

	.sidebar {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 60;
		width: min(20rem, 86vw);
		max-height: none;
		padding: 1.5rem 1.25rem 3rem;
		background: var(--bg);
		border-right: 1px solid var(--border);
		transform: translateX(-100%);
		visibility: hidden;
		transition: transform var(--quick) ease-in, visibility 0s var(--quick);
	}

	.sidebar[data-open] {
		transform: none;
		visibility: visible;
		transition: transform var(--quick) ease-in;
	}

	.search-button span:not(.search-glyph),
	.search-button kbd {
		display: none;
	}
}

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	margin: 0 0 0.75rem;
	padding: 0;
	list-style: none;
	font-size: 0.95rem;
}

.breadcrumbs li + li::before {
	content: '/';
	margin: 0 0.5rem;
	color: var(--border-strong);
}

.breadcrumbs a {
	color: var(--link);
}

.article-header h1 {
	margin: 0 0 0.75rem;
	font-size: clamp(2rem, 1.4rem + 2.2vw, 2.7rem);
	line-height: 1.2;
	letter-spacing: 0.43px;
}

.lead {
	max-width: var(--measure);
	margin: 0 0 1.25rem;
	color: var(--muted);
	font-size: 1.2rem;
	line-height: 1.55;
}

.status {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 2.5rem;
	padding: 0 0 1.5rem;
	border-bottom: 1px solid var(--border);
	list-style: none;
	font-size: 0.85rem;
	line-height: 1.4;
}

.status-item {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.25rem 0.65rem;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-small);
	color: var(--muted);
}

.status-value {
	color: var(--title);
	font-weight: var(--weight-strong);
}

/* The mark repeats the availability in shape: filled, half, hollow square, dashed ring */
.status-availability::before {
	content: '';
	width: 0.6rem;
	height: 0.6rem;
	border: 2px solid var(--muted);
	border-radius: 50%;
}

.status-availability[data-value='Supported']::before {
	background: var(--success);
	border-color: var(--success);
}

.status-availability[data-value='Experimental']::before {
	border-color: var(--accent);
	background: linear-gradient(90deg, var(--accent) 50%, transparent 50%);
}

.status-availability[data-value='Legacy']::before {
	border-radius: 1px;
}

.status-availability[data-value='Planned']::before {
	border-style: dashed;
}

.fallback-banner {
	margin: 0 0 2rem;
	padding: 0.85rem 1.1rem;
	border: 1px solid var(--accent);
	border-radius: var(--radius);
	background: var(--accent-wash);
}

.fallback-banner p {
	margin: 0;
	max-width: var(--measure);
}

.prose > * {
	max-width: var(--measure);
}

.prose > .code,
.prose > .table-scroll,
.prose > .anatomy,
.prose > .callout {
	max-width: 54rem;
}

.prose p,
.prose ul,
.prose ol {
	margin: 0 0 1.35rem;
}

.prose li {
	margin-bottom: 0.4rem;
}

.prose li > ul,
.prose li > ol {
	margin: 0.4rem 0 0;
}

.prose h2 {
	margin: 3.25rem 0 1rem;
	font-size: 1.75rem;
	line-height: 1.25;
}

.prose h3 {
	margin: 2.25rem 0 0.75rem;
	font-size: 1.3rem;
	line-height: 1.3;
}

.prose h4 {
	margin: 1.75rem 0 0.5rem;
	font-size: 1.05rem;
}

.prose > :first-child {
	margin-top: 0;
}

.heading-anchor {
	margin-left: 0.4rem;
	color: var(--border-strong);
	font-weight: var(--weight-body);
	opacity: 0;
}

h2:hover .heading-anchor,
h3:hover .heading-anchor,
h4:hover .heading-anchor {
	opacity: 1;
}

.prose a {
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
}

.prose a:hover {
	text-decoration-color: currentColor;
}

.prose :not(pre) > code {
	padding: 0.1em 0.35em;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 4px;
	font-size: 0.86em;
	overflow-wrap: anywhere;
}

.prose td:first-child > code {
	overflow-wrap: normal;
	white-space: nowrap;
}

.prose a > code {
	color: inherit;
}

.table-scroll {
	margin: 0 0 1.75rem;
	overflow-x: auto;
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
	line-height: 1.55;
}

th,
td {
	padding: 0.65rem 0.9rem;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--border);
}

th {
	background: var(--surface);
	color: var(--title);
	white-space: nowrap;
}

tr:last-child td {
	border-bottom: 0;
}

mark.verify {
	padding: 0.1em 0.4em;
	background: var(--warning);
	color: #000;
	font-family: var(--mono);
	font-size: 0.82em;
	font-weight: var(--weight-strong);
	border-radius: 3px;
}

.reviewed {
	margin: 3rem 0 0;
	color: var(--muted);
	font-size: 0.9rem;
}

/* Previous and next links, the browse page and their narrow-screen layout */
.sequence {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	max-width: 54rem;
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.sequence a {
	display: block;
	padding: 0.85rem 1.1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: border-color var(--quick) linear;
}

.sequence a:hover {
	border-color: var(--accent);
	text-decoration: none;
}

.sequence-next {
	text-align: right;
}

.sequence-label {
	display: block;
	color: var(--muted);
	font-size: 0.85rem;
}

.sequence-title {
	font-weight: var(--weight-strong);
}

.browse-list {
	padding: 0;
	list-style: none;
}

.browse-list li {
	padding: 1rem 0;
	border-bottom: 1px solid var(--border);
}

.browse-list p {
	margin: 0.15rem 0 0.6rem;
	color: var(--muted);
}

.browse-list .status {
	margin: 0;
	padding: 0;
	border: 0;
}

.browse-count {
	color: var(--muted);
}

@media (max-width: 600px) {
	.sequence {
		grid-template-columns: 1fr;
	}

	.sequence-next {
		text-align: left;
	}
}

.sidebar-group + .sidebar-group {
	margin-top: 1.75rem;
}

.sidebar-group h2 {
	margin: 0 0 0.4rem;
	color: var(--link);
	font-size: 0.95rem;
	font-weight: var(--weight-body);
	letter-spacing: 0.02em;
}

.sidebar ul,
.toc ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sidebar a {
	display: block;
	padding: 0.3rem 0.75rem;
	border-left: 2px solid transparent;
	color: var(--text);
	font-size: 0.95rem;
	line-height: 1.45;
}

.sidebar a:hover {
	color: var(--link);
	text-decoration: none;
}

.sidebar a[aria-current] {
	border-left-color: var(--accent);
	color: var(--title);
	font-weight: var(--weight-strong);
}

.toc h2 {
	margin: 0 0 0.75rem;
	color: var(--muted);
	font-size: 0.78rem;
	font-weight: var(--weight-strong);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.toc ol {
	border-left: 1px solid var(--border);
}

.toc a {
	display: block;
	margin-left: -1px;
	padding: 0.25rem 0 0.25rem 0.9rem;
	border-left: 2px solid transparent;
	color: var(--muted);
	font-size: 0.88rem;
	line-height: 1.4;
}

.toc-level-3 a {
	padding-left: 1.75rem;
}

.toc a:hover {
	color: var(--title);
	text-decoration: none;
}

.toc a[aria-current] {
	border-left-color: var(--accent);
	color: var(--link);
}

.sidebar-scrim {
	position: fixed;
	inset: 0;
	z-index: 55;
	background: rgba(0, 0, 0, 0.3);
}

.callout {
	margin: 0 0 1.75rem;
	padding: 1rem 1.25rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 3px solid var(--note);
	border-radius: var(--radius);
}

.callout > :last-child {
	margin-bottom: 0;
}

.callout-label {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.6rem;
	margin: 0 0 0.4rem !important;
	font-size: 0.95rem;
}

.callout-kind {
	color: var(--note);
	font-size: 0.78rem;
	font-weight: var(--weight-strong);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.callout-title {
	color: var(--title);
	font-weight: var(--weight-strong);
}

.callout-warning {
	border-left-color: var(--warning);
}

.callout-warning .callout-kind {
	color: var(--warning-text);
}

.callout-unsupported {
	border-left-color: var(--error);
}

.callout-unsupported .callout-kind {
	color: var(--error-text);
}

/* A proposal is drawn unfinished: dashed all around */
.callout-proposal {
	background: none;
	border: 1px dashed var(--proposal);
}

.callout-proposal .callout-kind {
	color: var(--proposal);
}

/*
 * URL anatomy: one request drawn as a single line, with a legend that names each part. The origin is the
 * only boxed part, because it is the only part a consumer changes between a development server and the CDN.
 */
.anatomy {
	margin: 0 0 1.75rem;
	padding: 1.25rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.prose .anatomy code {
	padding: 0;
	background: none;
	border: 0;
	border-radius: 0;
	font-size: 0.95rem;
}

.anatomy-url {
	margin: 0 0 1.1rem !important;
	padding-bottom: 1.1rem;
	border-bottom: 1px solid var(--border);
	line-height: 2.2;
	overflow-wrap: anywhere;
}

.anatomy-url span {
	display: inline-block;
	max-width: 100%;
	padding: 0 0 0.1rem;
	line-height: 1.6;
	border-bottom: 3px solid var(--border-strong);
	color: var(--title);
}

.anatomy-url span + span {
	margin-left: 2px;
}

.anatomy-url .anatomy-origin {
	margin-right: 0.35rem;
	padding: 0.1rem 0.5rem;
	border: 1px dashed var(--accent);
	border-radius: var(--radius-small);
	background: var(--accent-wash);
}

.anatomy-url .anatomy-package,
.anatomy-url .anatomy-subpath,
.anatomy-url .anatomy-asset {
	border-bottom-color: var(--title);
}

.anatomy-url .anatomy-version {
	border-bottom-color: var(--accent);
}

.anatomy-url .anatomy-query {
	border-bottom-color: var(--proposal);
}

.anatomy-legend {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 0.5rem 1.5rem;
	margin: 0;
	font-size: 0.88rem;
	line-height: 1.45;
}

.anatomy-legend div {
	display: flex;
	flex-direction: column;
}

.anatomy-legend dt code {
	color: var(--title);
	font-size: 0.85rem !important;
	overflow-wrap: anywhere;
}

.anatomy-legend dd {
	margin: 0;
	color: var(--muted);
}

.anatomy-legend .anatomy-origin dd {
	color: var(--link);
}

.code {
	margin: 0 0 1.75rem;
	background: var(--code-bg);
	border: 1px solid var(--code-border);
	border-radius: var(--radius);
	overflow: hidden;
}

.code figcaption {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.4rem 0.5rem 0.4rem 1rem;
	border-bottom: 1px solid var(--code-border);
	color: var(--code-muted);
	font-size: 0.78rem;
	line-height: 1.4;
}

.code-language {
	font-weight: var(--weight-strong);
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.code-file {
	font-family: var(--mono);
	color: var(--code-text);
}

.code-copy {
	margin-left: auto;
	padding: 0.2rem 0.65rem;
	background: none;
	border: 1px solid var(--code-border);
	border-radius: var(--radius-small);
	color: var(--code-text);
	font-size: 0.78rem;
	cursor: pointer;
}

.code-copy:hover {
	border-color: var(--code-accent);
}

.code-copy:focus-visible,
.code pre:focus-visible {
	outline-color: var(--code-accent);
}

.code-copy[data-copied] {
	border-color: var(--code-green);
	color: var(--code-green);
}

.code pre {
	margin: 0;
	padding: 1rem 1.1rem;
	overflow-x: auto;
	color: var(--code-text);
	font-size: 0.88rem;
	line-height: 1.65;
	tab-size: 2;
}

.hljs-comment,
.hljs-quote,
.hljs-meta {
	color: var(--code-muted);
	font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-name,
.hljs-tag {
	color: var(--code-accent);
}

.hljs-string,
.hljs-regexp,
.hljs-addition {
	color: var(--code-green);
}

.hljs-number,
.hljs-literal,
.hljs-symbol,
.hljs-attr,
.hljs-attribute {
	color: var(--code-yellow);
}

.hljs-title,
.hljs-section,
.hljs-variable,
.hljs-property,
.hljs-params .hljs-title {
	color: var(--code-blue);
}

.search-button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.3rem 0.6rem 0.3rem 0.7rem;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-small);
	color: var(--muted);
	font-size: 0.9rem;
}

.search-button:hover {
	border-color: var(--accent);
	text-decoration: none;
}

.search-glyph {
	position: relative;
	width: 0.7rem;
	height: 0.7rem;
	border: 2px solid currentColor;
	border-radius: 50%;
}

.search-glyph::after {
	content: '';
	position: absolute;
	right: -0.35rem;
	bottom: -0.25rem;
	width: 0.4rem;
	height: 2px;
	background: currentColor;
	transform: rotate(45deg);
}

.search-button kbd {
	padding: 0 0.35rem;
	border: 1px solid var(--border);
	border-radius: 3px;
	font-size: 0.75rem;
}

.search {
	width: min(44rem, calc(100vw - 2rem));
	max-height: min(80vh, 46rem);
	margin-top: 10vh;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius);
}

.search[open] {
	display: flex;
	flex-direction: column;
}

.search::backdrop {
	background: rgba(16, 22, 37, 0.55);
}

.search-form {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.75rem;
	padding: 1rem;
	border-bottom: 1px solid var(--border);
}

.search-form input[type='search'] {
	width: 100%;
	padding: 0.6rem 0.8rem;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-small);
}

.search-close {
	padding: 0 0.9rem;
	background: none;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-small);
	cursor: pointer;
}

.search-filters {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 1rem;
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 0.85rem;
}

.search-filter {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.search-filter select {
	padding: 0.15rem 0.4rem;
	background: var(--bg);
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-small);
}

.search-filter input {
	accent-color: var(--filled);
}

.search-status {
	margin: 0;
	padding: 0.75rem 1rem 0;
	color: var(--muted);
	font-size: 0.9rem;
}

.search-status:empty {
	display: none;
}

.search-results {
	flex: 1;
	margin: 0;
	padding: 0.5rem;
	overflow-y: auto;
	list-style: none;
}

.search-result a {
	display: block;
	padding: 0.7rem 0.75rem;
	border-radius: var(--radius-small);
	color: var(--text);
}

.search-result a:hover,
.search-result a:focus-visible {
	background: var(--surface);
	text-decoration: none;
}

.search-result-title {
	display: block;
	color: var(--title);
	font-weight: var(--weight-strong);
}

.search-result-meta {
	display: block;
	color: var(--muted);
	font-size: 0.8rem;
}

.search-result-snippet {
	display: block;
	font-size: 0.9rem;
	line-height: 1.5;
}

.search-result mark {
	background: var(--accent-wash);
	color: inherit;
	font-weight: var(--weight-strong);
}

.search-browse {
	margin: 0;
	padding: 0.75rem 1rem;
	border-top: 1px solid var(--border);
	font-size: 0.9rem;
}

/* What a reader can do after a search that found nothing: browse, or start from a symptom */
.search-empty {
	padding: 0 1rem 0.75rem;
	font-size: 0.9rem;
}

.search-empty[hidden] {
	display: none;
}

.search-empty p {
	margin: 0.5rem 0 0.25rem;
	color: var(--muted);
}

.search-empty ul {
	margin: 0;
	padding-left: 1.1rem;
}

/* The no-results block already offers the browse path */
.search-empty:not([hidden]) + .search-browse {
	display: none;
}
