/* TRUE COST Pro — components.css  (Dark Premium Automotive)
   No colour literals — var() only.
*/

/* ── Bottom Navigation ── */
#bottom-nav {
  background: rgba(11,18,32,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.40);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-nav-inactive);
  padding: var(--space-2) 0;
  transition: color var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.nav-btn.active {
  color: var(--color-nav-active);
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn.active::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-nav-active);
  margin-top: 2px;
}

/* ── Cards ── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}
.card-title {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}
.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

/* ── Premium Vehicle Card (Database + My Vehicles) ── */
.vehicle-card-pro {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s cubic-bezier(0.4,0,0.2,1), box-shadow 0.2s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
  position: relative;
}
.vehicle-card-pro:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-border-strong);
}
.vehicle-card-pro:active {
  transform: translateY(-1px);
}

.vehicle-card-img {
  position: relative;
  height: 200px;
  background: var(--color-surface-2);
  overflow: hidden;
}
.vehicle-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
  transition: transform 0.4s ease;
}
.vehicle-card-pro:hover .vehicle-card-img img {
  transform: scale(1.03);
}
.vehicle-card-img-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11,18,32,0.92) 0%, rgba(11,18,32,0.25) 50%, transparent 100%);
  pointer-events: none;
}
.vehicle-card-img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 4rem;
  background: linear-gradient(135deg, var(--color-surface-2) 0%, var(--color-surface-3) 100%);
}

/* Badges on top of image */
.vehicle-card-fuel-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}
.vehicle-card-rank-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: var(--color-accent);
  color: #0B1220;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

/* Card body */
.vehicle-card-body {
  padding: 14px 16px 16px;
}
.vehicle-card-make {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: 2px;
}
.vehicle-card-model {
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vehicle-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.vehicle-stat {
  background: var(--color-surface-2);
  border-radius: 8px;
  padding: 9px 11px;
  border: 1px solid var(--color-border);
}
.vehicle-stat-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}
.vehicle-stat-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.vehicle-card-actions {
  display: flex;
  gap: 8px;
}

/* Top-3 larger card variant */
.vehicle-card-pro.top3-card .vehicle-card-img {
  height: 220px;
}

/* ── Legacy vehicle-card (My Vehicles list) ── */
.vehicle-card {
  border-left: 3px solid var(--color-primary);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.vehicle-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.vehicle-cost-total {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.vehicle-cost-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
  text-align: center;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px var(--space-5);
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-accent {
  background: var(--color-accent);
  color: #0B1220;
  font-weight: 700;
  box-shadow: var(--shadow-gold);
}
.btn-accent:hover { background: var(--color-accent-hover); }

.btn-secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}
.btn-secondary:hover { background: var(--color-surface-3); }

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
}
.btn-ghost:hover { background: var(--color-primary-light); }

/* Add vehicle button */
.btn-add {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: var(--font-size-sm);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  box-shadow: var(--shadow-blue);
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn-add:active { transform: scale(0.96); }

.btn-pill { border-radius: var(--radius-pill); }
.btn-sm   { padding: 6px var(--space-3); font-size: var(--font-size-xs); }
.btn-full { width: 100%; }

/* Icon-only button */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.btn-icon:hover  { background: var(--color-surface-2); }
.btn-icon:active { transform: scale(0.90); }

/* ── Form inputs ── */
.label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}
.input, .select, .textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  -webkit-appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--color-text-subtle); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--color-border-focus);
  background: var(--color-surface-3);
}
.input-prefix { position: relative; }
.input-prefix .input { padding-left: var(--space-8); }
.input-prefix .prefix-label {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  font-size: var(--font-size-sm);
}
.select-wrapper { position: relative; }
.select-wrapper::after {
  content: "▾";
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--color-text-muted);
  pointer-events: none;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--space-3);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.badge-ev      { background: rgba(59,130,246,0.18);  color: #60A5FA; }
.badge-petrol  { background: rgba(249,115,22,0.18);  color: #FB923C; }
.badge-diesel  { background: rgba(139,115,85,0.18);  color: #A8956B; }
.badge-hybrid  { background: rgba(16,185,129,0.18);  color: #34D399; }
.badge-success { background: rgba(16,185,129,0.12);  color: var(--color-success); }
.badge-warning { background: rgba(245,158,11,0.12);  color: var(--color-accent); }
.badge-phev    { background: rgba(6,182,212,0.18);   color: #22D3EE; }
/* Fuel type nobody has stated. Deliberately grey rather than borrowing the petrol
   badge, which is how "unknown" used to read as "Petrol" all over the app. */
.badge-unknown { background: rgba(148,163,184,0.16); color: var(--color-text-muted); }

/* ── Cost summary chips ── */
.cost-chip {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  text-align: center;
}
.cost-chip-value {
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.5px;
}
.cost-chip-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--space-1);
}

/* ── Page header ── */
.page-title {
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.15;
  letter-spacing: -0.3px;
}
.page-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-top: 3px;
}

/* ── Cost breakdown row ── */
.cost-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}
.cost-value {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}
.cost-row-total .cost-label,
.cost-row-total .cost-value {
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  font-size: var(--font-size-base);
}

/* ── Cost bar (horizontal) ── */
.cost-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-4) 0;
}
.cost-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.cost-bar-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  width: 80px;
  flex-shrink: 0;
}
.cost-bar-track {
  flex: 1;
  height: 7px;
  background: var(--color-surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.cost-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
.cost-bar-pct {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Step indicator ── */
.steps {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border-strong);
  transition: background var(--transition-normal);
}
.step-dot.active { background: var(--color-primary); }
.step-dot.done   { background: var(--color-success); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-6) var(--space-8);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}
.empty-state-title {
  font-size: var(--font-size-lg);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.empty-state-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

/* ── Loading spinner ── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-surface-2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-total) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--space-8));
  max-width: calc(var(--max-width) - var(--space-8));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.toast {
  background: var(--color-surface-3);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}
.toast.success { background: rgba(16,185,129,0.15); border-color: rgba(16,185,129,0.30); color: #34D399; }
.toast.error   { background: rgba(239,68,68,0.15);  border-color: rgba(239,68,68,0.30);  color: #F87171; }
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Rates panel ── */
.rates-grid { display: flex; flex-direction: column; gap: var(--space-2); }
.rate-row { display: grid; grid-template-columns: 1fr 90px 32px; align-items: center; gap: var(--space-2); }
.rate-row label { font-size: var(--font-size-sm); color: var(--color-text-secondary); }
.rate-row input[type=number] {
  font-size: var(--font-size-sm); padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text);
  width: 100%; text-align: right;
}
.rate-row input[type=number].editing { border-color: var(--color-accent); }
.rate-row input[type=number].saved   { border-color: var(--color-success); }
.btn-rate-reset {
  background: none; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 4px 6px;
  font-size: 14px; cursor: pointer; color: var(--color-text-muted); line-height: 1;
}
.btn-rate-reset:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ── Info tip button (ⓘ) ── */
.btn-info-tip {
  background: none; border: none; padding: 2px 4px;
  font-size: 15px; line-height: 1; cursor: pointer;
  color: var(--color-text-muted); opacity: 0.7;
  transition: opacity var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}
.btn-info-tip:hover { opacity: 1; color: var(--color-primary); }

/* ── Info modal (rates source explanation) ── */
#tc-info-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 9001;
  display: flex; align-items: flex-end; justify-content: center;
  animation: tcFadeIn 0.15s ease;
}
#tc-info-modal .tc-info-sheet {
  background: var(--color-surface);
  border-radius: 20px 20px 0 0;
  padding: 24px 24px 40px;
  width: 100%; max-width: 480px;
  animation: tcSlideUp 0.25s cubic-bezier(0.32,0.72,0,1);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.20);
}
#tc-info-modal .tc-info-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--color-border-strong);
  margin: 0 auto 18px;
}
#tc-info-modal .tc-info-title {
  font-size: 1rem; font-weight: 600;
  color: var(--color-text); margin-bottom: 12px;
}
#tc-info-modal .tc-info-body {
  font-size: var(--font-size-sm); color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}
#tc-info-modal .tc-info-body a {
  color: var(--color-primary); text-decoration: none;
}
#tc-info-modal .tc-info-close {
  display: block; width: 100%; margin-top: 20px; padding: 13px;
  background: var(--color-bg-input); border: none;
  border-radius: var(--radius-md); font-size: 1rem;
  color: var(--color-text); cursor: pointer;
}

/* ── Vehicle preset search (in forms) ── */
.preset-search-wrap { margin-bottom: var(--space-5); border-bottom: 1px solid var(--color-border); padding-bottom: var(--space-5); }
.preset-hint { font-weight: 400; color: var(--color-text-muted); font-size: var(--font-size-xs); }
.preset-search-box { position: relative; }
.preset-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  z-index: 100; background: var(--color-surface-3);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); list-style: none; margin: 0;
  padding: var(--space-1) 0; max-height: 280px; overflow-y: auto;
}
.preset-dropdown.open { display: block; }
.preset-item { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); cursor: pointer; transition: background 0.1s; }
.preset-item:hover { background: var(--color-surface-2); }
.preset-name { font-size: var(--font-size-sm); font-weight: 600; color: var(--color-text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset-variant { font-size: var(--font-size-xs); color: var(--color-text-muted); flex: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset-fuel { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 99px; flex-shrink: 0; }
.preset-fuel--petrol   { background: rgba(249,115,22,0.15);  color: #FB923C; }
.preset-fuel--diesel   { background: rgba(139,115,85,0.15);  color: #C4A882; }
.preset-fuel--hybrid   { background: rgba(16,185,129,0.15);  color: #34D399; }
.preset-fuel--phev     { background: rgba(6,182,212,0.15);   color: #22D3EE; }
.preset-fuel--electric { background: rgba(59,130,246,0.15);  color: #60A5FA; }
.preset-fuel--lpg      { background: rgba(239,68,68,0.12);   color: #F87171; }

/* ── Vehicle detail breakdown rows ── */
.detail-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}
.detail-row:last-child { border-bottom: none; }

/* ── Feedback tab ── */
.feedback-type-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.feedback-type-btn {
  padding: var(--space-2) var(--space-2);
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  color: var(--color-text-secondary);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}
.feedback-type-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: var(--font-weight-semibold);
}

/* ── Partner CTA card (detail view) ── */
.partner-cta-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--color-surface-2);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-card);
  margin-top: var(--space-4);
  text-decoration: none;
}
.partner-cta-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  line-height: 1;
}
.partner-cta-text {
  flex: 1;
  min-width: 0;
}
.partner-cta-text strong {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}
.partner-cta-text span {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}
.partner-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: var(--color-accent);
  color: #0B1220;
  font-size: var(--font-size-sm);
  font-weight: 800;
  border-radius: var(--radius-pill);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-gold);
  transition: background var(--transition-fast);
}
.partner-cta-btn:hover { background: var(--color-accent-hover); }

/* ── Partner banner (database top) ── */
.partner-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
.partner-banner a {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.partner-banner a:hover { text-decoration: underline; }

/* ── DB hero search section ── */
.db-hero {
  padding: 6px 0 20px;
}
.db-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.2;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}
.db-hero-sub {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

/* ── DB stats row (pill badges) ── */
.db-stats-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}
.db-stats-row::-webkit-scrollbar { display: none; }
.db-stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  flex-shrink: 0;
}
.db-stat-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}
.db-stat-lbl {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

/* ── Empty state: one instruction, not a menu ── */
.empty-flow { text-align: center; padding: var(--space-6) var(--space-4); }
.empty-flow-icon { font-size: 44px; line-height: 1; margin-bottom: var(--space-3); }
.empty-flow-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 var(--space-2); }
.empty-flow-desc {
  font-size: var(--font-size-sm); color: var(--color-text-secondary);
  line-height: 1.55; margin: 0 auto var(--space-5); max-width: 32ch;
}
.empty-flow-hint {
  font-size: var(--font-size-xs); color: var(--color-text-muted);
  line-height: 1.5; margin: var(--space-4) auto var(--space-3); max-width: 34ch;
}

/* ── Saved-listing expiry countdown ── */
.expiry-badge {
  display: inline-block; margin-left: 6px; padding: 2px 7px;
  border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap;
  background: var(--color-surface-2, rgba(255,255,255,0.07));
  color: var(--color-text-muted);
}
.expiry-badge.is-soon { background: rgba(245,197,66,0.16); color: #F5C542; }
.expiry-badge.is-pinned { background: rgba(79,125,243,0.16); color: #7DA2F7; }

/* ── Gross vs after-tax toggle ── */
.tax-toggle {
  display: inline-flex; margin-top: 12px; padding: 3px; gap: 3px;
  border-radius: 999px; background: var(--color-surface-2, rgba(255,255,255,0.06));
}
.tax-toggle-btn {
  border: none; cursor: pointer; padding: 6px 16px; min-height: 34px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  background: transparent; color: var(--color-text-muted);
}
.tax-toggle-btn.active { background: var(--color-accent, #4F7DF3); color: #fff; }

/* ── Minimum tap targets ──
   Steven uses this on a phone almost exclusively, and several controls were coming
   out at 19–36px — too small to hit reliably. 44px is the accepted floor for a
   finger; these rules set it without changing how anything looks, by padding the
   hit area rather than growing the visual box. The mobile matrix asserts it. */
.btn, .btn-sm, .btn-icon, .nav-btn, button.rate-info, .rate-row button {
  min-height: 44px;
}
.btn-sm { padding-top: 8px; padding-bottom: 8px; }

/* Small icon buttons keep their size but gain a transparent hit area */
.rate-row button,
button[title]:not(.btn):not(.nav-btn) {
  min-width: 44px;
  min-height: 44px;
}

/* ── Stale-install hint ──
   Only ever shown to someone running the installed app who has never had a share
   land — i.e. exactly the people whose WebAPK predates the manifest fix. */
.stale-hint {
  display: block; text-align: left;
  background: rgba(245,197,66,0.10);
  border: 1px solid rgba(245,197,66,0.35);
  border-radius: var(--radius-md, 12px);
  padding: var(--space-4, 14px);
  margin-bottom: var(--space-5, 18px);
  font-size: var(--font-size-sm, 14px); line-height: 1.5;
}
.stale-hint strong { display: block; margin-bottom: 4px; color: #F5C542; }
.stale-hint span { display: block; color: var(--color-text-secondary); margin-bottom: 8px; }

/* ─────────────────────────────────────────────────────────────
   Preview mode — the worked example a first-time visitor sees
   Colours are token references only; see theme.css.
   ───────────────────────────────────────────────────────────── */

.preview-hero {
  background: linear-gradient(160deg, var(--color-hero-bg2) 0%, var(--color-surface) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 14px);
  padding: 20px 18px 22px;
  margin-bottom: var(--space-4, 16px);
}

.preview-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: var(--font-size-xs, 11px);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}

.preview-title {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin: 0 0 8px;
}

.preview-sub {
  font-size: var(--font-size-sm, 13px);
  line-height: 1.55;
  color: var(--color-text-secondary);
  margin: 0;
}

.preview-sub strong { color: var(--color-text); font-weight: 700; }

/* "Sample" chip in place of the delete button on an example car */
.badge-sample {
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: var(--font-size-xs, 11px);
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

/* The referral link back to the listing */
.listing-link {
  font-size: var(--font-size-xs, 11px);
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  padding: 6px 0;           /* taller tap target without moving the layout */
}
.listing-link:hover { text-decoration: underline; }

/* Three ways in, under the worked example */
.start-own {
  margin-top: var(--space-4, 16px);
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 14px);
  background: var(--color-surface);
}

.start-own-title {
  font-size: var(--font-size-md, 15px);
  font-weight: 800;
  color: var(--color-text);
  margin: 0 0 14px;
}

.start-own-grid { display: grid; gap: 10px; }

.start-own-option {
  display: block;
  width: 100%;
  min-height: 44px;                 /* tap target */
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 12px);
  background: var(--color-surface-2);
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
.start-own-option:hover { border-color: var(--color-border-strong); }

.start-own-icon { font-size: 18px; margin-right: 8px; }
.start-own-label { font-weight: 700; font-size: var(--font-size-sm, 13px); }
.start-own-hint {
  display: block;
  margin-top: 3px;
  font-size: var(--font-size-xs, 11px);
  color: var(--color-text-muted);
}

@media (min-width: 560px) {
  .start-own-grid { grid-template-columns: repeat(3, 1fr); }
  .preview-title { font-size: 1.6rem; }
}

/* Why a queued car is short of a price — "carsales asked for a human check" is
   something the user can act on; a blank field on its own is not. */
.queue-why {
  display: block;
  width: 100%;
  font-size: var(--font-size-xs, 11px);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Vehicle database search results.

   Each result is a <button> so it is reachable by keyboard, and a button does not
   inherit the page text colour — the card titles rendered near-black on the dark
   surface, legible only if you already knew what they said. */
.db-hit {
  color: var(--color-text);
  font: inherit;
  background: var(--color-surface-2);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.db-hit:hover { background: var(--color-surface-3); border-color: var(--color-primary); }
.db-hit:active { transform: scale(0.995); }

/* The versions behind a result: one row per engine/transmission/drivetrain, which is
   the level the cost calculation actually distinguishes. */
.db-row + .db-row { border-top: 1px solid var(--color-border); }
.db-row:hover { background: var(--color-surface-3); }

/* Provenance line above a cost breakdown: where the number came from, and how much
   to trust it. The weak variant is used when the model fell all the way to its global
   curve, which measured 58.6% median error — the app says so rather than printing a
   confident-looking figure it has not earned. */
.tcd-caveat {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
}
.tcd-caveat-weak {
  color: var(--color-accent);
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid var(--color-accent);
}

/* ── "Fuel type not set" nudge ──
   Sits above the cost rows on the detail view. Quiet on purpose: it is a prompt, not
   an error — the figure below it is still usable, just assumed. */
.fuel-nudge { margin-bottom: 0.65rem; }
.fuel-nudge-line {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--color-text-muted);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}
.fuel-nudge-cta { color: var(--color-accent); font-weight: 700; white-space: nowrap; }
.fuel-nudge-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
/* display:flex outranks the UA's [hidden]{display:none}, which left the picker
   permanently open. The attribute is the state, so it has to win here. */
.fuel-nudge-picker[hidden] { display: none; }
.fuel-nudge-chip {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}
.fuel-nudge-chip:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* ── Legal footer ──
   Lives at the end of #page-content, so it scrolls under whichever page is open
   rather than competing with the fixed nav for space. */
.app-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}
.app-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
  /* 44px tap target without pushing the row taller than the text line. */
  padding: var(--space-2) var(--space-1);
}
.app-footer a:hover,
.app-footer a:focus-visible { color: var(--color-text); text-decoration: underline; }

/* ── First-visit storage notice ── */
.storage-notice {
  position: fixed;
  bottom: calc(var(--nav-total) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--space-8));
  max-width: calc(var(--max-width) - var(--space-8));
  /* Under .toast-container (1000) so a toast is never obscured by it. */
  z-index: 999;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-surface-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.storage-notice p {
  margin: 0;
  flex: 1;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
}
.storage-notice a { color: var(--color-primary); }
.storage-notice button {
  flex-shrink: 0;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
}
.storage-notice button:hover { background: var(--color-surface-2); }
