/* ---- Chart */
.chartWrap {
  width: 100%;
  margin: 15px 0px;
  /* No scrollbars for the donut chart */
  overflow: hidden;
  /* Prevent Chart.js resize feedback loops */
  position: relative;
  height: 320px;
}

#doughnutChart {
  display: block;
  width: 100% !important;
  height: 320px !important;
  max-height: 320px;
}

td {
  white-space: normal;
}

/* ---- Qualification bars (ABD/ATD/Down payment) ---- */
.limitsBars {
  display: grid;
  gap: 12px;
}

.limitRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.limitTitle {
  font-weight: 700;
  font-size: 14px;
}

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

.limitSub {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
}

.limitValue {
  font-size: 13px;
  opacity: 0.85;
  white-space: nowrap;
}

.limitProgress {
  grid-column: 1 / -1;
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: relative;
}

.limitFill {
  height: 100%;
  width: 0%;
  background: var(--numora-accent, #111);
  border-radius: 999px;
  transition: width 180ms ease;
}

.limitBadge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 165, 0, 0.22);
  border: 1px solid rgba(255, 165, 0, 0.55);
}

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

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

  .chartWrap {
    height: 280px;
  }

  #doughnutChart {
    max-height: 280px;
  }
}

/* Utility: robust hiding (in case [hidden] is overridden elsewhere) */
.isHidden {
  display: none !important;
}

/* Slider styling */
.rentSlider {
  width: 100%;
  height: 28px;
  appearance: none;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  cursor: pointer;
}

.rentSlider::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
}

.rentSlider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #111;
  margin-top: -5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.rentSlider::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
}

.rentSlider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #111;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

/* Borrowing capacity additions */
.note {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.3;
}

.note.warn {
  background: rgba(255, 210, 0, 0.16);
  border: 1px solid rgba(255, 210, 0, 0.35);
}

/* More visible when down payment is the limiting factor */
.note.warn.cashLimit {
  background: rgba(255, 165, 0, 0.22);
  border: 1px solid rgba(255, 165, 0, 0.55);
}

.note.mini {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.chartWrap {
  margin-top: 18px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  position: relative;
  height: 320px;
}

/* Give the doughnut a stable height without forcing container scroll */
#doughnutChart {
  display: block;
  width: 100%;
  height: 320px;
  max-height: 320px;
}

/* Rental income inclusion slider (Numora 2026 look) */
.rangeWrap {
  width: 100%;
}

.rentSlider {
  width: 100%;
  height: 12px;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--numora-accent, #111) 0%, var(--numora-accent, #111) 50%, rgba(0, 0, 0, 0.12) 50%, rgba(0, 0, 0, 0.12) 100%);
  outline: none;
  cursor: pointer;
}

.rentSlider:focus-visible {
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

.rentSlider::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--numora-accent, #111);
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  margin-top: -5px;
}

.rentSlider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--numora-accent, #111);
  border: 3px solid #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.rentSlider::-moz-range-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
}

.rentSlider::-moz-range-progress {
  height: 12px;
  border-radius: 999px;
  background: var(--numora-accent, #111);
}