/* Mortgage payment calculator: keep styles consistent with global.css */

.sameRow {
  display: grid;
  align-items: end;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.actions {
  display: flex;
  justify-content: center;
}

/* Payment frequency dropdown should look like a full-width control (not inside an input) */
#freqDD {
  width: 100%;
}

#freqDD .ddBtn {
  width: 100%;
  justify-content: space-between;
}

/* Amortization table: scroll + sticky header */
.amortScroll {
  max-height: 340px;
  overflow: auto;
  border-radius: 14px;
}

.amortScroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.checkboxRow {
  margin-top: 6px;
}

.checkLabel {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.checkLabel input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.taxesFeesWrap {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (min-width: 620px) {
  .chartLegend {
    font-size: small;
  }
}

@media (max-width: 620px) {
  .sameRow {
    grid-template-columns: 1fr;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }

  .chartLegend {
    font-size: x-small;
  }
}

.tfAccordion {
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  padding: 8px 12px;
  background-color: #f3f6fd;
}

.tfAccordion summary {
  cursor: pointer;
  font-weight: 600;
}

.tfAccBody {
  padding-top: 10px;
}

/* Chart */
.chartWrap {
  width: -webkit-fill-available;
  margin-top: var(--margin);
  margin-bottom: var(--margin-bottom);
  padding: 12px;
}

#amortChart {
  width: 100%;
  display: block;
}

#breakdownChart {
  width: 100%;
  display: block;
}

.chartLegend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  justify-content: center;
}

.legendItem {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legendSwatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

#amortChartWrap {
  position: relative;
}

#breakdownWrap {
  position: relative;
}

.chartTooltip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 10px));
  min-width: 220px;
  max-width: 280px;
  background: rgba(17, 17, 17, 0.96);
  color: rgba(255, 255, 255, 0.96);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.20);
  font-size: 12px;
  line-height: 1.3;
  pointer-events: none;
  z-index: 5;
}

.chartTooltip .ctTitle {
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 2px;
}

.chartTooltip .ctSub {
  opacity: 0.9;
  margin-bottom: 8px;
}

.chartTooltip .ctRow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 3px 0;
}

.chartTooltip .ctRow span:last-child {
  font-weight: 700;
  white-space: nowrap;
}

.chartTooltip .ctStrong span:last-child {
  font-weight: 900;
}

.schlOnly {
  padding-top: 4px;
}