/* The portal's look: the site's colours and fonts (site/site.css), dark first, light by the system. No script, no
   toggle. Geist from this folder (SIL OFL 1.1, OFL.txt). Forms and lists stack at phone width. */

@font-face {
	font-family: 'Geist';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url(/static/geist-latin.woff2) format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Geist';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url(/static/geist-latin-ext.woff2) format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Geist Mono';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url(/static/geist-mono-latin.woff2) format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	color-scheme: dark;
	--bg: #05070d;
	--panel: #0a0f1b;
	--panel-2: #0f1626;
	--border: #1a2335;
	--border-2: #28334b;
	--text: #eaf0f8;
	--muted: #8f9bb0;
	--faint: #505b71;
	--accent: #38bdf8;
	--accent-ink: #03101a;
	--grad: linear-gradient(100deg, #7dd3fc 0%, #38bdf8 30%, #818cf8 68%, #c084fc 100%);
	--good: #22c55e;
	--good-bg: rgba(34, 197, 94, 0.12);
	--warn: #f59e0b;
	--bad: #ef4444;
	--bad-bg: rgba(239, 68, 68, 0.12);
	/* the environment badges (the console's banner has the same): fill, and the ink on it, 5:1 or better */
	--env-prod: #16a34a;
	--env-demo: #3b82f6;
	--env-test: #ea580c;
	--env-ink: #05070d;
	--ring: rgba(56, 189, 248, 0.45);
	--code-bg: #070b15;
	/* the Docs' code: comments, strings, keywords, numbers, types, macros */
	--hl-c: #6b7a93;
	--hl-s: #86efac;
	--hl-k: #c4b5fd;
	--hl-n: #fcd34d;
	--hl-t: #7dd3fc;
	--hl-m: #f0abfc;
	--radius: 14px;
	--font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
	--font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
	:root {
		color-scheme: light;
		--bg: #f6f8fc;
		--panel: #ffffff;
		--panel-2: #f2f5fa;
		--border: #e1e7f0;
		--border-2: #cdd6e2;
		--text: #0a1324;
		--muted: #536077;
		--faint: #98a3b5;
		--accent: #0284c7;
		--accent-ink: #ffffff;
		--grad: linear-gradient(100deg, #0369a1 0%, #0284c7 30%, #4f46e5 68%, #7c3aed 100%);
		--good: #15803d;
		--good-bg: rgba(21, 128, 61, 0.1);
		--warn: #b45309;
		--bad: #b91c1c;
		--bad-bg: rgba(185, 28, 28, 0.08);
		--env-prod: #15803d;
		--env-demo: #2563eb;
		--env-test: #c2410c;
		--env-ink: #ffffff;
		--ring: rgba(2, 132, 199, 0.35);
		--code-bg: #f8fafc;
		--hl-c: #6b7280;
		--hl-s: #047857;
		--hl-k: #6d28d9;
		--hl-n: #b45309;
		--hl-t: #0369a1;
		--hl-m: #a21caf;
	}
}

* { box-sizing: border-box; }
/* what a page's script shows when it's time: nothing a class sets wins over it */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--text);
	font: 15px/1.55 var(--font-sans);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 0.4rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 0.8rem; }
p { margin: 0 0 0.8rem; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.small { font-size: 0.87rem; }

/* the top bar */
.top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	padding: 0.8rem max(16px, calc((100vw - 1040px) / 2));
	border-bottom: 1px solid var(--border);
	background: var(--panel);
}
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand .tag { color: var(--muted); font-weight: 500; }
.top nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: 0.93rem; }
.top nav .who { color: var(--muted); }
.top nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.top nav form { margin: 0; }

main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: 1.6rem 16px 3rem; }
footer { padding: 1.2rem 16px; text-align: center; color: var(--faint); font-size: 0.85rem; border-top: 1px solid var(--border); }
footer a { color: var(--muted); }

/* blocks */
.card {
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.3rem;
	margin-bottom: 1.2rem;
}
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.lead { margin-bottom: 1.4rem; }
.lead h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* forms */
.form { display: grid; gap: 0.85rem; }
.form.inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
/* min-width 0: a date field's own minimum would push it past a narrow column at phone width */
label { display: grid; gap: 0.3rem; font-size: 0.88rem; color: var(--muted); min-width: 0; }
input, select, textarea {
	width: 100%;
	min-width: 0;
	font: inherit;
	font-size: 16px; /* a phone doesn't zoom in on it */
	color: var(--text);
	background: var(--panel-2);
	border: 1px solid var(--border-2);
	border-radius: 9px;
	padding: 0.55rem 0.7rem;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	font: inherit;
	font-weight: 600;
	color: var(--accent-ink);
	background: var(--accent);
	border: 1px solid transparent;
	border-radius: 9px;
	padding: 0.55rem 1rem;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.ghost { color: var(--text); background: transparent; border-color: var(--border-2); }
.btn.danger { color: var(--bad); background: transparent; border-color: var(--bad); }
.btn.small { padding: 0.3rem 0.65rem; font-size: 0.85rem; }
button.link { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
button.link:hover { text-decoration: underline; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

.error, .notice {
	border-radius: 9px;
	padding: 0.6rem 0.8rem;
	margin: 0 0 1rem;
}
.error { color: var(--bad); background: var(--bad-bg); border: 1px solid var(--bad); }
.notice { color: var(--good); background: var(--good-bg); border: 1px solid var(--good); }

/* consoles */
.console { display: grid; gap: 0.5rem; }
.console .head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.console .envs { display: flex; align-items: center; flex-wrap: wrap; gap: 0.2rem 0.5rem; min-width: 0; }
.console .env-name { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); word-break: break-all; }
.envbadge { display: inline-block; padding: 0.12rem 0.55rem; border-radius: 999px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; color: var(--env-ink); background: var(--faint); }
.envbadge.prod { background: var(--env-prod); }
.envbadge.demo { background: var(--env-demo); }
.envbadge.test { background: var(--env-test); }
.console .host { font-family: var(--font-mono); font-size: 0.88rem; color: var(--muted); word-break: break-all; }
.state { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; font-weight: 600; }
.state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.state.up { color: var(--good); }
.state.up::before { background: var(--good); }
.state.down { color: var(--bad); }
.state.down::before { background: var(--bad); }
.state.unknown { color: var(--muted); }

/* lists of files, requests, accounts */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 0.75rem 0; border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.pill {
	display: inline-block;
	font-size: 0.78rem;
	font-weight: 600;
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	border: 1px solid var(--border-2);
	color: var(--muted);
}
.pill.new, .pill.active { color: var(--good); border-color: var(--good); }
.pill.disabled, .pill.declined { color: var(--bad); border-color: var(--bad); }
.pill.invited { color: var(--warn); border-color: var(--warn); }
details { margin-top: 0.6rem; }
summary { cursor: pointer; color: var(--accent); font-size: 0.9rem; }
details[open] summary { margin-bottom: 0.7rem; }
.quote { white-space: pre-wrap; color: var(--muted); border-left: 2px solid var(--border-2); padding-left: 0.7rem; margin: 0.4rem 0; }

/* the invite's QR code: white around it, whatever the theme, or phones can't read it */
.qr { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin: 0.4rem 0 1rem; }
.qr img { width: 180px; height: 180px; background: #fff; border-radius: 10px; padding: 6px; }
.secret { font-family: var(--font-mono); font-size: 1rem; letter-spacing: 0.04em; word-break: break-all; }

.audit { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.audit th, .audit td { text-align: left; padding: 0.45rem 0.5rem; border-top: 1px solid var(--border); vertical-align: top; }
.audit th { color: var(--muted); font-weight: 600; border-top: 0; }
.audit td.mono { white-space: nowrap; }

@media (max-width: 640px) {
	h1 { font-size: 1.35rem; }
	.card { padding: 1rem; }
	.audit thead { display: none; }
	.audit tr { display: grid; padding: 0.5rem 0; border-top: 1px solid var(--border); }
	.audit td { border: 0; padding: 0.1rem 0; }
	.audit td.mono { white-space: normal; }
}
.mt { margin-top: 0.8rem; }
.mt-s { margin-top: 0.5rem; }

/* the login's other ways in */
.links { list-style: none; margin: 1rem 0 0.6rem; padding: 0; display: grid; gap: 0.35rem; font-size: 0.93rem; }

/* recovery codes, shown once: two columns where they fit, one on a phone */
.codes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
	gap: 0.4rem 1rem;
	margin: 0.4rem 0 1rem;
	padding: 0.8rem 1rem 0.8rem 2.9rem;
	background: var(--panel-2);
	border: 1px solid var(--border-2);
	border-radius: 9px;
	font-family: var(--font-mono);
	font-size: 1rem;
	letter-spacing: 0.03em;
}
.codes li { padding-left: 0.2rem; white-space: nowrap; }
.codes li::marker { color: var(--faint); font-size: 0.85rem; }
.warning { color: var(--warn); border: 1px solid var(--warn); border-radius: 9px; padding: 0.6rem 0.8rem; }

/* Share once: the text a link held, as it came, in a card wide enough for its lines; the new link, whole, to copy */
.share-card { max-width: 640px; }
.link-out { resize: none; overflow-wrap: anywhere; }
.share-label { font-weight: 600; margin-bottom: 0.7rem; overflow-wrap: anywhere; }
.shared {
	font-family: var(--font-mono);
	font-size: 0.92rem;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	margin: 0 0 0.7rem;
	padding: 0.75rem 0.85rem;
	background: var(--panel-2);
	border: 1px solid var(--border-2);
	border-radius: 9px;
}
.pill.waiting { color: var(--warn); border-color: var(--warn); }
.pill.opened { color: var(--good); border-color: var(--good); }

/* The operator's page: tabs as links (no script), a block per demo or client, the disabled folded. A demo's actions are
   summaries that look like buttons; the one opened takes the row's width for its confirmation. */
.tabs { display: flex; flex-wrap: wrap; gap: 0.2rem; margin: 0 0 1.2rem; border-bottom: 1px solid var(--border); }
.tabs a { padding: 0.5rem 0.9rem; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { margin-left: 0.3rem; padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.75rem; color: var(--good); border: 1px solid var(--good); }
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.block-head h2 { margin: 0; font-family: var(--font-mono); font-size: 1.05rem; overflow-wrap: anywhere; }
.block-meta { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; color: var(--muted); font-size: 0.87rem; margin-bottom: 0.5rem; }
.block-meta b { color: var(--text); font-weight: 600; }
.consoles-line { list-style: none; margin: 0 0 0.8rem; padding: 0; display: grid; gap: 0.3rem; }
.consoles-line li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; min-width: 0; }
.consoles-line code { color: var(--muted); overflow-wrap: anywhere; }
.envbadge.mini { padding: 0.05rem 0.45rem; font-size: 0.72rem; letter-spacing: 0.03em; }
.pill.on { color: var(--good); border-color: var(--good); }
.pill.locked { color: var(--warn); border-color: var(--warn); }
.pill.ended { color: var(--bad); border-color: var(--bad); }
.person { min-width: 0; overflow-wrap: anywhere; }
.demo-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem; margin: 0 0 1rem; }
.demo-actions details { margin: 0; }
.demo-actions details[open] { flex-basis: 100%; }
.demo-actions details[open] summary { margin-bottom: 0.6rem; }
summary.btn { list-style: none; display: inline-flex; }
summary.btn::-webkit-details-marker { display: none; }
.confirm { padding: 0.8rem; border: 1px solid var(--border-2); border-radius: 9px; background: var(--panel-2); }
.confirm p:last-child { margin-bottom: 0; }
details.folded { margin-top: 0.8rem; }
details.folded > summary { color: var(--muted); }
details.folded > .list { padding-top: 0.2rem; }
.ended-demos { margin-bottom: 1.2rem; }
.ended-demos > summary { margin-bottom: 0.8rem; }

/* The Docs (src/docs.rs, templates/docs_*.html): the bar on the left with every page and the current one's sections,
   sticky beside the page; on a phone it folds under a Contents button (a checkbox, no script) above the page. The pages'
   own HTML comes from the bundles' tools (tools/docpages.py): headings with anchors, tables, code, pictures, notes. */
main.docs { max-width: 1200px; padding-top: 0; }
.docs-page .top { padding-left: max(16px, calc((100vw - 1200px) / 2)); padding-right: max(16px, calc((100vw - 1200px) / 2)); }
html { scroll-padding-top: 1rem; }
.docs-layout {
	display: grid;
	grid-template-columns: 264px minmax(0, 1fr);
	grid-template-areas: "side bar" "side doc";
	column-gap: 3rem;
}
.docs-toggle { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.docs-bar { grid-area: bar; display: flex; align-items: center; gap: 0.8rem; padding: 1.5rem 0 0; min-width: 0; }
.docs-menu { display: none; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.45rem; font-size: 0.85rem; color: var(--muted); min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--faint); }
.crumbs [aria-current] { color: var(--text); overflow-wrap: anywhere; }

.docs-side {
	grid-area: side;
	position: sticky;
	top: 0;
	align-self: start;
	max-height: 100vh;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 1.5rem 1rem 2rem 0;
	border-right: 1px solid var(--border);
	font-size: 0.9rem;
	scrollbar-width: thin;
}
.side-title { display: block; margin: 0 0 1.1rem 0.7rem; color: var(--text); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; }
.side-title:hover { text-decoration: none; color: var(--accent); }
.side-group { margin-bottom: 1.3rem; }
.side-label, .eyebrow {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0 0 0.45rem;
	font: 500 11.5px/1.3 var(--font-mono);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent);
}
.side-label { padding-left: 0.7rem; }
.side-label::before, .eyebrow::before { content: ''; width: 14px; height: 1px; background: currentColor; opacity: 0.7; }
.docs-side ul { list-style: none; margin: 0; padding: 0; }
.docs-side li a { display: block; padding: 0.3rem 0.7rem; border-radius: 8px; color: var(--muted); line-height: 1.4; }
.docs-side li a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.docs-side li a[aria-current="page"] { color: var(--text); font-weight: 600; background: color-mix(in srgb, var(--accent) 13%, transparent); }
.docs-side a.code { font-family: var(--font-mono); font-size: 0.83rem; }
.side-head { padding: 0.8rem 0.7rem 0.2rem; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.docs-side .side-head a { padding: 0.15rem 0; margin: 0 -0.7rem; padding-left: 0.7rem; color: var(--muted); font-family: var(--font-mono); text-transform: none; letter-spacing: 0; font-size: 0.8rem; }
.docs-side ul.toc { margin: 0.25rem 0 0.5rem 1rem; padding-left: 0.5rem; border-left: 1px solid var(--border-2); }
.docs-side .toc a { padding: 0.2rem 0.6rem; font-size: 0.83rem; }
.docs-side .toc li.sub a { padding-left: 1.3rem; font-size: 0.8rem; }
.side-back { display: inline-flex; gap: 0.4rem; margin: 0.4rem 0 0 0.7rem; color: var(--muted); font-size: 0.87rem; }
.side-back:hover { color: var(--text); text-decoration: none; }

.doc { grid-area: doc; min-width: 0; max-width: 780px; padding-bottom: 1rem; }
.docs-layout.wide .doc { max-width: none; }
.doc-head { margin: 1.1rem 0 1.8rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--border); }
.doc-head h1 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); line-height: 1.12; letter-spacing: -0.03em; margin: 0.7rem 0 0.4rem; text-wrap: balance; }
.doc-head h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.doc-head .lead { font-size: 1.06rem; color: var(--muted); margin: 0.5rem 0 0; max-width: 62ch; }
.doc-head .muted.small { margin: 0.5rem 0 0; }

/* a page's text */
.prose { font-size: 1rem; line-height: 1.7; }
.prose p { margin: 0 0 1rem; text-wrap: pretty; }
.prose p.lead { font-size: 1.08rem; color: var(--text); }
.prose h2 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.02em; margin: 2.8rem 0 0.9rem; text-wrap: balance; }
.prose h3 { font-size: 1.13rem; line-height: 1.3; letter-spacing: -0.01em; margin: 2.1rem 0 0.6rem; }
.prose h4 { font-size: 1rem; margin: 1.6rem 0 0.5rem; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose .hash { margin-left: 0.45rem; color: var(--faint); font-weight: 400; opacity: 0; text-decoration: none; }
.prose :is(h2, h3, h4):hover .hash, .prose .hash:focus-visible { opacity: 1; }
@media (hover: none) { .prose .hash { opacity: 0.55; } }
.prose ul, .prose ol { margin: 0 0 1.1rem; padding-left: 1.35rem; }
.prose li { margin: 0.35rem 0; padding-left: 0.15rem; }
.prose li::marker { color: var(--faint); }
.prose ol > li::marker { color: var(--muted); font-weight: 600; font-size: 0.92em; }
.prose li > ul, .prose li > ol { margin: 0.35rem 0 0.2rem; }
.prose li > p { margin: 0 0 0.5rem; }
.prose strong { font-weight: 600; color: var(--text); }
.prose a[href] { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.prose a[href]:hover { text-decoration-color: currentColor; }
.prose a.hash, .prose figure a, .pydoc dt a[href] { text-decoration: none; }
.prose :not(pre) > code { padding: 0.08em 0.35em; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2); font-size: 0.86em; overflow-wrap: anywhere; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

.prose blockquote.note {
	margin: 0 0 1.5rem;
	padding: 0.85rem 1.1rem;
	border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
	border-left: 3px solid var(--accent);
	border-radius: 10px;
	background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.prose blockquote.note > :last-child { margin-bottom: 0; }

/* tables scroll sideways in their frame on a phone; the page never does */
.prose .table { margin: 0 0 1.4rem; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.55; }
.prose th, .prose td { padding: 0.6rem 0.85rem; text-align: left; vertical-align: top; border-top: 1px solid var(--border); min-width: 6.5rem; }
.prose th { border-top: 0; background: var(--panel-2); color: var(--muted); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; }
.prose tbody tr:first-child td { border-top: 0; }
.prose thead + tbody tr:first-child td { border-top: 1px solid var(--border); }
.prose td.right, .prose th.right { text-align: right; }
.prose td.center, .prose th.center { text-align: center; }

/* code */
pre.code {
	position: relative;
	margin: 0 0 1.3rem;
	padding: 1rem 1.15rem;
	overflow-x: auto;
	background: var(--code-bg);
	border: 1px solid var(--border);
	border-radius: 12px;
	font: 0.84rem/1.65 var(--font-mono);
	tab-size: 4;
}
pre.code[data-lang] { padding-top: 2.1rem; }
pre.code[data-lang]::before { content: attr(data-lang); position: absolute; top: 0.65rem; left: 1.15rem; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
pre.code code { font-size: inherit; }
pre.code .c { color: var(--hl-c); font-style: italic; }
pre.code .s { color: var(--hl-s); }
pre.code .k { color: var(--hl-k); }
pre.code .n { color: var(--hl-n); }
pre.code .t { color: var(--hl-t); }
pre.code .m { color: var(--hl-m); }
/* a whole file: numbered lines, the numbers not copied with the code */
pre.code.numbered { counter-reset: line; padding-left: 0; font-size: 0.82rem; }
pre.code.numbered .line { display: block; padding-left: 4.2rem; position: relative; }
pre.code.numbered .line::before {
	counter-increment: line;
	content: counter(line);
	position: absolute;
	left: 0;
	width: 3.1rem;
	text-align: right;
	color: var(--faint);
	user-select: none;
}
pre.code.numbered .line:target { background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* pictures: a click opens one alone; a phone's picture at a phone's width */
.prose figure { margin: 1.7rem 0 1.9rem; }
.prose figure > a { display: block; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.55); }
.prose figure img { display: block; width: 100%; height: auto; }
.prose figure.phone > a { max-width: 330px; margin: 0 auto; }
.prose figure.diagram > a { padding: 0.6rem; box-shadow: none; }
.prose figcaption { margin: 0.65rem auto 0; font-size: 0.84rem; line-height: 1.5; color: var(--muted); }
.prose figure.phone figcaption { max-width: 330px; text-align: center; }

/* previous and next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--border); }
.pager a { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.9rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); min-width: 0; }
.pager a:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); text-decoration: none; }
.pager .next { grid-column: 2; text-align: right; }
.pager .dir { font-size: 0.8rem; color: var(--muted); }
.pager .to { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }

/* the Docs' index and an SDK version's page */
.doc-card { margin: 0 0 1.2rem; padding: 1.3rem 1.4rem 0.6rem; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); scroll-margin-top: 1rem; }
.doc-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; }
.doc-card h2 { margin: 0 0 0.2rem; font-size: 1.15rem; letter-spacing: -0.01em; }
.doc-card > p.muted { margin: 0 0 0.6rem; }
.doc-card .pill:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.doc-links, .doc-files { list-style: none; margin: 0; padding: 0; }
.doc-links li { display: grid; grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr); gap: 0.15rem 1.4rem; padding: 0.7rem 0; border-top: 1px solid var(--border); }
.doc-links li > a { font-weight: 600; }
.doc-links li > a.code { font-family: var(--font-mono); font-weight: 500; font-size: 0.88rem; }
.doc-links li > span { color: var(--muted); font-size: 0.9rem; }
.doc-links li.doc-links-head { display: block; padding: 1.1rem 0 0.35rem; border-top: 0; font: 500 11px/1.3 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.doc-files li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.3rem 1rem; padding: 0.65rem 0; border-top: 1px solid var(--border); }
.doc-files li:first-child, .doc-links li:first-child { border-top: 0; }
.doc-files a { overflow-wrap: anywhere; }

/* the Rust reference: rustdoc's own page, framed, the height of the window */
.framed { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.framed iframe { display: block; width: 100%; height: calc(100vh - 12rem); min-height: 480px; border: 0; }
.framed-note { margin-top: 0.6rem; }

/* pydoc's page of the Python package, in the portal's colours: its sections and classes one under the other, as cards,
   its spacer cells (pydoc's coloured margins) left out */
.pydoc { font-size: 0.92rem; line-height: 1.6; }
.pydoc > p:empty, .pydoc p:empty { display: none; }
.pydoc table, .pydoc tbody, .pydoc tr, .pydoc td { display: block; }
.pydoc td.decor:not([colspan]), .pydoc td:not([class]) { display: none; }
.pydoc table.section { margin: 0 0 1.4rem; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; scroll-margin-top: 1rem; }
.pydoc .section-title { padding: 0.75rem 1rem; background: var(--panel-2); border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.92rem; overflow-wrap: anywhere; }
.pydoc .section-title strong { color: var(--text); }
.pydoc .bigsection { font-family: var(--font-sans); font-size: 1.15rem; letter-spacing: -0.01em; }
.pydoc td.decor[colspan] { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); color: var(--muted); }
.pydoc .singlecolumn { padding: 0.7rem 1rem 0.9rem; }
.pydoc tr:has(> td.multicolumn) { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.pydoc .multicolumn { font-family: var(--font-mono); font-size: 0.86rem; }
.pydoc table.section table.section { margin: 1rem 0 1.2rem; border-left: 3px solid color-mix(in srgb, var(--accent) 55%, var(--border)); }
.pydoc table.section table.section .section-title { font-size: 0.98rem; }
.pydoc dl { margin: 0.2rem 0; }
.pydoc dt { margin-top: 0.9rem; font-family: var(--font-mono); font-size: 0.86rem; overflow-wrap: anywhere; }
.pydoc dt strong { color: var(--text); }
.pydoc dd { margin: 0.25rem 0 0.4rem 1.1rem; color: var(--muted); }
.pydoc dd > dl > dt { margin-top: 0.3rem; }
.pydoc .code { overflow-wrap: anywhere; }
.pydoc hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.pydoc a { overflow-wrap: anywhere; }

@media (max-width: 900px) {
	main.docs { padding-top: 0; }
	.docs-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bar" "side" "doc"; }
	.docs-bar { flex-wrap: wrap; padding-top: 1rem; }
	.docs-menu {
		display: inline-flex;
		align-items: center;
		gap: 0.55rem;
		padding: 0.45rem 0.85rem;
		border: 1px solid var(--border-2);
		border-radius: 9px;
		background: var(--panel);
		color: var(--text);
		font-size: 0.9rem;
		font-weight: 600;
		cursor: pointer;
		user-select: none;
	}
	.burger { position: relative; width: 14px; height: 10px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }
	.burger::after { content: ''; position: absolute; left: 0; right: 0; top: 2px; border-top: 2px solid currentColor; }
	.docs-toggle:checked + .docs-bar .docs-menu { border-color: var(--accent); color: var(--accent); }
	.docs-toggle:focus-visible + .docs-bar .docs-menu { outline: 2px solid var(--ring); outline-offset: 1px; }
	.docs-side { display: none; position: static; max-height: none; margin-top: 0.8rem; padding: 1rem 0.8rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
	.docs-toggle:checked ~ .docs-side { display: block; }
	.doc-head { margin-top: 0.9rem; }
	.doc-head h1 { font-size: 1.75rem; }
	.prose h2 { font-size: 1.3rem; margin-top: 2.3rem; }
	.framed iframe { height: calc(100vh - 10rem); min-height: 420px; }
}
@media (max-width: 640px) {
	.doc-links li { grid-template-columns: minmax(0, 1fr); }
	.doc-card { padding: 1rem 1rem 0.4rem; }
	.pager { grid-template-columns: minmax(0, 1fr); }
	.pager .next { grid-column: 1; }
	.prose figure.phone > a, .prose figure.phone figcaption { max-width: 280px; }
	pre.code { border-radius: 10px; font-size: 0.8rem; }
	pre.code.numbered .line { padding-left: 3.2rem; }
	pre.code.numbered .line::before { width: 2.3rem; }
}
