[data-calculator-root] .calculator-tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

[data-calculator-root] .calculator-tabs button {
  flex: 1 1 auto;
}

[data-calculator-root] [role="tabpanel"] {
  scroll-margin-top: 145px;
}

.calculator-panel--overpayment {
  align-items: start;
}

.overpayment-inputs {
  min-width: 0;
}

.refinance-group {
  min-width: 0;
  margin-top: 1.5rem;
  padding: 0;
  border: 0;
}

.refinance-group legend {
  color: #0b1720;
  font-size: 0.95rem;
  font-weight: 650;
}

.refinance-group .refinance-fields {
  margin-top: 0.7rem;
}

.overpayment-intro {
  margin-top: 1rem;
  color: #52606b;
  font-size: 0.9rem;
  line-height: 1.75;
}

.overpayment-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 1rem;
  margin-top: 1.75rem;
}

.overpayment-fields .form-label {
  min-height: 2.8em;
  display: flex;
  align-items: flex-end;
}

.overpayment-fields .form-input {
  min-width: 0;
}

.overpayment-monthly {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.overpayment-monthly .calculator-amount-control {
  grid-template-columns: minmax(0, 1fr) minmax(8.5rem, 0.7fr);
  margin-top: 0.7rem;
}

.overpayment-assumptions summary {
  cursor: pointer;
  color: #0b1720;
  font-weight: 650;
}

.overpayment-result {
  min-width: 0;
  min-height: auto;
  justify-content: flex-start;
}

.overpayment-result .calculator-disclaimer {
  color: rgb(255 255 255 / 70%);
  font-size: 0.78rem;
  line-height: 1.65;
}

.overpayment-result > strong {
  font-size: clamp(1.9rem, 3.3vw, 2.8rem);
  line-height: 1.15;
}

.overpayment-savings {
  display: grid;
  gap: 0.45rem;
  margin-top: 1.65rem;
}

.overpayment-savings > span {
  color: rgb(255 255 255 / 65%);
  font-size: 0.85rem;
}

.overpayment-savings > b {
  font-size: 1.7rem;
  line-height: 1.2;
  font-weight: 600;
}

.overpayment-result .calculator-result__rows p {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.overpayment-status {
  margin-top: 1rem;
  color: #f7edc8;
  font-size: 0.8rem;
  line-height: 1.6;
}

.overpayment-status[hidden] {
  display: none;
}

.overpayment-comparison {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 0.75rem;
}

.overpayment-comparison table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
}

.overpayment-comparison caption {
  margin-bottom: 1rem;
  text-align: left;
  color: #0b1720;
  font-size: 1rem;
  font-weight: 650;
}

.overpayment-comparison th,
.overpayment-comparison td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: right;
  overflow-wrap: anywhere;
}

.overpayment-comparison th:first-child {
  text-align: left;
}

.overpayment-comparison thead {
  background: #f1f3ef;
  color: #52606b;
}

.overpayment-comparison tbody th {
  font-weight: 500;
  color: #52606b;
}

.overpayment-comparison td:last-child {
  font-weight: 650;
  color: #0b1720;
}

.overpayment-comparison > p {
  margin-top: 0.8rem;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.5;
}

@media (max-width: 639px) {
  [data-calculator-root] [role="tabpanel"] {
    scroll-margin-top: 96px;
  }

  [data-calculator-root] .calculator-tabs {
    width: 100%;
    flex-direction: column;
  }

  [data-calculator-root] .calculator-tabs button {
    min-height: 44px;
  }

  .overpayment-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .overpayment-fields .form-label {
    min-height: 0;
  }

  .overpayment-monthly .calculator-amount-control {
    grid-template-columns: minmax(0, 1fr);
  }

  .overpayment-comparison th,
  .overpayment-comparison td {
    padding: 0.7rem 0.4rem;
    font-size: 0.72rem;
  }
}
