.calculator-page {
  --calc-gold: #98722e;
  --calc-cream: #f7f4ee;
  --calc-ink: #292830;
  --calc-muted: #68656c;
  --calc-line: #ded8cc;
  --calc-chart-0: #98722e;
  --calc-chart-1: #394e50;
  --calc-chart-2: #9b654c;
  --calc-chart-3: #796c92;
  --calc-chart-4: #bcae85;
  color: var(--calc-ink);
  background: #fff;
  padding: 150px 0 80px;
}
.calculator-page [hidden] {
  display: none !important;
}
.calc-wrap {
  max-width: 1320px;
}
.calc-header {
  max-width: 850px;
  margin-bottom: 42px;
}
.calc-eyebrow {
  color: var(--calc-gold);
  letter-spacing: 2.6px;
  font-size: 11px;
  font-weight: 600;
}
.calc-header h1 {
  font-family: var(--bs-font-serif, Georgia, serif);
  font-size: clamp(34px, 4.1vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  margin: 16px 0;
}
.calc-header p {
  max-width: 700px;
  color: var(--calc-muted);
  font-size: 16px;
  line-height: 1.8;
}
.calc-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(350px, 1.65fr) minmax(
      220px,
      0.85fr
    );
  gap: 32px;
  align-items: start;
}
.calc-form {
  min-width: 0;
}
.calc-field {
  margin-bottom: 20px;
  min-width: 0;
}
.calc-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}
.calc-label label {
  font-size: 13px;
  font-weight: 500;
}
.calc-help {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--calc-muted);
  padding: 5px;
}
.calc-help svg {
  width: 18px;
  height: 18px;
}
.calc-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--calc-line);
  border-radius: 10px;
  background: #faf9f6;
  overflow: hidden;
}
.calc-input > span {
  padding-left: 14px;
  color: var(--calc-muted);
  font-size: 14px;
}
.calc-input input {
  border: 0;
  outline: none;
  background: transparent;
  min-width: 0;
  width: 100%;
  padding: 13px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--calc-ink);
}
.calc-input:focus-within {
  outline: 2px solid var(--calc-gold);
  outline-offset: 2px;
}
.calc-input:has([aria-invalid="true"]) {
  border-color: #ad342d;
}
.calc-field select {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 14px;
  background: #faf9f6;
  color: var(--calc-ink);
  border: 1px solid var(--calc-line);
  border-radius: 10px;
}
.calc-pair {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
}
.calc-error {
  display: block;
  color: #a72b24;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 5px;
}
.calc-error:empty {
  display: none;
}
.calc-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 18px 0;
}
.calc-toggle label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  cursor: pointer;
}
.calc-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--calc-gold);
  flex-shrink: 0;
}
.calc-toggle:has(input:disabled) {
  opacity: 0.6;
}
.calc-muted,
.calc-rate-note {
  font-size: 12px;
  line-height: 1.7;
  color: var(--calc-muted);
}
.calc-rate-note {
  margin: -8px 0 22px;
}
.calc-rate-note p {
  margin-bottom: 3px;
}
.calc-text-button {
  border: 0;
  padding: 3px 0;
  background: none;
  color: var(--calc-gold);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.calc-advanced {
  border-top: 1px solid var(--calc-line);
  border-bottom: 1px solid var(--calc-line);
  padding: 16px 0;
  margin-bottom: 18px;
}
.calculator-page summary {
  cursor: pointer;
  color: var(--calc-gold);
  font-weight: 500;
  font-size: 14px;
}
.calc-advanced[open] > summary {
  margin-bottom: 20px;
}
.calc-results {
  min-width: 0;
  position: sticky;
  top: 110px;
}
.calc-tabs {
  display: flex;
  border-bottom: 1px solid var(--calc-line);
  gap: 24px;
}
.calc-tabs button {
  font: inherit;
  font-size: 14px;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 12px 0;
  color: var(--calc-muted);
}
.calc-tabs button[aria-selected="true"] {
  border-color: var(--calc-gold);
  color: var(--calc-ink);
}
.calc-empty {
  padding: 65px 25px;
  text-align: center;
  background: var(--calc-cream);
  border-radius: 14px;
  margin-top: 26px;
  color: var(--calc-muted);
}
.calc-summary {
  display: flex;
  flex-direction: column;
  text-align: center;
  gap: 4px;
  padding: 25px 0 6px;
  font-size: 14px;
}
.calc-summary strong {
  font-family: var(--bs-font-serif, Georgia, serif);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.2;
}
.calc-donut-wrap {
  position: relative;
  max-width: 360px;
  margin: 12px auto;
}
.calc-donut {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.calc-donut text {
  font-family: inherit;
  fill: var(--calc-ink);
}
.calc-donut .donut-total {
  font-family: var(--bs-font-serif, Georgia, serif);
  font-size: 25px;
}
.calc-donut .donut-caption {
  font-size: 10px;
}
.calc-donut .donut-label {
  font-size: 10px;
}
.calc-donut .donut-amount {
  font-size: 12px;
  font-weight: 600;
}
.calc-legend {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.calc-legend li {
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #eeeae3;
  padding: 9px 0;
  font-size: 13px;
}
.calc-legend strong {
  margin-left: auto;
  white-space: nowrap;
  font-weight: 500;
}
.calc-dot {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
}
.calc-chart {
  width: 100%;
  height: auto;
  margin-top: 24px;
}
.calc-chart text {
  font: 11px sans-serif;
  fill: var(--calc-muted);
}
.calc-chart path {
  fill: none;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}
.calc-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  margin: 8px 0 16px;
}
.calc-chart-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.calc-month-select {
  font-size: 12px;
  display: block;
}
#calc-month {
  width: 100%;
  accent-color: var(--calc-gold);
}
[data-month-details] {
  display: block;
  font-size: 12px;
  line-height: 1.8;
  margin: 8px 0 20px;
}
.calc-table-wrap {
  max-height: 330px;
  overflow: auto;
  margin-top: 15px;
}
.calc-table-wrap table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}
.calc-table-wrap th,
.calc-table-wrap td {
  padding: 8px;
  text-align: right;
  border-bottom: 1px solid var(--calc-line);
  white-space: nowrap;
}
.calc-table-wrap th {
  position: sticky;
  top: 0;
  background: var(--calc-cream);
}
.calc-phases {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px;
  background: var(--calc-cream);
  border-radius: 12px;
  margin: 20px 0;
}
.calc-phases div {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  gap: 7px;
}
.calc-phases strong {
  font-size: 21px;
}
.calc-phases p {
  grid-column: 1/-1;
  font-size: 12px;
  line-height: 1.7;
  margin: 0;
}
.calc-disclaimer {
  margin: 22px 0 0;
}
.calc-cta {
  background: var(--calc-cream);
  border: 1px solid #e6dfd0;
  border-radius: 18px;
  padding: 28px 22px;
}
.calc-cta-art {
  color: var(--calc-gold);
  width: 100%;
  height: 105px;
  margin-bottom: 22px;
}
.calc-cta h2,
.calc-explore h2 {
  font-family: var(--bs-font-serif, Georgia, serif);
  font-weight: 400;
  line-height: 1.2;
}
.calc-cta h2 {
  font-size: 28px;
}
.calc-cta p {
  font-size: 13px;
  line-height: 1.8;
}
.calc-cta .btn {
  white-space: normal;
  font-size: 13px;
  width: 100%;
}
.calc-heloc {
  display: block;
  color: var(--calc-muted);
  font-size: 12px;
  line-height: 1.7;
  text-decoration: underline;
  margin-top: 18px;
  text-underline-offset: 3px;
}
.calc-explore {
  margin-top: 70px;
  border-top: 1px solid var(--calc-line);
  padding-top: 40px;
}
.calc-explore h2 {
  font-size: 34px;
  margin-bottom: 25px;
}
.calc-related {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.calc-related > a {
  color: var(--calc-ink);
  text-decoration: none;
  border: 1px solid var(--calc-line);
  border-radius: 14px;
  padding: 28px;
  transition: background 0.2s;
}
.calc-related > a:hover {
  background: var(--calc-cream);
}
.calc-related svg {
  width: 44px;
  height: 44px;
  color: var(--calc-gold);
  margin-bottom: 16px;
}
.calc-related h3 {
  font-family: var(--bs-font-serif, Georgia, serif);
  font-weight: 400;
  font-size: 25px;
}
.calc-related p {
  font-size: 13px;
  color: var(--calc-muted);
  line-height: 1.8;
}
.calc-related span {
  font-size: 13px;
  color: var(--calc-gold);
}
.calc-dialog {
  max-width: 480px;
  width: calc(100% - 32px);
  padding: 32px;
  border: 1px solid var(--calc-line);
  border-radius: 18px;
  color: var(--calc-ink);
}
.calc-dialog::backdrop {
  background: rgba(15, 15, 15, 0.55);
}
.calc-dialog h2 {
  font-family: var(--bs-font-serif, Georgia, serif);
  font-size: 28px;
  margin-right: 20px;
}
.calc-dialog p {
  font-size: 14px;
  line-height: 1.8;
}
.calc-dialog [data-close-help] {
  float: right;
  background: none;
  border: 0;
  font-size: 28px;
  line-height: 1;
  width: 32px;
  height: 32px;
}
.calculator-page
  :is(button, a, select, input, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--calc-gold);
  outline-offset: 4px;
}
/* Equal-size artwork at the slider midpoint, anchored to the drawn baseline. */
.calc-afford-scene {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 165px;
  padding: 18px 20px 8px;
  margin: 12px 0;
  color: var(--calc-gold);
}
.calc-afford-scene[hidden],
.calc-budget-control[hidden] {
  display: none;
}
.calc-afford-scene svg {
  width: 42%;
  max-width: 144px;
  height: auto;
  aspect-ratio: 160 / 130;
  transform-origin: 50% 93.076923%;
  transition: transform 220ms ease-out;
}
.calc-afford-savings {
  color: #168064;
  transform: scale(var(--savings-scale, 1));
}
.calc-afford-home {
  transform: scale(var(--home-scale, 0.8));
}
@media (prefers-reduced-motion: reduce) {
  .calc-afford-scene svg {
    transition: none;
  }
}
[data-afford-summary] > p,
[data-dti-note] > p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--calc-muted);
  text-align: center;
}
.calc-dti-bar {
  height: 28px;
  display: flex;
  background: #eee9df;
  border-radius: 20px;
  overflow: hidden;
  margin: 24px 0;
}
.calc-dti-bar span {
  height: 100%;
}
@media (max-width: 1199.98px) {
  .calc-layout {
    grid-template-columns: minmax(240px, 1fr) minmax(320px, 1.5fr);
    gap: 30px;
  }
  .calc-cta {
    grid-column: 1/-1;
  }
  .calc-cta-art {
    width: 110px;
    float: right;
  }
  .calc-cta .btn {
    width: auto;
  }
}
@media (max-width: 767.98px) {
  .calculator-page {
    padding: 110px 0 50px;
  }
  .calc-wrap {
    padding-inline: 22px;
  }
  .calc-header {
    margin-bottom: 25px;
  }
  .calc-header p {
    font-size: 14px;
  }
  .calc-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
  }
  .calc-layout > * {
    width: 100%;
  }
  .calc-results {
    position: static;
  }
  .calc-header h1 {
    font-size: 36px;
  }
  .calc-related {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .calc-explore {
    margin-top: 42px;
    padding-top: 30px;
  }
  .calc-explore h2 {
    font-size: 28px;
  }
  .calc-summary strong {
    font-size: 36px;
  }
  .calc-tabs {
    gap: 18px;
  }
  .calc-tabs button {
    font-size: 13px;
  }
  .calc-cta-art {
    float: none;
  }
  .calc-cta .btn {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .calculator-page * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.calc-mobile-summary {
  display: none;
}
.calc-pair .calc-label {
  min-height: 28px;
  align-items: flex-end;
}
@media (max-width: 767.98px) {
  .calc-mobile-summary {
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    background: var(--calc-cream);
    border-radius: 12px;
    font-size: 13px;
    gap: 6px;
  }
  .calc-mobile-summary strong {
    font-family: var(--bs-font-serif, Georgia, serif);
    font-size: 30px;
    font-weight: 400;
  }
}

.calc-budget-range {
  width: 100%;
  accent-color: var(--calc-gold);
  margin: 14px 0;
}
[data-budget-target] {
  display: block;
  text-align: center;
  margin-bottom: 14px;
  color: var(--calc-gold);
}
.calc-results label {
  font-size: 12px;
}
.calc-legend li > span:not(.calc-dot) {
  min-width: 0;
}
.calc-legend strong {
  font-size: clamp(10px, 1.1vw, 13px);
}

/* Title, compact source note, and property-style sharing. */
.calc-header,
.calc-header p {
  max-width: none;
}
.calc-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.calc-title-row h1 {
  min-width: 0;
}
.calc-rate-note {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0 5px;
  font-size: 10px;
}
.calc-rate-note .calc-text-button {
  white-space: nowrap;
}
.calc-month-select {
  display: flex;
  gap: 5px;
}
[data-month-details] {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.calc-chart-tooltip {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 6px;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--calc-cream);
  color: var(--calc-ink);
  font-size: 12px;
  line-height: 20px;
}
.calc-chart-tooltip strong {
  font-weight: 600;
}
.calc-chart-tooltip:empty {
  visibility: hidden;
}
.calc-donut [data-fee] {
  pointer-events: visiblePainted;
  cursor: pointer;
  transition: stroke-width 0.15s;
}
.calc-donut [data-fee]:hover,
.calc-donut [data-fee]:focus {
  stroke-width: 20;
  outline: none;
}
.calc-share {
  position: relative;
  flex-shrink: 0;
  z-index: 20;
}
.calc-share summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #ddd7cb;
  border-radius: 999px;
  background: #fff;
  color: #806020;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}
.calc-share summary::-webkit-details-marker {
  display: none;
}
.calc-share summary:hover {
  background: #f7f4ee;
}
.calc-share-items {
  position: absolute;
  top: 100%;
  right: 0;
  width: 240px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  background: #fff;
  border: 1px solid #ddd7cb;
  border-radius: 14px;
  box-shadow: 0 10px 30px #0002;
}
.calc-share-items > a,
.calc-share-items > button {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #292830;
  font: inherit;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.calc-share-items > [hidden] {
  display: none;
}
.calc-share-items .bi {
  width: 20px;
  text-align: center;
}
.calc-share-items > a:hover,
.calc-share-items > button:hover {
  background: #f7f4ee;
  color: #806020;
}
.calc-share :focus-visible {
  outline: 2px solid #ac8439;
  outline-offset: 2px;
}
.calc-share-status {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: #68656c;
  overflow-wrap: anywhere;
}
[data-share-countdown] {
  white-space: nowrap;
  margin-left: auto;
}
@media (max-width: 575.98px) {
  .calc-title-row {
    align-items: flex-start;
    gap: 10px;
  }
  .calc-share {
    margin-top: 18px;
  }
  .calc-share summary {
    padding: 10px;
  }
  .calc-share summary > span {
    display: none;
  }
}

.calc-rate-note [data-rate-note] {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.calc-pair:has([data-field="tax"]) .calc-label {
  min-height: 44px;
}

.calc-home-price-active .calc-summary > span {
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.25;
}
.calc-home-price-active .calc-summary strong {
  font-family: inherit;
  font-size: clamp(32px, 3vw, 40px);
  font-weight: 800;
  line-height: 1.15;
}
[data-afford-summary] > .calc-afford-guidance {
  text-align: center;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
}
.calc-fit-comfortable { color: #277039; }
.calc-fit-stretched { color: #9b5518; }
.calc-payment-slider {
  position: relative;
  margin: 0 14px 58px;
}
.calc-payment-slider [data-budget-target] {
  position: absolute;
  left: clamp(42px, var(--slider-position, 72%), calc(100% - 42px));
  transform: translateX(-50%);
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #e4dcc9;
  border-radius: 6px;
  background: #f7f4ee;
  color: #292929;
  font-size: 16px;
  white-space: nowrap;
}

.calc-payment-slider input[type="range"] {
  appearance: none;
  background: transparent;
  height: 26px;
  cursor: pointer;
}
.calc-payment-slider input::-webkit-slider-runnable-track { height: 4px; background: #d7d4cc; border-radius: 2px; }
.calc-payment-slider input::-webkit-slider-thumb { appearance: none; width: 26px; height: 26px; margin-top: -11px; border: 2px solid var(--calc-gold); border-radius: 50%; background: #fff; }
.calc-payment-slider input::-moz-range-track { height: 4px; background: #d7d4cc; border-radius: 2px; }
.calc-payment-slider input::-moz-range-thumb { width: 24px; height: 24px; border: 2px solid var(--calc-gold); border-radius: 50%; background: #fff; }

.calc-text-button.calc-disclaimer { color: #737373; font-size: 12px; font-weight: 400; }
.calc-text-button.calc-disclaimer:hover { color: var(--calc-gold); }
