  /* ============================================================
     YARDSCOUT — design system
     Light-first theme: soft off-white surfaces, one indigo accent,
     muted status colors, generous whitespace. Premium tool, not a
     game. All colors meet WCAG AA on their backgrounds.
     ============================================================ */
  :root {
    /* Paper & ink: warm off-white stock, near-black ink, hairline rules. */
    --bg: #efece4;
    --surface: #faf8f2;
    --surface2: #eae6da;
    --surface3: #e0dbcc;
    --border: #d8d2c2;
    --border-dark: #a89f8a;
    --text: #1b1913;
    --text-dim: #5f594a;
    /* One accent: safety orange, used sparingly and semantically. */
    --accent: #bf4a08;
    --accent-hover: #a03d06;
    --accent-soft: rgba(191, 74, 8, 0.08);
    --accent2: #3f6c33;
    --green-soft: rgba(63, 108, 51, 0.11);
    --red: #b03429;
    --red-soft: rgba(176, 52, 41, 0.09);
    /* Legacy aliases kept neutral so nothing renders purple/blue. */
    --blue: #5f594a;
    --blue-soft: rgba(95, 89, 74, 0.1);
    --purple: #5f594a;
    --purple-soft: rgba(95, 89, 74, 0.1);
    --cyan: #5f594a;
    --pink: #5f594a;
    --orange: #8a5a10;
    --gold: #8a5a10;
    --gold-soft: rgba(138, 90, 16, 0.12);
    --gold-glow: rgba(138, 90, 16, 0.06);
    --gold-border: rgba(138, 90, 16, 0.3);
    --demand-fast: #3f6c33;
    --demand-steady: #5f594a;
    --demand-slow: #8a5a10;
    /* Flat surfaces: borders carry structure, shadows only lift the sheets. */
    --shadow-sm: none;
    --shadow-md: 0 1px 0 rgba(27, 25, 19, 0.05);
    --shadow-lg: 0 -4px 28px rgba(27, 25, 19, 0.16);
    --radius: 4px;
    --radius-sm: 2px;
    --radius-lg: 8px;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    /* The data voice: every number, date, VIN, and tag reads like a spec sheet. */
    --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
    --nav-h: 58px;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums; /* digits align in stats, prices, counts */
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  }

  /* Inline SVG icon set: sized by font-size, colored by currentColor. */
  .ico {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.125em;
    flex-shrink: 0;
  }

  /* Real focus states for keyboard users; nothing for mouse clicks. */
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
  }
  :focus:not(:focus-visible) { outline: none; }

  /* ---------- Top bar ---------- */
  header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: calc(0.8rem + env(safe-area-inset-top)) 1.25rem 0.8rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
  .header-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
  }
  header h1 {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
  }
  /* Row-marker plate logo: the numbered sign at the end of every yard row.
   * Mounting screws are two radial gradients; letters are "stamped" with a
   * hairline top-shadow inset. */
  .row-plate {
    display: inline-grid;
    place-items: center;
    width: 34px; height: 30px;
    background: var(--text);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 0 rgba(250, 248, 242, 0.22);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
    background-image:
      radial-gradient(circle 1.6px at 5px 5px,  #6f695b 0 1.6px, transparent 1.7px),
      radial-gradient(circle 1.6px at 29px 25px, #6f695b 0 1.6px, transparent 1.7px);
    flex-shrink: 0;
  }
  .wordmark { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  /* Live spec line under the name — reads like the stamped fields on an
   * equipment data plate. Populated with real yard count + scan age. */
  .head-spec {
    font-family: var(--font-mono);
    font-size: 0.5625rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.26s ease, transform 0.26s ease;
  }
  /* Mid-swap state for the rotating data-plate facts: the old value slides
   * down and fades like a counter wheel turning, then the next one lands. */
  .head-spec.spec-swap { opacity: 0; transform: translateY(3px); }
  /* Caution-stripe rule under the header: thin, low-contrast, unmistakably
   * "yard" without shouting. */
  header::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 3px;
    background: repeating-linear-gradient(
      -45deg,
      rgba(191, 74, 8, 0.5) 0 7px,
      transparent 7px 14px
    );
    pointer-events: none;
  }

  .container { max-width: 1480px; margin: 0 auto; padding: 1rem 1.25rem; }

  /* ---------- Tabs: pills on desktop, bottom dock on mobile ---------- */
  .tabs {
    display: flex;
    gap: 0.3rem;
    margin-bottom: 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.3rem;
  }
  .tab {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
    position: relative;
  }
  .tab .tab-ico { display: inline-grid; place-items: center; line-height: 1; }
  .tab .tab-ico svg { display: block; }
  .tab:hover { color: var(--text); background: var(--surface2); }
  .tab.active {
    color: var(--surface);
    background: var(--text);
  }
  .tab-badge {
    background: var(--accent);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.08rem 0.38rem;
    border-radius: var(--radius-sm);
    line-height: 1.4;
  }
  @media (max-width: 720px) {
    .tabs {
      position: fixed;
      left: 0; right: 0; bottom: 0;
      z-index: 200;
      margin: 0;
      border-radius: 0;
      border: none;
      border-top: 1px solid var(--border-dark);
      background: var(--surface);
      padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
      height: auto;
    }
    .tab {
      flex-direction: column;
      gap: 0.15rem;
      padding: 0.35rem 0.25rem;
      font-size: 0.6875rem;
      font-weight: 600;
    }
    .tab .tab-ico svg { width: 20px; height: 20px; }
    .tab.active {
      background: transparent;
      color: var(--accent);
      box-shadow: none;
    }
    .tab-badge { position: absolute; top: 0; right: 18%; }
  }

  .tab-content { display: none; animation: fadeUp 0.25s ease; }
  .tab-content.active { display: block; }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ---------- First-run zip banner ---------- */
  .zip-banner {
    background: var(--surface);
    border: 1px solid var(--border-dark);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
  }
  .zip-banner-text { display: flex; flex-direction: column; gap: 0.2rem; }
  .zip-banner-text strong { font-size: 1rem; letter-spacing: -0.01em; }
  .zip-banner-text span { font-size: 0.8125rem; color: var(--text-dim); line-height: 1.5; }
  .zip-banner-coverage { font-size: 0.75rem !important; opacity: 0.85; margin-top: 0.15rem; }
  .zip-banner-coverage strong { color: var(--text); }
  .zip-banner-form { display: flex; gap: 0.5rem; }
  .zip-banner-form input {
    flex: 1;
    max-width: 180px;
    padding: 0.65rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font-ui);
    outline: none;
  }
  .zip-banner-form input:focus { border-color: var(--accent); }
  .gps-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    padding: 0.55rem 0.8rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.15s;
  }
  .gps-btn:hover { border-color: var(--accent); }
  .gps-btn:disabled { opacity: 0.6; cursor: wait; }
  .zip-banner-skip {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-family: var(--font-ui);
    padding: 0;
  }
  .zip-banner-skip:hover { color: var(--text); }

  /* ---------- Stat chips ---------- */
  .stats-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .stats-bar::-webkit-scrollbar { display: none; }
  .stat-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.85rem;
    min-width: 92px;
  }
  .stat-card .label {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-dim);
    white-space: nowrap;
  }
  .stat-card .value { font-family: var(--font-mono); font-size: 1rem; font-weight: 700; letter-spacing: 0; white-space: nowrap; line-height: 1.4; }
  .stat-card .value.value-sm { font-size: 0.8125rem; line-height: 1.72; }

  /* ---------- Toolbar (search + filter toggle) ---------- */
  .toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }
  .search-box {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    font-family: var(--font-ui);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .search-box::placeholder { color: var(--text-dim); }
  .search-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

  .filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s;
  }
  .filter-toggle:hover { border-color: var(--border-dark); }
  .filter-toggle.open { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
  .filter-count {
    background: var(--accent);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    display: inline-grid;
    place-items: center;
    font-family: var(--font-mono);
    border-radius: var(--radius-sm);
    padding: 0 4px;
  }

  /* ---------- Filter panel ---------- */
  .controls {
    display: none;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.8rem;
  }
  .controls.open { display: flex; }
  .filters-hint {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    background: var(--surface2);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.7rem;
  }
  .controls select:disabled,
  .controls input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  /* With the keyword box moved into the panel, the toolbar holds only the
   * Filters toggle — let it span full width as the panel's drawer handle. */
  .toolbar .filter-toggle { flex: 1; justify-content: center; }
  .ctl-group-title {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
  }
  .ctl-group-title::after {
    content: '';
    flex: 1;
    border-top: 1px dashed var(--border);
  }
  .ctl-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.5rem;
  }
  .controls .ctl {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  /* Wide control: spans the full grid row (capped) so long option labels
   * like "Recommended (value × freshness)" aren't truncated. */
  .controls .ctl-wide { grid-column: 1 / -1; max-width: 420px; }
  .controls .ctl label {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-dim);
    padding-left: 2px;
  }
  select, .controls input[type="text"], .controls input[type="number"], #live-zip {
    width: 100%;
    padding: 0.55rem 0.7rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.8125rem;
    font-family: var(--font-ui);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s;
  }
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235f594a' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 1.8rem;
  }
  select:focus, .controls input:focus, #live-zip:focus { border-color: var(--accent); }
  .controls .ctl-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.55rem;
    border-top: 1px dashed var(--border);
  }

  .btn {
    padding: 0.55rem 0.95rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
  }
  .btn:hover { background: var(--surface3); border-color: var(--border-dark); }
  .btn-primary {
    background: var(--text);
    border-color: var(--text);
    color: var(--surface);
  }
  .btn-primary:hover { background: #33301f; border-color: #33301f; }

  /* ---------- Vehicle cards ---------- */
  .car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 0.8rem;
  }
  @media (max-width: 480px) {
    .car-grid { grid-template-columns: 1fr; }
  }
  .car-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1rem 0.85rem;
    transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
    /* Off-screen cards skip layout/paint entirely — big scroll win with 400 cards */
    content-visibility: auto;
    contain-intrinsic-size: auto 190px;
  }
  @media (hover: hover) {
    .car-card:hover { border-color: var(--border-dark); }
  }
  .car-card.dim-card { opacity: 0.62; }
  .car-card.match-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--tier-color, var(--accent2));
  }
  .car-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .car-name {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
  }
  .car-years, .car-make { font-size: 0.75rem; color: var(--text-dim); font-weight: 600; margin-top: 0.1rem; }
  .live-card-location {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 500;
    margin-top: 0.25rem;
    line-height: 1.45;
  }
  /* Location line: quiet metadata, not a chip parade. */
  .live-card-location .ico { color: var(--text-dim); opacity: 0.7; }
  .loc-name { font-weight: 600; color: var(--text-dim); }
  .dist { font-weight: 600; color: var(--text-dim); }
  /* Stamped yard tag: bordered mono chip, like the tag wired to the car. */
  .live-card-row {
    display: inline-block;
    margin-left: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    padding: 0 0.3rem;
    background: var(--surface);
  }
  .car-meta { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-dim); margin-top: 0.3rem; line-height: 1.6; word-break: break-word; }
  .meta-note { color: var(--text-dim); opacity: 0.85; }
  .meta-note::before { content: '· '; }
  .meta-warn { color: var(--demand-slow); font-weight: 600; }
  .meta-warn::before { content: '· '; }
  .car-badges { display: flex; gap: 0.25rem; align-items: center; flex-shrink: 0; }
  .badge {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.45rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    letter-spacing: 0.07em;
  }
  .badge-new { background: var(--accent); color: #fff; }

  .profit-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.65rem;
  }
  /* Demand-first: how sellable the parts are leads; dollars are supporting info. */
  .demand-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.26rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
  }
  .demand-badge.demand-fast { background: var(--green-soft); color: var(--demand-fast); }
  .demand-badge.demand-steady { background: rgba(91, 98, 110, 0.1); color: var(--demand-steady); }
  .demand-badge.demand-slow { background: var(--gold-soft); color: var(--demand-slow); }
  .range-text { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); font-weight: 500; }
  /* Unconfirmed ("if equipped") upside: quieter than the confirmed range —
     visible, but clearly not promised dollars. */
  .range-extra {
    margin-top: 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-dim);
    opacity: 0.75;
  }
  .stat-card .value.accent { color: var(--accent); }

  /* parts inside <details> */
  .parts-details { margin-top: 0.55rem; border-top: 1px solid var(--border); }
  .parts-details summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    user-select: none;
  }
  .parts-details summary::-webkit-details-marker { display: none; }
  .parts-details summary .chev { margin-left: auto; transition: transform 0.2s; font-size: 0.75rem; }
  .parts-details[open] summary .chev { transform: rotate(180deg); }
  .parts-details summary:hover { color: var(--text); }

  .car-body { padding-top: 0.2rem; }
  .car-notes { font-size: 0.75rem; color: var(--text-dim); line-height: 1.5; margin-bottom: 0.5rem; }
  .parts-list { list-style: none; }
  .part-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
  }
  .part-item:last-child { border-bottom: none; }
  .part-name { flex: 1; min-width: 130px; font-weight: 600; line-height: 1.35; }
  .part-rarity {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.14rem 0.42rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }
  /* Rarity ladder: one warm accent for the top tier, neutrals below. */
  .rarity-legendary { background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold-border); }
  .rarity-epic { background: var(--accent-soft); color: var(--accent); }
  .rarity-rare { background: var(--surface3); color: var(--text); }
  .rarity-uncommon { background: var(--surface3); color: var(--text-dim); }
  .part-cost { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-dim); white-space: nowrap; }
  .part-price { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; color: var(--text); white-space: nowrap; }
  .part-profit { white-space: nowrap; }

  .sell-badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .sell-fast { background: var(--green-soft); color: var(--accent2); }
  .sell-medium { background: var(--surface3); color: var(--text-dim); }
  .sell-slow { background: var(--gold-soft); color: var(--demand-slow); }
  .sell-channel { font-size: 0.6875rem; color: var(--text-dim); }
  .sell-tip { font-size: 0.6875rem; color: var(--text-dim); font-style: italic; opacity: 0.85; }

  .mono-vin {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 0.6875rem;
    letter-spacing: 0.03em;
    word-break: break-all;
    color: var(--text);
  }
  /* Icon-only copy button: the title attribute carries the label. */
  .btn-copy-vin {
    font-size: 0.75rem;
    padding: 0.1rem 0.25rem;
    margin-left: 0.2rem;
    border: none;
    background: none;
    color: var(--text-dim);
    cursor: pointer;
    vertical-align: middle;
    line-height: 1;
  }
  .btn-copy-vin:hover { color: var(--accent); }
  .btn-copy-vin.copied { color: var(--accent2); }

  /* freq + category badges (database tab) */
  .freq-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }
  .freq-common { background: var(--surface3); color: var(--text-dim); }
  .freq-uncommon { background: var(--surface3); color: var(--text-dim); }
  .freq-rare { background: var(--gold-soft); color: var(--gold); }
  /* Body-style category is descriptive, not semantic — one neutral chip. */
  .cat-truck, .cat-suv, .cat-crossover, .cat-sedan, .cat-hatchback,
  .cat-van, .cat-sport, .cat-wagon { background: var(--surface3); color: var(--text-dim); }

  /* ---------- Tables ---------- */
  .value-table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: auto;
    max-height: 78vh;
    -webkit-overflow-scrolling: touch;
  }
  .value-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; min-width: 760px; }
  .value-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface2);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-dark);
    white-space: nowrap;
  }
  .value-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    line-height: 1.45;
  }
  .value-table tbody tr:hover td { background: var(--surface2); }
  .roi-badge {
    font-size: 0.6875rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }
  .roi-high { background: var(--green-soft); color: var(--accent2); }
  .roi-medium { background: var(--gold-soft); color: var(--gold); }
  .roi-low { background: var(--surface3); color: var(--text-dim); }

  .profit-note {
    padding: 0.65rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: var(--radius-sm);
    margin-bottom: 0.9rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.6;
  }
  .profit-note strong { color: var(--text); }
  .src-pnp { background: var(--green-soft); color: var(--accent2); padding: 1px 6px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.6875rem; }
  .src-tap { background: var(--blue-soft); color: var(--blue); padding: 1px 6px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.6875rem; }
  .src-utpap { background: rgba(184, 67, 127, 0.1); color: var(--pink); padding: 1px 6px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.6875rem; }
  .src-est { background: var(--gold-soft); color: var(--gold); padding: 1px 6px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.6875rem; }

  /* ---------- Alerts / watchlist ---------- */
  .info-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: 1rem;
  }
  .info-box h3 { font-size: 1rem; font-weight: 800; letter-spacing: -0.01em; }
  .info-box p { font-size: 0.8125rem; color: var(--text-dim); line-height: 1.55; }
  .info-box code { background: var(--surface3); padding: 0.1rem 0.35rem; border-radius: var(--radius-sm); font-size: 0.75rem; }

  .panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-top: 1rem;
  }
  .panel h4 { font-size: 0.875rem; font-weight: 800; margin-bottom: 0.75rem; }
  .panel label { font-family: var(--font-mono); font-size: 0.625rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-dim); display: block; margin-bottom: 0.25rem; }
  .panel input[type="text"], .panel input[type="number"] {
    padding: 0.55rem 0.7rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.8125rem;
    font-family: var(--font-ui);
    outline: none;
  }
  .panel input:focus { border-color: var(--accent); }

  .watchlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.5rem;
  }
  .wl-info { display: flex; flex-direction: column; gap: 0.12rem; }
  .wl-name { font-weight: 800; font-size: 0.875rem; letter-spacing: -0.01em; }
  .wl-detail { font-size: 0.75rem; color: var(--text-dim); }
  .wl-count { font-size: 0.75rem; font-weight: 700; }
  .wl-count.has-hits { color: var(--accent2); }
  .wl-count.no-hits { color: var(--text-dim); }
  .wl-remove {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-ui);
    transition: color 0.15s, border-color 0.15s;
  }
  .wl-remove:hover { color: var(--red); border-color: var(--red); }

  /* ---------- Empty state + footer ---------- */
  .empty-state {
    text-align: center;
    padding: 2.5rem 1.25rem;
    background: var(--surface);
    border: 1px dashed var(--border-dark);
    border-radius: var(--radius);
    color: var(--text-dim);
  }
  .empty-state h3 { color: var(--text); font-size: 1rem; margin-bottom: 0.4rem; }
  .empty-state p { font-size: 0.8125rem; line-height: 1.6; }
  .empty-state code { background: var(--surface3); padding: 0.15rem 0.4rem; border-radius: var(--radius-sm); font-size: 0.75rem; }

  .app-footer {
    margin-top: 2rem;
    padding: 1rem 0 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.6;
  }
  .app-footer strong { color: var(--text); }

  /* ===== Saved hearts + yard-visit sheet ===== */
  .heart-btn {
    background: none;
    border: none;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-dim);
    transition: color 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
  }
  .heart-btn:hover { color: var(--text); }
  .heart-btn.saved { color: var(--accent); }
  .heart-btn.saved .ico { fill: currentColor; }
  .heart-btn:active { transform: scale(1.15); }
  /* Floating pull-list counter: an ink block, like a stamped tally. */
  #saved-pill {
    position: fixed;
    right: 1rem;
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 150;
    background: var(--text);
    border: 1px solid var(--text);
    color: var(--surface);
    border-radius: var(--radius);
    padding: 0.6rem 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(27, 25, 19, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }
  #saved-pill .ico { fill: var(--accent); stroke: var(--accent); }
  #saved-pill span { color: var(--surface); }
  #saved-backdrop {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(15, 18, 25, 0.4);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
  }
  #saved-backdrop.open { opacity: 1; pointer-events: auto; }
  #saved-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 301;
    max-height: 78vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 0.5rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(105%);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
  }
  #saved-sheet.open { transform: translateY(0); }
  .sheet-handle {
    width: 42px; height: 5px; border-radius: 999px;
    background: var(--border-dark);
    margin: 0.4rem auto 0.75rem;
  }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; }
  .sheet-head h2 { font-size: 1.125rem; margin: 0; }
  .sheet-head button {
    background: none; border: none; color: var(--text-dim);
    font-size: 0.8125rem; cursor: pointer; text-decoration: underline;
  }
  .sheet-sub { font-size: 0.8125rem; color: var(--text-dim); margin: 0.3rem 0 0.9rem; line-height: 1.5; }
  .saved-yard-group { margin-bottom: 1.1rem; }
  .saved-yard-name {
    font-family: var(--font-mono);
    font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.09em;
    text-transform: uppercase; color: var(--text);
    padding-bottom: 0.35rem; margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
  }
  .saved-item {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.55rem 0.2rem;
    border-bottom: 1px solid var(--border);
  }
  .saved-row-badge {
    flex-shrink: 0;
    min-width: 3.1rem;
    text-align: center;
    background: var(--surface);
    border: 1.5px solid var(--text);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.4rem;
    font-family: var(--font-mono);
    font-weight: 700; font-size: 0.9375rem;
  }
  .saved-row-badge small { display: block; font-size: 0.6875rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
  .saved-item-info { flex: 1; min-width: 0; }
  .saved-item-name { font-weight: 700; font-size: 0.875rem; }
  .saved-item-sub { font-size: 0.75rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .saved-item-profit { font-family: var(--font-mono); font-weight: 700; color: var(--accent2); font-size: 0.8125rem; flex-shrink: 0; }
  .saved-remove {
    background: none; border: none; font-size: 0.875rem; cursor: pointer;
    color: var(--text-dim); padding: 0.25rem; flex-shrink: 0; line-height: 1;
  }
  .saved-remove:hover { color: var(--red); }
  .saved-empty { text-align: center; color: var(--text-dim); padding: 2rem 0; font-size: 0.875rem; }

  /* ===== Loading skeleton (first paint before the inventory JSON lands) ===== */
  .skeleton {
    background: linear-gradient(90deg, var(--surface2) 25%, #e4dfd1 37%, var(--surface2) 63%);
    background-size: 400% 100%;
    animation: skel-shimmer 1.4s ease infinite;
    border-radius: var(--radius-sm);
  }
  @keyframes skel-shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
  }
  .skel-chip {
    height: 3.7rem; /* matches loaded stat-card height — no layout shift on swap */
    flex: 1;
    min-width: 7rem;
    border: 1px solid var(--border);
  }
  .skel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }
  .skel-line { height: 0.85rem; }
  .skel-line.w30 { width: 30%; }
  .skel-line.w40 { width: 40%; }
  .skel-line.w60 { width: 60%; }
  .skel-line.w80 { width: 80%; }
  .skel-note {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8125rem;
    padding: 0.4rem 0 0.2rem;
  }
  @media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; }
  }

  .lot-clock {
    margin-top: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 600;
  }
  .lot-clock-soon { color: var(--orange); }
  .badge-soon {
    background: var(--gold-soft);
    color: var(--orange);
  }
  .share-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    transition: color 0.15s;
  }
  .share-btn:hover { color: var(--accent); }
  .focus-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--accent-soft);
    border: 1px solid rgba(191, 74, 8, 0.25);
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    font-size: 0.8125rem;
    color: var(--text);
  }

  .trim-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
  }
  .trim-badge.trim-vin {
    background: var(--green-soft);
    color: var(--accent2);
  }
  .trim-badge.trim-unknown {
    background: var(--surface3);
    color: var(--text-dim);
    font-weight: 600;
    font-style: italic;
  }

  /* Generation provenance ("fits 1996–2002") on part rows */
  .fits-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
    background: var(--surface3);
    color: var(--text-dim);
  }

  .ghost-note {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.55;
    background: var(--surface2);
    border-left: 3px solid var(--border-dark);
    border-radius: 0;
    padding: 0.5rem 0.7rem;
    margin: 0.35rem 0 0.6rem;
  }

  /* ===== Pro (fake door) ===== */
  /* Header Pro button styled as a punched inspection tag: string hole on the
   * left, clipped corner top-right. */
  .pro-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.35rem;
    padding: 0.22rem 0.65rem 0.22rem 0.5rem;
    background: var(--surface);
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    vertical-align: middle;
    clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
  }
  .pro-pill::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    border: 1px solid currentColor;
    flex-shrink: 0;
  }
  .pro-pill:hover { background: var(--accent); color: #fff; }
  .pro-pill.active { background: var(--accent); color: #fff; }
  .pro-tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.08rem 0.45rem;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    vertical-align: middle;
  }
  .lock-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.7rem;
    background: var(--accent-soft);
    border: 1px dashed rgba(191, 74, 8, 0.4);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
  }
  .lock-chip:hover { background: rgba(191, 74, 8, 0.16); }
  .locked-blur {
    filter: blur(4.5px);
    opacity: 0.75;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
  }
  #upgrade-backdrop {
    position: fixed; inset: 0; z-index: 320;
    background: rgba(15, 18, 25, 0.4);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
  }
  #upgrade-backdrop.open { opacity: 1; pointer-events: auto; }
  #upgrade-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 321;
    max-height: 88vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 0.5rem 1.15rem calc(1.4rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(105%);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
    max-width: 560px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
  }
  #upgrade-sheet.open { transform: translateY(0); }
  #upgrade-sheet .sheet-head h2 { font-size: 1.25rem; letter-spacing: -0.02em; }
  #upgrade-sheet .sheet-head button {
    background: none; border: none; color: var(--text-dim);
    font-size: 0.8125rem; cursor: pointer; text-decoration: underline;
    font-family: var(--font-ui);
  }
  .tier-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
  }
  .tier-card.tier-plus { border-color: var(--accent); background: var(--accent-soft); }
  .plan-option { cursor: pointer; transition: border-color 0.15s; }
  .plan-option:hover { border-color: var(--text-dim); }
  .plan-option.selected { border-color: var(--accent); background: var(--accent-soft); }
  .plan-option.selected .tier-name::after {
    content: '\2713 selected';
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-left: 0.5rem;
  }
  .pass-badge {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.1rem 0.35rem;
    margin-left: 0.4rem;
    vertical-align: middle;
  }
  .tier-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.4rem; }
  .tier-name { font-size: 0.875rem; font-weight: 800; letter-spacing: -0.01em; }
  .tier-price { font-family: var(--font-mono); font-size: 1rem; font-weight: 700; color: var(--accent); }
  .tier-price small { font-size: 0.75rem; font-weight: 600; color: var(--text-dim); }
  .tier-list { list-style: none; margin: 0; padding: 0; }
  .tier-list li {
    font-size: 0.8125rem;
    color: var(--text-dim);
    line-height: 1.5;
    padding: 0.18rem 0 0.18rem 1.15rem;
    position: relative;
  }
  .tier-list li::before {
    content: '\2713';
    position: absolute; left: 0;
    color: var(--accent2);
    font-weight: 800;
  }
  .tier-list li em { font-style: normal; opacity: 0.7; font-size: 0.75rem; }
  .waitlist-form {
    margin-top: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .waitlist-form strong { font-size: 0.875rem; letter-spacing: -0.01em; }
  .waitlist-row { display: flex; gap: 0.5rem; }
  .waitlist-row input {
    flex: 1;
    min-width: 0;
    padding: 0.62rem 0.85rem;
    background: var(--surface2);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.875rem;
    font-family: var(--font-ui);
    outline: none;
  }
  .waitlist-row input:focus { border-color: var(--accent); }
  .waitlist-note { font-size: 0.75rem; color: var(--text-dim); line-height: 1.5; }
  .waitlist-thanks {
    margin-top: 0.9rem;
    background: var(--green-soft);
    border: 1px solid rgba(15, 138, 90, 0.25);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .waitlist-thanks strong { font-size: 0.875rem; }
  .waitlist-thanks span { font-size: 0.8125rem; color: var(--text-dim); line-height: 1.5; }

  /* ===== Yards directory ===== */
  .yards-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin: -0.15rem 0 0.75rem;
    line-height: 1.5;
  }
  .yard-card { cursor: pointer; }
  .yard-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .yard-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
  }
  .yard-actions .btn { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
  .yard-price-link {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-dim);
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .yard-price-link:hover { color: var(--accent); }
  .yard-price-none {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-dim);
    opacity: 0.75;
  }

  /* ===== Doc pages (privacy / terms) ===== */
  .doc-page { max-width: 720px; padding-bottom: 3rem; }
  .doc-page h2 {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1.75rem 0 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
  }
  .doc-page p { font-size: 0.875rem; line-height: 1.65; margin: 0.5rem 0; color: var(--text); }
  .doc-page a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
  .doc-updated {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1rem 0 1.25rem !important;
  }
  .doc-back { margin-top: 2rem !important; }

  /* ===== Stale-data banner ===== */
  #stale-banner {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
  }
  #stale-banner.severe {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: var(--accent);
    font-weight: 700;
    font-size: 0.8125rem;
  }

  /* ===== iOS install hint ===== */
  #install-hint {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 0.75rem);
    z-index: 60;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--text);
    color: var(--bg);
    border: 1px solid var(--text);
    padding: 0.75rem 0.9rem;
    max-width: 480px;
    margin: 0 auto;
  }
  .install-hint-text { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.8125rem; line-height: 1.5; }
  .install-hint-text .ico { vertical-align: -3px; }
  #install-hint-close {
    background: none;
    border: none;
    color: var(--bg);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.1rem 0.25rem;
    flex-shrink: 0;
  }
  @media (min-width: 768px) {
    #install-hint { bottom: 1rem; }
  }

  /* ===== Feedback + footer links ===== */
  .feedback-link {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-dim);
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .feedback-link:hover { color: var(--accent); }
  .parts-details .feedback-link { display: inline-block; margin-top: 0.6rem; }
  .footer-links a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 2px; }
  .footer-links a:hover { color: var(--accent); }

  /* ===== Car photos (hotlinked from chain CDNs) ===== */
  .car-photo-wrap {
    margin: -1rem -1rem 0.75rem;
    border-radius: var(--radius) var(--radius) 0 0;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
    aspect-ratio: 3 / 2;
    overflow: hidden;
  }
  .car-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .car-specs { margin-top: 0.15rem; }

  /* Photo source attribution (same-chain hotlinked photos only) */
  .car-photo-wrap { position: relative; }
  .photo-credit {
    position: absolute;
    right: 0;
    bottom: 0;
    font-family: var(--mono, ui-monospace, monospace);
    font-size: 0.58rem;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(20, 18, 14, 0.55);
    padding: 0.1rem 0.4rem;
  }

  /* Manual-transmission tag — confirmed from VIN decode only, never inferred */
  .badge-manual {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border-strong, var(--border));
    font-family: var(--mono, ui-monospace, monospace);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
