/* OTA 4WD Matcher
 *
 * Every rule is scoped under .ota4wd. Divi's global button, heading, input and
 * list styles are specific enough to swallow anything unscoped, and Divi's
 * static CSS generation makes debugging the fallout slow.
 *
 * Typography deliberately inherits from the theme — the matcher should read as
 * part of OTA, not a bolted-on widget. The only place this design raises its
 * voice is the compliance verdict, because that is the one thing on the page a
 * reader could get legally wrong.
 */

.ota4wd {
	--ota-ink: #1a1a18;
	--ota-muted: #6b6b64;
	--ota-rule: #ddddd6;
	--ota-surface: #faf9f6;
	--ota-pass: #1f6b3a;
	--ota-pass-bg: #eaf4ed;
	--ota-fail: #a32020;
	--ota-fail-bg: #fbeceb;
	--ota-warn: #8a5b00;
	--ota-warn-bg: #fdf4e3;
	--ota-accent: #b4541e;

	font-family: inherit;
	color: var(--ota-ink);
	line-height: 1.5;
	max-width: 860px;
	margin: 0 auto;
}

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

.ota4wd--placeholder {
	padding: 1.5rem;
	border: 1px dashed var(--ota-rule);
	background: var(--ota-surface);
	text-align: center;
	color: var(--ota-muted);
}

/* ---------------------------------------------------------------- steps */

.ota4wd__step { border-top: 1px solid var(--ota-rule); padding: 1.5rem 0; }
.ota4wd__step:first-child { border-top: 0; }

.ota4wd__legend {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0 0 .35rem;
	letter-spacing: -0.01em;
}

.ota4wd__hint {
	font-size: .875rem;
	color: var(--ota-muted);
	margin: 0 0 1rem;
}

.ota4wd__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 1rem;
}

.ota4wd__field label {
	display: block;
	font-size: .8125rem;
	font-weight: 600;
	margin-bottom: .3rem;
}

.ota4wd__field input[type="number"],
.ota4wd__field select {
	width: 100%;
	padding: .55rem .6rem;
	border: 1px solid var(--ota-rule);
	border-radius: 3px;
	background: #fff;
	font: inherit;
	font-size: .95rem;
	color: var(--ota-ink);
}

.ota4wd__field input:focus-visible,
.ota4wd__field select:focus-visible,
.ota4wd button:focus-visible {
	outline: 2px solid var(--ota-accent);
	outline-offset: 2px;
}

/* Body type choices */

.ota4wd__choices { display: flex; flex-wrap: wrap; gap: .5rem; }

.ota4wd__choice {
	position: relative;
	display: inline-flex;
	align-items: center;
	padding: .55rem 1.1rem;
	border: 1px solid var(--ota-rule);
	border-radius: 3px;
	background: #fff;
	font-size: .9rem;
	font-weight: 600;
	cursor: pointer;
	margin: 0;
}

.ota4wd__choice input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.ota4wd__choice:hover { background: var(--ota-surface); }

.ota4wd__choice:has(input:checked) {
	border-color: var(--ota-accent);
	background: var(--ota-accent);
	color: #fff;
}

/* Fallback for browsers without :has() — JS-free, just less emphatic. */
.ota4wd__choice input:checked + span { text-decoration: underline; text-underline-offset: 3px; }
.ota4wd__choice:has(input:checked) input:checked + span { text-decoration: none; }

.ota4wd__choice:focus-within {
	outline: 2px solid var(--ota-accent);
	outline-offset: 2px;
}

.ota4wd__field.is-disabled { opacity: .45; }
.ota4wd__field select:disabled { cursor: not-allowed; background: var(--ota-surface); }

/* Priority sliders.
 *
 * A bare range input reads as decoration rather than a control, which is why
 * the previous version's lone dot went unnoticed. Three fixes: the track is
 * filled up to the thumb so the value is legible at a glance, the current
 * setting is spelled out in words above it, and the thumb is a 4WD silhouette
 * that makes the affordance obvious.
 */

.ota4wd__weight { padding: .85rem 0; border-bottom: 1px solid var(--ota-rule); }
.ota4wd__weight:last-child { border-bottom: 0; }

.ota4wd__weight-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	margin-bottom: .45rem;
}
.ota4wd__weight-head label { font-size: .9375rem; font-weight: 600; margin: 0; }

.ota4wd__weight-value {
	font-size: .8125rem;
	font-weight: 700;
	color: var(--ota-accent);
	white-space: nowrap;
}
.ota4wd__weight-value.is-off { color: var(--ota-muted); font-weight: 400; font-style: italic; }

.ota4wd__slider {
	--fill: 60%;
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: 26px;
	margin: 0;
	background: transparent;
	cursor: grab;
}
.ota4wd__slider:active { cursor: grabbing; }

/* Track - filled portion in OTA rust, remainder in a light rule. */
.ota4wd__slider::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 3px;
	background: linear-gradient(to right,
		var(--ota-accent) 0 var(--fill), var(--ota-rule) var(--fill) 100%);
}
.ota4wd__slider::-moz-range-track {
	height: 6px;
	border-radius: 3px;
	background: var(--ota-rule);
}
.ota4wd__slider::-moz-range-progress {
	height: 6px;
	border-radius: 3px;
	background: var(--ota-accent);
}

/* Thumb - 4WD silhouette on a white disc. */
.ota4wd__slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 34px;
	height: 26px;
	margin-top: -10px;
	border: 0;
	border-radius: 4px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2034%2022%22%3E%3Cpath%20fill%3D%22%2523b4541e%22%20d%3D%22M3%2014.2V11c0-.5.4-.9.9-.9h2.6l3.1-4.2c.3-.4.8-.7%201.3-.7h9.5c.5%200%201%20.2%201.3.6l3%204.3h4c.5%200%20.9.4.9.9v3.2c0%20.5-.4.9-.9.9h-1.4a4%204%200%200%200-7.9%200h-6.3a4%204%200%200%200-7.9%200H3.9a.9.9%200%200%201-.9-.9Z%22%2F%3E%3Ccircle%20fill%3D%22%2523b4541e%22%20cx%3D%229.6%22%20cy%3D%2216.3%22%20r%3D%222.7%22%2F%3E%3Ccircle%20fill%3D%22%2523b4541e%22%20cx%3D%2223.8%22%20cy%3D%2216.3%22%20r%3D%222.7%22%2F%3E%3C%2Fsvg%3E");
	background-size: 26px 17px;
	background-position: center;
	background-repeat: no-repeat;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.ota4wd__slider::-moz-range-thumb {
	width: 34px;
	height: 26px;
	border: 0;
	border-radius: 4px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2034%2022%22%3E%3Cpath%20fill%3D%22%2523b4541e%22%20d%3D%22M3%2014.2V11c0-.5.4-.9.9-.9h2.6l3.1-4.2c.3-.4.8-.7%201.3-.7h9.5c.5%200%201%20.2%201.3.6l3%204.3h4c.5%200%20.9.4.9.9v3.2c0%20.5-.4.9-.9.9h-1.4a4%204%200%200%200-7.9%200h-6.3a4%204%200%200%200-7.9%200H3.9a.9.9%200%200%201-.9-.9Z%22%2F%3E%3Ccircle%20fill%3D%22%2523b4541e%22%20cx%3D%229.6%22%20cy%3D%2216.3%22%20r%3D%222.7%22%2F%3E%3Ccircle%20fill%3D%22%2523b4541e%22%20cx%3D%2223.8%22%20cy%3D%2216.3%22%20r%3D%222.7%22%2F%3E%3C%2Fsvg%3E");
	background-size: 26px 17px;
	background-position: center;
	background-repeat: no-repeat;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

/* At zero the vehicle greys out, reinforcing "this one is switched off". */
.ota4wd__slider[value="0"]::-webkit-slider-thumb { background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2034%2022%22%3E%3Cpath%20fill%3D%22%25236b6b64%22%20d%3D%22M3%2014.2V11c0-.5.4-.9.9-.9h2.6l3.1-4.2c.3-.4.8-.7%201.3-.7h9.5c.5%200%201%20.2%201.3.6l3%204.3h4c.5%200%20.9.4.9.9v3.2c0%20.5-.4.9-.9.9h-1.4a4%204%200%200%200-7.9%200h-6.3a4%204%200%200%200-7.9%200H3.9a.9.9%200%200%201-.9-.9Z%22%2F%3E%3Ccircle%20fill%3D%22%25236b6b64%22%20cx%3D%229.6%22%20cy%3D%2216.3%22%20r%3D%222.7%22%2F%3E%3Ccircle%20fill%3D%22%25236b6b64%22%20cx%3D%2223.8%22%20cy%3D%2216.3%22%20r%3D%222.7%22%2F%3E%3C%2Fsvg%3E"); }

.ota4wd__scale {
	display: flex;
	justify-content: space-between;
	font-size: .6875rem;
	color: var(--ota-muted);
	margin-top: .15rem;
}

/* Dual-handle price range */

.ota4wd__price-out {
	display: block;
	font-size: 1.15rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	margin-bottom: .75rem;
}

.ota4wd__dual { position: relative; height: 26px; }

.ota4wd__dual-track {
	position: absolute;
	top: 10px;
	left: 0;
	right: 0;
	height: 6px;
	border-radius: 3px;
	background: var(--ota-rule);
}
.ota4wd__dual-fill {
	position: absolute;
	top: 0;
	height: 6px;
	border-radius: 3px;
	background: var(--ota-accent);
}

.ota4wd__dual input[type="range"] {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 26px;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	pointer-events: none;
}
.ota4wd__dual input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 6px; }
.ota4wd__dual input[type="range"]::-moz-range-track { background: transparent; height: 6px; }

.ota4wd__dual input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	pointer-events: auto;
	width: 34px;
	height: 26px;
	margin-top: -10px;
	border: 0;
	border-radius: 4px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2034%2022%22%3E%3Cpath%20fill%3D%22%2523b4541e%22%20d%3D%22M3%2014.2V11c0-.5.4-.9.9-.9h2.6l3.1-4.2c.3-.4.8-.7%201.3-.7h9.5c.5%200%201%20.2%201.3.6l3%204.3h4c.5%200%20.9.4.9.9v3.2c0%20.5-.4.9-.9.9h-1.4a4%204%200%200%200-7.9%200h-6.3a4%204%200%200%200-7.9%200H3.9a.9.9%200%200%201-.9-.9Z%22%2F%3E%3Ccircle%20fill%3D%22%2523b4541e%22%20cx%3D%229.6%22%20cy%3D%2216.3%22%20r%3D%222.7%22%2F%3E%3Ccircle%20fill%3D%22%2523b4541e%22%20cx%3D%2223.8%22%20cy%3D%2216.3%22%20r%3D%222.7%22%2F%3E%3C%2Fsvg%3E");
	background-size: 26px 17px;
	background-position: center;
	background-repeat: no-repeat;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	cursor: grab;
}
.ota4wd__dual input[type="range"]::-moz-range-thumb {
	pointer-events: auto;
	width: 34px;
	height: 26px;
	border: 0;
	border-radius: 4px;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2034%2022%22%3E%3Cpath%20fill%3D%22%2523b4541e%22%20d%3D%22M3%2014.2V11c0-.5.4-.9.9-.9h2.6l3.1-4.2c.3-.4.8-.7%201.3-.7h9.5c.5%200%201%20.2%201.3.6l3%204.3h4c.5%200%20.9.4.9.9v3.2c0%20.5-.4.9-.9.9h-1.4a4%204%200%200%200-7.9%200h-6.3a4%204%200%200%200-7.9%200H3.9a.9.9%200%200%201-.9-.9Z%22%2F%3E%3Ccircle%20fill%3D%22%2523b4541e%22%20cx%3D%229.6%22%20cy%3D%2216.3%22%20r%3D%222.7%22%2F%3E%3Ccircle%20fill%3D%22%2523b4541e%22%20cx%3D%2223.8%22%20cy%3D%2216.3%22%20r%3D%222.7%22%2F%3E%3C%2Fsvg%3E");
	background-size: 26px 17px;
	background-position: center;
	background-repeat: no-repeat;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
	cursor: grab;
}

.ota4wd__actions { padding-top: 1.25rem; }

.ota4wd button {
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	border-radius: 3px;
	border: 1px solid transparent;
	padding: .65rem 1.4rem;
	transition: background-color .15s ease;
}

.ota4wd__btn--primary { background: var(--ota-accent); color: #fff; }
.ota4wd__btn--primary:hover { background: #96461a; }
.ota4wd__btn--ghost { background: transparent; color: var(--ota-ink); border-color: var(--ota-rule); }
.ota4wd__btn--ghost:hover { background: var(--ota-surface); }

/* ------------------------------------------------------------- results */

.ota4wd__summary {
	font-size: .9rem;
	color: var(--ota-muted);
	padding: 1rem 0;
	border-bottom: 1px solid var(--ota-rule);
}

.ota4wd__card {
	border: 1px solid var(--ota-rule);
	border-radius: 4px;
	margin: 1rem 0;
	overflow: hidden;
	background: #fff;
}

.ota4wd__card-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
	padding: 1rem 1.1rem .75rem;
}

.ota4wd__card-name { font-size: 1.1rem; font-weight: 700; margin: 0 0 .15rem; letter-spacing: -0.01em; }
.ota4wd__card-sub { font-size: .8125rem; color: var(--ota-muted); margin: 0; }
.ota4wd__card-price { font-size: 1rem; font-weight: 700; white-space: nowrap; }
.ota4wd__card-price small { display: block; font-size: .6875rem; font-weight: 400; color: var(--ota-muted); text-align: right; }

/* The signature element: a verdict a reader can act on. */
.ota4wd__verdict {
	padding: .85rem 1.1rem;
	border-top: 1px solid var(--ota-rule);
	border-left: 4px solid transparent;
	font-size: .9rem;
}
.ota4wd__verdict--pass { background: var(--ota-pass-bg); border-left-color: var(--ota-pass); }
.ota4wd__verdict--fail { background: var(--ota-fail-bg); border-left-color: var(--ota-fail); }
.ota4wd__verdict--unknown { background: var(--ota-warn-bg); border-left-color: var(--ota-warn); }

.ota4wd__verdict-line { font-weight: 700; margin: 0 0 .3rem; }
.ota4wd__verdict--pass .ota4wd__verdict-line { color: var(--ota-pass); }
.ota4wd__verdict--fail .ota4wd__verdict-line { color: var(--ota-fail); }
.ota4wd__verdict--unknown .ota4wd__verdict-line { color: var(--ota-warn); }

.ota4wd__verdict-notes { margin: 0; padding: 0; list-style: none; }
.ota4wd__verdict-notes li { margin: .25rem 0; font-size: .8125rem; }

.ota4wd__sums {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: .1rem;
	background: var(--ota-rule);
	border-top: 1px solid var(--ota-rule);
}
.ota4wd__sum { background: #fff; padding: .6rem .75rem; }
.ota4wd__sum dt { font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ota-muted); margin: 0 0 .15rem; }
.ota4wd__sum dd { margin: 0; font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ota4wd__sum dd.is-missing { color: var(--ota-muted); font-weight: 400; }

.ota4wd__card-foot {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	align-items: center;
	justify-content: space-between;
	padding: .75rem 1.1rem;
	border-top: 1px solid var(--ota-rule);
	font-size: .8125rem;
}
.ota4wd__card-foot a { color: var(--ota-accent); font-weight: 600; }

.ota4wd__flag {
	display: inline-block;
	font-size: .6875rem;
	color: var(--ota-warn);
	background: var(--ota-warn-bg);
	padding: .15rem .45rem;
	border-radius: 2px;
}

.ota4wd__error {
	padding: 1rem;
	background: var(--ota-fail-bg);
	border-left: 4px solid var(--ota-fail);
	font-size: .9rem;
}

.ota4wd__loading { padding: 2rem 0; text-align: center; color: var(--ota-muted); font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
	.ota4wd * { transition: none !important; animation: none !important; }
}

/* A priority with no ratings behind it is shown, but visibly inert — better
 * than hiding it (the reader wonders why it vanished) or leaving it live (the
 * slider would do nothing and quietly mislead). */
.ota4wd__weight.is-unavailable { opacity: .5; }
.ota4wd__weight.is-unavailable .ota4wd__slider { cursor: not-allowed; }
.ota4wd__weight.is-unavailable .ota4wd__scale { font-style: italic; }

/* Provenance note under a figure - small, quiet, but never hidden. */
.ota4wd__basis {
	display: block;
	font-size: .625rem;
	font-weight: 400;
	color: var(--ota-muted);
	letter-spacing: .02em;
}

/* Sibling variants - present but never competing for attention with the pick. */
.ota4wd__sibs { border-top: 1px solid var(--ota-rule); font-size: .8125rem; }
.ota4wd__sibs summary {
	padding: .6rem 1.1rem;
	cursor: pointer;
	font-weight: 600;
	color: var(--ota-accent);
	list-style: none;
}
.ota4wd__sibs summary::-webkit-details-marker { display: none; }
.ota4wd__sibs summary::before { content: '+ '; font-weight: 700; }
.ota4wd__sibs[open] summary::before { content: '\2212 '; }
.ota4wd__sibs summary:hover { background: var(--ota-surface); }
.ota4wd__sib-why { margin: 0 1.1rem .5rem; color: var(--ota-muted); font-size: .75rem; font-style: italic; }
.ota4wd__sibs ul { margin: 0; padding: 0 1.1rem .75rem; list-style: none; }
.ota4wd__sibs li {
	display: flex;
	align-items: baseline;
	gap: .5rem;
	padding: .25rem 0;
	border-bottom: 1px solid var(--ota-surface);
}
.ota4wd__sib-mark { width: 1rem; font-weight: 700; }
.ota4wd__sib-mark.is-pass { color: var(--ota-pass); }
.ota4wd__sib-mark.is-fail { color: var(--ota-fail); }
.ota4wd__sib-mark.is-unknown { color: var(--ota-warn); }
.ota4wd__sib-price { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ota-muted); }

/* Service network disclosure */
.ota4wd__svc { border-top: 1px solid var(--ota-rule); font-size: .8125rem; }
.ota4wd__svc summary {
	padding: .6rem 1.1rem;
	cursor: pointer;
	font-weight: 600;
	color: var(--ota-accent);
	list-style: none;
}
.ota4wd__svc summary::-webkit-details-marker { display: none; }
.ota4wd__svc summary::before { content: '+ '; font-weight: 700; }
.ota4wd__svc[open] summary::before { content: '\2212 '; }
.ota4wd__svc summary:hover { background: var(--ota-surface); }
.ota4wd__svc-body { padding: 0 1.1rem .85rem; }
.ota4wd__svc-body p { margin: 0 0 .4rem; }
.ota4wd__svc-rating { font-variant-numeric: tabular-nums; }
.ota4wd__svc-body a { color: var(--ota-accent); font-weight: 600; }
