/* WrenchPal v3: Tesla-app feel. One big visual (the live engine), few words, a handful of large controls,
   lots of air, soft grey gradient instead of pure black, light airy type. Classic full-width bottom bar. */
:root {
  --v-bg: #141518;
  --v-grad-top: #33363c;
  --v-grad-bottom: #121316;
  --v-surface: #23252a;
  --v-surface-2: #2c2f35;
  --v-surface-3: #383b42;
  --v-text: #eceef1;
  --v-text-2: #9ea3ab;
  --v-text-3: #6e737b;
  --v-sep: rgba(255, 255, 255, 0.07);
  --v-font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --v-display: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --v-nav-h: 64px;
}
@media (prefers-color-scheme: light) {
  :root {
    --v-bg: #eef0f2;
    --v-grad-top: #ffffff;
    --v-grad-bottom: #e6e8eb;
    --v-surface: #ffffff;
    --v-surface-2: #dde0e5;
    --v-surface-3: #d6d9de;
    --v-text: #17181b;
    --v-text-2: #5d626a;
    --v-text-3: #8d929a;
    --v-sep: rgba(0, 0, 0, 0.07);
  }
}
body { letter-spacing: 0; }
h1, h2, h3 { letter-spacing: -0.01em; font-weight: 600; }
.v-title { font-weight: 600; letter-spacing: -0.02em; }
.screen { background: linear-gradient(180deg, var(--v-grad-top) 0%, var(--v-grad-bottom) 62%) fixed, var(--v-bg); }

/* ------------------------------------------------------------------ classic bottom bar */
.v-tabbar.classic {
  left: 0; right: 0; bottom: 0; transform: none; border-radius: 0; gap: 0;
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--v-grad-bottom) 88%, transparent);
  box-shadow: 0 -0.5px 0 var(--v-sep);
}
.app.no-tabbar .v-tabbar.classic { transform: translateY(110%); }
.v-tabbar.classic .v-tab { flex: 1; flex-direction: column; justify-content: center; gap: 4px; height: 54px; padding: 0; border-radius: 12px; font: 600 11px/1 var(--v-font); color: var(--v-text-3); }
.v-tabbar.classic .v-tab .v-tab-l { display: inline; }
.v-tabbar.classic .v-tab.active { background: none; color: var(--v-text); }
.v-tabbar.classic .v-tab svg { width: 24px; height: 24px; }
.app:not(.no-tabbar) .explore-dock { padding-bottom: calc(var(--v-nav-h) + 14px + env(safe-area-inset-bottom)) !important; }

/* ------------------------------------------------------------------ Home (car) */
.v3-home { min-height: 100%; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 18px) 0 calc(var(--v-nav-h) + 28px + env(safe-area-inset-bottom)); }
.v3-pad { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.v3-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.v3-name { font: 600 32px/1.1 var(--v-display); letter-spacing: -0.02em; color: var(--v-text); }
.v3-meta { margin-top: 6px; font: 500 15px/1.3 var(--v-font); color: var(--v-text-2); }
.v3-status { margin-top: 14px; display: inline-flex; align-items: center; gap: 8px; font: 500 15px/1.3 var(--v-font); color: var(--v-text-2); }
.v3-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--v-text-3); }
.v3-status.ok i { background: var(--v-ok); } .v3-status.yellow i { background: var(--v-warn); } .v3-status.red i { background: var(--v-crit); }
.v3-status b { color: var(--v-text); font-weight: 600; }
.v3-icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--v-text-2); display: grid; place-items: center; position: relative; text-decoration: none; }
.v3-icon-btn svg { width: 24px; height: 24px; }
.v3-badge { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--v-crit); color: #fff; font: 700 10px/16px var(--v-font); text-align: center; }

.v3-hero { position: relative; height: min(46vh, 400px); margin: 6px 0 4px; cursor: pointer; }
.v3-hero-3d { position: absolute; inset: 0; opacity: 0; transform: scale(0.97); transition: opacity 0.9s ease, transform 1.2s var(--v-ease); }
.v3-hero-3d.on { opacity: 1; transform: none; }
.v3-hero-3d canvas { display: block; pointer-events: none; }
.v3-hero-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--v-text-3); font: 500 14px var(--v-font); }
.v3-hero-hint { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font: 500 13px var(--v-font); color: var(--v-text-3); pointer-events: none; }

.v3-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.v3-act { display: flex; flex-direction: column; align-items: center; gap: 10px; border: 0; background: none; color: var(--v-text); font: 500 13px/1.2 var(--v-font); text-decoration: none; cursor: pointer; padding: 0; position: relative; }
.v3-act span.ring { width: 60px; height: 60px; border-radius: 50%; background: var(--v-surface-2); display: grid; place-items: center; transition: transform 0.2s var(--v-ease), background 0.2s; }
.v3-act:active span.ring { transform: scale(0.94); background: var(--v-surface-3); }
.v3-act svg { width: 26px; height: 26px; }
.v3-act .v3-badge { top: -2px; right: calc(50% - 34px); }

.v3-rows { margin-top: 34px; }
.v3-rows .v-row { min-height: 66px; }
.v3-rows .v-row-ic { color: var(--v-text-2); }
.v3-rows .v-row-t { font-weight: 500; font-size: 17px; }

/* ------------------------------------------------------------------ welcome (no car yet) */
.v3-brand { font: 600 14px/1 var(--v-font); color: var(--v-text-3); margin-bottom: 18px; }
.v3-welcome .v3-meta { max-width: 30ch; font-size: 16px; line-height: 1.45; }
.v3-spot-wrap { display: grid; place-items: center; width: 100%; border: 0; background: none; padding: 0; color: inherit; }
.v3-spot { position: relative; width: 240px; height: 240px; display: grid; place-items: center; }
.v3-spot-floor { position: absolute; bottom: 22px; left: 50%; width: 260px; height: 46px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--v-text) 10%, transparent), transparent); }
.v3-spot-ring { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; color: var(--v-text-2);
  background: color-mix(in srgb, var(--v-text) 5%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--v-text) 10%, transparent);
  animation: v3-breathe 3.2s ease-in-out infinite; }
.v3-spot-ring svg { width: 34px; height: 34px; }
@keyframes v3-breathe { 50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--v-text) 4%, transparent); } }
.v3-choices { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.v3-choice { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 76px; padding: 14px 20px; border: 0; border-radius: 22px;
  background: var(--v-surface-2); color: var(--v-text); text-align: left; cursor: pointer; transition: transform 0.2s var(--v-ease); }
.v3-choice:active { transform: scale(0.98); }
.v3-choice.primary { background: var(--v-primary); color: var(--v-on-primary); }
.v3-choice svg { width: 24px; height: 24px; flex: none; }
.v3-choice span { display: flex; flex-direction: column; gap: 3px; }
.v3-choice b { font: 600 17px/1.2 var(--v-font); }
.v3-choice small { font: 500 13px/1.35 var(--v-font); opacity: 0.68; }
.v3-skip { margin-top: 8px; align-self: center; border: 0; background: none; color: var(--v-text-2); font: 600 15px var(--v-font); padding: 10px; cursor: pointer; }
.v3-hero.reveal .v3-hero-3d { transition: opacity 1.6s ease, transform 2.2s var(--v-ease); transform: scale(0.9); }
.v3-hero.reveal .v3-hero-3d.on { transform: none; }
@media (prefers-reduced-motion: reduce) { .v3-spot-ring { animation: none; } }
.app:has(.v3-welcome) .v-tabbar { display: none; }
.v3-welcome { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

/* ------------------------------------------------------------------ status hero (Home with a car) */
.v3-health { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 36px 24px 8px; padding: 8px 0 12px; text-align: center; text-decoration: none; color: var(--v-text); --hc: var(--v-text-3); }
.v3-health.ok { --hc: var(--v-ok); } .v3-health.yellow { --hc: var(--v-warn); } .v3-health.red { --hc: var(--v-crit); }
.v3-health-ring { width: 148px; height: 148px; border-radius: 50%; display: grid; place-items: center; color: var(--hc);
  background: radial-gradient(circle, color-mix(in srgb, var(--hc) 14%, transparent) 0 58%, transparent 59%);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--hc) 70%, transparent), 0 0 60px color-mix(in srgb, var(--hc) 18%, transparent);
  margin-bottom: 10px; }
.v3-health.none .v3-health-ring { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--v-text) 14%, transparent); background: none; }
.v3-health-ring svg { width: 40px; height: 40px; }
.v3-health-big { font: 600 30px/1.1 var(--v-display); letter-spacing: -0.02em; }
.v3-health-small { font: 500 15px/1.4 var(--v-font); color: var(--v-text-2); max-width: 30ch; }
.v3-home .v3-actions { margin-top: 34px; }

/* ------------------------------------------------------------------ car dashboard Home */
.v3-dash { gap: 0; }
.v3-dash.slide-l { animation: v3-sl 0.45s var(--v-ease); } .v3-dash.slide-r { animation: v3-sr 0.45s var(--v-ease); }
@keyframes v3-sl { from { opacity: 0; transform: translateX(40px); } } @keyframes v3-sr { from { opacity: 0; transform: translateX(-40px); } }
.v3-dots { display: flex; gap: 6px; margin-top: 14px; }
.v3-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 4px; background: var(--v-text-3); opacity: 0.5; transition: width 0.3s var(--v-ease), opacity 0.3s; cursor: pointer; }
.v3-dots button[aria-selected="true"] { width: 20px; opacity: 1; background: var(--v-text); }
.v3-dash .v3-health { flex-direction: row; align-items: center; text-align: left; gap: 18px; margin: 30px 0 0; padding-top: 0; padding-bottom: 0; }
.v3-dash .v3-health-ring { width: 72px; height: 72px; margin: 0; flex: none; box-shadow: inset 0 0 0 2.5px color-mix(in srgb, var(--hc) 70%, transparent), 0 0 30px color-mix(in srgb, var(--hc) 14%, transparent); }
.v3-dash .v3-health-ring svg { width: 30px; height: 30px; }
.v3-health-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.v3-dash .v3-health-big { font-size: 24px; }
.v3-dash .v3-health-small { font-size: 14px; }
.v3-cta { margin-top: 24px; display: flex; align-items: center; justify-content: center; gap: 10px; height: 56px; border-radius: 999px; background: var(--v-primary); color: var(--v-on-primary); font: 600 17px/1 var(--v-font); text-decoration: none; transition: transform 0.2s var(--v-ease); }
.v3-cta:active { transform: scale(0.98); }
.v3-cta svg { width: 22px; height: 22px; }
.v3-sec { margin-top: 40px; }
.v3-miles { border: 0; background: var(--v-surface-2); color: var(--v-text); font: 600 14px/1 var(--v-font); height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer; letter-spacing: 0; }
.v3-done { flex: none; border: 0; background: var(--v-surface-2); color: var(--v-text); font: 600 14px/1 var(--v-font); height: 34px; padding: 0 14px; border-radius: 999px; cursor: pointer; }
.v3-due .v-row-s { color: var(--v-warn); }
.v3-due .v3-done { background: var(--v-primary); color: var(--v-on-primary); }
.v3-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; padding-top: 8px; }
.v3-num { display: flex; flex-direction: column; gap: 4px; }
.v3-num-v { font: 600 28px/1.05 var(--v-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.v3-num-v sup { font-size: 14px; color: var(--v-text-3); margin-left: 2px; }
.v3-num-l { font: 500 14px/1.3 var(--v-font); color: var(--v-text-2); }
.v3-miles-in { width: 100%; height: 60px; margin: 18px 0 14px; padding: 0 18px; border: 0; border-radius: 18px; background: var(--v-surface-2) !important; color: var(--v-text); font: 600 26px var(--v-font); }
.v3-miles-in:focus { outline: 2px solid var(--v-text-3); }
.v3-dash .v3-health { padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }

/* ------------------------------------------------------------------ Scan Home */
.v3-scanhome { justify-content: space-between; min-height: 100%; }
.v3-scan-top .v3-meta { max-width: 32ch; font-size: 16px; line-height: 1.45; }
.v3-scan-stage { flex: 1; display: grid; place-items: center; min-height: 300px; }
.v3-scan-btn { position: relative; width: 200px; height: 200px; border: 0; border-radius: 50%; background: none; padding: 0; cursor: pointer; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.v3-scan-core { position: relative; z-index: 2; width: 168px; height: 168px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: var(--v-primary); color: var(--v-on-primary); font: 700 20px/1 var(--v-font); letter-spacing: -0.01em;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); transition: transform 0.25s var(--v-ease); }
.v3-scan-btn:active .v3-scan-core { transform: scale(0.95); }
.v3-scan-core svg { width: 34px; height: 34px; }
.v3-scan-wave { position: absolute; inset: 16px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--v-text) 22%, transparent); animation: v3-wave 3s ease-out infinite; }
.v3-scan-wave.w2 { animation-delay: 1.5s; }
@keyframes v3-wave { from { transform: scale(1); opacity: 0.9; } to { transform: scale(1.55); opacity: 0; } }
.v3-scan-alt { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.v3-scan-note { font: 500 14px/1.45 var(--v-font); color: var(--v-text-2); max-width: 34ch; }
.v3-scan-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.v3-pill { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--v-surface-2); color: var(--v-text); font: 600 15px/1 var(--v-font); text-decoration: none; cursor: pointer; }
.v3-pill svg { width: 18px; height: 18px; }
.v3-scan-car { font: 500 13px var(--v-font); color: var(--v-text-3); }
.v3-stores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
@media (prefers-reduced-motion: reduce) { .v3-scan-wave { animation: none; opacity: 0.4; } }

/* ------------------------------------------------------------------ About & privacy (js/v3/screens/about.js) */
.v-about-safety { flex-direction: row; align-items: flex-start; gap: 12px; padding: 16px 18px; border-radius: 18px; background: color-mix(in srgb, var(--v-warn) 14%, transparent); }
.v-about-safety > .icon { color: var(--v-warn); flex: none; margin-top: 2px; }
.v-about-safety .v-prose { color: var(--v-text); font-size: 16px; }
.v-about-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font: 400 16px/1.45 var(--v-font); color: var(--v-text-2); }
.v-about-list strong { color: var(--v-text); font-weight: 600; }
.v-about-frame { display: block; width: 100%; height: min(70vh, 640px); border: 0; border-radius: 14px; background: var(--v-surface-2); }
.v-garage-about { margin-top: 8px; }
