/* ===== RESET ===== */
.ac-wrap *, .ac-wrap *::before, .ac-wrap *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== BASE ===== */
.ac-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; color: #1e293b;
  max-width: 1060px; margin: 0 auto;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 16px; overflow: hidden;
}

/* ===== HEADER ===== */
.ac-header { padding: 22px 24px 20px; background: #1e3a5f; }
.ac-header-inner { display: flex; align-items: center; gap: 14px; }
.ac-header-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}
.ac-title { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.ac-subtitle { font-size: 13px; color: rgba(255,255,255,0.7); }

/* ===== LAYOUT ===== */
.ac-body { display: flex; flex-direction: column; }
@media (min-width: 720px) {
  .ac-body { flex-direction: row; align-items: flex-start; }
  .ac-inputs { width: 52%; border-right: 1px solid #e2e8f0; }
  .ac-results { width: 48%; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; }
}
.ac-inputs { padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.ac-results { padding: 20px; display: flex; flex-direction: column; gap: 13px; background: #f8fafc; }

/* ===== SECTION LABELS ===== */
.ac-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: #64748b;
}

/* ===== FIELDS ===== */
.ac-field { display: flex; flex-direction: column; gap: 7px; }
.ac-label-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.ac-label { font-size: 13px; font-weight: 600; color: #334155; }
.ac-val-badge { font-size: 12.5px; font-weight: 700; color: #185FA5; background: #E6F1FB; padding: 2px 10px; border-radius: 20px; }
.ac-badge { font-size: 12.5px; font-weight: 700; color: #1e3a5f; background: #e0e7ff; padding: 2px 10px; border-radius: 20px; }
.ac-field-hint { font-size: 12px; color: #64748b; line-height: 1.5; }

/* ===== SLIDER ===== */
.ac-slider { width: 100%; height: 5px; accent-color: #185FA5; cursor: pointer; }

/* ===== INPUTS ===== */
.ac-input-prefix-wrap, .ac-input-suffix-wrap {
  display: flex; align-items: center;
  border: 1.5px solid #cbd5e1; border-radius: 8px;
  overflow: hidden; background: #f8fafc;
}
.ac-input-prefix-wrap:focus-within, .ac-input-suffix-wrap:focus-within {
  border-color: #185FA5; background: #fff;
}
.ac-prefix, .ac-suffix {
  padding: 0 10px; height: 42px;
  display: flex; align-items: center;
  font-size: 14px; font-weight: 600; color: #64748b;
  background: #f1f5f9;
}
.ac-prefix { border-right: 1px solid #e2e8f0; }
.ac-suffix { border-left: 1px solid #e2e8f0; }
.ac-input {
  flex: 1; border: none; background: transparent;
  padding: 0 12px; height: 42px;
  font-size: 14px; color: #1e293b; outline: none; min-width: 0;
  -moz-appearance: textfield;
}
.ac-input::-webkit-outer-spin-button,
.ac-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ===== BUTTON GROUPS ===== */
.ac-btn-group { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.ac-btn-group-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.ac-ratio-btn, .ac-cs-btn {
  padding: 10px 6px; border: 1.5px solid #cbd5e1;
  border-radius: 8px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; background: #f8fafc; color: #475569;
  transition: all .15s; text-align: center;
}
.ac-ratio-btn.active { background: #185FA5; border-color: #185FA5; color: #fff; }
.ac-cs-btn.active { background: #1e3a5f; border-color: #1e3a5f; color: #fff; }
.ac-ratio-btn:hover:not(.active), .ac-cs-btn:hover:not(.active) { border-color: #185FA5; color: white; }

/* ===== DISCLAIMER ===== */
.ac-disclaimer {
  background: #fefce8; border: 1px solid #fde68a;
  border-radius: 8px; padding: 12px 14px;
  font-size: 12px; color: #78350f; line-height: 1.5;
}

/* ===== DUAL HERO ===== */
.ac-dual-hero {
  display: flex; align-items: stretch; gap: 0;
  border-radius: 14px; overflow: hidden;
  border: 1px solid #e2e8f0;
}
.ac-hero-comfortable {
  flex: 1; background: #185FA5; color: #fff;
  padding: 18px 16px; text-align: center;
}
.ac-hero-lender {
  flex: 1; background: #1e293b; color: #fff;
  padding: 18px 16px; text-align: center;
}
.ac-hero-divider {
  display: flex; align-items: center; justify-content: center;
  background: #0f172a; color: rgba(255,255,255,0.5);
  font-size: 11px; font-weight: 700; padding: 0 10px;
  text-transform: uppercase; letter-spacing: .05em;
  writing-mode: vertical-rl;
}
.ac-hero-label { font-size: 11px; font-weight: 600; opacity: .75; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.ac-hero-amount { font-size: 30px; font-weight: 800; line-height: 1.1; }
.ac-hero-sub { font-size: 11px; opacity: .65; margin-top: 4px; }

/* ===== GAP CARD ===== */
.ac-gap-card {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff7ed; border: 1.5px solid #fed7aa;
  border-radius: 10px; padding: 12px 14px;
}
.ac-gap-icon { font-size: 18px; flex-shrink: 0; }
.ac-gap-text { font-size: 13px; color: #9a3412; font-weight: 600; line-height: 1.5; }

/* ===== PMI CARD ===== */
.ac-pmi-card {
  background: #fff; border: 1.5px solid #fecaca;
  border-radius: 12px; padding: 14px 16px;
}
.ac-pmi-title { font-size: 13px; font-weight: 700; color: #dc2626; margin-bottom: 10px; }
.ac-pmi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 8px; }
.ac-pmi-item { background: #fff5f5; border-radius: 8px; padding: 8px; text-align: center; }
.ac-pmi-label { font-size: 10.5px; font-weight: 600; color: #64748b; margin-bottom: 3px; }
.ac-pmi-val { font-size: 13.5px; font-weight: 700; color: #dc2626; }
.ac-pmi-note { font-size: 11.5px; color: #64748b; }

/* ===== STATS ===== */
.ac-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.ac-stat { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; }
.ac-stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-bottom: 5px; }
.ac-stat-val { font-size: 15px; font-weight: 700; color: #1e293b; }

/* ===== BREAKDOWN ===== */
.ac-breakdown {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 14px 16px;
}
.ac-breakdown-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin-bottom: 10px; }
.ac-breakdown-row { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; font-size: 13px; color: #475569; border-bottom: 1px solid #f1f5f9; }
.ac-breakdown-row:last-child { border-bottom: none; }
.ac-breakdown-total { padding-top: 10px; }
.ac-bk-amount { font-weight: 700; color: #1e293b; }
.ac-red { color: #dc2626; }

/* ===== INSIGHT ===== */
.ac-insight {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 12px; padding: 14px 16px;
  font-size: 13.5px; line-height: 1.6; color: #1e3a5f;
}

/* ===== MOBILE ===== */
@media (max-width: 480px) {
  .ac-header { padding: 16px; }
  .ac-inputs, .ac-results { padding: 14px; }
  .ac-title { font-size: 17px; }
  .ac-hero-amount { font-size: 24px; }
  .ac-btn-group-4 { grid-template-columns: repeat(2,1fr); }
  .ac-pmi-grid { grid-template-columns: repeat(2,1fr); }
}
