/* Compare page (compare.html): the static comparison first (network chart, side-by-side table, why switch), then the
   live run that compare.js drives. Builds on site.css tokens and components; no inline styles (CSP). */

.page-compare {
	/* the live-run stage is a fixed neutral dark viewer in both themes; compare.js clears the canvas to the same
	   colour (scene background and the empty quad: 0x161618) */
	--stage: #161618;
	--stage-ink: rgb(255 255 255 / 0.5);
	--stage-ink-strong: rgb(255 255 255 / 0.82);
	--stage-chip: rgb(10 10 11 / 0.62);
	--ours-1-soft: color-mix(in oklab, var(--accent) 8%, transparent);
	--ours-2: #10b981;
	--ours-2-ink: color-mix(in oklab, #10b981 78%, var(--text));
	--ours-2-soft: color-mix(in oklab, #10b981 8%, transparent);
}

.page-compare .page-head h1 { max-width: none; }

/* --- 1. visual overview: quadrant scatter + network curve + 2x2 mini bar charts --------------------------------- */

.cmp-viz-top {
	display: grid;
	grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
	gap: 18px;
}

.cmp-viz-card,
.cmp-mini-chart {
	margin: 0;
	padding: clamp(18px, 2.2vw, 24px);
	border: 1px solid var(--line-2);
	border-radius: var(--radius-l);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.cmp-viz-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 12px;
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--line);
}

.cmp-viz-head strong {
	color: var(--text);
	font-size: 0.98rem;
	font-weight: 650;
	letter-spacing: -0.015em;
}

.cmp-viz-head span {
	color: var(--text-3);
	font: 500 11.5px/1.2 var(--font-mono);
}

.viz-svg {
	width: 100%;
	height: auto;
	overflow: visible;
	font-family: var(--font-sans);
	font-variant-numeric: tabular-nums;
}

.viz-axis { stroke: var(--line-2); stroke-width: 1.25; }
.viz-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }

.viz-zone {
	fill: var(--ours-2-soft);
	stroke: color-mix(in oklab, var(--ours-2) 45%, transparent);
	stroke-width: 1.25;
	stroke-dasharray: 4 3;
}

.viz-zone-tag {
	fill: var(--ours-2-ink);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
}

.viz-tick {
	fill: var(--text-3);
	font-family: var(--font-mono);
	font-size: 10.5px;
}

.viz-ax-title {
	fill: var(--text-2);
	font-size: 11px;
	font-weight: 600;
}

.viz-range { stroke-width: 4; stroke-linecap: round; stroke-opacity: 0.36; }
.viz-range.is-ours-1 { stroke: var(--accent); }
.viz-range.is-ours-2 { stroke: var(--ours-2); }
.viz-range.is-them { stroke: var(--them); }

.viz-lead { stroke: var(--line-2); stroke-width: 1.25; }
.viz-lead.is-ours-1 { stroke: color-mix(in oklab, var(--accent) 55%, transparent); }
.viz-lead.is-ours-2 { stroke: color-mix(in oklab, var(--ours-2) 55%, transparent); }

.viz-dot { stroke: var(--surface); stroke-width: 2; }
.viz-dot.is-ours-1 { fill: var(--accent); }
.viz-dot.is-ours-2 { fill: var(--ours-2); }
.viz-dot.is-them { fill: var(--them); }
.viz-dot.is-bad { fill: var(--err); }

.viz-lbl {
	fill: var(--text-2);
	font-size: 12px;
	font-weight: 600;
}

.viz-lbl.is-ours-1 { fill: var(--accent-strong); font-weight: 700; }
.viz-lbl.is-ours-2 { fill: var(--ours-2-ink); font-weight: 700; }
.viz-lbl.is-bad { fill: var(--err); font-weight: 650; }
.viz-lbl.is-them { fill: var(--text-2); }

@media (prefers-color-scheme: light) {
	.viz-lbl.is-ours-1 { fill: var(--accent); }
}

.viz-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.viz-line.is-ours-2 { stroke: var(--ours-2); stroke-width: 3; }
.viz-line.is-ours-1 { stroke: var(--accent); stroke-width: 2.5; }
.viz-line.is-them { stroke: var(--them); stroke-width: 1.8; }
.viz-line.is-bad { stroke: var(--err); stroke-width: 2; stroke-dasharray: 5 4; }

.cmp-viz-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin-top: 18px;
}

.mini-bars {
	display: grid;
	gap: 11px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mini-row {
	display: grid;
	grid-template-columns: minmax(110px, 0.95fr) minmax(0, 1.3fr) auto;
	align-items: center;
	gap: 12px;
	font-size: 13px;
}

.mini-name {
	color: var(--text-2);
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mini-row.is-ours-1 .mini-name,
.mini-row.is-ours-2 .mini-name { color: var(--text); font-weight: 650; }

.mini-val {
	color: var(--text-2);
	font: 600 12.5px/1 var(--font-mono);
	font-variant-numeric: tabular-nums;
	text-align: right;
	white-space: nowrap;
}

.mini-row.is-ours-1 .mini-val { color: var(--accent); }
.mini-row.is-ours-2 .mini-val { color: var(--ours-2-ink); }
.mini-row.is-bad .mini-val { color: var(--err); }

.mini-track {
	position: relative;
	display: flex;
	height: 9px;
	border-radius: 999px;
	background: var(--surface-3);
	overflow: hidden;
}

.mini-fill,
.mini-range,
.mini-seg {
	display: block;
	height: 100%;
	border-radius: 999px;
}

.mini-range {
	position: absolute;
	inset: 0 auto 0 0;
	opacity: 0.28;
}

.mini-range.is-vram-uft { width: 25.06%; background: var(--ours-2); }
.mini-range.is-vram-spark { width: 25.06%; background: var(--them); }

.mini-fill { background: var(--them); min-width: 6px; }
.mini-fill.is-zero { min-width: 0; width: 0; }
.mini-fill.is-ours-1 { background: var(--accent); }
.mini-fill.is-ours-2 { background: var(--ours-2); }
.mini-fill.is-bad { background: var(--err); }

.mini-fill.is-dl-rcd { width: 24.71%; }
.mini-fill.is-dl-img { width: 20.69%; }
.mini-fill.is-dl-webp { width: 32.15%; }
.mini-fill.is-dl-ktx2 { width: 100%; }

.mini-fill.is-vram-uft { width: 6.26%; }
.mini-fill.is-vram-spark { width: 12.53%; }
.mini-fill.is-vram-ktx2 { width: 25.06%; }
.mini-fill.is-vram-rgba8 { width: 100%; }

.mini-fill.is-psnr-rcd { width: 91.43%; }
.mini-fill.is-psnr-img { width: 88.57%; }
.mini-fill.is-psnr-ktx2 { width: 77.14%; }
.mini-fill.is-psnr-spark { width: 25.71%; }

.mini-fill.is-bun-img { width: 26.62%; }
.mini-fill.is-bun-rcd { width: 30.88%; }
.mini-fill.is-bun-spark { width: 35.01%; }

.mini-seg.is-js { width: 13.12%; border-radius: 999px 0 0 999px; background: var(--them); }
.mini-seg.is-wasm { width: 86.88%; border-radius: 0 999px 999px 0; background: var(--err); }

@media (max-width: 920px) {
	.cmp-viz-top { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
	.cmp-viz-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
	.mini-row {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 4px 10px;
	}
	.mini-track { grid-column: 1 / -1; }
}

/* --- network chart + headline ratios ----------------------------------------------------------------------------- */

.cmp-size-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
	gap: clamp(32px, 5vw, 72px);
	align-items: center;
}

.cmp-chart {
	margin: 0;
	padding: clamp(22px, 3vw, 36px);
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.cmp-chart-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 6px 20px;
	margin-bottom: clamp(24px, 3vw, 32px);
	padding-bottom: 16px;
	border-bottom: 1px solid var(--line);
}

.cmp-chart-head h2 {
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.cmp-chart-head .subtle { font-family: var(--font-mono); font-size: 12px; }

.cmp-bars {
	display: grid;
	gap: 15px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cmp-row-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 6px;
}

.cmp-name {
	color: var(--text-2);
	font-size: 14.5px;
	font-weight: 500;
}

.cmp-row.ours .cmp-name { color: var(--text); font-weight: 600; }

.cmp-value {
	flex: none;
	color: var(--text-2);
	font-size: clamp(1.15rem, 1rem + 0.55vw, 1.45rem);
	font-weight: 650;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.025em;
	line-height: 1;
	white-space: nowrap;
}

.cmp-row.ours .cmp-value { color: var(--text); }
.cmp-row.ours-2 .cmp-value { color: var(--ours-2-ink); }
.cmp-row.ours-2 .cmp-fill { background: var(--ours-2); }

.cmp-track {
	height: 9px;
	border-radius: 999px;
	background: var(--surface-3);
	overflow: hidden;
}

/* network connection speed tabs (pure CSS, CSP-safe) */
.cmp-net-tabs > input[type='radio'] {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.cmp-net-bar {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	max-inline-size: 100%;
	gap: 4px;
	margin-bottom: 22px;
	padding: 4px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface-2);
	scrollbar-width: none;
}

.cmp-net-bar::-webkit-scrollbar { display: none; }

.cmp-net-bar label {
	position: relative;
	flex: 1 0 auto;
	padding: 7px 12px;
	border-radius: 7px;
	color: var(--text-2);
	font-size: 12.5px;
	font-weight: 550;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.cmp-net-bar label:hover { color: var(--text); }

#net-4g:checked ~ .cmp-net-bar label[for='net-4g'],
#net-4gp:checked ~ .cmp-net-bar label[for='net-4gp'],
#net-wifi:checked ~ .cmp-net-bar label[for='net-wifi'],
#net-gbps:checked ~ .cmp-net-bar label[for='net-gbps'],
#net-warm:checked ~ .cmp-net-bar label[for='net-warm'] {
	background: var(--bg);
	color: var(--text);
	box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgb(0 0 0 / 0.12);
}

#net-4g:checked ~ .cmp-net-bar label[for='net-4g']::after,
#net-4gp:checked ~ .cmp-net-bar label[for='net-4gp']::after,
#net-wifi:checked ~ .cmp-net-bar label[for='net-wifi']::after,
#net-gbps:checked ~ .cmp-net-bar label[for='net-gbps']::after,
#net-warm:checked ~ .cmp-net-bar label[for='net-warm']::after {
	content: '';
	position: absolute;
	inset-inline: 10px;
	inset-block-end: 0;
	border-block-end: 2px solid var(--accent);
}

#net-4g:focus-visible ~ .cmp-net-bar label[for='net-4g'],
#net-4gp:focus-visible ~ .cmp-net-bar label[for='net-4gp'],
#net-wifi:focus-visible ~ .cmp-net-bar label[for='net-wifi'],
#net-gbps:focus-visible ~ .cmp-net-bar label[for='net-gbps'],
#net-warm:focus-visible ~ .cmp-net-bar label[for='net-warm'] {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
}

.cmp-net-panel { display: none; }
#net-4g:checked ~ .cmp-net-panel[data-net='4g'],
#net-4gp:checked ~ .cmp-net-panel[data-net='4gp'],
#net-wifi:checked ~ .cmp-net-panel[data-net='wifi'],
#net-gbps:checked ~ .cmp-net-panel[data-net='gbps'],
#net-warm:checked ~ .cmp-net-panel[data-net='warm'] { display: grid; }

.cmp-fill {
	display: block;
	width: var(--w, 0%);
	height: 100%;
	border-radius: inherit;
	background: var(--them);
	transform-origin: left center;
	animation: cmp-grow 0.65s var(--ease) both;
}

/* 4-Map PBR Material + Full Mipmaps (4.72 MP) bar widths: each arm / slowest arm of that tab (2026-11-16, bench/delivery/run-pbr-race.mjs) */
.cmp-fill.is-rcd1-4g { --w: 25.82%; min-width: 10px; background: var(--ours); }
.cmp-fill.is-avif-4g { --w: 22.09%; min-width: 10px; background: var(--ours); }
.cmp-fill.is-spark-4g { --w: 33.07%; }
.cmp-fill.is-rgba8-4g { --w: 34.54%; }
.cmp-fill.is-ktx2-4g { --w: 100%; }

.cmp-fill.is-rcd1-4gp { --w: 26.34%; min-width: 10px; background: var(--ours); }
.cmp-fill.is-avif-4gp { --w: 23.16%; min-width: 10px; background: var(--ours); }
.cmp-fill.is-spark-4gp { --w: 33.52%; }
.cmp-fill.is-rgba8-4gp { --w: 36.99%; }
.cmp-fill.is-ktx2-4gp { --w: 100%; }

.cmp-fill.is-rcd1-wifi { --w: 28.07%; min-width: 10px; background: var(--ours); }
.cmp-fill.is-avif-wifi { --w: 27.64%; min-width: 10px; background: var(--ours); }
.cmp-fill.is-spark-wifi { --w: 34.81%; }
.cmp-fill.is-rgba8-wifi { --w: 51.31%; }
.cmp-fill.is-ktx2-wifi { --w: 100%; }

.cmp-fill.is-rcd1-gbps { --w: 24.67%; min-width: 10px; background: var(--ours); }
.cmp-fill.is-avif-gbps { --w: 33.91%; min-width: 10px; background: var(--ours); }
.cmp-fill.is-spark-gbps { --w: 42.02%; }
.cmp-fill.is-ktx2-gbps { --w: 71.39%; }
.cmp-fill.is-rgba8-gbps { --w: 100%; }

.cmp-fill.is-rcd1-warm { --w: 23.11%; min-width: 10px; background: var(--ours); }
.cmp-fill.is-avif-warm { --w: 31.22%; min-width: 10px; background: var(--ours); }
.cmp-fill.is-ktx2-warm { --w: 40.08%; }
.cmp-fill.is-spark-warm { --w: 45.00%; }
.cmp-fill.is-rgba8-warm { --w: 100%; }

@keyframes cmp-grow {
	from { transform: scaleX(0); }
}

.cmp-name code { font-size: 0.86em; }

/* how the chart was measured, under the bars */
.cmp-chart-foot {
	margin-top: clamp(24px, 3vw, 32px);
	padding-top: 16px;
	border-top: 1px solid var(--line);
	color: var(--text-3);
	font-size: 12.5px;
	line-height: 1.6;
}

.cmp-chart-foot em { color: var(--text-2); font-style: normal; }

.cmp-stats {
	display: grid;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cmp-stats li {
	display: grid;
	gap: 6px;
	padding-block: clamp(18px, 2.4vw, 26px);
	border-top: 1px solid var(--line);
}

.cmp-stats li:first-child { padding-top: 0; border-top: 0; }
.cmp-stats li:last-child { padding-bottom: 0; }

.cmp-big {
	color: var(--text);
	font-size: clamp(2.4rem, 1.7rem + 2.2vw, 3.5rem);
	font-weight: 650;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.04em;
	line-height: 1;
}

.cmp-stat-text {
	max-width: 34ch;
	color: var(--text-2);
	font-size: 15px;
	line-height: 1.5;
}

.cmp-stat-text strong { color: var(--text); font-weight: 600; }
.cmp-stat-text code { white-space: nowrap; }

@media (max-width: 960px) {
	.cmp-size-grid { grid-template-columns: minmax(0, 1fr); }
	.cmp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
	.cmp-stats li,
	.cmp-stats li:first-child { padding: 18px 0 0; border-top: 1px solid var(--line); }
}

@media (max-width: 620px) {
	.cmp-stats { grid-template-columns: minmax(0, 1fr); gap: 0; }

	.cmp-stats li,
	.cmp-stats li:first-child {
		grid-template-columns: 6.25rem minmax(0, 1fr);
		align-items: center;
		gap: 16px;
		padding-block: 16px;
	}

	.cmp-stats li:first-child { border-top: 0; }
	.cmp-big { font-size: 1.95rem; white-space: nowrap; }
	.cmp-stat-text { font-size: 14px; }
	/* every row the same rhythm: name, then the value under it */
	.cmp-row-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* --- side-by-side tables (responsive-table: container queries + sticky headers) ---------------------------------- */

.cmp-chart-wide { max-width: 880px; }
.cmp-chart-label {
	color: var(--text);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.cmp-subhead { margin-top: clamp(44px, 5.5vw, 68px); }

.cmp-callout {
	max-width: 88ch;
	margin-top: 16px;
	padding: 13px 18px;
	border: 1px solid var(--line);
	border-inline-start: 3px solid var(--accent);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text-2);
	font-size: 13.5px;
	line-height: 1.55;
}

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

.cmp-table-wrap {
	overflow: auto;
	max-inline-size: 100%;
	container-type: inline-size;
	border: 1px solid var(--line-2);
	border-radius: var(--radius-l);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.cmp-table {
	width: 100%;
	min-width: 840px;
	border-collapse: separate;
	border-spacing: 0;
	table-layout: fixed;
	font-size: 13.5px;
	font-variant-numeric: tabular-nums;
	--ours-1-bg: color-mix(in oklab, var(--accent) 6.5%, var(--surface));
	--ours-1-head: color-mix(in oklab, var(--accent) 13%, var(--surface));
	--ours-1-line: color-mix(in oklab, var(--accent) 28%, var(--line));
	--ours-2-bg: color-mix(in oklab, #10b981 7%, var(--surface));
	--ours-2-head: color-mix(in oklab, #10b981 13%, var(--surface));
	--ours-2-line: color-mix(in oklab, #10b981 30%, var(--line));
	--label-2: 'UltraTexture · Images';
	--label-3: 'UltraTexture · .rcd';
	--label-4: 'KTX2Loader';
	--label-5: 'spark.js';
	--label-6: 'TextureLoader';
}

.cmp-table col.col-metric { width: 17%; }
.cmp-table col.col-ours { width: 18%; }
.cmp-table col.col-them { width: 15.667%; }

.cmp-table thead {
	position: sticky;
	inset-block-start: 0;
	z-index: 2;
}

.cmp-table thead th {
	padding: 15px 16px;
	border-bottom: 1px solid var(--line-2);
	border-right: 1px solid var(--line);
	background: var(--surface-2);
	color: var(--text-2);
	font-size: 13.5px;
	font-weight: 650;
	letter-spacing: -0.015em;
	line-height: 1.25;
	vertical-align: middle;
	text-align: left;
	white-space: nowrap;
}

.cmp-table thead th:first-child {
	color: var(--text-3);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.cmp-table thead th:last-child { border-right: 0; }

.cmp-table thead th.ours-1 {
	background: var(--ours-1-head);
	border-left: 1px solid var(--ours-1-line);
	color: var(--text);
	box-shadow: inset 0 3px 0 var(--accent);
}

.cmp-table thead th.ours-2 {
	background: var(--ours-2-head);
	border-left: 1px solid var(--ours-2-line);
	border-right: 1px solid var(--ours-2-line);
	color: var(--text);
	box-shadow: inset 0 3px 0 var(--ours-2);
}

.cmp-table tbody th {
	position: sticky;
	inset-inline-start: 0;
	z-index: 1;
	padding: 15px 16px;
	border-bottom: 1px solid var(--line);
	border-right: 1px solid var(--line);
	background: var(--surface);
	color: var(--text);
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: -0.005em;
	line-height: 1.3;
	text-align: left;
	vertical-align: middle;
	white-space: nowrap;
}

.cmp-table td {
	padding: 15px 16px;
	border-bottom: 1px solid var(--line);
	border-right: 1px solid var(--line);
	color: var(--text-2);
	vertical-align: middle;
	line-height: 1.35;
	white-space: nowrap;
}

.cmp-table td:last-child { border-right: 0; }
.cmp-table tbody tr:last-child th,
.cmp-table tbody tr:last-child td { border-bottom: 0; }

.cmp-table td.ours-1 {
	background: var(--ours-1-bg);
	border-left: 1px solid var(--ours-1-line);
}

.cmp-table td.ours-2 {
	background: var(--ours-2-bg);
	border-left: 1px solid var(--ours-2-line);
	border-right: 1px solid var(--ours-2-line);
}

.cmp-val {
	color: var(--text-2);
	font-size: 0.98rem;
	font-weight: 500;
	letter-spacing: -0.015em;
	line-height: 1.2;
	white-space: nowrap;
}

.cmp-val.is-sm { font-size: 0.9rem; }
.cmp-val.is-bad { color: color-mix(in oklab, var(--err) 82%, var(--text)); font-weight: 600; }
.cmp-val.is-win { color: var(--ours-2-ink); font-weight: 700; }

.cmp-table td.ours-1 .cmp-val,
.cmp-table td.ours-2 .cmp-val {
	color: var(--text);
	font-size: 1.02rem;
	font-weight: 680;
}

.cmp-table td.ours-1 .cmp-val.is-sm,
.cmp-table td.ours-2 .cmp-val.is-sm {
	font-size: 0.92rem;
}

/* narrow containers: stacked card layout per row, sticky card header, CSS variable labels */
@container (width < 760px) {
	.cmp-table-wrap {
		border: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
	}

	.cmp-table,
	.cmp-table thead,
	.cmp-table tbody,
	.cmp-table tr,
	.cmp-table th,
	.cmp-table td { display: block; width: 100%; }

	.cmp-table { min-width: 0; }

	/* MANDATORY: Hide column header from layout and screen readers */
	.cmp-table thead { display: none; }

	.cmp-table tbody tr {
		margin-block-end: 16px;
		border: 1px solid var(--line-2);
		border-radius: var(--radius-l);
		background: var(--surface);
		overflow: clip;
	}

	.cmp-table tbody th {
		position: sticky;
		inset-block-start: 0;
		inset-inline-start: auto;
		z-index: 2;
		padding: 12px 14px;
		border-right: 0;
		border-bottom: 1px solid var(--line);
		background: var(--surface-2);
		color: var(--text);
		font-size: 14.5px;
		font-weight: 650;
	}

	.cmp-table td,
	.cmp-table td:last-child,
	.cmp-table td.ours-1,
	.cmp-table td.ours-2 {
		padding: 11px 14px;
		border-left: 0;
		border-right: 0;
		border-bottom: 1px solid var(--line);
	}

	.cmp-table tbody tr td:last-child { border-bottom: 0; }

	.cmp-table td::before {
		display: block;
		margin-bottom: 3px;
		color: var(--text-3);
		font: 600 11px/1.4 var(--font-mono);
		letter-spacing: 0.02em;
	}

	.cmp-table td:nth-child(2)::before { content: var(--label-2); color: var(--accent); }
	.cmp-table td:nth-child(3)::before { content: var(--label-3); color: var(--ours-2-ink); }
	.cmp-table td:nth-child(4)::before { content: var(--label-4); }
	.cmp-table td:nth-child(5)::before { content: var(--label-5); }
	.cmp-table td:nth-child(6)::before { content: var(--label-6); }

	.cmp-table td.ours-1 { box-shadow: inset 3px 0 0 var(--accent); }
	.cmp-table td.ours-2 { box-shadow: inset 3px 0 0 #10b981; }
}

/* --- trade-offs -------------------------------------------------------------------------------------------------- */

.cmp-choose {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(28px, 5vw, 64px);
}

.cmp-choice { display: grid; gap: 18px; align-content: start; }
.cmp-choice h3 { font-size: 1.2rem; }

.cmp-list {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--text-2);
	font-size: 15px;
	line-height: 1.55;
}

.cmp-list li {
	position: relative;
	padding: 14px 0 0 28px;
	border-top: 1px solid var(--line);
}

/* a small check (ours) or a neutral dash, drawn with borders */
.cmp-list li::before {
	content: '';
	position: absolute;
	top: 22px;
	left: 2px;
	width: 10px;
	height: 1.5px;
	border-radius: 1px;
	background: var(--text-3);
}

.cmp-choice.ours .cmp-list li::before {
	top: 19px;
	width: 5px;
	height: 10px;
	border: solid var(--accent);
	border-width: 0 1.75px 1.75px 0;
	border-radius: 0;
	background: none;
	transform: translateX(2px) rotate(45deg);
}

@media (max-width: 760px) {
	.cmp-choose { grid-template-columns: minmax(0, 1fr); }
}

/* --- live run ---------------------------------------------------------------------------------------------------- */

.cmp-run { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }

.cmp-run-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 24px;
}

.cmp-run-bar #status { min-width: 0; }
/* no WebGPU: compare.js renders no controls, and an empty flex item would push the note to the right edge */
.cmp-run-bar #controls:empty { display: none; }
.cmp-run-bar #controls { min-width: 0; max-width: 100%; }
.cmp-run-bar .field { max-width: 100%; min-width: 0; }
.cmp-run-bar .field > span { white-space: nowrap; }
.cmp-run-bar .field select { min-width: 0; max-width: 100%; flex: 1 1 auto; text-overflow: ellipsis; }

/* phones: the image picker takes its own full-width line, the run button(s) under it */
@media (max-width: 620px) {
	.cmp-run-bar #controls,
	.cmp-run-bar .field { flex: 1 1 100%; }
}

.cmp-stage {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--radius-l);
	background: var(--stage);
}

.cmp-stage canvas {
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 1;
}

/* the overlay over the whole canvas: the tag in its corner, the hint in its centre */
.cmp-half {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	pointer-events: none;
}

/* phones: a square stage, so the texture is drawn larger (compare.js renders 768 × 768 there) */
@media (max-width: 620px) {
	.cmp-stage canvas { aspect-ratio: 1 / 1; }
}

/* no usable WebGPU (compare.js sets data-uft="absent"): nothing will be drawn, and a canvas whose WebGL fallback was
   disposed shows the browser's lost-context image, so the canvas is hidden and the empty stage is a shorter frame */
.cmp-stage[data-uft='absent'] canvas { visibility: hidden; aspect-ratio: 3 / 1; }

@media (max-width: 620px) {
	.cmp-stage[data-uft='absent'] canvas { aspect-ratio: 2 / 1; }
}

.cmp-tag {
	position: absolute;
	top: 12px;
	left: 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 9px;
	border-radius: 999px;
	background: var(--stage-chip);
	color: var(--stage-ink-strong);
	font: 500 11.5px/1 var(--font-mono);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.cmp-tag b { color: var(--stage-ink); font-weight: 400; }

.cmp-hint {
	display: grid;
	justify-items: center;
	gap: 10px;
	padding: 0 16px;
	color: var(--stage-ink);
	font-size: 13px;
	text-align: center;
	transition: opacity 0.3s var(--ease);
}

.cmp-hint svg { opacity: 0.7; }

.cmp-stage[data-uft='done'] .cmp-hint { opacity: 0; }
.cmp-stage[data-uft='busy'] .cmp-hint svg { animation: cmp-blink 1.2s var(--ease) infinite; }

@keyframes cmp-blink {
	50% { opacity: 0.2; }
}

.cmp-sides {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(24px, 4vw, 48px);
	padding-top: 6px;
}

.cmp-side { display: grid; gap: 12px; align-content: start; min-width: 0; }

.cmp-side h3 {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 10px;
	font-size: 1.05rem;
}

.cmp-side-tag {
	color: var(--text-3);
	font: 400 12.5px/1.4 var(--font-mono);
	letter-spacing: 0;
}

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

.cmp-side table.kv thead { display: none; }
.cmp-side table.kv td { padding-block: 8px; }
.cmp-side table.kv tbody tr:first-child td { border-top: 1px solid var(--line); }
.cmp-side table.kv td:first-child { color: var(--text-3); }

.cmp-side table.kv td:last-child {
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 12.5px;
	text-align: right;
}

.cmp-side table.kv td:last-child code {
	padding: 0;
	border: 0;
	background: none;
	font-size: inherit;
}

.cmp-side table.cmp-ref-table th,
.cmp-side table.cmp-ref-table td {
	padding-block: 8px;
	white-space: nowrap;
}

.cmp-side table.cmp-ref-table th:not(:first-child),
.cmp-side table.cmp-ref-table td:not(:first-child) {
	text-align: right;
}

.cmp-side table.cmp-ref-table td:first-child {
	color: var(--text-3);
}

.cmp-side table.cmp-ref-table td:not(:first-child) {
	color: var(--text-2);
	font-family: var(--font-mono);
	font-size: 12.5px;
}

.cmp-side table.cmp-ref-table th:nth-child(2),
.cmp-side table.cmp-ref-table td:nth-child(2),
.cmp-side table.cmp-ref-table th:nth-child(3),
.cmp-side table.cmp-ref-table td:nth-child(3) {
	color: var(--accent);
	font-weight: 600;
}

/* phones: the five reference columns fit the width (values wrap instead of scrolling the competitors out of view) */
@media (max-width: 620px) {
	.cmp-side table.cmp-ref-table { width: 100%; }

	.cmp-side table.cmp-ref-table th,
	.cmp-side table.cmp-ref-table td {
		padding-inline: 3px;
		font-size: 11.5px;
		white-space: normal;
	}

	.cmp-side table.cmp-ref-table th:first-child,
	.cmp-side table.cmp-ref-table td:first-child { padding-left: 0; }

	.cmp-side table.cmp-ref-table td:not(:first-child) { font-size: 11.5px; }
}

@media (max-width: 760px) {
	.cmp-sides { grid-template-columns: minmax(0, 1fr); }
	.cmp-tag { top: 8px; left: 8px; padding: 4px 7px; font-size: 10.5px; }
	.cmp-tag b { display: none; }
	.cmp-hint { font-size: 12px; }
}

/* the closing call to action is the shared .page-next of site.css */
