/* ── VIN Lookup Pro — Professional UI ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Core palette */
  --bg:          #090e1a;
  --bg2:         #111827;
  --bg3:         #1a2235;
  --bg4:         #1f2d44;
  --border:      rgba(255,255,255,0.08);
  --border2:     rgba(255,255,255,0.12);

  /* Brand */
  --blue:        #2563eb;
  --blue-light:  #3b82f6;
  --blue-glow:   rgba(37,99,235,0.20);
  --blue-subtle: rgba(37,99,235,0.10);

  /* Semantic */
  --success:     #10b981;
  --success-bg:  rgba(16,185,129,0.10);
  --warning:     #f59e0b;
  --warning-bg:  rgba(245,158,11,0.10);
  --danger:      #ef4444;
  --danger-bg:   rgba(239,68,68,0.10);

  /* Typography */
  --text:        #f8fafc;
  --text-2:      #cbd5e1;
  --text-3:      #94a3b8;
  --text-4:      #64748b;

  /* Services */
  --carfax:      #cc0000;
  --autocheck:   #1a56db;
  --manheim:     #e07b00;

  /* Misc */
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   16px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.4);
  --shadow:      0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.5);
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono:        'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════
   HEADER
═══════════════════════════════════════ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9,14,26,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
}
.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.logo-icon {
  width: 32px; height: 32px;
  background: #152d6e;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { color: #fff; }
.logo-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo-name span {
  font-weight: 400;
  color: var(--text-3);
}
.header-actions { display: flex; align-items: center; gap: 6px; }

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  cursor: pointer;
  padding: 7px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s, border-color .15s;
  line-height: 1;
}
.icon-btn:hover {
  color: var(--text);
  background: var(--bg3);
  border-color: var(--border2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  height: 42px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }

.btn-ghost {
  background: var(--bg3);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg4); color: var(--text); border-color: var(--border2); }

.btn-outline {
  background: transparent;
  color: var(--blue-light);
  border: 1px solid rgba(59,130,246,0.35);
  font-size: 0.8125rem;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
}
.btn-outline:hover { background: var(--blue-subtle); border-color: var(--blue-light); }

.full-width { width: 100%; }

.text-btn {
  background: none;
  border: none;
  color: var(--text-4);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color .15s;
}
.text-btn:hover { color: var(--danger); }

/* ═══════════════════════════════════════
   LAYOUT
═══════════════════════════════════════ */
.main-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px calc(var(--safe-bottom) + 40px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-4);
  margin-bottom: 14px;
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* ═══════════════════════════════════════
   INPUT CARD
═══════════════════════════════════════ */
.input-card {
  padding: 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
}
.input-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-4);
  margin-bottom: 10px;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
  overflow: hidden;
}
.input-wrap:focus-within {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--text);
  text-transform: uppercase;
  outline: none;
  width: 100%;
  min-width: 0;
  -webkit-appearance: none;
}
.input-wrap input::placeholder {
  font-family: var(--font);
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-4);
  font-weight: 400;
  font-size: 0.9375rem;
}
.vin-counter {
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-4);
  white-space: nowrap;
  flex-shrink: 0;
  pointer-events: none;
  transition: color .2s;
}
.vin-counter.complete { color: var(--success); }

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.error-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--danger-bg);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* ═══════════════════════════════════════
   SCANNER
═══════════════════════════════════════ */
.scanner-card { padding: 16px; }
.scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.scanner-header span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-3);
}
.scanner-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.scanner-viewport video { width: 100%; height: 100%; object-fit: cover; }
.scan-overlay {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
}
.scan-frame {
  position: relative;
  width: 75%; height: 28%;
  min-height: 56px;
}
.corner {
  position: absolute;
  width: 18px; height: 18px;
  border-color: #fff;
  border-style: solid;
  opacity: 0.9;
}
.corner.tl { top:0; left:0; border-width:2px 0 0 2px; border-radius:2px 0 0 0; }
.corner.tr { top:0; right:0; border-width:2px 2px 0 0; border-radius:0 2px 0 0; }
.corner.bl { bottom:0; left:0; border-width:0 0 2px 2px; border-radius:0 0 0 2px; }
.corner.br { bottom:0; right:0; border-width:0 2px 2px 0; border-radius:0 0 2px 0; }
.scan-line {
  position: absolute;
  left: 0; right: 0; height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--blue-light), transparent);
  box-shadow: 0 0 8px var(--blue-light);
  animation: scanMove 2s ease-in-out infinite;
}
@keyframes scanMove { 0%,100%{top:0} 50%{top:calc(100% - 1.5px)} }
.scanner-tip {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-4);
  text-align: center;
}
.ocr-status {
  margin-top: 8px;
  padding: 6px 12px;
  background: rgba(37,99,235,0.15);
  border: 1px solid rgba(37,99,235,0.3);
  border-radius: 6px;
  font-size: 0.78rem;
  color: var(--blue-light);
  text-align: center;
  font-family: var(--mono);
}
.ocr-status.found {
  background: rgba(16,185,129,0.15);
  border-color: rgba(16,185,129,0.3);
  color: #34d399;
}
.scan-frame.ocr-mode {
  width: 90%;
  height: 20%;
}

/* ═══════════════════════════════════════
   LOADING
═══════════════════════════════════════ */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 20px;
  color: var(--text-3);
}
.loading-state p { font-size: 0.875rem; font-weight: 500; }
.spinner {
  width: 32px; height: 32px;
  border: 2.5px solid var(--bg4);
  border-top-color: var(--blue-light);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════
   SUMMARY CARD
═══════════════════════════════════════ */
.summary-card {
  background: linear-gradient(135deg, #0f2147 0%, #111827 55%);
  border-color: rgba(37,99,235,0.25);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.summary-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(37,99,235,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.summary-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--blue-light);
  margin-bottom: 10px;
  opacity: 0.9;
}
.summary-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.summary-icon {
  font-size: 2.25rem;
  line-height: 1;
  flex-shrink: 0;
}
.summary-text h2 {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #fff;
}
.summary-text p {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-top: 3px;
}
.vin-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 7px 14px;
}
.vin-mono {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: .14em;
  color: var(--text-2);
}
.copy-btn {
  background: none;
  border: none;
  color: var(--text-4);
  cursor: pointer;
  padding: 2px;
  display: flex;
  transition: color .15s;
  line-height: 1;
}
.copy-btn:hover { color: var(--blue-light); }

/* ═══════════════════════════════════════
   TAB NAV
═══════════════════════════════════════ */
.tab-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}
.tab-btn {
  padding: 8px 4px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-4);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  letter-spacing: -0.01em;
}
.tab-btn:hover:not(.active) { color: var(--text-2); }
.tab-btn.active {
  background: var(--bg4);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════
   TAB PANELS
═══════════════════════════════════════ */
.tab-panel { display: flex; flex-direction: column; gap: 12px; }
.tab-panel.hidden { display: none; }

/* ═══════════════════════════════════════
   INFO GRID
═══════════════════════════════════════ */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.info-item {
  background: var(--bg2);
  padding: 11px 14px;
  transition: background .15s;
}
.info-item:hover { background: var(--bg3); }
.info-item.full-width { grid-column: 1 / -1; }
.info-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-4);
  margin-bottom: 3px;
}
.info-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.35;
}
.info-value.highlight { color: var(--blue-light); font-weight: 600; }
.info-value.empty { color: var(--text-4); font-style: italic; font-weight: 400; }

/* ═══════════════════════════════════════
   RECALLS / COMPLAINTS
═══════════════════════════════════════ */
.recalls-list { display: flex; flex-direction: column; gap: 8px; }
.recall-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border-left-width: 3px;
}
.recall-item.danger { border-left-color: var(--danger); }
.recall-item.warning { border-left-color: var(--warning); }
.recall-number {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-4);
  margin-bottom: 5px;
}
.recall-desc { font-size: 0.8125rem; color: var(--text-2); line-height: 1.45; }
.recall-date { font-size: 0.75rem; color: var(--text-4); margin-top: 5px; }
.no-recalls {
  text-align: center;
  padding: 28px;
  color: var(--success);
  font-size: 0.875rem;
  font-weight: 500;
}
.no-recalls svg { display: block; margin: 0 auto 10px; opacity: 0.8; }

/* ═══════════════════════════════════════
   API INTEGRATION CARDS
═══════════════════════════════════════ */
.api-integration-card { padding: 20px; }
.api-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.api-logo {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: .06em;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
}
.api-logo.small { font-size: 0.65rem; padding: 3px 8px; }
.carfax-logo   { background: var(--carfax);   color: #fff; }
.autocheck-logo{ background: var(--autocheck); color: #fff; }
.manheim-logo  { background: var(--manheim);  color: #fff; }

.api-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  letter-spacing: .04em;
}
.badge-unconfigured { background: rgba(100,116,139,0.15); color: var(--text-4); }
.badge-configured   { background: var(--success-bg); color: var(--success); }
.badge-error        { background: var(--danger-bg); color: var(--danger); }

.api-desc {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-bottom: 14px;
  line-height: 1.55;
}

.api-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 20px;
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(255,255,255,0.08);
}
.api-placeholder p {
  font-size: 0.8125rem;
  color: var(--text-3);
  max-width: 260px;
  line-height: 1.55;
}

/* ═══════════════════════════════════════
   VALUE TAB
═══════════════════════════════════════ */
.small-note {
  font-size: 0.75rem;
  color: var(--text-4);
  margin-top: 12px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════
   HISTORY
═══════════════════════════════════════ */
.history-list { display: flex; flex-direction: column; gap: 6px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.history-item:hover { border-color: var(--border2); background: var(--bg3); }
.history-vin {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--text-2);
  flex: 1;
}
.history-vehicle { font-size: 0.75rem; color: var(--text-3); margin-top: 1px; }
.history-date { font-size: 0.6875rem; color: var(--text-4); flex-shrink: 0; }

/* ═══════════════════════════════════════
   SETTINGS MODAL
═══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
}
@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 20px; }
}
.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0 auto;
  padding-bottom: var(--safe-bottom);
  box-shadow: var(--shadow-lg);
}
@media (min-width: 600px) {
  .modal { border-radius: var(--radius-lg); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h2 {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.modal-body {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.modal-intro {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-bottom: 20px;
  line-height: 1.55;
  padding: 12px 14px;
  background: var(--bg-subtle, var(--bg));
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.api-settings-block { margin-bottom: 4px; }
.api-settings-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.text-link {
  font-size: 0.75rem;
  color: var(--blue-light);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0.85;
}
.text-link:hover { opacity: 1; text-decoration: underline; }

.settings-field { margin-bottom: 10px; }
.settings-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 6px;
  letter-spacing: .01em;
}
.optional { font-weight: 400; color: var(--text-4); }
.settings-field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8125rem;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.settings-field input:focus {
  outline: none;
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.settings-field input::placeholder { font-family: var(--font); color: var(--text-4); font-size: 0.8125rem; }
.secret-input-wrap { position: relative; }
.secret-input-wrap input { padding-right: 56px; }
.toggle-secret {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 4px;
  transition: color .15s;
  letter-spacing: .03em;
}
.toggle-secret:hover { color: var(--text); }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.expansion-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-3);
  line-height: 1.55;
}
.expansion-note svg { flex-shrink: 0; margin-top: 1px; color: var(--blue-light); opacity: 0.8; }

/* ═══════════════════════════════════════
   TOAST
═══════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 24px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg4);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 9px 18px;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 600;
  z-index: 999;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  letter-spacing: -0.01em;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════
   UTILITIES
═══════════════════════════════════════ */
.hidden { display: none !important; }
.text-muted { color: var(--text-3); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 380px) {
  .btn-row { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .info-item.full-width { grid-column: 1; }
  .summary-text h2 { font-size: 1.125rem; }
}
@media (min-width: 540px) {
  .main-content { padding-top: 28px; }
  .info-grid { grid-template-columns: repeat(3, 1fr); }
  .input-card { padding: 28px; }
  .summary-card { padding: 28px; }
}
@media (min-width: 720px) {
  .info-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ═══════════════════════════════════════
   AUCTION MODE
═══════════════════════════════════════ */
.auction-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.auction-screen.hidden { display: none; }

.auction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.auction-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-1);
  letter-spacing: 0.5px;
}

.auction-input-area {
  display: flex;
  gap: 10px;
  padding: 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.auction-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.auction-input-wrap input {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: 10px;
  color: var(--text-1);
  font-family: var(--mono);
  font-size: 1rem;
  padding: 12px 44px 12px 14px;
  letter-spacing: 1px;
  outline: none;
  transition: border-color 0.15s;
}
.auction-input-wrap input:focus { border-color: var(--blue-light); }
.auction-input-wrap .icon-btn {
  position: absolute;
  right: 8px;
  color: var(--text-3);
}

.auction-result {
  margin: 16px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 14px;
  overflow: hidden;
}
.auction-result.hidden { display: none; }

.auction-vehicle-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.auction-vehicle-icon { font-size: 2rem; }
.auction-vehicle-info { flex: 1; }
.auction-vehicle-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
}
.auction-vehicle-sub {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: 2px;
}
.recall-badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.recall-badge.hidden { display: none; }

.auction-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}
.auction-grid-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.auction-grid-item:nth-child(even) { border-right: none; }
.auction-grid-item .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-4);
  margin-bottom: 2px;
}
.auction-grid-item .value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-1);
}

.auction-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.auction-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 8px;
  border: none;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, filter 0.15s;
  letter-spacing: 0.5px;
}
.auction-action-btn:active { opacity: 0.7; }
.auction-action-btn.buy  { background: rgba(16,185,129,0.15); color: #34d399; border-top: 1px solid rgba(16,185,129,0.2); }
.auction-action-btn.watch { background: rgba(245,158,11,0.12); color: #fbbf24; border-top: 1px solid rgba(245,158,11,0.2); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.auction-action-btn.pass { background: rgba(239,68,68,0.12); color: #f87171; border-top: 1px solid rgba(239,68,68,0.2); }

/* Run List */
.auction-run-list {
  padding: 0 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.run-list-header {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-4);
  padding: 12px 0 6px;
}
.run-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.run-item-decision {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  min-width: 52px;
  text-align: center;
}
.run-item-decision.BUY  { background: rgba(16,185,129,0.15); color: #34d399; }
.run-item-decision.WATCH { background: rgba(245,158,11,0.12); color: #fbbf24; }
.run-item-decision.PASS { background: rgba(239,68,68,0.12); color: #f87171; }
.run-item-info { flex: 1; min-width: 0; }
.run-item-name { font-size: 0.88rem; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-item-vin  { font-size: 0.72rem; color: var(--text-4); font-family: var(--mono); }
.run-item-decision.PENDING { background: rgba(255,255,255,0.06); color: var(--text-4); }

/* ═══════════════════════════════════════
   IOS INSTALL BANNER
═══════════════════════════════════════ */
.ios-banner {
  position: fixed;
  bottom: 24px;
  left: 16px;
  right: 16px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 300;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.ios-banner.hidden { display: none; }
.ios-banner-icon img { border-radius: 10px; display: block; }
.ios-banner-text { flex: 1; min-width: 0; }
.ios-banner-title { font-size: 0.88rem; font-weight: 700; color: var(--text-1); }
.ios-banner-sub { font-size: 0.76rem; color: var(--text-3); margin-top: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ios-banner-sub strong { color: var(--text-1); }
.ios-banner-sub svg { display: inline; vertical-align: middle; flex-shrink: 0; }
.ios-banner-close {
  background: var(--bg3);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  flex-shrink: 0;
}
.ios-banner-arrow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--bg2);
}

/* ═══════════════════════════════════════
   PREMIUM PAYMENT TIERS
═══════════════════════════════════════ */
.premium-badge-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--warning);
  letter-spacing: 0.02em;
}
.premium-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--success-bg);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #22c55e;
  margin-bottom: 12px;
}
.premium-status-row.hidden { display: none; }
.premium-tiers { display: flex; flex-direction: column; gap: 10px; }
.premium-tiers.hidden { display: none; }
.premium-tier-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.premium-tier-card.tier-owned {
  opacity: 0.5;
  pointer-events: none;
}
.premium-tier-card.premium-tier-all {
  border-color: var(--warning);
  background: rgba(245,158,11,0.06);
}
.tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.tier-all-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--warning);
}
.tier-price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.tier-desc {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-bottom: 10px;
  line-height: 1.5;
}
.tier-buy-btn { width: 100%; justify-content: center; font-size: 0.83rem; }

/* ═══════════════════════════════════════
   PRICE HISTORY
═══════════════════════════════════════ */
.price-history-list { display: flex; flex-direction: column; gap: 8px; }
.price-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.phi-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue-subtle);
  color: var(--blue-light);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.phi-body { flex: 1; min-width: 0; }
.phi-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 3px; }
.phi-price { font-size: 1rem; font-weight: 700; color: var(--text); }
.phi-miles { font-size: 0.78rem; color: var(--text-3); }
.phi-meta  { font-size: 0.78rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phi-dates { font-size: 0.72rem; color: var(--text-4); margin-top: 2px; }
.phi-link  {
  color: var(--text-3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s;
}
.phi-link:hover { color: var(--blue-light); }

/* ═══════════════════════════════════════
   BLACK BOOK
═══════════════════════════════════════ */
.bb-badge {
  display: inline-block;
  background: rgba(245,158,11,0.12);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}
.bb-grid .info-item:first-child .info-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f59e0b;
}
