:root {
	--bg: #0b0d10;
	--bg-2: #12161b;
	--glass: rgb(18 22 27 / 0.72);
	--line: rgb(255 255 255 / 0.1);
	--text: #f2f4f7;
	--muted: #8d96a3;
	--accent: #37e8ff;
	--accent-ink: #00141a;
	--ok: #3ee59a;
	--warn: #f5c542;
	--bad: #ff6262;
	--r: 16px;
	--font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
	margin: 0;
	min-height: 100%;
	background: radial-gradient(120% 90% at 50% 70%, #16202a 0%, var(--bg) 60%) fixed, var(--bg);
	color: var(--text);
	font: 16px/1.5 var(--font);
}
a { color: inherit; }

.top {
	position: fixed; inset: 0 0 auto 0; z-index: 20;
	display: flex; align-items: center; justify-content: space-between;
	padding: max(16px, env(safe-area-inset-top)) 20px 16px;
	pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.logo { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.langs { display: flex; gap: 4px; }
.langs a, .langs span { padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; text-decoration: none; color: var(--muted); }
.langs span { color: var(--text); background: var(--line); }

.btn {
	font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; text-decoration: none;
	padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgb(255 255 255 / 0.06); color: var(--text);
}
.btn:hover { border-color: var(--accent); }
.btn.add { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.add.on { background: transparent; color: var(--ok); border-color: var(--ok); }
.btn.ghost { background: transparent; }

/* ── Home: one question ─────────────────────────────────────────────────── */
.ask { display: grid; place-items: center; padding: 120px 20px 40px; }
.ask-form { width: min(680px, 100%); position: relative; }
.ask-title { display: block; margin-top: 0; font-size: clamp(2.2rem, 7vw, 4.2rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin-bottom: 28px; }
.ask-title label { cursor: text; }
.ask-box { display: flex; align-items: center; border-bottom: 2px solid var(--line); transition: border-color .2s; }
.ask-box:focus-within { border-color: var(--accent); }
.ask-box input {
	flex: 1; min-width: 0; font: inherit; font-size: clamp(1.3rem, 4vw, 1.9rem); color: var(--text);
	background: none; border: 0; padding: 14px 0; outline: none;
}
.ask-box input::placeholder { color: rgb(255 255 255 / 0.22); }
.ask-box button {
	flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.4rem;
	background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 24px rgb(55 232 255 / 0.35);
}
.suggestions {
	list-style: none; margin: 10px 0 0; padding: 6px; position: absolute; left: 0; right: 0; z-index: 5;
	background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: var(--r);
}
.suggestions li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 10px; cursor: pointer; }
.suggestions li span { color: var(--muted); }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: rgb(55 232 255 / 0.12); }
.ask-note { color: var(--muted); margin: 18px 0 0; }
.examples { color: var(--muted); font-size: 0.9rem; margin-top: 28px; }
.example { color: var(--accent); text-decoration: none; margin-left: 4px; }

/* ── Model: the bike fills the screen ───────────────────────────────────── */
body.model { overflow: hidden; height: 100svh; }
.garage { position: fixed; inset: 0; }
.stage { position: absolute; inset: 0; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.stage canvas:active { cursor: grabbing; }
.bike-label {
	position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap; z-index: 2;
	padding: 4px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
	background: var(--accent); color: var(--accent-ink);
}
.no-webgl { position: absolute; top: 40%; left: 20px; right: 20px; text-align: center; color: var(--muted); }

.title { position: absolute; top: 64px; left: 20px; z-index: 5; pointer-events: none; max-width: calc(100% - 40px); transition: opacity .3s; }
.title > * { pointer-events: auto; }
.back { color: var(--muted); text-decoration: none; font-size: 0.85rem; }
.title h1 { margin: 6px 0 4px; font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1; letter-spacing: -0.04em; font-weight: 400; }
.title h1 strong { font-weight: 800; }
.years { margin: 0; color: var(--muted); font-size: 0.85rem; }

.hint {
	position: absolute; left: 50%; transform: translateX(-50%); bottom: 112px; margin: 0; z-index: 4;
	color: var(--muted); font-size: 0.85rem; white-space: nowrap; transition: opacity .3s; pointer-events: none;
}
body.panel-open .hint { opacity: 0; visibility: hidden; }

.chips {
	position: absolute; left: 0; right: 0; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 6;
	display: flex; gap: 8px; overflow-x: auto; padding: 4px 20px; scrollbar-width: none;
	justify-content: safe center;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
	flex: none; font-size: 0.85rem; padding: 8px 14px; border-radius: 999px; text-decoration: none;
	background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--line);
}
.chip:hover { border-color: rgb(55 232 255 / 0.5); }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.panel {
	position: absolute; z-index: 10; top: 64px; right: 16px; bottom: 80px; width: min(420px, calc(100% - 32px));
	overflow-y: auto; padding: 20px; border-radius: 20px;
	background: rgb(14 17 21 / 0.93); backdrop-filter: blur(20px); border: 1px solid var(--line);
	box-shadow: 0 20px 60px rgb(0 0 0 / 0.5);
	animation: slide-in .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
@media (max-width: 760px) {
	.panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62svh; border-radius: 22px 22px 0 0; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
	@keyframes slide-in { from { transform: translateY(40px); opacity: 0; } }
	body.panel-open .chips, body.panel-open .title { opacity: 0; pointer-events: none; }
	.panel { max-height: 56svh; }
}
.panel-close {
	position: sticky; top: 0; float: right; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
	border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 1.2rem; line-height: 1;
}
.zone h2 { margin: 2px 0 14px; font-size: 1.5rem; letter-spacing: -0.03em; }
.zone h2 .for { display: block; margin-top: 2px; font-size: 0.8rem; font-weight: 500; letter-spacing: 0; color: var(--muted, #8a929c); }
.parts { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.part { padding: 16px; border-radius: 14px; background: rgb(255 255 255 / 0.04); border: 1px solid var(--line); }
.part-brand { color: var(--accent); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.part h3 { margin: 2px 0 6px; font-size: 1.05rem; }
.part-price { margin: 0 0 8px; color: var(--muted); font-size: 0.88rem; }
.part-price strong { color: var(--text); font-size: 1.1rem; }
.part-note { color: var(--muted); font-size: 0.9rem; margin: 8px 0 12px; }
.part-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.legal { display: inline-block; margin: 0; font-size: 0.75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; cursor: help; }
.legal-approved, .legal-exempt { color: var(--ok); }
.legal-inspection { color: var(--warn); }
.legal-track { color: var(--bad); }
.legal-unknown { color: var(--muted); }
.draft { color: var(--muted); font-size: 0.75rem; margin: 18px 0 0; }

.build {
	position: absolute; z-index: 9; left: 16px; bottom: 76px; width: min(360px, calc(100% - 32px));
	border-radius: 16px; background: var(--glass); backdrop-filter: blur(16px);
	border: 1px solid rgb(55 232 255 / 0.45); box-shadow: 0 0 30px rgb(55 232 255 / 0.12);
}
@media (max-width: 760px) { body.panel-open .build { display: none; } }
.build summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; font-weight: 700; list-style: none; }
.build summary::-webkit-details-marker { display: none; }
.build summary strong { margin-left: auto; }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 8px; font-size: 0.75rem; margin-left: 4px; }
.build ul { list-style: none; margin: 0; padding: 0 16px 10px; display: grid; gap: 6px; max-height: 28svh; overflow: auto; }
.build li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; font-size: 0.88rem; }
.build li a { text-decoration: none; }
.build li span { color: var(--muted); white-space: nowrap; }
.build .part-actions { padding: 0 16px 14px; }
.remove { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; }

body.no-webgl .hint { display: none; }
@media (prefers-reduced-motion: reduce) { .panel { animation: none; } }

/* ── Real parts: price source, SKU, kits ───────────────────────────────── */
.part-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sku { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.btn.buy { background: rgb(55 232 255 / 0.12); border-color: rgb(55 232 255 / 0.5); }
.chip span { margin-left: 6px; font-size: 0.72rem; opacity: 0.6; font-variant-numeric: tabular-nums; }
.count { margin: 4px 0 0; color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.intro { margin: 8px 0 0; max-width: 40ch; text-shadow: 0 1px 8px var(--bg, #0b0d10); color: var(--muted, #8a929c); font-size: 0.8rem; line-height: 1.45; }
@media (max-width: 720px) { .intro { display: none; } }
.kits {
	position: absolute; z-index: 9; left: 16px; bottom: 76px; width: min(300px, calc(100% - 32px));
	padding: 12px; border-radius: 16px; background: var(--glass); backdrop-filter: blur(16px); border: 1px solid var(--line);
}
.kits[hidden], body.panel-open .kits { display: none; }
.kits p { margin: 2px 4px 10px; font-size: 0.85rem; font-weight: 700; }
.kits ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kit {
	width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 0 10px; text-align: left; cursor: pointer;
	font: inherit; color: var(--text); padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgb(255 255 255 / 0.04);
}
.kit:hover { border-color: var(--accent); }
.kit span { font-weight: 600; font-size: 0.9rem; }
.kit strong { font-size: 0.9rem; }
.kit small { display: none; }
@media (max-width: 760px) {
	body.panel-open .kits { display: none; }
	.kits { bottom: 70px; left: 12px; right: 12px; width: auto; padding: 10px; }
	.kits ul { grid-template-columns: repeat(3, 1fr); }
	.kit { grid-template-columns: 1fr; padding: 6px 8px; }
	.kit span, .kit strong { font-size: 0.78rem; }
	.kit small { display: none; }
}

.part-fit {
	margin: 0.15rem 0 0;
	font-size: 0.8rem;
	color: var(--muted);
}
.part-fit.unstated {
	color: #ffb84d;
}

/* ── Embed: the player inside another site's iframe ─────────────────────── */
body.embed { overflow: hidden; height: 100vh; min-height: 0; background: radial-gradient(120% 90% at 50% 70%, #16202a 0%, var(--bg) 60%), var(--bg); }
body.embed .chips { bottom: 44px; justify-content: flex-start; padding: 4px 12px; }
body.embed .chip { cursor: pointer; font: inherit; font-size: 0.8rem; color: var(--text); padding: 6px 12px; }
body.embed .chip.active { color: var(--accent-ink); }
body.embed .hint { bottom: 92px; font-size: 0.78rem; }
body.embed .panel { top: 12px; left: auto; right: 12px; bottom: 44px; width: min(340px, calc(100% - 24px)); max-height: none; padding: 16px; border-radius: 16px; }
/* The site's phone rules key off the window width; inside an iframe only the player's own width counts */
body.embed.panel-open .chips { opacity: 1; pointer-events: auto; }
body.embed.panel-open .chips { right: 364px; }
body.embed .panel h2 { margin: 2px 0 12px; font-size: 1.25rem; letter-spacing: -0.02em; }
body.embed .part { padding: 12px; }
body.embed .part h3 { font-size: 0.95rem; }
body.embed .part-price { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 560px) {
	body.embed .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 70%; border-radius: 18px 18px 0 0; }
	body.embed.panel-open .chips { right: 0; }
	body.embed.panel-open .chips, body.embed.panel-open .hint, body.embed.panel-open .powered { opacity: 0; pointer-events: none; }
}
.powered {
	position: absolute; left: 12px; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 6px;
	font-size: 0.75rem; font-weight: 700; color: var(--muted); text-decoration: none;
}
.powered .logo { width: 9px; height: 9px; }
.powered:hover { color: var(--text); }

/* ── Home: the fleet ───────────────────────────────────────────────────── */
.fleet { width: min(1200px, 100%); margin: 0 auto; padding: 8px 16px 80px; }
.fleet-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.fleet-head h2 { margin: 0 12px 0 0; font-size: 1.3rem; letter-spacing: -0.02em; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter {
	font: inherit; font-size: 0.85rem; cursor: pointer; padding: 6px 12px; border-radius: 999px;
	border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.filter:hover { color: var(--text); }
.filter.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.make-filter select {
	font: inherit; font-size: 0.85rem; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line);
	background: var(--bg-2); color: var(--text);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card a {
	display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px 14px; text-decoration: none;
	border: 1px solid var(--line); border-radius: var(--r); background: var(--glass); transition: border-color .2s, transform .2s;
}
.card a:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-pic {
	display: grid; place-items: center; aspect-ratio: 16 / 10; margin: -4px -6px 8px; border-radius: 10px; overflow: hidden;
	background: radial-gradient(90% 80% at 50% 70%, #1b2833 0%, #0e1216 75%);
}
.card-pic img { width: 100%; height: 100%; object-fit: contain; }
.card-ph { font-weight: 800; font-size: 1.4rem; letter-spacing: -0.03em; color: rgb(255 255 255 / 0.12); }
.card-make { color: var(--muted); font-size: 0.8rem; }
.card-name { font-size: 1.05rem; letter-spacing: -0.01em; }
.card-meta { color: var(--muted); font-size: 0.8rem; }
.card-parts { margin-top: 6px; color: var(--accent); font-size: 0.82rem; font-weight: 600; }
.card-parts.soon { color: var(--muted); font-weight: 400; }
.fleet-empty { color: var(--muted); }
