/* Shared calculator layout. The site header and footer use their own stylesheets. */
:root {
    --red: #b81920;
    --ink: #202123;
    --muted: #606367;
    --line: #dedcd8;
    --paper: #f4f3f0;
}
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    color: var(--ink);
    font: 400 16px/1.6 Lato,"Segoe UI",Arial,sans-serif;
    background: #fff;
}
button,input,select {
    font: inherit;
}
button,a,input,select {
    outline-offset: 3px;
}
a {
    color: var(--red);
}
button {
    cursor: pointer;
}
[hidden] {
    display: none !important;
}
.wrap {
    width: min(1200px,calc(100% - 64px));
    margin-inline: auto;
}
.msj-header-spacer {
    display: none;
}
.msj-header--hero:not(.is-docked) {
    position: absolute;
    top: 0;
    left: 0;
}
.hero {
    padding: 124px 0 64px;
    color: #fff;
    background-color: #202123;
    background-image: linear-gradient(90deg,rgba(10,12,14,.78),rgba(10,12,14,.18)),url("/img/mr-10.webp");
    background-position: center;
    background-size: cover;
}
.crumb {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: #e6e6e6;
    font-size: 13px;
    margin: 0 0 28px;
}
.crumb a {
    color: inherit;
    text-decoration: none;
}
.kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    margin: 0 0 10px;
}
.kicker:before {
    content: "";
    width: 23px;
    height: 2px;
    background: currentColor;
}
.hero .kicker {
    color: #ff9296;
}
.hero h1 {
    font-size: clamp(32px,4vw,50px);
    line-height: 1.15;
    margin: 0 0 12px;
    letter-spacing: -.025em;
}
.hero p:last-child {
    margin: 0;
    color: #e3e3e3;
    font-size: 18px;
}
.section {
    padding: 68px 0;
}
.section h2 {
    margin: 0 0 8px;
    font-size: clamp(25px,3vw,37px);
    line-height: 1.2;
    letter-spacing: -.025em;
}
.intro {
    color: var(--muted);
    margin: 0 0 24px;
}
.search-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 25px 0 16px;
}
.search-row input {
    flex: 1;
    min-width: 180px;
}
.search-row select {
    min-width: 190px;
}
input,select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbc8c3;
    background: #fff;
    border-radius: 3px;
    color: var(--ink);
    min-width: 0;
}
input:focus,select:focus {
    border-color: var(--red);
    outline: 2px solid #b8192022;
}
.search-row select {
    width: auto;
}
.group-title {
    font-size: 20px;
    margin: 30px 0 14px;
}
.tool-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 20px;
}
.tool-card {
    padding: 25px;
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: border-color .2s;
}
.tool-card:has(a):hover {
    border-color: var(--red);
}
.tool-icon {
    color: var(--red);
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
}
.tool-icon svg {
    width: 100%;
    height: 100%;
}
.tool-card h3 {
    font-size: 21px;
    line-height: 1.3;
    margin: 0 0 8px;
}
.tool-card p {
    font-size: 15px;
    color: var(--muted);
    margin: 0 0 20px;
    flex: 1;
}
.card-link {
    display: block;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    color: var(--red);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.pending {
    color: #747474;
    font-size: 12px;
    font-weight: 400;
}
.info-note {
    color: var(--muted);
    font-size: 13px;
    margin: 24px 0 0;
}
.purchase {
    background: var(--paper);
}
.topline {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}
.back {
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 18px;
}
.workspace {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1.04fr);
    gap: 24px;
    align-items: start;
}
.panel {
    min-width: 0;
    background: white;
    border: 1px solid var(--line);
}
.panel-head {
    padding: 23px 26px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.panel-head h3 {
    font-size: 21px;
    margin: 0;
}
.panel-head small {
    color: var(--muted);
    font-size: 12px;
}
.panel-body {
    padding: 25px 26px;
}
.field-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 16px;
}
.field {
    display: block;
    min-width: 0;
}
.field>span {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 6px;
}
.field.full {
    grid-column: 1/-1;
}
.field small {
    font-size: 11px;
    display: block;
    margin-top: 5px;
    color: var(--muted);
}
.group {
    border: 0;
    padding: 0 0 22px;
    margin: 0 0 20px;
    border-bottom: 1px solid var(--line);
    min-width: 0;
}
.group legend {
    font-size: 16px;
    font-weight: 700;
    padding: 0;
    margin-bottom: 15px;
}
.group:last-of-type {
    margin-bottom: 0;
}
.pair {
    display: grid;
    grid-template-columns: minmax(0,1.5fr) minmax(0,1fr);
    gap: 8px;
}
.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 19px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 19px;
    min-height: 44px;
    background: var(--red);
    color: white;
    border: 1px solid var(--red);
    border-radius: 3px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.btn.outline {
    background: white;
    color: var(--ink);
    border-color: #ccc9c5;
}
.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.estimate-title {
    color: var(--muted);
    text-align: center;
    font-size: 13px;
    margin: 0;
}
.donut {
    width: 214px;
    max-width: 100%;
    aspect-ratio: 1;
    position: relative;
    border-radius: 50%;
    margin: 20px auto;
    background: #e6e2dc;
    display: grid;
    place-items: center;
}
.donut-inner {
    width: 79%;
    height: 79%;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.donut-inner strong {
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -.035em;
}
.donut-inner small {
    font-size: 12px;
    color: var(--muted);
}
.breakdown {
    margin: 15px 0;
}
.line {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #ebe9e6;
    font-size: 14px;
}
.line .label {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
}
.swatch {
    width: 10px;
    height: 10px;
    flex: none;
    border-radius: 1px;
}
.line strong {
    font-variant-numeric: tabular-nums;
}
.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-top: 20px;
}
.metric {
    padding: 14px;
    background: #fff;
    min-width: 0;
}
.metric span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}
.metric strong {
    display: block;
    font-size: 19px;
    overflow-wrap: anywhere;
}
.estimate-note {
    padding: 13px 14px;
    background: var(--paper);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
    margin-top: 18px;
}
.warning {
    color: #8e2528;
    font-size: 12px;
    margin: 10px 0;
}
.schedule {
    margin-top: 25px;
}
.schedule h3 {
    margin: 0 0 4px;
    font-size: 21px;
}
.table-scroll {
    overflow: auto;
}
.schedule table,.report table {
    border-collapse: collapse;
    width: 100%;
    font-variant-numeric: tabular-nums;
}
.schedule th,.schedule td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: right;
    white-space: nowrap;
    font-size: 13px;
}
.schedule th {
    background: var(--paper);
    font-weight: 700;
}
.schedule th:first-child,.schedule td:first-child {
    text-align: left;
}
.schedule summary {
    cursor: pointer;
    color: var(--red);
    font-weight: 700;
    padding: 12px 0;
}
.report-view {
    background: #eeece9;
    padding: 115px 0 48px;
}
.report-toolbar {
    width: min(800px,calc(100% - 32px));
    margin: 0 auto 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.report {
    width: min(8.5in,calc(100% - 32px));
    margin: auto;
    background: #fff;
    padding: .45in .48in;
    box-shadow: 0 3px 24px #00000012;
    min-height: 10in;
    display: flex;
    flex-direction: column;
    font-size: 13px;
    line-height: 1.45;
    color: #202123;
}
.report-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border-bottom: 2px solid var(--red);
    padding-bottom: 15px;
}
.report-head img {
    width: 175px;
    height: auto;
    object-fit: contain;
}
.report-company {
    text-align: right;
    font-size: 11px;
    color: #555;
}
.report-company strong {
    display: block;
    font-size: 12px;
    color: #222;
}
.report h1 {
    font-size: 25px;
    margin: 20px 0 3px;
    line-height: 1.2;
}
.report-sub {
    font-size: 12px;
    color: #666;
    margin: 0 0 18px;
}
.report-payment {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-block: 1px solid var(--line);
    padding: 12px 0;
    margin-bottom: 18px;
}
.report-payment strong {
    font-size: 28px;
    color: var(--ink);
    line-height: 1.1;
}
.report-payment span {
    font-weight: 700;
}
.report-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}
.report h2 {
    font-size: 15px;
    margin: 0 0 8px;
}
.report td {
    padding: 7px 0;
    border-bottom: 1px solid #dedcd8;
    font-size: 12px;
    vertical-align: top;
}
.report td:last-child {
    text-align: right;
    font-weight: 700;
    padding-left: 10px;
}
.report-note {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    font-size: 11px;
    color: #444;
    margin: 17px 0;
}
.report-footer {
    margin-top: auto;
    border-top: 1px solid #aaa;
    padding-top: 13px;
    color: #222;
    break-inside: avoid;
}
.report-footer .msj-footer-compliance {
    display: grid;
    grid-template-columns: 155px minmax(0,1fr);
    gap: 15px;
    align-items: start;
    background: white;
    border: 0;
    padding: 0;
}
.report-footer .msj-footer-equal {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.report-footer .msj-footer-equal img {
    width: 43px;
    height: auto;
    flex: none;
    filter: grayscale(1) brightness(0);
}
.report-footer .msj-footer-equal strong,.report-footer .msj-footer-equal span,.report-footer .msj-footer-equal a {
    display: block;
    font-size: 10px;
    line-height: 1.4;
}
.report-footer .msj-footer-equal a span {
    display: inline;
}
.report-footer p {
    font-size: 10px;
    line-height: 1.45;
    margin: 0 0 5px;
    white-space: pre-line;
}
.report-footer a {
    color: #222;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.report-footer strong {
    color: #222;
}
.report-footer .msj-footer-equal a {
    font-weight: 700;
}
.report-footer .msj-footer-equal strong {
    font-size: 11px;
}
.report-footer .msj-footer-disclosures a {
    font-weight: 700;
}
.report-url {
    font-size: 10px;
    margin: 8px 0 0;
    text-align: right;
    color: #555;
}
.report-footer a:after {
    content: none;
}
.screen-report-label {
    font-size: 12px;
    color: #606367;
}
.error {
    color: #a51b23;
    font-size: 13px;
    margin: 12px 0;
}
.preview-tag {
    font-size: 12px;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #555;
    font-weight: 700;
}
.report-active .msj-header,.report-active .msj-footer,.report-active .hero {
    display: none;
}
.report-active .report-view {
    padding-top: 28px;
}
.skip {
    position: absolute;
    left: 16px;
    top: -100px;
    z-index: 100;
    background: white;
    padding: 10px;
}
.skip:focus {
    top: 8px;
}
@media (max-width:800px) {
    .wrap {
        width: calc(100% - 36px);
    }
    .hero {
        padding: 112px 0 42px;
    }
    .section {
        padding: 40px 0;
    }
    .tool-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
    .workspace {
        grid-template-columns: 1fr;
    }
    .report {
        padding: 24px;
        min-height: 0;
    }
    .report-columns {
        gap: 16px;
    }
    .report-footer {
        margin-top: 25px;
    }
}
@media (max-width:520px) {
    .tool-grid,.field-grid,.report-columns {
        grid-template-columns: 1fr;
    }
    .field.full {
        grid-column: auto;
    }
    .tool-card {
        padding: 20px;
    }
    .panel-head,.panel-body {
        padding: 18px;
    }
    .search-row select {
        width: 100%;
    }
    .hero h1 {
        font-size: 32px;
    }
    .report-head img {
        width: 125px;
    }
    .report-company {
        font-size: 10px;
    }
    .report-company strong {
        font-size: 11px;
    }
    .report h1 {
        font-size: 22px;
    }
    .report-payment {
        align-items: start;
        flex-direction: column;
        gap: 4px;
    }
    .report-footer .msj-footer-compliance {
        grid-template-columns: 1fr;
    }
    .report {
        padding: 18px;
    }
    .donut-inner strong {
        font-size: 25px;
    }
}

/* Buying power highlights and accessible validation. */
.buying-price {
    color: var(--ink);
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    margin: 8px 0 24px;
    overflow-wrap: anywhere;
}
[aria-invalid="true"] { border-color: #b81920 !important; }
.donut-inner strong { overflow-wrap: anywhere; }

/* Shared results for the consumer planning calculators. */
.scenario-label { margin: 0; color: #606367; font-weight: 700; }
.scenario-total { font-size: clamp(26px, 4vw, 42px); font-weight: 700; line-height: 1.2; margin: 8px 0 20px; overflow-wrap: anywhere; }
.scenario-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14px; }
.scenario-table caption { font-weight: 700; text-align: left; padding-bottom: 8px; }
.scenario-table td, .scenario-table th { padding: 9px 4px; border-bottom: 1px solid #dedcd8; text-align: left; overflow-wrap: anywhere; }
.scenario-table td:last-child { text-align: right; font-weight: 700; }
.scenario-scroll { overflow-x: auto; }
#scenario-schedule summary { cursor: pointer; font-weight: 700; margin: 14px 0; }
#scenario-schedule th, #scenario-schedule td { white-space: nowrap; }

/* Shared optional location controls; no separate calculator page. */
.calculator-tool .calc-location { margin: 0 0 24px; }
.calc-location .panel-head h3 small { font-weight: 400; }
.calc-location-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto; gap:12px; align-items:end; }
.calc-location-grid .field { margin:0; min-width:0; }
.calc-location-grid .btn { min-height:46px; white-space:normal; }
.calc-location .metrics { grid-template-columns:repeat(auto-fit,minmax(175px,1fr)); margin:16px 0; }
.calc-location .metric strong { overflow-wrap:anywhere; font-size:15px; }
.calc-location .actions { align-items:center; flex-wrap:wrap; }
.calc-location .actions .info-note { flex:1; margin:0; }
.calc-housing-builder { margin-top:16px; border-top:1px solid #dedbd7; padding-top:16px; }
.calc-housing-builder summary { cursor:pointer; font-weight:700; }
.calc-housing-builder .field-grid { margin:16px 0; }
@media(max-width:650px){.calc-location-grid{grid-template-columns:1fr}.calc-location .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.calc-location .actions .info-note{flex-basis:100%}}
.calc-compare { margin-top:24px; }
.calc-compare summary { cursor:pointer; font-weight:700; }
.calc-compare .field-grid { margin:16px 0; }
.calc-compare .scenario-table { min-width:550px; }


/* Shared field alignment: equal label tracks, control tracks and hint tracks.
   A wrapped label must not shift its control below its neighbor. */
.calculator-tool .field-grid { align-items: start; }
.calculator-tool .field-grid .field > :is(input,select),
.calculator-tool .pair input, .calculator-tool .calc-location-grid :is(input,select) { height: 46px; box-sizing: border-box; }
.calculator-tool .field-grid > .field > span { line-height: 1.4; }
@supports (grid-template-rows: subgrid) {
    .calculator-tool .field-grid { row-gap: 0; }
    .calculator-tool .field-grid > .field {
        display: grid;
        grid-row: span 3;
        grid-template-rows: subgrid;
        row-gap: 0;
        align-self: stretch;
        padding-bottom: 16px;
    }
    .calculator-tool .field-grid > .field > span { grid-row: 1; align-self: end; }
    .calculator-tool .field-grid > .field > :is(input,select,.pair) { grid-row: 2; align-self: start; }
    .calculator-tool .field-grid > .field > small { grid-row: 3; align-self: start; }
}
@supports not (grid-template-rows: subgrid) {
    @media (min-width: 521px) { .calculator-tool .field-grid > .field > span { min-height: 2.8em; } }
}
/* White card surfaces, independent borders: no grey empty grid cells. */
.calculator-tool .calc-location .metrics {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 10px;
    background: transparent;
    border: 0;
}
.calculator-tool .calc-location .metric { border: 1px solid var(--line); border-radius: 3px; }
.calculator-tool .calc-location .metric strong { line-height: 1.45; }
@media (max-width: 800px) { .calculator-tool .calc-location .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 420px) { .calculator-tool .calc-location .metrics { grid-template-columns: 1fr; } }

/* Location references use independent cards, including partial last rows. */
#calc-location .calc-location-tools { display:flex; justify-content:flex-end; margin-top:10px; }
#calc-location #calc-location-details { grid-template-columns:repeat(3,minmax(0,1fr)); background:transparent; border:0; gap:10px; }
#calc-location #calc-location-details .metric { border:1px solid var(--line); border-radius:3px; background:#fff; }
@media(max-width:800px){#calc-location #calc-location-details{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:420px){#calc-location #calc-location-details{grid-template-columns:1fr}}
