/* Ultra-Premium Design System - InstaHome Web v1.0.1 */
:root {
  --bg-dark: #080c14;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-solid: #121826;
  --bg-card-hover: rgba(26, 35, 54, 0.95);
  --bg-input: #0b101b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(16, 185, 129, 0.35);

  --primary-emerald: #10b981;
  --primary-emerald-hover: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --primary-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;

  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 35px rgba(16, 185, 129, 0.18);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(59, 130, 246, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Nav */
.header {
  background: rgba(12, 16, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-emerald), var(--accent-cyan));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.logo-text span {
  color: var(--primary-emerald);
}

.nav-links {
  display: flex;
  gap: 0.4rem;
  background: rgba(11, 16, 27, 0.8);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--primary-emerald), #059669);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrapper .select-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--primary-emerald);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 2;
}

.select-picker {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--bg-card-solid);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 0.85rem;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 1.8rem 0.55rem 2.1rem;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: all 0.25s ease;
  max-width: 155px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-picker option {
  background-color: #121826;
  color: #f8fafc;
  padding: 8px 12px;
}

.select-picker:hover, .select-picker:focus {
  border-color: var(--primary-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Buttons */
.btn-primary, .btn-secondary {
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-emerald), #059669);
  color: #fff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-sub);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  transform: translateY(-1px);
}

/* Presets & Quick Buttons */
.preset-pills {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-emerald);
  border-color: var(--primary-emerald);
}

/* Main & Layout */
.main-content {
  max-width: 1320px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  flex: 1;
  width: 100%;
}

.tab-content {
  display: none;
  animation: slideUpFade 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
  display: block;
}

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

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

@media (max-width: 1024px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    overflow-x: auto;
    max-width: 100%;
  }
}

/* Cards & Glassmorphism */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.full-width-card {
  grid-column: 1 / -1;
}

.card-header {
  margin-bottom: 1.75rem;
}

.card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-main);
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.35rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.35rem;
}

.form-row {
  display: flex;
  gap: 1.2rem;
}

.col-6 { flex: 1; }
.col-4 { flex: 1; }

label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 0.45rem;
}

.info-icon {
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: help;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.currency-symbol {
  position: absolute;
  left: 1rem;
  color: var(--primary-emerald);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 2;
  line-height: 1;
}

input[type="number"], select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  padding-left: 2.5rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: all 0.25s ease;
}

select {
  padding-left: 1rem;
  cursor: pointer;
}

input[type="number"]:focus, select:focus {
  border-color: var(--primary-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.sub-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.term-months-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.45rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.months-label {
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-bottom: 0;
  white-space: nowrap;
}

.input-months-sm {
  width: 90px !important;
  padding: 0.25rem 0.5rem !important;
  font-size: 0.88rem !important;
  text-align: center;
  border-radius: 6px !important;
}

/* Range Slider */
.slider {
  width: 100%;
  margin-top: 0.7rem;
  accent-color: var(--primary-emerald);
  cursor: pointer;
}

/* Accordion */
.accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  margin-top: 1.25rem;
  overflow: hidden;
}

.accordion-header {
  padding: 1rem 1.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-sub);
  transition: background 0.2s ease;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.accordion-body {
  padding: 1.2rem;
  border-top: 1px solid var(--border-color);
}

.accordion-body.hidden {
  display: none;
}

/* Results Display */
.result-header {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  position: relative;
}

.badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary-blue);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 0.6rem;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-emerald);
}

.badge-accent {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.monthly-payment-display {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1.5px;
  line-height: 1.05;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.payment-subtext {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 230px;
  margin: 1.5rem 0;
  width: 100%;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.chart-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.chart-center-val {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.chart-center-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Breakdown List */
.payment-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.breakdown-item {
  display: flex;
  align-items: center;
  font-size: 0.92rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.025);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 0.85rem;
}

.dot-principal { background: var(--primary-emerald); box-shadow: 0 0 10px rgba(16, 185, 129, 0.5); }
.dot-tax { background: var(--primary-blue); box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
.dot-insurance { background: var(--accent-purple); box-shadow: 0 0 10px rgba(139, 92, 246, 0.5); }
.dot-hoa { background: var(--accent-cyan); box-shadow: 0 0 10px rgba(6, 182, 212, 0.5); }

.breakdown-name {
  color: var(--text-sub);
  flex: 1;
  font-weight: 500;
}

.breakdown-val {
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-main);
}

.summary-stats-box {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  justify-content: space-around;
  text-align: center;
  border: 1px solid var(--border-color);
}

.summary-stats-box.vertical {
  flex-direction: column;
  gap: 0.85rem;
  text-align: left;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.summary-stats-box.vertical .stat-item {
  flex-direction: row;
  justify-content: space-between;
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed var(--border-color);
}

.summary-stats-box.vertical .stat-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-val {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.text-emerald { color: var(--primary-emerald); }
.text-accent { color: var(--accent-cyan); }

/* Table Styling */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.amortization-chart-wrapper {
  height: 300px;
  margin-bottom: 1.75rem;
}

.table-container {
  overflow-x: auto;
  max-height: 480px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.data-table th {
  background: var(--bg-input);
  padding: 0.95rem 1.15rem;
  color: var(--text-sub);
  font-family: var(--font-heading);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

/* Google AdSense Container & Responsive Formatting */
.ad-banner-wrapper {
  max-width: 1320px;
  margin: 1.25rem auto;
  padding: 0 1.5rem;
  text-align: center;
}

.ad-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 0.35rem;
}

.ad-container {
  background: rgba(11, 16, 27, 0.7);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.ad-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inline-ad {
  margin-top: 1.75rem;
  padding: 0;
}

/* Footer */
.footer {
  background: rgba(12, 16, 26, 0.95);
  border-top: 1px solid var(--border-color);
  padding: 1.75rem 1.5rem;
  margin-top: 3.5rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  color: var(--text-sub);
  text-decoration: none;
  margin-left: 1.25rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary-emerald);
}

.version-badge {
  display: inline-block;
  background: var(--bg-input);
  color: var(--primary-emerald);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-left: 0.5rem;
}

/* Print-only element hiding (Strictly hidden on web screen view) */
.print-only,
.print-header,
.print-footer,
.print-logo,
.print-subtitle,
.print-meta,
.print-date {
  display: none !important;
}

/* Print CSS - Perfectly Formatted 2-Page Executive Financial Report */
@media print {
  @page {
    size: A4 portrait;
    margin: 1.2cm 1.5cm;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 11pt;
    line-height: 1.4;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Hide unneeded web elements during print */
  .header, 
  .ad-banner-wrapper, 
  .nav-links, 
  .header-actions, 
  .footer, 
  .preset-pills, 
  .info-icon, 
  .slider, 
  .tab-content:not(#tab-calculator),
  .accordion-header i,
  .inline-ad {
    display: none !important;
  }

  /* Show extra cost accordion body when printing */
  .accordion-body {
    display: block !important;
  }

  .main-content {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  /* Reveal print-specific headers and footers during printing only */
  .print-only {
    display: block !important;
  }

  .print-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #10b981;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .print-logo {
    display: block !important;
  }

  .print-subtitle, .print-meta, .print-date {
    display: block !important;
  }

  .print-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
  }

  .print-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.2rem;
  }

  .print-meta {
    font-size: 0.85rem;
    color: #64748b;
    text-align: right;
  }

  /* Force 2-page layout */
  .calculator-grid {
    display: block !important;
  }

  /* PAGE 1 CONTENT */
  .input-card {
    page-break-after: always !important;
    break-after: page !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    padding: 1.5rem !important;
    margin-bottom: 0 !important;
    border-radius: 8px !important;
  }

  .input-card input, .input-card select {
    border: 1px solid #94a3b8 !important;
    background: #f8fafc !important;
    color: #0f172a !important;
    font-weight: 600;
  }

  /* PAGE 2 CONTENT */
  .result-card {
    page-break-before: always !important;
    break-before: page !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    padding: 1.5rem !important;
    border-radius: 8px !important;
  }

  .result-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    text-align: center;
  }

  .monthly-payment-display {
    color: #10b981 !important;
    font-size: 3.2rem !important;
  }

  .chart-container {
    height: 240px !important;
    margin: 1.25rem 0 !important;
  }

  .chart-center-val {
    color: #0f172a !important;
  }

  .breakdown-item {
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 0.6rem 0 !important;
    color: #334155 !important;
  }

  .breakdown-val {
    color: #0f172a !important;
  }

  .summary-stats-box {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    margin-top: 1.25rem !important;
    padding: 1.25rem !important;
  }

  .summary-stats-box .stat-label {
    color: #64748b !important;
  }

  .summary-stats-box .stat-val {
    color: #0f172a !important;
  }

  /* Print Footer */
  .print-footer {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #cbd5e1;
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
  }
}

/* Tablet & Mobile Header Adjustments (< 1024px) */
@media (max-width: 1024px) {
  .header-container {
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.4rem;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-btn {
    flex-shrink: 0;
    font-size: 0.82rem;
    padding: 0.5rem 0.9rem;
  }

  .header-actions {
    margin-left: auto;
    gap: 0.5rem;
  }

  .select-picker {
    max-width: 130px;
    font-size: 0.8rem;
    padding: 0.5rem 1.6rem 0.5rem 1.8rem;
  }

  .select-wrapper .select-icon {
    font-size: 0.75rem;
    left: 0.6rem;
  }

  .btn-primary, .btn-secondary {
    font-size: 0.8rem;
    padding: 0.5rem 0.85rem;
  }
}

/* Mobile Screens (< 768px) */
@media (max-width: 768px) {
  .main-content {
    margin: 1.25rem auto;
    padding: 0 0.85rem;
  }

  .card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  .card-header h2 {
    font-size: 1.2rem;
  }

  .monthly-payment-display {
    font-size: 2.6rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0.85rem;
  }

  .col-6, .col-4 {
    width: 100%;
  }

  .summary-stats-box {
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
  }

  .summary-stats-box .stat-item {
    flex-direction: row;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-color);
  }

  .summary-stats-box .stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .amortization-chart-wrapper {
    height: 220px;
  }

  .chart-container {
    height: 200px;
  }

  .chart-center-val {
    font-size: 1.15rem;
  }

  .footer-container {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .footer-links a {
    margin: 0 0.5rem;
  }
}

/* Extra Small Screens (< 480px) */
@media (max-width: 480px) {
  .header-container {
    gap: 0.5rem;
  }

  .logo-text {
    font-size: 1.2rem;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    order: 2;
  }

  .select-wrapper {
    flex: 1;
  }

  .select-picker {
    width: 100%;
    max-width: 100%;
  }

  .btn-primary, .btn-secondary {
    display: none;
  }

  .monthly-payment-display {
    font-size: 2.2rem;
  }
}
