/**
 * Calculator and planning tools.
 *
 * Shared by all five tools. Consumes the theme's design tokens with
 * fallbacks, so the tools stay legible under a different theme.
 */

.pcb-tool {
	--pcb-t-border: var(--ite-border, #232b3a);
	--pcb-t-surface: var(--ite-surface, #131822);
	--pcb-t-alt: var(--ite-surface-2, #1a2130);
	--pcb-t-text: var(--ite-text, #e8edf5);
	--pcb-t-muted: var(--ite-text-muted, #9aa6bb);
	--pcb-t-accent: var(--ite-accent, #4d9fff);
	--pcb-t-radius: var(--ite-radius, 10px);

	margin-block: 1.5rem;
	color: var(--pcb-t-text);
}

/* ------------------------------------------------------------------ Form */

.pcb-tool__form {
	padding: 1.25rem;
	background: var(--pcb-t-alt);
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	display: grid;
	gap: 1rem;
}

.pcb-tool__row {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

@media (min-width: 30em) {
	.pcb-tool__row {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 48em) {
	.pcb-tool__row {
		grid-template-columns: repeat(4, 1fr);
	}
}

.pcb-tool__field {
	display: grid;
	gap: 0.375rem;
	min-width: 0;
}

.pcb-tool__label {
	font-size: 0.875rem;
	font-weight: 600;
}

.pcb-tool__input {
	width: 100%;
	min-height: 2.75rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	background: var(--pcb-t-surface);
	font: inherit;
	font-size: 0.9375rem;
	color: inherit;
}

.pcb-tool__input:focus-visible {
	outline: 2px solid var(--pcb-t-accent);
	outline-offset: 1px;
}

/*
 * A select keeps the platform's own control unless it is told otherwise,
 * which on Windows means a white listbox on a dark page. Removing the
 * native appearance means drawing the arrow ourselves: it is an inline
 * SVG in a data URI rather than a background image file, so it costs no
 * request and inherits nothing that could fail to load.
 */
select.pcb-tool__input {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 2.5rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239aa6bb' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.875rem center;
	cursor: pointer;
}

/* The dropdown list itself is drawn by the platform, so its colours have
   to be set explicitly or it falls back to the system palette. */
select.pcb-tool__input option {
	background: var(--pcb-t-surface);
	color: var(--pcb-t-text);
}

/* Number inputs carry spinners that sit awkwardly against a dark field
   and are redundant beside a keyboard and a slider. */
input[type="number"].pcb-tool__input {
	-moz-appearance: textfield;
}

input[type="number"].pcb-tool__input::-webkit-outer-spin-button,
input[type="number"].pcb-tool__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.pcb-tool__input::placeholder {
	color: var(--pcb-t-muted);
	opacity: 1;
}

.pcb-tool__input:hover:not(:focus) {
	border-color: var(--ite-border-bright, #313c4f);
}

.pcb-tool__help {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--pcb-t-muted);
}

.pcb-tool__checks {
	display: grid;
	gap: 0.5rem;
}

.pcb-tool__check {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9375rem;
	cursor: pointer;
	min-height: 2.25rem;
}

.pcb-tool__check input {
	width: 1.125rem;
	height: 1.125rem;
	cursor: pointer;
}

/* ---------------------------------------------------------------- Output */

.pcb-tool__output {
	margin-top: 1.25rem;
	padding: 1.25rem;
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	background: var(--pcb-t-surface);
}

.pcb-tool__output-title {
	margin: 0 0 1rem;
	font-size: 1.125rem;
}

.pcb-tool__figures {
	display: grid;
	gap: 1rem;
}

@media (min-width: 34em) {
	.pcb-tool__figures {
		grid-template-columns: repeat(2, 1fr);
	}
}

.pcb-tool__headline {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	margin: 0 0 1rem;
}

.pcb-tool__figure {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--pcb-t-accent);
	font-variant-numeric: tabular-nums;
}

.pcb-tool__figure-label {
	font-size: 0.875rem;
	color: var(--pcb-t-muted);
}

/* --------------------------------------------------------------- Working */

.pcb-tool__working summary {
	cursor: pointer;
	padding: 0.5rem 0;
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--pcb-t-accent);
}

.pcb-tool__working summary:focus-visible {
	outline: 2px solid var(--pcb-t-accent);
	outline-offset: 2px;
}

.pcb-tool__table {
	width: 100%;
	margin: 0.75rem 0;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.pcb-tool__table th,
.pcb-tool__table td {
	padding: 0.5rem;
	text-align: left;
	border-bottom: 1px solid var(--pcb-t-border);
	font-weight: 400;
	vertical-align: top;
}

.pcb-tool__watts {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.pcb-tool__basis {
	color: var(--pcb-t-muted);
	font-size: 0.8125rem;
}

.pcb-tool__total th,
.pcb-tool__total td {
	border-top: 2px solid var(--pcb-t-border);
	border-bottom: 0;
	font-weight: 700;
}

/* ----------------------------------------------------------------- Notes */

.pcb-tool__notes {
	font-size: 0.9375rem;
	line-height: 1.6;
}

.pcb-tool__notes h3 {
	margin: 1.25rem 0 0.375rem;
	font-size: 1rem;
}

.pcb-tool__notes h3:first-child {
	margin-top: 0;
}

.pcb-tool__notes p {
	margin: 0 0 0.75rem;
}

.pcb-tool__disclaimer {
	margin-top: 1rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--pcb-t-border);
	font-size: 0.8125rem;
	color: var(--pcb-t-muted);
}

/* ------------------------------------------------------------------ Plan */

.pcb-tool__plan {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: step;
	display: grid;
	gap: 1rem;
}

.pcb-tool__plan-item {
	counter-increment: step;
	padding: 1rem 1rem 1rem 3rem;
	position: relative;
	background: var(--pcb-t-alt);
	border-radius: var(--pcb-t-radius);
}

.pcb-tool__plan-item::before {
	content: counter(step);
	position: absolute;
	left: 1rem;
	top: 1rem;
	width: 1.5rem;
	height: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var(--pcb-t-accent);
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 700;
}

.pcb-tool__plan-title {
	margin: 0 0 0.25rem;
	font-size: 1rem;
}

.pcb-tool__plan-impact {
	margin: 0 0 0.5rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--pcb-t-accent);
}

.pcb-tool__plan-why {
	margin: 0;
	font-size: 0.9375rem;
	color: var(--pcb-t-muted);
	line-height: 1.6;
}

/* -------------------------------------------------------------- Noscript */

.pcb-noscript {
	padding: 1rem 1.25rem;
	background: var(--pcb-t-alt);
	border-left: 4px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	font-size: 0.9375rem;
}

.pcb-spec-unknown {
	color: var(--pcb-t-muted);
	font-style: italic;
}

/* ========================================================== Build generator */

.pcb-gen__form {
	padding: 1.5rem;
	background: var(--pcb-t-alt);
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
}

.pcb-gen__fields {
	display: grid;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

@media (min-width: 34em) {
	.pcb-gen__fields {
		grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
	}
}

.pcb-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 2.75rem;
	padding: 0.625rem 1.25rem;
	border: 1px solid transparent;
	border-radius: var(--pcb-t-radius);
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.pcb-button--lg {
	min-height: 3rem;
	padding: 0.75rem 1.5rem;
	width: 100%;
}

@media (min-width: 34em) {
	.pcb-button--lg {
		width: auto;
	}
}

.pcb-button--primary {
	background: var(--pcb-t-accent);
	border-color: var(--pcb-t-accent);
	color: #fff;
}

.pcb-button--primary:hover {
	filter: brightness(1.1);
	transform: translateY(-1px);
}

.pcb-button--primary[disabled] {
	opacity: 0.6;
	cursor: wait;
	transform: none;
}

.pcb-button--secondary {
	background: var(--pcb-t-surface);
	border-color: var(--pcb-t-border);
	color: inherit;
}

.pcb-button--secondary:hover {
	border-color: var(--pcb-t-accent);
}

.pcb-gen__loading {
	margin-top: 1.5rem;
	padding: 2rem;
	text-align: center;
	color: var(--pcb-t-muted);
	border: 1px dashed var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
}

.pcb-gen__result {
	margin-top: 1.5rem;
	padding: 1.5rem;
	background: var(--pcb-t-surface);
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
}

.pcb-gen__result-title {
	margin: 0 0 1rem;
	font-size: 1.25rem;
}

.pcb-gen__result-title:focus {
	outline: none;
}

.pcb-gen__headline {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	margin: 0 0 1.25rem;
}

.pcb-gen__table-wrap {
	overflow-x: auto;
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	margin-bottom: 1rem;
}

.pcb-gen__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.pcb-gen__table th,
.pcb-gen__table td {
	padding: 0.75rem 1rem;
	text-align: left;
	border-bottom: 1px solid var(--pcb-t-border);
}

.pcb-gen__table tbody th {
	font-weight: 600;
	white-space: nowrap;
	width: 1%;
	color: var(--pcb-t-muted);
	font-size: 0.8125rem;
}

.pcb-gen__part {
	font-weight: 500;
}

.pcb-gen__power {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	color: var(--pcb-t-muted);
}

.pcb-gen__notices {
	margin-bottom: 1.25rem;
}

.pcb-gen__notices h3 {
	margin: 0 0 0.75rem;
	font-size: 1rem;
}

.pcb-gen__note-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.625rem;
}

.pcb-gen__note {
	padding: 0.75rem 1rem;
	border-left: 3px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	background: var(--pcb-t-alt);
	font-size: 0.875rem;
}

.pcb-gen__note p {
	margin: 0;
}

.pcb-gen__note--note,
.pcb-gen__note--substituted { border-left-color: var(--ite-accent, #4d9fff); }
.pcb-gen__note--unknown     { border-left-color: var(--ite-warning, #f5a623); }
.pcb-gen__note--conflict,
.pcb-gen__note--unresolved,
.pcb-gen__note--unavailable { border-left-color: var(--ite-error, #ff6b6b); }

.pcb-gen__note-detail {
	margin-top: 0.375rem !important;
	font-size: 0.8125rem;
	color: var(--pcb-t-muted);
	line-height: 1.55;
}

.pcb-gen__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.25rem;
}

/* ====================================================== Component tables */

/*
 * A specification table that a reader can order by any column.
 *
 * Wide tables are a genuine problem on a phone, and the two usual answers
 * are both bad: horizontal scrolling hides the columns that matter, and
 * shrinking the type makes the whole thing unreadable. Below 52em each row
 * becomes a card instead, with every cell labelled by the column it came
 * from, so nothing is hidden and nothing needs to be scrolled sideways.
 */

.pcb-ctable {
	margin-block: var(--ite-8, 2rem);
}

.pcb-ctable__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ite-4, 1rem);
	margin-bottom: var(--ite-4, 1rem);
}

.pcb-ctable__search {
	flex: 1 1 16rem;
	min-width: 0;
	min-height: 2.75rem;
	padding: 0.5rem 0.875rem;
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	background: var(--pcb-t-surface);
	color: inherit;
	font: inherit;
	font-size: 0.9375rem;
}

.pcb-ctable__search:focus-visible {
	outline: 2px solid var(--pcb-t-accent);
	outline-offset: 1px;
}

.pcb-ctable__search::placeholder {
	color: var(--ite-text-dim, #6b7688);
	opacity: 1;
}

.pcb-ctable__search::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.pcb-ctable__count {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--pcb-t-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.pcb-ctable__scroll {
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	overflow: hidden;
}

.pcb-ctable__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.pcb-ctable__table th,
.pcb-ctable__table td {
	padding: 0.75rem 0.875rem;
	text-align: left;
	border-bottom: 1px solid var(--pcb-t-border);
	vertical-align: middle;
}

.pcb-ctable__table tbody tr:last-child th,
.pcb-ctable__table tbody tr:last-child td {
	border-bottom: 0;
}

.pcb-ctable__table thead th {
	padding: 0;
	background: var(--pcb-t-alt);
	border-bottom: 1px solid var(--pcb-t-border);
}

/* The whole header cell is the sort control, so the target is the cell
   rather than the few pixels of text inside it. */
.pcb-ctable__sort {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.375rem;
	width: 100%;
	min-height: 2.75rem;
	padding: 0.625rem 0.875rem;
	border: 0;
	background: none;
	color: var(--pcb-t-muted);
	font: inherit;
	font-size: 0.75rem;
	font-weight: 650;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-align: left;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.pcb-ctable__sort:hover {
	color: var(--pcb-t-text);
	background: color-mix(in srgb, var(--pcb-t-accent) 8%, transparent);
}

.pcb-ctable__sort:focus-visible {
	outline: 2px solid var(--pcb-t-accent);
	outline-offset: -2px;
}

[aria-sort="ascending"] .pcb-ctable__sort,
[aria-sort="descending"] .pcb-ctable__sort {
	color: var(--pcb-t-accent);
}

.pcb-ctable__arrow {
	flex-shrink: 0;
	font-size: 0.875rem;
	opacity: 0.55;
}

[aria-sort="ascending"] .pcb-ctable__arrow,
[aria-sort="descending"] .pcb-ctable__arrow {
	opacity: 1;
}

.pcb-ctable__num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.pcb-ctable__num .pcb-ctable__sort {
	flex-direction: row-reverse;
	text-align: right;
}

.pcb-ctable__primary {
	color: var(--pcb-t-text);
	font-weight: 600;
}

.pcb-ctable__table tbody tr:nth-child(even) {
	background: color-mix(in srgb, var(--pcb-t-alt) 45%, transparent);
}

.pcb-ctable__table tbody tr:hover {
	background: color-mix(in srgb, var(--pcb-t-accent) 6%, transparent);
}

.pcb-ctable__empty {
	padding-block: var(--ite-10, 2.5rem) !important;
	text-align: center !important;
	color: var(--pcb-t-muted);
}

.pcb-ctable__pager {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: var(--ite-4, 1rem);
	margin-top: var(--ite-4, 1rem);
}

.pcb-ctable__page {
	font-size: 0.8125rem;
	color: var(--pcb-t-muted);
	font-variant-numeric: tabular-nums;
}

.pcb-ctable__note {
	margin-top: var(--ite-4, 1rem);
	font-size: 0.8125rem;
	color: var(--ite-text-dim, #6b7688);
	line-height: 1.55;
}

/* Below this width the table reflows into one card per row. */
@media (max-width: 51.99em) {
	.pcb-ctable__scroll {
		border: 0;
		border-radius: 0;
		overflow: visible;
	}

	.pcb-ctable__table,
	.pcb-ctable__table tbody,
	.pcb-ctable__table tr {
		display: block;
	}

	/* The header row is the sort control on a phone too, so it is moved
	   above the cards as a scrollable strip rather than hidden. */
	.pcb-ctable__table thead {
		display: block;
		overflow-x: auto;
		border: 1px solid var(--pcb-t-border);
		border-radius: var(--pcb-t-radius);
		margin-bottom: var(--ite-4, 1rem);
		-webkit-overflow-scrolling: touch;
	}

	.pcb-ctable__table thead tr {
		display: flex;
	}

	.pcb-ctable__table thead th {
		flex: 0 0 auto;
		border-bottom: 0;
		border-right: 1px solid var(--pcb-t-border);
	}

	.pcb-ctable__table thead th:last-child {
		border-right: 0;
	}

	.pcb-ctable__table tbody tr {
		border: 1px solid var(--pcb-t-border);
		border-radius: var(--pcb-t-radius);
		margin-bottom: 0.75rem;
		padding: 0.25rem 0;
		background: var(--pcb-t-surface);
	}

	.pcb-ctable__table tbody tr:nth-child(even),
	.pcb-ctable__table tbody tr:hover {
		background: var(--pcb-t-surface);
	}

	.pcb-ctable__table tbody th,
	.pcb-ctable__table tbody td {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: var(--ite-4, 1rem);
		padding: 0.4375rem 0.875rem;
		border-bottom: 0;
		text-align: left;
	}

	/* Each stacked cell names its own column; a bare number in a card
	   says nothing about what it measures. */
	.pcb-ctable__table tbody td::before,
	.pcb-ctable__table tbody th::before {
		content: attr(data-label);
		flex-shrink: 0;
		color: var(--pcb-t-muted);
		font-size: 0.75rem;
		font-weight: 600;
		letter-spacing: 0.04em;
		text-transform: uppercase;
	}

	/* The model is the card's heading, so it keeps neither label nor
	   the right-hand alignment the other cells use. */
	.pcb-ctable__table tbody th.pcb-ctable__primary {
		display: block;
		padding-top: 0.625rem;
		padding-bottom: 0.5rem;
		border-bottom: 1px solid var(--pcb-t-border);
		margin-bottom: 0.25rem;
		font-size: 0.9375rem;
	}

	.pcb-ctable__table tbody th.pcb-ctable__primary::before {
		content: none;
	}

	.pcb-ctable__num {
		text-align: right;
	}

	.pcb-ctable__empty {
		display: block !important;
	}
}

/* ==================================================== Head-to-head compare */

.pcb-compare {
	margin-block: var(--ite-8, 2rem);
}

.pcb-compare__slots {
	display: grid;
	gap: var(--ite-4, 1rem);
	align-items: start;
	margin-bottom: var(--ite-6, 1.5rem);
}

@media (min-width: 40em) {
	.pcb-compare__slots {
		grid-template-columns: 1fr auto 1fr;
	}
}

.pcb-compare__slot {
	position: relative;
	min-width: 0;
}

.pcb-compare__slot-label {
	margin: 0 0 0.5rem;
	font-size: 0.75rem;
	font-weight: 650;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--pcb-t-muted);
}

.pcb-compare__slot--filled {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ite-4, 1rem);
	padding: 0.75rem 1rem;
	border: 1px solid var(--pcb-t-accent);
	border-radius: var(--pcb-t-radius);
	background: color-mix(in srgb, var(--pcb-t-accent) 8%, transparent);
}

.pcb-compare__chosen {
	margin: 0;
	min-width: 0;
	font-weight: 600;
	line-height: 1.35;
}

/* The versus marker is a separator, not a heading, so it sits centred on
   a wide screen and disappears into the flow on a narrow one. */
.pcb-compare__versus {
	font-size: 0.8125rem;
	font-weight: 650;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--pcb-t-muted);
	text-align: center;
}

@media (max-width: 39.99em) {
}

.pcb-compare__results {
	position: absolute;
	top: calc(100% + 0.25rem);
	left: 0;
	right: 0;
	z-index: 30;
	list-style: none;
	margin: 0;
	padding: 0.25rem;
	max-height: 18rem;
	overflow-y: auto;
	background: var(--pcb-t-alt);
	border: 1px solid var(--ite-border-bright, #313c4f);
	border-radius: var(--pcb-t-radius);
	box-shadow: var(--ite-shadow-lg, 0 20px 48px rgba(0, 0, 0, 0.4));
}

.pcb-compare__result {
	margin: 0;
}

.pcb-compare__result-button {
	display: block;
	width: 100%;
	min-height: 2.75rem;
	padding: 0.5rem 0.75rem;
	border: 0;
	border-radius: var(--ite-radius-sm, 6px);
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.875rem;
	text-align: left;
	line-height: 1.35;
	cursor: pointer;
}

.pcb-compare__result-button:hover,
.pcb-compare__result-button:focus-visible {
	background: color-mix(in srgb, var(--pcb-t-accent) 12%, transparent);
	outline: none;
}

.pcb-compare__result--empty {
	padding: 0.75rem;
	font-size: 0.875rem;
	color: var(--pcb-t-muted);
}

.pcb-compare__table-wrap {
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.pcb-compare__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.pcb-compare__table th,
.pcb-compare__table td {
	padding: 0.75rem 1rem;
	text-align: left;
	border-bottom: 1px solid var(--pcb-t-border);
	vertical-align: top;
	line-height: 1.4;
}

.pcb-compare__table tbody tr:last-child th,
.pcb-compare__table tbody tr:last-child td {
	border-bottom: 0;
}

.pcb-compare__table thead th {
	position: sticky;
	top: 0;
	background: var(--pcb-t-alt);
	font-size: 0.8125rem;
	font-weight: 650;
}

.pcb-compare__table thead th:first-child {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--pcb-t-muted);
}

.pcb-compare__table tbody th {
	width: 30%;
	font-weight: 500;
	color: var(--pcb-t-muted);
}

.pcb-compare__value {
	font-variant-numeric: tabular-nums;
}

/* A row where the two parts agree is dimmed rather than hidden, so the
   differences stand out without the matching figures disappearing. */
.pcb-compare__row:not(.is-different) .pcb-compare__value {
	color: var(--pcb-t-muted);
}

.pcb-compare__row.is-different {
	background: color-mix(in srgb, var(--pcb-t-accent) 5%, transparent);
}

/* Larger, not better: the mark says which figure is bigger and the note
   under the table says why that is not the same thing. */
.pcb-compare__value.is-larger {
	color: var(--pcb-t-text);
	font-weight: 650;
}

.pcb-compare__value.is-larger::after {
	content: " \25B2";
	font-size: 0.6875em;
	color: var(--pcb-t-accent);
	vertical-align: 0.1em;
}

.pcb-compare__note {
	margin-top: var(--ite-4, 1rem);
	font-size: 0.8125rem;
	color: var(--ite-text-dim, #6b7688);
	line-height: 1.55;
}

.pcb-compare__empty {
	margin: 0;
	padding: var(--ite-10, 2.5rem) var(--ite-4, 1rem);
	text-align: center;
	color: var(--pcb-t-muted);
	border: 1px dashed var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
}

.pcb-compare__actions {
	margin-top: var(--ite-4, 1rem);
}

@media (max-width: 39.99em) {
	.pcb-compare__table tbody th {
		width: auto;
	}

	.pcb-compare__table th,
	.pcb-compare__table td {
		padding: 0.625rem 0.75rem;
	}
}

/* ------------------------------------------------ Compare: summary and sections */

.pcb-compare__summary {
	padding: var(--ite-5, 1.25rem) var(--ite-6, 1.5rem);
	margin-bottom: var(--ite-6, 1.5rem);
	border: 1px solid var(--pcb-t-border);
	border-left: 4px solid var(--pcb-t-accent);
	border-radius: var(--pcb-t-radius);
	background: var(--pcb-t-surface);
}

.pcb-compare__summary-title {
	margin: 0 0 0.75rem;
	font-size: 1rem;
}

.pcb-compare__summary-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.5rem;
}

.pcb-compare__summary-item {
	position: relative;
	padding-left: 1.125rem;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.pcb-compare__summary-item::before {
	content: "\25B2";
	position: absolute;
	left: 0;
	top: 0.15em;
	font-size: 0.625em;
	color: var(--pcb-t-accent);
}

.pcb-compare__summary-text,
.pcb-compare__summary-note {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--pcb-t-muted);
	line-height: 1.55;
}

.pcb-compare__summary-note {
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--pcb-t-border);
}

/* A section heading inside the table groups the rows beneath it. */
.pcb-compare__section th {
	padding-top: 1.25rem !important;
	background: var(--pcb-t-alt);
	font-size: 0.75rem;
	font-weight: 650;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--pcb-t-muted);
}

.pcb-compare__table tbody tr:first-child .pcb-compare__section th,
.pcb-compare__section:first-child th {
	padding-top: 0.75rem !important;
}

/* Picker results carry a second line naming what makes each one
   different, because a search for one chip returns dozens of cards whose
   names differ only in cooler branding. */
.pcb-compare__result-button {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	min-height: 3.25rem;
}

.pcb-compare__result-name {
	font-weight: 500;
}

.pcb-compare__result-spec {
	font-size: 0.8125rem;
	color: var(--pcb-t-muted);
	line-height: 1.4;
}

.pcb-compare__result-spec:empty {
	display: none;
}

/* ------------------------------------------- Compare: panel and alignment */

/*
 * The picker and its results are one unit on the page, set apart from the
 * prose above and the full table below. Without a frame the two search
 * fields read as part of the paragraph they follow.
 */
.pcb-compare {
	padding: var(--ite-6, 1.5rem);
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	background: var(--pcb-t-alt);
}

.pcb-compare__output {
	margin-top: var(--ite-6, 1.5rem);
}

/* The slots row aligns on the fields themselves, not on the labels above
   them, so "vs" sits level with the two inputs rather than below them. */
.pcb-compare__slots {
	align-items: end;
}

/*
 * The row aligns on the controls rather than the labels above them, so
 * "vs" is centred against the height of a filled slot.
 */
.pcb-compare__versus {
	align-self: stretch;
	display: flex;
	align-items: center;
	justify-content: center;
	padding-block: 0;
}

/* A filled slot carries no label above it, so it takes the space the
   label would have used to stay level with an empty slot beside it. */
.pcb-compare__slot--filled {
	margin-top: 1.55rem;
}

/* Once both slots are filled there is no label anywhere on the row, so
   the offset would only push the whole row down. */
.pcb-compare__slots:not(:has(.pcb-compare__slot-label)) .pcb-compare__slot--filled {
	margin-top: 0;
}

@media (max-width: 39.99em) {
	.pcb-compare {
		padding: var(--ite-4, 1rem);
	}

	.pcb-compare__slots {
		align-items: stretch;
	}

	.pcb-compare__slot--filled {
		margin-top: 0;
	}

	.pcb-compare__versus {
		padding-bottom: 0;
	}
}

/*
 * The dropdown sits over the page, so its background has to be opaque.
 * The surface token is semi-transparent under some palettes, which let
 * the text underneath show through the list.
 */
.pcb-compare__results {
	background: var(--ite-surface-2, #1a2130);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

.pcb-compare__result-button:hover,
.pcb-compare__result-button:focus-visible {
	background: var(--ite-surface-3, #232c3d);
}

/* The panel already carries a background, so the summary inside it uses
   the darker surface to stay distinct from it. */
.pcb-compare__summary {
	background: var(--ite-surface, #131822);
}

.pcb-compare__empty {
	background: var(--ite-surface, #131822);
}

/* ------------------------------------- Compare: standings and suitability */

.pcb-compare__standings,
.pcb-compare__suits {
	margin-top: var(--ite-6, 1.5rem);
}

.pcb-compare__standings-title,
.pcb-compare__suits-title {
	margin: 0 0 0.75rem;
	font-size: 1rem;
}

.pcb-compare__standings-note,
.pcb-compare__suits-note-block {
	margin: 0.75rem 0 0;
	font-size: 0.8125rem;
	color: var(--ite-text-dim, #6b7688);
	line-height: 1.55;
}

/*
 * The stacking happens inside the cell, not by making the cell a flex
 * container: display:flex on a td removes it from the table layout, which
 * puts both values in the first column and leaves the second empty.
 */
.pcb-compare__standing-cell {
	vertical-align: middle;
}

.pcb-compare__standing-cell > span {
	display: block;
}

.pcb-compare__standing-position {
	font-size: 1.125rem;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}

.pcb-compare__standing-of {
	font-size: 0.75rem;
	color: var(--pcb-t-muted);
}

/* The cell of whichever part places higher on that specification. Tinted
   rather than outlined, so a column reads as a block at a glance. */
.pcb-compare__standing-cell.is-ahead {
	background: color-mix(in srgb, var(--pcb-t-accent) 14%, transparent);
	box-shadow: inset 3px 0 0 var(--pcb-t-accent);
}

.pcb-compare__standing-cell.is-ahead .pcb-compare__standing-position {
	color: var(--pcb-t-accent);
}

.pcb-compare__suits-use {
	display: block;
	color: var(--pcb-t-text);
	font-weight: 600;
}

.pcb-compare__suits-basis {
	display: block;
	margin-top: 0.125rem;
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--pcb-t-muted);
	line-height: 1.4;
}

.pcb-compare__suits-cell {
	text-align: center;
}

.pcb-compare__suits-mark {
	display: block;
	font-size: 1.25rem;
	line-height: 1;
	color: var(--ite-text-dim, #6b7688);
}

.pcb-compare__suits-cell.is-met {
	background: color-mix(in srgb, var(--ite-success, #3ecf8e) 12%, transparent);
}

.pcb-compare__suits-cell.is-met .pcb-compare__suits-mark {
	color: var(--ite-success, #3ecf8e);
}

.pcb-compare__suits-note {
	display: block;
	margin-top: 0.375rem;
	font-size: 0.6875rem;
	color: var(--pcb-t-muted);
	line-height: 1.4;
	text-align: left;
}

@media (max-width: 39.99em) {
	.pcb-compare__suits-note {
		display: none;
	}
}

/* A heading for a column that cannot be sorted: the same type as a sort
   control, without the affordance of one. */
.pcb-ctable__static {
	padding: 0.625rem 0.875rem;
	background: var(--pcb-t-alt);
	font-size: 0.75rem;
	font-weight: 650;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--pcb-t-muted);
	vertical-align: middle;
}

/* ========================================================= Bottleneck checker */

.pcb-bn {
	margin-block: var(--ite-8, 2rem);
	padding: var(--ite-6, 1.5rem);
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	background: var(--pcb-t-alt);
}

.pcb-bn__fields {
	display: grid;
	gap: var(--ite-4, 1rem);
	margin-bottom: var(--ite-6, 1.5rem);
}

@media (min-width: 40em) {
	.pcb-bn__fields {
		grid-template-columns: 1fr 1fr;
	}
}

.pcb-bn__field {
	position: relative;
	min-width: 0;
}

.pcb-bn__field-label {
	display: block;
	margin: 0 0 0.5rem;
	font-size: 0.75rem;
	font-weight: 650;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--pcb-t-muted);
}

.pcb-bn__chosen {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ite-4, 1rem);
	min-height: 2.75rem;
	padding: 0.625rem 1rem;
	border: 1px solid var(--pcb-t-accent);
	border-radius: var(--pcb-t-radius);
	background: color-mix(in srgb, var(--pcb-t-accent) 8%, transparent);
}

.pcb-bn__chosen-name {
	min-width: 0;
	font-weight: 600;
	line-height: 1.35;
}

/* The suggestion list hangs over the page, so it needs an opaque ground. */
.pcb-bn__suggestions {
	position: absolute;
	top: calc(100% + 0.25rem);
	left: 0;
	right: 0;
	z-index: 30;
	list-style: none;
	margin: 0;
	padding: 0.25rem;
	max-height: 18rem;
	overflow-y: auto;
	background: var(--ite-surface-2, #1a2130);
	border: 1px solid var(--ite-border-bright, #313c4f);
	border-radius: var(--pcb-t-radius);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

.pcb-bn__suggestion {
	margin: 0;
}

.pcb-bn__suggestion-button {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--ite-4, 1rem);
	width: 100%;
	min-height: 2.75rem;
	padding: 0.5rem 0.75rem;
	border: 0;
	border-radius: var(--ite-radius-sm, 6px);
	background: none;
	color: inherit;
	font: inherit;
	font-size: 0.875rem;
	text-align: left;
	line-height: 1.35;
	cursor: pointer;
}

.pcb-bn__suggestion-button:hover,
.pcb-bn__suggestion-button:focus-visible {
	background: var(--ite-surface-3, #232c3d);
	outline: none;
}

.pcb-bn__suggestion-meta {
	flex-shrink: 0;
	font-size: 0.75rem;
	color: var(--pcb-t-muted);
	font-variant-numeric: tabular-nums;
}

.pcb-bn__suggestion--empty {
	padding: 0.75rem;
	font-size: 0.875rem;
	color: var(--pcb-t-muted);
}

.pcb-bn__controls {
	display: grid;
	gap: var(--ite-5, 1.25rem);
	padding-block: var(--ite-5, 1.25rem);
	border-block: 1px solid var(--pcb-t-border);
}

@media (min-width: 52em) {
	.pcb-bn__controls {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.pcb-bn__control-label {
	margin: 0 0 0.5rem;
	font-size: 0.75rem;
	font-weight: 650;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--pcb-t-muted);
}

.pcb-bn__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
}

.pcb-bn__choice {
	min-height: 2.75rem;
	padding: 0.5rem 0.875rem;
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	background: var(--pcb-t-surface);
	color: var(--pcb-t-muted);
	font: inherit;
	font-size: 0.8125rem;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.pcb-bn__choice:hover {
	color: var(--pcb-t-text);
	border-color: var(--ite-border-bright, #313c4f);
}

.pcb-bn__choice.is-active {
	background: color-mix(in srgb, var(--pcb-t-accent) 14%, transparent);
	border-color: var(--pcb-t-accent);
	color: var(--pcb-t-text);
	font-weight: 600;
}

.pcb-bn__choice:focus-visible {
	outline: 2px solid var(--pcb-t-accent);
	outline-offset: 1px;
}

/*
 * The answer gets its own panel. Sharing a surface with the controls
 * above made the verdict read as another row of the form rather than as
 * the thing the form was for.
 */
.pcb-bn__result {
	margin-top: var(--ite-6, 1.5rem);
	padding: var(--ite-6, 1.5rem);
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	background: var(--pcb-t-surface);
}

@media (max-width: 39.99em) {
	.pcb-bn__result {
		padding: var(--ite-4, 1rem);
	}
}

.pcb-bn__verdict {
	padding: var(--ite-5, 1.25rem);
	border-radius: var(--pcb-t-radius);
	border-left: 4px solid var(--pcb-t-muted);
	background: var(--pcb-t-alt);
}

.pcb-bn__verdict--balanced { border-left-color: var(--ite-success, #3ecf8e); }
.pcb-bn__verdict--cpu      { border-left-color: var(--ite-warning, #f5a623); }
.pcb-bn__verdict--gpu      { border-left-color: var(--pcb-t-accent); }

.pcb-bn__headline {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 680;
	letter-spacing: -0.015em;
}

.pcb-bn__confidence {
	margin: 0.375rem 0 0;
	font-size: 0.8125rem;
	color: var(--pcb-t-muted);
	text-transform: capitalize;
}

.pcb-bn__meter-wrap {
	margin-top: var(--ite-5, 1.25rem);
}

.pcb-bn__meter-label {
	margin: 0 0 0.5rem;
	font-size: 0.75rem;
	font-weight: 650;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--pcb-t-muted);
}

.pcb-bn__meter {
	display: flex;
	height: 2.25rem;
	border-radius: var(--pcb-t-radius);
	overflow: hidden;
	border: 1px solid var(--pcb-t-border);
}

.pcb-bn__meter-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	font-size: 0.75rem;
	font-weight: 650;
	white-space: nowrap;
	transition: width 0.3s ease;
}

.pcb-bn__meter-bar--cpu {
	background: color-mix(in srgb, var(--ite-warning, #f5a623) 28%, transparent);
	color: var(--pcb-t-text);
}

.pcb-bn__meter-bar--gpu {
	background: color-mix(in srgb, var(--pcb-t-accent) 28%, transparent);
	color: var(--pcb-t-text);
}

/* A share small enough that its label would not fit hides the text rather
   than letting it spill over the bar beside it. */
.pcb-bn__meter-text {
	overflow: hidden;
	text-overflow: ellipsis;
	padding-inline: 0.25rem;
}

.pcb-bn__explain {
	margin: var(--ite-5, 1.25rem) 0 0;
	line-height: 1.6;
}

.pcb-bn__fps {
	margin-top: var(--ite-5, 1.25rem);
	padding: var(--ite-4, 1rem) var(--ite-5, 1.25rem);
	border: 1px solid var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
	background: var(--pcb-t-alt);
}

.pcb-bn__fps-figure {
	margin: 0;
	font-size: 1.375rem;
	font-weight: 680;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.015em;
}

.pcb-bn__fps-label {
	margin: 0.25rem 0 0;
	font-size: 0.8125rem;
	color: var(--pcb-t-muted);
}

.pcb-bn__empty,
.pcb-bn__waiting,
.pcb-bn__error {
	margin: var(--ite-6, 1.5rem) 0 0;
	padding: var(--ite-8, 2rem) var(--ite-4, 1rem);
	text-align: center;
	color: var(--pcb-t-muted);
	border: 1px dashed var(--pcb-t-border);
	border-radius: var(--pcb-t-radius);
}

.pcb-bn__error {
	border-style: solid;
	border-color: var(--ite-error, #ff6b6b);
	color: var(--ite-error, #ff6b6b);
}

@media (max-width: 39.99em) {
	.pcb-bn {
		padding: var(--ite-4, 1rem);
	}
}
