/* Visitor-facing type. Relative sizes respect browser reading preferences. */
:root {
  --reading-copy: 1rem;
  --reading-label: .9375rem;
  --reading-note: .875rem;
}
:root:not([data-theme="dark"]) { --muted: #565c57; }
:root[data-theme="dark"] { --muted: #c2c8c4; }
body { font-size:var(--reading-copy); }

body :is(.discover-intro .subhead, .hero-row .subhead) {
  font-size:1.0625rem;
  line-height:1.55;
}
body :is(.section-desc, .category-sheet .category-description, .map-topline p,
  .discover-next p:not(.eyebrow), .score-heading p, .local-quality-section > p,
  .threeway-budget > p, .explain-card p, .source-card p, .source-card li,
  .referral-process p, .side-note p, .partner-review-note p, .partner-receipt p,
  .modal-copy, .field label, .partner-form-card legend) {
  font-size:var(--reading-copy);
  line-height:1.55;
}
body :is(.info-note, .result-notice, .budget-footnote, .score-method, .local-intro,
  .local-place, .local-empty, .local-limit, .crime-data-note, .same-state-note,
  .check-row, .cash-details p, .projection p, .cta-strip p, .care-cta p, .errors,
  .intake-error, .hospital-list, .city-source-note, .saved-item small) {
  font-size:var(--reading-label);
  line-height:1.55;
}
body :is(.field .hint, .city-picker .hint, .partner-required, .partner-permission,
  .intake-route small, .intake-consent, .intake-foot, .benefit p, .benchmark-mini p,
  .glance-footer small, .discover-footnote, .discover-source, .discover-caveat,
  .map-feedback, .map-legend, .map-bottom p, .local-metric small, .location-help,
  .computed-payment small, .metric small, .source-meta small, .budget-table .method,
  .living-table small, .care-cta small, .city-results small, .intake-reference) {
  font-size:var(--reading-note);
  line-height:1.5;
}

body :is(.discover-table, .discover-table:not(.quick-table), .snapshot-facts .quick-table,
  .living-table, .budget-table, .method-table, .score-table) {
  font-size:var(--reading-copy);
}
body :is(.quick-table.three-places td, .quick-table.three-places tbody th,
  .living-table .row-title, .budget-table .expense-title, .budget-table .difference,
  .budget-table .total td, .cash-row, .local-metric > span, .adjust-row) {
  font-size:var(--reading-label);
}
body :is(.discover-table thead th, .discover-table:not(.quick-table) thead th,
  .quick-table.three-places thead th, .comparison-values thead th small,
  .discover-table th small, .city-score-caption, .category-sheet header span,
  .score-denom, .living-table th, .budget-table th, .budget-table .unknown td,
  .method-table th, .method-table td, .metric .label, .source-meta strong) {
  font-size:var(--reading-note);
  line-height:1.4;
}
body .discover-table th small { margin-top:.25em; }

body :is(.discover-select label, .location-bar .state-fields label, .location-title > span,
  .map-mode button, .map-topline .badge, .card-top .badge, .pill,
  .budget-tabs small, .header-inner nav a, .header-inner .nav-contact, .theme-toggle,
  .header-save, .site-footer > div, .site-footer > div a, .site-footer button, .trust-strip) {
  font-size:var(--reading-note);
}
body :is(.category-tabs button, .housing-header .segment button, .segment button,
  .step, .step > span:last-child, .btn, .btn.small, .agent-float, .result-actions .btn, .form-footer .btn,
  .text-btn, .local-card .text-btn, .glance-footer a, .city-link, .reset-estimate) {
  font-size:var(--reading-label);
  line-height:1.35;
}
body :is(.discover-select select, .discover-selectors.with-alt select,
  .slot-field select, .field input, .field select, .field textarea, .living-table input) {
  font-size:var(--reading-copy);
}
.glance-footer { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 12px; }
.glance-footer small { flex-basis:100%; }
.map-mode { flex-wrap:wrap; }
.discover-selectors > *, .result-actions > *, .state-fields > * { min-width:0; }
.category-tabs button { min-width:0; }

@media (min-width:821px) {
  .discover-top { grid-template-columns:minmax(0,1.45fr) minmax(345px,1fr); }
}
@media (max-width:820px) {
  .map-feedback { text-align:start; }
}
@media (max-width:600px) {
  .header-inner nav a, .header-inner .nav-contact { min-height:38px; }
  .header-inner nav { row-gap:2px; }
  .living-table td { overflow-wrap:anywhere; }
  .discover-table.three-places th, .budget-table th { overflow-wrap:anywhere; }
  .quick-table.three-places .best-check { display:block; }
  .category-tabs button { padding-inline:5px; }
}

body :is(.glance-top .eyebrow,.eyebrow,.section-number) { font-size:.8125rem; }
body .step .num { font-size:var(--reading-note); }
.map-state text { font-size:17px; }
.map-inset-caption { font-size:14px; }
.measure-table { container-type:inline-size; min-width:0; }
/* At narrow widths, use a full-width measure label above the aligned state values. */
@container (max-width:350px) {
  .measure-table table { display:block; }
  .measure-table :is(thead,tbody) { display:block; }
  .measure-table tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .measure-table .three-places tr { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .measure-table .discover-table tr > th:first-child { grid-column:1/-1; width:auto; }
  .measure-table .discover-table thead th,
  .measure-table .discover-table tbody td { text-align:center; padding:6px 2px; }
  .measure-table .discover-table tr > th:first-child { text-align:start; }
  .measure-table .discover-table tbody th { border-bottom:0; padding:10px 4px 3px; }
  .measure-table .discover-table th[scope=row] small { display:inline-block; margin:0 0 0 .4em; }
  .measure-table .discover-table tbody td { overflow-wrap:anywhere; padding-bottom:9px; }
  .measure-table .best-check { display:block; line-height:1; }
  .measure-table td:not(.best-value) { align-content:end; }
}
@media(min-width:601px) and (max-width:1240px) {
  .site-header { height:auto; }
  .header-inner { flex-wrap:wrap; padding-top:12px; gap:6px 16px; }
  .header-actions { margin-left:auto; }
  .header-inner nav { width:100%; height:auto; order:3; flex-wrap:wrap; justify-content:space-between; gap:4px 12px; margin:0; }
  .header-inner nav :is(a,button) { min-height:38px; display:inline-flex; align-items:center; }
  .header-inner nav a.active:after { bottom:0; }
}
@media(max-width:600px) {
  .discover-top > *, .discover-selectors { min-width:0; }
  .discover-selectors, .discover-selectors.with-alt { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .discover-selectors.with-alt .discover-select:first-child { grid-column:1/-1; }
  .header-inner .nav-contact { white-space:normal; }
  .header-inner nav .youtube-nav { gap:1px; }
  .header-inner nav .youtube-nav span { font-size:.75em; }
}

@media(max-width:600px) {
  .result-grid > * { min-width:0; }
  .budget-top, .projection-head { flex-wrap:wrap; }
  .budget-table, .budget-table thead, .budget-table tbody { display:block; }
  .budget-table tr { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
  .budget-table tr > :first-child, .budget-table td[colspan] { grid-column:1/-1; }
  .budget-table th, .budget-table td { padding:5px 3px; text-align:right; white-space:normal; overflow-wrap:anywhere; }
  .budget-table td:first-child { border-bottom:0; padding-top:12px; }
  .budget-table .expense-title { max-width:none; }
  .budget-table .method { margin-left:0; color:var(--muted); }
}

body :is(.budget-table .method, .budget-table .unknown td, .input-wrap .prefix, .input-wrap .suffix) { color:var(--muted); }
@media(min-width:1141px) {
  .comparison-deck .category-tabs { flex-wrap:nowrap; }
  .comparison-deck .category-tabs button { padding-inline:7px; gap:5px; }
}
@media(min-width:701px) and (max-width:1140px) {
  .comparison-deck .category-tabs { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); }
}
