.tool-page {
  background: #ffffff;
  color: #223746;
  padding: 104px 0 56px;
}

.tool-page .container {
  max-width: 1040px;
}

.tool-heading {
  margin-bottom: 26px;
}

.tool-heading h1 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.15;
  color: #2f3d4a;
  letter-spacing: 0;
  margin-bottom: 18px;
}

.tool-heading .subtitle {
  color: #000;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.45;
  margin-bottom: 26px;
}

.updated {
  color: #000;
  font-size: 0.88rem;
  font-weight: 800;
}

.mh-card {
  background: #fff;
  border: 1px solid #eef0f2;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px);
}

.mh-card.narrow {
  max-width: 560px;
}

.mh-card.medium {
  max-width: 680px;
}

.mh-card.wide {
  max-width: 940px;
}

.calc-title {
  color: #000;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.12;
  text-align: center;
  margin-bottom: 30px;
  letter-spacing: 0;
}

.small-title {
  font-size: clamp(1.65rem, 3vw, 2rem);
  color: #243746;
}

.blue-rule {
  width: min(150px, 35%);
  height: 1px;
  margin: 0 auto 30px;
  background: #3b82f6;
}

.simple-rows {
  display: grid;
  gap: 0;
}

.simple-row {
  display: grid;
  grid-template-columns: minmax(145px, 1fr) minmax(150px, 190px) 24px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #fff0d9;
  padding: 6px 0;
  color: #58636e;
  font-size: 1.28rem;
}

.simple-row input,
.simple-row output,
.soft-input {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: #f1f4f7;
  color: #243746;
  font: inherit;
  padding: 10px 14px;
}

.simple-row output {
  display: flex;
  align-items: center;
}

.unit {
  color: #2563eb;
  font-size: 1.1rem;
}

.button-primary {
  min-height: 48px;
  border: 2px solid #000;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 34px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 56px;
  align-items: center;
}

.field {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
  color: #000;
  font-size: 1rem;
}

.field label {
  color: #000;
}

.boxed-input {
  display: flex;
  align-items: center;
  border: 1px solid #1f2d3a;
  border-radius: 4px;
  overflow: hidden;
  min-height: 38px;
  background: #fff;
}

.boxed-input span {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-width: 40px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  border-right: 1px solid #1f2d3a;
}

.boxed-input span.suffix {
  border-left: 1px solid #1f2d3a;
  border-right: 0;
}

.boxed-input input,
.plain-box {
  width: 100%;
  border: 0;
  color: #000;
  font-weight: 800;
  font-size: 1rem;
  padding: 8px 10px;
  background: #fff;
}

.plain-box {
  border: 1px solid #1f2d3a;
  min-height: 38px;
  text-align: center;
}

.center-control {
  grid-column: 1 / -1;
  justify-self: center;
}

.blue-panel {
  background: #2563eb;
  color: #fff;
  padding: 22px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.blue-panel h2 {
  color: #fff;
}

.blue-panel strong {
  display: block;
  color: #fff;
  font-size: 1.55rem;
  margin: 8px 0 22px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.summary-grid div {
  font-weight: 800;
  font-size: 1.45rem;
}

.summary-grid span {
  display: block;
  color: #58636e;
  font-size: 0.95rem;
  font-weight: 400;
  margin-top: 4px;
}

.loan-results {
  margin-top: 38px;
  border-top: 1px solid #eef0f2;
  padding-top: 22px;
}

.loan-hero {
  background: #2563eb;
  color: #fff;
  text-align: center;
  padding: 22px;
  margin-bottom: 18px;
}

.loan-hero output {
  display: block;
  font-size: 2rem;
  font-weight: 800;
}

.chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  align-items: end;
  height: 230px;
  border-bottom: 1px solid #243746;
  margin: 26px auto 30px;
  max-width: 760px;
}

.bar {
  display: grid;
  align-items: end;
  height: 100%;
  gap: 8px;
  text-align: center;
  font-size: 0.8rem;
}

.bar-fill {
  background: #2563eb;
  min-height: 2px;
  position: relative;
}

.bar-fill::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: var(--interest, 20%);
  background: #bfdbfe;
}

.amort-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.amort-table caption {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 20px 0;
  color: #000;
}

.amort-table th,
.amort-table td {
  padding: 10px;
  border-bottom: 1px solid #2563eb;
  text-align: right;
}

.amort-table th:first-child,
.amort-table td:first-child {
  text-align: center;
}

.amort-table thead {
  background: #eff6ff;
}

.amort-table tbody tr:nth-child(even) {
  background: #f8fbff;
}

.two-column-calc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.column-title {
  background: #2563eb;
  color: #fff;
  text-align: center;
  padding: 9px;
  font-weight: 800;
  font-size: 1.22rem;
  margin-bottom: 16px;
}

.net-row {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 138px);
  gap: 12px;
  align-items: center;
  margin-bottom: 11px;
  color: #58636e;
  font-weight: 700;
}

.total-box {
  background: #2563eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  color: #fff;
  font-weight: 800;
  margin-top: 24px;
}

.total-box output {
  font-size: 1.55rem;
}

.net-worth-total {
  margin-top: 42px;
  text-align: center;
  color: #58636e;
  font-size: 1.55rem;
  font-weight: 800;
}

.net-worth-total output {
  color: #58636e;
  font-size: 2rem;
}

.comparison-layout {
  display: grid;
  gap: 16px;
  justify-items: center;
}

.comparison-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 44px;
  width: 100%;
  max-width: 540px;
  align-items: center;
}

.comparison-top .line {
  display: grid;
  grid-template-columns: 1fr 126px;
  gap: 12px;
  align-items: center;
  color: #000;
}

.big-rate {
  width: min(212px, 100%);
  border: 1px solid #1f2d3a;
  text-align: center;
  font-size: 2.35rem;
  font-weight: 900;
  padding: 10px;
}

.radio-lines {
  display: grid;
  gap: 10px;
  color: #243746;
  font-weight: 800;
}

.radio-lines label {
  display: flex;
  gap: 12px;
  align-items: center;
}

.radio-lines input {
  width: 26px;
  height: 26px;
  accent-color: #111;
}

.mortgage-block {
  background: #fafafa;
  padding: 18px;
  margin-top: 18px;
}

.mortgage-block h3 {
  color: #58636e;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.mortgage-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.mortgage-field {
  display: grid;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #58636e;
}

.mortgage-field input {
  min-height: 36px;
  border: 1px solid #edf0f3;
  padding: 8px 12px;
}

.blue-result,
.blue-strong-result {
  min-height: 102px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #58636e;
  font-weight: 800;
  padding: 16px;
}

.blue-result {
  background: #dff0ff;
}

.blue-strong-result {
  background: #2563eb;
  color: #fff;
}

.blue-result output,
.blue-strong-result output {
  display: block;
  font-size: 1.45rem;
  margin-top: 8px;
}

.stepper-field {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
}

.stepper-field button {
  background: #2563eb;
  color: #fff;
  font-weight: 800;
}

.bmi-card {
  max-width: 560px;
  font-family: Georgia, 'Times New Roman', serif;
}

.bmi-card .calc-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2rem;
}

.avatar-row,
.toggle-row {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin-bottom: 22px;
}

.avatar-choice {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #000;
  font-family: Inter, sans-serif;
  font-size: 0.9rem;
}

.avatar {
  width: 82px;
  height: 82px;
  border: 5px solid #2563eb;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2.8rem;
  background: #eff6ff;
}

.segmented {
  display: inline-flex;
  border: 1px solid #2563eb;
  border-radius: 3px;
  overflow: hidden;
  font-family: Inter, sans-serif;
}

.segmented button {
  padding: 6px 13px;
  color: #7b8794;
  background: #fff;
}

.segmented button.active {
  color: #fff;
  background: #2563eb;
  font-weight: 800;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 12px;
  align-items: center;
  margin: 28px 0;
}

.range-row input[type='range'] {
  accent-color: #2563eb;
}

.range-value {
  border: 1px solid #000;
  border-radius: 6px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: Inter, sans-serif;
}

.bmi-result {
  text-align: center;
  color: #243746;
  font-family: Inter, sans-serif;
  font-weight: 800;
  margin-top: 16px;
  min-height: 26px;
}

@media (max-width: 760px) {
  .tool-page {
    padding-top: 84px;
  }

  .form-grid,
  .two-column-calc,
  .comparison-top,
  .mortgage-row {
    grid-template-columns: 1fr;
  }

  .simple-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .unit {
    justify-self: end;
  }

  .field,
  .comparison-top .line,
  .net-row {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .chart {
    gap: 8px;
    height: 180px;
  }
}
