/**
 * Equipment Compare - component styles.
 *
 * Scoped to .ec-* classes so the theme owns typography, colour tokens and page
 * chrome, and this file owns only the data components. Tokens fall back to
 * neutral values so the plugin renders sensibly under any theme.
 */

:root {
	--ec-accent: var(--fc-accent, #0b5fff);
	--ec-accent-ink: var(--fc-accent-ink, #ffffff);
	--ec-ink: var(--fc-ink, #14181f);
	--ec-ink-2: var(--fc-ink-2, #4a5361);
	--ec-ink-3: var(--fc-ink-3, #7a8494);
	--ec-line: var(--fc-line, #e3e7ee);
	--ec-surface: var(--fc-surface, #ffffff);
	--ec-surface-2: var(--fc-surface-2, #f5f7fa);
	--ec-best: var(--fc-best, #e6f6ea);
	--ec-best-ink: var(--fc-best-ink, #0f6b2f);
	--ec-warn: var(--fc-warn, #fff6e0);
	--ec-radius: var(--fc-radius, 8px);
	--ec-mono: var(--fc-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
}

/* ---------- Layout ---------- */

.ec-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

.ec-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
}

@media (min-width: 1024px) {
	.ec-layout {
		grid-template-columns: minmax(0, 1fr) 300px;
	}
	.ec-layout--listing {
		grid-template-columns: 260px minmax(0, 1fr);
	}
}

.ec-layout__results--full {
	grid-column: 1 / -1;
}

.ec-main {
	padding-block: 24px 64px;
}

/* ---------- Breadcrumbs ---------- */

.ec-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
	font-size: 0.85rem;
	color: var(--ec-ink-3);
}

.ec-breadcrumbs li + li::before {
	content: "/";
	margin-right: 6px;
	color: var(--ec-line);
}

.ec-breadcrumbs a {
	color: var(--ec-ink-2);
	text-decoration: none;
}

.ec-breadcrumbs a:hover {
	color: var(--ec-accent);
}

/* ---------- Page headers ---------- */

.ec-page-header {
	margin-bottom: 28px;
}

.ec-page-header h1,
.ec-model-header h1,
.ec-compare-header h1 {
	margin: 0 0 12px;
	font-size: clamp(1.6rem, 3.2vw, 2.4rem);
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.ec-page-header__intro {
	max-width: 70ch;
	color: var(--ec-ink-2);
	font-size: 1.05rem;
}

.ec-page-header__logo {
	height: 48px;
	width: auto;
	margin-bottom: 12px;
}

.ec-eyebrow {
	margin: 0 0 6px;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ec-ink-3);
}

.ec-eyebrow a {
	color: inherit;
	text-decoration: none;
}

.ec-eyebrow a:hover {
	color: var(--ec-accent);
}

/* ---------- Model header ---------- */

.ec-model-header {
	display: grid;
	gap: 24px;
	margin-bottom: 28px;
}

@media (min-width: 768px) {
	.ec-model-header {
		grid-template-columns: minmax(0, 1fr) 320px;
		align-items: start;
	}
}

.ec-model-header__desc {
	color: var(--ec-ink-2);
	max-width: 65ch;
}

.ec-model-header__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin: 12px 0;
}

.ec-model-header__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 16px 0 0;
}

.ec-model-header__image {
	margin: 0;
}

.ec-model-header__image img {
	width: 100%;
	height: auto;
	border-radius: var(--ec-radius);
	border: 1px solid var(--ec-line);
	background: var(--ec-surface-2);
}

.ec-model-header__image figcaption {
	font-size: 0.75rem;
	color: var(--ec-ink-3);
	margin-top: 6px;
}

/* ---------- Buttons ---------- */

.ec-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 18px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	background: var(--ec-surface);
	color: var(--ec-ink);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

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

.ec-button--primary {
	background: var(--ec-accent);
	border-color: var(--ec-accent);
	color: var(--ec-accent-ink);
}

.ec-button--primary:hover {
	filter: brightness(0.92);
}

.ec-button--block {
	width: 100%;
}

.ec-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ---------- Tags and badges ---------- */

.ec-tag {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--ec-surface-2);
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--ec-ink-2);
}

.ec-tag--verified {
	background: var(--ec-best);
	color: var(--ec-best-ink);
}

.ec-completeness {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.8rem;
	color: var(--ec-ink-2);
	white-space: nowrap;
}

.ec-completeness__bar {
	display: inline-block;
	width: 64px;
	height: 6px;
	border-radius: 3px;
	background: var(--ec-line);
	overflow: hidden;
}

.ec-completeness__bar > span {
	display: block;
	height: 100%;
	background: var(--ec-accent);
}

.ec-completeness.is-high .ec-completeness__bar > span { background: #1a9a4a; }
.ec-completeness.is-medium .ec-completeness__bar > span { background: #e0a100; }
.ec-completeness.is-low .ec-completeness__bar > span { background: #d9534f; }

.ec-na {
	color: var(--ec-ink-3);
	font-style: italic;
}

.ec-alt-unit {
	color: var(--ec-ink-3);
	font-size: 0.9em;
	white-space: nowrap;
}

/* ---------- Quick specs ---------- */

.ec-quick-specs dl {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1px;
	margin: 0 0 28px;
	background: var(--ec-line);
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	overflow: hidden;
}

@media (min-width: 640px) {
	.ec-quick-specs dl {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.ec-quick-spec {
	padding: 14px 16px;
	background: var(--ec-surface);
}

.ec-quick-spec dt {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-ink-3);
	margin-bottom: 4px;
}

.ec-quick-spec dd {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.ec-quick-spec dd .ec-alt-unit {
	display: block;
	font-size: 0.8rem;
	font-weight: 400;
}

/* ---------- Tables ---------- */

.ec-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
	font-variant-numeric: tabular-nums;
}

.ec-table th,
.ec-table td {
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--ec-line);
}

.ec-table--specs th {
	width: 45%;
	font-weight: 500;
	color: var(--ec-ink-2);
}

.ec-table--specs tr.is-empty td {
	color: var(--ec-ink-3);
}

.ec-spec-group {
	margin-bottom: 24px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	overflow: hidden;
}

.ec-spec-group__title {
	margin: 0;
	padding: 12px 14px;
	background: var(--ec-surface-2);
	font-size: 0.95rem;
	font-weight: 700;
}

.ec-spec-group .ec-table tr:last-child th,
.ec-spec-group .ec-table tr:last-child td {
	border-bottom: 0;
}

.ec-help {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin-left: 6px;
	border-radius: 50%;
	background: var(--ec-line);
	color: var(--ec-ink-2);
	font-size: 0.7rem;
	font-weight: 700;
	cursor: help;
}

/* ---------- Section heads ---------- */

.ec-section-head {
	margin: 40px 0 16px;
}

.ec-section-head h2,
.ec-section-head h3 {
	margin: 0 0 4px;
	font-size: 1.3rem;
}

.ec-section-head__desc {
	margin: 0;
	color: var(--ec-ink-2);
}

/* ---------- Cards ---------- */

.ec-grid {
	display: grid;
	gap: 16px;
}

.ec-grid--cards {
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.ec-grid--calculators {
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.ec-grid--manufacturers,
.ec-grid--values {
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.ec-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	background: var(--ec-surface);
	overflow: hidden;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.ec-card:hover {
	border-color: var(--ec-ink-3);
	box-shadow: 0 4px 16px rgba(20, 24, 31, 0.06);
}

.ec-card__media {
	display: block;
	aspect-ratio: 4 / 3;
	background: var(--ec-surface-2);
}

.ec-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ec-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 14px;
}

.ec-card__eyebrow {
	margin: 0 0 2px;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-ink-3);
}

.ec-card__title {
	margin: 0 0 10px;
	font-size: 1.05rem;
}

.ec-card__title a {
	color: var(--ec-ink);
	text-decoration: none;
}

.ec-card__title a:hover {
	color: var(--ec-accent);
}

.ec-card__specs {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	font-size: 0.85rem;
}

.ec-card__specs li {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 4px 0;
	border-bottom: 1px dashed var(--ec-line);
}

.ec-card__specs li span {
	color: var(--ec-ink-3);
}

.ec-card__foot {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin: auto 0 0;
}

.ec-card__compare {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--ec-accent);
	text-decoration: none;
}

.ec-calc-card,
.ec-mfr-card,
.ec-value-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 18px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	background: var(--ec-surface);
	color: var(--ec-ink);
	text-decoration: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.ec-calc-card:hover,
.ec-mfr-card:hover,
.ec-value-card:hover {
	border-color: var(--ec-accent);
	box-shadow: 0 4px 16px rgba(20, 24, 31, 0.06);
}

.ec-calc-card__title,
.ec-mfr-card__name,
.ec-value-card__label {
	font-weight: 700;
	font-size: 1.05rem;
}

.ec-calc-card__desc,
.ec-mfr-card__count,
.ec-mfr-card__country,
.ec-value-card__count {
	font-size: 0.88rem;
	color: var(--ec-ink-2);
}

.ec-calc-card__cta {
	margin-top: auto;
	padding-top: 10px;
	font-weight: 600;
	color: var(--ec-accent);
}

.ec-calc-card--large {
	padding: 24px;
}

.ec-mfr-card img {
	height: 40px;
	width: auto;
	object-fit: contain;
	align-self: flex-start;
}

/* ---------- Lists ---------- */

.ec-link-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ec-link-list li {
	padding: 10px 0;
	border-bottom: 1px solid var(--ec-line);
}

.ec-link-list a {
	color: var(--ec-ink);
	font-weight: 500;
	text-decoration: none;
}

.ec-link-list a:hover {
	color: var(--ec-accent);
}

@media (min-width: 768px) {
	.ec-link-list--two-col {
		columns: 2;
		column-gap: 32px;
	}
	.ec-link-list--two-col li {
		break-inside: avoid;
	}
}

.ec-pill-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ec-pill-list a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border: 1px solid var(--ec-line);
	border-radius: 999px;
	background: var(--ec-surface);
	color: var(--ec-ink);
	font-size: 0.9rem;
	font-weight: 500;
	text-decoration: none;
}

.ec-pill-list a:hover {
	border-color: var(--ec-accent);
	color: var(--ec-accent);
}

.ec-pill-list a span {
	padding: 1px 7px;
	border-radius: 999px;
	background: var(--ec-surface-2);
	font-size: 0.75rem;
	color: var(--ec-ink-2);
}

.ec-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	margin: 16px 0 0;
}

.ec-facts dt {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-ink-3);
}

.ec-facts dd {
	margin: 2px 0 0;
	font-weight: 600;
}

.ec-key-spec-note {
	margin-top: 20px;
	padding: 16px 20px;
	border-left: 3px solid var(--ec-accent);
	background: var(--ec-surface-2);
	border-radius: 0 var(--ec-radius) var(--ec-radius) 0;
}

.ec-key-spec-note h2 {
	margin: 0 0 8px;
	font-size: 0.95rem;
}

.ec-key-spec-note ul {
	margin: 0;
	padding-left: 18px;
	font-size: 0.9rem;
}

.ec-key-spec-note li span {
	color: var(--ec-ink-2);
}

/* ---------- Missing data ---------- */

.ec-missing {
	margin: 28px 0;
	padding: 16px 20px;
	border: 1px dashed var(--ec-line);
	border-radius: var(--ec-radius);
}

.ec-missing h2 {
	margin: 0 0 6px;
	font-size: 1rem;
}

.ec-missing__intro,
.ec-missing__note {
	margin: 0 0 8px;
	font-size: 0.9rem;
	color: var(--ec-ink-2);
}

.ec-missing__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
}

.ec-missing__list li {
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--ec-surface-2);
	font-size: 0.82rem;
}

/* ---------- FAQ ---------- */

.ec-faq {
	border-bottom: 1px solid var(--ec-line);
}

.ec-faq summary {
	padding: 14px 0;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
	position: relative;
	padding-right: 28px;
}

.ec-faq summary::-webkit-details-marker {
	display: none;
}

.ec-faq summary::after {
	content: "+";
	position: absolute;
	right: 4px;
	top: 12px;
	color: var(--ec-ink-3);
	font-size: 1.2rem;
}

.ec-faq[open] summary::after {
	content: "\2212";
}

.ec-faq__answer {
	padding: 0 0 16px;
	color: var(--ec-ink-2);
}

/* ---------- Sources ---------- */

.ec-sources ul {
	margin: 0;
	padding-left: 20px;
	font-size: 0.9rem;
}

.ec-sources__date {
	color: var(--ec-ink-3);
	margin-left: 6px;
}

.ec-sources--none {
	padding: 12px 16px;
	background: var(--ec-warn);
	border-radius: var(--ec-radius);
	font-size: 0.9rem;
}

/* ---------- Sidebar ---------- */

.ec-sidebar-block {
	padding: 18px;
	margin-bottom: 16px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	background: var(--ec-surface);
}

.ec-sidebar-block h2 {
	margin: 0 0 12px;
	font-size: 0.95rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-ink-3);
}

.ec-sidebar-block--cta {
	background: var(--ec-surface-2);
}

.ec-sidebar-block--cta p {
	margin: 0 0 12px;
	font-size: 0.9rem;
	color: var(--ec-ink-2);
}

.ec-sidebar-block--note p {
	font-size: 0.85rem;
	color: var(--ec-ink-2);
	margin: 0 0 8px;
}

.ec-sidebar-specs div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 0;
	border-bottom: 1px dashed var(--ec-line);
	font-size: 0.9rem;
}

.ec-sidebar-specs dt {
	color: var(--ec-ink-3);
}

.ec-sidebar-specs dd {
	margin: 0;
	font-weight: 600;
	text-align: right;
}

.ec-sidebar-links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ec-sidebar-links li {
	padding: 6px 0;
}

.ec-sidebar-links a {
	color: var(--ec-ink);
	text-decoration: none;
	font-weight: 500;
}

.ec-sidebar-links a:hover {
	color: var(--ec-accent);
}

/* ---------- Comparison ---------- */

.ec-compare-header {
	margin-bottom: 24px;
}

.ec-compare-header__lead {
	color: var(--ec-ink-2);
	max-width: 70ch;
}

.ec-compare-bar__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	list-style: none;
	margin: 16px 0 0;
	padding: 0;
}

.ec-compare-bar__item {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	background: var(--ec-surface);
	overflow: hidden;
}

.ec-compare-bar__link {
	display: flex;
	flex-direction: column;
	padding: 8px 14px;
	color: var(--ec-ink);
	text-decoration: none;
}

.ec-compare-bar__mfr {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-ink-3);
}

.ec-compare-bar__model {
	font-weight: 700;
}

.ec-compare-bar__remove {
	display: flex;
	align-items: center;
	padding: 0 12px;
	border-left: 1px solid var(--ec-line);
	color: var(--ec-ink-3);
	text-decoration: none;
	font-size: 1.1rem;
}

.ec-compare-bar__remove:hover {
	background: var(--ec-surface-2);
	color: var(--ec-ink);
}

.ec-compare-bar__item--add a {
	display: flex;
	align-items: center;
	padding: 8px 14px;
	color: var(--ec-accent);
	font-weight: 600;
	text-decoration: none;
	border-style: dashed;
}

.ec-key-differences {
	margin: 24px 0;
	padding: 20px 24px;
	background: var(--ec-surface-2);
	border-radius: var(--ec-radius);
}

.ec-key-differences .ec-section-head {
	margin-top: 0;
}

.ec-key-differences ul {
	margin: 0;
	padding-left: 20px;
}

.ec-key-differences li {
	margin-bottom: 8px;
}

.ec-key-differences--none {
	border-left: 3px solid var(--ec-ink-3);
}

.ec-key-differences--none p {
	margin: 0;
}

.ec-compare__wide {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
}

.ec-compare__wide:focus-visible {
	outline: 2px solid var(--ec-accent);
}

.ec-table--compare {
	min-width: 640px;
}

.ec-table--compare thead th {
	position: sticky;
	top: 0;
	background: var(--ec-surface);
	z-index: 1;
	border-bottom: 2px solid var(--ec-ink);
	vertical-align: bottom;
}

.ec-table--compare thead a {
	display: flex;
	flex-direction: column;
	color: var(--ec-ink);
	text-decoration: none;
}

.ec-compare__mfr {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-ink-3);
	font-weight: 500;
}

.ec-compare__model {
	font-weight: 700;
	font-size: 1rem;
}

.ec-compare__spec-col {
	min-width: 180px;
}

.ec-compare__group-head th {
	background: var(--ec-surface-2);
	font-weight: 700;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.ec-table--compare tbody th {
	font-weight: 500;
	color: var(--ec-ink-2);
}

.ec-table--compare td.is-best {
	background: var(--ec-best);
	color: var(--ec-best-ink);
	font-weight: 700;
}

.ec-row--differs th {
	color: var(--ec-ink);
}

.ec-direction {
	margin-left: 4px;
	color: var(--ec-ink-3);
	font-size: 0.8rem;
	cursor: help;
}

.ec-compare__narrow {
	display: none;
}

@media (max-width: 719px) {
	.ec-compare__wide {
		display: none;
	}
	.ec-compare__narrow {
		display: block;
	}
	.ec-compare[data-model-count="2"] .ec-compare__wide {
		display: block;
	}
	.ec-compare[data-model-count="2"] .ec-compare__narrow {
		display: none;
	}
	.ec-table--compare {
		min-width: 0;
		font-size: 0.85rem;
	}
	.ec-compare__spec-col {
		min-width: 110px;
	}
}

.ec-compare-card-group h3 {
	margin: 24px 0 8px;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-ink-3);
}

.ec-compare-card {
	padding: 12px 14px;
	margin-bottom: 8px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
}

.ec-compare-card--differs {
	border-left: 3px solid var(--ec-accent);
}

.ec-compare-card__label {
	margin: 0 0 8px;
	font-weight: 600;
	font-size: 0.9rem;
}

.ec-compare-card dl {
	margin: 0;
}

.ec-compare-card__row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 5px 0;
	border-top: 1px dashed var(--ec-line);
	font-size: 0.9rem;
}

.ec-compare-card__row dt {
	color: var(--ec-ink-2);
}

.ec-compare-card__row dd {
	margin: 0;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.ec-compare-card__row.is-best dd {
	color: var(--ec-best-ink);
	font-weight: 700;
}

.ec-compare-note {
	margin: 28px 0;
	padding: 18px 22px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	font-size: 0.9rem;
}

.ec-compare-note h2 {
	margin: 0 0 8px;
	font-size: 1rem;
}

.ec-compare-note ul {
	margin: 0;
	padding-left: 20px;
	color: var(--ec-ink-2);
}

.ec-compare-note li {
	margin-bottom: 6px;
}

.ec-compare-cta {
	margin: 40px 0;
	padding: 28px;
	text-align: center;
	background: var(--ec-surface-2);
	border-radius: var(--ec-radius);
}

.ec-compare-cta h2 {
	margin: 0 0 6px;
}

.ec-compare-cta p {
	margin: 0 0 16px;
	color: var(--ec-ink-2);
}

/* ---------- Builder ---------- */

.ec-builder {
	padding: 24px;
	margin-bottom: 32px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	background: var(--ec-surface);
}

.ec-builder__label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
}

.ec-builder__control {
	position: relative;
}

.ec-builder__input,
.ec-search__input {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	font: inherit;
	font-size: 1rem;
	background: var(--ec-surface);
	color: var(--ec-ink);
}

.ec-builder__input:focus,
.ec-search__input:focus {
	outline: 2px solid var(--ec-accent);
	outline-offset: -1px;
	border-color: var(--ec-accent);
}

.ec-builder__results,
.ec-search__results {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 50;
	max-height: 360px;
	overflow-y: auto;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	background: var(--ec-surface);
	box-shadow: 0 8px 24px rgba(20, 24, 31, 0.12);
}

.ec-builder__result,
.ec-search__item {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 10px 14px;
	border: 0;
	border-bottom: 1px solid var(--ec-line);
	background: none;
	font: inherit;
	text-align: left;
	color: var(--ec-ink);
	text-decoration: none;
	cursor: pointer;
}

.ec-builder__result:hover,
.ec-search__item:hover,
.ec-search__item.is-active {
	background: var(--ec-surface-2);
}

.ec-builder__result.is-taken {
	opacity: 0.4;
	cursor: default;
}

.ec-builder__result-name,
.ec-search__item-name {
	font-weight: 600;
}

.ec-builder__result-meta,
.ec-search__item-meta {
	font-size: 0.8rem;
	color: var(--ec-ink-3);
}

.ec-search__item-type {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-accent);
}

.ec-search__item--all {
	color: var(--ec-accent);
	font-weight: 600;
}

.ec-search__empty,
.ec-builder__empty {
	margin: 0;
	padding: 12px 14px;
	color: var(--ec-ink-3);
	font-size: 0.9rem;
}

.ec-builder__tray {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 20px 0;
}

@media (min-width: 640px) {
	.ec-builder__tray {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.ec-tray-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 56px;
	padding: 10px 12px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	background: var(--ec-surface-2);
	font-weight: 600;
	font-size: 0.9rem;
}

.ec-tray-item--empty {
	border-style: dashed;
	background: none;
	color: var(--ec-ink-3);
	font-weight: 400;
	justify-content: center;
}

.ec-tray-item__remove {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 50%;
	background: var(--ec-surface);
	color: var(--ec-ink-2);
	font-size: 1.1rem;
	cursor: pointer;
}

.ec-tray-item__remove:hover {
	background: var(--ec-ink);
	color: var(--ec-surface);
}

.ec-builder__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin: 0;
}

.ec-builder__hint {
	font-size: 0.9rem;
	color: var(--ec-ink-3);
}

/* ---------- Search box ---------- */

.ec-search {
	position: relative;
}

.ec-search__control {
	position: relative;
}

.ec-search__input {
	padding-right: 48px;
}

.ec-search--large .ec-search__input {
	padding: 16px 56px 16px 20px;
	font-size: 1.1rem;
}

.ec-search__submit {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 6px;
	background: var(--ec-accent);
	color: var(--ec-accent-ink);
	cursor: pointer;
}

.ec-search--large .ec-search__submit {
	width: 44px;
	height: 44px;
	right: 8px;
}

.ec-search--header .ec-search__input {
	padding-block: 9px;
	font-size: 0.95rem;
}

/* ---------- Filters ---------- */

.ec-filters {
	margin-bottom: 20px;
}

.ec-filters__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.ec-filters__head h2 {
	margin: 0;
	font-size: 1rem;
}

.ec-filters__toggle {
	display: none;
	padding: 8px 14px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	background: var(--ec-surface);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

@media (max-width: 1023px) {
	.ec-filters__toggle {
		display: inline-block;
	}
	.ec-filters__body {
		display: none;
	}
	.ec-filters__body.is-open {
		display: block;
	}
}

.ec-filters__active {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
}

.ec-filters__active ul {
	display: contents;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ec-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--ec-ink);
	color: var(--ec-surface);
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: none;
}

.ec-filters__clear {
	font-size: 0.85rem;
	color: var(--ec-ink-2);
}

.ec-filter-group {
	margin: 0 0 18px;
	padding: 0;
	border: 0;
}

.ec-filter-group legend {
	margin-bottom: 8px;
	font-weight: 700;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-ink-3);
}

.ec-filter-group ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ec-filter-option {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 7px 10px;
	margin-bottom: 2px;
	border-radius: 6px;
	color: var(--ec-ink);
	text-decoration: none;
	font-size: 0.92rem;
}

.ec-filter-option:hover {
	background: var(--ec-surface-2);
}

.ec-filter-option.is-active {
	background: var(--ec-accent);
	color: var(--ec-accent-ink);
}

.ec-filter-option__count {
	font-size: 0.78rem;
	color: var(--ec-ink-3);
}

.ec-filter-option.is-active .ec-filter-option__count {
	color: inherit;
	opacity: 0.8;
}

.ec-results-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--ec-line);
}

.ec-results-bar__count {
	margin: 0;
	font-weight: 600;
}

.ec-results-bar__sort {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
}

.ec-results-bar__sort select {
	padding: 6px 10px;
	border: 1px solid var(--ec-line);
	border-radius: 6px;
	font: inherit;
	background: var(--ec-surface);
}

/* ---------- Pagination ---------- */

.ec-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 32px 0;
}

.ec-pagination a,
.ec-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	color: var(--ec-ink);
	text-decoration: none;
	font-weight: 500;
}

.ec-pagination .is-current {
	background: var(--ec-ink);
	border-color: var(--ec-ink);
	color: var(--ec-surface);
}

.ec-pagination__gap {
	border: 0;
}

.ec-empty-state {
	padding: 48px 24px;
	text-align: center;
	border: 1px dashed var(--ec-line);
	border-radius: var(--ec-radius);
}

.ec-empty-state h2 {
	margin: 0 0 8px;
}

.ec-empty-state p {
	color: var(--ec-ink-2);
	margin: 0 0 16px;
}

/* ---------- Calculators ---------- */

.ec-calculator {
	display: grid;
	gap: 24px;
	margin-bottom: 24px;
}

@media (min-width: 900px) {
	.ec-calculator {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: start;
	}
	.ec-calculator__results {
		position: sticky;
		top: 16px;
	}
}

.ec-calc-group {
	margin: 0 0 20px;
	padding: 16px 18px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
}

.ec-calc-group legend {
	padding: 0 6px;
	font-weight: 700;
}

.ec-calc-field {
	margin-bottom: 14px;
}

.ec-calc-field label {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 4px;
	font-size: 0.9rem;
	font-weight: 500;
}

.ec-calc-field__unit {
	color: var(--ec-ink-3);
	font-weight: 400;
	font-family: var(--ec-mono);
	font-size: 0.8rem;
}

.ec-calc-field input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--ec-line);
	border-radius: 6px;
	font: inherit;
	font-size: 1rem;
	font-variant-numeric: tabular-nums;
	background: var(--ec-surface);
}

.ec-calc-field input:focus {
	outline: 2px solid var(--ec-accent);
	outline-offset: -1px;
}

.ec-calc-field__help {
	margin: 4px 0 0;
	font-size: 0.8rem;
	color: var(--ec-ink-3);
}

.ec-calculator__controls {
	margin: 0;
}

.ec-calculator__results {
	padding: 22px;
	border: 1px solid var(--ec-line);
	border-radius: var(--ec-radius);
	background: var(--ec-surface-2);
}

.ec-calculator__results h3 {
	margin: 20px 0 10px;
	font-size: 0.95rem;
}

.ec-result-headline {
	margin-bottom: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--ec-line);
}

.ec-result-headline__label {
	margin: 0;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ec-ink-3);
}

.ec-result-headline__value {
	margin: 4px 0 0;
	font-size: clamp(1.8rem, 4vw, 2.6rem);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
}

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

.ec-result-grid dt {
	font-size: 0.78rem;
	color: var(--ec-ink-3);
}

.ec-result-grid dd {
	margin: 2px 0 0;
	font-size: 1.15rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.ec-breakdown {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ec-breakdown li {
	display: grid;
	grid-template-columns: 1fr 2fr auto;
	align-items: center;
	gap: 10px;
	padding: 6px 0;
	font-size: 0.88rem;
}

.ec-breakdown__bar {
	display: block;
	height: 8px;
	border-radius: 4px;
	background: var(--ec-line);
	overflow: hidden;
}

.ec-breakdown__bar > span {
	display: block;
	height: 100%;
	background: var(--ec-accent);
	transition: width 0.2s;
}

.ec-breakdown__value {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	text-align: right;
}

.ec-table--results {
	background: var(--ec-surface);
	border-radius: 6px;
	overflow: hidden;
	font-size: 0.9rem;
}

.ec-table--results th,
.ec-table--results td {
	padding: 8px 10px;
}

.ec-result-notes {
	margin-top: 16px;
	font-size: 0.9rem;
}

.ec-result-notes p {
	margin: 0 0 8px;
}

.ec-result-notes ul {
	margin: 0;
	padding-left: 20px;
}

.ec-result-notes__hint {
	color: var(--ec-ink-3);
}

.ec-calculator__currency-note {
	margin: 16px 0 0;
	font-size: 0.78rem;
	color: var(--ec-ink-3);
}

.ec-notice {
	padding: 14px 18px;
	border-radius: var(--ec-radius);
	background: var(--ec-warn);
	font-size: 0.9rem;
}

.ec-notice p {
	margin: 0 0 6px;
}

.ec-assumptions {
	margin-top: 8px;
}

.ec-assumptions summary {
	cursor: pointer;
	font-weight: 600;
}

.ec-assumptions ul {
	margin: 8px 0 0;
	padding-left: 20px;
}

.ec-formula-list {
	padding-left: 20px;
	color: var(--ec-ink-2);
}

.ec-formula-list li {
	margin-bottom: 6px;
}

/* ---------- Ads ---------- */

.ec-ad {
	margin: 24px 0;
	text-align: center;
}

.ec-ad__label {
	display: block;
	margin-bottom: 4px;
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--ec-ink-3);
}

.ec-ad--placeholder {
	padding: 24px;
	border: 1px dashed #c9a400;
	background: repeating-linear-gradient(45deg, #fff9db, #fff9db 10px, #fff3b0 10px, #fff3b0 20px);
	border-radius: var(--ec-radius);
	color: #6b5900;
	font-size: 0.8rem;
}

.ec-ad--placeholder .ec-ad__slot {
	display: block;
	font-weight: 700;
}

.ec-ad--sidebar {
	margin: 0 0 16px;
}

@media (max-width: 1023px) {
	.ec-ad--sidebar {
		display: none;
	}
}

/* ---------- Utilities ---------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ec-empty {
	color: var(--ec-ink-3);
}

.ec-next-steps {
	margin: 32px 0;
}

.ec-spec-links ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ec-spec-links h2 {
	font-size: 1rem;
	margin: 32px 0 10px;
}

.ec-spec-links a {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid var(--ec-line);
	border-radius: 999px;
	color: var(--ec-ink);
	text-decoration: none;
	font-size: 0.88rem;
}

.ec-spec-links a:hover {
	border-color: var(--ec-accent);
	color: var(--ec-accent);
}

.ec-category-nav {
	margin-bottom: 24px;
}

.ec-category-nav h2 {
	font-size: 0.95rem;
	margin: 0 0 10px;
}

.ec-spec-attribute {
	margin-bottom: 32px;
}

.ec-spec-attribute h2 {
	font-size: 1.15rem;
	margin: 0 0 10px;
}

.ec-spec-attribute h2 a {
	color: var(--ec-ink);
	text-decoration: none;
}

.ec-calculator-note {
	margin-top: 40px;
	padding: 20px 24px;
	border-left: 3px solid var(--ec-ink-3);
	background: var(--ec-surface-2);
	border-radius: 0 var(--ec-radius) var(--ec-radius) 0;
}

.ec-calculator-note h2 {
	margin: 0 0 8px;
	font-size: 1rem;
}

.ec-calculator-note p {
	margin: 0 0 8px;
	font-size: 0.92rem;
	color: var(--ec-ink-2);
}
