@font-face {
	font-family: "Latin Modern Roman";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("/fonts/lmroman10-regular.woff2") format("woff2");
}
@font-face {
	font-family: "Latin Modern Roman";
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url("/fonts/lmroman10-italic.woff2") format("woff2");
}
@font-face {
	font-family: "Latin Modern Roman";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("/fonts/lmroman10-bold.woff2") format("woff2");
}

:root {
	--bg: #f6f4ee;
	--fg: #0b1020;
	--muted: #5d5d66;
	--rule: #dcd9d0;
	--accent: #2f6bff;
	--gold: #e8b04b;
	--serif: "Latin Modern Roman", "CMU Serif", "Computer Modern", "STIX Two Text", Georgia, "Times New Roman", serif;
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0b1020;
		--fg: #f6f4ee;
		--muted: #a2a4b3;
		--rule: #24293d;
		--accent: #7ea1ff;
	}
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
	background: var(--bg);
	color: var(--fg);
	font-family: var(--serif);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Animated conformal map, behind everything. */
.plane {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	pointer-events: none;
}

.page {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	max-width: 72rem;
	margin: 0 auto;
	padding: 1.25rem 1rem;
}

/* Header and nav */
.top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	color: inherit;
	text-decoration: none;
	font-size: 1.35rem;
	letter-spacing: 0.01em;
}

/* The mark beside the two words, "Academy" under "Functorial" and flush left with it. */
.brand svg { width: 2.1rem; height: 2.1rem; flex: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }

.nav {
	display: flex;
	align-items: center;
	gap: 1.4rem;
	font-size: 1.15rem;
}

.nav a {
	color: inherit;
	text-decoration: none;
	padding: 0.2rem 0.1rem;
	border-bottom: 1px solid transparent;
}

.nav a:hover, .nav a:focus-visible, .nav a[aria-current="page"] {
	border-bottom-color: var(--accent);
}


/* Hero */
.hero {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 3rem 0 6rem;
}

.hero h1 {
	margin: 0 0 1rem;
	font-weight: 400;
	font-size: clamp(2.4rem, 7vw, 4.75rem);
	line-height: 1.05;
	letter-spacing: -0.005em;
	text-wrap: balance;
}

.hero .tagline {
	margin: 0 0 2.25rem;
	max-width: 60ch;
	font-size: clamp(1.2rem, 2.6vw, 1.65rem);
	font-style: italic;
	color: var(--muted);
	text-wrap: balance;
}

.cta {
	display: inline-block;
	padding: 0.75rem 1.6rem;
	border: 1.5px solid var(--fg);
	border-radius: 999px;
	color: var(--fg);
	background: color-mix(in srgb, var(--bg) 80%, transparent);
	backdrop-filter: blur(4px);
	text-decoration: none;
	font-size: 1.2rem;
	transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.cta:hover, .cta:focus-visible {
	background: var(--fg);
	color: var(--bg);
	border-color: var(--fg);
}

/* ---------- Functorial Academy ---------- */

:root {
	--mono: "JetBrains Mono", "JetBrainsMono Nerd Font", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
	--card: color-mix(in srgb, var(--bg) 88%, transparent);
	--code-bg: #ece9df;
	--good: #1f7a4d;
	--good-soft: #dff0e4;
	--bad: #b3261e;
	--bad-soft: #f8e1dd;
	--warn: #8a5a00;
	--warn-soft: #f6ecd2;
	--syn-keyword: #7a3e9d;
	--syn-tactic: #0f6b63;
	--syn-type: #9a5b00;
	--syn-comment: #85837a;
	--syn-string: #2b6a2f;
	--syn-number: #b04a12;
	--syn-op: #2f6bff;
	--syn-command: #a3195b;
	/* The primary call to action in a course (Start, Continue). Label on it:
	   5.4:1. As text on the page (--go-ink): 4.9:1. */
	--go: #18794a;
	--go-hover: #11603a;
	--go-fg: #ffffff;
	--go-ink: #18794a;
}

@media (prefers-color-scheme: dark) {
	:root {
		--code-bg: #131a30;
		--good: #5fd39a;
		--good-soft: #12301f;
		--bad: #ff8a80;
		--bad-soft: #3a1717;
		--warn: #f0c36a;
		--warn-soft: #33290f;
		--syn-keyword: #c9a4ff;
		--syn-tactic: #6fe0d2;
		--syn-type: #f2c078;
		--syn-comment: #7d8299;
		--syn-string: #96e39a;
		--syn-number: #ffb07a;
		--syn-op: #7ea1ff;
		--syn-command: #ff9ccb;
		/* Dark label on a light green: 8.1:1; as text: 10.2:1. */
		--go: #3fbf7f;
		--go-hover: #5fd39a;
		--go-fg: #0b1020;
		--go-ink: #5fd39a;
	}
}

body { font-size: 1.125rem; }
body:not(.home) .plane { display: none; }

a { color: var(--accent); }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 400; text-wrap: balance; }
code, pre, textarea { font-family: var(--mono); font-variant-ligatures: none; }
code { font-size: 0.82em; background: var(--code-bg); padding: 0.08em 0.32em; border-radius: 5px; overflow-wrap: anywhere; }
pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }

.brand span b { display: block; font-weight: 400; color: var(--muted); }
.nav .stat { color: var(--muted); font-size: 1rem; white-space: nowrap; }
.nav .stat b { color: var(--fg); font-weight: 400; }

main { flex: 1; width: 100%; padding: 2.5rem 0 4rem; }
main.narrow { max-width: 46rem; margin: 0 auto; }
main.wide { max-width: 62rem; margin: 0 auto; }

/* Home */
/* The courses start on the first screen: the hero takes what its words need, no more. */
.hero { padding: 0.5rem 0 2.5rem; flex: none; }
body.home main { padding-top: 1.5rem; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.cta.primary { background: var(--fg); color: var(--bg); }
.cta.primary:hover, .cta.primary:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; }
.cta.small { padding: 0.45rem 1.1rem; font-size: 1.05rem; border-width: 1.25px; }
.cta[disabled] { opacity: 0.45; pointer-events: none; }
button.cta { cursor: pointer; }

.section { margin: 0 auto 3.5rem; max-width: 62rem; }
.section > h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: 0 0 0.4rem; }
.section > .lede { margin: 0 0 1.5rem; font-size: 1.2rem; color: var(--muted); max-width: 44rem; }

.card {
	border: 1.5px solid color-mix(in srgb, var(--muted) 45%, transparent);
	border-radius: 18px;
	padding: 1.25rem 1.5rem;
	background: var(--card);
	backdrop-filter: blur(6px);
}

.courses { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1.25rem; }
.course { display: flex; flex-direction: column; color: inherit; text-decoration: none; transition: border-color 150ms ease, transform 150ms ease; }
.course:hover, .course:focus-visible { border-color: var(--accent); transform: translateY(-2px); }
.course .level { font-size: 0.95rem; color: var(--accent); margin: 0 0 0.35rem; }
.course h3 { margin: 0 0 0.35rem; font-size: 1.5rem; line-height: 1.15; }
.course .tagline { margin: 0 0 0.75rem; font-style: italic; color: var(--muted); }
.course .audience { margin: 0 0 1rem; font-size: 1rem; flex: 1; }
.course .meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.95rem; color: var(--muted); }

.bar { height: 5px; border-radius: 999px; background: var(--rule); overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 300ms ease; }

.how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem; }
.how li { display: flex; gap: 0.75rem; }
.how .n { color: var(--accent); padding-top: 0.15rem; }
.how h3 { margin: 0 0 0.25rem; font-size: 1.2rem; font-weight: 700; }
.how p { margin: 0; color: var(--muted); font-size: 1.05rem; }

/* The handoff diagram */
.diagram { display: block; width: 100%; max-width: 46rem; height: auto; margin: 0 auto; overflow: visible; }
.diagram .word { font-family: var(--serif); font-size: 21px; fill: var(--fg); }
.diagram .label { font-family: var(--serif); font-style: italic; font-size: 15px; fill: var(--muted); }
.diagram .arrow { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.diagram .gold { stroke: var(--gold); }
.diagram .node { fill: var(--bg); stroke: color-mix(in srgb, var(--muted) 55%, transparent); stroke-width: 1.5; }
.diagram .node.you { stroke: var(--fg); stroke-width: 2; }

/* Course page */
.crumbs { margin: 0 0 1rem; font-size: 1rem; color: var(--muted); }
.crumbs a { color: inherit; }
.title { margin: 0 0 0.4rem; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; }
.subtitle { margin: 0 0 1.5rem; font-size: 1.25rem; color: var(--muted); font-style: italic; }
.unit { margin-top: 1.25rem; }
.unit-head { display: flex; gap: 0.9rem; align-items: baseline; }
.unit-head .n { color: var(--accent); min-width: 1.4rem; }
.unit-head h2 { margin: 0; font-size: 1.45rem; }
.unit .blurb { margin: 0.2rem 0 0.9rem 2.3rem; color: var(--muted); font-size: 1.05rem; }
.lessons { list-style: none; margin: 0 0 0 2.3rem; padding: 0; display: grid; gap: 0.5rem; }
.lesson-link { display: flex; align-items: center; gap: 0.9rem; padding: 0.6rem 0.9rem; border: 1px solid var(--rule); border-radius: 12px; color: inherit; text-decoration: none; background: var(--card); }
.lesson-link:hover, .lesson-link:focus-visible { border-color: var(--accent); }
.lesson-link .name { flex: 1; }
.lesson-link .count { color: var(--muted); font-size: 0.95rem; white-space: nowrap; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--muted) 60%, transparent); }
.dots i.done { background: var(--accent); border-color: var(--accent); }
.dots i.due { background: var(--gold); border-color: var(--gold); }

/* Exercise */
.lesson-top { display: flex; align-items: center; gap: 1rem; margin: 0 0 1.5rem; font-size: 1rem; color: var(--muted); }
.lesson-top a { color: inherit; text-decoration: none; }
.lesson-top a:hover { color: var(--accent); }
.steps { display: flex; gap: 6px; flex: 1; }
.steps a { flex: 1; height: 6px; border-radius: 999px; background: var(--rule); }
.steps a.done { background: color-mix(in srgb, var(--accent) 55%, var(--rule)); }
.steps a.here { background: var(--accent); }
.kind { font-size: 0.95rem; color: var(--accent); margin: 0 0 0.3rem; letter-spacing: 0.02em; }
.ex h1 { margin: 0 0 1rem; font-size: clamp(1.7rem, 4.2vw, 2.3rem); line-height: 1.15; }
.md p { margin: 0 0 0.9rem; }
.md strong { font-weight: 700; }
.prompt { margin: 1.25rem 0 0.75rem; font-size: 1.2rem; }
.prompt p { margin: 0; }

.code { margin: 0 0 1rem; padding: 0.85rem 1rem; background: var(--code-bg); border-radius: 12px; overflow-x: auto; font-size: 0.9rem; line-height: 1.5; tab-size: 2; }
.code .hole { background: color-mix(in srgb, var(--accent) 22%, transparent); border-bottom: 2px solid var(--accent); border-radius: 3px; padding: 0 0.2em; }
.tok-keyword { color: var(--syn-keyword); }
.tok-tactic { color: var(--syn-tactic); }
.tok-type { color: var(--syn-type); }
.tok-comment { color: var(--syn-comment); font-style: italic; }
.tok-string { color: var(--syn-string); }
.tok-number { color: var(--syn-number); }
.tok-op { color: var(--syn-op); }
.tok-command { color: var(--syn-command); }
.tok-attribute { color: var(--syn-comment); }
.tok-sorry { color: var(--bad); font-weight: 700; }

.editor { position: relative; border-radius: 12px; background: var(--code-bg); border: 2px solid transparent; overflow: hidden; }
.editor:focus-within { border-color: var(--accent); }
.editor.good { border-color: var(--good); }
.editor.bad { border-color: var(--bad); }
.editor pre, .editor textarea { margin: 0; padding: 0.8rem 0.95rem; font-size: 16px; line-height: 1.5; tab-size: 2; white-space: pre; border: 0; }
.editor pre { position: absolute; inset: 0; overflow: hidden; pointer-events: none; color: var(--fg); }
.editor textarea { position: relative; display: block; width: 100%; resize: none; background: transparent; color: transparent; caret-color: var(--fg); outline: none; overflow-x: auto; overflow-y: hidden; }
.editor textarea::placeholder { color: var(--muted); }
.symbols { display: flex; gap: 6px; margin: 0.5rem 0 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.symbols button { flex: none; min-width: 2.1rem; height: 2.1rem; border-radius: 8px; border: 1px solid var(--rule); background: var(--card); font-family: var(--mono); font-size: 0.95rem; cursor: pointer; }
.symbols button:hover { border-color: var(--accent); }

.goal { margin: 0.75rem 0 0; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.goal .head { padding: 0.3rem 0.9rem; font-size: 0.9rem; color: var(--muted); border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; }
.goal pre { margin: 0; padding: 0.7rem 0.9rem; font-size: 0.85rem; line-height: 1.5; overflow-x: auto; white-space: pre-wrap; }
.goal .done { color: var(--good); }
.goal .err { color: var(--bad); border-top: 1px dashed var(--rule); }

.options { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.options button { width: 100%; text-align: left; padding: 0.7rem 1rem; border: 1.5px solid var(--rule); border-radius: 12px; background: var(--card); cursor: pointer; font-family: var(--mono); font-size: 0.92rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.options button.prose { font-family: var(--serif); font-size: 1.1rem; }
.options button:hover { border-color: var(--accent); }
.options button.picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.options button.right { border-color: var(--good); background: var(--good-soft); }
.options button.wrong { border-color: var(--bad); background: var(--bad-soft); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin: 1.1rem 0 0; }
.actions .spacer { flex: 1; }
.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 1rem; }
.link:hover { color: var(--accent); }

.verdict { margin: 1.1rem 0 0; padding: 0.9rem 1.1rem; border-radius: 14px; border: 1.5px solid var(--rule); }
.verdict.ok { border-color: var(--good); background: var(--good-soft); }
.verdict.bad { border-color: var(--bad); background: var(--bad-soft); }
.verdict.unknown { border-color: var(--gold); background: var(--warn-soft); }
.verdict h3 { margin: 0 0 0.4rem; font-size: 1.2rem; font-weight: 700; }
.verdict.ok h3 { color: var(--good); }
.verdict.bad h3 { color: var(--bad); }
.verdict.unknown h3 { color: var(--warn); }
.verdict .md p:last-child { margin-bottom: 0; }
.msg { margin: 0.5rem 0 0; }
.msg .where { font-size: 0.95rem; color: var(--muted); }
.msg pre { margin: 0.15rem 0 0; font-size: 0.82rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }

.obligations { margin: 0.8rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.55rem; }
.ob { display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.2rem 0.5rem; padding: 0.6rem 0.8rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); }
.ob .mark { font-family: var(--mono); font-weight: 700; }
.ob.yes .mark { color: var(--good); }
.ob.no .mark { color: var(--bad); }
.ob.open .mark { color: var(--warn); }
.ob .what { font-size: 1.05rem; }
.ob .what code { font-size: 0.8em; }
.ob .says { grid-column: 2; color: var(--muted); font-size: 0.98rem; }
.ob.no .says { color: var(--bad); }
.ob pre { grid-column: 2; margin: 0.25rem 0 0; padding: 0.5rem 0.7rem; background: var(--code-bg); border-radius: 8px; font-size: 0.8rem; line-height: 1.45; overflow-x: auto; }
.ob details { grid-column: 2; font-size: 0.98rem; }
.ob summary { cursor: pointer; color: var(--accent); }
.handoff { margin: 0.9rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; }
.handoff .note { color: var(--muted); font-size: 0.98rem; flex: 1; min-width: 14rem; }
.spinner { display: inline-block; width: 0.9em; height: 0.9em; border: 2px solid var(--rule); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -0.1em; margin-right: 0.4em; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.status { margin: 0 0 1.25rem; padding: 0.55rem 0.9rem; border-radius: 10px; font-size: 1rem; background: var(--warn-soft); color: var(--warn); }
.status.failed { background: var(--bad-soft); color: var(--bad); }

.done-card { text-align: center; padding: 2.5rem 1.5rem; }
.done-card h1 { margin: 0 0 0.5rem; font-size: clamp(2rem, 5vw, 2.8rem); }
.done-card p { margin: 0 0 1.5rem; color: var(--muted); font-size: 1.2rem; }

.prose-page h2 { margin: 2rem 0 0.5rem; font-size: 1.5rem; }
.prose-page p, .prose-page li { font-size: 1.15rem; }
.prose-page table { border-collapse: collapse; width: 100%; margin: 0.5rem 0 1rem; font-size: 1.05rem; }
.prose-page th, .prose-page td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose-page th { font-weight: 700; }

.playground textarea { min-height: 16rem; }
.empty { color: var(--muted); font-style: italic; }

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

footer { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 1rem; font-size: 0.95rem; color: var(--muted); }
footer p { margin: 0.5rem 0; }
footer a { color: inherit; }
footer .links { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }

@media (max-width: 640px) {
	.top { flex-wrap: wrap; row-gap: 0.35rem; }
	.nav { flex-wrap: wrap; }
	.hero { padding: 0.25rem 0 1.75rem; }
	.brand { font-size: 1.1rem; }
	.nav { gap: 0.85rem; font-size: 1rem; }
	.nav .stat { display: none; }
	.unit .blurb, .lessons { margin-left: 0; }
	.card { padding: 1rem 1.05rem; }
	.lesson-link .dots { display: none; }
}

/* The Riemann course's card: first on the home page, the whole row. */
.courses > .riemann-card { grid-column: 1 / -1; }

/* ---------- Course versions ---------- */
.version { color: var(--muted); font-size: 0.85em; font-family: var(--mono); font-variant-ligatures: none; opacity: 0.85; }

/* ---------- Stuck? ---------- */
.actions a.stuck { color: var(--warn); font-weight: 600; text-decoration: none; }
.actions a.stuck:hover, .actions a.stuck:focus-visible { text-decoration: underline; }
.actions a.stuck[hidden] { display: none; }
.help-line { margin: 1rem 0 0; padding: 0.55rem 0.9rem; border-left: 3px solid var(--gold); background: var(--warn-soft); border-radius: 0 10px 10px 0; font-size: 1.02rem; }
.help h2 { font-size: 1.4rem; margin: 2rem 0 0.6rem; }
.help-call { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.2rem; font-size: 1.2rem; margin: 0 0 1rem; }
.help-call .cta { font-family: var(--mono); font-variant-ligatures: none; letter-spacing: 0.02em; }
.help-try { padding-left: 1.4rem; margin: 0 0 1.5rem; display: grid; gap: 0.5rem; }
.help-try b { font-weight: 700; }
.help-form { display: grid; gap: 0.4rem; margin-top: 2rem; }
.help-form h2 { margin: 0 0 0.3rem; }
.help-form label { font-size: 1rem; color: var(--muted); margin-top: 0.5rem; }
.help-from { margin: 0; color: var(--muted); }
.help-note { margin: 0; color: var(--muted); font-size: 1rem; }

/* Form controls in the Academy's own forms */
.help-form textarea, .help-form input, .ann-pop textarea, .ann-pop select, .admin input, .admin select, .admin textarea {
	font: inherit;
	font-size: 1rem;
	color: var(--fg);
	background: var(--bg);
	border: 1.5px solid var(--rule);
	border-radius: 10px;
	padding: 0.5rem 0.7rem;
	width: 100%;
}
.help-form textarea, .ann-pop textarea, .admin textarea { resize: vertical; font-family: var(--serif); }
.help-form textarea:focus, .help-form input:focus, .ann-pop textarea:focus, .ann-pop select:focus, .admin input:focus, .admin select:focus, .admin textarea:focus { outline: none; border-color: var(--accent); }

/* ---------- Advisor feedback ---------- */
body.annotating [data-ann-field] { user-select: text; -webkit-user-select: text; }
mark.ann {
	background: color-mix(in srgb, var(--gold) 34%, transparent);
	color: inherit;
	border-bottom: 2px solid var(--gold);
	border-radius: 2px;
	cursor: pointer;
	padding: 0;
}
mark.ann mark.ann { background: color-mix(in srgb, var(--gold) 60%, transparent); }
mark.ann.resolved { background: none; border-bottom: 2px dotted color-mix(in srgb, var(--good) 70%, transparent); }
mark.ann:hover, mark.ann:focus-visible { background: color-mix(in srgb, var(--gold) 55%, transparent); }
.ann-btn {
	position: absolute;
	z-index: 50;
	padding: 0.4rem 0.85rem;
	border-radius: 999px;
	border: 1.5px solid var(--fg);
	background: var(--fg);
	color: var(--bg);
	font-size: 0.95rem;
	cursor: pointer;
	box-shadow: 0 4px 14px rgb(0 0 0 / 0.18);
	white-space: nowrap;
}
.ann-btn:hover, .ann-btn:focus-visible { background: var(--accent); border-color: var(--accent); color: #fff; }
.ann-pop {
	position: absolute;
	z-index: 60;
	width: min(24rem, calc(100vw - 1rem));
	max-height: min(70vh, 34rem);
	overflow: auto;
	padding: 0.9rem 1rem;
	border-radius: 14px;
	border: 1.5px solid color-mix(in srgb, var(--muted) 50%, transparent);
	background: var(--bg);
	box-shadow: 0 10px 30px rgb(0 0 0 / 0.22);
	font-size: 1rem;
}
.ann-pop form { display: grid; gap: 0.5rem; }
.ann-pop label { display: grid; gap: 0.2rem; font-size: 0.92rem; color: var(--muted); }
.ann-title { margin: 0 0 0.3rem; font-weight: 700; }
.ann-quote { margin: 0; padding: 0.3rem 0.7rem; border-left: 3px solid var(--gold); color: var(--muted); font-style: italic; white-space: pre-wrap; overflow-wrap: anywhere; }
.ann-where, .fb-by { margin: 0; font-size: 0.85rem; color: var(--muted); font-family: var(--mono); font-variant-ligatures: none; }
.fb-by { font-family: var(--serif); }
.ann-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 0.4rem; }
.ann-err { margin: 0; color: var(--bad); font-size: 0.92rem; }
.ann-err:empty { display: none; }
.ann-item { padding: 0.6rem 0; border-top: 1px solid var(--rule); }
.ann-item:first-of-type { border-top: 0; }
.ann-meta { margin: 0 0 0.3rem; display: flex; flex-wrap: wrap; gap: 0.3rem 0.6rem; align-items: baseline; font-size: 0.9rem; color: var(--muted); }
.ann-cat, .ann-status { padding: 0.05rem 0.5rem; border-radius: 999px; background: color-mix(in srgb, var(--gold) 30%, transparent); color: var(--fg); font-size: 0.85rem; }
.ann-status { background: var(--good-soft); color: var(--good); }
.ann-comment { margin: 0.3rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ann-resolution { margin: 0.3rem 0; font-size: 0.95rem; color: var(--good); }

/* ---------- Capstone ---------- */
.preview-tag { display: inline-block; margin: 0 0 0.8rem; padding: 0.15rem 0.7rem; border-radius: 999px; border: 1.5px dashed var(--warn); color: var(--warn); font-size: 0.95rem; }
.capstone-locked { margin-top: 1rem; }
.capstone-locked h2 { font-size: 1.25rem; margin: 1.2rem 0 0.6rem; }
.lock-count { margin: 0 0 0.6rem; font-size: 1.3rem; }
.lock-count b { font-size: 2rem; font-weight: 400; color: var(--accent); }
.capstone-locked .bar { margin-bottom: 1rem; }
.capstone-done { color: var(--good); }
.capstone-hint { color: var(--muted); font-size: 1rem; }
.capstone-log { max-height: 26rem; overflow: auto; margin: 0.5rem 0 0; padding: 0.7rem 0.9rem; background: var(--code-bg); border-radius: 10px; font-size: 0.8rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.verdict details summary { cursor: pointer; color: var(--accent); margin-top: 0.6rem; }
.axioms h4 { margin: 0.6rem 0 0.2rem; font-size: 1rem; font-weight: 700; }
.axioms ul { margin: 0; padding-left: 1.2rem; }
.axioms li.extra { color: var(--bad); }
.capstone-ok h3 { font-size: 1.5rem; }

/* ---------- Admin ---------- */
main.admin { max-width: 72rem; margin: 0 auto; }
.admin-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; }
.admin-nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1rem; font-size: 1rem; }
.admin-nav .updated { color: var(--muted); font-size: 0.9rem; }
.admin-section { margin: 2rem 0 0; }
.admin-section > h2 { font-size: 1.35rem; margin: 0 0 0.7rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.tile { border: 1px solid var(--rule); border-radius: 12px; padding: 0.7rem 0.9rem; background: var(--card); }
.tile-label { margin: 0; font-size: 0.85rem; color: var(--muted); letter-spacing: 0.03em; text-transform: uppercase; }
.tile-value { margin: 0.1rem 0; font-size: 1.7rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile-value a { color: inherit; }
.tile-sub { margin: 0; font-size: 0.9rem; color: var(--muted); }
.admin-courses { display: grid; gap: 1rem; }
.admin-course-head { display: flex; align-items: baseline; gap: 0.8rem; }
.admin-course h3 { margin: 0; font-size: 1.3rem; }
.admin-course h3 a { color: inherit; }
.funnel { list-style: none; margin: 0.8rem 0 0; padding: 0; display: grid; gap: 3px; font-size: 0.92rem; }
.funnel li { display: grid; grid-template-columns: 1.6rem minmax(8rem, 16rem) 1fr 5.5rem; gap: 0.6rem; align-items: center; }
.funnel-n { color: var(--accent); text-align: right; font-variant-numeric: tabular-nums; }
.funnel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel-bar { position: relative; height: 0.8rem; background: var(--rule); border-radius: 4px; overflow: hidden; }
.funnel-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
i.started { background: color-mix(in srgb, var(--accent) 35%, var(--rule)); }
i.finished { background: var(--accent); }
.funnel-num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 0.35rem; }
.legend i { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; margin-left: 0.6rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); }
.admin-table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.admin-table th, .admin-table td { text-align: left; padding: 0.4rem 0.7rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table th { font-weight: 700; font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-table .id { display: block; font-family: var(--mono); font-variant-ligatures: none; font-size: 0.78rem; color: var(--muted); }
.table-wrap.learners { max-height: 34rem; overflow: auto; }
.table-wrap.learners th { position: sticky; top: 0; background: var(--bg); }
.meter { display: inline-block; width: 3.5rem; height: 0.45rem; border-radius: 999px; background: var(--rule); overflow: hidden; vertical-align: middle; }
.meter i { display: block; height: 100%; background: var(--accent); }
.admin input[type="search"] { max-width: 22rem; margin-bottom: 0.6rem; }
.help-reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.help-req { border: 1px solid var(--rule); border-left: 3px solid var(--gold); border-radius: 10px; padding: 0.6rem 0.9rem; background: var(--card); }
.help-req.done { border-left-color: var(--rule); opacity: 0.8; }
.help-req p { margin: 0 0 0.35rem; }
.help-req-meta { font-size: 0.92rem; color: var(--muted); }
.help-req-meta b { color: var(--fg); }
.help-req-msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin details summary { cursor: pointer; color: var(--accent); margin: 0.6rem 0; }
.admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 0 1.5rem; }
.grant { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.8rem; }
.grant label { font-size: 0.92rem; color: var(--muted); }
.grant input { flex: 1 1 12rem; width: auto; }
.grant select { width: auto; }
.fb-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin: 0 0 1rem; }
.fb-filters label { font-size: 0.92rem; color: var(--muted); }
.fb-filters select { width: auto; margin-right: 0.8rem; }
.fb-group h2 { font-size: 1.25rem; margin: 1.6rem 0 0.6rem; }
.fb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.fb { border: 1px solid var(--rule); border-left: 3px solid var(--gold); border-radius: 10px; padding: 0.7rem 0.9rem; background: var(--card); }
.fb.resolved { border-left-color: var(--good); }
.fb.wontfix { border-left-color: var(--rule); }
.fb-resolve details { margin-top: 0.3rem; }
.fb-resolve textarea { margin-top: 0.2rem; }

@media (max-width: 640px) {
	.funnel li { grid-template-columns: 1.4rem 1fr 4.5rem; }
	.funnel-bar { grid-column: 2 / 4; grid-row: 2; }
	.admin-cols { grid-template-columns: 1fr; }
	.help-call { font-size: 1.05rem; }
}
.help-call > a:first-child { color: inherit; text-decoration: none; }
footer .version { font-family: inherit; font-size: inherit; opacity: 1; }
.help-form > .cta { justify-self: start; }
.admin-table td.nowrap { white-space: nowrap; }

/* The checker is busy: calm, not an error. */
.verdict.wait { border-color: color-mix(in srgb, var(--accent) 45%, var(--rule)); background: color-mix(in srgb, var(--accent) 7%, var(--bg)); }
.verdict.wait h3 { color: var(--fg); font-weight: 400; }
.verdict.wait b { font-variant-numeric: tabular-nums; font-weight: 400; }

/* ---------- Admin: cost ---------- */
/* Two series colors, validated for both surfaces (dataviz validate_palette.js:
   lightness band, chroma, CVD and normal-vision separation, 3:1 contrast). */
:root { --viz-variable: #2f6bff; --viz-fixed: #b7791f; --viz-soft: color-mix(in srgb, #2f6bff 32%, #f6f4ee); }
@media (prefers-color-scheme: dark) { :root { --viz-variable: #5f86f2; --viz-fixed: #b5822a; --viz-soft: color-mix(in srgb, #5f86f2 48%, #0b1020); } }
.cost-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.8rem; }
.cost-head h2 { font-size: 1.35rem; margin: 0 auto 0.7rem 0; }
.cost-head label { font-size: 0.92rem; color: var(--muted); }
.cost-head select { width: auto; }
.cost-source { margin: 0 0 0.8rem; padding: 0.5rem 0.8rem; border-radius: 10px; font-size: 0.98rem; background: var(--good-soft); }
.cost-source.rates { background: var(--warn-soft); }
.cost-source b { font-weight: 700; }
.cost-defs { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.8rem; margin: 0 0 0.6rem; font-size: 0.98rem; }
.cost-defs dt { font-weight: 700; }
.cost-defs dd { margin: 0; color: var(--muted); }
.cost-split, .cost-chart { margin: 1rem 0 0; }
.cost-split figcaption, .cost-chart figcaption { font-size: 0.85rem; color: var(--muted); letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 0.4rem; }
.cost-chart .axis-max { text-transform: none; letter-spacing: 0; }
.split { display: flex; gap: 2px; height: 0.9rem; }
.split i { display: block; min-width: 2px; border-radius: 4px; }
i.fixed { background: var(--viz-fixed); }
i.variable { background: var(--viz-variable); }
.cost-split .legend i { width: 0.8rem; height: 0.8rem; }
.cost-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0 2rem; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 0.92rem; }
.hbars li { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr 5.5rem; gap: 0.6rem; align-items: center; }
.hb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-bar { height: 0.8rem; }
.hb-bar i { display: block; height: 100%; min-width: 2px; background: var(--viz-variable); border-radius: 0 4px 4px 0; }
.hb-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.cols-wrap { position: relative; }
.cols { display: flex; align-items: flex-end; gap: 2px; height: 7rem; border-bottom: 1px solid var(--rule); }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.col i { display: block; width: 100%; background: var(--viz-variable); border-radius: 4px 4px 0 0; min-height: 1px; }
.col:hover i { background: color-mix(in srgb, var(--viz-variable) 75%, var(--fg)); }
.cost-tip { position: absolute; top: -0.4rem; transform: translate(-50%, -100%); margin: 0; padding: 0.15rem 0.5rem; border-radius: 6px; background: var(--fg); color: var(--bg); font-size: 0.85rem; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.cols-axis { display: flex; justify-content: space-between; margin: 0.2rem 0 0; font-size: 0.82rem; color: var(--muted); }
.cost-table summary { font-size: 0.9rem; }
.cost-proj { margin: 1.2rem 0 0; padding: 0.7rem 0.9rem; border: 1px dashed var(--rule); border-radius: 12px; }
.cost-proj p { margin: 0 0 0.3rem; }
.admin input.proj-n { width: 7rem; display: inline-block; padding: 0.2rem 0.5rem; }
.costs h3 { font-size: 1.15rem; margin: 0 0 0.5rem; }
.admin-table th.num { text-align: right; }
.admin-table button.sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; font-weight: 700; }
.admin-table button.sort:hover { color: var(--accent); }
.admin input.rate { width: 9rem; text-align: right; padding: 0.2rem 0.5rem; font-variant-numeric: tabular-nums; }
.rate-status { display: block; font-size: 0.82rem; color: var(--muted); }
.rate-status:empty { display: none; }
.admin-cols > *, .cost-charts > * { min-width: 0; }

/* ---------- Feedback management ---------- */
.fb-filters { gap: 0.5rem 1rem; }
.fb-filter { display: inline-flex; align-items: center; gap: 0.4rem; }
.fb-filter select { margin-right: 0; }
.fb-search { flex: 1 1 16rem; }
.fb-search input { flex: 1; }
.fb-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.4rem 1rem; margin: 0.4rem 0; }
.fb-export { font-size: 0.95rem; color: var(--muted); display: inline-flex; gap: 0.7rem; align-items: baseline; }
.fb-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0.4rem 0 0.8rem; font-size: 0.95rem; }
.fb-bulk:empty { display: none; }
.fb-bulk-actions { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.fb-bulk-actions b { font-weight: 700; }
.admin .fb-bulk-actions input { width: 16rem; padding: 0.25rem 0.5rem; }
.fb-bulk-status { color: var(--muted); }
.fb-head { display: flex; gap: 0.7rem; align-items: flex-start; }
.fb-head > input { margin-top: 0.3rem; width: auto; }
.fb-main { flex: 1; min-width: 0; }
.fb-open { font-size: 0.92rem; }
.fb-ver { white-space: nowrap; }
.fb-detail { margin: 0.6rem 0 0; padding: 0.6rem 0 0; border-top: 1px dashed var(--rule); }
.fb-detail h3 { font-size: 1rem; font-weight: 700; margin: 0 0 0.3rem; }
.fb-context { margin: 0 0 0.5rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.fb-context mark.ann { color: var(--fg); cursor: default; }
.fb-detail details { margin: 0 0 0.5rem; }
.fb-note { display: grid; gap: 0.2rem; margin: 0.5rem 0 0; font-size: 0.92rem; color: var(--muted); }
.fb-edit { display: grid; gap: 0.4rem; width: 100%; }
.fb-edit label { font-size: 0.92rem; color: var(--muted); }
.fb-edit select { width: auto; }
.fb-new-wrap { margin: 0 0 1.2rem; border: 1px solid var(--rule); border-radius: 12px; padding: 0.6rem 0.9rem; background: var(--card); }
.fb-new-wrap > summary { cursor: pointer; color: var(--accent); }
.fb-new { display: grid; gap: 0.4rem; margin-top: 0.5rem; }
.fb-new > label { font-size: 0.92rem; color: var(--muted); }
.fb-pickers { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 0.7rem; align-items: center; font-size: 0.95rem; }
.fb-pickers label { color: var(--muted); }
.fb-new-done { color: var(--good); font-size: 0.95rem; }

/* Dashboard: feedback first */
.fb-card { margin: 1rem 0 0; }
.fb-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.fb-card-head h2 { margin: 0; font-size: 1.35rem; }
.fb-card-head h2 a { color: inherit; }
.fb-card-total { color: var(--muted); }
.fb-card-total b { font-size: 1.7rem; font-weight: 400; color: var(--fg); }
.fb-card-list { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.5rem; }
.fb-card-list a { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.45rem 0.7rem; border: 1px solid var(--rule); border-radius: 10px; color: inherit; text-decoration: none; }
.fb-card-list a:hover, .fb-card-list a:focus-visible { border-color: var(--accent); }
.fb-card-list b { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.fb-card-list b.zero { color: var(--muted); font-weight: 400; }

/* Versions */
.ver-note { margin: 0 0 0.8rem; padding: 0.6rem 0.9rem; border-left: 3px solid var(--accent); background: var(--card); border-radius: 0 10px 10px 0; font-size: 0.98rem; }
.ver-note p { margin: 0 0 0.4rem; }
.ver-note p:last-child { margin: 0; }
.ver-note b { font-weight: 700; }
.ver-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0.8rem; }
.ver-grid > * { min-width: 0; }
.ver-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.7rem; }
.ver-head h3 { margin: 0; font-size: 1.15rem; }
.ver-now { font-family: var(--mono); font-variant-ligatures: none; color: var(--accent); }
.ver-changes { margin: 0.4rem 0; }
.ver-history { margin: 0.3rem 0 0; padding-left: 1.2rem; font-size: 0.95rem; }
.ver-history p { margin: 0.1rem 0 0.4rem; color: var(--muted); }
.admin input[type="checkbox"] { width: auto; padding: 0; margin: 0; accent-color: var(--accent); }

/* ---------- Go: the primary call to action in a course ---------- */
.cta.primary.go { background: var(--go); border-color: var(--go); color: var(--go-fg); }
.cta.primary.go:hover, .cta.primary.go:focus-visible { background: var(--go-hover); border-color: var(--go-hover); color: var(--go-fg); }
.courses .riemann-card .rz-go { color: var(--go-ink); }

/* ---------- The name Lean, in the monospace face (ui.ts leanName) ---------- */
/* A monospace word in a serif line looks large and dark; a little smaller and
   lighter it sits on the same baseline with the same color. */
.lean-name { font-family: var(--mono); font-variant-ligatures: none; font-weight: 300; font-size: 0.86em; letter-spacing: -0.02em; }
:is(h1, .hero, .title, .subtitle, .rz-subtitle) .lean-name { font-size: 0.82em; letter-spacing: -0.03em; }
:is(b, strong, th) .lean-name { font-weight: 600; }
code .lean-name, pre .lean-name { font: inherit; letter-spacing: inherit; }

/* ---------- Admin tables: padding, alignment, a separated header ---------- */
.table-wrap { border-radius: 12px; }
.admin-table { font-size: 0.95rem; line-height: 1.35; }
.admin-table th, .admin-table td { padding: 0.55rem 0.8rem; vertical-align: top; border-bottom: 1px solid var(--rule); }
.admin-table thead th { background: color-mix(in srgb, var(--fg) 5%, var(--bg)); border-bottom: 2px solid color-mix(in srgb, var(--muted) 45%, var(--rule)); font-size: 0.84rem; letter-spacing: 0.02em; color: var(--muted); font-weight: 700; white-space: nowrap; vertical-align: bottom; }
.admin-table th.num, .admin-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table a { text-underline-offset: 3px; }
.ex-title { display: block; }
.ex-id { display: block; margin-top: 0.2rem; font-family: var(--mono); font-variant-ligatures: none; font-size: 0.76rem; color: var(--muted); letter-spacing: 0; }
.ex-where { display: block; font-size: 0.82rem; color: var(--muted); }
.admin-table td.rate { display: table-cell; }
.admin-table td.rate .meter { margin-right: 0.5rem; }
.admin-table td.rate span:last-child { display: inline-block; min-width: 2.8em; }
.mf-title { font-size: 1rem; margin: 0.8rem 0 0.4rem; }

/* ---------- Admin tiles ---------- */
.tiles.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; }
.tile { padding: 0.65rem 0.85rem; display: flex; flex-direction: column; }
.tile-label { text-transform: none; letter-spacing: 0; font-size: 0.88rem; }
.tile-value { font-size: 1.55rem; }
.tile-sub b { font-weight: 700; color: var(--fg); }
a.tile-link { color: inherit; text-decoration: none; transition: border-color 150ms ease; }
a.tile-link:hover, a.tile-link:focus-visible { border-color: var(--accent); }
a.tile-link .tile-label::after { content: " →"; color: var(--accent); }
a.tile-link.alert { border-color: color-mix(in srgb, var(--warn) 55%, var(--rule)); background: color-mix(in srgb, var(--warn-soft) 70%, var(--card)); }
a.tile-link.alert .tile-value { color: var(--warn); }
/* A tile's meter sits at the bottom of the tile: the track is the same hue, lighter. */
.tile .tile-sub { margin-bottom: 0.5rem; }
.tile-meter { display: block; margin-top: auto; height: 6px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--viz-variable) 18%, var(--bg)); }
.tile-meter i { display: block; height: 100%; min-width: 2px; border-radius: 999px; background: var(--viz-variable); }
.spark { display: block; width: 100%; height: 24px; margin-top: auto; padding-top: 0.4rem; overflow: visible; }
.spark polyline { stroke: var(--viz-variable); stroke-width: 2px; stroke-linejoin: round; stroke-linecap: round; }
.fb-by-course { margin: 0.6rem 0 0; font-size: 0.95rem; color: var(--muted); }
.fb-by-course a { color: inherit; text-decoration: none; }
.fb-by-course a b { color: var(--accent); font-weight: 700; }
.fb-by-course a.zero b { color: var(--muted); font-weight: 400; }
.fb-by-course a:hover { color: var(--accent); }

/* The unit funnel in a table cell: one column per unit. */
.admin-table td.chart { width: 38%; min-width: 12rem; vertical-align: middle; }
.mini-funnel { display: flex; align-items: stretch; gap: 2px; height: 2.4rem; }
.mf-col { position: relative; flex: 1; min-width: 4px; }
.mf-col i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 2px 2px 0 0; }
.mf-col i.started { background: var(--viz-soft); }
.mf-col i.finished { background: var(--viz-variable); }
.mf-col:hover i.started { background: color-mix(in srgb, var(--viz-variable) 65%, var(--bg)); }
.legend i.started { background: var(--viz-soft); }
.legend i.finished { background: var(--viz-variable); }
.legend .tile-sub { display: inline; margin-left: 0.3rem; }

@media (max-width: 900px) { .tiles.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .admin-table td.chart { min-width: 9rem; } }

/* ---------- Admin: right now, and incidents (live.ts) ---------- */
.live-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.9rem; }
.live-head h2 { font-size: 1.35rem; margin: 0 0 0.3rem; }
.live-head.inc-head { margin-top: 1.5rem; }
.live-pill { font-size: 0.85rem; padding: 0.05rem 0.6rem; border-radius: 999px; border: 1px solid var(--rule); color: var(--muted); }
.live-pill::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; margin-right: 0.4rem; background: var(--muted); }
.live-pill.live { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, var(--rule)); }
.live-pill.live::before { background: var(--good); }
.live-pill.polling, .live-pill.waiting { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--rule)); }
.live-pill.polling::before, .live-pill.waiting::before { background: var(--warn); }
.tiles.kpis.live-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 0.4rem; }
.tile.alert { border-color: color-mix(in srgb, var(--warn) 55%, var(--rule)); background: color-mix(in srgb, var(--warn-soft) 70%, var(--card)); }
.tile.alert .tile-value { color: var(--warn); }
.inc-toggle { font-size: 0.9rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.35rem; }
.incidents { list-style: none; margin: 0.5rem 0 0; padding: 0; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); max-height: 26rem; overflow: auto; }
.incident { display: grid; grid-template-columns: 4.6rem 7.5rem 4.8rem 1fr; gap: 0.2rem 0.8rem; align-items: baseline; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--rule); border-left: 3px solid var(--rule); font-size: 0.95rem; }
.incident:last-child { border-bottom: 0; }
.incident.error { border-left-color: var(--bad); }
.incident.warning { border-left-color: var(--gold); }
.inc-sev { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.incident.error .inc-sev { color: var(--bad); }
.incident.warning .inc-sev { color: var(--warn); }
.inc-when, .inc-src { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inc-msg { overflow-wrap: anywhere; }
.inc-count { font-weight: 700; white-space: nowrap; }
.inc-kind { margin-left: 0.5rem; font-size: 0.74rem; color: var(--muted); background: none; padding: 0; }
.incident.resolved { border-left-color: var(--rule); opacity: 0.75; }
.incident.resolved .inc-sev { color: var(--muted); }
.inc-resolution { display: block; margin-top: 0.2rem; font-size: 0.86rem; color: var(--muted); }
@media (max-width: 1100px) { .tiles.kpis.live-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
	.tiles.kpis.live-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.incident { grid-template-columns: auto auto 1fr; }
	.inc-msg { grid-column: 1 / -1; }
}

/* ---------- Admin: the cost estimate (costs.ts) ---------- */
.estimate h4 { font-size: 1rem; font-weight: 700; margin: 0.9rem 0 0.4rem; }
.est-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.6rem 1rem; margin: 0 0 0.9rem; }
.est-fields label { display: grid; gap: 0.15rem; font-size: 0.92rem; }
.est-fields label span { color: var(--muted); }
.est-fields small { color: var(--muted); font-size: 0.78rem; line-height: 1.3; }
.admin .est-fields input { padding: 0.25rem 0.5rem; font-variant-numeric: tabular-nums; }
.admin-table tr.short td { color: var(--muted); }
.estimate .table-wrap { margin: 0.5rem 0; }

/* ---------- keyboard shortcut hints (keys.ts) ---------- */
.keyed { position: relative; }
.key-hint {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 0.35rem);
	transform: translateX(-50%);
	padding: 0.1rem 0.45rem;
	border: 1px solid var(--muted);
	border-radius: 6px;
	background: var(--bg);
	color: var(--fg);
	font: 0.8rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 120ms ease;
}
.show-keys .key-hint { opacity: 1; }

/* ---------- Admin: the feedback flow (feedbackflow.ts) ---------- */
.fb-tools .fb-flow { margin-left: auto; }
dialog.ff { width: min(46rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--rule); border-radius: 14px; background: var(--bg); color: var(--fg); box-shadow: 0 18px 60px rgb(0 0 0 / 0.25); }
dialog.ff::backdrop { background: color-mix(in srgb, var(--fg) 35%, transparent); }
dialog.ff:focus { outline: none; }
.ff-panel { display: grid; gap: 0.6rem; padding: 1rem 1.2rem 0.9rem; }
.ff-card { display: grid; gap: 0.5rem; transition: opacity 120ms ease; }
.ff-card.busy { opacity: 0.55; pointer-events: none; }
.ff-head { display: flex; align-items: center; gap: 0.8rem; }
.ff-count { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.95rem; white-space: nowrap; }
.ff-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.ff-bar i { display: block; height: 100%; background: var(--accent); }
.ff-close { margin-left: auto; }
.ff-quote { font-style: normal; max-height: 11rem; overflow: auto; }
.ff-quote mark.ann { font-style: italic; }
.ff-comment { font-size: 1.12rem; }
.ann-status.ff-st-open { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--fg); }
.ann-status.ff-st-wontfix { background: var(--rule); color: var(--muted); }
.ff-issue { margin: 0; }
.ff-note, .ff-title, .ff-desc { width: 100%; }
.ff-desc { font-family: var(--mono); font-size: 0.85rem; }
.ff-compose { display: grid; gap: 0.45rem; padding: 0.7rem 0.8rem; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--rule)); border-radius: 10px; }
.ff-compose-head { margin: 0; font-size: 0.95rem; color: var(--muted); }
.ff-compose-head b { color: var(--fg); }
.ff-actions .cta kbd, .ff-compose kbd, .ff-nav kbd, .ff-keys kbd, .ff-done kbd { font-family: var(--mono); font-size: 0.78em; padding: 0.05rem 0.35rem; border: 1px solid currentColor; border-radius: 4px; opacity: 0.75; }
.ff-nav { margin-left: auto; display: flex; gap: 0.9rem; }
.ff-status { margin: 0; min-height: 1.3em; font-size: 0.95rem; color: var(--good); transition: opacity 0.6s ease; }
.ff-status.gone { opacity: 0; }
.ff-status.failed { color: var(--bad); }
.ff-foot { border-top: 1px solid var(--rule); padding-top: 0.5rem; display: grid; gap: 0.3rem; }
.ff-linear { margin: 0; font-size: 0.9rem; color: var(--muted); }
.ff-keys { margin: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; font-size: 0.82rem; color: var(--muted); }
.ff-done { text-align: center; padding: 1.5rem 0 0.5rem; }
.ff-done h2 { margin: 0 0 0.4rem; }
@media (max-width: 640px) {
	.ff-panel { padding: 0.8rem; }
	.ff-nav { margin-left: 0; }
	.ff-keys { display: none; }
}

/* ---------- The editor's completion and descriptions (assist.ts) ---------- */
.editor-wrap { position: relative; }
.editor-mirror { position: absolute; inset: 0; margin: 0; padding: 0.8rem 0.95rem; font-family: var(--mono); font-variant-ligatures: none; border: 0; font-size: 16px; line-height: 1.5; tab-size: 2; white-space: pre; visibility: hidden; pointer-events: none; overflow: hidden; }
.cmp { position: absolute; z-index: 30; display: flex; align-items: stretch; background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 10px 32px rgb(0 0 0 / 0.18); overflow: hidden; font-size: 0.9rem; }
.cmp.stacked { flex-direction: column; }
.cmp-list { list-style: none; margin: 0; padding: 4px 0; overflow-y: auto; flex: 0 0 52%; min-width: 0; }
.cmp.stacked .cmp-list { flex: none; }
.cmp-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0.6rem; cursor: pointer; white-space: nowrap; font-family: var(--mono); font-variant-ligatures: none; line-height: 1.5; }
.cmp-item[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--bg)); }
.cmp-label { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cmp-label b { color: var(--accent); font-weight: 700; }
.cmp-detail { margin-left: auto; padding-left: 0.6rem; color: var(--muted); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; flex: 0 4 auto; min-width: 2rem; }
.cmp-kind { flex: none; width: 2.4rem; text-align: center; border-radius: 4px; font-size: 0.68rem; line-height: 1.5; color: var(--bg); background: var(--muted); }
.cmp-kind.k-theorem { background: var(--syn-type); }
.cmp-kind.k-def, .cmp-kind.k-opaque { background: var(--syn-keyword); }
.cmp-kind.k-structure, .cmp-kind.k-class, .cmp-kind.k-inductive, .cmp-kind.k-constructor { background: var(--syn-tactic); }
.cmp-kind.k-tactic, .cmp-kind.k-keyword { background: var(--syn-command); }
.cmp-kind.k-local { background: var(--accent); }
.cmp-doc { flex: 1; min-width: 0; max-height: 20rem; overflow-y: auto; padding: 0.55rem 0.8rem; border-left: 1px solid var(--rule); }
.cmp.stacked .cmp-doc { border-left: 0; border-top: 1px solid var(--rule); max-height: 12rem; }
.cmp-doc:empty { display: none; }
.hover-doc { display: block; max-height: 22rem; overflow-y: auto; padding: 0.55rem 0.8rem; }
.lean-card .lean-sig { margin: 0 0 0.45rem; padding: 0.45rem 0.6rem; font-size: 0.82rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.lean-card .lean-sig-name { margin: 0 0 0.4rem; }
.lean-card .md { font-size: 0.92rem; line-height: 1.45; }
.lean-card .md p { margin: 0 0 0.45rem; }
.lean-card .md pre.code { font-size: 0.8rem; }
.lean-card .lean-meta { margin: 0.3rem 0 0; font-size: 0.78rem; color: var(--muted); font-family: var(--mono); overflow-wrap: anywhere; }
.lean-docs { margin: 0.75rem 0 0; padding: 0.6rem 0.85rem; border: 1px solid var(--rule); border-radius: 12px; }
.lean-docs-head { margin: 0 0 0.4rem; font-size: 0.8rem; color: var(--muted); letter-spacing: 0.03em; text-transform: uppercase; }
.cmp[hidden], .lean-docs[hidden] { display: none; }

/* Asides and unit references in course text (markdown agent) */
details.aside { margin: 0 0 0.9rem; border: 1px solid var(--rule); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--card, transparent); }
details.aside > summary { cursor: pointer; padding: 0.5rem 0.85rem; color: var(--accent); font-size: 0.95rem; list-style: none; display: flex; gap: 0.5rem; align-items: baseline; border-radius: 10px; }
details.aside > summary::-webkit-details-marker { display: none; }
details.aside > summary::before { content: "▸"; font-size: 0.8em; transition: transform 0.15s; }
details.aside[open] > summary::before { transform: rotate(90deg); }
details.aside > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details.aside .aside-body { padding: 0.2rem 0.85rem 0.1rem; font-size: 0.97rem; }
details.aside .aside-body > :last-child { margin-bottom: 0.5rem; }
@media (prefers-reduced-motion: reduce) { details.aside > summary::before { transition: none; } }
@media print { details.aside { break-inside: avoid; } }

a.unit-ref { color: var(--accent); text-decoration: underline dotted; text-underline-offset: 3px; }
a.unit-ref:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.float-card { position: fixed; z-index: 60; width: min(22rem, calc(100vw - 16px)); max-height: 70vh; overflow: auto; padding: 0.8rem 1rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); color: var(--fg); box-shadow: 0 8px 30px rgb(0 0 0 / 0.22); font-size: 0.92rem; }
.float-card[hidden] { display: none; }
.unit-card h3 { margin: 0 0 0.3rem; font-size: 1.1rem; }
.unit-card-kicker { margin: 0; font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.unit-card-blurb { margin: 0 0 0.5rem; color: var(--muted); }
.unit-card-lessons { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.unit-card-lessons li { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.15rem 0; }
.unit-card-lessons .count { color: var(--muted); font-family: var(--mono); font-size: 0.8rem; }
.unit-card-lessons .due { color: var(--gold); font-size: 0.8rem; }
.unit-card-go { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.unit-card-note { margin: 0.6rem 0 0; font-size: 0.8rem; color: var(--muted); }

/* ---------- Cards for Lean names in course text (cards.ts) ---------- */
/* At rest a name Lean knows has a faint dotted underline: in a code block only while the
   pointer is over the block or a name in it has focus, and always on touch screens. */
.lx-on { cursor: help; border-radius: 2px; text-decoration-line: underline; text-decoration-style: dotted; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
pre.code .lx-on { text-decoration-color: transparent; }
pre.code:hover .lx-on, pre.code:focus-within .lx-on { text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
@media (hover: none) { pre.code .lx-on { text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); } }
.lx-on.lx-local { text-decoration-style: dotted; }
.lx-on:hover, .lx-on[aria-expanded="true"] { background: color-mix(in srgb, var(--accent) 14%, transparent); text-decoration-color: currentColor; }
.lx-on:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button .lx-on { cursor: inherit; }
.lx-card { position: absolute; z-index: 40; max-height: min(24rem, 70vh); overflow-y: auto; padding: 0.6rem 0.85rem; background: var(--bg); color: var(--fg); border: 1px solid var(--rule); border-radius: 10px; box-shadow: 0 10px 32px rgb(0 0 0 / 0.18); font-size: 0.92rem; text-align: left; }
.lx-card:focus { outline: none; }
.lx-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .lx-card { animation: lx-in 120ms ease-out; } }
@keyframes lx-in { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: none; } }
.lean-card .lean-src { white-space: nowrap; }
.lean-card .lean-meta + .md { margin-top: 0.45rem; }
.lean-also { margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px solid var(--rule); }
.lean-also-head { margin: 0 0 0.35rem; font-size: 0.85rem; color: var(--muted); }

/* ---------- Typing Lean's symbols: did you mean, and the typing demo (meant.ts, typing.ts) ---------- */
.symbol-row { display: flex; align-items: flex-start; gap: 8px; }
.symbol-row .symbols { flex: 1 1 auto; min-width: 0; }
.typing-open { flex: none; margin-top: 0.5rem; height: 2.1rem; padding: 0 0.7rem; border-radius: 8px; border: 1px dashed color-mix(in srgb, var(--muted) 60%, transparent); background: transparent; color: var(--muted); font: inherit; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }
.typing-open:hover, .typing-open[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.typing[hidden] { display: none; }
.typing { position: absolute; z-index: 25; right: 0; bottom: calc(100% + 8px); width: min(25rem, 100%); padding: 0.7rem 0.9rem 0.8rem; background: var(--bg); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 10px 32px rgb(0 0 0 / 0.18); font-size: 0.95rem; }
.typing-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.typing-close { width: 2rem; height: 2rem; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.typing-close:hover, .typing-close:focus-visible { color: var(--fg); background: var(--rule); }
.typing-lede { margin: 0.1rem 0 0.5rem; color: var(--muted); }
.typing-stage { display: flex; align-items: center; gap: 0.8rem; padding: 0.55rem 0.8rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); min-height: 3.2rem; }
.typing-stage[hidden] { display: none; }
.typing-line { flex: 1; font-family: var(--mono); font-size: 1.35rem; min-height: 1.9rem; display: flex; align-items: center; white-space: pre; }
.typing-box.done { color: var(--accent); animation: typing-pop 420ms ease-out; }
.typing-caret { width: 2px; height: 1.4rem; margin-left: 2px; background: var(--fg); animation: typing-blink 1s steps(1) infinite; }
.typing-key { flex: none; min-width: 3.2rem; text-align: center; padding: 0.15rem 0.5rem; border: 1px solid var(--rule); border-bottom-width: 3px; border-radius: 6px; background: var(--bg); font-family: var(--mono); font-size: 0.95rem; }
.typing-key.hit { animation: typing-press 200ms ease-out; }
.typing-list { list-style: none; margin: 0.6rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: 0.3rem 0.8rem; }
.typing-list li { display: flex; align-items: baseline; gap: 0.4rem; padding: 0.1rem 0.3rem; border-radius: 6px; }
.typing-list li.now { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.typing-keys { color: var(--muted); }
.typing-sym { font-family: var(--mono); font-size: 1.1rem; }
.typing-foot { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }
.typing-pause { border: 1px solid var(--rule); border-radius: 8px; background: var(--card); color: var(--fg); font: inherit; font-size: 0.85rem; padding: 0.15rem 0.7rem; cursor: pointer; }
.typing-pause[hidden] { display: none; }
.typing-pause:hover { border-color: var(--accent); }
@keyframes typing-blink { 50% { opacity: 0; } }
@keyframes typing-press { from { transform: translateY(2px); border-bottom-width: 1px; } to { transform: none; } }
@keyframes typing-pop { from { transform: scale(1.35); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
	.typing-caret, .typing-key.hit, .typing-box.done { animation: none; }
}
@media (max-width: 640px) {
	.typing-open { font-size: 0.8rem; padding: 0 0.5rem; }
	.typing { width: 100%; }
}
.meant { margin: 0.6rem 0 0; padding: 0.6rem 0.85rem; border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--rule)); border-left-width: 4px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.meant p { margin: 0 0 0.5rem; }
.meant-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- Vocabulary panel and glossary page (FUN-7, web/src/glossary.ts) ---------- */
.vocab-toggle { flex: none; padding: 0.2rem 0.75rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--card, var(--bg)); color: var(--fg); font: inherit; font-size: 0.95rem; cursor: pointer; }
.vocab-toggle:hover { border-color: var(--accent); color: var(--accent); }
.vocab-toggle[aria-expanded="true"] { border-color: color-mix(in srgb, var(--accent) 55%, var(--rule)); }
.vocab-toggle:focus-visible, .vocab-close:focus-visible, .vocab-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vocab-side { display: none; }
/* Wide: the exercise keeps its width; it and the column are centered together. */
@media (min-width: 70rem) {
	main.ex.has-vocab.vocab-open { margin-left: calc((100% - 68rem) / 2); position: relative; }
	main.ex.vocab-open > .vocab-side { display: block; position: absolute; top: 2.5rem; bottom: 0; left: calc(100% + 2rem); width: 20rem; }
}
.vocab-inner { position: sticky; top: 1rem; max-height: min(calc(100vh - 2rem), 100%); max-height: min(calc(100dvh - 2rem), 100%); overflow-y: auto; overscroll-behavior: contain; padding: 0 0.25rem 1rem 1.25rem; border-left: 1px solid var(--rule); }
.vocab-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.vocab-bar h2 { margin: 0; font-size: 1.3rem; }
.vocab-close { padding: 0.15rem 0.6rem; border: 1px solid var(--rule); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 0.9rem; cursor: pointer; }
.vocab-close:hover { color: var(--accent); border-color: var(--accent); }
.vocab-tools { position: sticky; top: 0; z-index: 1; padding: 0.6rem 0 0.4rem; background: var(--bg); }
.vocab-filter { width: 100%; padding: 0.4rem 0.7rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); color: var(--fg); font: inherit; font-size: 1rem; }
.vocab-count { margin: 0.3rem 0 0; font-size: 0.85rem; color: var(--muted); }
.vocab-unit-title { margin: 1rem 0 0.4rem; font-size: 0.85rem; font-weight: 400; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); }
.vocab-term { padding: 0.55rem 0; border-top: 1px solid var(--rule); font-size: 0.95rem; }
.vocab-term-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.1rem 0.75rem; margin: 0 0 0.25rem; }
.vocab-term-head h3, .vocab-term-head h4 { margin: 0; font-size: 1.05rem; }
.vocab-from { font-size: 0.82rem; color: var(--muted); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.vocab-from:hover { color: var(--accent); }
.vocab-new { font-size: 0.78rem; padding: 0 0.5rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.vocab-term.new { border-left: 3px solid var(--accent); padding-left: 0.6rem; margin-left: -0.6rem; }
.vocab-term .md p { margin: 0 0 0.4rem; }
.vocab-term pre.code { margin: 0.2rem 0 0.3rem; padding: 0.5rem 0.7rem; font-size: 0.78rem; border-radius: 8px; }
.vocab-all { margin: 1rem 0 0; font-size: 0.95rem; }
/* Keywords so far: the tactics and commands met, as chips above the filter. */
.vocab-keywords { margin: 0.8rem 0 0.2rem; padding: 0 0 0.7rem; border-bottom: 1px solid var(--rule); }
.vocab-keywords-title { margin: 0 0 0.4rem; font-size: 0.85rem; font-weight: 400; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); }
.vocab-keyword-row { margin: 0 0 0.45rem; }
.vocab-keyword-label { margin: 0 0 0.2rem; font-size: 0.85rem; color: var(--muted); }
.vocab-keyword-chips { display: flex; flex-wrap: wrap; gap: 0.3rem 0.35rem; margin: 0; padding: 0; list-style: none; }
.vocab-keyword { padding: 0.12rem 0.5rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--code-bg); color: var(--fg); font-family: var(--mono); font-variant-ligatures: none; font-size: 0.8rem; line-height: 1.5; cursor: pointer; }
.vocab-keyword:hover { border-color: var(--accent); color: var(--accent); }
.vocab-keyword[aria-expanded="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.vocab-keyword.new { border-color: color-mix(in srgb, var(--accent) 55%, var(--rule)); background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.vocab-keyword:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vocab-keyword-detail:not(:empty) { margin: 0.4rem 0 0; }
.vocab-keyword-detail .vocab-term { border-top: 1px solid var(--rule); }
/* Narrow: the same list as a sheet from the right. */
dialog.vocab-sheet { margin: 0 0 0 auto; width: min(28rem, 100vw); max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; padding: 1rem 1rem 2rem; border: 0; border-left: 1px solid var(--rule); background: var(--bg); color: var(--fg); overflow-y: auto; overscroll-behavior: contain; }
dialog.vocab-sheet::backdrop { background: color-mix(in srgb, var(--fg) 35%, transparent); }
@media (min-width: 70rem) { dialog.vocab-sheet:not([open]) { display: none; } }
/* The glossary page. */
.glossary-letters { display: flex; flex-wrap: wrap; gap: 0.2rem 0.7rem; margin: 0 0 0.5rem; font-size: 1.05rem; }
.glossary-letters a { color: var(--muted); }
.glossary-letters a:hover { color: var(--accent); }
.glossary-page .vocab-tools { padding-top: 0.5rem; }
.glossary-letter h2 { margin: 1.6rem 0 0.3rem; font-size: 1.5rem; scroll-margin-top: 4.5rem; }
.glossary-page .vocab-term { font-size: 1.05rem; padding: 0.8rem 0; scroll-margin-top: 4.5rem; }
.glossary-page .vocab-term-head h3 { font-size: 1.2rem; }
.glossary-page .vocab-from { font-size: 0.9rem; }
.glossary-page .vocab-term pre.code { font-size: 0.85rem; }
@media (max-width: 640px) { .lesson-top { gap: 0.6rem; } .vocab-toggle { padding: 0.15rem 0.6rem; font-size: 0.9rem; } }

/* ---------- Lists in course text, and the unit preview blurb as markdown ---------- */
.md ul, .md ol { margin: 0 0 0.9rem; padding-left: 1.3rem; }
.md li { margin: 0 0 0.3rem; }
.unit-card-blurb .md p { margin: 0 0 0.4rem; }

/* ---------- Profile ---------- */
.avatar { display: inline-flex; flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; object-fit: cover; background: var(--rule); vertical-align: middle; }
.avatar.initial { align-items: center; justify-content: center; background: hsl(var(--hue, 220) 42% 42%); color: #fff; font-size: 1rem; line-height: 1; }
.avatar.big { width: 6rem; height: 6rem; }
.avatar.big.initial { font-size: 3rem; }
.nav a.me { display: inline-flex; padding: 0; border: 0; border-radius: 50%; outline: 1.5px solid transparent; outline-offset: 2px; }
.nav a.me:hover, .nav a.me:focus-visible, .nav a.me[aria-current="page"] { outline-color: var(--accent); }
.profile .card { margin: 0 0 1.25rem; }
.profile .card h2 { margin: 0 0 0.5rem; font-size: 1.4rem; font-weight: 400; }
.profile .card p { margin: 0 0 0.75rem; font-size: 1.1rem; }
.profile .card p:last-child { margin-bottom: 0; }
.profile-head { display: flex; align-items: center; gap: 1.25rem; }
.profile-head > div { min-width: 0; }
.profile .profile-name { margin: 0 0 0.2rem; font-size: 1.7rem; line-height: 1.15; overflow-wrap: anywhere; }
.profile .profile-meta { margin: 0; color: var(--muted); font-size: 1rem; overflow-wrap: anywhere; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin: 0 0 1.25rem; }
.stat-tile { display: flex; flex-direction: column; padding: 0.8rem 1rem; border: 1.5px solid var(--rule); border-radius: 14px; background: var(--card); }
.stat-tile b { font-weight: 400; font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-tile span { color: var(--muted); font-size: 0.95rem; }
/* A square a day, a column a week. */
.days { display: grid; grid-template-rows: repeat(7, 0.8rem); grid-auto-flow: column; grid-auto-columns: 0.8rem; gap: 3px; margin: 0.25rem 0 0.9rem; overflow-x: auto; }
.days i { border-radius: 3px; background: var(--rule); }
.days i.pad { background: none; }
.days i.on { background: var(--good); }
.days i.today { outline: 1.5px solid var(--fg); outline-offset: 1px; }
.profile .profile-rule { color: var(--muted); font-size: 0.95rem; }
.profile .soon { border-style: dashed; }
.soon-tag { margin-left: 0.6rem; padding: 0.1rem 0.55rem; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 0.85rem; vertical-align: middle; white-space: nowrap; }
.profile-done { margin: 0; padding-left: 1.2rem; }
.profile-form { display: flex; flex-direction: column; gap: 0.4rem; margin: 0 0 1.1rem; }
.profile-form label, .profile-form .label { color: var(--muted); font-size: 1rem; }
.profile-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.profile-row .at { color: var(--muted); font-size: 1.2rem; margin-right: -0.3rem; }
.profile-row input[type="text"] { flex: 1 1 12rem; min-width: 0; max-width: 20rem; font: inherit; font-size: 1.1rem; color: var(--fg); background: var(--bg); border: 1.5px solid var(--rule); border-radius: 10px; padding: 0.45rem 0.8rem; }
.profile-row input[type="text"]:focus { outline: none; border-color: var(--accent); }
.profile-row label.cta { cursor: pointer; color: var(--fg); }
.profile-row label.cta:hover { color: var(--bg); }
.profile-row label.cta:focus-within { border-color: var(--accent); }
.profile .profile-note { color: var(--muted); font-size: 1rem; }
.profile .profile-note:empty { display: none; }
.profile .profile-note.bad { color: var(--bad); }
@media (max-width: 640px) {
	.stat-tiles { grid-template-columns: repeat(2, 1fr); }
	.profile-head { gap: 0.9rem; }
	.avatar.big { width: 4.5rem; height: 4.5rem; }
	.avatar.big.initial { font-size: 2.2rem; }
}

/* ---------- Course pictures (courseart.ts) and each course's own look ---------- */
/* Two cards to a row on a wide page, so each picture has room. */
.courses { grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); }
.course.themed { padding: 0; overflow: hidden; }
.course-body { display: flex; flex-direction: column; flex: 1; padding: 1.1rem 1.5rem 1.25rem; }
.art { display: block; border-bottom: 1.5px solid color-mix(in srgb, var(--muted) 45%, transparent); }
.art svg { display: block; width: 100%; height: auto; }
.ca-grid { fill: none; stroke: var(--rule); stroke-width: 0.6; }
.ca-ink { fill: none; stroke: var(--fg); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.ca-ink.ca-thin { stroke-width: 0.8; }
.ca-ink.ca-dash { stroke-dasharray: 4 3; }
.ca-ink.ca-accent { stroke: var(--accent); }
.ca-accent-fill { fill: var(--accent); }
.ca-area { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.ca-dot { fill: var(--accent); }
.ca-math { fill: var(--fg); font-family: var(--serif); }
.ca-math.ca-it { font-style: italic; }
/* The page at the top of a course: the same picture, wide. */
.course-banner { margin: 0 0 1.5rem; border: 1.5px solid color-mix(in srgb, var(--muted) 45%, transparent); border-radius: 18px; overflow: hidden; }
.course-banner .art { border-bottom: 0; }
.course-banner .art svg { width: auto; max-width: 100%; height: 12rem; margin: 0 auto; }

/* Lean 4 for Programmers: a terminal. Dark in both themes, as terminals are. */
.course-prog {
	--t-bg: #0d1117; --t-fg: #d6dbe4; --t-dim: #8b949e; --t-green: #7ee787; --t-line: #30363d;
	--syn-keyword: #c9a4ff; --syn-tactic: #6fe0d2; --syn-type: #f2c078; --syn-comment: #7d8299; --syn-string: #96e39a; --syn-number: #ffb07a; --syn-op: #7ea1ff; --syn-command: #ff9ccb;
	background: var(--t-bg); color: var(--t-fg); border-color: var(--t-line); border-radius: 10px; font-family: var(--mono); font-variant-ligatures: none; backdrop-filter: none;
}
.course.course-prog:hover, .course.course-prog:focus-visible { border-color: var(--t-green); }
.course-prog .art { border-bottom-color: var(--t-line); }
.term-bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.75rem; background: #161b22; color: var(--t-dim); font-size: 0.72rem; }
.term-bar i { width: 0.62rem; height: 0.62rem; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { flex: 1; text-align: center; padding-right: 2.6rem; white-space: nowrap; overflow: hidden; }
.term-buf { margin: 0; padding: 0.45rem 0 0.15rem; font-size: 0.8rem; line-height: 1.5; white-space: pre; overflow: hidden; color: var(--t-fg); }
.term-line { display: block; min-height: 1.5em; }
.term-line.cur { background: #161b22; }
.term-nr { display: inline-block; width: 3ch; margin-right: 1.5ch; text-align: right; color: #545d68; user-select: none; }
.term-line.cur .term-nr { color: #e3b341; }
.term-line.tilde { padding-left: 1ch; color: #3d6fd9; }
.term-cursor { display: inline-block; width: 1ch; height: 1.15em; vertical-align: text-bottom; background: var(--t-fg); }
.term-status { display: flex; background: #21262d; color: var(--t-fg); font-size: 0.72rem; line-height: 1.7; white-space: pre; overflow: hidden; }
.term-status b { background: var(--t-green); color: var(--t-bg); font-weight: 700; }
.term-status .term-fill { flex: 1; }
.term-status .term-ok { color: var(--t-green); }
.term-status .term-pos { background: #30363d; }
@media (prefers-reduced-motion: no-preference) {
	.term-cursor { animation: term-blink 1.1s steps(1) infinite; }
}
@keyframes term-blink { 50% { opacity: 0; } }
.course-prog .lean-name { font: inherit; letter-spacing: inherit; }
.course-prog .level { color: var(--t-green); font-size: 0.8rem; }
.course-prog .level::before { content: "# "; }
.course-prog h3 { font-size: 1.22rem; line-height: 1.3; }
.course-prog h3::before { content: "$ "; color: var(--t-green); }
.course-prog .tagline { font-style: normal; font-size: 0.86rem; color: var(--t-dim); }
.course-prog .tagline::before { content: "-- "; }
.course-prog .audience { font-size: 0.86rem; line-height: 1.55; }
.course-prog .meta { font-size: 0.78rem; color: var(--t-dim); }
.course-prog .bar { background: var(--t-line); }
.course-prog .bar i { background: var(--t-green); border-radius: 0; }
.course-banner.course-prog .term-buf { font-size: 0.92rem; padding-bottom: 0.4rem; }

/* Lean 4 for Mathematicians: a page of mathematics. */
.course-math .level { font-variant-caps: small-caps; letter-spacing: 0.04em; font-size: 1.05rem; }
.course-math .audience::after { content: " ∎"; color: var(--muted); }

/* Specification Engineering: a drawing sheet. Square corners, one weight of line, capitals. */
.course.course-spec-eng, .course-banner.course-spec-eng { border-radius: 3px; border-color: var(--fg); }
.course-spec-eng .art { border-bottom: 1.5px solid var(--fg); }
.ca-eng { fill: var(--fg); font-family: var(--mono); font-variant-ligatures: none; letter-spacing: 0.06em; }
.ca-eng.ca-dim { fill: var(--muted); letter-spacing: 0; }
.ca-ink.ca-fill { fill: var(--bg); }
.course-spec-eng .level { align-self: flex-start; margin-bottom: 0.6rem; padding: 0.1rem 0.5rem; border: 1px solid var(--fg); color: var(--fg); font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; }
.course-spec-eng h3 { font-family: var(--mono); font-variant-ligatures: none; font-size: 1.12rem; letter-spacing: 0.07em; text-transform: uppercase; line-height: 1.3; }
.course-spec-eng .tagline { font-style: normal; color: var(--fg); }
.course-spec-eng .audience { color: var(--muted); }
.course-spec-eng .meta { padding-top: 0.6rem; border-top: 1px solid var(--fg); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg); }
.course-spec-eng .bar { height: 6px; border-radius: 0; }
.course-spec-eng .bar i { border-radius: 0; background: var(--fg); }

/* Intro to Proofs: goal, tactic, goal. */
.ca-panel { fill: var(--bg); stroke: color-mix(in srgb, var(--muted) 55%, transparent); stroke-width: 1.2; }
.ca-panel.ca-done { stroke: var(--go-ink); fill: color-mix(in srgb, var(--go) 10%, var(--bg)); }
.ca-code { fill: var(--fg); font-family: var(--mono); font-variant-ligatures: none; }
.ca-code.ca-tactic { fill: var(--syn-tactic); }
.ca-turnstile { fill: var(--accent); }
.ca-ink.ca-go { stroke: var(--go-ink); stroke-width: 1.5; }
.ca-ink.ca-check { stroke-width: 3; }
.ca-go-fill { fill: var(--go-ink); }
.course-proofs .art { background: color-mix(in srgb, var(--go) 6%, transparent); }
.course-proofs .level { color: var(--go-ink); }
.course.course-proofs:hover, .course.course-proofs:focus-visible { border-color: var(--go-ink); }
.course-proofs .bar i { background: var(--go); }

/* ---------- The detour to Intro to Proofs, and the way back (detour.ts) ---------- */
.detour-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.7rem 1.2rem; margin: 1rem 0 0; padding: 0.7rem 0.95rem; border: 1px solid color-mix(in srgb, var(--go) 45%, var(--rule)); border-left: 3px solid var(--go); border-radius: 0 12px 12px 0; background: color-mix(in srgb, var(--go) 7%, var(--card)); }
.detour-offer p { flex: 1 1 18rem; margin: 0; font-size: 1.02rem; }
.detour-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin: 0 0 1.25rem; padding: 0.45rem 0.6rem 0.45rem 0.95rem; border: 1px solid color-mix(in srgb, var(--go) 45%, var(--rule)); border-radius: 12px; background: color-mix(in srgb, var(--go) 7%, var(--card)); font-size: 1rem; color: var(--muted); }
.detour-card { margin: 0 0 1.5rem; border-color: color-mix(in srgb, var(--go) 55%, var(--rule)); background: color-mix(in srgb, var(--go) 7%, var(--card)); }
.detour-card p { margin: 0 0 0.6rem; }
.detour-card .actions { margin: 0.2rem 0 0; }
.help-try a.cta { margin-top: 0.4rem; }
@media (max-width: 640px) {
	.course-body { padding: 0.9rem 1.05rem 1rem; }
	.term-buf { font-size: 0.72rem; }
}
