/* Car Garage Academy: light theme. Ivory surfaces, warm neutral greys, one accent (deep navy). */
@font-face{font-family:"Inter";src:url(/static/fonts/inter-latin.woff2) format("woff2");font-weight:400 700;font-display:swap}
@font-face{font-family:"Manrope";src:url(/static/fonts/manrope-latin.woff2) format("woff2");font-weight:500 800;font-display:swap}
:root{
  --bg:#f6f3ed;--surface:#fffefb;--panel:#fbf9f5;--sunk:#f2eee6;--line:#e5dfd4;--line2:#d6cebf;
  --text:#1d2129;--mut:#6c6a64;--faint:#9b968c;
  --acc:#1f3a5f;--acc-2:#2c4f7c;--acc-soft:#e9eef5;--acc-ring:rgba(31,58,95,.18);
  --ok:#2d6a4c;--ok-soft:#e8f1eb;--bad:#a33e33;--bad-soft:#f7e9e6;--warn:#94671e;--warn-soft:#f6efe0;
  --r:12px;--r-s:9px;
  --sh-1:0 1px 2px rgba(40,32,20,.05),0 1px 1px rgba(40,32,20,.03);
  --sh-2:0 6px 20px -8px rgba(40,32,20,.18),0 2px 6px -2px rgba(40,32,20,.08);
  --sh-3:0 18px 40px -16px rgba(30,24,14,.28),0 4px 12px -4px rgba(30,24,14,.10);
  --sans:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --display:"Manrope","Inter",system-ui,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden;background:var(--bg);color:var(--text);font:14px/1.45 var(--sans);-webkit-font-smoothing:antialiased;font-feature-settings:"cv11","ss01"}
body{display:flex;flex-direction:column;height:100vh;height:100dvh}
button{font:inherit;color:inherit}
svg.i{width:16px;height:16px;flex:none;vertical-align:-3px}

/* ---------- header */
header{flex:none;display:flex;align-items:center;gap:20px;padding:0 20px;height:58px;background:var(--surface);border-bottom:1px solid var(--line)}
.brand{display:flex;gap:11px;align-items:center;min-width:0}
.brand b{display:block;font:700 15.5px/1.15 var(--display);letter-spacing:-.01em}
.brand small{display:block;color:var(--mut);font-size:11.5px;margin-top:1px}
.logo{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:var(--acc);color:#f6f3ed;box-shadow:inset 0 0 0 1px rgba(255,255,255,.08),var(--sh-1)}
.logo svg{width:18px;height:18px}
nav{display:flex;gap:2px;margin-left:18px;padding:3px;background:var(--sunk);border:1px solid var(--line);border-radius:11px}
nav button{display:flex;align-items:center;gap:7px;background:transparent;border:0;color:var(--mut);padding:6px 13px;border-radius:8px;font-size:13.5px;font-weight:500;cursor:pointer;transition:color .15s,background .15s,box-shadow .15s}
nav button svg{width:15px;height:15px}
nav button:hover{color:var(--text)}
nav button.active{color:var(--acc);background:var(--surface);box-shadow:var(--sh-1),0 0 0 1px var(--line)}
.score{margin-left:auto;display:flex;align-items:baseline;gap:4px;padding:5px 13px;border:1px solid var(--line);border-radius:999px;background:var(--surface);box-shadow:var(--sh-1)}
.score span{font:700 15px var(--display);color:var(--acc);font-variant-numeric:tabular-nums}
.score small{color:var(--mut);font-size:11.5px;letter-spacing:.04em;text-transform:uppercase}

/* ---------- shell */
main{flex:1;display:flex;min-height:0}
#stage{flex:1;position:relative;min-width:0;overflow:hidden;
  background:radial-gradient(120% 90% at 50% 30%,#fdfbf7 0%,#f5f1e9 55%,#e9e3d8 100%)}
#viewer{position:absolute;inset:0}
#panel{flex:0 0 clamp(400px,34vw,500px);background:var(--panel);border-left:1px solid var(--line);overflow:hidden;display:flex;flex-direction:column}
#panel-inner{flex:1;min-height:0;display:flex;flex-direction:column;padding:16px 18px 14px;gap:10px}
.ph{flex:none;display:flex;align-items:center;gap:8px}
.pb{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:10px;margin:0 -6px;padding:0 6px 2px}
.pb.fit{overflow:visible}
.pf{flex:none;display:flex;align-items:center;gap:8px;padding-top:10px;border-top:1px solid var(--line)}
.pb::-webkit-scrollbar{width:8px}.pb::-webkit-scrollbar-thumb{background:var(--line2);border-radius:8px;border:2px solid var(--panel)}
footer{flex:none;font-size:11px;line-height:1.4;color:var(--faint);padding:6px 20px;border-top:1px solid var(--line);background:var(--surface)}
footer a{color:var(--acc);text-decoration:none;border-bottom:1px solid var(--acc-ring)}footer a:hover{border-bottom-color:var(--acc)}
footer code{font-size:10.5px;background:var(--sunk);padding:0 4px;border-radius:4px}

/* ---------- stage overlays */
#hud-title{position:absolute;left:20px;top:16px;font:700 19px/1.2 var(--display);letter-spacing:-.015em;color:var(--text);pointer-events:none;max-width:60%}
#hud-title small{display:block;font:500 12px/1.4 var(--sans);letter-spacing:0;color:var(--mut);margin-top:3px}
.hint3d{position:absolute;left:20px;bottom:12px;font-size:11px;color:var(--faint);pointer-events:none;letter-spacing:.01em}
#banana{position:absolute;right:16px;bottom:12px;display:flex;align-items:center;gap:7px;background:rgba(255,254,251,.9);border:1px solid var(--line);padding:5px 12px 5px 9px;border-radius:999px;font:500 12px/1.2 inherit;font-family:inherit;color:var(--mut);box-shadow:var(--sh-1);backdrop-filter:blur(6px);cursor:pointer;transition:background .15s,border-color .15s,color .15s;z-index:4}
#banana .bi{font-size:13px;filter:grayscale(.85) opacity(.75);transition:filter .15s}
#banana:hover{color:var(--text);border-color:var(--line2)}
#banana.on{background:#fbf3d6;border-color:#e6cf86;color:#5c4a14}#banana.on .bi{filter:none}
#banana:focus-visible{outline:2px solid var(--acc-ring);outline-offset:2px}
#loading{position:absolute;right:16px;top:14px;display:flex;align-items:center;gap:8px;background:rgba(255,254,251,.9);border:1px solid var(--line);padding:6px 11px;border-radius:999px;font-size:12px;color:var(--mut);box-shadow:var(--sh-1);backdrop-filter:blur(6px)}
.spin{width:11px;height:11px;border-radius:50%;border:1.5px solid var(--line2);border-top-color:var(--acc);animation:sp 0.8s linear infinite}@keyframes sp{to{transform:rotate(360deg)}}
#toast{position:absolute;left:50%;bottom:38px;transform:translateX(-50%);width:max-content;max-width:min(560px,82%);display:flex;gap:10px;align-items:flex-start;padding:11px 14px 11px 12px;border-radius:12px;background:rgba(255,254,251,.96);border:1px solid var(--line);box-shadow:var(--sh-3);font-size:13.5px;line-height:1.45;backdrop-filter:blur(8px);cursor:pointer;animation:tin .25s ease-out;z-index:5}
@keyframes tin{from{opacity:0;transform:translate(-50%,6px)}}
#toast .ti{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--acc-soft);color:var(--acc);margin-top:-1px}
#toast .ti svg{width:13px;height:13px;stroke-width:2.2}
#toast.ok .ti{background:var(--ok-soft);color:var(--ok)}#toast.bad .ti{background:var(--bad-soft);color:var(--bad)}#toast.neutral .ti{background:var(--warn-soft);color:var(--warn)}
#toast.ok{border-color:#cfe0d5}#toast.bad{border-color:#ebcdc7}
#toast .tx b{font-weight:600}
#toast .tc{color:var(--faint);margin-left:4px;flex:none}#toast .tc svg{width:14px;height:14px}
#stage.diag #toast{left:auto;right:16px;transform:none;max-width:min(380px,46%);animation:none}
#jobcard{position:absolute;left:16px;top:14px;width:min(320px,52%);background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:11px 14px 12px;box-shadow:var(--sh-2)}
#jobcard .k{display:flex;align-items:center;gap:6px;font:600 10.5px/1 var(--sans);letter-spacing:.12em;text-transform:uppercase;color:var(--mut)}
#jobcard .k svg{width:13px;height:13px}
#jobcard .sym{font:600 14px/1.4 var(--display);margin-top:7px;color:var(--text)}
#findings{position:absolute;left:16px;bottom:30px;width:min(360px,52%);max-height:42%;display:flex;flex-direction:column;background:rgba(255,254,251,.95);border:1px solid var(--line);border-radius:12px;box-shadow:var(--sh-2);backdrop-filter:blur(8px)}
#findings .fh{flex:none;display:flex;align-items:center;gap:6px;padding:9px 12px 7px;font:600 10.5px/1 var(--sans);letter-spacing:.12em;text-transform:uppercase;color:var(--mut);border-bottom:1px solid var(--line)}
#findings .fh svg{width:13px;height:13px}
#findings .fl{overflow:auto;padding:6px 8px 8px;min-height:0}
#instrument{position:absolute;right:16px;top:52px;width:200px;background:#2a2e35;color:#e9e4d8;border-radius:14px;padding:10px 10px 11px;box-shadow:var(--sh-3),inset 0 1px 0 rgba(255,255,255,.08);font-family:ui-monospace,"SF Mono",Menlo,monospace}
#instrument .lcd{background:#cfd6b8;color:#1f2614;border-radius:7px;padding:7px 9px;text-align:right;font-size:28px;font-weight:700;letter-spacing:1px;box-shadow:inset 0 2px 4px rgba(0,0,0,.25)}
#instrument .cap{font-size:10px;letter-spacing:.1em;text-transform:uppercase;margin:0 2px 7px;color:#bdb6a6}
#instrument.thermal .lcd{background:linear-gradient(120deg,#33205c,#a2302f 60%,#e0a33c);color:#fff}
#instrument.scanner .lcd{background:#0f1d18;color:#7fe0a8;font-size:22px}
.hidden{display:none!important}

/* ---------- type */
h2{margin:0;font:700 19px/1.25 var(--display);letter-spacing:-.015em}
h3{margin:0;font:600 10.5px/1 var(--sans);letter-spacing:.12em;text-transform:uppercase;color:var(--mut);display:flex;align-items:center;gap:6px}
h3 svg.i{width:13px;height:13px}
p{margin:0}.mut{color:var(--mut)}.lede{color:var(--mut);font-size:13.5px}
.eyebrow{font:600 10.5px/1 var(--sans);letter-spacing:.12em;text-transform:uppercase;color:var(--acc)}

/* ---------- controls */
.btn{display:inline-flex;align-items:center;gap:7px;background:var(--acc);color:#fff;border:1px solid var(--acc);border-radius:var(--r-s);padding:8px 15px;font-size:13.5px;font-weight:600;cursor:pointer;box-shadow:0 1px 2px rgba(20,30,50,.18),inset 0 1px 0 rgba(255,255,255,.1);transition:background .15s,box-shadow .15s,transform .05s}
.btn svg.i{width:15px;height:15px}
.btn:hover{background:var(--acc-2)}.btn:active{transform:translateY(1px)}
.btn.sec{background:var(--surface);color:var(--text);border-color:var(--line2);box-shadow:var(--sh-1)}
.btn.sec:hover{background:#fff;border-color:#c7bead}
.btn.ghost{background:transparent;border-color:transparent;box-shadow:none;color:var(--mut);padding:6px 8px}
.btn.ghost:hover{color:var(--text);background:var(--sunk)}
.btn.sm{padding:5px 10px;font-size:12.5px}
.btn:disabled{opacity:.4;cursor:default;transform:none}
.btn.wide{flex:1;justify-content:center}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.spacer{flex:1}
.pill{display:inline-flex;align-items:center;gap:6px;background:var(--sunk);border:1px solid var(--line);border-radius:999px;padding:3px 10px;font-size:12px;color:var(--mut);font-weight:500;white-space:nowrap}
.pill svg.i{width:13px;height:13px}
.kbd{font-variant-numeric:tabular-nums}

/* ---------- cards */
.cards{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:13px 14px;cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .15s;position:relative;box-shadow:var(--sh-1)}
.card:hover{border-color:var(--line2);box-shadow:var(--sh-2);transform:translateY(-1px)}
.card .ic{width:32px;height:32px;border-radius:9px;display:grid;place-items:center;background:var(--acc-soft);color:var(--acc);margin-bottom:9px}
.card .ic svg{width:17px;height:17px}
.card b{display:block;font:600 14px/1.3 var(--display)}.card small{color:var(--mut);font-size:12px}
.card.row-card{display:flex;align-items:center;gap:12px}.card.row-card .ic{margin:0}
.card.done::after{content:"";position:absolute;right:11px;top:11px;width:18px;height:18px;border-radius:50%;background:var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat}
.info{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:11px 13px;box-shadow:var(--sh-1)}
.info .k{display:flex;align-items:center;gap:6px;font:600 10.5px/1 var(--sans);letter-spacing:.12em;text-transform:uppercase;color:var(--acc);margin-bottom:6px}
.info .k svg{width:13px;height:13px}
.info p{font-size:13.5px}

/* progress segments */
.dots{display:flex;gap:3px}.dots i{flex:1;height:4px;border-radius:2px;background:var(--line)}.dots i.on{background:var(--acc)}.dots i.done{background:#8fa3bf}

/* quiz */
.choice{display:flex;gap:10px;align-items:flex-start;width:100%;text-align:left;background:var(--surface);border:1px solid var(--line);color:var(--text);padding:9px 12px;border-radius:var(--r-s);cursor:pointer;font-size:13.5px;box-shadow:var(--sh-1);transition:border-color .15s}
.choice .lt{flex:none;width:20px;height:20px;border-radius:6px;border:1px solid var(--line2);display:grid;place-items:center;font-size:11px;font-weight:600;color:var(--mut)}
.choice:hover:not(:disabled){border-color:var(--acc)}
.choice:disabled{cursor:default}
.choice.right{border-color:var(--ok);background:var(--ok-soft)}.choice.right .lt{background:var(--ok);border-color:var(--ok);color:#fff}
.choice.wrong{border-color:var(--bad);background:var(--bad-soft)}.choice.wrong .lt{background:var(--bad);border-color:var(--bad);color:#fff}
.choices{display:flex;flex-direction:column;gap:7px}
.feedback{display:flex;gap:9px;align-items:flex-start;padding:10px 12px;border-radius:var(--r-s);font-size:13.5px;border:1px solid}
.feedback svg.i{margin-top:1px}
.feedback.ok{background:var(--ok-soft);border-color:#cfe0d5;color:#1f4a35}.feedback.bad{background:var(--bad-soft);border-color:#ebcdc7;color:#6e2a22}.feedback.neutral{background:var(--warn-soft);border-color:#eadcbd;color:#5e4413}

/* ---------- build: current step */
.stepcard{flex:none;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:11px 13px 12px;box-shadow:var(--sh-1);position:relative}
.stepcard .top{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.stepcard .title{font:650 15px/1.3 var(--display);letter-spacing:-.01em;margin-bottom:9px;min-height:2.6em}
.stepcard .spec{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--mut);margin-top:9px}
.stepcard .spec svg{width:13px;height:13px;color:var(--acc)}
.allsteps{position:relative}
.allsteps summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--mut);padding:2px 6px;border-radius:6px}
.allsteps summary::-webkit-details-marker{display:none}
.allsteps summary:hover{color:var(--text);background:var(--sunk)}
.allsteps summary svg{width:13px;height:13px;transition:transform .15s}.allsteps[open] summary svg.chev{transform:rotate(180deg)}
.allsteps .pop{position:absolute;right:-6px;top:calc(100% + 6px);z-index:20;width:330px;max-width:calc(100vw - 40px);background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--sh-3);padding:6px}
.steps{list-style:none;padding:0;margin:0}
.steps li{padding:5px 8px;border-radius:7px;font-size:12.5px;color:var(--mut);display:flex;gap:8px;line-height:1.35}
.steps li .n{width:18px;flex:none;font-weight:600;font-variant-numeric:tabular-nums;color:var(--faint)}
.steps li.cur{background:var(--acc-soft);color:var(--acc);font-weight:500}.steps li.cur .n{color:var(--acc)}
.steps li.dn{color:var(--text)}.steps li.dn .n{color:var(--ok)}.steps li .n svg{width:12px;height:12px;stroke-width:2.4}

/* toolbox */
.tools{display:grid;grid-template-columns:repeat(6,1fr);gap:6px}
.tool{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:4px 4px 5px;cursor:pointer;text-align:center;font-size:10.5px;line-height:1.2;color:var(--text);box-shadow:var(--sh-1);transition:border-color .15s,box-shadow .15s;display:flex;flex-direction:column;align-items:center;gap:3px;min-width:0}
.tool .th{width:100%;aspect-ratio:1;max-height:var(--th,76px);border-radius:7px;background:radial-gradient(circle at 50% 40%,#fbf9f4,#eee9df);display:grid;place-items:center;overflow:hidden}
.tool img{width:100%;height:100%;object-fit:contain;display:block}
.tool .noimg{color:var(--acc)}.tool .noimg svg{width:24px;height:24px}
.tool .nm{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.4em;padding:0 1px}
.tool:hover{border-color:var(--line2);box-shadow:var(--sh-2)}
.tool.sel{border-color:var(--acc);box-shadow:0 0 0 3px var(--acc-ring)}
.tool.fit{opacity:.5}.tool.fit .nm::after{content:" ✓";color:var(--ok)}
.tools.parts{grid-template-columns:repeat(4,1fr)}
.tooldesc{display:flex;gap:7px;align-items:flex-start;font-size:12.5px;color:var(--mut);min-height:2.9em;line-height:1.45}
.tooldesc svg{width:14px;height:14px;margin-top:2px;color:var(--faint)}
.tooldesc b{color:var(--text);font-weight:600}
.torque{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r-s);padding:7px 12px;box-shadow:var(--sh-1)}
.torque label{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--mut);white-space:nowrap}
.torque input[type=range]{flex:1;accent-color:var(--acc);min-width:0}
.torque output{font:700 16px var(--display);font-variant-numeric:tabular-nums;width:78px;text-align:right;color:var(--acc)}
.done-card{display:flex;flex-direction:column;gap:10px}

/* ---------- diagnose */
.clock{display:flex;align-items:center;gap:6px;font:600 13px var(--display);font-variant-numeric:tabular-nums}
.clock svg{color:var(--mut)}
.bar{height:4px;background:var(--line);border-radius:4px;overflow:hidden;flex:none}.bar i{display:block;height:100%;background:var(--acc);transition:width .3s}
.actions{display:grid;grid-template-columns:1fr 1fr;gap:5px}
.act{background:var(--surface);border:1px solid var(--line);color:var(--text);border-radius:8px;padding:6px 8px;text-align:left;cursor:pointer;font-size:12.5px;display:flex;gap:7px;align-items:center;min-width:0;box-shadow:var(--sh-1);transition:border-color .15s}
.act svg{width:14px;height:14px;color:var(--acc)}
.act .l{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.act:hover{border-color:var(--acc)}.act.used{background:var(--sunk);color:var(--mut);box-shadow:none}.act.used svg{color:var(--faint)}
.act .c{margin-left:auto;color:var(--faint);font-size:11px;white-space:nowrap;font-variant-numeric:tabular-nums}
.logline{font-size:12.5px;padding:6px 9px;border-left:2px solid var(--line2);margin:3px 0;background:transparent;line-height:1.45}
.logline.notable{border-left-color:var(--warn);background:var(--warn-soft);border-radius:0 6px 6px 0}
.logline b{font-weight:600}
.suspects{display:flex;flex-wrap:wrap;gap:5px}
.susp{display:inline-flex;align-items:center;gap:6px;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:3px 10px 3px 3px;font-size:12px;cursor:pointer;box-shadow:var(--sh-1);transition:border-color .15s;white-space:nowrap}
.susp img{width:22px;height:22px;border-radius:50%;object-fit:cover;background:#eee9df}
.susp:hover{border-color:var(--acc)}
.susp.pend{border-color:var(--acc);box-shadow:0 0 0 3px var(--acc-ring);color:var(--acc)}
.susp.x{opacity:.35;pointer-events:none;text-decoration:line-through}
.confirm{display:flex;align-items:center;gap:6px;padding:5px 6px 5px 10px;background:var(--acc-soft);border:1px solid #cdd7e5;border-radius:var(--r-s);font-size:12.5px;color:var(--acc)}
.confirm span{flex:1;line-height:1.35}
.sec-h{display:flex;align-items:center;gap:8px;min-height:18px}

/* ---------- progress */
.stat{display:grid;grid-template-columns:1fr 1fr;gap:10px}.stat .big{font:700 26px/1.1 var(--display);letter-spacing:-.02em;color:var(--text);font-variant-numeric:tabular-nums}
.badge{display:inline-flex;align-items:center;gap:6px;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:4px 11px;margin:3px 4px 3px 0;font-size:12.5px;box-shadow:var(--sh-1)}
.badge svg{width:13px;height:13px;color:var(--acc)}

/* ---------- build: full car (anchored guidance callout, glowing target, celebration) */
:root{--gold:#c9a14a;--gold-2:#e2c57a;--gold-soft:#fbf3dd}
#leader{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:3;overflow:visible}
#leader .ld{fill:none;stroke:url(#ldg);stroke-width:1.6;stroke-linecap:round;stroke-dasharray:5 6;animation:ldash 1.1s linear infinite}
#leader .ld2{fill:none;stroke:rgba(201,161,74,.28);stroke-width:6;stroke-linecap:round;filter:blur(2px)}
#leader .tp0{fill:var(--gold)}#leader .ep{fill:var(--acc);stroke:#fffefb;stroke-width:1.5}
#leader .tp1,#leader .tp2{fill:none;stroke:var(--gold);stroke-width:1.5;transform-box:fill-box;transform-origin:center;animation:tping 1.6s ease-out infinite}
#leader .tp2{animation-delay:.8s}
@keyframes ldash{to{stroke-dashoffset:-22}}
@keyframes tping{from{transform:scale(.6);opacity:.95}to{transform:scale(2.6);opacity:0}}
#callout{position:absolute;left:0;top:0;z-index:4;pointer-events:none;will-change:transform;transition:opacity .2s ease}
#callout .co-card{width:252px;pointer-events:auto;position:relative;overflow:hidden;background:rgba(255,254,251,.97);border:1px solid var(--line);border-radius:13px;padding:10px 12px 8px;
  box-shadow:0 0 0 4px rgba(31,58,95,.05),0 22px 44px -18px rgba(30,24,14,.34),0 6px 14px -6px rgba(30,24,14,.14);backdrop-filter:blur(10px)}
#callout .co-card::before{content:"";position:absolute;left:0;right:0;top:0;height:3px;background:linear-gradient(90deg,var(--acc),var(--gold) 55%,var(--acc))}
#callout .co-card::after{content:"";position:absolute;top:0;bottom:0;width:60%;left:-70%;pointer-events:none;background:linear-gradient(100deg,transparent 20%,rgba(226,197,122,.22) 48%,rgba(255,255,255,.5) 52%,transparent 80%)}
#callout.in .co-card{animation:coin .55s cubic-bezier(.2,.9,.25,1.15) both}
#callout.in .co-card::after{animation:shimmer 1.3s .35s ease-out both}
#callout.in .co-sec{animation:cosec .45s ease-out both}#callout.in .co-sec.here{animation-delay:.12s}#callout.in .co-sec.why{animation-delay:.22s}
#callout.fitting .co-card{animation:coglow .5s ease-out}
@keyframes coin{from{opacity:0;transform:scale(.86) translateY(8px)}to{opacity:1;transform:none}}
@keyframes shimmer{from{left:-70%}to{left:120%}}
@keyframes cosec{from{opacity:0;transform:translateY(5px)}}
@keyframes coglow{50%{box-shadow:0 0 0 6px rgba(201,161,74,.35),0 22px 44px -18px rgba(30,24,14,.34)}}
.co-card.shake{animation:coshake .42s ease-in-out!important}
@keyframes coshake{20%{transform:translateX(-5px)}40%{transform:translateX(5px)}60%{transform:translateX(-3px)}80%{transform:translateX(2px)}}
.co-top{display:flex;align-items:center;gap:7px;margin-bottom:6px}
.co-n{flex:none;white-space:nowrap;font:700 10.5px/1 var(--display);letter-spacing:.06em;color:#fff;background:var(--acc);padding:4px 7px;border-radius:999px;box-shadow:0 0 0 3px rgba(201,161,74,.25)}
.co-n i{font-style:normal;opacity:.6;margin-left:1px}
.co-part{flex:1;display:flex;align-items:center;gap:6px;font:700 13.5px/1.2 var(--display);letter-spacing:-.01em;color:var(--text);min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.co-part svg{width:15px;height:15px;color:var(--gold);flex:none}
.co-sec{padding:5px 0 4px;border-top:1px solid var(--line)}
.co-sec:first-of-type{border-top:0;padding-top:2px}
.co-k{display:flex;align-items:center;gap:5px;font:700 9px/1 var(--sans);letter-spacing:.13em;text-transform:uppercase;margin-bottom:3px}
.co-k svg{width:11px;height:11px;stroke-width:2.2}
.co-sec.next .co-k{color:var(--acc)}.co-sec.here .co-k{color:#9a7420}.co-sec.why .co-k{color:var(--ok)}
.co-sec p{font-size:11.75px;line-height:1.4;color:#3a3d44}
.co-sec p.clamp{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}
.co-more{display:inline-block;margin-top:1px;padding:0;border:0;background:none;font:600 11px/1.3 var(--sans);color:var(--acc);cursor:pointer}
.co-more:hover{text-decoration:underline}.co-more[hidden]{display:none}
.co-min{flex:none;width:22px;height:22px;margin:-3px -5px -3px 0;display:grid;place-items:center;border:0;border-radius:7px;background:none;color:var(--faint);cursor:pointer;transition:background .15s,color .15s}
.co-min:hover{background:var(--acc-soft);color:var(--acc)}.co-min svg{width:14px;height:14px;transform:rotate(180deg)}
.co-pill{pointer-events:auto;display:flex;align-items:center;gap:7px;max-width:230px;padding:4px 8px 4px 4px;border-radius:999px;border:1px solid var(--line);background:rgba(255,254,251,.97);font-family:inherit;cursor:pointer;
  box-shadow:0 0 0 3px rgba(31,58,95,.05),0 10px 22px -12px rgba(30,24,14,.35);backdrop-filter:blur(10px)}
.co-pill .co-part{font-size:12.5px}.co-pill:hover{border-color:var(--line2)}
.co-exp{flex:none;color:var(--faint);display:grid;place-items:center}.co-exp svg{width:13px;height:13px}
#callout.in .co-pill{animation:coin .45s cubic-bezier(.2,.9,.25,1.15) both}
.co-min:focus-visible,.co-pill:focus-visible,.co-more:focus-visible,.term:focus-visible{outline:2px solid var(--acc-ring);outline-offset:2px}
abbr.term{text-decoration:none;border-bottom:1px dotted currentColor;cursor:help}
#termtip{position:absolute;z-index:7;max-width:220px;padding:6px 9px;border-radius:8px;background:#1f2633;color:#f6f3ec;font-size:11.5px;line-height:1.35;pointer-events:none;box-shadow:0 8px 20px -8px rgba(0,0,0,.4)}
#termtip.hidden{display:none}
.co-cta{display:inline-block;margin-top:3px;font:600 11px/1 var(--sans);color:#7a5a12;background:var(--gold-soft);border:1px solid #ecdcae;padding:3px 7px;border-radius:999px}
.fc-sheet{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:3px 6px}
.fc-sheet li{display:flex;align-items:center;gap:6px;font-size:12px;line-height:1.2;color:var(--mut);padding:4px 6px;border-radius:7px;min-width:0}
.fc-sheet li .n{width:17px;height:17px;flex:none;display:grid;place-items:center;border-radius:50%;font:600 10px/1 var(--sans);color:var(--faint);border:1px solid var(--line2)}
.fc-sheet li .t{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fc-sheet li.dn{color:var(--text)}.fc-sheet li.dn .n{background:var(--ok);border-color:var(--ok);color:#fff}.fc-sheet li .n svg{width:10px;height:10px;stroke-width:3}
.fc-sheet li.cur{background:var(--acc-soft);color:var(--acc);font-weight:600}.fc-sheet li.cur .n{background:var(--acc);border-color:var(--acc);color:#fff;box-shadow:0 0 0 3px rgba(201,161,74,.3)}
.fc-phase{display:inline-flex;align-items:center;gap:5px;font:600 11px/1 var(--sans);padding:4px 8px;border-radius:999px;background:var(--gold-soft);color:#7a5a12;border:1px solid #ecdcae}
.fc-phase svg{width:12px;height:12px}.fc-phase.secure{background:var(--acc-soft);color:var(--acc);border-color:#cdd7e5}
.fc-how{display:flex;gap:7px;align-items:flex-start;font-size:12.5px;color:var(--mut);line-height:1.45}
.fc-how svg{width:14px;height:14px;margin-top:2px;color:var(--faint);flex:none}.fc-how b{color:var(--text);font-weight:600}.fc-how b.gold{color:#8a6516}
.fc-q{font-size:12.5px;color:var(--text);line-height:1.4}
.tool.bad{border-color:var(--bad);box-shadow:0 0 0 3px rgba(163,62,51,.14)}
.fc-spark{position:absolute;width:0;height:0;pointer-events:none;z-index:4}
.fc-spark i{position:absolute;left:-2px;top:-9px;width:4px;height:18px;border-radius:2px;background:linear-gradient(var(--gold-2),var(--gold));transform:rotate(var(--a)) translateY(-14px);opacity:0;animation:spk .8s ease-out forwards}
.fc-spark i:nth-child(odd){background:linear-gradient(#8fa3bf,var(--acc))}
@keyframes spk{0%{opacity:1;transform:rotate(var(--a)) translateY(-8px) scaleY(.4)}100%{opacity:0;transform:rotate(var(--a)) translateY(-46px) scaleY(1)}}
.confetti{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:6}
.confetti i{position:absolute;top:-16px;border-radius:2px;opacity:.95;animation:cf linear forwards;box-shadow:0 0 0 .5px rgba(30,24,14,.08)}
@keyframes cf{to{transform:translate(var(--dx),calc(100vh - 40px)) rotate(var(--r));opacity:0}}
@media (max-height:820px){#callout .co-card{width:240px;padding:9px 11px 7px}.co-sec p{font-size:11.5px}.co-part{font-size:13px}.fc-sheet li{padding:3px 6px}}
@media (max-height:680px){#callout .co-card{width:228px}.co-sec{padding:4px 0 3px}.co-sec p{font-size:11px;line-height:1.34}.co-cta{margin-top:3px}.fc-sheet{gap:1px 6px}.fc-sheet li{font-size:11.5px;padding:2px 5px}.fc-sheet li .n{width:15px;height:15px}}
@media (prefers-reduced-motion:reduce){#callout.in .co-pill,#callout.in .co-card,#callout.in .co-sec,#leader .ld,#leader .tp1,#leader .tp2,.confetti i{animation:none!important}}

@media (min-height:760px){.act{align-items:center;padding:6px 8px}.act .l{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;line-height:1.3}}
/* ---------- compact heights: keep every play control above the fold */
@media (max-height:820px){
  #panel-inner{padding:12px 16px 12px;gap:8px}.pb{gap:8px}
  .tool .th{--th:58px}.stepcard{padding:9px 12px 10px}.stepcard .title{margin-bottom:7px}.stepcard .spec{margin-top:7px}
  h2{font-size:17.5px}.act{padding:4px 8px}.actions{gap:4px}
}
@media (max-height:680px){
  header{height:50px}.logo{width:30px;height:30px}.brand small{display:none}
  #panel-inner{padding:10px 14px 10px;gap:7px}.pb{gap:7px}
  .tool .th{--th:42px}.tool{font-size:10px;padding:3px 3px 4px}
  .stepcard .title{font-size:14px;min-height:0}.tooldesc{min-height:2.7em;font-size:12px}
  .act{padding:4px 8px;font-size:12px}.susp{padding:2px 9px 2px 2px}.susp img{width:20px;height:20px}
  .hint3d{display:none}#hud-title{font-size:17px}
  .choice{padding:7px 11px}.info{padding:9px 12px}
  footer{padding:4px 16px;font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .actions{gap:4px}.act{padding:3px 8px}.suspects{gap:4px}.susp{font-size:11.5px}.confirm{font-size:12px;line-height:1.3}
}
@media (max-width:1100px){nav{margin-left:6px}nav button{padding:6px 10px}.brand small{display:none}}
/* ---------- phones and small touch screens (html.m is set from JS: narrow, touch portrait, or short landscape).
   Nothing scrolls the page: the 3D view takes the top, the panel stacks under it and scrolls inside. */
html:not(.m) #gsheet{display:none!important}
html.m body{height:100vh;height:100dvh;overflow:hidden}
html.m header{height:52px;gap:8px;padding:0 8px}
html.m .brand div,html.m .brand small{display:none}html.m .logo{width:30px;height:30px}
html.m nav{flex:1;min-width:0;margin-left:0;overflow-x:auto;scrollbar-width:none;padding:2px}html.m nav::-webkit-scrollbar{display:none}
html.m nav button{flex:none;min-height:44px;padding:0 11px;font-size:13px}html.m nav button svg{display:none}
html.m .score{flex:none}
html.m main{flex-direction:column}
html.m #stage{flex:1 1 auto;min-height:0}
html.m #panel{flex:0 1 auto;max-height:42%;min-height:0;border-left:0;border-top:1px solid var(--line)}
html.m.gs-open #panel{max-height:62%}
html.m #panel-inner{overflow:auto;padding:10px 12px 10px;gap:8px}
html.m .pb,html.m .pb.fit{overflow:visible;flex:none}
html.m .pf{position:sticky;bottom:-10px;background:var(--panel);padding-bottom:2px;z-index:1}
html.m footer{padding:3px 10px;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.m .hint3d{display:none}
html.m #hud-title{left:12px;top:10px;font-size:15px;max-width:70%}html.m #hud-title small{font-size:11px}
html.m #banana{right:8px;bottom:8px;min-height:44px;min-width:44px;padding:0;justify-content:center;font-size:0;gap:0}html.m #banana .bi{font-size:18px}
html.m.land main{flex-direction:row}
html.m.land #panel{flex:0 0 46%;max-height:none;height:auto;border-top:0;border-left:1px solid var(--line)}
html.m.land header{height:50px}
/* tap targets */
html.m .btn,html.m .btn.sm{min-height:44px}
html.m .tool{min-height:44px}html.m .tools{grid-template-columns:repeat(3,1fr)}
html.m .fc-tray .it{min-height:44px}html.m .seg button{min-height:44px;padding:0 12px}
html.m .card,html.m .choice,html.m .act,html.m .susp,html.m .mode-card{min-height:44px}
html.m .fc-sheet{display:none}html.m .stepcard .title{min-height:0}
/* the floating guide card is replaced by the bottom sheet; only the target marker stays in 3D */
html.m #callout,html.m #termtip{display:none!important}
#leader.marker-only .ld,#leader.marker-only .ld2,#leader.marker-only .ep{display:none}
#gsheet{flex:none;position:relative;background:rgba(255,254,251,.98);border-bottom:1px solid var(--line);padding:6px 12px 8px;box-shadow:0 -10px 24px -18px rgba(30,24,14,.4)}
#gsheet::before{content:"";position:absolute;left:0;right:0;top:0;height:3px;background:linear-gradient(90deg,var(--acc),var(--gold) 55%,var(--acc))}
#gsheet.in{animation:gsin .4s cubic-bezier(.2,.9,.25,1.1) both}
@keyframes gsin{from{opacity:0;transform:translateY(10px)}}
.gs-head{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:0;border:0;background:none;font:inherit;color:var(--text);cursor:pointer;text-align:left}
.gs-chev{margin-left:auto;flex:none;width:32px;height:32px;display:grid;place-items:center;color:var(--faint)}.gs-chev svg{width:16px;height:16px;transform:rotate(180deg);transition:transform .2s}
#gsheet.open .gs-chev svg{transform:none}
.gs-line{margin:0;font-size:13px;line-height:1.4;color:#3a3d44;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
#gsheet.open .gs-line{white-space:normal}
.gs-more{display:none;max-height:30vh;overflow:auto;margin-top:4px}
#gsheet.open .gs-more{display:block}
.gs-more .co-sec p{font-size:13px}
#gsheet abbr.term.show::after{content:" (" attr(data-def) ")";color:var(--mut);font-style:italic}

/* ---------- build the car: start screen (Tutorial / Test yourself) */
nav button.main{font-weight:600}
.mode-card{display:flex;align-items:center;gap:12px;width:100%;text-align:left;font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:14px 14px;cursor:pointer;box-shadow:var(--sh-1);transition:border-color .15s,box-shadow .15s,transform .15s}
.mode-card:hover{border-color:var(--line2);box-shadow:var(--sh-2);transform:translateY(-1px)}
.mode-card:focus-visible{outline:2px solid var(--acc-ring);outline-offset:2px}
.mode-card .ic{flex:none;width:40px;height:40px;border-radius:11px;display:grid;place-items:center;background:var(--acc-soft);color:var(--acc)}
.mode-card .ic.gold{background:var(--gold-soft);color:#8a6516}.mode-card .ic svg{width:19px;height:19px}
.mc-tx{flex:1;min-width:0}.mc-tx b{display:block;font:650 15px/1.25 var(--display);letter-spacing:-.01em}.mc-tx small{display:block;margin-top:3px;color:var(--mut);font-size:12.5px;line-height:1.4}
.mc-meta{flex:none;font-size:11.5px;color:var(--mut);white-space:nowrap}.mc-meta b{color:var(--text)}.mc-meta .ok{display:inline-flex;align-items:center;gap:4px;color:var(--ok);font-weight:600}.mc-meta svg{width:12px;height:12px}
/* test yourself: parts tray, show me, results */
.fc-tray{display:grid;grid-template-columns:1fr 1fr;gap:5px}
.fc-tray .it{display:flex;align-items:center;gap:7px;min-width:0;padding:3px 7px 3px 3px;font:inherit;font-size:12px;line-height:1.2;text-align:left;color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:9px;cursor:pointer;box-shadow:var(--sh-1);transition:border-color .15s,box-shadow .15s}
.fc-tray .it:hover{border-color:var(--line2)}
.fc-tray .it .th{flex:none;width:34px;height:34px;border-radius:7px;background:radial-gradient(circle at 50% 40%,#fbf9f4,#eee9df);display:grid;place-items:center;overflow:hidden}
.fc-tray .it .th img{width:100%;height:100%;object-fit:contain}.fc-tray .it .noimg svg{width:16px;height:16px;color:var(--faint)}
.fc-tray .it .nm{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fc-tray .it.sel{border-color:var(--gold);box-shadow:0 0 0 3px rgba(201,161,74,.22);background:var(--gold-soft)}
.fc-tray .it.reveal,.tool.reveal{border-color:var(--gold);box-shadow:0 0 0 3px rgba(201,161,74,.35);animation:rvl 1s ease-in-out 3}
@keyframes rvl{50%{box-shadow:0 0 0 6px rgba(201,161,74,.12)}}
#showme .cost{font-size:11px;color:var(--bad);font-weight:600;margin-left:2px}
.pill.warn{color:var(--bad)}
.seg{display:inline-flex;padding:2px;background:var(--sunk);border:1px solid var(--line);border-radius:9px}
.seg button{border:0;background:none;font:inherit;font-size:12px;color:var(--mut);padding:5px 9px;border-radius:7px;cursor:pointer}
.seg button.on{background:var(--surface);color:var(--acc);box-shadow:var(--sh-1)}
.results{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px;box-shadow:0 0 0 4px rgba(31,58,95,.05),var(--sh-2);position:relative;overflow:hidden;display:grid;gap:10px;animation:coin .55s cubic-bezier(.2,.9,.25,1.15) both}
.results::before{content:"";position:absolute;left:0;right:0;top:0;height:3px;background:linear-gradient(90deg,var(--acc),var(--gold) 55%,var(--acc))}
.rs-top{display:flex;align-items:center;justify-content:space-between}
.rs-new{font:600 11px/1 var(--sans);color:#7a5a12;background:var(--gold-soft);border:1px solid #ecdcae;padding:4px 8px;border-radius:999px}
.rs-score{display:flex;align-items:baseline;gap:4px}.rs-score b{font:700 44px/1 var(--display);letter-spacing:-.03em;color:var(--acc);font-variant-numeric:tabular-nums}.rs-score span{color:var(--mut);font-size:15px}
.rs-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.rs-grid div{background:var(--sunk);border:1px solid var(--line);border-radius:9px;padding:6px 8px;display:grid;gap:2px}
.rs-grid span{font-size:10.5px;color:var(--mut);text-transform:uppercase;letter-spacing:.08em}.rs-grid b{font:650 15px/1.1 var(--display);font-variant-numeric:tabular-nums}
@media (max-height:680px){.mode-card{padding:10px 12px}.mc-tx small{font-size:12px}.fc-tray .it .th{width:28px;height:28px}.fc-tray{gap:4px}.rs-score b{font-size:36px}}
/* continue a saved build */
.resume{background:var(--surface);border:1px solid #ecdcae;border-radius:var(--r);padding:12px 14px;box-shadow:0 0 0 3px rgba(201,161,74,.14),var(--sh-1);display:grid;gap:6px;position:relative;overflow:hidden}
.resume::before{content:"";position:absolute;left:0;right:0;top:0;height:3px;background:linear-gradient(90deg,var(--acc),var(--gold) 55%,var(--acc))}
.resume .rs-h{display:flex;align-items:center;gap:7px;font:650 14.5px/1.25 var(--display)}.resume .rs-h svg{width:15px;height:15px;color:#8a6516}
.resume p{margin:0;font-size:12.5px;color:var(--mut);line-height:1.4}
.resume .rs-b{display:flex;gap:8px;margin-top:2px}
/* phones: tool choice. The tools come first in the panel as one swipeable row of chips, so they're always on screen without covering the car */
html.m .fc-sheet-h{display:none}
html.m.fc-tooltime #panel{max-height:50%}
html.m.fc-tooltime .pb.fit{order:-1;gap:6px}
html.m.fc-tooltime .stepcard .dots,html.m.fc-tooltime .stepcard .top{display:none}
html.m.fc-tooltime .stepcard{padding:7px 12px}html.m.fc-tooltime .stepcard .title{margin:0;font-size:13.5px}
html.m.fc-tooltime .fc-q{font-size:12.5px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
html.m .fc-tools{display:flex;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;margin:0 -12px;padding:2px 12px 4px}
html.m .fc-tools::-webkit-scrollbar{display:none}
html.m .fc-tools .tool{flex:0 0 78px;scroll-snap-align:start;flex-direction:column;padding:4px 4px 5px;min-height:44px}
html.m .fc-tools .tool .th{width:44px;height:44px;max-height:44px;aspect-ratio:auto}
html.m .fc-tools .tool .nm{font-size:10.5px;min-height:2.4em}
html.m.land.fc-tooltime #panel{max-height:none}
