.budget-finder { margin: 32px 0 38px; padding: 25px 26px 22px; border: 1px solid #b6c8e4; border-radius: 11px; background: linear-gradient(130deg, #f2f6fe, #fff 72%); scroll-margin-top: 18px; }
.budget-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; }
.budget-kicker { margin-bottom: 6px; color: var(--accent); font-size: 11px; font-weight: 700; }
.budget-heading h2 { font-size: 24px; letter-spacing: -.035em; }
.budget-city-label { color: var(--muted); font-size: 11px; }
.budget-intro { max-width: 790px; margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.9; word-break: keep-all; }
.budget-scope-note { margin-top: 16px; padding: 12px 14px; border: 1px solid #cbd8eb; border-left: 3px solid var(--accent); border-radius: 6px; background: #fff; color: var(--muted); font-size: 11px; line-height: 1.85; word-break: keep-all; overflow-wrap: anywhere; }
.budget-scope-note h3 { margin: 0 0 5px; color: var(--ink); font-size: 12px; }
.budget-scope-note details { margin-top: 6px; }
.budget-scope-note summary { width: fit-content; padding-block: 4px; color: var(--accent); cursor: pointer; }
.budget-primary { display: flex; align-items: end; gap: 12px; margin-top: 23px; }
.budget-field { display: grid; min-width: 0; gap: 7px; color: var(--ink); font-size: 12px; }
.budget-capital { flex: 1; max-width: 440px; font-weight: 700; }
.budget-input-wrap { display: flex; align-items: center; min-width: 0; gap: 9px; padding: 0 12px; border: 1px solid #c6d0df; border-radius: 6px; background: #fff; }
.budget-input-wrap:focus-within { outline: 2px solid #8aa8d6; outline-offset: 2px; }
.budget-input-wrap input { width: 100%; min-width: 0; height: 42px; border: 0; padding: 9px 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.budget-input-wrap > span { flex-shrink: 0; color: var(--muted); font-size: 12px; font-weight: 400; }
.budget-capital input { height: 48px; font-size: 20px; font-weight: 700; }
.budget-field select { width: 100%; min-height: 44px; padding: 9px 27px 9px 11px; border: 1px solid #c6d0df; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; }
.budget-field small { color: var(--muted); font-size: 10px; line-height: 1.7; font-weight: 400; word-break: keep-all; }
.budget-field:has([aria-invalid="true"]) .budget-input-wrap { border-color: #a24131; }
.budget-submit { display: inline-flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 50px; padding: 12px 18px; border: 1px solid var(--accent); border-radius: 6px; color: #fff; background: var(--accent); font-size: 13px; font-weight: 700; white-space: nowrap; }
.budget-submit:hover { filter: brightness(.95); }
.budget-submit:disabled { opacity: .65; cursor: wait; }
.budget-submit span { font-size: 20px; font-weight: 400; }
.budget-field-hint { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.budget-conditions { margin-top: 20px; border-top: 1px solid #d7e0ed; }
.budget-conditions > summary { min-height: 46px; padding-block: 13px; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; }
.budget-conditions > summary span { margin-left: 9px; color: var(--muted); font-size: 10px; font-weight: 400; }
.budget-conditions-note { margin-bottom: 16px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.budget-fields, .budget-cost-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 17px 20px; }
.budget-cost-fields { margin-top: 20px; padding-top: 20px; border-top: 1px solid #d7e0ed; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.budget-cost-fields + .budget-conditions-note { margin: 15px 0 0; }
.budget-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.budget-form-footer p { color: var(--muted); font-size: 10px; line-height: 1.75; }
.budget-reset { flex-shrink: 0; min-height: 32px; padding: 5px 0 5px 10px; border: 0; color: var(--muted); background: transparent; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.budget-error { margin-top: 12px; padding: 10px 12px; border: 1px solid #e6c3bb; border-radius: 5px; color: #8e3426; background: #fff7f4; font-size: 12px; line-height: 1.8; }
.budget-status { margin-top: 16px; color: var(--muted); font-size: 12px; line-height: 1.85; word-break: keep-all; }
.budget-results { margin-top: 21px; }
.budget-result-group + .budget-result-group { margin-top: 25px; }
.budget-result-heading { margin-bottom: 10px; font-size: 15px; letter-spacing: -.02em; }
.budget-result-heading span { margin-left: 7px; color: var(--muted); font-size: 11px; font-weight: 400; }
.budget-table { width: 100%; table-layout: fixed; border-collapse: collapse; border: 1px solid #d5dfed; background: #fff; font-size: 12px; line-height: 1.75; }
.budget-table thead th { padding: 10px 9px; color: var(--muted); background: #f4f6fa; font-size: 11px; font-weight: 400; text-align: left; }
.budget-table thead th:first-child { width: 24%; }
.budget-table thead th:nth-child(2) { width: 17%; }
.budget-table thead th:nth-child(3) { width: 18%; }
.budget-table th, .budget-table td { padding: 12px 9px 7px; text-align: left; vertical-align: top; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.budget-home > tr:first-child > th { font-weight: 700; }
.budget-home { border-bottom: 1px solid #d5dfed; }
.budget-home:last-child { border-bottom: 0; }
.budget-region { display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.budget-type { margin-left: 5px; color: var(--accent); white-space: nowrap; }
.budget-value { display: block; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; }
.budget-secondary { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.budget-badge { display: inline-block; margin-top: 5px; padding: 2px 5px; border-radius: 3px; color: #246b5c; background: #eaf4ee; font-size: 9px; font-weight: 700; }
.budget-badge-conditional { color: #725313; background: #fcf3db; }
.budget-badge-shortfall, .budget-badge-ineligible { color: #8b4134; background: #f9eeeb; }
.budget-pending { display: inline-block; margin-left: 5px; color: #906117; font-size: 9px; }
.budget-detail-row td { padding: 0 9px 10px; }
.budget-home-detail > summary { width: fit-content; min-height: 30px; padding-block: 6px; color: var(--accent); font-size: 10px; cursor: pointer; }
.budget-home-detail[open] { margin-top: 3px; padding: 8px 12px 12px; border-radius: 5px; background: #f6f8fc; }
.budget-reasons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin-top: 8px; }
.budget-reasons h4, .budget-costs h4 { margin: 0 0 5px; color: var(--ink); font-size: 11px; }
.budget-reasons ul { margin: 0; padding-left: 15px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.budget-costs { margin-top: 13px; }
.budget-costs dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 20px; margin: 0; font-size: 10px; }
.budget-costs dl > div { display: flex; align-items: start; justify-content: space-between; gap: 10px; color: var(--muted); }
.budget-costs dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.budget-option-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 15px; }
.budget-option { padding: 10px; border: 1px solid #d8e1ee; border-radius: 5px; background: #fff; }
.budget-option h4 { margin: 0; font-size: 11px; }
.budget-option p { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.budget-option ul { margin: 5px 0 0; padding-left: 14px; color: var(--muted); font-size: 10px; }
.budget-home-link { display: inline-flex; gap: 14px; align-items: center; min-height: 36px; margin-top: 10px; color: var(--accent); font-size: 11px; font-weight: 700; text-underline-offset: 3px; }
.budget-reference-note, .budget-warning { margin-top: 10px; color: var(--muted); font-size: 10px; line-height: 1.8; word-break: keep-all; }
.budget-warning { padding: 10px 12px; border: 1px solid #e5dac2; border-radius: 5px; color: #755623; background: #fffaf0; }
.budget-more { margin-top: 13px; }
.budget-more > summary { min-height: 38px; padding-block: 10px; color: var(--accent); font-size: 11px; cursor: pointer; }
.budget-method { margin-top: 17px; padding-top: 12px; border-top: 1px solid #d7e0ed; }
.budget-method > summary { min-height: 33px; padding-block: 7px; color: var(--muted); font-size: 11px; cursor: pointer; }
.budget-assumptions { padding: 7px 0 3px; color: var(--muted); font-size: 10px; line-height: 1.9; word-break: keep-all; }
.budget-assumptions p + p { margin-top: 7px; }
.budget-assumptions a { color: var(--accent); text-underline-offset: 3px; }
.budget-assumptions ul { margin: 7px 0 0; padding-left: 17px; }
@media (max-width: 850px) {
  .budget-finder { padding-inline: 20px; }
  .budget-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .budget-table thead th, .budget-table th, .budget-table td { padding-inline: 7px; }
  .budget-option-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  .budget-finder { margin: 24px 0 30px; padding: 21px 16px 17px; }
  .budget-heading h2 { font-size: 21px; }
  .budget-city-label { font-size: 10px; }
  .budget-intro { font-size: 12px; }
  .budget-primary { display: block; margin-top: 19px; }
  .budget-capital { max-width: none; }
  .budget-submit { width: 100%; min-height: 46px; margin-top: 10px; }
  .budget-conditions > summary span { display: block; margin: 4px 0 0 14px; }
  .budget-fields, .budget-cost-fields { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .budget-form-footer { align-items: start; }
}

/* Six result columns need more room than tablet and unfolded-phone viewports. */
@media (max-width: 1100px) {
  .budget-table { display: block; border: 0; background: transparent; }
  .budget-table caption, .budget-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .budget-table .budget-home { display: block; margin-bottom: 12px; padding: 0 13px; border: 1px solid #d5dfed; border-radius: 7px; background: #fff; }
  .budget-table .budget-home:last-child { border-bottom: 1px solid #d5dfed; }
  .budget-table tr { display: block; }
  .budget-table th, .budget-table td { display: block; width: auto; padding: 7px 0; }
  .budget-table .budget-home > tr:first-child > th { padding: 13px 0 11px; border-bottom: 1px solid #e6ebf3; font-size: 13px; }
  .budget-table td[data-label] { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 1px 9px; }
  .budget-table td[data-label]::before { grid-row: 1 / 8; content: attr(data-label); padding-top: 1px; color: var(--muted); font-size: 10px; }
  .budget-table .budget-detail-row td { padding: 2px 0 9px; }
  .budget-reasons, .budget-costs dl { grid-template-columns: minmax(0, 1fr); }
  .budget-home-detail[open] { padding-inline: 9px; }
}

.budget-guarantee { display: flex; align-items: start; gap: 9px; margin-top: 20px; padding-top: 17px; border-top: 1px solid #d7e0ed; font-size: 11px; line-height: 1.8; }
.budget-guarantee input { flex: 0 0 auto; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.budget-guarantee strong { font-size: 12px; font-weight: 700; }
.budget-guarantee small { display: block; color: var(--muted); font-size: 10px; }

.budget-borrow-mode { min-width: 0; margin: 19px 0 0; padding: 0; border: 0; }
.budget-borrow-mode legend { margin-bottom: 8px; padding: 0; color: var(--ink); font-size: 12px; font-weight: 700; }
.budget-mode-switch { display: flex; width: fit-content; gap: 4px; padding: 4px; border: 1px solid #cbd7e8; border-radius: 7px; background: #f5f8fd; }
.budget-mode-switch label { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 13px; border-radius: 4px; color: var(--muted); font-size: 12px; cursor: pointer; }
.budget-mode-switch label:has(input:checked) { color: var(--accent); background: #fff; box-shadow: 0 1px 3px #183c7420; font-weight: 700; }
.budget-mode-switch input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.budget-borrow-mode > p { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.budget-results-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; margin-top: 19px; padding-top: 14px; border-top: 1px solid #d7e0ed; }
.budget-scenario { color: var(--accent); font-size: 12px; font-weight: 700; }
.budget-view-controls > label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.budget-results-toolbar select { min-height: 36px; padding: 7px 28px 7px 9px; border: 1px solid #c6d0df; border-radius: 5px; color: var(--ink); background: #fff; font: inherit; }
.budget-sort-hint { grid-column: 1 / -1; color: var(--muted); font-size: 10px; line-height: 1.8; }
@media (max-width: 650px) {
  .budget-mode-switch { width: 100%; }
  .budget-mode-switch label { flex: 1; justify-content: center; padding-inline: 6px; font-size: 11px; }
  .budget-results-toolbar { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .budget-view-controls > label { justify-content: space-between; }
  .budget-results-toolbar select { min-width: 145px; }
}

.budget-view-controls { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 9px 14px; }
.budget-size-filter { min-width: 0; margin: 0; padding: 0; border: 0; }
.budget-size-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; max-width: 100%; padding: 3px; border: 1px solid #cbd7e8; border-radius: 6px; background: #f5f8fd; }
.budget-size-switch label { display: inline-flex; align-items: center; justify-content: center; min-width: 43px; min-height: 30px; padding: 5px 8px; border-radius: 3px; color: var(--muted); font-size: 11px; cursor: pointer; }
.budget-size-switch label:has(input:checked) { color: var(--accent); background: #fff; box-shadow: 0 1px 3px #183c7420; font-weight: 700; }
.budget-size-switch label:has(input:focus-visible) { outline: 2px solid #8aa8d6; outline-offset: 1px; }
.budget-size-switch input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.budget-empty { padding: 18px 15px; border: 1px solid #d5dfed; border-radius: 6px; color: var(--muted); background: #fff; font-size: 12px; line-height: 1.8; }
@media (max-width: 650px) {
  .budget-view-controls { justify-content: space-between; gap: 8px; }
  .budget-size-switch label { min-width: 39px; padding-inline: 5px; }
  .budget-view-controls > label { gap: 6px; }
}

.budget-bank-notice { margin-bottom: 17px; padding: 11px 13px; border: 1px solid #cfddf0; border-radius: 6px; color: var(--muted); background: #f0f5fd; font-size: 11px; line-height: 1.8; word-break: keep-all; }
.budget-bank-notice p:first-child { color: var(--accent); font-weight: 700; }
.budget-bank-notice p + p { margin-top: 3px; }
.budget-bank-assessment { margin-top: 8px; color: var(--muted); font-size: 10px; line-height: 1.85; }
.budget-bank-assessment p + p { margin-top: 4px; }
.budget-bank-reference { color: var(--accent); }

.budget-product-toggles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-column: 1 / -1; gap: 9px 20px; min-width: 0; margin: 3px 0 0; padding: 0; border: 0; }
.budget-product-toggles > label { display: inline-flex; align-items: start; gap: 8px; width: fit-content; min-height: 36px; padding-block: 7px; color: var(--ink); font-size: 12px; cursor: pointer; }
.budget-product-toggles input { appearance: none; position: relative; flex-shrink: 0; width: 32px; height: 18px; margin: 0; border: 1px solid #b6c5d9; border-radius: 999px; background: #ced8e7; cursor: pointer; }
.budget-product-toggles input::before { content: ""; display: block; width: 12px; height: 12px; margin: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #1b365c22; transition: transform .15s ease; }
.budget-product-toggles input:checked { border-color: var(--accent); background: var(--accent); }
.budget-product-toggles input:checked::before { transform: translateX(14px); }
.budget-product-toggles input:focus-visible { outline: 2px solid #8aa8d6; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .budget-product-toggles input::before { transition: none; } }
.budget-product-toggles small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.7; font-weight: 400; }
.budget-bank-toggle-notice { margin-top: 12px; padding: 11px 13px; border: 1px solid #d3dff0; border-radius: 6px; color: #385477; background: #f1f6ff; font-size: 11px; line-height: 1.85; word-break: keep-all; }
@media (max-width: 650px) {
  .budget-product-toggles { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .budget-product-toggles > label { min-height: 35px; font-size: 11px; }
}

.budget-other-sizes { flex-basis: 100%; min-width: 0; }
.budget-other-sizes summary { padding: 7px 8px; color: var(--muted); font-size: 11px; cursor: pointer; }
.budget-other-sizes > div { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; max-height: 200px; overflow-y: auto; }
.budget-other-sizes:has(input:checked) summary { color: var(--accent); font-weight: 700; }
