.mdc-page {
  --mdc-ink: #102A43;
  --mdc-copy: #52677C;
  --mdc-line: #DCE5EC;
  --mdc-navy: #17324D;
  --mdc-blue: #2563EB;
  --mdc-teal: #0F766E;
  --mdc-amber: #C96B1A;
  --mdc-slate: #64748B;
  min-height: calc(100vh - 70px);
  padding: 34px 0 72px;
  background: #F4F7F9;
  color: var(--mdc-ink);
}

.mdc-page * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.mdc-shell {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
}

.mdc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: #7B8DA0;
  font-size: 12px;
}

.mdc-breadcrumb a {
  color: #52677C;
  text-decoration: none;
}

.mdc-breadcrumb a:hover {
  color: var(--mdc-blue);
}

.mdc-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  align-items: end;
  gap: 48px;
  margin-bottom: 28px;
}

.mdc-kicker {
  margin: 0 0 6px;
  color: var(--mdc-blue);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.mdc-heading h1 {
  margin: 0;
  color: var(--mdc-ink);
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.06;
  font-weight: 700;
}

.mdc-heading > p {
  margin: 0 0 4px;
  color: var(--mdc-copy);
  font-size: 15px;
  line-height: 1.65;
}

.mdc-workbench {
  display: grid;
  grid-template-columns: minmax(360px, .76fr) minmax(560px, 1.24fr);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--mdc-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 44px rgba(16, 42, 67, .08);
}

.mdc-controls,
.mdc-results {
  min-width: 0;
  padding: 28px;
}

.mdc-controls {
  border-right: 1px solid var(--mdc-line);
  background: #fff;
}

.mdc-results {
  background: #FBFCFD;
}

.mdc-panel-heading,
.mdc-result-head,
.mdc-visual-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.mdc-panel-heading {
  margin-bottom: 28px;
}

.mdc-panel-heading span,
.mdc-visual-heading span,
.mdc-result-head > div > span,
.mdc-ltv span,
.mdc-key-metrics span {
  color: #6A7D90;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.mdc-panel-heading h2,
.mdc-visual-heading h2 {
  margin: 4px 0 0;
  color: var(--mdc-ink);
  font-size: 19px;
  line-height: 1.25;
  font-weight: 650;
}

.mdc-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #C7E8DF;
  border-radius: 999px;
  background: #F0FAF7;
  color: var(--mdc-teal) !important;
  font-size: 9px !important;
  white-space: nowrap;
}

.mdc-live-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
}

.mdc-slider-field {
  margin-bottom: 24px;
}

.mdc-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 11px;
}

.mdc-input-row label,
.mdc-term-field legend {
  color: #334E68;
  font-size: 12px;
  font-weight: 600;
}

.mdc-input-row input.slider-value {
  width: 154px;
  max-width: 50%;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid #CAD6E0;
  border-radius: 5px;
  background: #fff;
  color: var(--mdc-ink);
  font-size: 16px;
  font-weight: 650;
  text-align: right;
}

.mdc-input-row input.slider-value:focus {
  outline: 2px solid rgba(37, 99, 235, .16);
  border-color: var(--mdc-blue);
  box-shadow: none;
}

.mdc-value-with-note {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mdc-value-with-note input.slider-value {
  width: 148px;
  max-width: none;
  flex: 0 0 148px;
}

.mdc-value-with-note small {
  min-width: 38px;
  color: var(--mdc-teal);
  font-size: 11px;
  font-weight: 650;
}

.mdc-page input[type="range"].slider {
  height: 5px;
  background-color: #DDE6ED;
  background-image: linear-gradient(var(--mdc-blue), var(--mdc-blue));
}

.mdc-page input[type="range"].slider::-webkit-slider-thumb {
  width: 21px;
  height: 21px;
  border: 4px solid #fff;
  background: var(--mdc-blue);
  box-shadow: 0 0 0 1px var(--mdc-blue), 0 3px 8px rgba(16, 42, 67, .18);
}

.mdc-bounds {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: #8798A9;
  font-size: 10px;
}

.mdc-term-field {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.mdc-term-field legend {
  margin-bottom: 9px;
}

.mdc-segments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid #D8E2EA;
  border-radius: 6px;
  background: #EFF3F6;
}

.mdc-segments button {
  min-height: 38px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #52677C;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mdc-segments button.active {
  background: #fff;
  color: var(--mdc-ink);
  box-shadow: 0 1px 4px rgba(16, 42, 67, .13);
}

.mdc-assumptions {
  margin-top: 6px;
  border-top: 1px solid var(--mdc-line);
}

.mdc-assumptions summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0 4px;
  list-style: none;
  cursor: pointer;
}

.mdc-assumptions summary::-webkit-details-marker {
  display: none;
}

.mdc-assumptions summary span:first-child {
  display: grid;
  gap: 3px;
}

.mdc-assumptions summary strong {
  color: #334E68;
  font-size: 12px;
  font-weight: 650;
}

.mdc-assumptions summary small {
  color: #7B8DA0;
  font-size: 10px;
}

.mdc-summary-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid #CAD6E0;
  border-radius: 5px;
  color: var(--mdc-blue);
  font-size: 17px;
  line-height: 1;
}

.mdc-assumptions[open] .mdc-summary-icon {
  transform: rotate(45deg);
}

.mdc-assumption-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 16px;
}

.mdc-assumption-grid label {
  display: grid;
  gap: 6px;
  color: #52677C;
  font-size: 10px;
  font-weight: 600;
}

.mdc-assumption-grid label > span {
  display: flex;
  align-items: center;
  min-height: 38px;
  overflow: hidden;
  border: 1px solid #CAD6E0;
  border-radius: 5px;
  background: #fff;
  color: #7B8DA0;
}

.mdc-assumption-grid input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 9px;
  border: 0;
  outline: 0;
  color: var(--mdc-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
}

.mdc-money-input i {
  padding-left: 9px;
  font-style: normal;
}

.mdc-result-head {
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--mdc-line);
}

.mdc-result-head > div > strong {
  display: block;
  margin-top: 4px;
  color: var(--mdc-ink);
  font-size: clamp(38px, 5vw, 54px);
  line-height: 1;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.mdc-result-head p {
  margin: 7px 0 0;
  color: var(--mdc-copy);
  font-size: 11px;
}

.mdc-ltv {
  min-width: 98px;
  padding: 12px;
  border-left: 3px solid var(--mdc-teal);
  background: #F0FAF7;
}

.mdc-ltv strong {
  display: block;
  margin-top: 3px;
  color: var(--mdc-teal);
  font-size: 20px;
  font-weight: 650;
}

.mdc-key-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 18px 0;
  border: 1px solid var(--mdc-line);
  background: var(--mdc-line);
}

.mdc-key-metrics > div {
  padding: 13px;
  background: #fff;
}

.mdc-key-metrics strong {
  display: block;
  margin-top: 5px;
  color: var(--mdc-ink);
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.mdc-payment-visual,
.mdc-amortization {
  padding: 20px 0 0;
  border-top: 1px solid var(--mdc-line);
}

.mdc-amortization {
  margin-top: 22px;
}

.mdc-visual-heading {
  align-items: center;
}

.mdc-visual-heading > small {
  color: #7B8DA0;
  font-size: 10px;
}

.mdc-composition-grid {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  align-items: center;
  gap: 26px;
  margin-top: 18px;
}

.mdc-donut {
  position: relative;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: conic-gradient(var(--mdc-navy) 0 78%, var(--mdc-blue) 78% 94%, var(--mdc-teal) 94% 100%);
}

.mdc-donut::after {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: #FBFCFD;
  content: "";
}

.mdc-donut > div {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.mdc-donut strong,
.mdc-donut span {
  display: block;
}

.mdc-donut strong {
  color: var(--mdc-ink);
  font-size: 19px;
  font-weight: 650;
}

.mdc-donut span {
  margin-top: 2px;
  color: #7B8DA0;
  font-size: 9px;
}

.mdc-legend {
  display: grid;
  gap: 8px;
}

.mdc-legend > div {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 22px;
  color: #52677C;
  font-size: 11px;
}

.mdc-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.mdc-legend strong {
  color: var(--mdc-ink);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.mdc-legend [data-component="pi"] i,
.mdc-component-bars #calc-bar-pi { background: var(--mdc-navy); }
.mdc-legend [data-component="tax"] i,
.mdc-component-bars #calc-bar-tax { background: var(--mdc-blue); }
.mdc-legend [data-component="insurance"] i,
.mdc-component-bars #calc-bar-insurance { background: var(--mdc-teal); }
.mdc-legend [data-component="hoa"] i,
.mdc-component-bars #calc-bar-hoa { background: var(--mdc-amber); }
.mdc-legend [data-component="pmi"] i,
.mdc-component-bars #calc-bar-pmi { background: var(--mdc-slate); }

.mdc-component-bars {
  display: flex;
  width: 100%;
  height: 7px;
  overflow: hidden;
  margin-top: 16px;
  border-radius: 2px;
  background: #E8EEF3;
}

.mdc-component-bars span {
  width: 0;
  transition: width 220ms ease;
}

.mdc-chart-key {
  display: flex;
  gap: 14px;
  color: #52677C;
  font-size: 10px;
}

.mdc-chart-key span::before {
  display: inline-block;
  width: 14px;
  height: 2px;
  margin: 0 5px 3px 0;
  background: currentColor;
  content: "";
}

.mdc-chart-key .balance { color: var(--mdc-blue); }
.mdc-chart-key .equity { color: var(--mdc-teal); }

.mdc-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
  margin-top: 10px;
  overflow: visible;
}

.mdc-grid-lines line {
  stroke: #DCE5EC;
  stroke-width: 1;
}

.mdc-chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mdc-chart-line.balance { stroke: var(--mdc-blue); }
.mdc-chart-line.equity { stroke: var(--mdc-teal); }

.mdc-chart-labels text {
  fill: #7B8DA0;
  font-size: 10px;
  text-anchor: middle;
}

.mdc-chart-note {
  margin: -2px 0 0;
  color: #7B8DA0;
  font-size: 10px;
  line-height: 1.45;
}

.mdc-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
}

.mdc-footer-row p {
  max-width: 760px;
  margin: 0;
  color: #6A7D90;
  font-size: 10.5px;
  line-height: 1.55;
}

.mdc-primary-action {
  min-height: 42px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 17px;
  border-radius: 6px;
  background: var(--mdc-navy);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.mdc-primary-action:hover {
  background: #0C2538;
  color: #fff;
}

@media (max-width: 1040px) {
  .mdc-heading {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mdc-workbench {
    grid-template-columns: 1fr;
  }

  .mdc-controls {
    border-right: 0;
    border-bottom: 1px solid var(--mdc-line);
  }
}

@media (max-width: 640px) {
  .mdc-page {
    padding: 24px 0 52px;
  }

  .mdc-shell {
    width: min(100% - 24px, 1320px);
  }

  .mdc-heading h1 {
    font-size: 34px;
  }

  .mdc-controls,
  .mdc-results {
    padding: 20px 16px;
  }

  .mdc-live-badge {
    display: none;
  }

  .mdc-input-row input.slider-value {
    width: 132px;
  }

  .mdc-assumption-grid,
  .mdc-key-metrics {
    grid-template-columns: 1fr;
  }

  .mdc-composition-grid {
    grid-template-columns: 1fr;
  }

  .mdc-donut {
    margin: 0 auto;
  }

  .mdc-result-head {
    align-items: flex-start;
  }

  .mdc-result-head > div > strong {
    font-size: 40px;
  }

  .mdc-chart-key {
    display: none;
  }

  .mdc-footer-row {
    align-items: stretch;
    flex-direction: column;
  }

  .mdc-primary-action {
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .mdc-input-row {
    gap: 8px;
  }

  .mdc-input-row input.slider-value {
    width: 126px;
    max-width: none;
    font-size: 15px;
  }

  .mdc-value-with-note {
    gap: 6px;
  }

  .mdc-value-with-note input.slider-value {
    width: 126px;
    flex-basis: 126px;
  }

  .mdc-value-with-note small {
    min-width: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mdc-component-bars span {
    transition: none;
  }
}
