/* =========================================================================
 * Trail & Error — styles.css
 * Dark, garage-inspired automotive diagnostic theme.
 * Color status language: green=verified, amber=needs/estimate, red=unverified
 * /critical, orange=accent (Jeep), cyan/purple/etc=system accents.
 * ========================================================================= */

:root {
  /* Neutral graphite scale — the product is mostly grey, like a pro tool. */
  --bg:        #131517;
  --bg-2:      #191c1f;
  --bg-3:      #22262a;
  --panel:     #17191c;
  --border:    #2c3035;
  --border-2:  #3b4046;
  --text:      #edeff1;
  --text-2:    #a6acb2;
  --muted:     #767d84;

  /* Jeep accent — a single restrained khaki-amber, used sparingly. Olive is a
     secondary brand nod. Everything else stays neutral grey. */
  --orange:    #d98b34;   /* primary Jeep accent (amber/gold) */
  --orange-2:  #c47a28;   /* accent, darker */
  --olive:     #7d8a5c;   /* secondary brand nod */
  --amber:     #d6a23e;   /* status: caution / planning estimate */
  --green:     #5aa46f;   /* status: verified / healthy (muted) */
  --red:       #cf6a5e;   /* status: unverified / critical (muted brick) */
  --steel:     #8a96a0;   /* neutral system accent */
  --cyan:      #6f9bb0;   /* desaturated info accent (links) */
  --purple:    #8f8aa6;   /* desaturated, used rarely */

  --radius:    14px;
  --radius-sm: 9px;
  --shadow:    0 10px 30px rgba(0,0,0,.45);
  /* Shared height for the two desktop chrome bars (app-header + tab-bar) so they
     render as a matched pair. Matches the tab-bar's natural height so the header
     collapses DOWN to it. Desktop-only; see the min-width:901px block. */
  --chrome-h:  56px;
  /* Type system:
     Headings ....................... Barlow SemiBold (600)   --font-head
     UI labels ...................... Inter Medium    (500)   --font-body @ 500
     Data / specs / torque values ... Barlow Medium   (500)   --font-data
     Long explanations / body ....... Inter Regular   (400)   --font-body @ 400 */
  --font-head: 'Barlow', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-data: 'Barlow', 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
/* The `hidden` attribute must always win, even over component rules that set
   their own `display` (e.g. .data-error/.dashboard). Without this, a hidden
   overlay styled `display:flex` stays visible. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
/* App fits the viewport: the page itself never scrolls. The body is a fixed-
   height flex column (disclaimer banner + the active screen). Any dense
   content scrolls inside its own region, not the window. */
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: .3px; margin: 0 0 .4em; line-height: 1.1; }
a { color: var(--cyan); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg-3); padding: 1px 6px; border-radius: 5px; font-size: .85em; }
.muted { color: var(--muted); }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  font-family: var(--font-body); font-weight: 500; font-size: 1rem;
  border: 1px solid var(--border-2); background: var(--bg-3); color: var(--text);
  padding: 10px 18px; border-radius: var(--radius-sm); cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  text-transform: uppercase; letter-spacing: .6px;
}
.btn:hover { transform: translateY(-1px); border-color: var(--orange); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--orange), var(--orange-2)); color: #1a1206; border-color: transparent; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-lg { padding: 14px 26px; font-size: 1.1rem; }
.btn-small { padding: 7px 12px; font-size: .82rem; }
.btn-tiny { padding: 5px 10px; font-size: .72rem; margin-top: 8px; }
.icon-btn { background: transparent; border: none; color: var(--text-2); font-size: 1.2rem; cursor: pointer; padding: 4px 8px; }
.icon-btn:hover { color: var(--text); }

/* ---- Global disclaimer banner ----------------------------------------- */
.global-disclaimer {
  flex: 0 0 auto;
  background: repeating-linear-gradient(45deg, #1a1206, #1a1206 12px, #1f1608 12px, #1f1608 24px);
  border-bottom: 1px solid var(--border);
  color: var(--amber); font-size: .78rem; text-align: center;
  padding: 7px 16px; letter-spacing: .2px;
}
/* The banner carries a full line for desktop and a terse line for phones;
   only one shows at a time (toggled in the mobile media query). */
.global-disclaimer .disc-short { display: none; }

/* ---- Screens ---------------------------------------------------------- */
/* The active screen fills all height left under the disclaimer banner.
   min-height:0 lets inner flex children scroll instead of growing the page. */
.screen {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* Landing + setup are long-form: let them scroll *within* the screen box on
   short viewports, while the window itself stays fixed. */
.screen-landing, .screen-setup { overflow-y: auto; overflow-x: hidden; }

/* ---- Landing ---------------------------------------------------------- */
.screen-landing { position: relative; }
.landing-bg {
  /* Fixed to the viewport so it covers the screen once and never scrolls or
     tiles vertically when the hero content is taller than the phone screen. */
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(245,158,11,.15), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(34,211,238,.10), transparent 60%),
    linear-gradient(180deg, var(--bg), #0a0d12);
  background-repeat: no-repeat;
  background-size: cover;
}
/* margin:auto vertically centers the hero when it fits; it scrolls otherwise. */
.landing-inner { position: relative; max-width: 1080px; margin: auto; padding: 20px 24px; width: 100%; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.brand-mark { display: inline-flex; align-items: center; }
/* Flat icon system: consistent inline-SVG sizing. */
.ic { width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.18em; flex: none; }
.btn-ic { width: 1.05em; height: 1.05em; vertical-align: -0.14em; margin-right: 4px; }
.logo-ic { width: 38px; height: auto; display: block; }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: 1.4rem; letter-spacing: 1px; }
/* Landing logo lockup: flat mountain emblem above the wordmark, framed by a trail line. */
.logo-lockup { display: inline-flex; flex-direction: column; align-items: stretch; margin-bottom: 22px; }
/* Emblem stretches to the full wordmark width (preserveAspectRatio:none on the SVG). */
.logo-emblem { width: 100%; height: 34px; display: block; }
.logo-lockup .brand-name { font-size: 2rem; letter-spacing: 5px; margin-top: 4px; line-height: 1; text-align: center; white-space: nowrap; }
.brand-trail { display: block; width: 100%; height: 0; border-top: 2px dotted var(--border-2); margin-top: 6px; }
/* Project slogan, sits under the wordmark's trail line in the landing lockup. */
.brand-tagline { margin: 12px auto 0; max-width: 32ch; text-align: center; font-family: var(--font-head); font-style: italic; font-size: 1.02rem; line-height: 1.35; color: var(--text-2); }
.hero-title { font-family: var(--font-head); font-size: clamp(2rem, 4.4vw, 3.4rem); font-weight: 600; margin-bottom: 14px; }
.hero-sub { font-size: 1.05rem; color: var(--text-2); max-width: 680px; margin-bottom: 20px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.hero-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 0; }
.feat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feat-ic { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 10px; background: rgba(217,139,52,.12); color: var(--orange); }
.feat-ic .ic { width: 26px; height: 26px; }
.feat h3 { margin: 10px 0 6px; font-size: 1.3rem; }
.feat p { color: var(--text-2); font-size: .95rem; margin: 0; }

/* ---- Setup ------------------------------------------------------------ */
.setup-wrap { max-width: 880px; margin: 0 auto; padding: 28px 24px 48px; width: 100%; }
.link-back { background: none; border: none; color: var(--text-2); cursor: pointer; font-size: .95rem; margin-bottom: 14px; }
.link-back:hover { color: var(--text); }
.setup-wrap h1 { font-size: 2.3rem; }
.setup-lead { color: var(--text-2); margin-bottom: 18px; }
.setup-warning {
  background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.35);
  color: var(--amber); padding: 12px 16px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 24px;
}
.setup-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; background: var(--panel); }
.setup-form legend { font-family: var(--font-head); font-size: 1.3rem; color: var(--orange); padding: 0 8px; }
.legend-note { font-size: .8rem; color: var(--muted); font-family: var(--font-body); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.setup-form label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--text-2); font-weight: 500; min-width: 0; }
.setup-form input, .setup-form select {
  background: var(--bg-3); border: 1px solid var(--border-2); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: .95rem; font-family: var(--font-body);
  /* width:100% + min-width:0 stop inputs from forcing the grid wider than the
     phone screen (the cause of the horizontal scroll on the setup page). */
  width: 100%; min-width: 0; max-width: 100%;
}
.setup-form input:focus, .setup-form select:focus { outline: 2px solid var(--orange); outline-offset: 0; border-color: var(--orange); }
.setup-form input:disabled { opacity: .6; }
.form-errors { background: rgba(239,68,68,.1); border: 1px solid var(--red); border-radius: var(--radius-sm); padding: 12px 12px 12px 30px; color: #fca5a5; margin-bottom: 18px; }
.form-actions { margin-top: 10px; }

/* ---- App layout ------------------------------------------------------- */
.app-header {
  /* Center every item vertically (brand cluster lines up with the status tiles
     to the right). Extra top padding leaves room for the emblem that floats
     above the wordmark. */
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  /* Inner content aligned to the same centered 1280px column as the 3D scene. */
  padding: 18px max(22px, calc((100% - 1280px) / 2 + 22px)) 12px;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
  /* Must out-stack .life-slider (z 30): the sticky header is one stacking
     context, so the ⋯ dropdown inside it can never exceed this value — at 20
     the menu rendered BEHIND the slider strip. Stays under the detail
     scrim/drawer (38/40). */
  position: sticky; top: 0; z-index: 35;
}
/* Logo above the wordmark; emblem stretches to the wordmark width (landing-style). */
.app-brand { position: relative; font-family: var(--font-head); font-weight: 600; line-height: 1;
  display: inline-block; align-self: center; }
.app-logo-emblem { position: absolute; bottom: 100%; left: 0; width: 100%; height: 11px;
  margin-bottom: 3px; display: block; }
.app-brand-name { font-size: 1.05rem; letter-spacing: 1.5px; white-space: nowrap; }
/* Keep the vehicle summary's text baseline aligned with the wordmark. */
.vehicle-summary { align-self: center; }
.vehicle-summary { flex: 1; min-width: 200px; display: flex; align-items: baseline; gap: 8px; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.vs-name { font-weight: 600; font-size: .95rem; }
.vs-meta { font-size: .85rem; color: var(--text-2); }
.vs-mi { font-size: .85rem; color: var(--text-2); }
.vs-mi strong { color: var(--text); }
.vs-sep { color: var(--muted); }
.vs-severe { color: var(--orange); font-weight: 600; }
.vs-factors { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.vs-chip { background: var(--bg-3); border: 1px solid var(--border-2); border-radius: 20px; padding: 1px 9px; font-size: .7rem; color: var(--text-2); }
.app-header-actions { display: flex; gap: 8px; }
.settings-menu-wrap { position: relative; }
.settings-btn { font-size: 1.4rem; line-height: 1; padding: 4px 10px; border-radius: 7px; }
.settings-btn:hover { background: var(--bg-3); }
.settings-menu {
  position: absolute; right: 0; top: 100%; margin-top: 6px; z-index: 30;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; min-width: 190px; display: flex; flex-direction: column;
}
.settings-menu button {
  background: none; border: none; color: var(--text-2); text-align: left; font-family: var(--font-body);
  font-size: .9rem; font-weight: 500; padding: 9px 12px; border-radius: 7px; cursor: pointer;
}
.settings-menu button:hover { background: var(--bg-3); color: var(--text); }

/* Status counts hoisted into the header — three identical stat tiles so the
   most important info ("what's due") is always visible and visually uniform. */
.header-status { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.hs-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-width: 86px; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--bg-3);
}
.hs-chip b { font-family: var(--font-data); font-weight: 500; font-size: 1.25rem; line-height: 1; color: var(--text); }
.hs-label { font-size: .62rem; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
/* Color appears only on the value, and only when it carries meaning. */
.hs-now b { color: var(--red); }
.hs-soon b { color: var(--amber); }
.hs-high b { color: var(--red); }
.hs-mid b { color: var(--amber); }
.hs-low b { color: var(--green); }

/* ---- Life slider ------------------------------------------------------ */
/* Slider panel keeps a full-width background, but its inner content is aligned
   to the same centered 1280px column (+22px gutter) as .app-main / the 3D scene
   so the track lines up with the explorer viewport edges. */
.life-slider { background: var(--panel); border-bottom: 1px solid var(--border);
  padding: 10px max(22px, calc((100% - 1280px) / 2 + 22px)) 12px;
  /* Own stacking context above the 3D scene (which is a composited layer via
     isolation/translateZ on .three-container) so the break-in popover, which
     opens over the scene, isn't hidden behind the canvas. */
  position: relative; z-index: 30; }
/* Mileage pinned left; ownership-stage text stays centered across the row. */
.ls-row { position: relative; display: flex; align-items: center; justify-content: center; min-height: 38px; }
/* Left-aligned with the slider track's start (thumb center at value 0). */
.ls-row .slider-mileage { position: absolute; left: 0; top: 50%; transform: translateY(-50%); white-space: nowrap; }
.ls-row .slider-readout { text-align: center; }
/* The mileage is the app's primary value (it drives the whole plan), so it's the
   visual hero of the slider area: large, bold, tabular figures (no width jitter
   while scrubbing), with an amber unit tying it to the slider thumb accent. */
.sm-num { font-family: var(--font-data); font-size: 2.45rem; font-weight: 600; color: var(--text); line-height: 1;
  letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.sm-unit { font-family: var(--font-data); font-weight: 600; font-size: .95rem; color: var(--orange); margin-left: 5px; text-transform: uppercase; letter-spacing: .5px; }
/* Neutral progress track (filled portion driven by --pct from JS). The single
   accent is the thumb ring — the slider is the primary control, so it earns it. */
.slider-wrap { position: relative; margin-top: 4px; }
/* Decorative Jeep-terrain ridge behind the track (ALL sizes). The actual
   draggable track stays straight + legible (z-index above); the ridge is pure
   branding (pointer-events:none) — a faint mountain silhouette whose baseline
   sits on the track line. Subtle by default (mobile); desktop bumps it slightly. */
.trail-terrain {
  display: block; position: absolute; left: 0; right: 0; bottom: 50%;
  height: 10px; z-index: 0; pointer-events: none; opacity: .3;
  background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='240'%20height='16'%20viewBox='0%200%20240%2016'%20preserveAspectRatio='none'%3E%3Cpath%20d='M0%2016%20L0%2010%20L20%205%20L38%209%20L58%203%20L78%2010%20L96%206%20L116%2011%20L136%204%20L158%2010%20L178%206%20L198%2011%20L218%205%20L240%209%20L240%2016%20Z'%20fill='%238a96a0'/%3E%3C/svg%3E") repeat-x left bottom / 200px 10px;
}
.slider { position: relative; z-index: 1;
  /* margin:0 overrides the UA default (~2px each side on range inputs) that
     insets the track from the full-width .trail-terrain ridge above it — without
     it the bar looks a few px narrower / shifted right (most visible at 0 mi). */
  -webkit-appearance: none; appearance: none; width: 100%; margin: 0; height: 6px; border-radius: 4px; outline: none;
  background: linear-gradient(90deg, var(--steel) 0 var(--pct, 20%), var(--bg-3) var(--pct, 20%) 100%); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--orange); cursor: grab; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 3px solid var(--orange); cursor: grab; }
.ls-ticks { display: flex; justify-content: space-between; font-size: .68rem; color: var(--muted); margin-top: 4px; }
.slider-readout { font-size: .82rem; color: var(--text-2); }
.slider-readout strong { color: var(--text); }

/* Trail-marker "peak" above each tick label (0/50k/100k/150k/200k) — applies at
   all sizes; low-risk branding charm. */
.ls-ticks span { position: relative; padding-top: 7px; }
.ls-ticks span::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 3px solid transparent; border-right: 3px solid transparent;
  border-bottom: 5px solid var(--steel); opacity: .55;
}
/* Desktop has more room: a slightly taller, more present ridge. */
@media (min-width: 601px) {
  .trail-terrain { height: 13px; opacity: .4; background-size: 240px 13px; }
}

/* ---- Tabs ------------------------------------------------------------- */
/* overflow must stay visible so the "More" dropdown isn't clipped.
   Primary tabs are centered; the More menu floats to the right edge. */
.tab-bar { position: relative; display: flex; justify-content: center; gap: 2px; overflow: visible; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 0 14px; }
.tab-bar button {
  background: none; border: none; color: var(--text-2); font-family: var(--font-body); font-weight: 500;
  font-size: 1rem; padding: 14px 16px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap;
}
.tab-bar > button:hover, .tab-more-btn:hover { color: var(--text); }
.tab-bar > button.active, .tab-more-btn.active { color: var(--orange); border-bottom-color: var(--orange); }

/* Secondary tools overflow menu — pinned to the right so primary tabs center. */
/* Align the More button's right edge with the 3D scene / content column. */
.tab-more { position: absolute; right: max(14px, calc((100% - 1280px) / 2 + 22px)); top: 0; }
.tab-more-btn {
  background: none; border: none; color: var(--text-2); font-family: var(--font-body); font-weight: 500;
  font-size: 1rem; padding: 14px 16px; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap;
}
.tab-more-menu {
  position: absolute; right: 0; top: 100%; z-index: 30;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; min-width: 200px; display: flex; flex-direction: column;
}
.tab-more-menu button {
  background: none; border: none; color: var(--text-2); text-align: left; font-family: var(--font-body);
  font-size: .92rem; font-weight: 500; padding: 9px 12px; border-radius: 7px; cursor: pointer; border-bottom: none;
}
.tab-more-menu button:hover { background: var(--bg-3); color: var(--text); }
.tab-more-menu button.active { color: var(--orange); background: var(--bg-3); }

/* ---- Desktop chrome: equal-height header + tab-bar w/ tire-tread texture ---- */
/* Desktop only (≥901px). On phones the header wraps into multiple centered rows
   (see the max-width:900px block), so a fixed row height + tread texture there
   would fight the wrap — keep the mobile chrome plain. */
@media (min-width: 901px) {
  /* Both bars share the tab-bar's natural height so they look like a matched
     pair. min-height (not height) still lets the header grow if the vehicle line
     ever wraps to a second row. */
  .app-header, .tab-bar {
    min-height: var(--chrome-h);
    /* Very faint tire-tread chevrons in the grey palette (--border-2), mostly
       transparent so each bar's --bg-2 reads first — just a subtle texture.
       Tile: two tread bands (y≈11 & y≈33, 22px apart) that repeat seamlessly. */
    background:
      url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='20'%20height='44'%20viewBox='0%200%2020%2044'%3E%3Cg%20fill='none'%20stroke='%233b4046'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'%20opacity='0.12'%3E%3Cpath%20d='M2%206%20L12%2011%20L2%2016'/%3E%3Cpath%20d='M2%2028%20L12%2033%20L2%2038'/%3E%3C/g%3E%3C/svg%3E") repeat,
      var(--bg-2);
    /* Nudge the tread tile up so the two bands sit symmetrically in the bar. */
    background-position: 0 -5px, 0 0;
  }
  /* Collapse the header's tall stock padding so its content (the status tiles)
     centers inside the shared height instead of forcing the bar taller. */
  .app-header { padding-top: 0; padding-bottom: 0; }
  /* The emblem is absolutely positioned ABOVE the wordmark (out of flow), so
     flex-centering only centers the wordmark and the cluster reads high. Reserve
     the emblem's height (11px + 3px gap) as top padding and drop the emblem into
     it, so emblem + wordmark center together as one block. */
  .app-brand { padding-top: 14px; transform: translateY(-1px); }
  .app-brand .app-logo-emblem { top: 0; bottom: auto; margin-bottom: 0; }
  /* No dividing lines around the chrome bars on desktop. The lines that read as
     a "top border" on each bar are actually the bottom border of the element
     ABOVE it — the disclaimer banner above the header, and the life-slider above
     the tab-bar — so clear those too. */
  .app-header, .tab-bar { border: none; }
  .global-disclaimer, .life-slider { border-bottom: none; }
}

/* ---- Panels ----------------------------------------------------------- */
/* app-main fills the height left under header/slider/tabs and never grows the
   page. The active panel is a flex column; its dense region scrolls inside. */
.app-main {
  flex: 1 1 auto; min-height: 0;
  padding: 18px 22px; width: 100%; max-width: 1280px; margin: 0 auto;
  display: flex; flex-direction: column; overflow: hidden;
}
.panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.panel[hidden] { display: none !important; }
.panel-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { font-size: 1.5rem; margin: 0; text-transform: uppercase; letter-spacing: .8px; }
/* Scrollable regions inside panels (instead of the window scrolling). */
.search-input { flex: 0 0 auto; }
.table-wrap, .report-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }

/* Explorer */
.panel-explorer { position: relative; }
.three-container { position: relative; flex: 1 1 auto; width: 100%; height: auto; min-height: 0; border-radius: var(--radius);
  overflow: hidden; background: #0d1117; border: 1px solid var(--border-2); cursor: grab;
  /* Stop the browser turning a touch-drag into a scroll/zoom so rotation is smooth on mobile. */
  touch-action: none;
  /* iOS Safari won't clip a composited WebGL canvas to the parent's rounded
     corners (bottom corners stay square), so isolate the stacking context. */
  isolation: isolate; -webkit-transform: translateZ(0); }
/* Round the canvas itself too, so all four corners are rounded even where the
   parent's overflow clip doesn't apply to the composited canvas layer. */
.three-container canvas { display: block; border-radius: inherit; }
/* Hover label for 3D markers — tells the user what a marker teaches. */
.hotspot-tip { position: absolute; transform: translate(14px, -50%); pointer-events: none; z-index: 5;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--border-2); border-left: 3px solid var(--orange);
  font-family: var(--font-body); font-weight: 500; font-size: .85rem; letter-spacing: .3px; padding: 5px 10px; border-radius: 6px;
  white-space: nowrap; box-shadow: var(--shadow); }
/* Touch tap-to-label variants: centered above the bubble (beside-placement runs
   off narrow screens), flipped below when the bubble is near the canvas top. */
.hotspot-tip.tip-above { transform: translate(-50%, -100%); margin-top: -18px; }
.hotspot-tip.tip-below { transform: translate(-50%, 0); margin-top: 18px; }

/* Break-in guidance — inline chip on the readout line. The expanded body is a
   popover overlay (position:absolute) so it never pushes the 3D scene down. */
.break-in { display: none; }
.breakin { display: inline-block; position: relative; margin-left: 8px; vertical-align: baseline; }
/* The chip is rendered twice (readout + mileage line); show the readout copy on
   desktop, the mileage-line copy on mobile (toggled in the 600px query). */
.breakin-mobile { display: none; }
.breakin > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 5px;
  font-size: .76rem; color: var(--amber); padding: 2px 8px; border: 1px solid rgba(217,139,52,.4);
  border-radius: 20px; background: rgba(217,139,52,.1); }
.breakin > summary::-webkit-details-marker { display: none; }
.breakin > summary .ic { width: 1em; height: 1em; color: var(--amber); }
.breakin[open] > summary { background: rgba(217,139,52,.2); }
.breakin-body { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); z-index: 25;
  width: min(420px, 80vw); font-size: .8rem; color: var(--text-2); line-height: 1.45; text-align: left;
  /* Always wrap, even when an ancestor (e.g. the mileage element) sets nowrap —
     otherwise the paragraph spills outside the popover box. */
  white-space: normal;
  background: var(--bg-2); border: 1px solid rgba(217,139,52,.4); border-radius: 8px; padding: 10px 12px;
  box-shadow: var(--shadow); }
.breakin-body em { color: var(--amber); font-style: normal; }
.explorer-hint { flex: 0 0 auto; text-align: center; color: var(--muted); font-size: .78rem; margin-top: 8px; }
/* Compact touch-gesture hint — shown only on phones (≤600px swaps these). */
.explorer-hint-mobile { display: none; flex: 0 0 auto; text-align: center; color: var(--muted); font-size: .72rem; margin-top: 6px; }

/* Reset-view pill overlaying the 3D canvas corner. */
.reset-view { position: absolute; right: 10px; top: 10px; z-index: 6;
  font-family: var(--font-body); font-weight: 500; font-size: .74rem; color: var(--text-2);
  background: rgba(19,21,23,.72); border: 1px solid var(--border-2); border-radius: 20px;
  padding: 6px 12px; cursor: pointer; backdrop-filter: blur(2px); }
.reset-view:hover { color: var(--text); border-color: var(--orange); }
.reset-view .rv-glyph { margin-right: 5px; font-size: 1.4em; line-height: 1; vertical-align: -0.02em; }

/* Model download progress — centered over the empty terrain while the GLB loads. */
.model-loading { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; pointer-events: none; }
.model-loading .ml-label { font-family: var(--font-data); font-weight: 500; font-size: .85rem;
  color: var(--text-2); letter-spacing: .4px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.model-loading .ml-track { width: min(260px, 60%); height: 4px; border-radius: 4px;
  background: rgba(255,255,255,.12); overflow: hidden; }
.model-loading .ml-bar { width: 0%; height: 100%; border-radius: 4px; background: var(--orange);
  transition: width .25s ease; }
.model-loading .ml-bar.ml-indeterminate { width: 40%; animation: ml-slide 1.2s ease-in-out infinite alternate; }
@keyframes ml-slide { from { margin-left: 0; } to { margin-left: 60%; } }
/* Required attribution for the CC BY-NC-SA Jeep model. */
.model-credit { flex: 0 0 auto; text-align: center; color: var(--muted); font-size: .68rem; margin-top: 3px; opacity: .8; }
.model-credit a { color: var(--text-2); }
.model-credit .mc-short { display: none; }

/* ---- Dashboard -------------------------------------------------------- */
/* The whole panel scrolls (heading + disclaimer included) rather than pinning a
   static header above inner per-column scrollers. The three buckets flow at
   natural height and scroll as one; each <details> stays collapsible so users
   can still hide buckets they don't care about. */
.panel-dashboard { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.dashboard { flex: 0 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.dash-col { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; min-height: 0; }
.dash-col-body { overflow: visible; }
.dash-col-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); cursor: pointer; list-style: none; }
.dash-col-head::-webkit-details-marker { display: none; }
.dash-col-head h3 { margin: 0; font-size: 1.3rem; }
.dash-col .count { background: var(--bg-3); border-radius: 20px; padding: 1px 10px; font-size: .8rem; color: var(--text-2); margin-left: auto; }
/* Caret signals the section is collapsible; rotates when closed. */
.dash-col-head::after { content: '▾'; color: var(--muted); font-size: .8rem; transition: transform .15s ease; }
.dash-col:not([open]) > .dash-col-head { margin-bottom: 0; }
.dash-col:not([open]) > .dash-col-head::after { transform: rotate(-90deg); }
.dash-now .dash-col-head h3 { color: var(--red); }
.dash-soon .dash-col-head h3 { color: var(--amber); }
.dash-future .dash-col-head h3 { color: var(--green); }
.dash-col-body { display: flex; flex-direction: column; gap: 12px; }

.dash-card { background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 12px; }
.dash-card-top { display: flex; justify-content: space-between; align-items: center; }
.dash-card-title { font-weight: 600; font-size: 1rem; margin: 6px 0 2px; }
.dash-card-sys { font-size: .78rem; color: var(--muted); }
.dash-due { font-size: .85rem; margin-top: 8px; color: var(--text-2); }
.dash-due .over { color: var(--red); font-weight: 600; }
.dash-due .in { color: var(--text-2); }
.dash-est { margin-top: 6px; }
.dash-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.dash-card-foot .mini { font-size: .72rem; color: var(--muted); }
.severe-dot { color: var(--orange); font-weight: 700; }
.dash-card-actions { display: flex; gap: 8px; align-items: center; }
.dash-card-actions .btn-tiny { margin-top: 8px; }

/* Mark-done + planner-state surfaces (service logging loop) */
.btn-done { border-color: rgba(90,164,111,.55); color: #86efac; }
.btn-done:hover { background: rgba(90,164,111,.16); border-color: #5aa46f; }
.plan-chip { font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.plan-chip.plan-completed { color: #86efac; border-color: rgba(90,164,111,.55); }
.plan-chip.plan-planned { color: var(--amber); border-color: rgba(245,158,11,.4); }
.plan-chip.plan-needs-pro { color: #fca5a5; border-color: rgba(239,68,68,.4); }
.planner-last { font-size: .75rem; margin-top: 6px; }

/* ---- Pills & badges --------------------------------------------------- */
.pill { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px; }
.pill-do-now { background: rgba(239,68,68,.18); color: #fca5a5; }
.pill-coming-soon { background: rgba(245,158,11,.18); color: var(--amber); }
.pill-future { background: rgba(34,197,94,.16); color: #86efac; }
.pill-unknown { background: var(--bg-3); color: var(--text-2); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 600;
  padding: 2px 9px; border-radius: 20px; border: 1px solid transparent; white-space: nowrap; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-green { background: rgba(34,197,94,.13); color: #86efac; border-color: rgba(34,197,94,.4); }
.badge-amber { background: rgba(245,158,11,.13); color: var(--amber); border-color: rgba(245,158,11,.4); }
.badge-red { background: rgba(239,68,68,.13); color: #fca5a5; border-color: rgba(239,68,68,.4); }
.badge-gray { background: var(--bg-3); color: var(--text-2); border-color: var(--border-2); }
.badge-planning { font-size: .68rem; }

.val { font-family: var(--font-data); color: var(--text); font-weight: 500; }
.val-est { font-family: var(--font-data); color: var(--amber); font-weight: 500; }
.val-missing { color: #fca5a5; font-style: italic; font-size: .85rem; }

/* ---- Detail panel (drawer) ------------------------------------------- */
/* Scrim dims/blurs the page so the drawer pops to the foreground. */
.detail-scrim { position: fixed; inset: 0; z-index: 38; background: rgba(8,10,13,.6); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.detail-panel { position: fixed; top: 0; right: 0; height: 100vh; width: min(480px, 100%);
  background: linear-gradient(180deg, #1e232a 0%, #15181c 100%);
  /* --accent is set inline by app.js openSystem() to the bubble's state color
     (priority red/amber/green or base blue) so the drawer edge matches the
     marker that opened it; orange is the no-JS/no-WebGL fallback. */
  border-left: 3px solid var(--accent, var(--orange)); box-shadow: -26px 0 64px rgba(0,0,0,.62);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); z-index: 40; overflow-y: auto; }
.detail-panel.open { transform: translateX(0); }
.detail-head { position: sticky; top: 0; background: var(--bg-2); padding: 16px 20px;
  /* Fixed grey on purpose (NOT var(--accent)): the state color lives on the
     drawer's left edge; this separator stays consistent across all systems. */
  display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--border-2); z-index: 2; }
.detail-head h2 { margin: 0; font-size: 1.6rem; }
.detail-body { padding: 18px 20px 60px; }
.info-block { margin-bottom: 16px; }
.info-block h4 { font-size: 1.05rem; color: var(--orange-2); margin: 0 0 4px; }
.info-block p { margin: 0; color: var(--text-2); font-size: .92rem; }
.bullet { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); font-size: .9rem; }
.bullet li { margin-bottom: 2px; }
.detail-sub { font-size: 1.3rem; margin: 22px 0 12px; color: var(--text); border-top: 1px solid var(--border); padding-top: 16px; }

/* Task card */
.task-card { background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px; }
.task-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.task-card-title { font-weight: 600; font-size: 1.05rem; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { display: inline-flex; gap: 5px; background: var(--bg-3); border: 1px solid var(--border-2); border-radius: 6px; padding: 3px 8px; font-size: .72rem; }
.chip-k { color: var(--muted); }
.chip-v { font-family: var(--font-data); color: var(--text); font-weight: 500; }
.task-reason { font-size: .88rem; color: var(--text-2); margin: 8px 0; }
.task-interval { font-size: .88rem; margin: 8px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ti-label { color: var(--muted); font-weight: 600; }
.ref-list { list-style: none; padding: 0; margin: 6px 0 0; }
.ref-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: .85rem; }
.ref-name { font-weight: 600; }
.tools { font-size: .82rem; color: var(--text-2); margin: 8px 0; }

/* Step-by-step DIY guide (collapsible) */
.steps { margin: 10px 0; border: 1px solid var(--border-2); border-radius: 8px; background: var(--bg-3); }
.steps > summary { cursor: pointer; list-style: none; padding: 9px 12px; font-family: var(--font-body); font-weight: 500;
  font-size: .9rem; letter-spacing: .3px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.steps > summary::-webkit-details-marker { display: none; }
.steps > summary .ic { color: var(--orange); }
.steps[open] > summary { border-bottom: 1px solid var(--border); }
.steps-list { margin: 8px 0 4px; padding: 0 14px 0 32px; }
.steps-list li { margin-bottom: 7px; font-size: .86rem; color: var(--text-2); line-height: 1.45; }
.steps-note { font-size: .74rem; color: var(--muted); padding: 0 12px 10px; margin: 4px 0 0; font-style: italic; }
.video-link { display: inline-flex; align-items: center; gap: 7px; margin: 4px 0 2px; font-size: .85rem; font-weight: 600;
  color: var(--orange); text-decoration: none; }
.video-link:hover { text-decoration: underline; }
.video-link .ic { color: var(--orange); }
.severe-flag { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.4); color: var(--amber);
  border-radius: 8px; padding: 8px 10px; font-size: .82rem; margin: 8px 0; }
.planner-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.planner-label { font-size: .75rem; color: var(--muted); }
.planner-select { background: var(--bg-3); border: 1px solid var(--border-2); color: var(--text); border-radius: 6px; padding: 6px 8px; font-size: .82rem; }
.disclaimer-block { background: var(--bg-3); border: 1px solid var(--border-2); border-left: 3px solid var(--amber);
  border-radius: 8px; padding: 12px; font-size: .78rem; color: var(--muted); margin-top: 20px; }

/* ---- Tables ----------------------------------------------------------- */
.search-input { width: 100%; background: var(--bg-3); border: 1px solid var(--border-2); color: var(--text);
  border-radius: var(--radius-sm); padding: 11px 14px; font-size: .95rem; margin-bottom: 14px; }
.search-input:focus { outline: 2px solid var(--orange); border-color: var(--orange); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th { text-align: left; padding: 10px 12px; background: var(--bg-2); color: var(--text-2);
  font-family: var(--font-body); font-weight: 500; border-bottom: 2px solid var(--border-2); position: sticky; top: 0; }
.data-table td { font-family: var(--font-data); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }
.data-table .center { text-align: center; }
.row-note { font-family: var(--font-body); font-weight: 400; font-size: .76rem; color: var(--muted); margin-top: 3px; max-width: 360px; }
.torque-warning { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.35); color: #fca5a5;
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: .85rem; margin-bottom: 14px; }
.lib-gen-note { font-family: var(--font-body); font-weight: 400; font-size: .82rem; color: var(--text-2);
  margin: 0 0 12px; padding: 8px 12px; background: rgba(217,139,52,.08); border-left: 3px solid var(--orange);
  border-radius: var(--radius-sm); }
.lib-gen-note strong { font-family: var(--font-data); font-weight: 500; color: var(--text-1); }

/* ---- Source manager --------------------------------------------------- */
.sm-intro { color: var(--text-2); font-size: .9rem; margin-bottom: 16px; }
.sm-summary { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }
.sm-stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.sm-stat-val { font-family: var(--font-data); font-size: 1.7rem; font-weight: 500; }
.sm-stat-label { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.sm-green .sm-stat-val { color: #86efac; }
.sm-amber .sm-stat-val { color: var(--amber); }
.sm-red .sm-stat-val { color: #fca5a5; }
.sm-gray .sm-stat-val { color: var(--text); }

/* ---- Report ----------------------------------------------------------- */
.report-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.report-head h1 { font-size: 2rem; }
.report-date { color: var(--muted); }
.report section { margin: 22px 0; }
.report h2 { font-size: 1.4rem; color: var(--orange-2); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.report-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.report-table th, .report-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.report-table th { color: var(--text-2); width: 38%; }
.report-warn { background: rgba(245,158,11,.07); border: 1px solid rgba(245,158,11,.3); border-radius: var(--radius-sm); padding: 14px 18px; }
.report-disclaimer { font-size: .78rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 14px; }

/* ---- Toast ------------------------------------------------------------ */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--green); color: #062b13; font-weight: 600; padding: 10px 20px; border-radius: 30px;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 60; font-size: .9rem; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Boot loader ------------------------------------------------------ */
/* First paint on slow connections: branded overlay + progress bar driven by
   script-load milestones (inline JJG_BOOT in index.html; app.js dismisses it
   when the first screen renders). Same visual language as .model-loading.
   z-index 80: above all app chrome, below .data-error (100). */
.boot-loader { position: fixed; inset: 0; z-index: 80; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .4s ease; }
.boot-loader.boot-out { opacity: 0; pointer-events: none; }
.boot-inner { display: flex; flex-direction: column; align-items: center; width: min(300px, 78vw); }
.boot-emblem { width: 148px; height: 32px; display: block; }
.boot-brand { font-family: var(--font-head); font-weight: 600; font-size: 1.15rem;
  letter-spacing: 4px; color: var(--text); margin-top: 5px; line-height: 1; white-space: nowrap; }
.boot-trail { display: block; width: 148px; height: 0; border-top: 2px dotted var(--border-2); margin-top: 8px; }
.boot-track { width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.12);
  overflow: hidden; margin-top: 26px; }
.boot-bar { width: 0%; height: 100%; border-radius: 4px; background: var(--orange);
  transition: width .35s ease; }
.boot-label { font-family: var(--font-data); font-weight: 500; font-size: .8rem;
  color: var(--text-2); letter-spacing: .4px; margin-top: 10px; min-height: 1.25em;
  text-align: center; line-height: 1.4; }

/* ---- Data error ------------------------------------------------------- */
.data-error { position: fixed; inset: 0; background: rgba(8,10,14,.96); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.data-error-card { background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 28px; max-width: 560px; }
.data-error-card h2 { color: var(--amber); }
.data-error-card pre { background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px; padding: 12px; overflow-x: auto; color: var(--cyan); }

/* ---- Responsive ------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-features { grid-template-columns: 1fr; }
  /* Stack the three buckets into a single column (the panel-level scroll from
     the base rules already moves the heading + disclaimer into the scroll). */
  .dashboard { display: block; }
  .dash-col { margin-bottom: 14px; }
  .sm-summary { grid-template-columns: repeat(2, 1fr); }
  /* Data panels (Fluids & Parts, Torque, Source Manager): phones don't leave
     enough height for the desktop inner-table scroller, so the PANEL becomes
     the vertical scroll container — the heading scrolls up under the tab bar
     while the search bar pins to the top and rows scroll beneath it.
     .table-wrap keeps only its horizontal pan for wide tables (its auto
     height means it never scrolls vertically here, so the column-header
     sticky inside it simply deactivates on mobile). */
  .panel[data-panel="library"], .panel[data-panel="torque"], .panel[data-panel="sourcemgr"] {
    display: block; overflow-y: auto; }
  .panel[data-panel="library"] .search-input, .panel[data-panel="torque"] .search-input {
    position: sticky; top: 0; z-index: 7; box-shadow: 0 6px 12px -4px rgba(8,10,13,.6); }
  .grid-2 { grid-template-columns: 1fr; }
  .detail-panel { width: 100%; }
  /* Pin the 3D view to a fixed height on mobile (flex:0 0) so changes to the
     bottom slider readout — the break-in chip appearing/disappearing at 1,500
     mi, or the ownership-stage note wrapping to a different number of lines —
     can NEVER reflow/resize the canvas and leave a blank gap under it. */
  .three-container { flex: 0 0 50vh; height: 50vh; }
}
@media (max-width: 600px) {
  /* Slider readout on phones: stack and CENTER. The mileage (with the inline
     break-in chip beside it) is centered on its own line; the ownership-stage
     note is centered below. No absolute positioning, no left-alignment. */
  .ls-row { flex-direction: column; align-items: center; justify-content: center; text-align: center; row-gap: 2px; min-height: 0; }
  /* Mileage number CENTERED on the page; the break-in chip is pulled out of
     flow and pinned to the right edge so it doesn't shift the centered number. */
  .ls-row .slider-mileage { position: relative; transform: none; display: flex; align-items: center; justify-content: center; width: 100%; }
  .ls-row .slider-readout { text-align: center; min-width: 0; }
  /* Break-in chip: on mobile show the copy beside the mileage, hide the readout
     copy, and float it to the right edge (number stays centered). */
  .breakin-mobile { display: inline-block; }
  .breakin-desktop { display: none; }
  .ls-row .breakin-mobile { position: absolute; right: 0; top: 50%; transform: translateY(-50%); margin-left: 0; }
  .sm-num { font-size: 1.75rem; }
  .sm-unit { font-size: .8rem; }
  /* Trim the caution banner on phones: terser text, smaller type, tighter padding. */
  .global-disclaimer { font-size: .68rem; padding: 5px 12px; line-height: 1.35; letter-spacing: 0; }
  .global-disclaimer .disc-full { display: none; }
  .global-disclaimer .disc-short { display: inline; }
  /* Landing: center the logo lockup at the top on phones (it's left-aligned
     inline-flex on desktop). */
  .logo-lockup { display: flex; margin-left: auto; margin-right: auto; width: max-content; max-width: 100%; }
  /* Hide the "VR view (coming soon)" button on phones — VR will be a desktop/
     headset feature, so it shouldn't appear in the mobile landing actions. */
  #vr-btn { display: none; }
  /* Header on phones: wrap into centered rows. Row 1 = brand (left) + menu
     (right); the vehicle line and the status tiles each take a full centered
     row so the "… · 3.6L V6 · …" line is no longer truncated. */
  .app-header { gap: 8px 12px; flex-wrap: wrap; row-gap: 8px; justify-content: center; text-align: center; }
  /* Logo alone on the top row, centered. The ⋯ menu is pulled to the top-right
     corner (out of flow) so it doesn't shove the logo off-center. */
  .app-brand { order: 0; }
  .app-header-actions { position: absolute; top: 10px; right: 12px; margin-left: 0; }
  /* Hide engine/transmission on phones and keep "<year> … Rubicon · <mi>" on a
     single centered line. */
  .vehicle-summary { order: 2; flex: 1 1 100%; min-width: 0; justify-content: center;
    flex-wrap: nowrap; white-space: nowrap; overflow: visible; text-align: center; }
  .vehicle-summary .vs-meta { display: none; }
  .header-status { order: 3; flex: 1 1 100%; justify-content: center; }
  /* Tabs: "3D Explorer" and "Maintenance" center in the bar (via the tab-bar's
     justify-content:center) while "More" keeps its original absolute right-pin. */
  /* Mobile: move the slider to the BOTTOM (thumb-reachable). The screen is a
     flex column; order pushes .life-slider last without changing the DOM.
     safe-area padding keeps it clear of the phone home-bar. */
  .screen-app { position: relative; }
  .life-slider { order: 99; border-bottom: none; border-top: 1px solid var(--border);
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .app-header { order: 0; }
  .tab-bar { order: 1; }
  .app-main { order: 2; }
  /* Reclaim space under the 3D scene: the orbit hint ("scroll to zoom") is
     desktop-centric, and the model attribution shrinks to a compact one-liner
     (still links title + license to satisfy the CC BY-NC-SA terms). */
  .explorer-hint { display: none; }
  .explorer-hint-mobile { display: block; }
  /* The explorer column (50vh canvas + hints + credit) can run taller than the
     space app-main leaves once the header wraps, which clipped the last item —
     the model attribution — off the bottom. Overlay it flush on the BOTTOM EDGE
     OF THE CANVAS instead: the canvas is the first child of .panel-explorer and
     is exactly 50vh tall, so top:50vh + translateY(-100%) sits the credit's
     bottom edge right on the canvas bottom (with a scrim for legibility) — the
     CC BY-NC-SA credit is always visible and pinned to the 3D view. */
  .model-credit { position: absolute; left: 0; right: 0; top: 50vh; transform: translateY(-100%); z-index: 4;
    font-size: .6rem; margin: 0; padding: 4px 8px; line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0,0,0,.9);
    background: linear-gradient(to top, rgba(13,17,23,.9), rgba(13,17,23,0)); }
  .model-credit .mc-full { display: none; }
  .model-credit .mc-short { display: inline; }
  /* Slider sits at the bottom on phones, so the break-in popover must open
     UPWARD (and hug the right edge) instead of dropping off the screen. */
  .breakin-body { top: auto; bottom: calc(100% + 6px); left: auto; right: 0; transform: none;
    width: min(320px, 86vw); max-height: 50vh; overflow-y: auto; }
}

/* ---- Portrait-only guard (mobile) ------------------------------------- */
/* Hidden by default; only shown on short, landscape viewports (i.e. phones
   turned sideways). Desktops are landscape too but are tall, so max-height
   keeps them unaffected. */
.rotate-notice { display: none; }
.rotate-notice .rotate-inner { max-width: 340px; text-align: center; color: var(--text); }
.rotate-notice svg { color: var(--orange); margin-bottom: 14px; }
.rotate-notice h2 { font-family: var(--font-head); font-size: 1.25rem; margin: 0 0 8px; }
.rotate-notice p { font-family: var(--font-body); color: var(--text-2); font-size: .9rem; line-height: 1.5; margin: 0; }
@media (orientation: landscape) and (max-height: 600px) {
  .rotate-notice {
    display: flex; position: fixed; inset: 0; z-index: 9999;
    align-items: center; justify-content: center; padding: 24px;
    background: var(--bg);
  }
  /* Hide the app behind the notice so landscape can't be interacted with. */
  .global-disclaimer, .screen { display: none !important; }
}


/* ---- WebXR VR entry (modal + in-app pill) ----------------------------- */
/* Pure progressive enhancement: these only appear when the VR module decides
   to show them; they never affect the normal desktop/mobile layout. */
.vr-modal-scrim {
  position: fixed; inset: 0; z-index: 10000;
  /* flex-start + the modal's margin:auto keeps short modals centered but lets a
     TALL modal (e.g. with VR Help expanded) align to the top and SCROLL — in a
     headset browser the viewport can be short, and a centered tall modal pushed
     its close button off-screen with no way to reach it. */
  display: flex; align-items: flex-start; justify-content: center; padding: 24px;
  overflow-y: auto;
  background: rgba(8, 10, 12, .72); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .2s ease;
}
.vr-modal-scrim.show { opacity: 1; }
.vr-modal {
  position: relative; width: 100%; max-width: 460px; margin: auto;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 30px 26px 26px; box-shadow: 0 24px 60px rgba(0,0,0,.5);
  text-align: center;
}
/* Cap the help block so it scrolls internally rather than ballooning the modal. */
.vr-modal-help { max-height: 46vh; overflow-y: auto; }
.vr-modal-close {
  position: absolute; top: 10px; right: 12px; width: 34px; height: 34px;
  border: 0; background: transparent; color: var(--muted); font-size: 1.5rem;
  line-height: 1; cursor: pointer; border-radius: 8px;
}
.vr-modal-close:hover { background: var(--bg-3); color: var(--text); }
.vr-modal-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 14px; margin-bottom: 12px;
  background: rgba(217,139,52,.12); color: var(--orange);
}
.vr-modal h2 { font-family: var(--font-head); font-size: 1.5rem; margin: 0 0 4px; }
.vr-modal-sub { color: var(--orange); font-weight: 600; margin: 0 0 12px; font-size: .98rem; }
.vr-modal-body { color: var(--text-2); font-size: .92rem; line-height: 1.55; margin: 0 auto 18px; max-width: 38ch; }
.vr-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.vr-modal-actions .btn { width: 100%; justify-content: center; }
.vr-modal-msg {
  background: var(--bg-3); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 10px 12px; color: var(--text-2); font-size: .86rem; line-height: 1.5; margin: 0 0 14px;
}
.vr-modal-help { text-align: left; margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.vr-modal-help ul { margin: 0; padding-left: 18px; }
.vr-modal-help li { color: var(--text-2); font-size: .85rem; line-height: 1.55; margin-bottom: 8px; }
.vr-modal-help strong { color: var(--text); }

/* In-app "Enter VR" pill, floating in the 3D Explorer corner. */
.vr-enter-pill {
  position: absolute; top: 12px; right: 12px; z-index: 12;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 22px; cursor: pointer;
  background: rgba(217,139,52,.92); color: #1a1206; border: 1px solid transparent;
  font-family: var(--font-body); font-weight: 600; font-size: .82rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.vr-enter-pill:hover { background: var(--orange); transform: translateY(-1px); }
.vr-enter-pill:disabled { opacity: .5; cursor: default; }
.panel-explorer { position: relative; }
/* No VR offer on phones (no headset path); keep the calm mobile layout. */
@media (max-width: 600px) { .vr-enter-pill { display: none; } }

/* ---- Print (report) --------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; }
  .global-disclaimer, .app-header, .life-slider, .tab-bar, .detail-panel, .toast,
  .panel-head .btn, .explorer-hint, .explorer-hint-mobile, .three-container { display: none !important; }
  .panel:not([data-panel="report"]) { display: none !important; }
  .panel[data-panel="report"] { display: block !important; }
  .report-wrap { background: #fff; border: none; color: #000; padding: 0; }
  .report h2 { color: #000; }
  .report-table th, .report-table td { border-color: #ccc; color: #000; }
  .report-table th { color: #333; }
  a { color: #000; text-decoration: underline; }
}

/* Trust badges are ACTIVE (restored 2026-06-01 once verified data + the
 * tier-based sourcing policy were in place). Confidence is now surfaced
 * everywhere per SOURCING_POLICY.md. (Previously a temporary block hid all
 * badges while the data was empty.) */
