:root {
  --ink: #121212;
  --muted: #5f6267;
  --line: #ececec;
  --border: #d0d1d2;
  --field: #f4f4f4;
  --stage: #f4f4f4;
  --track: #e6e6e6;
  --red: #c8102e;
  --logo: #e31937;
  --section: #f4f4f4;
  --section-line: #e2e2e2;
  --font: 'Albert Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: #fff;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: underline; }
a:hover { color: var(--muted); }
button, input, select { font-family: var(--font); }
input::placeholder { color: #9a9ca0; }

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  height: 56px; padding: 0 24px;
  display: flex; align-items: center; gap: 24px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  flex: none; display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 500; font-size: 14px; letter-spacing: .24em; white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.brand-by { font-size: 10px; font-weight: 400; letter-spacing: .14em; color: var(--muted); }
.brand-mark { width: 26px; height: 26px; flex: none; color: var(--logo); }
/* Buy me a coffee: neutral pill that turns brand yellow on hover, a light sweep every few seconds, steam rising off a sloshing cup. */
.coffee {
  position: relative; overflow: hidden; isolation: isolate;
  flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px 0 12px;
  border-radius: 999px; background: #fff;
  color: var(--ink); text-decoration: none; font: 600 13px var(--font); white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--border);
  transition: background 200ms ease, color 200ms ease, transform 160ms ease, box-shadow 200ms ease;
}
.coffee:hover, .coffee:focus-visible {
  background: #ffdd00; color: #0d0c22; transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 12, 34, .18), inset 0 0 0 1px rgba(13, 12, 34, .1);
}
.coffee::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(0, 0, 0, .06) 45%, rgba(255, 255, 255, .9) 50%, rgba(0, 0, 0, .06) 55%, transparent 70%);
  transform: translateX(-120%);
  animation: coffee-shimmer 3.2s ease-in-out infinite;
}
.cup { width: 20px; height: 20px; flex: none; overflow: visible; }
.cup-coffee { fill: #b5b7ba; transition: fill 200ms ease; animation: coffee-slosh 1.6s ease-in-out infinite; }
.coffee:hover .cup-coffee, .coffee:focus-visible .cup-coffee { fill: #6f4e37; }
.cup-steam {
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round;
  opacity: 0; animation: coffee-steam 2.4s ease-out infinite;
}
.cup-steam.s2 { animation-delay: 1.2s; }
@keyframes coffee-shimmer {
  0%, 55% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
@keyframes coffee-slosh {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-4px, -.6px); }
}
@keyframes coffee-steam {
  0% { opacity: 0; transform: translateY(2px); }
  30% { opacity: .9; }
  100% { opacity: 0; transform: translateY(-3px); }
}
@media (max-width: 599px) {
  /* Phones: smaller name so the full coffee pill still fits. */
  .topbar { padding: 0 16px; gap: 12px; }
  .brand { flex: 0 1 auto; min-width: 0; gap: 8px; font-size: 11px; letter-spacing: .14em; }
  .brand-name { overflow: hidden; text-overflow: ellipsis; }
  .brand-by { font-size: 9px; letter-spacing: .1em; }
  .brand-mark { width: 24px; height: 24px; }
  .coffee { height: 34px; gap: 6px; padding: 0 12px 0 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .coffee::after, .cup-coffee, .cup-steam { animation: none; }
  .cup-steam { opacity: .7; }
}

/* Layout: phone first, car above the checklist */
.layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); }

.visual {
  order: 0; position: relative; height: 420px; padding: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--stage);
}
.car { position: relative; height: 356px; aspect-ratio: 2 / 3; max-width: 100%; }
.panel { order: 1; min-width: 0; display: flex; flex-direction: column; }

@media (min-width: 900px) {
  .layout { grid-template-columns: 480px minmax(0, 1fr); }
  .visual { order: 2; position: sticky; top: 56px; height: calc(100vh - 56px); }
  .car { height: min(calc(100vh - 140px), 820px); }
  .panel { border-right: 1px solid var(--line); }
}

/* Car image slot */
.slot { position: absolute; inset: 0; cursor: pointer; outline: none; }
.slot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.slot img[hidden] { display: none; }
.slot-empty {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px;
  border: 1px dashed var(--border); color: var(--muted); font-size: 13px; text-align: center;
}
.slot-empty[hidden] { display: none; }
.slot-drop {
  position: absolute; inset: 0; display: none; place-items: center;
  border: 1px dashed var(--ink); background: rgba(255, 255, 255, .7);
  font-size: 12px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase;
}
.slot.is-over .slot-drop { display: grid; }
.slot:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.pins { position: absolute; inset: 0; pointer-events: none; }
.pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 999px; border: 1px solid;
  display: grid; place-items: center; font-size: 12px; font-weight: 500;
  transition: background 200ms ease;
}

.caption {
  position: absolute; left: 32px; top: 28px; z-index: 1;
  display: flex; flex-direction: column; gap: 6px; color: var(--ink); pointer-events: none;
}
.caption-model { font-size: 40px; line-height: 1; font-weight: 600; letter-spacing: -.02em; }
.caption-vin { font-size: 12px; letter-spacing: .16em; color: var(--muted); }
.photo-actions { position: absolute; top: 16px; right: 24px; display: flex; gap: 16px; }
.link-btn {
  border: 0; background: transparent; padding: 4px 0; cursor: pointer;
  font: 500 12px var(--font); color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ink); }
.link-btn[hidden] { display: none; }

/* 360 viewer */
.car[hidden], .spin[hidden], .spin-back[hidden], .photo-actions[hidden] { display: none; }
.visual.is-spin { height: auto; padding: 24px 0 56px; overflow: hidden; }
.spin {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  outline: none; transition: opacity 160ms ease;
}
.spin.is-dragging { cursor: grabbing; }
.spin.is-zoomed { cursor: default; }
.spin.is-swapping { opacity: 0; }
.spin:focus-visible { outline: 1px solid var(--ink); outline-offset: -1px; }
.spin-zoom {
  position: absolute; inset: 0; --z: 1; --tx: 0%; --ty: 0%;
  transform: translate(var(--tx), var(--ty)) scale(var(--z)); transition: transform 560ms cubic-bezier(.2, .7, .2, 1);
}
.spin canvas, .spin-still {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  /* Feather the render's edges into the stage so it never reads as a box. */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  mask-composite: intersect;
}
.visual { transition: background 300ms ease; }
/* A matching shot of the same angle (frunk open, lights on) fades in over the frame. */
.spin-still { object-fit: cover; opacity: 0; pointer-events: none; transition: opacity 420ms ease; }
.spin-still.is-on { opacity: 1; }
/* Inside the cabin: the camera pushes in through the glass, then the shot fades up. */
.scene { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 260ms ease; background: #111; }
.scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 420ms ease; }
.scene img.is-on { opacity: 1; }
.visual.is-inside .scene { opacity: 1; transition: opacity 420ms ease 300ms; }
.visual.is-inside .spin-pins, .visual.is-inside .spin-hint { opacity: 0; pointer-events: none; }
.visual.is-inside .spin { cursor: default; }
.visual.is-inside .caption, .visual.is-inside .caption-vin { color: rgba(255, 255, 255, .85); z-index: 2; }
.spin-pins .pin {
  pointer-events: auto; cursor: pointer; padding: 0; font-family: var(--font);
  transform: translate(-50%, -50%) scale(calc(1 / var(--z)));
  transition: background 200ms ease, opacity 120ms linear, box-shadow 200ms ease;
}
.spin.is-zoomed .spin-pins .pin:not(.is-focus) { opacity: 0 !important; pointer-events: none; }
/* Up close on an open shot, the pin would sit right on the part being shown. */
.spin.is-zoomed .spin-still.is-on ~ .spin-pins .pin { opacity: 0 !important; pointer-events: none; }
.pin.is-focus { box-shadow: 0 0 0 6px rgba(18, 18, 18, .14); }
.spin-hint {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  pointer-events: none; transition: opacity 600ms ease;
}
.spin-hint.is-gone { opacity: 0; }
.spin-back { position: absolute; top: 16px; left: 24px; z-index: 2; background: #fff; }

/* Phones and tablets: the car sticks under the top bar, cropped from just above the
   roof (18% of the frame) to just under the wheels (71%), so the list keeps the room.
   --sw is the rendered width of the 16:9 frame. */
@media (max-width: 899px) {
  .visual.is-spin {
    --sw: 100vw; --crop-top: .15; --crop-h: .60;
    position: sticky; top: 56px; z-index: 4;
    height: calc(var(--sw) * .5625 * var(--crop-h)); padding: 0; align-items: flex-start;
    border-bottom: 1px solid var(--line);
  }
  .visual.is-spin .spin { margin-top: calc(var(--sw) * .5625 * var(--crop-top) * -1); }
  /* Model Y L sits higher in its frames: start the strip higher and make it taller. */
  .visual.is-spin[data-model="myl"] { --crop-top: .08; --crop-h: .66; }
  .visual.is-spin .caption { display: none; }
  .visual.is-spin .spin-hint { left: 12px; top: calc(var(--crop-top) * 100% + 8px); bottom: auto; transform: none; }
  .spin-back { top: 8px; left: 12px; }
}
@media (max-width: 599px) {
  /* Zoomed out a touch on phones, so the whole car shows with room around it. */
  .visual.is-spin { --sw: 96vw; }
  .spin { width: 96%; margin: 0 2%; }
  .visual.is-spin .spin-hint { left: 12px; }
  .spin-pins .pin { width: 22px; height: 22px; font-size: 11px; }
}
@media (min-width: 900px) {
  .visual.is-spin { height: calc(100vh - 56px); padding: 32px; }
}

/* Panel content */
.content { flex: 1; padding: 48px 32px 32px; display: flex; flex-direction: column; gap: 24px; }

.stack { display: flex; flex-direction: column; }
.gap-32 { gap: 32px; } .gap-28 { gap: 28px; } .gap-12 { gap: 12px; } .gap-10 { gap: 10px; } .gap-8 { gap: 8px; }

.h1 { margin: 0; font-size: 40px; line-height: 1.1; font-weight: 300; letter-spacing: -.02em; text-wrap: balance; }
.h2 { margin: 0; font-size: 36px; line-height: 1.15; font-weight: 300; letter-spacing: -.02em; }
.lede { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.kicker { font-size: 12px; font-weight: 500; letter-spacing: .2em; color: var(--muted); }
.label { font-size: 13px; font-weight: 500; }
.hint { font-size: 12px; color: var(--muted); }
.fine { margin: 0; font-size: 12px; line-height: 1.55; color: var(--muted); }

.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.model {
  height: 48px; padding: 0 12px; border-radius: 4px;
  border: 1px solid var(--border); background: #fff; color: var(--ink);
  font: 400 14px var(--font); white-space: nowrap; cursor: pointer;
  transition: border-color 160ms ease;
}
.model[aria-pressed="true"] { border: 2px solid var(--ink); font-weight: 500; }
.model:active, .btn:active, .choice:active { transform: scale(.98); }
/* Models still to come: greyed out, and the label swaps to "Adding soon" on hover. */
.model.is-soon { position: relative; border-style: dashed; background: var(--field); color: #a3a5a8; cursor: not-allowed; }
.model.is-soon:active { transform: none; }
.model.is-soon::after {
  content: "Adding soon"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 13px; font-weight: 500; color: var(--muted); opacity: 0; transition: opacity 160ms ease;
}
.model.is-soon span { transition: opacity 160ms ease; }
.model.is-soon:hover::after, .model.is-soon:focus-visible::after { opacity: 1; }
.model.is-soon:hover span, .model.is-soon:focus-visible span { opacity: 0; }

.field { display: flex; flex-direction: column; gap: 10px; }
.input {
  height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--field); color: var(--ink); font: 400 15px var(--font); outline: none;
}
.input:focus { border-color: var(--ink); background: #fff; }
.input-vin { letter-spacing: .08em; text-transform: uppercase; }
select.input { cursor: pointer; }

.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 16px 0; }
.stat-n { font-size: 28px; font-weight: 300; }
.stat-l { font-size: 12px; color: var(--muted); }

.step-head { display: flex; flex-direction: column; gap: 8px; padding-bottom: 24px; }
.row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 16px;
  padding: 20px 0; border-top: 1px solid var(--line);
}
.num {
  width: 26px; height: 26px; border-radius: 999px; border: 1px solid;
  display: grid; place-items: center; font-size: 12px; font-weight: 500;
  transition: background 200ms ease;
}
.row-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.row-text { display: flex; flex-direction: column; gap: 4px; }
.row-text[data-action] { cursor: pointer; }
.row-text[data-action]:hover .row-t { text-decoration: underline; text-underline-offset: 3px; }
.row-t { font-size: 16px; font-weight: 500; line-height: 1.35; }
.row-h { font-size: 14px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 280px; }
.choice {
  height: 44px; border-radius: 4px; border: 1px solid var(--border);
  background: #fff; color: var(--ink); font: 500 14px var(--font); cursor: pointer;
  transition: background 160ms ease;
}
.choice.is-ok { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice.is-bad { background: var(--red); border-color: var(--red); color: #fff; }

.issue {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 0; border: 0; border-top: 1px solid var(--line);
  background: #fff; color: var(--ink); text-align: left; cursor: pointer; font-family: var(--font);
}
.issue:hover { background: #fafafa; }
.issue-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.issue-t { font-size: 15px; font-weight: 500; line-height: 1.35; }
.issue-view { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Sections: light grey rounded cards with a bold heading and label / value rows,
   in the style of a Tesla order summary. */
.section { background: var(--section); border-radius: 12px; padding: 28px 28px 10px; }
.section.stack { padding-bottom: 28px; }
.section-h { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 600; letter-spacing: -.01em; }
.section-sub { margin: 6px 0 8px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.section .row, .section .issue { border-top-color: var(--section-line); background: transparent; }
.section .issue:hover { background: transparent; }
.section .issue:hover .issue-t { text-decoration: underline; text-underline-offset: 3px; }
.section .input, .report .input { background: #fff; }
.section .stats { border-color: var(--section-line); margin-top: 18px; }
.section .lede { margin-top: 6px; }
.model-title { margin: 8px 0 0; font-size: 44px; line-height: 1.05; font-weight: 600; letter-spacing: -.02em; }
.verdict { margin-top: 18px; font-size: 22px; line-height: 1.25; font-weight: 500; }
.spec {
  width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 15px 0;
  border: 0; border-top: 1px solid var(--section-line); background: transparent; cursor: pointer;
  font: 500 15px/1.4 var(--font); color: var(--ink); text-align: left;
}
.section-h + .spec { margin-top: 14px; border-top: 0; }
.spec:hover > span:first-child { text-decoration: underline; text-underline-offset: 3px; }
.spec-v { flex: none; white-space: nowrap; }
.spec-v.is-bad { color: var(--red); }
.spec-v.is-left { color: var(--muted); font-weight: 400; }
.gap-16 { gap: 16px; } .gap-24 { gap: 24px; }

/* Account: Google sign-in for cloud save */
.account { display: flex; align-items: center; gap: 16px; padding: 22px 24px; background: var(--section); border-radius: 12px; flex-wrap: wrap; }
.account-text { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.account-title { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account.is-in { background: var(--section); }
.avatar {
  flex: none; width: 36px; height: 36px; border-radius: 999px; object-fit: cover;
  display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 15px; font-weight: 500;
}
.btn-google {
  flex: none; display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px;
  border: 1px solid var(--border); border-radius: 4px; background: #fff; color: #1f1f1f;
  font: 500 14px var(--font); cursor: pointer; transition: border-color 160ms ease, box-shadow 160ms ease;
}
.btn-google:hover { border-color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.btn-google svg { width: 18px; height: 18px; }

/* Country search with flags */
.combo { position: relative; }
.combo-flag { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 20px; line-height: 1; pointer-events: none; }
.combo-input { width: 100%; padding-left: 46px; }
.combo-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; max-height: 280px; overflow-y: auto;
  margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
}
.combo-list[hidden] { display: none; }
.combo-opt { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 6px; font-size: 15px; cursor: pointer; }
.combo-opt.is-active { background: var(--field); }
.combo-opt[aria-selected="true"] { font-weight: 600; }
.combo-opt-flag { font-size: 20px; line-height: 1; }
.combo-empty { padding: 10px; font-size: 14px; color: var(--muted); }
.checks-more { align-self: flex-start; margin-top: 8px; }

.share-field { display: flex; gap: 8px; }
.share-field .input { flex: 1; min-width: 0; font-size: 14px; color: var(--ink); background: #fff; }
.share-field .btn { flex: none; }
.share-actions { display: flex; flex-wrap: wrap; gap: 6px 20px; }

/* Saved checks, one per car */
.checks { flex-basis: 100%; display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 12px; }
.checks-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 4px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.checks-head + .check-row { border-top: 0; }
.check-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.check-t { font-size: 14px; font-weight: 500; }
.check-vin { font-weight: 400; color: var(--muted); letter-spacing: .04em; }
.check-tag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: #e8f3ec; color: #1d6b3a; font-size: 11px; font-weight: 500; vertical-align: 1px; }
.check-now { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Share your result */
.share .input { flex: 1 1 160px; }
.share-opt { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.share-opt input { width: 16px; height: 16px; accent-color: var(--ink); }
.share-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 4px; background: var(--field); font-size: 14px; }
.share-link a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Report: PDF and email */
.report { display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--section); border-radius: 12px; }
.report-title { font-size: 16px; font-weight: 500; }
.report-row { display: flex; gap: 8px; flex-wrap: wrap; }
.report-row .input { flex: 1 1 200px; min-width: 0; }
.report-row .report-name { flex-basis: 100%; }
.report-status { font-size: 13px; color: var(--muted); min-height: 1em; }
.report-status.is-ok { color: var(--ink); }
.report-status.is-err { color: var(--red); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Bottom bar */
.bar {
  position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line);
  padding: 16px 32px 20px; display: flex; flex-direction: column; gap: 14px;
}
.bar-progress { display: flex; align-items: center; gap: 16px; }
.track { flex: 1; height: 2px; background: var(--track); overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--ink); transition: width 320ms ease; }
.sum-toggle {
  border: 0; background: transparent; padding: 4px 0; cursor: pointer;
  font: 500 13px var(--font); color: var(--ink); white-space: nowrap;
  text-decoration: underline; text-underline-offset: 3px;
}
.sum-rows { display: flex; flex-direction: column; }
.sum-rows[hidden] { display: none; }
.sum-row {
  display: flex; justify-content: space-between; gap: 12px; padding: 12px 0;
  border: 0; border-bottom: 1px solid var(--line); background: transparent;
  font: 400 14px var(--font); color: var(--ink); text-align: left; cursor: pointer;
}
.sum-stat { font-weight: 500; }

.bar-nav { display: flex; gap: 8px; }
.btn { height: 48px; padding: 0 24px; border-radius: 4px; font: 500 14px var(--font); cursor: pointer; }
.btn[hidden] { display: none; }
.btn-ghost { border: 1px solid var(--border); background: #fff; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-primary { flex: 1; border: 0; background: var(--ink); color: #fff; transition: background 160ms ease; }
.btn-primary:hover { background: #333; }
.btn-small { height: 40px; padding: 0 16px; font-size: 13px; }
/* Square icon button, e.g. restart beside Start inspection. */
.btn-icon { flex: none; width: 48px; padding: 0; display: inline-flex; align-items: center; justify-content: center; transition: border-color 160ms ease, color 160ms ease, background 160ms ease; }
.btn-icon[hidden] { display: none; }
.btn-icon svg { width: 20px; height: 20px; transition: transform 300ms ease; }
.btn-icon:hover:not(:disabled) svg { transform: rotate(-60deg); }
.btn-icon:disabled { color: #b5b7ba; border-color: var(--line); background: var(--field); cursor: not-allowed; }
.btn-icon.is-armed { color: #fff; background: var(--red); border-color: var(--red); }

/* Toast: floats just above the bottom bar. */
.toast {
  position: absolute; left: 50%; bottom: calc(100% + 12px); z-index: 6;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px); overflow: hidden;
  padding: 11px 16px; border-radius: 8px; background: var(--ink); color: #fff;
  font: 500 13px var(--font); white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast span { overflow: hidden; text-overflow: ellipsis; }
.toast svg { width: 16px; height: 16px; flex: none; }
.toast-warn { background: var(--red); }
.toast-ok svg { color: #7ee2a0; }
.toast-timer {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: rgba(255, 255, 255, .7); transform-origin: left;
  animation: toast-drain linear forwards;
}
@keyframes toast-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .toast-timer { animation: none; }
}
/* Zoomed in on a part, "Back to car" takes the model name's corner. */
.visual:has(.spin.is-zoomed) .caption { opacity: 0; }

/* Congratulations: shown on a fully good review, with a one-off confetti burst. */
.congrats {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding: 8px 14px; border-radius: 999px;
  background: #fff6d6; color: var(--ink); font: 600 14px var(--font);
  animation: congrats-in 520ms cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes congrats-in { from { opacity: 0; transform: translateY(6px) scale(.92); } }
.confetti { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; display: block;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate(var(--dx), 105vh) rotate(var(--r)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .congrats { animation: none; }
}

/* Support modal: Buy Me a Coffee panel plus a "build something" section. */
.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 16px;
  background: #fff; color: var(--ink); box-shadow: 0 24px 64px rgba(0, 0, 0, .24); overflow: auto;
}
.modal::backdrop { background: rgba(18, 18, 18, .45); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in 220ms ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } }
.modal-inner { display: flex; flex-direction: column; gap: 16px; padding: 28px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head .section-h { font-size: 24px; }
.modal-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 999px; background: var(--section); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.modal-x svg { width: 18px; height: 18px; }
.modal-x:hover { background: #e8e8e8; }
.modal-frame { border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.modal-frame iframe { display: block; width: 100%; height: 520px; border: 0; }
.modal-alt { align-self: center; font-size: 12px; }
.modal-build { padding-bottom: 24px; }
.modal-build .btn { display: inline-flex; align-items: center; text-decoration: none; }
.modal-legal { margin: 0; text-align: center; }
.fine a { color: inherit; }
@media (max-width: 599px) {
  /* Phones: a sheet from the bottom. */
  .modal { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .modal-inner { padding: 22px 16px 28px; }
  .modal-frame iframe { height: 480px; }
}
@media (prefers-reduced-motion: reduce) { .modal[open] { animation: none; } }

/* Analytics consent banner */
.consent {
  position: fixed; z-index: 30; right: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 16px;
  background: #fff; color: var(--ink); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .04);
  font-size: 14px; line-height: 1.5;
}
.consent[hidden] { display: none; }
.consent p { margin: 0; }
.consent a { color: inherit; }
.consent-actions { display: flex; justify-content: flex-end; gap: 8px; }
.consent-actions .btn { flex: none; }
.consent-short { display: none; }
@media (max-width: 599px) {
  /* Phones: one compact row so it doesn't cover the checklist. */
  .consent { left: 8px; right: 8px; bottom: 8px; width: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; font-size: 13px; border-radius: 10px; }
  .consent .consent-long { display: none; }
  .consent .consent-short { display: inline; }
  .consent p.consent-short { flex: 1; min-width: 0; }
  .consent-actions { gap: 6px; }
  .consent-actions .btn-small { height: 34px; padding: 0 12px; font-size: 13px; }
}
.link-inline { border: 0; padding: 0; background: none; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Email card after sending */
.sent { display: flex; gap: 14px; align-items: flex-start; }
.sent-icon { flex: none; width: 36px; height: 36px; border-radius: 999px; background: #1d7a43; color: #fff; display: grid; place-items: center; margin-top: 2px; }
.sent-icon svg { width: 20px; height: 20px; }

/* VIN field with a camera scan button */
.vin-field { position: relative; }
.vin-field .input { width: 100%; padding-right: 104px; }
.vin-scan {
  position: absolute; right: 6px; top: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px;
  border: 0; border-radius: 4px; background: var(--ink); color: #fff; font: 500 13px var(--font); cursor: pointer;
}
.vin-scan svg { width: 18px; height: 18px; }
.vin-scan:hover { background: #333; }

/* Full-screen camera scanner */
.vinscan { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; font-family: var(--font); }
.vinscan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vinscan-frame {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  width: min(88vw, 640px); height: min(22vw, 120px); border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); border: 2px solid rgba(255, 255, 255, .9);
}
.vinscan-frame span { position: absolute; left: 12px; right: 12px; top: 50%; height: 2px; background: #e31937; opacity: .85; animation: vinscan-line 1.6s ease-in-out infinite; }
@keyframes vinscan-line { 0%, 100% { transform: translateY(-28px); } 50% { transform: translateY(28px); } }
.vinscan.is-found .vinscan-frame { border-color: #2fbf71; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55), 0 0 0 4px rgba(47, 191, 113, .5); }
.vinscan.is-found .vinscan-frame span { display: none; }
.vinscan-top { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; }
.vinscan-x { width: 44px; height: 44px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; cursor: pointer; }
.vinscan-x svg { width: 22px; height: 22px; }
.vinscan-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 24px max(28px, env(safe-area-inset-bottom)); text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); }
.vinscan-title { font-size: 20px; font-weight: 600; }
.vinscan-hint { margin-top: 6px; font-size: 14px; opacity: .8; }
.vinscan-status { margin-top: 14px; min-height: 22px; font-size: 16px; font-weight: 600; letter-spacing: .08em; }
.vinscan-type { margin-top: 14px; border: 1px solid rgba(255, 255, 255, .5); background: transparent; color: #fff; border-radius: 999px; padding: 10px 18px; font: 500 14px var(--font); cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .vinscan-frame span { animation: none; } }

/* Photos of flagged items */
.shots { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shots[hidden] { display: none; }
.shots.is-ro { margin: 2px 0 12px; }
.shot { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: #e8e8e8; flex: none; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-del {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: 0; border-radius: 999px;
  background: rgba(18, 18, 18, .7); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.shot-add {
  height: 64px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px dashed var(--red); border-radius: 8px; color: var(--red); background: #fff; font: 500 14px var(--font);
}
.shot-add[hidden] { display: none; }
.shot-add svg { width: 20px; height: 20px; }
.shot-add:hover { background: #fff5f6; }

/* Deleting checks and the account */
.link-btn.is-danger { color: var(--red); }
.link-btn.is-danger:hover { color: #9e0c24; }
.check-actions, .account-actions { display: inline-flex; gap: 16px; align-items: center; flex: none; }
.btn-danger { flex: none; border: 0; background: var(--red); color: #fff; }
.btn-danger:hover { background: #a50d26; }
.btn-danger:disabled { opacity: .6; cursor: default; }
.delete-list { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; }
