:root {
	--bg: #0a0a0b;
	--panel: #121212;
	--text: #ebebeb;
	--body: #bcbcbc;
	--secondary: #a1a1a1;
	--muted: #818181;
	--hairline: rgba(235, 235, 235, 0.07);
	--separator: rgba(235, 235, 235, 0.14);
	--code-bg: #262626;
	--code-border: #323232;
	--link: #419cff;
	--working: #f76b15;
	--waiting: #ffb224;
	--success: #30a46c;
	--success-text: #3dd68c;
	--failed: #e5484d;
	--merged: #a371f7;
	--action: #7c85e3;
	--sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	--topbar: 56px;
	--sidebar: 248px;
	--toc: 220px;
}

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

html {
	background: var(--bg);
	color-scheme: dark;
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: calc(var(--topbar) + 16px);
}

body {
	margin: 0;
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.7;
	color: var(--body);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

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

a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

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

.skip {
	position: absolute;
	left: -9999px;
	top: 8px;
	z-index: 100;
	padding: 6px 12px;
	background: var(--panel);
	color: var(--text);
	border-radius: 6px;
}

.skip:focus {
	left: 8px;
}

/* Top bar */

.topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 20px;
	height: var(--topbar);
	padding: 0 20px;
	background: var(--bg);
	border-bottom: 1px solid var(--hairline);
}

.brand {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: 15px;
	color: var(--text);
}

.brand:hover {
	text-decoration: none;
}

.brand img {
	border-radius: 6px;
}

.top-links {
	display: flex;
	gap: 4px;
	margin-left: 8px;
}

.top-links a {
	padding: 6px 10px;
	border-radius: 6px;
	font-size: 14px;
	color: var(--secondary);
}

.top-links a:hover {
	color: var(--text);
	background: var(--hairline);
	text-decoration: none;
}

.top-links a[aria-current="page"] {
	color: var(--text);
}

.download {
	margin-left: auto;
	padding: 6px 14px;
	border-radius: 7px;
	font-size: 14px;
	font-weight: 500;
	color: #0a0a0b;
	background: var(--text);
}

.download:hover {
	background: #ffffff;
	text-decoration: none;
}

.menu-button {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	margin-left: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	color: var(--text);
	background: transparent;
	cursor: pointer;
}

.menu-button:hover {
	background: var(--hairline);
}

.menu-button svg {
	width: 20px;
	height: 20px;
}

/* Layout */

.layout {
	display: grid;
	grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc);
	max-width: 1360px;
	margin: 0 auto;
}

.sidebar {
	position: sticky;
	top: var(--topbar);
	height: calc(100vh - var(--topbar));
	overflow-y: auto;
	padding: 28px 16px 40px 20px;
	border-right: 1px solid var(--hairline);
}

.nav-group {
	margin: 24px 0 8px;
	padding: 0 12px;
	font-size: 12px;
	font-weight: 500;
	color: var(--muted);
}

.nav-group:first-child {
	margin-top: 0;
}

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

.sidebar li {
	margin: 2px 0;
}

.sidebar li a {
	display: block;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--secondary);
}

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

.sidebar li a[aria-current="page"] {
	color: var(--text);
	background: var(--separator);
}

main {
	overflow-wrap: anywhere;
	min-width: 0;
	padding: 44px 48px 80px;
}

article {
	max-width: 70ch;
	margin: 0 auto;
}

.toc {
	position: sticky;
	top: var(--topbar);
	height: calc(100vh - var(--topbar));
	overflow-y: auto;
	padding: 44px 20px 40px 8px;
	font-size: 13px;
}

.toc[hidden] {
	display: none;
}

.toc-title {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 500;
	color: var(--muted);
}

.toc ul {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* The rail: a faint track, a fill up to the section being read, and a lit marker on it, all moved by docs.js. */
.toc ul::before,
.toc-fill,
.toc-mark {
	position: absolute;
	top: 0;
	left: 0;
	width: 2px;
	border-radius: 2px;
	pointer-events: none;
}

.toc ul::before {
	content: "";
	bottom: 0;
	background: var(--hairline);
}

.toc-fill {
	height: var(--fill, 0);
	background: rgba(235, 235, 235, 0.16);
	transition: height 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.toc-mark {
	height: var(--h, 0);
	background: linear-gradient(var(--working), var(--merged));
	box-shadow: 0 0 10px rgba(247, 107, 21, 0.6);
	opacity: 0;
	transform: translateY(var(--y, 0));
	transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), height 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms;
}

.toc.spying .toc-mark {
	opacity: 1;
}

.toc li {
	margin: 0;
}

.toc li a {
	display: block;
	padding: 5px 0 5px 14px;
	line-height: 1.5;
	color: var(--muted);
	transition: color 200ms, transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.toc li a.read {
	color: var(--secondary);
}

.toc li a[aria-current="location"] {
	color: var(--text);
	transform: translateX(3px);
}

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

/* Article content */

.eyebrow {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--muted);
}

h1,
h2,
h3 {
	color: var(--text);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

h1 {
	margin: 0 0 16px;
	font-size: 34px;
	letter-spacing: -0.02em;
}

h2 {
	margin: 40px 0 12px;
	padding-top: 20px;
	font-size: 23px;
	border-top: 1px solid var(--hairline);
}

h3 {
	margin: 32px 0 8px;
	font-size: 18px;
}

.lede {
	margin: 0 0 8px;
	font-size: 18px;
	color: var(--body);
}

p,
ul,
ol,
table,
pre,
.callout {
	margin: 0 0 20px;
}

ul,
ol {
	padding-left: 24px;
}

li {
	margin: 0 0 8px;
}

li > ul,
li > ol {
	margin: 8px 0 0;
}

strong {
	color: var(--text);
	font-weight: 600;
}

code,
kbd {
	font-family: var(--mono);
	font-size: 0.875em;
}

:not(pre) > code {
	padding: 1px 5px;
	border: 1px solid var(--code-border);
	border-radius: 5px;
	background: var(--code-bg);
	color: var(--text);
	overflow-wrap: anywhere;
}

kbd {
	padding: 1px 6px;
	border: 1px solid var(--code-border);
	border-bottom-width: 2px;
	border-radius: 5px;
	background: var(--panel);
	color: var(--text);
	white-space: nowrap;
}

.code {
	position: relative;
	margin: 0 0 20px;
}

pre {
	overflow-wrap: normal;
	overflow-x: auto;
	padding: 16px;
	border: 1px solid var(--code-border);
	border-radius: 8px;
	background: var(--code-bg);
	color: var(--text);
	line-height: 1.6;
	tab-size: 4;
}

.code pre {
	margin: 0;
	padding-right: 72px;
}

pre code {
	font-size: 14px;
}

.copy {
	position: absolute;
	top: 8px;
	right: 8px;
	min-height: 32px;
	padding: 4px 8px;
	border: 1px solid var(--code-border);
	border-radius: 6px;
	background: var(--panel);
	color: var(--secondary);
	font-family: var(--sans);
	font-size: 12px;
	cursor: pointer;
}

.copy:hover {
	color: var(--text);
	border-color: var(--separator);
}

.table-wrap {
	overflow-x: auto;
	margin: 0 0 20px;
	border: 1px solid var(--separator);
	border-radius: 8px;
}

table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	font-size: 14.5px;
	line-height: 1.55;
}

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

td code {
	white-space: nowrap;
	overflow-wrap: normal;
}

th {
	color: var(--text);
	font-weight: 500;
	background: var(--panel);
	white-space: nowrap;
}

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

.callout {
	--tone: 124, 133, 227;
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr);
	column-gap: 14px;
	padding: 16px 18px;
	border-radius: 12px;
	background: linear-gradient(135deg, rgba(var(--tone), 0.09), rgba(var(--tone), 0.025) 60%);
	box-shadow: inset 0 0 0 1px rgba(var(--tone), 0.2);
}

.callout.warning {
	--tone: 255, 178, 36;
}

/* The icon sits in its own column; the text, however many paragraphs, in the next. */
.callout::before {
	content: "";
	grid-row: 1 / span 9;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: rgba(var(--tone), 0.14) no-repeat center / 16px var(--icon);
	--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c85e3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E");
}

.callout.warning::before {
	--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffb224' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E");
}

.callout > * {
	grid-column: 2;
}

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

.callout-title {
	display: block;
	margin: 3px 0 4px;
	color: rgb(var(--tone));
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.status {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--text);
	font-weight: 500;
	white-space: nowrap;
}

.status::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--muted);
}

.status.working::before {
	background: var(--working);
}

.status.needs-you::before {
	background: var(--waiting);
}

.status.done::before {
	background: var(--success);
}

.status.failed::before {
	background: var(--failed);
}

.badge-soon {
	display: inline-block;
	padding: 1px 8px;
	border: 1px solid var(--separator);
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	color: var(--secondary);
	vertical-align: middle;
}

/* Prev and next */

.pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	max-width: 70ch;
	margin: 56px auto 0;
}

.pager a {
	display: block;
	padding: 12px 16px;
	border: 1px solid var(--separator);
	border-radius: 8px;
	color: var(--text);
	font-weight: 500;
}

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

.pager span {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: var(--muted);
}

.pager .next {
	grid-column: 2;
	text-align: right;
}

/* Narrow screens */

@media (max-width: 1180px) {
	.layout {
		grid-template-columns: var(--sidebar) minmax(0, 1fr);
	}

	.toc {
		display: none;
	}
}

@media (max-width: 860px) {
	.layout {
		display: block;
	}

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

	.sidebar {
		display: none;
		position: fixed;
		inset: var(--topbar) 0 0 0;
		z-index: 15;
		width: 100%;
		height: auto;
		padding: 20px 20px 48px;
		border-right: 0;
		background: var(--bg);
	}

	body.nav-open .sidebar {
		display: block;
	}

	body.nav-open {
		overflow: hidden;
	}

	main {
		padding: 28px 20px 64px;
	}

	h1 {
		font-size: 28px;
	}

	h2 {
		font-size: 21px;
	}
}

@media (max-width: 520px) {
	.topbar {
		gap: 8px;
		padding: 0 12px;
	}

	.top-links {
		margin-left: 0;
		gap: 0;
	}

	.top-links a {
		padding: 8px;
	}

	.brand span {
		display: none;
	}

	.download {
		padding: 8px 12px;
	}

	.pager {
		grid-template-columns: 1fr;
	}

	.pager .next {
		grid-column: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}
