/* AARI calculators — uses redesign tokens (navy, gold, lagoon, radii 6/10/16). */

.calc-preview-note { margin: 0; }

.calc-hub-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin: 0 0 32px;
}
@media (min-width: 700px) {
  .calc-hub-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .calc-hub-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.calc-hub-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: 22px 22px 20px;
  color: inherit;
  text-decoration: none;
  min-height: 100%;
}
.calc-hub-card:hover { border-color: var(--navy); color: inherit; }
.calc-hub-card h2 {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--navy);
}
.calc-hub-card p { margin: 0 0 14px; color: var(--slate); font-size: 16px; line-height: 1.5; flex: 1; }
.calc-hub-card .calc-hub-go { font-weight: 600; color: var(--lagoon); font-size: 15px; }

.calc-app {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 900px) {
  .calc-app { grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr); gap: 32px; }
  /* Sticky only when JS adds .is-sticky (the whole panel fits in the viewport). */
  .calc-results.is-sticky { position: sticky; top: 88px; }
}

.calc-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  padding: 22px 22px 20px;
}
.calc-panel + .calc-panel, .calc-fieldset + .calc-fieldset { margin-top: 16px; }
.calc-panel h2, .calc-fieldset h2 {
  font-size: 20px;
  margin: 0 0 16px;
  color: var(--navy);
}

.calc-fields { display: grid; gap: 14px; }
.calc-fields.two {
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .calc-fields.two { grid-template-columns: 1fr 1fr; }
}
.calc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.calc-field label, .calc-field .calc-label {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--navy);
}
.calc-field .hint, .calc-assume {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted, #5c6b7a);
}
.calc-assume { color: var(--gold-ink); }
.calc-field input:not([type="checkbox"]):not([type="radio"]),
.calc-field select, .calc-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--field-border, #667085);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  box-sizing: border-box;
}
.calc-field input:focus, .calc-field select:focus, .calc-field textarea:focus {
  outline: 2px solid var(--lagoon);
  outline-offset: 1px;
  border-color: var(--lagoon);
}
.calc-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  line-height: 1.4;
}
.calc-check input { width: 20px; height: 20px; min-height: 0; min-width: 0; margin-top: 2px; padding: 0; flex: none; box-sizing: border-box; }

.calc-app, .calc-panel, .calc-inputs, .calc-results, .calc-field, .calc-fields {
  max-width: 100%;
  min-width: 0;
}
.calc-actions .btn, .calc-next .btn { white-space: normal; }
.calc-seg {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  border: 2px solid var(--navy);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}
.calc-seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.calc-seg-wrap { position: relative; }
.calc-seg label {
  flex: 1 1 auto;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--navy);
  cursor: pointer;
  border-right: 1px solid var(--navy);
}
.calc-seg label:last-of-type { border-right: 0; }
.calc-seg input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.calc-seg input:checked + span,
.calc-seg label:has(input:checked) {
  background: var(--navy);
  color: #fff;
}
.calc-seg label:has(input:focus-visible) { outline: 2px solid var(--lagoon); outline-offset: -2px; }

.calc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.calc-actions .btn, .calc-next .btn, .calc-tools .btn { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.calc-actions button[type="button"].linkish,
.calc-text-btn {
  background: none;
  border: 0;
  color: var(--lagoon);
  font-weight: 600;
  font-family: var(--sans);
  font-size: 15px;
  cursor: pointer;
  padding: 8px 0;
  min-height: 44px;
}
.calc-text-btn:hover { color: var(--navy); }

.calc-results .calc-voice {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 16px;
}
.calc-headline-label {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold-ink);
}
.calc-headline {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(36px, 6vw, 52px);
  line-height: 1.05;
  color: var(--navy);
  margin: 0 0 16px;
  overflow-wrap: anywhere;
}
.calc-kicker { margin: -8px 0 16px; font-size: 15px; color: var(--slate); }

.calc-bars { display: grid; gap: 8px; margin: 0 0 16px; }
.calc-bar { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14.5px; min-width: 0; }
.calc-bar span:first-child { color: var(--slate); }
.calc-bar strong { color: var(--navy); text-align: right; }
.calc-bar-track {
  grid-column: 1 / -1;
  height: 8px;
  background: var(--mist, #F4F6F9);
  border-radius: 3px;
  overflow: hidden;
}
.calc-bar-fill { height: 100%; background: var(--navy); border-radius: 3px; max-width: 100%; }

.calc-table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 16px; }
.calc-table th, .calc-table td {
  text-align: left;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.calc-table th:last-child, .calc-table td:last-child, .calc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; }
.calc-table tfoot td { font-weight: 600; border-bottom: 0; color: var(--navy); }
.calc-table caption { text-align: left; font-weight: 600; color: var(--navy); margin-bottom: 6px; font-size: 15px; }

.calc-warn, .calc-note, .calc-disclaimer, .calc-rates {
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0 0 12px;
  color: var(--slate);
}
.calc-warn {
  background: var(--sand);
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
}
.calc-taxbox {
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 12px;
  margin: 0 0 16px;
  background: var(--sand);
  font-size: 14.5px;
}

.calc-compare { margin-top: 8px; overflow-x: auto; }
.calc-next, .calc-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.calc-links { margin: 16px 0 0; padding: 0; list-style: none; font-size: 15px; }
.calc-links li { margin: 0 0 6px; }

.calc-email {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.calc-email h2 { font-size: 18px; margin: 0 0 8px; }
.calc-email-status {
  font-size: 14.5px;
  line-height: 1.5;
  background: var(--mist, #F4F6F9);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin: 0 0 12px;
  color: var(--ink);
}
/* v28.42 CLS: reserve room for the longest status line */
.calc-email-status { min-height: 4.6em; }
@media (max-width: 600px) { .calc-email-status { min-height: 7.6em; } }
/* v28.42 CLS: reserve the results column before the calculator renders (heights measured at 1350 px, default inputs) */
@media (min-width: 901px) { [data-calc="mortgage"] #calc-output:empty { min-height: 1670px; } [data-calc="closing"] #calc-output:empty { min-height: 2030px; } [data-calc="seller"] #calc-output:empty { min-height: 1720px; } [data-calc="invest"] #calc-output:empty { min-height: 1850px; } [data-calc="affordability"] #calc-output:empty { min-height: 245px; } }
.calc-email-status[data-state="error"] { background: #fde8e8; }
.calc-email-status[data-state="ok"] { background: #e7f4ef; }
.calc-email-status[data-state="preview"] { background: var(--sand); }

.calc-chart { display: grid; gap: 6px; margin: 0 0 16px; }
.calc-chart-row { display: grid; grid-template-columns: 3.5em 1fr 1fr; gap: 8px; align-items: center; font-size: 13px; }
.calc-chart-pair { display: flex; height: 16px; background: var(--mist); border-radius: 3px; overflow: hidden; min-width: 0; }
.calc-chart-buy { background: var(--navy); height: 100%; }
.calc-chart-rent { background: var(--lagoon); height: 100%; }
.calc-legend { display: flex; gap: 16px; font-size: 13px; margin: 0 0 10px; }
.calc-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.calc-legend .buy { background: var(--navy); }
.calc-legend .rent { background: var(--lagoon); }

.calc-rates a { font-weight: 600; }

#print-sheet { display: none; }

@media print {
  .preview-banner, .skip-link, .site-header, footer, .mobile-bar, .cta-band,
  .page-hero, .no-print, .calc-actions, .calc-next, .calc-tools, .calc-email, .nav-toggle {
    display: none !important;
  }
  .calc-results { position: static !important; box-shadow: none; }
  body { background: #fff; }
  #print-sheet {
    display: block !important;
    font-size: 11pt;
    color: #000;
    max-width: 7.5in;
    margin: 0 auto;
  }
  #print-sheet h1 { font-size: 18pt; margin: 0 0 6pt; }
  #print-sheet table { width: 100%; border-collapse: collapse; }
  #print-sheet td, #print-sheet th { text-align: left; padding: 3pt 0; border-bottom: 0.4pt solid #ccc; }
  #print-sheet .num { text-align: right; }
  .calc-app, .calc-panel { display: none !important; }
  .calc-print-only-wrap { display: block !important; }
}

@media (max-width: 419px) {
  .calc-panel { padding: 16px 14px; }
  .calc-headline { font-size: 34px; }
  .calc-table { font-size: 14px; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* v2827: rent vs. buy, simpler form (Your numbers / Adjust assumptions / Results) */
[data-calc="rent"] .calc-panel { border-radius: 0; }
[data-calc="rent"] .rvb-block, [data-calc="rent"] .calc-results { border-top: 3px solid var(--navy); }
[data-calc="rent"] .rvb-block h2, [data-calc="rent"] .rvb-results-title { font-size: 22px; margin: 0 0 6px; padding-bottom: 10px; position: relative; }
[data-calc="rent"] .rvb-block h2::after, [data-calc="rent"] .rvb-results-title::after { content: none; display: none; background: none; width: 0; height: 0; }
[data-calc="rent"] .rvb-intro { margin: 0 0 16px; }
[data-calc="rent"] .calc-field .calc-label { font-weight: 600; font-size: 14.5px; color: var(--navy); text-transform: none; letter-spacing: normal; }
[data-calc="rent"] .rvb-intro, [data-calc="rent"] .rvb-more > p.hint { font-size: 14.5px; line-height: 1.45; color: var(--slate); }
[data-calc="rent"] .rvb-more { padding: 0; }
[data-calc="rent"] .rvb-more > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 12px 22px; font-family: var(--sans); font-weight: 600; font-size: 17px; color: var(--navy); }
[data-calc="rent"] .rvb-more > summary::-webkit-details-marker { display: none; }
[data-calc="rent"] .rvb-more > summary::after { content: none; display: none; background: none; width: 0; height: 0; }
[data-calc="rent"] .rvb-more[open] > summary::after { content: none; display: none; background: none; width: 0; height: 0; }
[data-calc="rent"] .rvb-more > summary:focus-visible { outline: 2px solid var(--lagoon); outline-offset: -2px; }
[data-calc="rent"] .rvb-more > :not(summary) { margin-left: 22px; margin-right: 22px; }
[data-calc="rent"] .rvb-more[open] { padding-bottom: 20px; }
[data-calc="rent"] .rvb-group { margin: 20px 22px 10px; font-family: var(--sans); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--gold-ink); }
[data-calc="rent"] .rvb-lead { font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.35; color: var(--navy); margin: 12px 0 14px; }
[data-calc="rent"] .rvb-sub { font-size: 18px; color: var(--navy); margin: 20px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 419px) {
  [data-calc="rent"] .rvb-more > summary { padding: 12px 14px; }
  [data-calc="rent"] .rvb-more > :not(summary) { margin-left: 14px; margin-right: 14px; }
  [data-calc="rent"] .rvb-group { margin-left: 14px; margin-right: 14px; }
  [data-calc="rent"] .rvb-lead { font-size: 19px; }
}
/* aari-v28.39: rent-vs-buy CLS */
/* Reserve the results height so the email box doesn't jump when the script fills #calc-output (desktop CLS 0.21). */
@media (min-width: 1024px) {
  [data-calc="rent"] #calc-output:empty { min-height: 2080px; }
}

/* v29.19.12 (Marcus 5:09 PM): segmented calc toggles use the same filled navy as .seg-btn[aria-pressed="true"].
   Unselected options are white, not transparent. The selected fill follows :checked (click, keyboard, and default). */
.calc-seg {
  background: #fff;
  border: 2px solid var(--navy, #0B2545);
  padding: 0;
  margin: 0;
  min-inline-size: 0;
  overflow: hidden;
}
.calc-seg label {
  background: #fff;
  color: var(--navy, #0B2545);
}
.calc-seg input:checked + span,
.calc-seg label:has(input:checked) {
  background: var(--navy, #0B2545);
  color: #fff;
}
/* Visible legend sits above the segment (not inside the bordered box), so it cannot double the label or cut the border. */
fieldset.calc-seg-wrap {
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
  background: transparent;
  overflow: visible;
}
fieldset.calc-seg-wrap > legend.calc-label {
  position: static;
  float: none;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  display: block;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, #5B6675);
  margin: 0 0 10px;
}

/* v3.1 (Marcus, Dec 3 2026 11:01-11:02 PM HST): one clean choice-group component for every calculator.
   One visible legend per group. Buttons share one width and one height (grid, equal tracks). The selected fill is the
   button's own span, which fills the whole button box edge to edge. Square corners, navy and gold. Radios stay real and keyboard-reachable. */
div.calc-choice { container: calcchoice / inline-size; min-width: 0; max-width: 100%; }
div.calc-choice > fieldset.calc-seg-wrap { border: 0; padding: 0; margin: 0; min-inline-size: 0; background: transparent; overflow: visible; }
div.calc-choice > fieldset.calc-seg-wrap > legend.calc-label.calc-label {
  position: static; float: none; width: auto; height: auto; overflow: visible; clip: auto; display: block;
  padding: 0; margin: 0 0 8px; font-size: 14.5px; font-weight: 600; letter-spacing: normal; text-transform: none; color: var(--navy, #0B2545);
}
div.calc-choice .calc-seg {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0;
  padding: 0; margin: 0; border: 2px solid var(--navy, #0B2545); border-radius: 0; overflow: visible; background: #fff; box-sizing: border-box;
}
div.calc-choice .calc-seg > label {
  position: relative; display: flex; flex: none; align-items: stretch; justify-content: stretch; margin: 0; padding: 0; border: 0; border-radius: 0; min-height: 48px; min-width: 0;
  background: #fff; color: var(--navy, #0B2545); font-weight: 600; font-size: 14.5px; line-height: 1.25; cursor: pointer; box-sizing: border-box;
}
div.calc-choice .calc-seg > label > span {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center; text-align: center; min-width: 0;
  padding: 8px 8px; margin: 0; background: #fff; color: var(--navy, #0B2545); box-sizing: border-box; overflow-wrap: anywhere;
}
div.calc-choice .calc-seg > label + label > span { box-shadow: inset 2px 0 0 var(--navy, #0B2545); }
div.calc-choice .calc-seg > label > input {
  position: absolute; left: 0; top: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important;
  margin: 0; opacity: 0; overflow: hidden; pointer-events: none;
}
div.calc-choice .calc-seg > label:hover > input:not(:checked) + span { background: var(--gold-pale, #F6EFD9); }
div.calc-choice .calc-seg > label > input:checked + span,
div.calc-choice .calc-seg > label:has(input:checked) { background: var(--navy, #0B2545); color: #fff; }
div.calc-choice .calc-seg > label > input:checked + span { background: var(--navy, #0B2545); color: #fff; }
div.calc-choice .calc-seg > label > input:focus-visible + span { outline: 3px solid var(--gold, #C9A227); outline-offset: -5px; }
@container calcchoice (max-width: 559px) {
  div.calc-choice .calc-seg.calc-seg--stack { grid-auto-flow: row; grid-auto-columns: minmax(0, 1fr); grid-auto-rows: 1fr; }
  div.calc-choice .calc-seg.calc-seg--stack > label + label > span { box-shadow: inset 0 2px 0 var(--navy, #0B2545); }
}
