#mortgage-panel, #schedule-panel {
  color: var(--ink, #172d33);
  min-width: 0;
}
#mortgage-panel [hidden], #schedule-panel [hidden] { display: none !important; }
.mh-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 1rem;
}
.mh-field {
  display: flex;
  flex-direction: column;
  gap: .38rem;
  min-width: 0;
  color: var(--ink, #172d33);
  font: inherit;
  font-size: .9rem;
  font-weight: 550;
}
.mh-input {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.mh-field input, .mh-field select, .mh-year-line select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 2.8rem;
  padding: .64rem .75rem;
  color: var(--ink, #172d33);
  font: inherit;
  font-size: 1rem;
  font-weight: 450;
  border: 1px solid var(--line, #cbd7d4);
  border-radius: .55rem;
  background-color: #fff;
}
.mh-field select, .mh-year-line select {
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23455e5d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .72rem center;
}
.mh-input input { padding-right: 3.4rem; font-variant-numeric: tabular-nums; }
.mh-input > span {
  position: absolute;
  right: .78rem;
  color: var(--muted, #546a68);
  pointer-events: none;
  font-size: .87rem;
  font-weight: 450;
}
.mh-input input::-webkit-inner-spin-button, .mh-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.mh-input input[type=number] { appearance: textfield; -moz-appearance: textfield; }
.mh-field input:focus-visible, .mh-field select:focus-visible, .mh-year-line select:focus-visible,
.mh-event button:focus-visible, .mh-action:focus-visible, .mh-switch button:focus-visible, .mh-ledger button:focus-visible {
  outline: 2px solid var(--teal, #11735f);
  outline-offset: 2px;
}
.mh-field input[aria-invalid=true] { border-color: #a13c32; }
.mh-estimate {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: .75rem;
  padding: .8rem .9rem;
  margin: 1rem 0 0;
  border-radius: .55rem;
  background: #f2f6f3;
}
.mh-estimate dt { color: var(--muted, #526560); font-size: .86rem; }
.mh-estimate dd { margin: .25rem 0 0; font-size: 1.04rem; font-weight: 620; font-variant-numeric: tabular-nums; }
.mh-changes { border-top: 1px solid var(--line, #d7e0dc); margin-top: 1.55rem; padding-top: 1.1rem; }
.mh-subhead, .mh-event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  flex-wrap: wrap;
}
.mh-subhead h3, .mh-section h2 { color: var(--ink, #172d33); margin: 0; letter-spacing: -.025em; }
.mh-subhead h3 { font-size: 1rem; font-weight: 650; }
.mh-subhead button, .mh-remove, .mh-ledger button { font: inherit; cursor: pointer; }
.mh-action, .mh-remove {
  min-height: 2.75rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: var(--teal, #116c5b);
  font-size: .88rem !important;
  font-weight: 650 !important;
}
.mh-action { padding: .45rem .8rem; background: #edf5f1; }
.mh-action:hover, .mh-remove:hover { background: #e5efea; }
.mh-hint { color: var(--muted, #526560); font-size: .91rem; line-height: 1.5; margin: .45rem 0 0; }
.mh-event { border: 1px solid var(--line, #d7e0dc); border-radius: .75rem; padding: .6rem 1rem 1rem; margin-top: .9rem; }
.mh-event-head { margin-bottom: .5rem; }
.mh-event-head strong { font-size: .94rem; }
.mh-remove { padding: .35rem .5rem; }
.mh-problem { font-size: .86rem; line-height: 1.5; color: #9b382c; margin: .65rem 0 0; }
.mh-heading h1 { margin: 0 0 1.1rem; letter-spacing: -.04em; font-size: clamp(1.7rem, 4vw, 2.35rem); }
.mh-empty { padding: 1.3rem; background: var(--surface, #fff); border: 1px solid var(--line, #d7e0dc); border-radius: .85rem; }
.mh-section { min-width: 0; margin-bottom: 1rem; padding: clamp(.85rem, 2.5vw, 1.5rem); background: var(--surface, #fff); border: 1px solid var(--line, #d7e0dc); border-radius: .95rem; }
.mh-section h2 { font-size: 1.14rem; font-weight: 650; }
.mh-comparison { margin-top: 1rem; }
.mh-scroll { max-width: 100%; overflow-x: auto; }
.mh-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink, #172d33);
  font-size: .92rem;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.mh-table th, .mh-table td { border: 0; padding: .62rem .6rem; text-align: right; }
.mh-table th:first-child, .mh-table td:first-child { text-align: left; }
.mh-table thead th {
  border-bottom: 1px solid var(--line, #d7e0dc);
  background: #f4f7f5;
  color: var(--muted, #53675f);
  font-size: .875rem;
  font-weight: 600;
}
.mh-table thead th:first-child { border-top-left-radius: .45rem; }
.mh-table thead th:last-child { border-top-right-radius: .45rem; }
.mh-table tbody tr + tr { border-top: 1px solid var(--line, #d7e0dc); }
.mh-table tbody th { font-weight: 500; }
.mh-table tbody td { white-space: nowrap; }
.mh-comparison tbody td:last-child { color: var(--teal, #116c5b); font-weight: 620; }
.mh-switch { display: inline-flex; padding: .18rem; border-radius: .6rem; background: #eef2f0; border: 1px solid var(--line, #d7e0dc); }
.mh-switch button {
  border: 0;
  border-radius: .45rem;
  padding: .46rem .82rem;
  min-height: 2.5rem;
  color: var(--muted, #526560);
  font-size: .88rem;
  font-weight: 550;
  background: transparent;
}
.mh-switch button[aria-pressed=true] { color: var(--ink, #172d33); background: #fff; box-shadow: 0 1px 4px #1c49391a; }
.mh-year-line { margin: .8rem 0; }
.mh-year-line label { display: flex; align-items: center; gap: .7rem; color: var(--muted, #526560); font-size: .875rem; }
.mh-year-line select { width: auto; min-width: 6.3rem; }
.mh-ledger tbody th { padding-top: .1rem; padding-bottom: .1rem; }
.mh-ledger button {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2.7rem;
  min-width: 2.7rem;
  padding: .15rem .3rem;
  background: transparent;
  border: 0;
  border-radius: .3rem;
  color: var(--teal, #116c5b);
  font-weight: 600;
}
.mh-ledger button span { font-size: 1.05rem; }
.mh-detail-row td { white-space: normal !important; background: #f4f8f5; }
.mh-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .65rem 1.2rem; margin: .32rem 0; }
.mh-details dt { font-size: .82rem; color: var(--muted, #526560); }
.mh-details dd { font-size: .91rem; margin: .12rem 0 0; font-weight: 600; }
@media (max-width: 32rem) {
  .mh-fields { gap: .75rem; }
  .mh-subhead { gap: .4rem; }
  .mh-event { padding: .45rem .65rem .8rem; }
  .mh-table { font-size: .84rem; }
  .mh-table thead th { font-size: .8rem; }
  .mh-table th, .mh-table td { padding-right: .32rem; padding-left: .32rem; }
}
@media (max-width: 22rem) {
  .mh-fields { grid-template-columns: minmax(0,1fr); }
}
.mh-changes > h3 {
  margin: 0;
  font-size: 1.06rem;
}
.mh-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: .85rem 0 0;
}
.mh-main-action {
  background: var(--teal, #116c5b);
  color: white;
}
.mh-main-action:hover { background: var(--deep, #104b42); }
.mh-event-result, .mh-impact {
  margin-top: .9rem;
  padding: .75rem .9rem;
  border-radius: .6rem;
  background: #f0f6ef;
}
.mh-event-result p, .mh-impact .mh-hint {
  font-size: .88rem;
  line-height: 1.5;
}
.mh-link {
  display: inline-block;
  min-height: 2.75rem;
  padding: .35rem 0;
  border: none;
  color: var(--teal, #116c5b);
  background: transparent;
  font-size: .9rem;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: .16em;
}
.mh-impact h4 {
  margin: 0;
  font-size: 1rem;
}
.mh-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  gap: .75rem;
  margin: .8rem 0 0;
}
.mh-summary dt {
  font-size: .86rem;
  color: var(--muted, #526560);
}
.mh-summary dd {
  margin: .15rem 0 0;
  font-size: 1.05rem;
  font-weight: 640;
}
.mh-heading.mh-subhead {
  margin-bottom: 1rem;
}
.mh-heading.mh-subhead h1 {
  margin: 0;
}
.mh-extra-note {
  display: block;
  color: var(--teal, #116c5b);
  font-size: .78rem;
  line-height: 1.35;
  white-space: normal;
}
