.mortgage-layout{
  align-items:start;
}

.results-card{
  position:sticky;
  top:16px;
}

.schedule-results-card{
  position:static;
}

.mortgage-hero-metrics{
  grid-template-columns:repeat(3,minmax(0,1fr));
}

.mortgage-insight-grid{
  grid-template-columns:1.2fr .8fr;
}

.chart-container{
  position:relative;
  width:100%;
  min-height:320px;
  max-height:75vh;
}

.chart-container canvas{
  width:100% !important;
  height:100% !important;
  display:block;
  background:#fff;
  border-radius:14px;
  margin-top:10px;
}

.breakdown-table.compact-table th,
.breakdown-table.compact-table td{
  font-size:.9rem;
}

.breakdown-table.compact-table td:nth-child(2),
.breakdown-table.compact-table td:nth-child(3){
  text-align:right;
}

.breakdown-table.compact-table th:first-child{
  width:46%;
}

.milestone-grid .mini-card small{
  display:block;
  margin-top:6px;
  color:#6a7891;
}

.live-stats-grid.single-stat-grid{
  margin-top:14px;
}

.assumption-callout{
  margin-top:16px;
}

.schedule-heading-row{
  margin-bottom:14px;
}

.schedule-table-wrap{
  overflow-x:auto;
}

.schedule-table th:last-child,
.schedule-table td:last-child{
  text-align:right;
}

@media (max-width:1120px){
  .results-card{
    position:static;
  }
}

@media (max-width:780px){
  .mortgage-hero-metrics,
  .mortgage-insight-grid{
    grid-template-columns:1fr !important;
  }
}


.chart-legend{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  margin-top:14px;
}

.chart-legend-item{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#49617d;
  font-size:.95rem;
  font-weight:600;
}

.chart-legend-swatch{
  width:22px;
  height:4px;
  border-radius:999px;
  display:inline-block;
}

.chart-legend-swatch--baseline{ background:#9aa8bd; }
.chart-legend-swatch--overpay{ background:#147a56; }

.chart-tooltip{
  position:absolute;
  transform:translate(-50%, calc(-100% - 12px));
  pointer-events:none;
  min-width:150px;
  padding:10px 12px;
  border-radius:12px;
  background:#10233b;
  color:#fff;
  box-shadow:0 14px 32px rgba(16,35,59,.18);
  z-index:2;
}

.chart-tooltip[hidden]{
  display:none;
}

.chart-tooltip-date{
  display:block;
  margin-bottom:6px;
  font-size:.85rem;
  font-weight:700;
}

.chart-tooltip-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  font-size:.85rem;
}

.chart-tooltip-row + .chart-tooltip-row{
  margin-top:4px;
}

.chart-tooltip-key{
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.chart-tooltip-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  display:inline-block;
}

.chart-tooltip-dot--baseline{ background:#9aa8bd; }
.chart-tooltip-dot--overpay{ background:#147a56; }
