:root {
  /* Light Theme (Default) */
  --bg-body: #f5f5f5;
  --bg-card: #fff;
  --bg-hero: rgba(255, 255, 255, 0.95);
  --text-main: #333;
  --text-muted: #666;
  --text-inverse: #fff;
  --primary: #1a73e8;
  --primary-light: #e8f0fe;
  --accent-green: #2e7d32;
  --accent-red: #c62828;
  --accent-yellow: #ef6c00;
  --border: #e0e0e0;
  --border-focus: #1a73e8;
  --shadow: rgba(0, 0, 0, 0.15);
  --shadow-hover: rgba(0, 0, 0, 0.2);
  --gradient-start: #667eea;
  --gradient-end: #764ba2;
  --computed-bg: #e8f0fe;
  --computed-border: #1a73e8;
  --computed-text: #0d47a1;
  --warning-bg: #ffebee;
  --warning-text: #9e1b1b;
  --success-bg: #e8f5e9;
  --success-text: #1b5e20;
  --info-bg: #fff3e0;
  --info-text: #b53d00;
  --danger-bg: #ffcdd2;
  --danger-text: #b71c1c;
  --label-optional-bg: #e8f5e9;
  --label-optional-text: #2e7d32;
  --label-warning-bg: #ffebee;
  --label-warning-text: #c62828;
  --link: #1a73e8;
  --link-hover: #1557b0;
  --table-header-bg: #1a73e8;
  --table-header-text: #fff;
  --table-border: #e0e0e0;
  --table-alt-bg: #f8f9fa;
  --btn-bg: transparent;
  --btn-text: #333;
  --btn-border: #333;
  --btn-hover-bg: #333;
  --btn-hover-text: #f5f5f5;
  --btn-primary-bg: #333;
  --btn-primary-text: #f5f5f5;
  --btn-primary-hover-bg: #c62828;
  --btn-primary-hover-border: #c62828;
}

[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-card: #1e293b;
  --bg-hero: rgba(30, 41, 59, 0.98);
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  --primary: #60a5fa;
  --primary-light: #1e3a5f;
  --accent-green: #4ade80;
  --accent-red: #f87171;
  --accent-yellow: #fbbf24;
  --border: #334155;
  --border-focus: #60a5fa;
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-hover: rgba(0, 0, 0, 0.5);
  --gradient-start: #0f172a;
  --gradient-end: #1e293b;
  --computed-bg: #1e3a5f;
  --computed-border: #60a5fa;
  --warning-bg: rgba(248, 113, 113, 0.15);
  --warning-text: #ff9e9e;
  --success-bg: rgba(74, 222, 128, 0.15);
  --success-text: #4ade80;
  --info-bg: rgba(251, 191, 36, 0.15);
  --info-text: #fbbf24;
  --danger-bg: rgba(239, 83, 80, 0.15);
  --danger-text: #ef5350;
  --label-optional-bg: rgba(74, 222, 128, 0.15);
  --label-optional-text: #4ade80;
  --label-warning-bg: rgba(248, 113, 113, 0.15);
  --label-warning-text: #ff9e9e;
  --link: #60a5fa;
  --link-hover: #93c5fd;
  --table-header-bg: #1e3a5f;
  --table-header-text: #e2e8f0;
  --table-border: #334155;
  --table-alt-bg: #1e293b;
  --btn-bg: transparent;
  --btn-text: #e2e8f0;
  --btn-border: #e2e8f0;
  --btn-hover-bg: #e2e8f0;
  --btn-hover-text: #0f172a;
  --btn-primary-bg: #e2e8f0;
  --btn-primary-text: #0f172a;
  --btn-primary-hover-bg: #f87171;
  --btn-primary-hover-border: #f87171;
}

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

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: var(--text-inverse);
  padding: 0.5rem 1rem;
  z-index: 1000;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  min-height: 100vh;
  padding: 1rem;
  line-height: 1.6;
  color: var(--text-main);
  transition: background 0.3s ease, color 0.3s ease;
}

/* Dark mode: solid bg instead of gradient */
[data-theme="dark"] body {
  background: var(--bg-body);
}

/* Layout Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
header {
  text-align: left;
  margin-bottom: 2rem;
  padding: 2rem 2rem 2rem 2.5rem;
  background: var(--bg-hero);
  border-radius: 12px;
  box-shadow: 0 4px 6px var(--shadow);
  backdrop-filter: blur(10px);
}

h1 {
  color: var(--primary);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.version-badge {
  display: inline-block;
  background: var(--primary);
  color: var(--text-inverse);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Theme Toggle */
/* Header actions (theme toggle + help, top-right) */
.header-actions {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 10;
}

.theme-toggle {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s ease;
  z-index: 100;
}

.theme-toggle:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

/* Controls Row */
.controls-row {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* 4-Square Grid */
.four-square {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.square {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.square:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-hover);
}

.square h2 {
  font-size: 1.3rem;
  color: var(--primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.square-number {
  background: var(--primary);
  color: var(--text-inverse);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
}

label small {
  text-transform: none;
  font-style: italic;
}

input[type="number"] {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text-main);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text-main);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

input[type="number"]::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* Computed Values */
.computed {
  background: var(--computed-bg);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--computed-text);
  font-size: 1rem;
  border-left: 4px solid var(--computed-border);
  transition: background 0.3s ease, color 0.3s ease;
}

.computed span { color: var(--computed-text); }

.computed.highlight {
  font-size: 1.25rem;
  background: var(--success-bg);
  color: var(--success-text);
  border-left-color: var(--accent-green);
}

.walkaway-chip {
  margin-bottom: 0;
}

/* Status Indicators */
.warning {
  background: var(--warning-bg) !important;
  color: var(--warning-text) !important;
  border-left-color: var(--accent-red) !important;
}

.success {
  background: var(--success-bg) !important;
  color: var(--success-text) !important;
  border-left-color: var(--accent-green) !important;
}

.info {
  background: var(--info-bg) !important;
  color: var(--info-text) !important;
  border-left-color: var(--accent-yellow) !important;
}

.danger {
  background: var(--danger-bg, #ffcdd2) !important;
  color: var(--danger-text, #b71c1c) !important;
  border-left-color: var(--accent-red) !important;
}

/* Rebate breakdown */
.rebate-breakdown {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.rebate-breakdown summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
}
.rebate-breakdown .form-group {
  margin: 0.5rem 0 0;
}
.rebate-breakdown .form-group.small label {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Fee Breakout */
.fee-breakout {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px var(--shadow);
  margin-bottom: 2rem;
}

.fee-breakout h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary-light);
}

.fee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

/* Comparison Controls */
.comparison-controls {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow);
  text-align: center;
}

.comparison-controls h2 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: 2px solid var(--btn-border);
  background: var(--bg-card);
  color: var(--btn-text);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0.5rem;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-border);
}

.btn-primary:hover {
  background: var(--btn-primary-hover-bg);
  border-color: var(--btn-primary-hover-border);
}

.btn-secondary {
  background: var(--btn-bg);
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.btn-secondary:hover {
  background: var(--border);
}

/* Snapshot Banner */
.snapshot-banner {
  background: var(--success-bg);
  border: 2px solid var(--accent-green);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.snapshot-banner p {
  color: var(--success-text);
  font-weight: 600;
}

/* Dealer Info Section */
.dealer-info-section {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow);
}

.dealer-name-group {
  grid-column: 1;
}

.dealer-contact-group {
  grid-column: auto;
}

/* Comparison Table */
.comparison-table {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px var(--shadow);
  margin-bottom: 2rem;
  overflow-x: auto;
}

.comparison-table h2 {
  color: var(--primary);
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 0;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.comparison-header {
  background: var(--table-header-bg);
  color: var(--table-header-text);
  padding: 1rem;
  font-weight: 700;
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.comparison-row { display: contents; }

.comparison-row:nth-child(even) .comparison-cell {
  background: var(--table-alt-bg);
}

.comparison-cell {
  padding: 1rem;
  border-bottom: 1px solid var(--table-border);
  text-align: center;
  font-weight: 500;
  color: var(--text-main);
}

.comparison-cell:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
}

.comparison-cell.savings {
  background: var(--success-bg) !important;
  color: var(--success-text);
  font-weight: 700;
}

.comparison-cell.cost-more {
  background: var(--warning-bg) !important;
  color: var(--warning-text);
  font-weight: 700;
}

.comparison-cell.neutral {
  color: var(--text-muted);
}

/* Savings / Loss Summary */
.savings-summary {
  background: var(--success-bg);
  border: 2px solid var(--accent-green);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 1.5rem;
  text-align: center;
}

.savings-summary h3 {
  color: var(--success-text);
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.savings-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--success-text);
}

.loss-summary {
  background: var(--warning-bg);
  border: 2px solid var(--accent-red);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 1.5rem;
  text-align: center;
}

.loss-summary h3 {
  color: var(--warning-text);
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.loss-amount {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--warning-text);
}

/* Side-by-side Panels */
.side-by-side-panels {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto 2rem auto;
}

.side-by-side-panels .fee-breakout {
  margin-bottom: 0;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Export Toolbar */
.export-toolbar {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* CFPB Labels */
.label-optional {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--label-optional-text);
  background: var(--label-optional-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.label-warning {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--label-warning-text);
  background: var(--label-warning-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.label-non-negotiable {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.square {
  animation: fadeIn 0.4s ease forwards;
}

.square:nth-child(1) { animation-delay: 0.1s; }
.square:nth-child(2) { animation-delay: 0.2s; }
.square:nth-child(3) { animation-delay: 0.3s; }
.square:nth-child(4) { animation-delay: 0.4s; }

/* Mobile Responsive */
@media (max-width: 768px) {
  html { scrollbar-width: none; }
  html::-webkit-scrollbar { display: none; }

  body { padding: 0.5rem; padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }

  header {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
  }

  h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
  .subtitle { font-size: 0.95rem; }

  .header-actions {
    top: 0.75rem;
    right: 0.75rem;
  }

  .controls-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .comparison-controls {
    display: none;
  }

  .mobile-lock-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: var(--bg-body);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 12px var(--shadow);
    display: flex;
    justify-content: center;
  }

  .mobile-lock-bar .lock-offer-btn {
    width: 100%;
    max-width: 480px;
    min-height: 3rem;
    font-size: 1rem;
  }

  body {
    padding: 0.5rem;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
  }

  .four-square {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .square { padding: 1rem; border-radius: 10px; }
  .square h2 { font-size: 1.1rem; }

  .comparison-grid {
    grid-template-columns: 1fr 1fr;
    font-size: 0.85rem;
  }

  .comparison-header:nth-child(n+3) { display: none; }

  .side-by-side-panels {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .fee-grid { grid-template-columns: 1fr; }

  .shortcut-hint {
    top: 0.5rem;
    bottom: auto;
    left: 0.5rem;
    right: 0.5rem;
    transform: none;
    max-width: none;
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.35rem; }
  .container { padding: 0; }
  .square { border-radius: 8px; }

  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .export-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .export-toolbar .btn {
    flex: 1 1 auto;
    min-width: 120px;
    justify-content: center;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  @page {
    margin: 0.75in;
    size: auto;
  }

  body {
    background: white !important;
    padding: 0;
    color: #000 !important;
    font-size: 10pt;
    line-height: 1.3;
  }

  /* Hide interactive / non-essential elements */
  .theme-toggle,
  .btn,
  .export-toolbar,
  .comparison-controls,
  .snapshot-banner,
  .save-status,
  input[type="number"],
  .fee-breakout h2,
  .controls-row,
  .four-square h2,
  .side-by-side-panels,
  .comparison-table,
  .savings-summary,
  .loss-summary {
    display: none !important;
  }

  /* Force show print summary */
  .print-summary {
    display: block !important;
  }

  /* Restyle remaining visible content */
  header {
    background: none !important;
    box-shadow: none !important;
    padding: 0 0 0.5rem 0 !important;
    margin-bottom: 0.75rem !important;
    border-bottom: 2pt solid #000;
  }

  h1 {
    font-size: 16pt !important;
    color: #000 !important;
    margin-bottom: 0.25rem !important;
  }

  .subtitle {
    color: #333 !important;
    font-size: 10pt !important;
  }

  .square {
    box-shadow: none !important;
    border: 1pt solid #ccc;
    padding: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    page-break-inside: avoid;
  }

  .square .computed {
    background: none !important;
    border: none !important;
    padding: 0.25rem 0 !important;
    font-size: 10pt !important;
    color: #000 !important;
  }

  .computed {
    background: none !important;
    border-left: 3pt solid #000 !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 10pt !important;
    color: #000 !important;
  }

  .square:nth-child(3),
  .square:nth-child(4) {
    page-break-before: always;
  }

  footer {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1pt solid #ccc;
    font-size: 8pt;
    color: #555;
  }
}

/* ───────────────────────────────────────────
   HELP OVERLAY & KEYBOARD STYLES (Feature 3+4)
   ─────────────────────────────────────────── */

/* Help Button */
.help-btn {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  transition: all 0.2s ease;
  z-index: 100;
}

.help-btn:hover {
  border-color: var(--primary);
  transform: scale(1.1);
  background: var(--primary-light);
}

/* Shortcut Hint Banner */
.shortcut-hint {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-main);
  box-shadow: 0 4px 12px var(--shadow);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100vw - 2rem);
  cursor: pointer;
}

.shortcut-hint kbd {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
}

.shortcut-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.shortcut-dismiss:hover {
  color: var(--text-main);
  background: var(--bg-body);
}
  font-family: monospace;
  font-size: 0.85rem;
}

/* Help Overlay Modal */
.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.help-modal {
  background: var(--bg-card);
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.help-header h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin: 0;
}

.help-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.help-close:hover {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.help-content {
  padding: 1.5rem 2rem 2rem;
}

.help-content h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-light);
}

.help-content h3:first-child {
  margin-top: 0;
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.help-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.help-table td:first-child {
  width: 40%;
  white-space: nowrap;
}

.help-table kbd {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-family: monospace;
  font-size: 0.9rem;
  box-shadow: 0 1px 0 var(--border);
}

.help-content ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.help-content li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.help-content a {
  color: var(--link);
  text-decoration: underline;
}

/* Header positioning for help button */
header {
  position: relative;
}

/* Amortization Schedule (Feature 11) */
.amortization-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.amortization-content {
  background: var(--bg-card);
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.amortization-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.amortization-header h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin: 0;
}

.amortization-body {
  padding: 1.5rem 2rem 2rem;
}

.amortization-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.amortization-table th {
  background: var(--table-header-bg);
  color: var(--table-header-text);
  padding: 0.75rem;
  text-align: left;
  position: sticky;
  top: 0;
}

.amortization-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--table-border);
}

.amortization-table tr:nth-child(even) {
  background: var(--table-alt-bg);
}

/* State Tax Dropdown (Feature 12) */
.state-tax-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  align-items: end;
  margin-top: 1rem;
}

select {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text-main);
  transition: border-color 0.2s ease;
}

select:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* Total Cost of Ownership (Feature 13) */
.tco-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.tco-card {
  background: var(--computed-bg);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  border-left: 4px solid var(--computed-border);
}

.tco-card h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.tco-card .tco-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

/* Deal Score Display (Feature 1, Tier 1) */
.deal-score-display {
  background: var(--computed-bg);
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--computed-border);
  margin-top: 0.75rem;
}

.lock-offer-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  gap: 0.25rem;
  width: 100%;
  white-space: nowrap;
}

.lock-offer-btn .unlock-label {
  font-weight: 700;
  font-size: 1rem;
}

.lock-offer-btn .timer-label {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.9;
}

.deal-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.deal-score-header span:first-child {
  font-weight: 600;
  color: var(--text-main);
}

.deal-score-grade {
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
}

.deal-score-grade.success {
  background: var(--success-bg);
  color: var(--success-text);
}

.deal-score-grade.info {
  background: var(--info-bg);
  color: var(--info-text);
}

.deal-score-grade.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.deal-score-bar {
  width: 100%;
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.deal-score-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.deal-score-fill.success { background: var(--accent-green); }
.deal-score-fill.info { background: var(--accent-yellow); }
.deal-score-fill.warning { background: var(--accent-red); }

.deal-score-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  margin-bottom: 0.25rem;
}

.deal-score-msg {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* Negotiation Timer (Feature 4, Tier 1) */
.negotiation-timer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--computed-bg);
  border-radius: 8px;
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0.75rem 0;
  border-left: 4px solid var(--computed-border);
  transition: all 0.3s ease;
}

.negotiation-timer.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-left-color: var(--accent-red);
  animation: pulse 1s infinite;
}

.timer-alert {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Negotiation Script Modal (Feature 9, Tier 3) */
.script-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.script-content {
  background: var(--bg-card);
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.script-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.script-header h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin: 0;
}

.script-body {
  padding: 1.5rem 2rem 2rem;
}

.script-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.script-point {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-body);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
  position: relative;
}

.script-point.critical {
  border-left-color: var(--accent-red);
  background: var(--warning-bg);
}

.script-point.high {
  border-left-color: var(--accent-orange);
}

.script-point.medium {
  border-left-color: var(--accent-yellow);
}

.script-point.low {
  border-left-color: var(--accent-green);
}

.script-priority-badge {
  flex-shrink: 0;
  width: 80px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
  background: var(--primary);
}

.script-point.critical .script-priority-badge {
  background: var(--accent-red);
}

.script-point.high .script-priority-badge {
  background: var(--accent-orange);
}

.script-point.medium .script-priority-badge {
  background: var(--accent-yellow);
  color: var(--text-main);
}

.script-point.low .script-priority-badge {
  background: var(--accent-green);
}

.script-text {
  flex: 1;
}

.script-text p {
  margin: 0 0 0.5rem;
  font-style: italic;
  color: var(--text-main);
  line-height: 1.5;
}

.script-why {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.script-copy {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.script-copy:hover {
  background: var(--primary);
  color: white;
}

































/* Pre-Negotiation Checklist (Feature 2, Tier 1) */
.checklist-panel {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px var(--shadow);
}

.checklist-toggle {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-light);
  color: var(--primary);
  font-size: 1.3rem;
}

.checklist-toggle:hover {
  color: var(--link-hover);
}

.checklist-chevron {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 1rem;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  margin: -0.5rem -0.5rem -0.5rem 0;
}

.checklist-chevron:hover {
  background: var(--bg-body);
}

.checklist-content {
  padding-top: 1rem;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: var(--bg-body);
  border-radius: 8px;
  transition: background 0.2s;
}

.checklist li:hover {
  background: var(--primary-light);
}

.checklist input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checklist label {
  margin: 0;
  color: var(--text-main);
  cursor: pointer;
  font-weight: 400;
}

.checklist label strong {
  color: var(--primary);
}

/* Depreciation Curve (Feature 3, Tier 1) */
.depreciation-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.depreciation-bar {
  display: grid;
  grid-template-columns: 80px 1fr 120px;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.depreciation-label {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.9rem;
}

.depreciation-track {
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.depreciation-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.5s ease;
  min-width: 4px;
}

.depreciation-fill.good {
  background: var(--accent-green);
}

.depreciation-fill.fair {
  background: var(--accent-yellow);
}

.depreciation-fill.poor {
  background: var(--accent-red);
}

.depreciation-value {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  text-align: right;
}

.depreciation-pct {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

/* Trade-In Value Estimator (Feature 7, Tier 2) */
.tradein-estimator {
  margin-top: 1rem;
}

.tradein-estimator h3 {
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.tradein-ranges {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tradein-range-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg-body);
  border-radius: 6px;
}

.range-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.range-value {
  font-weight: 700;
  font-size: 0.95rem;
}

.range-value.dealer {
  color: var(--accent-red);
}

.range-value.private {
  color: var(--accent-yellow);
}

.range-value.retail {
  color: var(--accent-green);
}

/* Dealer Info Section (Feature 6) */
.dealer-info-section {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow);
}

.dealer-name-group input {
  font-weight: 600;
  font-size: 1.1rem;
}

.dealer-contact-group input {
  font-size: 0.95rem;
}

/* Scenario Comparison (Feature 10) */
.scenario-comparison {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow);
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.scenario-card {
  background: var(--bg-body);
  border-radius: 8px;
  padding: 1rem;
  border: 2px solid var(--border);
}

.scenario-card:nth-child(1) { border-color: var(--primary); }
.scenario-card:nth-child(2) { border-color: var(--accent-green); }
.scenario-card:nth-child(3) { border-color: var(--accent-yellow); }

.scenario-results {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border);
}

.scenario-results h3 {
  margin-bottom: 1rem;
  color: var(--primary);
}

@media (max-width: 768px) {
  .dealer-info-section {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .scenario-grid {
    grid-template-columns: 1fr;
  }
}

/* Dealer Research Links (Feature 10, Tier 3) */
.dealer-research {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 2px 8px var(--shadow);
}

.dealer-research h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 1rem;
}

.research-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.research-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-body);
  border: 2px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.research-link:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.quick-search-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.quick-search-links .search-link {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  background: var(--bg-body);
  border: 2px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
}

.quick-search-links .search-link:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Fuel Cost Calculator */
.fuel-calculator {
  margin: 0.75rem 0 1rem 0;
}

.fuel-calc-toggle {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.fuel-calc-toggle:hover {
  text-decoration: underline;
}

.fuel-calc-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.5rem;
}

/* VIN Lookup (Feature 11, Tier 3) */
.vin-lookup {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.vin-lookup input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.vin-result {
  background: var(--bg-body);
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.vin-result .vin-detail {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}

.vin-result .vin-detail:last-child {
  border-bottom: none;
}


/* ============================================
   VIN LOOKUP STYLES (Feature 11)
   ============================================ */

.vin-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-body);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.dark .vin-section {
    background: rgba(255, 255, 255, 0.05);
}

.vin-input-wrap {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.vin-input-wrap input {
    flex: 1;
    font-family: monospace;
    letter-spacing: 2px;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.decode-btn {
    white-space: nowrap;
}

.vin-card {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.dark .vin-card {
    background: rgba(76, 175, 80, 0.15);
}

.vin-card h4 {
    margin: 0 0 0.75rem 0;
    color: var(--success);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.vin-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
}

.dark .vin-detail {
    border-bottom-color: rgba(255,255,255,0.05);
}

.vin-detail:last-child {
    border-bottom: none;
}

.vin-detail span:first-child {
    color: var(--text-muted);
    font-weight: 500;
}

.vin-detail span:last-child {
    font-weight: 600;
    color: var(--text-dark);
}

.dark .vin-detail span:last-child {
    color: var(--text-light);
}

.vin-error {
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}


/* ============================================
   TIER 4 FEATURES CSS (v1.4.x)
   ============================================ */

/* v1.4.2: Payment Split Calculator */
.biweekly-toggle {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(76, 175, 80, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.dark .biweekly-toggle {
    background: rgba(76, 175, 80, 0.12);
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
}

.switch-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--success);
}

.biweekly-results {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(76, 175, 80, 0.3);
}

.biweekly-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.95rem;
}

.biweekly-row.highlight span:last-child {
    font-weight: 600;
    color: var(--success);
}

.biweekly-note {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-style: italic;
}

/* v1.4.3: GAP Insurance Analyzer */
.gap-analyzer {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(239, 83, 80, 0.08);
    border: 1px solid rgba(239, 83, 80, 0.2);
}

.dark .gap-analyzer {
    background: rgba(239, 83, 80, 0.12);
}

.gap-analyzer h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gap-status {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

.gap-needed {
    background: rgba(239, 83, 80, 0.2);
    color: #9e1b1b;
}

.dark .gap-needed {
    color: #ffcdd2;
}

.gap-ok {
    background: rgba(76, 175, 80, 0.2);
    color: #1b5e20;
}

.dark .gap-ok {
    color: #c8e6c9;
}

.gap-details div {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.gap-details span:first-child {
    color: var(--text-muted);
}

.gap-rec {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* v1.4.4: Extended Warranty Analyzer */
.warranty-analyzer {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(255, 167, 38, 0.08);
    border: 1px solid rgba(255, 167, 38, 0.2);
}

.dark .warranty-analyzer {
    background: rgba(255, 167, 38, 0.12);
}

.warranty-analyzer h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group.small input,
.form-group.small select {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
}

.warranty-results {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(255, 167, 38, 0.3);
}

.warranty-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.95rem;
}

.warranty-row span:last-child.good { color: var(--success); font-weight: 600; }
.warranty-row span:last-child.fair { color: var(--warning); font-weight: 600; }
.warranty-row span:last-child.poor { color: var(--danger); font-weight: 600; }


/* ============================================
   ALTERNATIVE FEATURES CSS (v1.4.5-alt, v1.4.6-alt, v1.5.0)
   ============================================ */

/* v1.4.5-alt: Rebate Tracker */
.rebate-tracker {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(76, 175, 80, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.dark .rebate-tracker {
    background: rgba(76, 175, 80, 0.12);
}

.rebate-tracker h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--success);
}

.rebate-tracker .form-group.small {
    margin-bottom: 0.5rem;
}

.rebate-tracker .form-group.small label {
    font-size: 0.85rem;
}

.rebate-tracker .form-group.small input {
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
}

.rebate-summary {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed rgba(76, 175, 80, 0.3);
}

.rebate-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1rem;
    color: var(--success);
    padding: 0.35rem 0;
}

.rebate-line {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.rebate-line span:first-child {
    color: var(--text-muted);
}

/* v1.4.6-alt: Drive-Off Price Builder */
.drive-off {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-body);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.dark .drive-off {
    background: rgba(255, 255, 255, 0.05);
}

.drive-off h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.drive-off-breakdown > div {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.95rem;
}

.drive-off-breakdown .minus {
    color: var(--success);
}

.drive-off-final {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    margin-top: 0.5rem;
    border-top: 2px solid var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
}

/* v1.5.0: Dealer Profit Estimator */
.profit-estimator {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 167, 38, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 167, 38, 0.2);
}

.dark .profit-estimator {
    background: rgba(255, 167, 38, 0.12);
}

.profit-estimator h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profit-details > div {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.95rem;
}

.profit-details .minus {
    color: var(--success);
}

.profit-details .faint {
    color: var(--text-muted);
    font-style: italic;
}

.profit-line {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-weight: 600;
}

.profit-verdict {
    margin-top: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.profit-verdict.danger {
    background: rgba(239, 83, 80, 0.15);
    color: #c62828;
    border: 1px solid rgba(239, 83, 80, 0.3);
}

.dark .profit-verdict.danger { color: #ffcdd2; }

.profit-verdict.warning {
    background: rgba(255, 167, 38, 0.15);
    color: #b53d00;
    border: 1px solid rgba(255, 167, 38, 0.3);
}

.dark .profit-verdict.warning { color: #ffe0b2; }

.profit-verdict.success {
    background: rgba(76, 175, 80, 0.15);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.dark .profit-verdict.success { color: #c8e6c9; }

/* Refinance projection panel */
.refinance-projection {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.refinance-projection h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--primary);
}

.refi-results {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.refi-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
}

.refi-row:last-child {
  border-bottom: none;
}

.refi-row.highlight {
  font-weight: 700;
}

.refi-row .savings {
  color: var(--accent-green);
  font-weight: 700;
}

/* Payment Summary v2 — collapsible details */
.payment-summary .payment-summary-primary {
  font-size: 1.35rem;
  font-weight: 700;
  padding: 1rem;
  text-align: center;
  border: 2px solid var(--primary);
  border-radius: 8px;
}

.payment-summary .walkaway-chip {
  font-size: 0.95rem;
  padding: 0.75rem;
}

.details-toggle {
  width: 100%;
  margin: 0.75rem 0 0.25rem;
  padding: 0.6rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.details-toggle:hover,
.details-toggle:focus {
  background: var(--primary-light);
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.details-panel {
  padding-top: 0.5rem;
}

.details-panel .drive-off,
.details-panel .biweekly-toggle,
.details-panel .refinance-projection,
.details-panel .gap-analyzer,
.details-panel .dealer-economics {
  margin: 0.75rem 0;
}

.dealer-economics {
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.dealer-economics h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--primary);
}

/* Cloud Save/Load Session Modal */
.cloud-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cloud-content {
  background: var(--bg-card);
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.cloud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.cloud-header h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin: 0;
}

.cloud-body {
  padding: 1.5rem 2rem 2rem;
}

.cloud-json {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  max-height: 50vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-main);
}

/* Match walkaway chip padding to other .computed blocks */
.payment-summary .walkaway-chip {
  font-size: 0.95rem;
  padding: 1rem;
}
