.mc-page-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 14px 28px;
}

.mc-page-shell {
  border: 1px solid #d2d4d8;
  background: #f6f6f6;
  padding: 18px 16px 24px;
}

.mc-page-title h1,
.mc-section h2,
.mc-customize h3 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  color: #111827;
  font-weight: 400;
}

.mc-page-title h1 {
  font-size: clamp(36px, 2.7vw, 56px);
  line-height: 1.08;
}

.mc-page-title p {
  margin: 8px 0 0;
  color: #2f3744;
  font-size: 14px;
}

.mc-layout {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 18px;
}

.mc-controls {
  border-right: 1px solid #d4d7dc;
  padding-right: 18px;
}

.mc-control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mc-money {
  color: #0d6637;
  font-size: 32px;
  font-weight: 400;
}

.mc-label {
  color: #374151;
  font-size: 12px;
}

.mc-slider-wrap {
  margin-top: 10px;
}

.mc-slider-wrap input[type="range"] {
  width: 100%;
  accent-color: #1f6f43;
}

.mc-field-grid {
  margin-top: 14px;
}

.mc-field-row {
  display: grid;
  grid-template-columns: 1fr minmax(0, 170px);
  align-items: center;
  border-top: 1px solid #d7dbe1;
  min-height: 44px;
  color: #27303d;
  font-size: 14px;
}

.mc-field-row > span:first-child {
  padding-right: 10px;
}

.mc-input-pack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.mc-input-pack--single {
  grid-template-columns: 1fr;
}

.mc-input-pack input {
  border: 1px solid #ccd2db;
  border-right: 0;
  min-height: 34px;
  padding: 4px 8px;
  font-size: 14px;
  background: #fff;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.mc-input-pack--single input {
  border-right: 1px solid #ccd2db;
}

.mc-unit-toggle {
  border: 1px solid #1f6f43;
  background: #1f6f43;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  min-width: 38px;
}

.mc-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 34px);
  height: 34px;
}

.mc-switch-btn {
  border: 1px solid #1f6f43;
  border-left: 0;
  background: #f8fafc;
  color: #1f6f43;
  font-size: 12px;
  cursor: pointer;
  min-height: 100%;
}

.mc-switch-btn:first-child {
  border-left: 1px solid #1f6f43;
}

.mc-switch-btn.active {
  background: #1f6f43;
  color: #fff;
}

.mc-unit-toggle[disabled] {
  opacity: 0.82;
  cursor: default;
}

.mc-frequency {
  border-top: 1px solid #d7dbe1;
  padding-top: 10px;
  margin-top: 4px;
}

.mc-frequency__label {
  font-size: 13px;
  margin-bottom: 8px;
}

.mc-frequency__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #ced3dc;
}

.mc-frequency__tabs button {
  min-height: 40px;
  border: 0;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

.mc-frequency__tabs button.active {
  background: #1f6f43;
  color: #fff;
}

.mc-add-extra {
  width: 100%;
  margin-top: 14px;
  border: 0;
  background: transparent;
  color: #1f6f43;
  text-align: center;
  padding: 6px 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.mc-add-extra__arrow {
  font-size: 18px;
  line-height: 1;
}

.mc-extra-row.hidden {
  display: none;
}

.mc-extra-panel {
  margin-top: 4px;
}

.mc-extra-panel.hidden {
  display: none;
}

.mc-extra-group {
  border-top: 1px solid #d7dbe1;
  padding: 10px 0 12px;
}

.mc-extra-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #27303d;
}

.mc-extra-group .mc-extra-heading {
  font-size: 18px;
}

.mc-extra-input,
.mc-extra-date {
  position: relative;
  margin-bottom: 10px;
}

.mc-extra-input input,
.mc-extra-date input {
  width: 100%;
  border: 1px solid #ccd2db;
  min-height: 34px;
  padding: 4px 10px;
  box-sizing: border-box;
  font-size: 14px;
  background: #fff;
}

.mc-extra-input input {
  padding-left: 28px;
}

.mc-extra-sign {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #1f6f43;
  font-weight: 700;
}

.mc-remove-extra {
  width: 100%;
  border: 0;
  background: transparent;
  color: #1f6f43;
  text-align: center;
  padding: 8px 0 10px;
  font-size: 14px;
  cursor: pointer;
}

.mc-results {
  padding-left: 2px;
}

.mc-estimate-row {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #d7dbe1;
  margin-bottom: 10px;
}

.mc-estimate-money {
  color: #0d6637;
  font-size: 48px;
  line-height: 1;
  font-weight: 400;
}

.mc-estimate-copy {
  border-left: 1px solid #d7dbe1;
  padding-left: 18px;
  font-size: 15px;
}

.mc-section {
  margin-top: 10px;
}

.mc-section h2 {
  font-size: clamp(18px, 1vw, 24px);
}

.mc-divider {
  margin: 6px 0 16px;
  border-top: 1px solid #d7dbe1;
}

.mc-breakdown-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.mc-donut-panel {
  min-height: 430px;
}

.mc-donut-wrap {
  position: relative;
  width: 340px;
  height: 340px;
  margin: 0 auto;
}

.mc-donut {
  width: 340px;
  height: 340px;
  position: relative;
  overflow: hidden;
  border-radius: 50%;
  background: conic-gradient(
    #1f6f43 0deg 280deg,
    #7d8cff 280deg 300deg,
    #8adf9f 300deg 326deg,
    #ef7080 326deg 348deg,
    #dfc974 348deg 356deg,
    #4f56d2 356deg 360deg
  );
}

.mc-donut::after {
  content: "";
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: #f6f6f6;
}

.mc-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.mc-donut-amount {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: #1f2937;
}

.mc-dollar {
  color: #1f6f43;
  font-size: 28px;
  line-height: 1;
}

#mcDonutPayment {
  font-size: 46px;
  line-height: 1;
}

.mc-donut-center small {
  font-size: 14px;
  color: #374151;
}

.mc-mini-legend {
  margin: 16px auto 0;
  width: 230px;
  list-style: none;
  padding: 10px 12px;
  background: #f0f0f0;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  font-size: 12px;
}

.mc-mini-legend li {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 8px;
  line-height: 1.6;
}

.mc-mini-legend i,
.mc-customize i {
  width: 11px;
  height: 11px;
  display: inline-block;
}

.mc-customize td:first-child i {
  margin-right: 10px;
  vertical-align: middle;
}

.c-principal { background: #1f6f43; }
.c-extra { background: #7d8cff; }
.c-insurance { background: #8adf9f; }
.c-tax { background: #ef7080; }
.c-hoa { background: #dfc974; }
.c-pmi { background: #4f56d2; }
.c-balance { background: #4aa3e8; }
.c-interest { background: #f07b4b; }

.mc-customize h3 {
  font-size: clamp(18px, 1vw, 24px);
  margin-bottom: 6px;
}

.mc-customize table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.mc-customize td {
  border-top: 1px solid #d7dbe1;
  padding: 7px 6px;
  vertical-align: middle;
}

.mc-customize td:nth-child(1) {
  width: 66%;
}

.mc-customize td:nth-child(2) {
  width: 28px;
  color: #1f6f43;
  font-weight: 700;
}

.mc-customize .mc-value-cell {
  text-align: right;
}

.mc-customize input {
  width: 138px;
  max-width: 100%;
  border: 1px solid #cdd3dc;
  border-right: 0;
  min-height: 30px;
  padding: 4px 8px;
  background: #fff;
}

.mc-custom-input {
  display: inline-grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  justify-content: start;
  width: 206px;
  max-width: 100%;
}

.mc-customize tr.mc-input-row td:nth-child(3) {
  text-align: left;
}

.mc-total-row td {
  font-weight: 700;
}

.mc-bars {
  margin-top: 2px;
}

.mc-bar-row {
  display: grid;
  grid-template-columns: 420px 1fr 28px 170px;
  align-items: center;
  gap: 14px;
  min-height: 34px;
  font-size: 14px;
}

.mc-bar-label {
  color: #1f2937;
}

.mc-bar-track {
  height: 22px;
  background: #eceff3;
  position: relative;
}

.mc-bar-fill {
  height: 100%;
}

.mc-bar-currency {
  color: #1f6f43;
  text-align: center;
  font-weight: 700;
}

.mc-bar-value {
  text-align: right;
}

.mc-am-chart-wrap {
  position: relative;
}

#mcAmChart {
  width: 100%;
  height: 360px;
  background: #f7f7f7;
}

.mc-am-tooltip {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #d4d9e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: #1f2937;
  pointer-events: none;
  z-index: 4;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.12);
}

.mc-am-tooltip.hidden {
  display: none;
}

.mc-am-tooltip strong {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
}

.mc-am-meta {
  margin-top: 18px;
  border-top: 1px solid #d7dbe1;
}

.mc-am-meta-head {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 22px;
  padding: 12px 0;
  border-bottom: 1px solid #d7dbe1;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  color: #111827;
}

.mc-am-meta-head #mcAmAsOfYear {
  color: #0f6b3c;
}

.mc-am-meta-body {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 22px;
  padding-top: 14px;
}

.mc-am-payoff #mcPayoffMonthDay {
  color: #0f6b3c;
  font-size: 30px;
  line-height: 1.1;
}

.mc-am-payoff #mcPayoffYear {
  color: #1f2937;
  font-size: 46px;
  line-height: 0.95;
}

.mc-am-breakdown {
  padding-top: 2px;
}

.mc-am-row {
  display: grid;
  grid-template-columns: 1fr 22px 140px;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: 18px;
}

.mc-am-row > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1f2937;
}

.mc-am-row i {
  width: 19px;
  height: 19px;
  display: inline-block;
}

.mc-am-dollar {
  color: #0f6b3c;
  font-weight: 700;
  text-align: center;
}

.mc-am-row > span:last-child {
  text-align: right;
  color: #1f2937;
}

@media (max-width: 1500px) {
  .mc-layout {
    grid-template-columns: 400px 1fr;
  }

  .mc-bar-row {
    grid-template-columns: 290px 1fr 22px 130px;
  }
}

@media (max-width: 1200px) {
  .mc-layout {
    grid-template-columns: 1fr;
  }

  .mc-controls {
    border-right: 0;
    border-bottom: 1px solid #d4d7dc;
    padding-right: 0;
    padding-bottom: 12px;
  }

  .mc-breakdown-grid {
    grid-template-columns: 1fr;
  }

  .mc-donut-panel {
    min-height: 320px;
  }

  .mc-donut-wrap {
    width: 280px;
    height: 280px;
  }

  .mc-donut {
    width: 280px;
    height: 280px;
  }

  .mc-dollar {
    font-size: 22px;
  }

  #mcDonutPayment {
    font-size: 34px;
  }

  .mc-donut-center small {
    font-size: 12px;
  }

  .mc-mini-legend {
    font-size: 11px;
  }

  .mc-estimate-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-bottom: 10px;
  }

  .mc-estimate-copy {
    border-left: 0;
    padding-left: 0;
  }

  .mc-bar-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 7px 0;
    border-top: 1px solid #e0e4ea;
  }

  .mc-bar-currency,
  .mc-bar-value {
    text-align: left;
  }

  .mc-customize input {
    width: 120px;
  }

  .mc-am-meta-head,
  .mc-am-meta-body {
    grid-template-columns: 1fr;
  }

  .mc-am-payoff #mcPayoffMonthDay {
    font-size: 30px;
  }

  .mc-am-payoff #mcPayoffYear {
    font-size: 48px;
  }

  .mc-am-row {
    grid-template-columns: 1fr 20px 120px;
    font-size: 20px;
  }
}
