:root {
  --ink: #091b36;
  --muted: #5f6d82;
  --blue: #0871e9;
  --sky: #2d9bf4;
  --pale: #eef6ff;
  --line: #d9e1eb;
  --paper: #fff;
  --soft: #f5f7f9;
  --coral: #ff7669;
  --green: #53d9a0;
  --gold: #ffc74e;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f4f6f8;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: #f4f6f8; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.page {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto 56px;
}
.breadcrumbs {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8793a4;
  font-size: 11px;
}
.breadcrumbs a { color: #64748a; text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue); }

.hero {
  min-height: 250px;
  padding: 46px 50px;
  border: 1px solid #dce5ef;
  border-radius: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  align-items: center;
  gap: 50px;
  background:
    radial-gradient(circle at 94% 10%, rgba(40, 146, 255, .19), transparent 27rem),
    linear-gradient(116deg, #fff5f1, #f4f7ff 67%, #e8f3ff);
  overflow: hidden;
}
.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}
.hero h1 {
  max-width: 850px;
  margin: 12px 0 12px;
  font-size: clamp(38px, 5vw, 64px);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.055em;
}
.hero > div > p:last-child {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.52;
}
.hero-points {
  margin: 0;
  padding: 22px;
  border: 1px solid rgba(9,27,54,.08);
  border-radius: 24px;
  display: grid;
  gap: 0;
  list-style: none;
  background: rgba(255,255,255,.74);
  box-shadow: 0 22px 55px rgba(9,27,54,.08);
}
.hero-points li {
  min-height: 48px;
  padding: 0 0 0 24px;
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(9,27,54,.08);
  color: #233753;
  font-size: 14px;
  font-weight: 500;
}
.hero-points li:last-child { border-bottom: 0; }
.hero-points li::before {
  width: 9px;
  height: 9px;
  position: absolute;
  left: 2px;
  border-radius: 50%;
  background: var(--sky);
  content: "";
}

.calculator-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(390px, 2fr);
  gap: 22px;
  align-items: start;
}
.input-card,
.result-card,
.scenarios,
.explanation,
.seo-content {
  min-width: 0;
  border-radius: 30px;
}
.input-card {
  padding: 32px;
  border: 1px solid #e0e5ec;
  display: grid;
  gap: 18px;
  background: #eceef1;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.card-head h2 {
  margin: 7px 0 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.035em;
}
.reset-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #cad4e0;
  border-radius: 999px;
  color: #526178;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.reset-button:hover { border-color: #8cc5ff; color: #0865c6; }

.settings-group {
  padding: 20px;
  border: 1px solid #d9e2ec;
  border-radius: 22px;
  background: #fff;
}
.settings-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.settings-head > span {
  min-width: 34px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #0869c7;
  background: #e8f3ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
}
.settings-head h3 {
  margin: 1px 0 0;
  color: #0b203f;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}
.settings-head p {
  margin: 4px 0 0;
  color: #66758a;
  font-size: 11px;
  line-height: 1.4;
}
.fields {
  margin-top: 18px;
  display: grid;
  align-items: start;
  gap: 18px 14px;
}
.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { min-width: 0; }
.field-head {
  min-height: 31px;
  margin-bottom: 7px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.field-head label {
  color: #112540;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.22;
}
.field-head span {
  max-width: 45%;
  color: #68768a;
  font-size: 10px;
  line-height: 1.22;
  text-align: right;
}
.input-shell {
  height: 58px;
  position: relative;
  border: 1px solid #d0d8e3;
  border-radius: 16px;
  display: flex;
  align-items: center;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input-shell:focus-within {
  border-color: var(--sky);
  box-shadow: 0 0 0 4px rgba(45,155,244,.12);
}
.input-shell input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 44px 0 16px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: clamp(16px, 1.7vw, 20px);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.input-shell i {
  position: absolute;
  right: 16px;
  color: #617084;
  font-size: 15px;
  font-style: normal;
  font-weight: 500;
  pointer-events: none;
}
.range {
  width: 100%;
  height: 18px;
  margin: 6px 0 0;
  padding: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg,var(--sky) var(--range-progress,10%),#30343b var(--range-progress,10%)); }
.range::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -6px; border: 0; border-radius: 50%; appearance: none; background: var(--sky); box-shadow: 0 3px 10px rgba(45,155,244,.3); }
.range::-moz-range-track { height: 4px; border-radius: 999px; background: #30343b; }
.range::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--sky); }
.range::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--sky); }
.range-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #68768a;
  font-size: 9px;
}
.range-meta strong { color: #1a2d48; font-weight: 500; font-variant-numeric: tabular-nums; }
.preset-row {
  margin-top: 9px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.preset-row button {
  min-height: 38px;
  border: 1px solid #d3dce8;
  border-radius: 11px;
  color: #526077;
  background: #fff;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.preset-row button[aria-pressed="true"] {
  border-color: #2998ff;
  color: #075fc7;
  background: #eaf4ff;
  box-shadow: inset 0 0 0 1px rgba(41,152,255,.16);
}
.reserve-field .input-shell { background: #fffaf2; }
.inline-note {
  margin: 14px 0 0;
  padding: 11px 13px;
  border-left: 2px solid var(--gold);
  color: #68768a;
  background: #fff9e9;
  font-size: 10px;
  line-height: 1.45;
}

.result-card {
  padding: 30px;
  position: sticky;
  top: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0, rgba(54,157,255,.27), transparent 34%),
    linear-gradient(145deg,#071c3b,#0c3768);
  box-shadow: 0 22px 60px rgba(8,31,66,.2);
  font-variant-numeric: tabular-nums;
}
.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.result-kicker {
  margin: 0;
  color: #aebfd3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}
.result-state {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(117,203,255,.38);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #c9e9ff;
  background: rgba(45,155,244,.12);
  font-size: 9px;
  font-weight: 500;
  white-space: nowrap;
}
.result-card.is-ready .result-state { border-color: rgba(83,217,160,.48); color: #9ff0ca; background: rgba(83,217,160,.12); }
.result-card h2 {
  margin: 24px 0 3px;
  color: #c8d5e5;
  font-size: 15px;
  font-weight: 500;
}
.result-value {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(42px, 5vw, 66px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.045em;
}
.result-card.is-ready .result-value { color: #83e8bb; }
.result-copy { margin: 12px 0 0; color: #b6c5d6; font-size: 12px; line-height: 1.45; }
.target-warning { margin: 10px 0 0; padding: 10px 12px; border-left: 2px solid var(--gold); color: #ffe2a2; background: rgba(255,199,78,.12); font-size: 10px; line-height: 1.4; }
.target-warning[hidden] { display: none; }
.progress-block { margin-top: 24px; }
.progress-head { margin-bottom: 8px; display: flex; justify-content: space-between; gap: 12px; color: #b6c5d6; font-size: 10px; }
.progress-head strong { color: #fff; font-weight: 500; }
.progress-track { height: 9px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.13); }
.progress-track span { width: 0; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,var(--sky),#71c3ff); transition: width .2s ease; }
.result-card.is-ready .progress-track span { background: linear-gradient(90deg,#39c98d,#82ebbd); }
.result-metrics { margin: 22px 0 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.result-metrics div { min-width: 0; padding: 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.065); }
.result-metrics dt { color: #aebfd3; font-size: 9px; line-height: 1.25; }
.result-metrics dd { margin: 5px 0 0; overflow-wrap: anywhere; color: #fff; font-size: 15px; font-weight: 500; line-height: 1.1; }
.time-card { margin-top: 10px; padding: 14px; border-left: 2px solid var(--gold); background: rgba(255,199,78,.12); }
.time-card span, .time-card strong, .time-card small { display: block; }
.time-card span { color: #c8d4e2; font-size: 9px; }
.time-card strong { margin-top: 4px; font-size: 20px; font-weight: 500; }
.time-card small { margin-top: 4px; color: #aebfd3; font-size: 9px; }
.result-card.is-ready .time-card { border-left-color: var(--green); background: rgba(83,217,160,.11); }
.mortgage-summary { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); }
.mortgage-summary p { margin: 0 0 8px; color: #c7d3e1; font-size: 10px; }
.mortgage-summary p strong { color: #fff; }
.mortgage-summary > div { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid rgba(255,255,255,.09); }
.mortgage-summary > div:last-child { border-bottom: 0; }
.mortgage-summary span { color: #aebfd3; font-size: 10px; }
.mortgage-summary strong { max-width: 57%; overflow-wrap: anywhere; color: #fff; font-size: 13px; font-weight: 500; text-align: right; }
.primary-cta {
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  padding: 0 20px;
  border: 1px solid rgba(126,205,255,.55);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #0b7ee9;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}
.primary-cta:hover { background: #1591f4; }
.result-disclaimer { margin: 12px 0 0; color: #9fb1c6; font-size: 9px; line-height: 1.4; text-align: center; }

.scenarios,
.explanation,
.seo-content {
  margin-top: 24px;
  padding: 38px;
  border: 1px solid #e0e5ec;
  background: #fff;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}
.section-head h2,
.content-intro h2,
.content-columns h2,
.limits-note h2,
.faq h2 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -.04em;
}
.section-head > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.scenario-grid { margin-top: 26px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.scenario-card { min-width: 0; padding: 20px; border: 1px solid #dce3ec; border-radius: 20px; background: #f7f9fb; }
.scenario-card.is-target { border-color: #82c4ff; background: #eef7ff; box-shadow: inset 0 0 0 1px rgba(45,155,244,.12); }
.scenario-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scenario-card h3 { margin: 0; font-size: 24px; font-weight: 700; }
.scenario-card header span { min-height: 28px; padding: 0 9px; border-radius: 999px; display: inline-flex; align-items: center; color: #637187; background: #e7ebf0; font-size: 9px; }
.scenario-card.is-target header span { color: #0865c6; background: #dcedff; }
.scenario-readiness { margin: 14px 0; padding: 11px 12px; border-left: 2px solid var(--coral); color: #7a433d; background: #fff0ed; font-size: 11px; line-height: 1.35; }
.scenario-readiness.is-enough { border-left-color: var(--green); color: #247352; background: #e9fbf3; }
.scenario-card dl { margin: 0; }
.scenario-card dl div { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid #e1e6ec; }
.scenario-card dl div:last-child { border-bottom: 0; }
.scenario-card dt { color: #68768a; font-size: 10px; }
.scenario-card dd { margin: 0; max-width: 58%; overflow-wrap: anywhere; color: #172b47; font-size: 12px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.scenario-card button { width: 100%; min-height: 42px; margin-top: 14px; border: 1px solid #a9c9ec; border-radius: 12px; color: #0967c8; background: #fff; font-size: 11px; font-weight: 500; cursor: pointer; }
.scenario-card button:hover { border-color: var(--sky); background: #eaf5ff; }

.explanation { background: #f8fafc; }
.formula-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.formula-grid article { min-width: 0; padding: 19px; border: 1px solid #dce3ec; border-radius: 18px; background: #fff; }
.formula-grid article > span { width: 32px; height: 24px; display: inline-grid; place-items: center; border-radius: 999px; color: #0967c8; background: #e8f3ff; font-size: 9px; font-weight: 700; }
.formula-grid h3 { margin: 15px 0 7px; font-size: 15px; font-weight: 700; }
.formula-grid p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.seo-content { padding: 42px; }
.content-intro { max-width: 940px; }
.content-intro > p:last-child { margin: 16px 0 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.content-columns { margin-top: 32px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.content-columns section { padding: 24px; border: 1px solid #dfe5ec; border-radius: 20px; background: #f8fafc; }
.content-columns h2 { font-size: 22px; }
.content-columns p { margin: 13px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.limits-note { margin-top: 24px; padding: 24px; border-left: 3px solid var(--gold); display: grid; grid-template-columns: minmax(260px,.6fr) minmax(0,1.4fr); gap: 30px; background: #fff9ea; }
.limits-note h2 { font-size: 22px; }
.limits-note > p { margin: 0; color: #616d7e; font-size: 13px; line-height: 1.65; }
.faq { margin-top: 38px; padding-top: 34px; border-top: 1px solid #dfe5ec; }
.faq h2 { margin-bottom: 18px; }
.faq details { border-bottom: 1px solid #dfe5ec; }
.faq summary { padding: 18px 0; color: #152a46; font-size: 14px; font-weight: 500; cursor: pointer; }
.faq details p { max-width: 930px; margin: 0; padding: 0 0 17px; color: var(--muted); font-size: 13px; line-height: 1.6; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible { outline: 3px solid rgba(45,155,244,.28); outline-offset: 2px; }

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-points { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .hero-points li { min-height: 38px; border-bottom: 0; border-right: 1px solid rgba(9,27,54,.08); }
  .hero-points li:last-child { border-right: 0; }
  .calculator-grid { grid-template-columns: 1fr; }
  .result-card { position: relative; top: auto; }
  .formula-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .page { width: min(100% - 24px, 1320px); margin-bottom: 32px; }
  .hero { min-height: auto; padding: 28px 22px; border-radius: 26px; }
  .hero h1 { font-size: clamp(34px, 10vw, 46px); }
  .hero > div > p:last-child { font-size: 15px; }
  .hero-points { padding: 10px; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .hero-points li { min-height: 52px; padding: 0 7px; justify-content: center; border-right: 1px solid rgba(9,27,54,.08); border-bottom: 0; font-size: 10px; line-height: 1.25; text-align: center; }
  .hero-points li::before { display: none; }
  .hero-points li:last-child { border-right: 0; }
  .calculator-grid { gap: 12px; }
  .input-card { display: contents; }
  .input-card > .card-head { order: 1; padding: 18px; border: 1px solid #e0e5ec; border-radius: 22px; background: #eceef1; }
  .input-card > .settings-group:nth-of-type(1) { order: 2; }
  .input-card > .settings-group:nth-of-type(2) { order: 3; }
  .result-card { order: 4; }
  .input-card > .settings-group:nth-of-type(3) { order: 5; }
  .card-head h2 { font-size: 24px; }
  .settings-group { padding: 16px; border-radius: 18px; }
  .two-cols, .three-cols { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .three-cols .field:last-child { grid-column: 1 / -1; }
  .field-head { min-height: auto; }
  .field-head span { display: none; }
  .input-shell input { padding-left: 12px; font-size: 16px; }
  .input-shell i { right: 12px; font-size: 13px; }
  .result-card { padding: 24px 20px; border-radius: 24px; }
  .result-top { align-items: flex-start; }
  .result-state { max-width: 145px; white-space: normal; text-align: center; }
  .result-value { font-size: clamp(40px, 13vw, 56px); }
  .result-metrics { grid-template-columns: 1fr 1fr; }
  .scenarios, .explanation, .seo-content { padding: 24px 18px; border-radius: 24px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .scenario-grid { grid-template-columns: 1fr; }
  .formula-grid { grid-template-columns: 1fr; }
  .content-columns { grid-template-columns: 1fr; }
  .limits-note { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 420px) {
  .page { width: min(100% - 16px, 1320px); }
  .breadcrumbs { padding-inline: 4px; }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 35px; }
  .input-card { padding: 12px; }
  .settings-group { padding: 14px; }
  .result-card { padding: 22px 18px; }
  .result-metrics { grid-template-columns: 1fr; }
  .result-value { font-size: 40px; }
}

@media print {
  body { background: #fff; }
  .calculator-global-header, .breadcrumbs, .reset-button, .primary-cta { display: none !important; }
  .page { width: 100%; }
  .hero, .input-card, .result-card, .scenarios, .explanation, .seo-content { box-shadow: none; break-inside: avoid; }
  .result-card { position: static; background: #0b2f5a !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
