/* UOPD project page. Colors are tokens; chart hues were checked with a
   colorblind/contrast validator in both themes. */

:root {
	--bg: #ffffff;
	--bg-alt: #f6f8fa;
	--surface: #ffffff;
	--surface-2: #f3f5f8;
	--ink: #161b22;
	--ink-2: #424a55;
	--ink-3: #687180;
	--line: #e3e7ec;
	--line-2: #cfd5dc;
	--focus: #2a78d6;

	--uopd: #2a78d6;
	--opd: #d9653b;
	--student: #1b8a5c;
	--teacher: #7152b0;
	--threshold: #b8641f;
	--base: #87949a;
	--uopd-soft: rgba(42, 120, 214, 0.1);
	--opd-soft: rgba(217, 101, 59, 0.11);
	--student-soft: rgba(27, 138, 92, 0.12);
	--teacher-soft: rgba(113, 82, 176, 0.12);
	--threshold-soft: rgba(184, 100, 31, 0.12);
	--grid: rgba(22, 27, 34, 0.08);
	--figure-bg: #ffffff;

	--radius: 14px;
	--radius-sm: 9px;
	--shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 10px 30px rgba(16, 24, 40, 0.06);
	--sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0f1216;
		--bg-alt: #13171c;
		--surface: #171b21;
		--surface-2: #1d2229;
		--ink: #e8ebef;
		--ink-2: #b9c0c9;
		--ink-3: #8b94a0;
		--line: #262c34;
		--line-2: #343b45;
		--focus: #5c9ded;
		--uopd: #3a85e0;
		--opd: #d6663f;
		--student: #219a68;
		--teacher: #8a6ed4;
		--threshold: #c8782f;
		--base: #5f6a70;
		--uopd-soft: rgba(58, 133, 224, 0.16);
		--opd-soft: rgba(214, 102, 63, 0.16);
		--student-soft: rgba(33, 154, 104, 0.17);
		--teacher-soft: rgba(138, 110, 212, 0.18);
		--threshold-soft: rgba(200, 120, 47, 0.16);
		--grid: rgba(232, 235, 239, 0.08);
		--figure-bg: #ffffff;
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--bg: #0f1216;
	--bg-alt: #13171c;
	--surface: #171b21;
	--surface-2: #1d2229;
	--ink: #e8ebef;
	--ink-2: #b9c0c9;
	--ink-3: #8b94a0;
	--line: #262c34;
	--line-2: #343b45;
	--focus: #5c9ded;
	--uopd: #3a85e0;
	--opd: #d6663f;
	--student: #219a68;
	--teacher: #8a6ed4;
	--threshold: #c8782f;
	--base: #5f6a70;
	--uopd-soft: rgba(58, 133, 224, 0.16);
	--opd-soft: rgba(214, 102, 63, 0.16);
	--student-soft: rgba(33, 154, 104, 0.17);
	--teacher-soft: rgba(138, 110, 212, 0.18);
	--threshold-soft: rgba(200, 120, 47, 0.16);
	--grid: rgba(232, 235, 239, 0.08);
	--figure-bg: #ffffff;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.25);
	color-scheme: dark;
}

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: 76px;
	-webkit-text-size-adjust: 100%;
}

body {
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.65;
	margin: 0;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: var(--uopd);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:hover {
	text-decoration-thickness: 2px;
}

button {
	font: inherit;
}

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

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

.skip-link {
	background: var(--ink);
	color: var(--bg);
	left: 12px;
	padding: 8px 12px;
	position: absolute;
	top: -60px;
	z-index: 100;
}

.skip-link:focus {
	top: 12px;
}

.container {
	margin: 0 auto;
	max-width: 1100px;
	padding: 0 24px;
}

.container-wide {
	max-width: 1240px;
}

.container-text {
	max-width: 820px;
}

/* ------------------------------------------------------------------ nav */

.topnav {
	backdrop-filter: saturate(160%) blur(10px);
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	border-bottom: 1px solid transparent;
	left: 0;
	position: fixed;
	right: 0;
	top: 0;
	transform: translateY(-100%);
	transition: transform 220ms ease, border-color 220ms ease;
	z-index: 50;
}

.topnav.is-visible {
	border-bottom-color: var(--line);
	transform: translateY(0);
}

.topnav-inner {
	align-items: center;
	display: flex;
	gap: 18px;
	height: 58px;
	margin: 0 auto;
	max-width: 1240px;
	padding: 0 24px;
}

.topnav-brand {
	color: var(--ink);
	font-weight: 800;
	letter-spacing: -0.01em;
	text-decoration: none;
}

.topnav-links {
	display: flex;
	flex: 1;
	gap: 4px;
	overflow-x: auto;
	scrollbar-width: none;
}

.topnav-links::-webkit-scrollbar {
	display: none;
}

.topnav-links a {
	border-radius: 8px;
	color: var(--ink-2);
	flex: 0 0 auto;
	font-size: 14px;
	font-weight: 500;
	padding: 6px 10px;
	text-decoration: none;
}

.topnav-links a:hover,
.topnav-links a.is-active {
	background: var(--surface-2);
	color: var(--ink);
}

.theme-toggle {
	align-items: center;
	background: transparent;
	border: 1px solid var(--line-2);
	border-radius: 999px;
	color: var(--ink-2);
	cursor: pointer;
	display: inline-flex;
	flex: 0 0 auto;
	height: 34px;
	justify-content: center;
	width: 34px;
}

.theme-toggle svg {
	fill: none;
	height: 17px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-width: 1.8;
	width: 17px;
}

.theme-toggle .icon-sun {
	display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
	display: block;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
	display: none;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .theme-toggle .icon-sun {
		display: block;
	}

	:root:not([data-theme="light"]) .theme-toggle .icon-moon {
		display: none;
	}
}

/* ------------------------------------------------------------------ hero */

.hero {
	background:
		radial-gradient(900px 380px at 18% -10%, var(--uopd-soft), transparent 70%),
		radial-gradient(800px 360px at 88% 0%, var(--teacher-soft), transparent 70%);
	padding: 92px 0 56px;
	text-align: center;
}

.hero-inner {
	max-width: 980px;
}

.venue {
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 13px;
	letter-spacing: 0.06em;
	margin: 0 0 18px;
	text-transform: uppercase;
}

.title {
	font-size: clamp(30px, 4.4vw, 50px);
	font-weight: 800;
	letter-spacing: -0.025em;
	line-height: 1.12;
	margin: 0 auto 26px;
	max-width: 960px;
	text-wrap: balance;
}

.title-acronym {
	background: linear-gradient(92deg, var(--uopd), var(--teacher));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	display: block;
	font-size: 1.18em;
	letter-spacing: -0.03em;
	margin-bottom: 6px;
}

.title-rest {
	display: block;
}

.authors {
	display: flex;
	flex-wrap: wrap;
	font-size: 18px;
	font-weight: 500;
	gap: 6px 22px;
	justify-content: center;
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
}

.authors a {
	color: var(--ink);
	text-decoration-color: var(--line-2);
}

.authors sup,
.affiliations sup {
	color: var(--ink-3);
	font-size: 0.66em;
	margin-left: 1px;
}

.affiliations {
	color: var(--ink-2);
	display: flex;
	flex-wrap: wrap;
	font-size: 15px;
	gap: 4px 20px;
	justify-content: center;
	margin: 0 0 28px;
}

.affiliations .equal {
	color: var(--ink-3);
}

.hero-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.hero-buttons-left {
	justify-content: flex-start;
}

.btn {
	align-items: center;
	background: var(--surface);
	border: 1px solid var(--line-2);
	border-radius: 999px;
	color: var(--ink);
	display: inline-flex;
	font-size: 15px;
	font-weight: 600;
	gap: 8px;
	line-height: 1;
	padding: 11px 18px;
	text-decoration: none;
	transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.btn:hover {
	border-color: var(--ink-3);
	transform: translateY(-1px);
}

.btn svg {
	fill: none;
	flex: 0 0 auto;
	height: 17px;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
	width: 17px;
}

.btn svg.icon-fill {
	fill: currentColor;
	stroke: none;
}

.btn-primary {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--bg);
}

.btn-primary:hover {
	border-color: var(--ink);
}

/* ------------------------------------------------------------------ sections */

.section {
	padding: 84px 0;
}

.section-tight {
	padding: 8px 0 40px;
}


.section-alt {
	background: var(--bg-alt);
	border-bottom: 1px solid var(--line);
	border-top: 1px solid var(--line);
}

.section-head {
	margin: 0 auto 36px;
	max-width: 820px;
	text-align: center;
}

.eyebrow {
	color: var(--uopd);
	font-family: var(--mono);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	margin: 0 0 10px;
	text-transform: uppercase;
}

.section h2 {
	font-size: clamp(25px, 3vw, 34px);
	font-weight: 750;
	letter-spacing: -0.02em;
	line-height: 1.2;
	margin: 0 0 14px;
	text-wrap: balance;
}

.lead {
	color: var(--ink-2);
	font-size: 18px;
	margin: 0;
}

.container-text > p {
	color: var(--ink-2);
	margin: 0 0 16px;
	text-align: justify;
	hyphens: auto;
}

.subsection {
	margin-top: 56px;
}

.subsection-head {
	margin-bottom: 18px;
}

.subsection-head h3 {
	font-size: 21px;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0 0 6px;
}

.subsection-head p {
	color: var(--ink-2);
	font-size: 15.5px;
	margin: 0;
	max-width: 760px;
}

.grid-2 {
	display: grid;
	gap: 28px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-2 > .subsection {
	display: flex;
	flex-direction: column;
	margin-top: 56px;
}

.grid-2 > .subsection > .widget {
	flex: 1;
}

.noscript,
.figure-note {
	color: var(--ink-3);
	font-size: 13.5px;
	margin: 14px auto 0;
	max-width: 760px;
	text-align: center;
}

/* ------------------------------------------------------------------ stats */

.stat-grid {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px 18px 16px;
}

.stat-value {
	font-size: 28px;
	font-weight: 750;
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin: 0 0 6px;
}

.stat-label {
	color: var(--ink-2);
	font-size: 14px;
	line-height: 1.45;
	margin: 0;
}

/* ------------------------------------------------------------------ figures */

.figure {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	margin: 36px 0 0;
	overflow: hidden;
}

.figure-hero {
	margin-top: 0;
}

.figure-zoom {
	background: var(--figure-bg);
	border: 0;
	cursor: zoom-in;
	display: block;
	margin: 0;
	padding: 18px;
	width: 100%;
}

.figure-row {
	background: var(--figure-bg);
	display: grid;
	gap: 0;
}

.figure-row-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.figure-row-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.figure-row .figure-zoom {
	padding: 14px;
}

.figure figcaption {
	border-top: 1px solid var(--line);
	color: var(--ink-2);
	font-size: 14.5px;
	line-height: 1.6;
	padding: 14px 18px 16px;
}

.figure figcaption strong {
	color: var(--ink);
}

.lightbox {
	align-items: center;
	background: rgba(10, 12, 16, 0.86);
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 4vmin;
	position: fixed;
	z-index: 200;
}

.lightbox[hidden] {
	display: none;
}

.lightbox img {
	background: #fff;
	border-radius: 10px;
	max-height: 92vh;
	max-width: 96vw;
	object-fit: contain;
	padding: 12px;
}

.lightbox-close {
	background: #fff;
	border: 0;
	border-radius: 999px;
	color: #111;
	cursor: pointer;
	font-size: 26px;
	height: 42px;
	line-height: 1;
	position: absolute;
	right: 20px;
	top: 20px;
	width: 42px;
}

/* ------------------------------------------------------------------ method */

.steps {
	counter-reset: step;
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-top: 0;
}

.step {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px 20px 18px;
	position: relative;
}

.step-index {
	align-items: center;
	background: var(--uopd-soft);
	border-radius: 999px;
	color: var(--uopd);
	display: inline-flex;
	font-family: var(--mono);
	font-size: 13px;
	font-weight: 700;
	height: 28px;
	justify-content: center;
	margin-bottom: 10px;
	width: 28px;
}

.step h3 {
	font-size: 17px;
	margin: 0 0 6px;
}

.step p {
	color: var(--ink-2);
	font-size: 15px;
	margin: 0;
}

.equation-card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	margin-top: 16px;
	padding: 20px 24px 8px;
}

.equation-label {
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 12.5px;
	letter-spacing: 0.04em;
	margin: 0;
	text-transform: uppercase;
}

.equation {
	max-width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 2px 0;
}

.equation .katex-display {
	margin: 0.6em 0 0.9em;
}

.equation-grid {
	border-top: 1px dashed var(--line-2);
	display: grid;
	gap: 0 28px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	padding-top: 14px;
}

/* ------------------------------------------------------------------ motivation */

.split {
	align-items: start;
	display: grid;
	gap: 32px;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.findings {
	display: grid;
	gap: 16px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.findings li {
	border-left: 3px solid var(--uopd);
	color: var(--ink-2);
	font-size: 15.5px;
	padding: 2px 0 2px 16px;
}

.findings strong {
	color: var(--ink);
	display: block;
	font-size: 16px;
	margin-bottom: 2px;
}

/* ------------------------------------------------------------------ insights */

.insight-grid {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-top: 22px;
}

.insight {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px;
}

.insight h3 {
	font-size: 16px;
	margin: 0 0 6px;
}

.insight p {
	color: var(--ink-2);
	font-size: 14.5px;
	line-height: 1.55;
	margin: 0;
}

/* ------------------------------------------------------------------ theory */

.theorem {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 22px 24px 18px;
}

.theorem-kicker {
	color: var(--teacher);
	font-family: var(--mono);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.05em;
	margin: 0 0 6px;
	text-transform: uppercase;
}

.theorem h3 {
	font-size: 19px;
	letter-spacing: -0.01em;
	margin: 0 0 10px;
}

.theorem p {
	color: var(--ink-2);
	font-size: 15.5px;
	margin: 0 0 10px;
}

/* ------------------------------------------------------------------ paper */

.paper-block {
	align-items: start;
	display: grid;
	gap: 36px;
	grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
}

.paper-cover {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 10px;
	box-shadow: var(--shadow);
	display: block;
	overflow: hidden;
	transition: transform 160ms ease;
}

.paper-cover:hover {
	transform: translateY(-2px);
}

.paper-side h3 {
	font-size: 22px;
	letter-spacing: -0.01em;
	line-height: 1.3;
	margin: 0 0 8px;
}

.paper-authors {
	color: var(--ink-2);
	margin: 0;
}

.paper-meta {
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 13.5px;
	margin: 4px 0 18px;
}

.paper-strip-label {
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 12.5px;
	letter-spacing: 0.04em;
	margin: 28px 0 10px;
	text-transform: uppercase;
}

.paper-strip {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

.paper-strip a {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 6px;
	display: block;
	overflow: hidden;
	position: relative;
	transition: transform 140ms ease, border-color 140ms ease;
}

.paper-strip a:hover {
	border-color: var(--uopd);
	transform: translateY(-2px);
}

.paper-strip span {
	background: var(--surface);
	border-top: 1px solid var(--line);
	color: var(--ink-3);
	display: block;
	font-family: var(--mono);
	font-size: 10.5px;
	line-height: 1;
	padding: 5px 0;
	text-align: center;
}

/* ------------------------------------------------------------------ bibtex */

.bibtex {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	position: relative;
}

.bibtex pre {
	font-family: var(--mono);
	font-size: 13.5px;
	line-height: 1.6;
	margin: 0;
	overflow-x: auto;
	padding: 20px 22px;
}

.copy-btn {
	background: var(--surface-2);
	border: 1px solid var(--line-2);
	border-radius: 8px;
	color: var(--ink-2);
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	padding: 5px 10px;
	position: absolute;
	right: 12px;
	top: 12px;
}

/* ------------------------------------------------------------------ footer */

.footer {
	border-top: 1px solid var(--line);
	color: var(--ink-3);
	font-size: 14px;
	padding: 34px 0 44px;
}

.footer-inner p {
	margin: 0 0 4px;
	text-align: center;
}

/* ================================================================== widgets */

.widget {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	min-width: 0;
	padding: 18px 20px 18px;
	position: relative;
}

.w-controls {
	align-items: flex-end;
	display: flex;
	flex-wrap: wrap;
	gap: 12px 22px;
	margin-bottom: 14px;
}

.w-field {
	display: grid;
	gap: 6px;
	min-width: 0;
}

.w-field-grow {
	flex: 1 1 260px;
}

.w-label {
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: 0.01em;
}

.seg {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.seg button {
	background: var(--surface);
	border: 1px solid var(--line-2);
	border-radius: 999px;
	color: var(--ink-2);
	cursor: pointer;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.2;
	padding: 6px 12px;
}

.seg button:hover {
	border-color: var(--ink-3);
	color: var(--ink);
}

.seg button[aria-pressed="true"] {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--bg);
}

.seg button small {
	font-family: var(--mono);
	font-size: 11px;
	font-weight: 500;
	margin-left: 4px;
	opacity: 0.75;
}

.w-range {
	accent-color: var(--uopd);
	margin: 4px 0 0;
	width: 100%;
}

.w-readouts {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-bottom: 14px;
}

.w-readout {
	background: var(--surface-2);
	border-radius: var(--radius-sm);
	padding: 9px 12px;
}

.w-readout dt {
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 11.5px;
}

.w-readout dd {
	font-size: 19px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	margin: 2px 0 0;
}

.w-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}

.w-panel {
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	min-width: 0;
	padding: 12px 14px;
	position: relative;
}

.w-panel-title {
	font-size: 14px;
	font-weight: 700;
	margin: 0 0 8px;
}

.w-svg {
	min-width: 0;
	width: 100%;
}

.w-svg svg {
	display: block;
	overflow: visible;
}

.w-note {
	color: var(--ink-3);
	font-size: 13px;
	line-height: 1.5;
	margin: 12px 0 0;
}

.w-summary {
	border-top: 1px solid var(--line);
	color: var(--ink-2);
	font-size: 14.5px;
	margin: 12px 0 0;
	padding-top: 10px;
}

.w-summary strong {
	color: var(--ink);
}

.w-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
}

.w-legend li {
	align-items: center;
	color: var(--ink-2);
	display: inline-flex;
	font-size: 13px;
	gap: 7px;
}

.key {
	border-radius: 3px;
	display: inline-block;
	flex: 0 0 auto;
	height: 11px;
	width: 11px;
}

.key-dot {
	border-radius: 999px;
}

.key-line {
	border-radius: 2px;
	height: 3px;
	width: 16px;
}

.key-student { background: var(--student); }
.key-teacher { background: var(--teacher); }
.key-threshold { background: var(--threshold); }
.key-uopd { background: var(--uopd); }
.key-opd { background: var(--opd); }
.key-base { background: var(--base); }

.w-turns {
	display: grid;
	gap: 5px;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	margin-top: 8px;
}

.w-turn {
	background: var(--student-soft);
	border: 1px solid transparent;
	border-radius: 7px;
	color: var(--ink);
	cursor: pointer;
	font-family: var(--mono);
	font-size: 12.5px;
	min-height: 30px;
	padding: 0;
}

.w-turn.is-teacher {
	background: var(--teacher-soft);
}

.w-turn[aria-pressed="true"] {
	border-color: var(--ink);
	font-weight: 700;
}

.w-detail {
	background: var(--surface-2);
	border-radius: var(--radius-sm);
	padding: 12px 14px;
}

.w-detail h4 {
	font-family: var(--mono);
	font-size: 13px;
	margin: 0 0 6px;
}

.w-detail p {
	color: var(--ink-2);
	font-size: 14px;
	margin: 0 0 10px;
}

.branch {
	border: 1px solid var(--line);
	border-left: 3px solid var(--student);
	border-radius: 8px;
	margin-top: 8px;
	opacity: 0.5;
	padding: 7px 10px;
	transition: opacity 150ms ease;
}

.branch.is-teacher {
	border-left-color: var(--teacher);
}

.branch.is-active {
	background: var(--surface);
	opacity: 1;
}

.branch code {
	display: block;
	font-family: var(--mono);
	font-size: 12.5px;
	white-space: normal;
}

.branch span {
	color: var(--ink-3);
	font-size: 12.5px;
}

.w-tooltip {
	background: var(--ink);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	color: var(--bg);
	display: grid;
	font-size: 12.5px;
	gap: 1px;
	max-width: 240px;
	padding: 7px 10px;
	pointer-events: none;
	position: absolute;
	z-index: 10;
}

.w-tooltip[hidden] {
	display: none;
}

.w-tooltip strong {
	font-size: 14px;
}

.w-tooltip span {
	opacity: 0.8;
}

/* chart text */
.w-svg .grid { stroke: var(--grid); stroke-width: 1; }
.w-svg .axis { fill: var(--ink-3); font: 400 11px var(--mono); }
.w-svg .axis-cat { fill: var(--ink-2); font: 600 12px var(--sans); }
.w-svg .label { fill: var(--ink-2); font: 500 12.5px var(--sans); }
.w-svg .label-strong { fill: var(--ink); font: 700 12.5px var(--sans); }
.w-svg .value { fill: var(--ink-2); font: 500 11.5px var(--mono); }
.w-svg .value-strong { fill: var(--ink); font: 700 11.5px var(--mono); }
/* a surface-colored halo keeps labels legible where they cross grid or reference lines */
.w-svg .value,
.w-svg .value-strong,
.w-svg .ref-label,
.w-svg .label,
.w-svg .label-strong,
.w-svg .thr text { paint-order: stroke; stroke: var(--surface); stroke-width: 3.5px; stroke-linejoin: round; }
.w-svg .baseline { stroke: var(--line-2); stroke-width: 1; }
.w-svg .ref { stroke: var(--ink-2); stroke-width: 1; }
.w-svg .ref-soft { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.w-svg .ref-label { fill: var(--ink-3); font: 400 10.5px var(--mono); }
.w-svg .whisker { stroke: var(--ink); stroke-width: 1.2; }
.w-svg .hit { fill: transparent; }
.w-svg .mark { cursor: default; outline: none; }
.w-svg .mark:hover .bar,
.w-svg .mark:focus .bar { opacity: 0.82; }
.w-svg .mark:focus .hit { stroke: var(--focus); stroke-width: 1.5; }
.w-svg .fill-uopd { fill: var(--uopd); }
.w-svg .fill-opd { fill: var(--opd); }
.w-svg .fill-base { fill: var(--base); }
.w-svg .fill-teacher { fill: var(--teacher); }
.w-svg .fill-student { fill: var(--student); }
.w-svg .fill-muted { fill: color-mix(in srgb, var(--base) 55%, var(--surface)); }
.w-svg .trace { fill: none; stroke: var(--line-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.w-svg .thr line { stroke: var(--threshold); stroke-width: 2; }
.w-svg .thr text { fill: var(--ink); font: 500 11px var(--mono); }
.w-svg .dot { stroke: var(--surface); stroke-width: 2; }
.w-svg .curve { fill: none; stroke-width: 2.2; stroke-linecap: round; }
.w-svg .curve-opd { stroke: var(--opd); }
.w-svg .curve-sft { stroke: var(--uopd); }

/* tables */
.w-table-wrap {
	margin-top: 4px;
	overflow-x: auto;
}

.w-table {
	border-collapse: collapse;
	font-size: 14px;
	min-width: 640px;
	width: 100%;
}

.w-table caption {
	caption-side: top;
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 12px;
	padding: 0 0 8px;
	text-align: left;
}

.w-table th,
.w-table td {
	border-bottom: 1px solid var(--line);
	font-variant-numeric: tabular-nums;
	padding: 9px 10px;
	text-align: right;
	white-space: nowrap;
}

.w-table thead th {
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 12px;
	font-weight: 500;
	white-space: normal;
}

.w-table th[scope="row"],
.w-table thead th:first-child {
	text-align: left;
}

.w-table th[scope="row"] {
	font-weight: 600;
}

.w-table tr.is-uopd th,
.w-table tr.is-uopd td {
	background: var(--uopd-soft);
}

.w-table tr.is-ref th,
.w-table tr.is-ref td {
	color: var(--ink-3);
}

.w-table td.is-best {
	font-weight: 700;
}

.w-table tr.group th {
	text-align: left;
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 11.5px;
	font-weight: 500;
	letter-spacing: 0.05em;
	padding-top: 16px;
	text-transform: uppercase;
}

.w-table tr.is-selected th,
.w-table tr.is-selected td {
	background: var(--threshold-soft);
}

.w-table tbody tr[data-row] {
	cursor: pointer;
}

.delta {
	color: var(--ink-3);
	display: inline-block;
	font-family: var(--mono);
	font-size: 11.5px;
	margin-left: 6px;
	min-width: 44px;
	text-align: left;
}

.w-details {
	margin-top: 12px;
}

.w-details summary {
	color: var(--ink-2);
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
}

/* ================================================================== theater */

.theater {
	--th-surface: var(--surface);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 18px;
	box-shadow: var(--shadow);
	overflow: hidden;
}

.th-head {
	align-items: center;
	border-bottom: 1px solid var(--line);
	display: flex;
	flex-wrap: wrap;
	gap: 10px 18px;
	justify-content: space-between;
	padding: 14px 20px;
}

.th-task {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	min-width: 0;
}

.th-tag {
	background: var(--surface-2);
	border-radius: 999px;
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 11.5px;
	padding: 3px 9px;
}

.th-task strong {
	font-size: 15.5px;
}

.th-task strong span {
	color: var(--uopd);
}

.th-head .w-legend {
	margin: 0;
}

.th-lanes {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.th-lane {
	min-width: 0;
	padding: 16px 20px 18px;
}

.th-lane + .th-lane {
	border-left: 1px solid var(--line);
}

.th-lane-head {
	align-items: center;
	display: flex;
	gap: 10px;
	justify-content: space-between;
	margin-bottom: 10px;
}

.th-lane-name {
	align-items: center;
	display: flex;
	gap: 10px;
	min-width: 0;
}

.th-lane-name h3 {
	font-size: 18px;
	letter-spacing: -0.01em;
	margin: 0;
}

.th-lane-name p {
	color: var(--ink-3);
	font-size: 13px;
	line-height: 1.3;
	margin: 0;
}

.th-swatch {
	border-radius: 4px;
	flex: 0 0 auto;
	height: 30px;
	width: 6px;
}

.th-lane-opd .th-swatch { background: var(--opd); }
.th-lane-uopd .th-swatch { background: var(--uopd); }

.th-status {
	background: var(--surface-2);
	border-radius: 999px;
	color: var(--ink-2);
	flex: 0 0 auto;
	font-family: var(--mono);
	font-size: 12px;
	font-weight: 600;
	padding: 4px 10px;
	white-space: nowrap;
}

.th-status.is-success {
	background: var(--student-soft);
	color: var(--student);
}

.th-status.is-fail {
	background: var(--opd-soft);
	color: var(--opd);
}

.th-map {
	background: var(--surface-2);
	border-radius: 12px;
	margin-bottom: 12px;
	overflow: hidden;
	position: relative;
}

.th-map svg {
	display: block;
	height: auto;
	width: 100%;
}

.th-map .room { fill: var(--surface); stroke: var(--line-2); stroke-width: 1; }
.th-map .node rect { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.2; }
.th-map .node text { fill: var(--ink-2); font: 600 11px var(--sans); }
.th-map .start-dot { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1.5; }
.th-map .start-label { fill: var(--ink-3); font: 500 9.5px var(--mono); }
.th-map .node.is-current rect { stroke: var(--ink); stroke-width: 1.8; }
.th-map .node.is-target-teacher rect { stroke: var(--teacher); stroke-width: 2.2; }
.th-map .node.is-target-student rect { stroke: var(--student); stroke-width: 2.2; }
.th-map .trail { fill: none; stroke: var(--line-2); stroke-width: 2; stroke-linecap: round; }
.th-map .trail-back { fill: none; stroke: var(--opd); stroke-dasharray: 4 4; stroke-width: 2; stroke-linecap: round; }
.th-map .ghost { fill: none; stroke: var(--student); stroke-dasharray: 3 4; stroke-width: 1.8; opacity: 0.9; }
.th-map .agent-body { fill: var(--ink); stroke: var(--surface); stroke-width: 2.5; }
.th-map .mug { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.th-map .mug-clean { fill: var(--uopd); }
.th-map .mug-hot { fill: var(--opd); }
.th-map .map-badge rect { fill: var(--surface); stroke: var(--line-2); }
.th-map .map-badge text { fill: var(--ink-2); font: 600 10px var(--mono); }

.th-card {
	border: 1px solid var(--line);
	border-radius: 12px;
	display: grid;
	gap: 10px;
	min-height: 236px;
	padding: 12px 14px;
}

.th-row-label {
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 11px;
	letter-spacing: 0.04em;
	margin: 0 0 3px;
	text-transform: uppercase;
}

.th-action {
	align-items: center;
	border-radius: 8px;
	display: flex;
	font-family: var(--mono);
	font-size: 13.5px;
	gap: 8px;
	min-height: 34px;
	padding: 6px 10px;
}

.th-action::before {
	border-radius: 999px;
	content: "";
	flex: 0 0 auto;
	height: 9px;
	width: 9px;
}

.th-action-student {
	background: var(--student-soft);
}

.th-action-student::before {
	background: var(--student);
}

.th-action-teacher {
	background: var(--teacher-soft);
}

.th-action-teacher::before {
	background: var(--teacher);
}

.th-action.is-struck .th-action-text {
	color: var(--ink-3);
	text-decoration: line-through;
	text-decoration-color: var(--opd);
	text-decoration-thickness: 2px;
}

.th-action-text {
	min-width: 0;
	overflow-wrap: anywhere;
}

.th-meter {
	align-items: center;
	display: grid;
	gap: 10px;
	grid-template-columns: minmax(0, 1fr) auto;
}

.th-meter-track {
	background: var(--surface-2);
	border-radius: 999px;
	height: 12px;
	overflow: visible;
	position: relative;
}

.th-meter-fill {
	background: var(--student);
	border-radius: 999px;
	height: 100%;
	left: 0;
	position: absolute;
	top: 0;
	transition: background-color 120ms linear;
	width: 0;
}

.th-meter-fill.is-high {
	background: var(--teacher);
}

.th-meter-tau {
	background: var(--threshold);
	border-radius: 2px;
	height: 22px;
	position: absolute;
	top: -5px;
	width: 3px;
}

.th-meter-value {
	color: var(--ink-2);
	font-family: var(--mono);
	font-size: 12.5px;
	min-width: 132px;
	text-align: right;
	white-space: nowrap;
}

.th-decision {
	align-items: center;
	border-radius: 8px;
	display: flex;
	flex-wrap: wrap;
	font-size: 13.5px;
	gap: 6px 10px;
	min-height: 34px;
	padding: 6px 10px;
}

.th-decision.is-empty {
	background: transparent;
	border: 1px dashed var(--line-2);
	color: var(--ink-3);
}

.th-decision.is-student {
	background: var(--student-soft);
}

.th-decision.is-teacher {
	background: var(--teacher-soft);
}

.th-decision.is-warn {
	background: var(--opd-soft);
}

.th-loss {
	border-radius: 999px;
	font-family: var(--mono);
	font-size: 11.5px;
	font-weight: 600;
	padding: 2px 8px;
	white-space: nowrap;
}

.th-loss-rkl {
	background: var(--surface);
	border: 1px solid var(--student);
	color: var(--student);
}

.th-loss-sft {
	background: var(--surface);
	border: 1px solid var(--teacher);
	color: var(--teacher);
}

.th-obs {
	color: var(--ink-2);
	font-size: 13.5px;
	font-style: italic;
	line-height: 1.45;
	min-height: 40px;
}

.th-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 12px;
	min-height: 28px;
}

.th-chip {
	align-items: center;
	background: var(--surface-2);
	border: 1px solid transparent;
	border-radius: 7px;
	color: var(--ink-2);
	cursor: pointer;
	display: inline-flex;
	font-family: var(--mono);
	font-size: 11.5px;
	gap: 5px;
	height: 26px;
	padding: 0 8px;
}

.th-chip::before {
	border-radius: 999px;
	content: "";
	height: 7px;
	width: 7px;
}

.th-chip.is-student::before { background: var(--student); }
.th-chip.is-teacher::before { background: var(--teacher); }
.th-chip.is-back { border-color: var(--opd); }
.th-chip.is-current { border-color: var(--ink); color: var(--ink); }
.th-chip.is-ff { cursor: default; }
.th-chip.is-ff::before { background: var(--opd); }

.th-narration {
	background: var(--bg-alt);
	border-top: 1px solid var(--line);
	color: var(--ink-2);
	font-size: 14.5px;
	line-height: 1.5;
	min-height: 64px;
	padding: 12px 20px;
}

.th-narration strong {
	color: var(--ink);
}

.th-transport {
	align-items: center;
	border-top: 1px solid var(--line);
	display: grid;
	gap: 12px;
	grid-template-columns: auto minmax(0, 1fr) auto;
	padding: 12px 20px 14px;
}

.th-buttons {
	display: flex;
	gap: 6px;
}

.th-btn {
	align-items: center;
	background: var(--surface);
	border: 1px solid var(--line-2);
	border-radius: 999px;
	color: var(--ink);
	cursor: pointer;
	display: inline-flex;
	height: 36px;
	justify-content: center;
	width: 36px;
}

.th-btn svg {
	fill: currentColor;
	height: 16px;
	width: 16px;
}

.th-btn-play {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--bg);
	width: 44px;
}

.th-scrub {
	min-width: 0;
	position: relative;
}

.th-scrub input {
	accent-color: var(--uopd);
	display: block;
	margin: 0;
	width: 100%;
}

.th-ticks {
	display: flex;
	justify-content: space-between;
	margin-top: 2px;
	pointer-events: none;
}

.th-ticks span {
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 10px;
	text-align: center;
	width: 0;
}

.th-ticks span b {
	display: inline-block;
	font-weight: 500;
	transform: translateX(-50%);
	white-space: nowrap;
}

.th-speed {
	align-items: center;
	display: flex;
	gap: 8px;
}

.th-speed .seg button {
	padding: 5px 9px;
}

/* ================================================================== responsive */

@media (max-width: 1020px) {
	.stat-grid,
	.insight-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.w-grid,
	.split {
		grid-template-columns: minmax(0, 1fr);
	}

	.grid-2 {
		gap: 0;
		grid-template-columns: minmax(0, 1fr);
	}

	.th-lanes {
		grid-template-columns: minmax(0, 1fr);
	}

	.th-lane + .th-lane {
		border-left: 0;
		border-top: 1px solid var(--line);
	}

	.paper-block {
		grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
		gap: 24px;
	}
}

@media (max-width: 760px) {
	body {
		font-size: 16px;
	}

	.container {
		padding: 0 16px;
	}

	.hero {
		padding: 64px 0 40px;
	}

	.section {
		padding: 60px 0;
	}

	.steps,
	.equation-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.figure-row-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.figure-row-2 {
		grid-template-columns: minmax(0, 1fr);
	}

	.w-readouts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.paper-block {
		grid-template-columns: minmax(0, 1fr);
	}

	.paper-cover {
		margin: 0 auto;
		max-width: 300px;
	}

	.paper-strip {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.th-head,
	.th-lane,
	.th-narration,
	.th-transport {
		padding-left: 14px;
		padding-right: 14px;
	}

	.th-transport {
		grid-template-columns: minmax(0, 1fr);
	}

	.th-map .node text {
		font-size: 12.5px;
	}

	.th-buttons,
	.th-speed {
		justify-content: center;
	}

	.w-turns {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.widget {
		padding: 14px;
	}

	.container-text > p {
		text-align: left;
	}
}

@media (max-width: 480px) {
	.stat-grid,
	.insight-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.th-meter {
		grid-template-columns: minmax(0, 1fr);
	}

	.th-meter-value {
		min-width: 0;
		text-align: left;
	}

	.authors {
		font-size: 16px;
		gap: 4px 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition: none !important;
	}
}

@media print {
	.topnav,
	.th-transport,
	.lightbox {
		display: none !important;
	}
}

/* ================================================================== interactive Figure 1 */

.section-teaser {
	padding: 8px 0 56px;
}

.figure1 {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 18px;
	box-shadow: var(--shadow);
	overflow: hidden;
}

.f1-head-row {
	align-items: center;
	border-bottom: 1px solid var(--line);
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	justify-content: space-between;
	padding: 12px 18px;
}

.f1-title {
	align-items: baseline;
	display: flex;
	gap: 10px;
}

.f1-kicker {
	color: var(--uopd);
	font-family: var(--mono);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.f1-title strong {
	font-size: 16px;
}

.f1-tabs {
	background: var(--surface-2);
	border-radius: 999px;
	display: inline-flex;
	gap: 2px;
	padding: 3px;
}

.f1-tab {
	background: transparent;
	border: 0;
	border-radius: 999px;
	color: var(--ink-2);
	cursor: pointer;
	font-size: 13.5px;
	font-weight: 600;
	padding: 6px 14px;
}

.f1-tab[aria-selected="true"] {
	background: var(--surface);
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
	color: var(--ink);
}

.f1-paper .figure-zoom {
	padding: 22px;
}

.f1-bar {
	align-items: center;
	border-bottom: 1px solid var(--line);
	display: flex;
	flex-wrap: wrap;
	gap: 10px 20px;
	justify-content: space-between;
	padding: 10px 18px;
}

.f1-buttons {
	align-items: center;
	display: flex;
	gap: 8px;
}

.f1-buttons .seg {
	margin-left: 6px;
}

.f1-legend {
	margin: 0;
}

.f1-lane {
	padding: 12px 18px 6px;
}

.f1-lane + .f1-lane {
	border-top: 1px dashed var(--line-2);
}

.f1-lane-head {
	align-items: center;
	display: flex;
	gap: 10px;
	justify-content: space-between;
	margin-bottom: 4px;
}

.f1-lane-name {
	align-items: center;
	display: flex;
	gap: 10px;
}

.f1-lane-name h3 {
	font-size: 16px;
	margin: 0;
}

.f1-lane-name p {
	color: var(--ink-3);
	font-size: 13px;
	margin: 0;
}

.f1-lane-opd .th-swatch { background: var(--opd); height: 26px; }
.f1-lane-uopd .th-swatch { background: var(--uopd); height: 26px; }

.f1-row {
	align-items: center;
	display: grid;
	gap: 8px 22px;
	grid-template-columns: minmax(0, 600fr) minmax(0, 520fr);
}

.f1-svg svg {
	display: block;
	height: auto;
	overflow: visible;
	width: 100%;
}

/* svg typography */
.f1-svg text { font-family: var(--sans); }
.f1-svg .f1-label { fill: var(--ink-2); font-size: 14px; font-weight: 600; }
.f1-svg .f1-label-strong { fill: var(--ink); font-size: 15px; font-weight: 700; }
.f1-svg .f1-note { fill: var(--ink-3); font-size: 13px; font-style: italic; }
.f1-svg .f1-note-teacher { fill: var(--teacher); font-style: normal; font-weight: 600; }
.f1-svg .f1-math { fill: var(--ink); font: 500 15.5px "Times New Roman", "STIX Two Math", serif; }
.f1-svg .f1-math-small { font-size: 14.5px; }
.f1-svg .mi { font-style: italic; }
.f1-svg .msub { font-size: 10.5px; font-style: normal; }
.f1-svg .f1-roll-title { font-size: 15px; font-weight: 700; }
.f1-svg .f1-roll-title-bad { fill: var(--opd); }
.f1-svg .f1-roll-title-good { fill: var(--uopd); }
.f1-svg .f1-outcome { fill: var(--ink-3); font-size: 15px; font-weight: 700; }
.f1-svg .f1-outcome.is-good { fill: var(--student); }
.f1-svg .f1-outcome.is-bad { fill: var(--opd); }
.f1-svg .f1-kl { font-size: 13.5px; font-weight: 700; }
.f1-svg .f1-kl-rev { fill: var(--student); }
.f1-svg .f1-kl-fwd { fill: var(--teacher); }
.f1-svg .f1-badge-text { fill: #ffffff; font: 700 12px var(--mono); }

/* edges */
.f1-edge { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; transition: opacity 160ms ease; }
.f1-edge-student { stroke: var(--student); }
.f1-edge-teacher { stroke: var(--teacher); }
.f1-edge-obs { stroke: var(--base); }
.f1-edge-dashed { stroke: var(--ink-3); stroke-dasharray: 4 4; stroke-width: 1.5; }
.f1-edge.is-dim,
.f1-branch.is-dim { opacity: 0.22; }
.f1-branch { transition: opacity 160ms ease; }
.f1-arrowhead { stroke: none; }
.f1-ah-ink { fill: var(--ink-2); }
.f1-ah-student { fill: var(--student); }
.f1-ah-teacher { fill: var(--teacher); }
.f1-ah-obs { fill: var(--base); }
.f1-ah-muted { fill: var(--ink-3); }

/* nodes */
.f1-node-circle { fill: var(--surface); stroke-width: 2; }
.f1-node-student .f1-node-circle { stroke: var(--student); }
.f1-node-teacher .f1-node-circle { stroke: var(--teacher); }
.f1-node-obs .f1-node-circle { stroke: var(--base); }
.f1-node-error .f1-node-circle { fill: var(--opd-soft); stroke: var(--opd); stroke-width: 2.6; }
.f1-robot .f1-head { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.6; }
.f1-robot .f1-stroke { stroke: var(--ink-2); stroke-width: 1.6; }
.f1-robot-student .f1-screen { fill: var(--student-soft); }
.f1-robot-student .f1-accent { fill: var(--student); }
.f1-robot-teacher .f1-screen { fill: var(--teacher-soft); }
.f1-robot-teacher .f1-accent { fill: var(--teacher); }
.f1-star { fill: #e6a817; }
.f1-globe-body { fill: var(--uopd-soft); stroke: var(--ink-2); stroke-width: 1.6; }
.f1-globe-line { fill: none; stroke: var(--ink-3); stroke-width: 1.1; }
.f1-db-body { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.5; }
.f1-db-line { fill: none; stroke: var(--ink-3); stroke-width: 1.1; }
.f1-diamond { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.8; transition: fill 160ms ease, stroke 160ms ease; }
.f1-diamond.is-teacher { fill: var(--teacher-soft); stroke: var(--teacher); }
.f1-diamond.is-student { fill: var(--student-soft); stroke: var(--student); }
.f1-badge.is-teacher { fill: var(--teacher); }
.f1-badge.is-student { fill: var(--student); }
.f1-roll { stroke-width: 1.2; }
.f1-roll-bad { fill: var(--opd-soft); stroke: color-mix(in srgb, var(--opd) 40%, transparent); }
.f1-roll-good { fill: var(--uopd-soft); stroke: color-mix(in srgb, var(--uopd) 40%, transparent); }
.f1-dist-bg { fill: var(--surface-2); stroke: transparent; stroke-width: 1.5; transition: fill 160ms ease, stroke 160ms ease; }
.f1-dist.is-active .f1-dist-bg { fill: var(--surface); stroke: var(--ink-2); }

/* motion; decorative overlays let the pointer reach the component underneath */
.f1-chips, .f1-outcome, .f1-packet, .f1-badge, .f1-badge-text { pointer-events: none; }
.f1-packet-dot { stroke: var(--surface); stroke-width: 2; }
.f1-packet-glow { opacity: 0.22; }
.f1-packet-student .f1-packet-dot, .f1-packet-student .f1-packet-glow { fill: var(--student); }
.f1-packet-teacher .f1-packet-dot, .f1-packet-teacher .f1-packet-glow { fill: var(--teacher); }
.f1-packet-obs .f1-packet-dot, .f1-packet-obs .f1-packet-glow { fill: var(--base); }
.f1-packet-error .f1-packet-dot, .f1-packet-error .f1-packet-glow { fill: var(--opd); }
.f1-hot { cursor: pointer; outline: none; }
.f1-hot.is-hover .f1-node-circle,
.f1-hot.is-hover .f1-head,
.f1-hot.is-hover .f1-globe-body,
.f1-hot.is-hover .f1-db-body,
.f1-hot.is-hover .f1-diamond,
.f1-hot.is-hover .f1-roll,
.f1-hot.is-hover .f1-dist-bg { stroke: var(--focus); stroke-width: 2.6; }
.f1-hot:focus-visible { outline: none; }
.is-pulse .f1-head,
.is-pulse .f1-globe-body { stroke: var(--threshold); stroke-width: 2.6; }

/* bottom: threshold chart + explanation */
.f1-bottom {
	border-top: 1px solid var(--line);
	display: grid;
	gap: 16px;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	padding: 14px 18px 18px;
}

.f1-thr {
	padding-bottom: 10px;
}

.f1-thr-note {
	margin-top: 6px;
}

.f1-tau { cursor: ns-resize; outline: none; }
.f1-tau-line { stroke: var(--threshold); stroke-width: 2.4; }
.f1-tau-knob { fill: var(--threshold); }
.f1-tau-text { fill: #ffffff; font: 700 11.5px var(--mono); }
.f1-tau:focus-visible .f1-tau-knob { stroke: var(--focus); stroke-width: 2.5; }

.f1-info {
	background: var(--surface-2);
	border-radius: var(--radius-sm);
	min-height: 200px;
	padding: 14px 16px;
}

.f1-info-kicker {
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 11.5px;
	letter-spacing: 0.04em;
	margin: 0 0 4px;
	text-transform: uppercase;
}

.f1-info h4 {
	font-size: 16px;
	line-height: 1.35;
	margin: 0 0 6px;
}

.f1-info p {
	color: var(--ink-2);
	font-size: 14.5px;
	line-height: 1.55;
	margin: 0;
}

.f1-caption {
	border-top: 1px solid var(--line);
	color: var(--ink-2);
	font-size: 14.5px;
	line-height: 1.6;
	margin: 0;
	padding: 14px 18px 16px;
}

.f1-caption strong {
	color: var(--ink);
}

@media (max-width: 1020px) {
	.f1-row {
		grid-template-columns: minmax(0, 1fr);
	}

	.f1-svg-out {
		margin: 0 auto;
		max-width: 560px;
		width: 100%;
	}

	.f1-bottom {
		grid-template-columns: minmax(0, 1fr);
	}

	.f1-info {
		min-height: 0;
	}
}

@media (max-width: 760px) {
	.f1-head-row,
	.f1-bar,
	.f1-lane,
	.f1-bottom,
	.f1-caption {
		padding-left: 12px;
		padding-right: 12px;
	}
}
.f1-obs-dot { fill: var(--base); }

/* phones: keep diagram text legible (about 11-12 px) and let wide diagrams scroll sideways */
.f1-swipe {
	display: none;
}

@media (max-width: 620px) {
	.f1-swipe {
		color: var(--ink-3);
		display: block;
		font-size: 12.5px;
		margin: 0;
		padding: 8px 12px 0;
	}

	.f1-svg {
		-webkit-overflow-scrolling: touch;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		padding-bottom: 6px;
		scrollbar-width: thin;
	}

	.f1-svg-pipe svg {
		min-width: 480px;
	}

	.f1-svg-out svg {
		min-width: 440px;
	}

	.f1-svg-out {
		max-width: none;
	}
}
