/* Lucy's Car Check — "showroom" theme: ink header, warm paper, amber accent, verdict colours. */

:root {
	--paper: #f5f1ea;
	--surface: #ffffff;
	--surface-2: #faf7f2;
	--ink: #17202b;
	--ink-2: #24303d;
	--text: #1c232c;
	--muted: #5f6772;
	--line: #e8e2d8;
	--brand: #0e6b5c;
	--brand-ink: #0a5247;
	--brand-soft: #e3f1ed;
	--accent: #f2a93b;
	--accent-ink: #8a5300;
	--great: #1d8a4b;
	--good: #0e7f6e;
	--fair: #b9770c;
	--twice: #d35a1f;
	--avoid: #c3303a;
	--ok-soft: #e6f4ea;
	--warn-soft: #fdf1dc;
	--bad-soft: #fbe7e7;
	--shadow: 0 1px 2px rgb(23 32 43 / 0.05), 0 4px 16px rgb(23 32 43 / 0.06);
	--radius: 18px;
	--radius-sm: 12px;
	--topbar-h: calc(56px + env(safe-area-inset-top));
	--pad-x: max(1rem, env(safe-area-inset-left));
	color-scheme: light;
	font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
	font-size: 17px;
	line-height: 1.5;
	color: var(--text);
	background: var(--paper);
	-webkit-text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
}

@media (prefers-color-scheme: dark) {
	:root {
		--paper: #0f141a;
		--surface: #18202a;
		--surface-2: #1d2631;
		--ink: #0b1016;
		--ink-2: #151c25;
		--text: #e9edf1;
		--muted: #9aa5b1;
		--line: #2a3542;
		--brand: #3cc2a8;
		--brand-ink: #6fd8c3;
		--brand-soft: #173a35;
		--accent-ink: #f6c06d;
		--great: #4cc47c;
		--good: #3cc2a8;
		--fair: #e6a83a;
		--twice: #f0874e;
		--avoid: #f0656d;
		--ok-soft: #173327;
		--warn-soft: #3a2d14;
		--bad-soft: #3d1d21;
		--shadow: 0 1px 2px rgb(0 0 0 / 0.3);
		color-scheme: dark;
	}
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar-h) + 64px); }
body { margin: 0; min-height: 100vh; overflow-x: hidden; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 1.65rem; margin: 0 0 0.4rem; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; font-weight: 750; }
h3 { font-size: 0.8rem; margin: 1.25rem 0 0.5rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
p { margin: 0 0 0.6rem; }
a { color: var(--brand-ink); text-underline-offset: 0.15em; }
img { max-width: 100%; display: block; }
svg.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- Top bar */
.topbar {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	height: var(--topbar-h);
	padding: env(safe-area-inset-top) max(0.5rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
	background: var(--ink);
	color: #fff;
}
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; gap: 0.6rem; min-height: 44px; font-weight: 800; letter-spacing: -0.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: block; }
.brand small { display: block; font-size: 0.72rem; font-weight: 600; color: #b9c3cd; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1; }
.brand span { line-height: 1.1; }
.icon-btn { color: #fff; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.icon-btn:active { background: rgb(255 255 255 / 0.1); }
.icon-btn[hidden] { display: none; }

main {
	max-width: 760px;
	margin: 0 auto;
	padding: 1rem max(1rem, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 2.5rem) var(--pad-x);
}

/* Full-bleed bands inside <main> */
.bleed { margin-left: calc(-1 * var(--pad-x)); margin-right: calc(-1 * max(1rem, env(safe-area-inset-right))); }

/* ---------------------------------------------------------------- Cards */
.card {
	background: var(--surface);
	border-radius: var(--radius);
	padding: 1.15rem;
	margin: 0 0 1rem;
	box-shadow: var(--shadow);
	overflow-wrap: anywhere;
}
.card p { white-space: pre-line; }
.card > :last-child { margin-bottom: 0; }
.sec-title { display: flex; align-items: center; gap: 0.55rem; }
.sec-title .i { color: var(--brand); width: 1.25em; height: 1.25em; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.section-head h2 { margin: 0; }
.list-title { margin: 1.75rem 0 0.75rem; font-size: 1.2rem; }

/* ---------------------------------------------------------------- Forms */
label { display: block; font-weight: 650; margin: 0 0 0.35rem; font-size: 0.95rem; }
input {
	width: 100%;
	font: inherit;
	font-size: 17px;
	min-height: 50px;
	padding: 0.65rem 0.9rem;
	border: 1.5px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 700; margin-bottom: 0.5rem; padding: 0; }
.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }
.field .small { margin: 0.35rem 0 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.pair .field { margin: 0; }
.pair label { font-weight: 550; color: var(--muted); }
.prefix { position: relative; }
.prefix > span { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.prefix > input { padding-left: 1.75rem; }
.form-error { color: var(--avoid); margin: 0.6rem 0 0; font-weight: 600; }
.form-error:empty { display: none; }

button, .button {
	font: inherit;
	font-weight: 700;
	min-height: 50px;
	padding: 0.6rem 1.1rem;
	border-radius: 999px;
	border: 1.5px solid transparent;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	text-decoration: none;
	text-align: center;
	transition: transform 0.1s, background 0.15s;
}
button:active, .button:active { transform: scale(0.98); }
button:disabled { opacity: 0.6; cursor: progress; }
button:focus-visible, .button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--brand); color: #fff; }
.accent { background: var(--accent); color: #2b1a00; }
.secondary { background: var(--surface); color: var(--brand-ink); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.ghost { background: rgb(255 255 255 / 0.1); color: #fff; border-color: rgb(255 255 255 / 0.25); }
.danger { background: transparent; color: var(--avoid); border-color: color-mix(in srgb, var(--avoid) 35%, transparent); }
.link-btn { background: none; color: var(--brand-ink); min-height: 44px; padding: 0 0.5rem; white-space: nowrap; font-size: 0.95rem; }
.block { width: 100%; }
.row { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.row > * { flex: 1; }
.row > .secondary { flex: 0 0 auto; padding-inline: 0.9rem; }
.row > .accent { flex: 1; min-width: 0; white-space: nowrap; padding-inline: 0.75rem; }
.actions { display: flex; gap: 0.75rem; margin: 1.25rem 0; }
.actions > * { flex: 1; }

/* ---------------------------------------------------------------- Login */
.login { max-width: 420px; margin: 8vh auto 0; text-align: center; padding: 1.75rem 1.25rem; }
.login .brand-mark { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 1rem; }
.login form { text-align: left; margin-top: 1.25rem; }
.login button { width: 100%; margin-top: 1rem; }

/* ---------------------------------------------------------------- Home hero */
.hero-band {
	background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
	color: #fff;
	margin-top: -1rem;
	padding: 1.5rem var(--pad-x) 4.5rem;
}
.hero-band h1 { font-size: 2rem; margin-bottom: 0.35rem; }
.hero-band h1 em { font-style: normal; color: var(--accent); }
.hero-band p { color: #c4ccd5; margin: 0; max-width: 34em; }
.check-panel { margin-top: -3.5rem; position: relative; padding: 1rem; }
.check-panel .form-error { margin-top: 0.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip-link {
	display: inline-flex; align-items: center; gap: 0.35rem;
	min-height: 34px; padding: 0.25rem 0.65rem; border-radius: 999px;
	background: var(--surface-2); color: var(--text); text-decoration: none; font-size: 0.84rem; font-weight: 650; white-space: nowrap;
	border: 1px solid var(--line);
}
.budget-row { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); display: block; color: inherit; text-decoration: none; }
.budget-row .edit { background: transparent; border-color: transparent; color: var(--brand-ink); font-weight: 750; }

/* ---------------------------------------------------------------- Badges, rings, pills */
.badge {
	display: inline-flex; align-items: center; gap: 0.4rem;
	font-size: 0.82rem; font-weight: 750;
	padding: 0.25rem 0.65rem; border-radius: 999px;
	color: #fff; background: var(--muted); white-space: nowrap;
}
.badge.working { background: var(--brand-soft); color: var(--brand-ink); font-weight: 650; }
.v-great_deal { --v: var(--great); }
.v-good_deal { --v: var(--good); }
.v-fair { --v: var(--fair); }
.v-think_twice { --v: var(--twice); }
.v-avoid, .v-error { --v: var(--avoid); }
.badge[class*='v-'] { background: var(--v); }

.ring { position: relative; width: 56px; height: 56px; flex: none; color: var(--v, var(--muted)); }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: color-mix(in srgb, currentColor 18%, transparent); }
.ring .bar { stroke: currentColor; stroke-linecap: round; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.05rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.ring.lg { width: 92px; height: 92px; }
.ring.lg b { font-size: 1.8rem; }
.ring.lg b small { display: block; font-size: 0.7rem; color: var(--muted); font-weight: 650; text-align: center; margin-top: -0.2rem; }

.spinner {
	width: 14px; height: 14px; border-radius: 50%;
	border: 2px solid currentColor; border-right-color: transparent;
	animation: spin 0.9s linear infinite; flex: none;
}
.spinner.inline { display: inline-block; vertical-align: -2px; color: var(--brand); margin-right: 0.25rem; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } button, .button { transition: none; } }

.tag { display: inline-block; font-size: 0.75rem; font-weight: 750; padding: 0.15rem 0.55rem; border-radius: 999px; white-space: nowrap; letter-spacing: 0.01em; }
.tag.sev-high, .tag.rel-poor { background: var(--bad-soft); color: var(--avoid); }
.tag.sev-medium, .tag.rel-average { background: var(--warn-soft); color: var(--fair); }
.tag.sev-low, .tag.rel-unknown { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tag.rel-good { background: var(--ok-soft); color: var(--great); }

/* ---------------------------------------------------------------- Car list */
.car-list, .picks, .plain, .faults, .costs, .fit-list, .reviews { list-style: none; padding: 0; margin: 0; }
.car-list { display: grid; gap: 1rem; }
.car-card {
	display: block; background: var(--surface); border-radius: var(--radius); overflow: hidden;
	color: inherit; text-decoration: none; box-shadow: var(--shadow);
	transition: transform 0.15s;
}
.car-card:active { transform: scale(0.99); }
.car-media { position: relative; aspect-ratio: 16 / 9; background: var(--surface-2); }
.car-media img { width: 100%; height: 100%; object-fit: cover; }
.car-media .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.car-media .placeholder .i { width: 48px; height: 48px; stroke-width: 1.5; }
.car-media .badge { position: absolute; left: 0.75rem; bottom: 0.75rem; box-shadow: 0 2px 8px rgb(0 0 0 / 0.25); }
.car-body { padding: 0.9rem 1rem 1rem; }
.car-top { display: flex; gap: 0.75rem; align-items: flex-start; justify-content: space-between; }
.car-name { font-weight: 800; font-size: 1.08rem; line-height: 1.25; }
.car-meta { color: var(--muted); font-size: 0.9rem; margin-top: 0.15rem; }
.car-headline { font-size: 0.95rem; margin-top: 0.6rem; }
.car-top .ring { margin-top: -2.4rem; background: var(--surface); border-radius: 50%; padding: 4px; box-shadow: var(--shadow); width: 62px; height: 62px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.7rem, 1fr)); gap: 0.45rem; margin-top: 0.75rem; }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.45rem 0.5rem; min-width: 0; }
.stat span { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.stat b { font-size: 0.9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; padding: 2rem 1rem; }
.empty .i { width: 40px; height: 40px; color: var(--muted); margin: 0 auto 0.5rem; stroke-width: 1.5; }

/* ---------------------------------------------------------------- Recommendations */
.recs { background: linear-gradient(160deg, var(--surface) 60%, color-mix(in srgb, var(--accent) 10%, var(--surface))); }
.recs .sec-title .i { color: var(--accent-ink); }
progress { width: 100%; height: 10px; accent-color: var(--accent); margin: 0.5rem 0 0.25rem; }
.pick { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; margin-top: 0.75rem; }
.pick-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.pick h3 { margin: 0 0 0.35rem; font-size: 1.08rem; text-transform: none; letter-spacing: -0.01em; color: var(--text); }
.pick dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 0.8rem; margin: 0.6rem 0 0.9rem; font-size: 0.92rem; }
.pick dt { color: var(--muted); font-weight: 600; }
.pick dd { margin: 0; }
.pick .button { width: 100%; }

.plain li { padding: 0.4rem 0 0.4rem 1.3rem; position: relative; }
.plain li::before { content: ''; position: absolute; left: 0.25rem; top: 0.95em; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.danger-card .plain li::before { background: var(--avoid); }
.good .plain li::before { background: var(--great); }
.bad .plain li::before { background: var(--twice); }

/* ---------------------------------------------------------------- Detail: hero */
.car-hero { position: relative; margin-top: -1rem; background: var(--ink); color: #fff; min-height: 220px; display: flex; align-items: flex-end; }
.car-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.car-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(10 15 20 / 0.35) 0%, rgb(10 15 20 / 0) 30%, rgb(10 15 20 / 0.85) 100%); }
.car-hero.has-img { aspect-ratio: 4 / 3; max-height: 70vh; }
.hero-text { position: relative; z-index: 1; padding: 1rem var(--pad-x) 1.1rem; width: 100%; }
.hero-text h1 { font-size: 1.7rem; margin: 0; text-shadow: 0 1px 12px rgb(0 0 0 / 0.4); }
.hero-text p { margin: 0.2rem 0 0; color: #dfe5ea; font-size: 0.95rem; }
.hero-back {
	position: absolute; z-index: 2; top: 0.75rem; left: var(--pad-x);
	width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
	background: rgb(10 15 20 / 0.55); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.spec-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.spec-chips span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.75rem; font-size: 0.88rem; font-weight: 650; }
.spec-chips .price { background: var(--ink); color: #fff; border-color: var(--ink); }
.advert-link { width: 100%; margin-bottom: 1rem; }

/* Section jump bar */
.jump {
	position: sticky; top: var(--topbar-h); z-index: 10;
	display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none;
	padding: 0.6rem var(--pad-x); margin-bottom: 1rem;
	background: color-mix(in srgb, var(--paper) 92%, transparent);
	backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}
.jump::-webkit-scrollbar { display: none; }
.jump button {
	min-height: 40px; padding: 0.3rem 0.9rem; flex: none; font-size: 0.88rem; font-weight: 700;
	background: var(--surface); color: var(--text); border: 1px solid var(--line);
}
.jump button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (prefers-color-scheme: dark) { .jump button.on { background: var(--brand); color: #04201b; border-color: var(--brand); } }

/* Verdict */
.verdict { border-top: 6px solid var(--v); }
.verdict-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 0.9rem; }
.verdict-label { font-size: 1.7rem; font-weight: 850; color: var(--v); line-height: 1.1; letter-spacing: -0.02em; }
.headline { font-weight: 750; font-size: 1.05rem; margin: 0 0 0.5rem; }
.reactions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.chip { flex: 1; background: var(--surface-2); border-color: var(--line); color: var(--text); white-space: nowrap; padding-inline: 0.75rem; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.working-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.5rem; color: var(--brand-ink); padding: 2rem 1rem; }
.working-card .spinner { width: 32px; height: 32px; border-width: 3px; }
.danger-card { border-top: 6px solid var(--avoid); }
.danger-card .sec-title .i { color: var(--avoid); }
.good .sec-title .i { color: var(--great); }
.bad .sec-title .i { color: var(--twice); }

.callout { background: var(--brand-soft); border-radius: var(--radius-sm); padding: 0.8rem 0.9rem; font-size: 0.95rem; margin: 0.75rem 0; }
.callout.warn { background: var(--warn-soft); }
.callout.plain-c { background: var(--surface-2); border: 1px solid var(--line); }
.callout > :last-child { margin-bottom: 0; }
.callout button { margin-top: 0.5rem; }

/* Experts */
.reviews li { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.75rem; padding: 0.85rem 0; border-top: 1px solid var(--line); }
.reviews li:first-child { border-top: 0; padding-top: 0.25rem; }
.reviews strong { font-size: 1rem; }
.reviews p { grid-column: 1 / -1; margin: 0; }
.rating { font-weight: 850; white-space: nowrap; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.rating small { color: var(--muted); font-weight: 650; }
.stars { color: var(--accent); letter-spacing: 0.05em; }
.reliability-line .tag { margin-bottom: 0.4rem; font-size: 0.8rem; }

/* Budget */
.fit-list li { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.65rem 0.8rem; border-radius: var(--radius-sm); margin-bottom: 0.5rem; background: var(--surface-2); }
.fit-list li .i { margin-top: 0.2rem; }
.fit-list .ok { background: var(--ok-soft); } .fit-list .ok .i { color: var(--great); }
.fit-list .warn { background: var(--warn-soft); } .fit-list .warn .i { color: var(--fair); }
.fit-list .bad { background: var(--bad-soft); } .fit-list .bad .i { color: var(--avoid); }

.facts { margin: 0; }
.fact { display: grid; grid-template-columns: minmax(7.5rem, 38%) 1fr; gap: 0.75rem; padding: 0.6rem 0; border-top: 1px solid var(--line); }
.fact:first-child { border-top: 0; }
.fact dt { color: var(--muted); }
.fact dd { margin: 0; font-weight: 600; }
.note { display: block; color: var(--muted); font-size: 0.85rem; font-weight: 400; }

/* Running costs */
.scenarios { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 0 0.5rem; font-size: 0.95rem; }
.scenarios th, .scenarios td { padding: 0.55rem 0.5rem; border-top: 1px solid var(--line); text-align: right; vertical-align: top; }
.scenarios th[scope='row'], .scenarios thead th:first-child { text-align: left; font-weight: 550; color: var(--muted); padding-left: 0; }
.scenarios thead th { border-top: 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.scenarios thead .best { color: var(--great); } .scenarios thead .worst { color: var(--avoid); }
.scenarios td { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.scenarios td.best, .scenarios thead .best { background: color-mix(in srgb, var(--great) 7%, transparent); }
.scenarios td.worst, .scenarios thead .worst { background: color-mix(in srgb, var(--avoid) 7%, transparent); }
.scenarios thead .best { border-radius: 10px 0 0 0; } .scenarios thead .worst { border-radius: 0 10px 0 0; }
.scenarios tfoot th[scope='row'], .scenarios tfoot td { color: var(--text); font-weight: 850; border-top: 2px solid var(--line); }
.scenarios tfoot tr:last-child td.best { border-radius: 0 0 0 10px; } .scenarios tfoot tr:last-child td.worst { border-radius: 0 0 10px 0; }
.scenarios .note { font-size: 0.78rem; }

.allin { background: var(--ink); color: #fff; border-radius: var(--radius-sm); padding: 1rem; margin: 1rem 0; }
.allin .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: #b9c3cd; font-weight: 700; }
.allin .big { font-size: 1.7rem; font-weight: 850; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 0.1rem 0 0.6rem; }
.allin .big small { font-size: 0.95rem; font-weight: 600; color: #b9c3cd; }
.allin svg { width: 100%; height: 14px; display: block; }
.allin .legend { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; font-size: 0.8rem; color: #c4ccd5; margin-top: 0.5rem; }
.allin .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.3rem; vertical-align: -1px; }
.allin p { color: #dfe5ea; font-size: 0.92rem; margin: 0.75rem 0 0; }
.k-pcp { background: #7aa7ff; fill: #7aa7ff; } .k-run { background: var(--accent); fill: var(--accent); } .k-risk { background: #e8707a; fill: #e8707a; }
.allin .track { fill: rgb(255 255 255 / 0.12); }

.scenario-notes { display: grid; gap: 0.6rem; margin-top: 0.75rem; }
.scenario-notes div { border-radius: var(--radius-sm); padding: 0.75rem 0.85rem; }
.scenario-notes .best { background: var(--ok-soft); }
.scenario-notes .worst { background: var(--bad-soft); }
.scenario-notes b { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.2rem; }
.scenario-notes .best b { color: var(--great); } .scenario-notes .worst b { color: var(--avoid); }
.scenario-notes p { margin: 0; }

/* Faults & hidden costs */
.faults li { padding: 0.8rem 0 0.8rem 0.9rem; border-left: 4px solid var(--line); margin: 0 0 0.75rem; }
.faults li.sev-high { border-left-color: var(--avoid); }
.faults li.sev-medium { border-left-color: var(--fair); }
.faults li p, .costs p { margin: 0.25rem 0 0; }
.costs li { padding: 0.8rem 0; border-top: 1px solid var(--line); }
.costs li:first-child { border-top: 0; padding-top: 0.2rem; }
.fault-head, .cost-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.cost-head span { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }

.sources summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; gap: 0.5rem; }
.sources ul { margin-top: 0.5rem; }
.footnote { text-align: center; padding: 0 1rem; }

/* ---------------------------------------------------------------- Settings */
.page-title { margin: 0.25rem 0 1rem; }
.back { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; margin-bottom: 0.25rem; text-decoration: none; font-weight: 700; }
.settings .card h2 { margin-bottom: 1rem; }
.save-bar {
	position: sticky; bottom: 0; z-index: 5;
	padding: 0.75rem var(--pad-x) calc(0.75rem + env(safe-area-inset-bottom));
	background: color-mix(in srgb, var(--paper) 92%, transparent);
	backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
	border-top: 1px solid var(--line);
}
.save-bar button { width: 100%; }
.current-car { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem; margin-top: 1rem; }
.current-car .facts-line { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.current-car .facts-line span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.85rem; font-weight: 650; }
.usage { margin-top: 1.5rem; }

/* ---------------------------------------------------------------- Wider screens */
@media (min-width: 640px) {
	.car-list { grid-template-columns: 1fr 1fr; }
	.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
	.hero-band { padding-top: 2.25rem; }
	.hero-band h1 { font-size: 2.4rem; }
	.car-hero { margin-top: 0; border-radius: var(--radius); overflow: hidden; margin-left: 0; margin-right: 0; }
	.jump { margin-left: 0; margin-right: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
	.scenario-notes { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 760px) {
	.hero-band { border-radius: 0 0 var(--radius) var(--radius); }
}
