body.mortgage-tool{
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;

  --bg: #ffffff;
  --bg-2: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #fbfcfe;
  --surface-tint: #f3f7ff;

  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --border: #e2e8f0;
  --border-2: #d6deea;

  --primary: #6d28d9;
  --primary-2: #7c3aed;
  --ring: rgba(124, 58, 237, .20);
  --primary-soft: rgba(124, 58, 237, .08);

  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .10);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;

  --shadow-xs: 0 1px 2px rgba(15,23,42,.06);
  --shadow-sm: 0 2px 10px rgba(15,23,42,.06);
  --shadow-md: 0 12px 28px rgba(15,23,42,.10);
  --shadow-lg: 0 18px 48px rgba(15,23,42,.14);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;

  --container: 1100px;

  --fs-1: 12px;
  --fs-2: 14px;
  --fs-3: 16px;
  --fs-4: 18px;
  --fs-5: 22px;
  --fs-6: 28px;
  --fs-7: 34px;

  --lh: 1.5;
  --lh-tight: 1.2;

  --input-h: 50px;

  font-family: var(--font-sans);
  color: var(--text);
  background: #ffffff;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.mortgage-tool *, body.mortgage-tool *::before, body.mortgage-tool *::after{ box-sizing:border-box; }
body.mortgage-tool img, body.mortgage-tool svg{ display:block; max-width:100%; }
body.mortgage-tool a{ color:inherit; text-decoration:none; }
body.mortgage-tool p{ margin:0; }
body.mortgage-tool ul{ margin:0; padding-left: 1.1em; }
body.mortgage-tool li{ margin: 0 0 var(--space-2); }
body.mortgage-tool li:last-child{ margin-bottom:0; }
body.mortgage-tool :where(h1,h2,h3){ margin:0; letter-spacing:-0.02em; }
body.mortgage-tool :where(h2){ font-size: var(--fs-5); line-height: var(--lh-tight); }
body.mortgage-tool :where(h3){ font-size: var(--fs-4); line-height: var(--lh-tight); }
body.mortgage-tool .small{ font-size: var(--fs-2); color: var(--muted); line-height: var(--lh); }
body.mortgage-tool .helper{ font-size: var(--fs-2); color: var(--muted); margin-top: var(--space-2); line-height: 1.35; }
body.mortgage-tool .error{
  display:none;
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid rgba(220,38,38,.22);
  background: linear-gradient(180deg, rgba(220,38,38,.08), rgba(220,38,38,.05));
  color: #7f1d1d;
  font-size: var(--fs-2);
}
body.mortgage-tool #mortgageError:not(:empty),
body.mortgage-tool #formError:not(:empty){ display:block; }

body.mortgage-tool :where(a, button, input, select, summary):focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
}
body.mortgage-tool ::selection{ background: rgba(124,58,237,.18); }

body.mortgage-tool .main-container{ padding: 0 var(--space-4) var(--space-9); }
body.mortgage-tool .container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0;
}
body.mortgage-tool .page-shell{ display:block; }

body.mortgage-tool .site-header{
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid rgba(226,232,240,.85);
}
body.mortgage-tool .nav-wrap{
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: var(--space-4);
}
body.mortgage-tool .nav-left{ display:flex; align-items:center; gap: var(--space-4); min-width:0; }
body.mortgage-tool .logo{
  display:inline-flex;
  align-items:center;
  gap: var(--space-2);
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
}

body.mortgage-tool .logo .logo-word{
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 15px;
}
body.mortgage-tool .nav-links{
  display:flex;
  gap: 2px;
  align-items:center;
  flex-wrap: wrap;
}
body.mortgage-tool .nav-links a{
  font-size: var(--fs-2);
  color: var(--text-2);
  padding: 10px 10px;
  border-radius: 999px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, text-decoration-color .15s ease;
}
body.mortgage-tool .nav-links a:hover{
  background: var(--primary-soft);
  color: var(--text);
}
body.mortgage-tool .nav-links a.active{
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(124,58,237,.55);
}
body.mortgage-tool .nav-right a{
  font-size: var(--fs-2);
  color: var(--text-2);
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(226,232,240,.90);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-xs);
  transition: background .15s ease, border-color .15s ease;
}
body.mortgage-tool .nav-right a:hover{ background: #fff; border-color: rgba(210,222,234,.95); }

body.mortgage-tool .hero.hero-intro{
  padding: var(--space-8) 0 var(--space-6);
}
body.mortgage-tool .hero-inner{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-4);
  display:flex;
  flex-direction: column;
  gap: var(--space-5);
}
body.mortgage-tool .hero-copy p{
  margin-top: var(--space-3);
  font-size: var(--fs-3);
  color: var(--text-2);
  line-height: 1.6;
  max-width: 64ch;
}
body.mortgage-tool .eyebrow{
  display:inline-flex;
  align-items:center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--fs-2);
  color: var(--muted);
  letter-spacing: .02em;
  text-transform: none;
}
body.mortgage-tool h1{
  margin-top: var(--space-2);
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}
body.mortgage-tool .beta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-left: var(--space-2);
  color: var(--primary-2);
  background: var(--primary-soft);
  border: 1px solid rgba(124,58,237,.18);
  vertical-align: middle;
}

body.mortgage-tool .trust-info-block{
  padding: var(--space-4);
}
body.mortgage-tool .trust-row{
  display:flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items:center;
}
body.mortgage-tool .trust-pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--primary-soft);
  border: 1px solid rgba(124,58,237,.14);
  color: var(--text-2);
  font-size: var(--fs-2);
  font-weight: 600;
}
body.mortgage-tool .trust-meta{
  margin-top: var(--space-3);
  font-size: var(--fs-2);
  color: var(--muted);
  line-height: 1.45;
}

body.mortgage-tool .calculator-card{
  margin-top: var(--space-4);
}
body.mortgage-tool .grid.mortgage-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

body.mortgage-tool .card{
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(226,232,240,.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
body.mortgage-tool .card-header{
  padding: 16px var(--space-5) 8px;
  background: transparent;
}
body.mortgage-tool .card-header p.small{ margin-top: var(--space-2); }
body.mortgage-tool .supporting-content-section{ margin-top: var(--space-7); }
body.mortgage-tool .support-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
body.mortgage-tool .trust-card{
  padding: var(--space-5);
}
body.mortgage-tool .trust-card p.small{ margin-top: var(--space-3); }
body.mortgage-tool .bullets{ margin-top: var(--space-3); color: var(--text-2); }
body.mortgage-tool .bullets li{ color: var(--text-2); }

body.mortgage-tool .kpi{
  padding: var(--space-5);
  display:grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
body.mortgage-tool .kpi-examples{
  grid-template-columns: 1fr;
}

body.mortgage-tool .kpi-results{
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

@media (max-width: 380px){
  body.mortgage-tool .kpi-results{
    grid-template-columns: 1fr;
  }

  body.mortgage-tool .kpi-results .v{
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

body.mortgage-tool .kpi-results .box{
  border: 0;
  border-radius: 22px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
  padding: 18px 18px 16px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

body.mortgage-tool .kpi-results .k{
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
  color: #111827;
  min-height: 0;
  display: block;
}

body.mortgage-tool .kpi-results .v{
  margin-top: auto;
  font-size: 14px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: #111827;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  min-width: 0;
}

body.mortgage-tool .v{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111827;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

body.mortgage-tool .v{
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}
body.mortgage-tool [data-example-payment]{
  font-variant-numeric: tabular-nums;
}

body.mortgage-tool .kpi-results .box{
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.14);
  min-height: 116px;
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr;
}

body.mortgage-tool #payoffTimeValue{
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

body.mortgage-tool button,
body.mortgage-tool input,
body.mortgage-tool select{
  font-family: inherit;
}
body.mortgage-tool button{
  appearance:none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  font-size: var(--fs-2);
  line-height: 1;
  cursor: pointer;
  background: rgba(255,255,255,.90);
  color: var(--text);
  border-color: rgba(226,232,240,.95);
  box-shadow: var(--shadow-xs);
  transition: transform .05s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

body.mortgage-tool .selectlike{
  width: 100%;
  min-height: var(--input-h);
  border-radius: 12px;
  border: 1px solid rgba(210,222,234,.95);
  background: rgba(255,255,255,.96);
  padding: 12px 12px;
  font-size: 15px;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

body.mortgage-tool .selectlike:hover{
  border-color: rgba(148,163,184,.85);
}

body.mortgage-tool .selectlike-caret{
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(51,65,85,.75);
  border-bottom: 2px solid rgba(51,65,85,.75);
  transform: rotate(45deg);
  flex: 0 0 auto;
}

body.mortgage-tool .selectlike-menu{
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid rgba(210,222,234,.95);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

body.mortgage-tool .selectlike-option{
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px 12px;
  font-weight: 700;
}

body.mortgage-tool .selectlike-option:hover{
  background: rgba(15,23,42,.03);
}

body.mortgage-tool .selectlike-option[aria-selected="true"]{
  background: var(--primary-soft);
}

body.mortgage-tool .selectlike{
  display: flex;
  align-items: center;
  justify-content: space-between;
  white-space: nowrap;
}

body.mortgage-tool .selectlike-value{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.mortgage-tool .selectlike-option{
  white-space: nowrap;
}

body.mortgage-tool button:hover{
  background: #ffffff;
  border-color: rgba(210,222,234,.95);
  box-shadow: 0 2px 14px rgba(15,23,42,.08);
}
body.mortgage-tool button:active{ transform: translateY(1px); }

body.mortgage-tool button#calculateBtn,
body.mortgage-tool button.primary[type="submit"],
body.mortgage-tool button.primary{
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  border: 1px solid rgba(124,58,237,.60);
  color: #ffffff;
  border-radius: 14px;
  font-weight: 800;
  position: relative;
  padding-right: 44px;
}

body.mortgage-tool button#calculateBtn:hover,
body.mortgage-tool button.primary[type="submit"]:hover,
body.mortgage-tool button.primary:hover{
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  border-color: rgba(124,58,237,.70);
}

body.mortgage-tool button#calculateBtn::after,
body.mortgage-tool button.primary[type="submit"]::after,
body.mortgage-tool button.primary::after{
  content: "";
  position: absolute;
  right: 16px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255,255,255,.92);
  border-bottom: 2px solid rgba(255,255,255,.92);
  transform: rotate(-45deg);
}

body.mortgage-tool button:disabled{
  cursor: not-allowed;
  opacity: 1;
  color: var(--muted-2);
  background: rgba(248,250,252,.95);
  border-color: rgba(226,232,240,.95);
  box-shadow: none;
}
body.mortgage-tool button#downloadCsvBtn{
  background: rgba(255,255,255,.9);
  border: 0;
  color: #111827;
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
  border-radius: 14px;
}

body.mortgage-tool button#downloadCsvBtn:hover{
  background: rgba(255,255,255,.9);
}

body.mortgage-tool button#downloadCsvBtn:disabled{
  background: rgba(255,255,255,.9);
  border: 0;
  color: rgba(17,24,39,.55);
  box-shadow: none;
}

body.mortgage-tool button:disabled:hover{ box-shadow:none; background: rgba(248,250,252,.95); }

body.mortgage-tool input,
body.mortgage-tool select{
  width: 100%;
  min-height: var(--input-h);
  border-radius: 12px;
  border: 1px solid rgba(210,222,234,.95);
  background: rgba(255,255,255,.96);
  padding: 12px 12px;
  font-size: 15px;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
body.mortgage-tool input::placeholder{
  color: rgba(100,116,139,.75);
}
body.mortgage-tool input:hover,
body.mortgage-tool select:hover{
  border-color: rgba(148,163,184,.85);
}
body.mortgage-tool input:focus,
body.mortgage-tool select:focus{
  outline: none;
  border-color: rgba(124,58,237,.55);
  box-shadow: 0 0 0 4px var(--ring);
  background: #fff;
}
body.mortgage-tool input:disabled,
body.mortgage-tool select:disabled{
  cursor: not-allowed;
  background: rgba(248,250,252,.95);
  color: rgba(71,85,105,.75);
}

body.mortgage-tool select{
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(51,65,85,.75) 50%),
    linear-gradient(135deg, rgba(51,65,85,.75) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
  -webkit-appearance: none;
  appearance: none;
}

body.mortgage-tool .input-split{
  display: block;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

body.mortgage-tool .input-split .split-addon{
  display: none;
}

body.mortgage-tool .input-split input{
  width: 100%;
}

body.mortgage-tool form#mortgageForm{
  padding: 8px var(--space-5) var(--space-5);
}
body.mortgage-tool .form-grid{
  display:flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: 2px;
}
body.mortgage-tool .field{
  display:flex;
  flex-direction: column;
}
body.mortgage-tool label{
  font-size: var(--fs-2);
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: var(--space-2);
}
body.mortgage-tool .row{
  display:grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
body.mortgage-tool #mortgageStatus{
  margin-bottom: 2px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  border: 1px solid rgba(124,58,237,.12);
  color: var(--text-2);
}
body.mortgage-tool #depositHint{ margin-top: var(--space-2); }

body.mortgage-tool .divider{
  height: 1px;
  background: rgba(226,232,240,.92);
  margin: var(--space-6) 0;
}
body.mortgage-tool .actions{
  display:flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
body.mortgage-tool .actions button{
  width: 100%;
  min-height: 48px;
}

body.mortgage-tool .disclaimer-block{
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  color: var(--muted);
}

body.mortgage-tool details.mortgage-advanced{
  margin-top: var(--space-5);
  border: 1px solid rgba(226,232,240,.95);
  border-radius: var(--radius-lg);
  background: rgba(251,252,254,.92);
  box-shadow: var(--shadow-xs);
  overflow:hidden;
}
body.mortgage-tool details.mortgage-advanced[open]{
  background: rgba(255,255,255,.94);
}
body.mortgage-tool summary.mortgage-summary{
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 14px 16px;
  font-weight: 800;
  font-size: var(--fs-2);
  color: var(--text);
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: var(--space-3);
  background: linear-gradient(180deg, rgba(124,58,237,.06), rgba(124,58,237,.03));
  border-bottom: 1px solid rgba(226,232,240,.92);
}
body.mortgage-tool summary.mortgage-summary::-webkit-details-marker{ display:none; }
body.mortgage-tool summary.mortgage-summary::after{
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(51,65,85,.85);
  border-bottom: 2px solid rgba(51,65,85,.85);
  transform: rotate(45deg);
  margin-left: auto;
  transition: transform .18s ease;
}
body.mortgage-tool details.mortgage-advanced[open] summary.mortgage-summary::after{
  transform: rotate(-135deg);
}
body.mortgage-tool details.mortgage-advanced > .form-grid{
  padding: var(--space-5);
  margin-top: 0;
}

body.mortgage-tool .results-panel#resultsPanel{
  background: #f6f9fe;
  border: 0;
  box-shadow: none;
}

body.mortgage-tool #trustNotes{
  display:flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
  color: var(--muted);
}

body.mortgage-tool #trustNotes span{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.9);
  box-shadow: 0 10px 30px rgba(15,23,42,.08);
  font-weight: 650;
  font-size: 12px;
  color: #111827;
}

body.mortgage-tool .results-panel .actions{
  padding: 0 var(--space-5) var(--space-5);
  margin-top: 0;
}
body.mortgage-tool .results-panel .divider{
  margin: 0 var(--space-5) var(--space-5);
}

body.mortgage-tool #scheduleWrap{
  padding: 0 var(--space-5) var(--space-5);
}
body.mortgage-tool .mortgage-table-wrap{
  border-radius: var(--radius-lg);
  border: 1px solid rgba(226,232,240,.95);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-xs);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
body.mortgage-tool table.mortgage-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 860px;
  font-size: 13px;
  color: var(--text-2);
}
body.mortgage-tool table.mortgage-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(248,250,252,.98), rgba(241,245,249,.98));
  color: var(--text);
  font-weight: 800;
  text-align: left;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(226,232,240,.95);
  white-space: nowrap;
}
body.mortgage-tool table.mortgage-table tbody td{
  padding: 11px 12px;
  border-bottom: 1px solid rgba(226,232,240,.75);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
body.mortgage-tool table.mortgage-table tbody tr:nth-child(odd) td{
  background: rgba(15,23,42,.015);
}
body.mortgage-tool table.mortgage-table tbody tr:hover td{
  background: rgba(124,58,237,.06);
}
body.mortgage-tool table.mortgage-table tbody tr:last-child td{
  border-bottom: none;
}

body.mortgage-tool :where(button, input, select){ -webkit-tap-highlight-color: transparent; }
body.mortgage-tool :where(button).primary{ letter-spacing: .01em; }
body.mortgage-tool :where(.card-header h2){ font-weight: 850; }
body.mortgage-tool :where(.card-header h2, h3){ color: var(--text); }
body.mortgage-tool :where(.card-header p.small){ max-width: 72ch; }

@media (min-width: 520px){
  body.mortgage-tool .kpi-examples{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.mortgage-tool .kpi-results{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.mortgage-tool .actions{ flex-direction: row; flex-wrap: wrap; }
  body.mortgage-tool .actions button{ width: auto; flex: 1 1 160px; }
  body.mortgage-tool .row{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px){
  body.mortgage-tool{
    --container: 1180px;
  }
  body.mortgage-tool .hero-inner{
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-6);
  }
  body.mortgage-tool .trust-info-block{ max-width: 420px; margin-top: 0; }
  body.mortgage-tool .grid.mortgage-grid{
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  body.mortgage-tool .kpi-examples{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.mortgage-tool .support-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.mortgage-tool .results-panel#resultsPanel{
    position: static;
    top: auto;
  }
}

@media (min-width: 1024px){
  body.mortgage-tool{
    --container: 1240px;
    --input-h: 52px;
  }
  body.mortgage-tool .main-container{ padding-bottom: 56px; }
  body.mortgage-tool .card-header{ padding: var(--space-6); }
  body.mortgage-tool form#mortgageForm{ padding: 14px var(--space-6) var(--space-6); }
  body.mortgage-tool .kpi{ padding: var(--space-6); gap: var(--space-4); }
  body.mortgage-tool .kpi-examples{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.mortgage-tool .kpi-results{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.mortgage-tool .results-panel .actions{ padding: 0 var(--space-6) var(--space-6); }
  body.mortgage-tool .results-panel .divider{ margin: 0 var(--space-6) var(--space-6); }
  body.mortgage-tool #scheduleWrap{ padding: 0 var(--space-6) var(--space-6); }
}

@media (prefers-reduced-motion: reduce){
  body.mortgage-tool *{ transition: none !important; scroll-behavior: auto !important; }
}

body.mortgage-tool .kpi-examples .box{
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
  padding: 16px;
}

body.mortgage-tool .kpi-examples .k{
  margin: 0;
}

body.mortgage-tool .kpi-examples [data-example-payment]{
  display: none;
}

body.mortgage-tool .kpi-examples button.primary{
  margin-top: auto;
  width: 100%;
  min-height: 42px;
}

@media (max-width: 700px){
  body.mortgage-tool .site-footer{
    border-top: 1px solid rgba(226,232,240,.95);
    margin-top: 40px;
    padding: 26px 0 40px;
    background: #f6f9fe;
  }

  body.mortgage-tool .footer-inner{
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    flex-wrap: wrap;
  }

  body.mortgage-tool .footer-tag{
    margin-top: 10px;
    color: #64748b;
  }

  body.mortgage-tool .footer-links{
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  body.mortgage-tool .footer-links a{
    font-size: 14px;
    color: #334155;
  }

  body.mortgage-tool .footer-links a:hover{
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: rgba(124,58,237,.55);
  }
}

@media (max-width: 700px){
  body.mortgage-tool{
    --space-5: 16px;
    --space-6: 20px;
    --space-7: 24px;
    --space-8: 28px;
    --space-9: 32px;

    --radius-lg: 14px;
    --radius: 12px;

    --shadow-xs: 0 1px 2px rgba(15,23,42,.05);
    --shadow-sm: 0 2px 10px rgba(15,23,42,.05);
  }

  body.mortgage-tool .main-container{
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 28px;
  }

  body.mortgage-tool .hero.hero-intro{
    padding: 22px 0 14px;
  }

  body.mortgage-tool .hero-inner{
    padding: 0 var(--space-4);
    gap: 14px;
  }

  body.mortgage-tool .hero-copy p{
    margin-top: 10px;
    line-height: 1.5;
  }

  body.mortgage-tool .trust-info-block{
    padding: 12px;
    border-radius: var(--radius-lg);
  }

  body.mortgage-tool .trust-row{
    gap: 8px;
  }

  body.mortgage-tool .trust-pill{
    padding: 6px 10px;
    border-radius: 12px;
  }

  body.mortgage-tool .trust-meta{
    margin-top: 10px;
    line-height: 1.4;
  }

  body.mortgage-tool main.container{
    padding: 0 var(--space-4) var(--space-6);
  }

  body.mortgage-tool .grid.mortgage-grid{
    gap: 14px;
  }

  body.mortgage-tool .card{
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }

  body.mortgage-tool .card-header{
    padding: 14px 16px 8px;
  }

  body.mortgage-tool form#mortgageForm{
    padding: 8px 16px 16px;
  }

  body.mortgage-tool .form-grid{
    gap: 12px;
    margin-top: 12px;
  }

  body.mortgage-tool label{
    margin-bottom: 6px;
  }

  body.mortgage-tool input,
  body.mortgage-tool select{
    min-height: 48px;
    border-radius: 12px;
  }

  body.mortgage-tool .divider{
    margin: 16px 0;
  }

  body.mortgage-tool .actions{
    gap: 10px;
    margin-top: 14px;
  }

  body.mortgage-tool details.mortgage-advanced{
    border-radius: var(--radius-lg);
  }

  body.mortgage-tool summary.mortgage-summary{
    padding: 12px 14px;
  }

  body.mortgage-tool details.mortgage-advanced > .form-grid{
    padding: 16px;
  }

  body.mortgage-tool .kpi{
    padding: 16px;
    gap: 12px;
  }

  body.mortgage-tool .kpi-results{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.mortgage-tool .kpi-results .box{
    padding: 10px 12px;
    min-height: 0;
    gap: 6px;
    grid-template-rows: auto auto;
    align-content: start;
  }

  body.mortgage-tool .kpi-results .v{
    margin-top: 0;
  }

  body.mortgage-tool .kpi-results .box:nth-child(1){
    grid-column: 1 / -1;
    border: 1px solid rgba(124,58,237,.18);
    box-shadow: 0 10px 30px rgba(124,58,237,.10), 0 8px 22px rgba(15,23,42,.06);
  }

  body.mortgage-tool .kpi-results .k{
    font-size: 12.5px;
    line-height: 1.25;
  }

  body.mortgage-tool .kpi-results .v{
    font-size: 15px;
    line-height: 1.15;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  body.mortgage-tool .kpi-results .box:nth-child(1) .v{
    font-size: 18px;
  }

  body.mortgage-tool .results-panel .actions{
    padding: 12px 16px 16px;
  }

  body.mortgage-tool .results-panel .divider{
    display: none;
  }

  body.mortgage-tool #scheduleWrap{
    padding: 0 16px 16px;
  }

  body.mortgage-tool .supporting-content-section{
    margin-top: 22px;
  }

  body.mortgage-tool .support-grid{
    gap: 14px;
  }

  body.mortgage-tool .trust-card{
    padding: 16px;
  }

  body.mortgage-tool .row{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  body.mortgage-tool .field{
    min-width: 0;
  }

  body.mortgage-tool .helper,
  body.mortgage-tool .small{
    margin-top: 6px;
    line-height: 1.45;
  }

  body.mortgage-tool .input-split{
    display: grid;
    align-items: stretch;
    border-radius: 12px;
    border: 1px solid rgba(210,222,234,.95);
    background: rgba(255,255,255,.96);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  }

  body.mortgage-tool .input-split[data-split="currency"]{
    grid-template-columns: auto 1fr;
  }

  body.mortgage-tool .input-split:not([data-split="currency"]){
    grid-template-columns: 1fr auto;
  }

  body.mortgage-tool .input-split:focus-within{
    border-color: rgba(124,58,237,.55);
    box-shadow: 0 0 0 4px var(--ring);
    background: #fff;
  }

  body.mortgage-tool .input-split .split-addon{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    font-weight: 800;
    color: #0f172a;
    background: rgba(15,23,42,.03);
    white-space: nowrap;
  }

  body.mortgage-tool .input-split[data-split="currency"] .split-addon{
    min-width: 52px;
  }

  body.mortgage-tool .input-split input{
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    min-height: 48px;
    padding: 12px 12px;
  }

  body.mortgage-tool .input-split input:focus{
    outline: none;
    box-shadow: none;
  }
}

@media (max-width: 420px){
  body.mortgage-tool .kpi-results{
    grid-template-columns: 1fr;
  }

  body.mortgage-tool .kpi-results .box:nth-child(1){
    grid-column: auto;
  }
}

@media (max-width: 700px){
  body.mortgage-tool #resultsPanel{
    display: none;
  }

  body.mortgage-tool.has-results #resultsPanel{
    display: block;
  }
}

@media (max-width: 700px){
  body.mortgage-tool #instantExamples .card-header{
    padding-bottom: 14px;
  }

  body.mortgage-tool .kpi.kpi-examples{
    gap: 14px;
  }

  body.mortgage-tool .kpi-examples .box{
    padding: 14px;
    gap: 10px;
  }

  body.mortgage-tool .kpi-examples .ex-amount{
    font-size: 17px;
  }

  body.mortgage-tool .kpi-examples button.primary{
    min-height: 40px;
  }
}