/* ============================================================
   HomeAffordabilityCalc.info — Shared Design System
   Aesthetic: Zillow editorial + Wealthfront dashboard + Realtor.com data density
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@300;400;600&display=swap');

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Teal palette */
  --teal:        #0D6E6E;
  --teal-dark:   #0A5A5A;
  --teal-mid:    #14918A;
  --teal-pale:   #E6F5F4;
  --teal-ultra:  #F2FAF9;

  /* Gold palette */
  --gold:        #C9933A;
  --gold-dark:   #A67328;
  --gold-bright: #E8B450;
  --gold-pale:   #FDF6E8;
  --gold-ultra:  #FEF9F0;

  /* Background */
  --bg-page:     #F4F1EC;
  --bg-surface:  #FFFFFF;

  /* Text */
  --text-primary: #1A1F2E;
  --text-muted:   #5C6478;
  --text-light:   #8A94A8;

  /* Border */
  --border:      #DDD8CE;

  /* Status */
  --ok-color:    #0D6E6E;
  --warn-color:  #C9933A;
  --over-color:  #C0392B;

  /* Spacing scale */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;

  /* Border radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Shadows */
  --shadow-card:     0 4px 24px rgba(13, 110, 110, .13);
  --shadow-elevated: 0 12px 48px rgba(13, 110, 110, .18);
  --shadow-micro:    0 1px 6px rgba(13, 110, 110, .08);

  /* Transitions */
  --t-micro:    180ms ease;
  --t-normal:   280ms ease;
  --t-layout:   420ms ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color var(--t-micro);
}

a:hover {
  color: var(--teal-mid);
}

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

p {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.page-body {
  min-height: 100vh;
  background: var(--bg-page);
}

.content-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

@media (min-width: 480px) {
  .content-wrap {
    padding: 0 var(--sp-6);
  }
}

@media (min-width: 920px) {
  .content-wrap {
    padding: 0 var(--sp-8);
  }
}

/* Two-column layout: main + sidebar */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
}

@media (min-width: 680px) {
  .two-col {
    grid-template-columns: 1fr 300px;
    align-items: start;
  }
}

@media (min-width: 920px) {
  .two-col {
    grid-template-columns: 1fr 320px;
    gap: var(--sp-12);
  }
}

/* ============================================================
   1. NAVIGATION — .top-nav
   ============================================================ */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 62px;
  background: var(--teal);
  border-bottom: 3px solid var(--gold);
  display: flex;
  align-items: center;
}

.top-nav .content-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.top-nav__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #FFFFFF;
  text-decoration: none;
  flex-shrink: 0;
}

.top-nav__logo:hover,
.top-nav__logo:focus-visible {
  color: var(--gold-bright);
  outline-color: var(--gold-bright);
}

.top-nav__logo svg,
.top-nav__logo img {
  width: 28px;
  height: 28px;
}

.top-nav__links {
  display: none;
  align-items: center;
  gap: var(--sp-6);
}

@media (min-width: 920px) {
  .top-nav__links {
    display: flex;
  }
}

.top-nav__links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  transition: color var(--t-micro);
  white-space: nowrap;
}

.top-nav__links a:hover {
  color: #FFFFFF;
}

.top-nav__links a:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: var(--r-xs);
  color: #FFFFFF;
}

.top-nav__right {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

/* Hamburger */
.top-nav__hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-2);
}

@media (min-width: 920px) {
  .top-nav__hamburger {
    display: none;
  }
}

.top-nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #FFFFFF;
  border-radius: 2px;
  transition: transform var(--t-normal), opacity var(--t-micro);
}

/* Mobile dropdown panel */
.top-nav__mobile-panel {
  position: fixed;
  top: 62px;
  left: 0;
  right: 0;
  background: var(--teal-dark);
  padding: var(--sp-6);
  display: none;
  flex-direction: column;
  gap: var(--sp-1);
  z-index: 99;
  box-shadow: var(--shadow-elevated);
}

.top-nav__mobile-panel.is-open {
  display: flex;
}

.top-nav__mobile-panel a {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: block;
}

.top-nav__mobile-panel a:hover {
  color: var(--gold-bright);
}

/* Scroll margin so anchor links clear the sticky nav */
[id] {
  scroll-margin-top: 70px;
}

/* ============================================================
   2. HERO — .hero-wrap
   ============================================================ */
.hero-wrap {
  background: var(--bg-page);
  padding: var(--sp-12) 0 var(--sp-8);
  position: relative;
  overflow: hidden;
}

.hero-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(13, 110, 110, .07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-wrap .content-wrap {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-wrap h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  color: var(--teal-dark);
  max-width: 780px;
  margin: var(--sp-4) auto var(--sp-6);
}

.hero-wrap h1 em {
  font-style: italic;
  color: var(--gold);
}

.hero-wrap .hero-subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto var(--sp-8);
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
}

.trust-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-1) var(--sp-4);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  box-shadow: var(--shadow-micro);
}

.trust-chip::before {
  content: '✓';
  color: var(--teal);
  font-weight: 700;
}

/* ============================================================
   3. CALCULATOR CARD — .tool-card
   ============================================================ */
.tool-card {
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Tab bar */
.tool-card__tabs {
  display: flex;
  background: var(--teal-pale);
  padding: var(--sp-2);
  gap: var(--sp-1);
}

.tool-card__tab {
  flex: 1;
  min-height: 44px;
  padding: var(--sp-2) var(--sp-4);
  background: none;
  border: none;
  border-radius: var(--r-xl);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal);
  cursor: pointer;
  transition: background var(--t-micro), color var(--t-micro);
  white-space: nowrap;
  text-align: center;
}

.tool-card__tab:hover {
  background: rgba(255, 255, 255, .6);
}

.tool-card__tab.is-active {
  background: var(--bg-surface);
  color: var(--teal-dark);
  box-shadow: var(--shadow-micro);
}

.tool-card__tab:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.tool-card__body {
  padding: var(--sp-8);
}

@media (max-width: 479px) {
  .tool-card__body {
    padding: var(--sp-4);
  }
  .tool-card__tabs {
    flex-direction: column;
  }
}

/* ============================================================
   4. INPUT ROW — .input-row
   ============================================================ */
.input-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}

.input-row label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.input-row .helper-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--text-light);
}

.input-row .error-msg {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--over-color);
  display: none;
}

.input-row.has-error .error-msg {
  display: block;
}

.input-row.has-error .form-input,
.input-row.has-error .form-select {
  border-color: var(--over-color);
}

/* ============================================================
   5. FORM INPUTS — .form-input, .form-select
   ============================================================ */
.form-input,
.form-select {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xs);
  padding: 0 var(--sp-4);
  min-height: 48px;
  width: 100%;
  transition: border-color var(--t-micro), box-shadow var(--t-micro);
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.form-input::placeholder {
  color: var(--text-light);
}

.form-input:hover,
.form-select:hover {
  border-color: var(--teal-mid);
}

.form-input:focus,
.form-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 110, 110, .18);
  outline: none;
}

.form-input:focus-visible,
.form-select:focus-visible {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 147, 58, .25);
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235C6478' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-4) center;
  padding-right: var(--sp-12);
  cursor: pointer;
}

/* Input error state */
.form-input[aria-invalid="true"],
.form-select[aria-invalid="true"] {
  border-color: var(--over-color);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .18);
}

.input-error {
  display: block;
  font-size: 0.75rem;
  color: var(--over-color);
  margin-top: var(--sp-1);
  min-height: 1em;
}

/* Synced input pair: number field + slider */
.input-synced {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

@media (min-width: 480px) {
  .input-synced {
    grid-template-columns: 1fr 160px;
    align-items: center;
  }
  .input-synced .form-input {
    grid-column: 2;
    grid-row: 1;
  }
  .input-synced .range-wrap {
    grid-column: 1;
    grid-row: 1;
  }
}

/* ============================================================
   6. RANGE SLIDER — .range-wrap
   ============================================================ */
.range-wrap {
  position: relative;
  padding: var(--sp-1) 0;
}

.range-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--teal) 0%,
    var(--teal) var(--fill, 50%),
    var(--border) var(--fill, 50%),
    var(--border) 100%
  );
  outline: none;
  cursor: pointer;
}

.range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 1px 4px rgba(13, 110, 110, .35);
  cursor: pointer;
  transition: transform var(--t-micro), background var(--t-micro);
}

.range-wrap input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 1px 4px rgba(13, 110, 110, .35);
  cursor: pointer;
  transition: transform var(--t-micro), background var(--t-micro);
}

.range-wrap input[type="range"]:hover::-webkit-slider-thumb,
.range-wrap input[type="range"]:focus::-webkit-slider-thumb {
  transform: scale(1.15);
  background: var(--teal-mid);
}

.range-wrap input[type="range"]:hover::-moz-range-thumb,
.range-wrap input[type="range"]:focus::-moz-range-thumb {
  transform: scale(1.15);
  background: var(--teal-mid);
}

.range-wrap input[type="range"]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ============================================================
   7. DTI GAUGE BAR — .dti-bar
   ============================================================ */
.dti-bar {
  background: var(--teal-pale);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-6);
}

.dti-bar__label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.dti-bar__track-wrap {
  margin-bottom: var(--sp-3);
}

.dti-bar__track-label {
  display: flex;
  justify-content: space-between;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: var(--sp-1);
}

.dti-bar__track {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.dti-bar__fill {
  height: 100%;
  border-radius: 5px;
  transition: width var(--t-normal), background-color var(--t-normal);
  min-width: 2px;
}

.dti-bar__fill.dti-ok   { background: var(--teal); }
.dti-bar__fill.dti-warn { background: var(--gold); }
.dti-bar__fill.dti-over { background: var(--over-color); }

/* Threshold tick marks */
.dti-bar__threshold {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, .7);
}

.dti-bar__stats {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.dti-bar__stat {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
}

.dti-bar__stat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   8. RESULT PANEL — .result-box
   ============================================================ */
.result-box {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
  border-radius: var(--r-md);
  padding: var(--sp-8);
  color: #FFFFFF;
}

.result-box__eyebrow {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .7);
  margin-bottom: var(--sp-2);
}

.result-box__primary-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, .85);
  margin-bottom: var(--sp-1);
}

.result-box__amount {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.1;
  margin-bottom: var(--sp-6);
}

.result-box__subgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  border-top: 1px solid rgba(255, 255, 255, .2);
  padding-top: var(--sp-6);
}

@media (max-width: 479px) {
  .result-box__subgrid {
    grid-template-columns: 1fr;
  }
}

.result-box__stat {
  text-align: center;
}

.result-box__stat-value {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #FFFFFF;
  display: block;
}

.result-box__stat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, .65);
}

.result-box__actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  flex-wrap: wrap;
}

/* Mobile sticky result panel */
@media (max-width: 679px) {
  .result-box--sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    border-radius: var(--r-md) var(--r-md) 0 0;
    box-shadow: 0 -8px 32px rgba(13, 110, 110, .25);
  }
}

/* ============================================================
   9. AFFORDABILITY TIER — .afford-tier
   ============================================================ */
.afford-tier {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-xl);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
}

.afford-tier__icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.afford-tier--comfortable {
  background: var(--teal-pale);
  color: var(--teal-dark);
}
.afford-tier--comfortable .afford-tier__icon { background: var(--teal); }

.afford-tier--stretched {
  background: var(--gold-pale);
  color: var(--gold-dark);
}
.afford-tier--stretched .afford-tier__icon { background: var(--gold); }

.afford-tier--over {
  background: #FDECEA;
  color: var(--over-color);
}
.afford-tier--over .afford-tier__icon { background: var(--over-color); }

/* ============================================================
   10. RATE STRIP — .rate-context
   ============================================================ */
.rate-context {
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-6);
  box-shadow: var(--shadow-micro);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.rate-context__badge {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}

.rate-context__rates {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  flex: 1;
}

.rate-context__item {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.rate-context__item strong {
  color: var(--teal-dark);
  font-weight: 600;
}

/* ============================================================
   11. STAT ROW — .stat-row
   ============================================================ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-micro);
  overflow: hidden;
}

@media (min-width: 480px) {
  .stat-row {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-row__cell {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  position: relative;
}

.stat-row__cell + .stat-row__cell::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: var(--border);
}

@media (max-width: 479px) {
  .stat-row__cell:nth-child(2)::before { display: none; }
}

.stat-row__value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--teal-dark);
  display: block;
  line-height: 1.1;
}

.stat-row__label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: var(--sp-1);
  display: block;
}

/* ============================================================
   12. DATA TABLES — .info-table, .tbl-wrap
   ============================================================ */
.tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-micro);
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
}

.info-table thead {
  position: sticky;
  top: 62px;
  z-index: 10;
}

.info-table thead th {
  background: var(--teal);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.8125rem;
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  white-space: nowrap;
  letter-spacing: .02em;
}

.info-table thead th:first-child { border-radius: var(--r-xs) 0 0 0; }
.info-table thead th:last-child  { border-radius: 0 var(--r-xs) 0 0; }

.info-table tbody tr:nth-child(odd)  { background: var(--bg-surface); }
.info-table tbody tr:nth-child(even) { background: var(--teal-ultra); }

.info-table tbody tr:hover { background: var(--teal-pale); }

.info-table td {
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.info-table tbody tr:last-child td { border-bottom: none; }

.info-table .tbl-highlight td {
  background: var(--gold-ultra) !important;
  font-weight: 600;
}

.info-table caption {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  color: var(--text-light);
  text-align: left;
  padding: var(--sp-2) var(--sp-4);
  caption-side: bottom;
}

/* ============================================================
   13. CARDS — .nav-card, .callout-card, .tip-card, .scenario-card
   ============================================================ */

/* Nav card: tool grid links */
.nav-card {
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  text-decoration: none;
  transition: box-shadow var(--t-micro), border-color var(--t-micro), transform var(--t-micro);
}

.nav-card:hover {
  box-shadow: var(--shadow-card);
  border-color: var(--teal-mid);
  transform: translateY(-2px);
}

.nav-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.nav-card__icon {
  width: 40px;
  height: 40px;
  background: var(--teal-pale);
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
}

.nav-card__title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-card__desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.nav-card__cta {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal);
  margin-top: auto;
}

/* Callout card: gold left accent */
.callout-card {
  background: var(--bg-surface);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: var(--sp-6);
  box-shadow: var(--shadow-micro);
}

.callout-card__title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}

.callout-card p {
  font-size: 0.9375rem;
}

/* Tip card */
.tip-card {
  background: var(--teal-ultra);
  border: 1.5px solid var(--teal-pale);
  border-radius: var(--r-sm);
  padding: var(--sp-6);
}

.tip-card__label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--sp-2);
}

/* Scenario card */
.scenario-card {
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-card);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.scenario-card__number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--teal);
  color: #FFFFFF;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.scenario-card__title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.scenario-card__body {
  font-size: 0.9375rem;
}

/* ============================================================
   14. METHODOLOGY CARD — .method-card
   ============================================================ */
.method-card {
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--bg-surface);
  box-shadow: var(--shadow-micro);
  overflow: hidden;
}

.method-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-6);
  cursor: pointer;
  user-select: none;
}

.method-card__header:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.method-card__title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.method-card__toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold-pale);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--gold-dark);
  transition: transform var(--t-normal);
  flex-shrink: 0;
}

.method-card.is-open .method-card__toggle {
  transform: rotate(45deg);
}

.method-card__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-layout);
}

.method-card.is-open .method-card__body {
  max-height: 800px;
}

.method-card__inner {
  padding: 0 var(--sp-6) var(--sp-6);
}

.method-card pre,
.method-card code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: var(--sp-4);
  overflow-x: auto;
  color: var(--teal-dark);
  display: block;
  margin: var(--sp-3) 0;
  line-height: 1.6;
  white-space: pre;
}

/* ============================================================
   15. BUTTONS — .btn-teal, .btn-outline, .btn-gold
   ============================================================ */
.btn-teal,
.btn-outline,
.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-2) var(--sp-6);
  border-radius: var(--r-xs);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background var(--t-micro), color var(--t-micro), border-color var(--t-micro), box-shadow var(--t-micro), transform var(--t-micro);
  white-space: nowrap;
}

/* Teal fill */
.btn-teal {
  background: var(--teal);
  color: #FFFFFF;
  border-color: var(--teal);
}

.btn-teal:hover {
  background: var(--teal-mid);
  border-color: var(--teal-mid);
  color: #FFFFFF;
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.btn-teal:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-teal:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--teal);
  border-color: var(--teal);
}

.btn-outline:hover {
  background: var(--teal-pale);
  color: var(--teal-dark);
}

.btn-outline:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Gold fill */
.btn-gold {
  background: var(--gold);
  color: var(--text-primary);
  border-color: var(--gold);
}

.btn-gold:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201, 147, 58, .3);
}

.btn-gold:active {
  transform: translateY(0);
}

.btn-gold:focus-visible {
  outline: 2px solid var(--gold-dark);
  outline-offset: 3px;
}

/* ============================================================
   16. LABELS — .eyebrow, .badge-live, .trust-chip
   ============================================================ */
.eyebrow {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-light);
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--teal-dark);
  background: var(--teal-pale);
  border: 1px solid rgba(13, 110, 110, .2);
  border-radius: var(--r-xl);
  padding: var(--sp-1) var(--sp-3);
}

.badge-live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ============================================================
   17. FAQ ACCORDION — .faq-row
   ============================================================ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.faq-row {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  transition: border-color var(--t-micro), box-shadow var(--t-micro);
}

.faq-row:hover {
  border-color: var(--teal-mid);
}

.faq-row.is-open {
  border-color: var(--teal);
  box-shadow: var(--shadow-micro);
}

.faq-row__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  min-height: 56px;
}

.faq-row__trigger:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.faq-row__question {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.faq-row__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal-pale);
  border: 1.5px solid var(--teal-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
  transition: transform var(--t-normal), background var(--t-normal);
}

.faq-row.is-open .faq-row__icon {
  transform: rotate(45deg);
  background: var(--teal);
  color: #FFFFFF;
  border-color: var(--teal);
}

.faq-row__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-normal);
}

.faq-row.is-open .faq-row__answer {
  max-height: 600px;
}

.faq-row__answer-inner {
  padding: 0 var(--sp-6) var(--sp-5);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================================
   18. FOOTER — .site-footer
   ============================================================ */
.site-footer {
  background: var(--teal-dark);
  border-top: 3px solid var(--gold);
  padding: var(--sp-12) 0 var(--sp-8);
  margin-top: var(--sp-20);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
}

@media (min-width: 680px) {
  .site-footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.site-footer__col-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .5);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.site-footer__links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, .65);
  text-decoration: none;
  transition: color var(--t-micro);
}

.site-footer__links a:hover {
  color: rgba(255, 255, 255, .95);
}

.site-footer__links a:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.site-footer__brand {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: var(--sp-3);
}

.site-footer__desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, .5);
  line-height: 1.6;
}

.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  margin-top: var(--sp-8);
  padding-top: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-4);
}

.site-footer__disclaimer {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, .35);
  line-height: 1.6;
  max-width: 700px;
}

.site-footer__copy {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, .35);
  flex-shrink: 0;
}

/* ============================================================
   19. SIDEBAR — .side-card, .related-tag
   ============================================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

@media (min-width: 680px) {
  .sidebar {
    position: sticky;
    top: 80px;
  }
}

.side-card {
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-card);
  padding: var(--sp-6);
}

.side-card__title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1.5px solid var(--border);
}

.side-card__links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.side-card__links a {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  color: var(--teal);
  text-decoration: none;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--t-micro);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.side-card__links a:last-child {
  border-bottom: none;
}

.side-card__links a:hover {
  color: var(--teal-mid);
}

.side-card__links a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Related tags: teal-pale pill → solid teal on hover */
.related-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.related-tag {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--r-xl);
  background: var(--teal-pale);
  color: var(--teal-dark);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background var(--t-micro), color var(--t-micro), border-color var(--t-micro);
  min-height: 36px;
}

.related-tag:hover {
  background: var(--teal);
  color: #FFFFFF;
}

.related-tag:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: var(--r-xl);
}

/* ============================================================
   AD SLOTS
   ============================================================ */
.ad-unit {
  min-height: 90px;       /* leaderboard / banner default */
  border-radius: var(--r-xs);
  overflow: hidden;
  contain: layout;        /* prevent CLS from late-loading ads */
}

.ad-unit--rectangle { min-height: 250px; }  /* 300×250 */
.ad-unit--leaderboard { min-height: 90px; } /* 728×90 */
.ad-unit--sidebar { min-height: 600px; }    /* 160×600 / 300×600 */

/* No ad within 200px of calculator inputs — enforced via spacing utility */
.ad-unit + .tool-card,
.tool-card + .ad-unit {
  margin-top: 200px;
}

.ad-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  color: var(--text-light);
  text-align: center;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}

/* ============================================================
   TOOLS GRID — 3-col
   ============================================================ */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}

@media (min-width: 480px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 920px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   AUTHORITY BAR / RATE BAR (shared pill style)
   ============================================================ */
.authority-bar {
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-micro);
  padding: var(--sp-3) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
  text-align: center;
}

.authority-bar__text {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* Accessible screen reader only text */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Slide-up animation */
@media (prefers-reduced-motion: no-preference) {
  .slide-up {
    opacity: 0;
    transform: translateY(24px);
    animation: slideUpIn 480ms ease forwards;
  }

  .slide-up.delay-1 { animation-delay: 80ms; }
  .slide-up.delay-2 { animation-delay: 160ms; }
  .slide-up.delay-3 { animation-delay: 240ms; }
  .slide-up.delay-4 { animation-delay: 320ms; }
}

/* DTI status indicators */
.dti-ok {
  color: var(--teal-dark);
  background: var(--teal-pale);
}
.dti-ok::before {
  content: '✓ ';
  font-weight: 700;
}

.dti-warn {
  color: var(--gold-dark);
  background: var(--gold-pale);
}
.dti-warn::before {
  content: '⚠ ';
}

.dti-over {
  color: var(--over-color);
  background: #FDECEA;
}
.dti-over::before {
  content: '✕ ';
  font-weight: 700;
}

/* Count-up hook (JS targets this class) */
.count-up {
  display: inline-block;
}

/* Section spacing */
.section {
  padding: var(--sp-12) 0;
}

.section--tight {
  padding: var(--sp-8) 0;
}

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  color: var(--teal-dark);
  margin-bottom: var(--sp-4);
}

.section-subtitle {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: var(--sp-8);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8125rem;
  color: var(--text-light);
  padding: var(--sp-3) 0;
}

.breadcrumb a {
  color: var(--teal);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--teal-mid);
}

.breadcrumb__sep {
  color: var(--border);
}

/* Instant answer block */
.instant-answer {
  background: linear-gradient(135deg, var(--teal-ultra) 0%, var(--teal-pale) 100%);
  border: 1.5px solid rgba(13, 110, 110, .2);
  border-radius: var(--r-md);
  padding: var(--sp-8);
}

.instant-answer__metric {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: var(--sp-2);
}

.instant-answer__scenarios {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}

.instant-answer__scenario {
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  padding: var(--sp-4);
  text-align: center;
  box-shadow: var(--shadow-micro);
}

.instant-answer__scenario-value {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--teal-dark);
  display: block;
}

.instant-answer__scenario-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--text-light);
}

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  @keyframes slideUpIn {
    from {
      opacity: 0;
      transform: translateY(24px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes pulse-dot {
    0%, 100% {
      opacity: 1;
      transform: scale(1);
    }
    50% {
      opacity: .55;
      transform: scale(.85);
    }
  }
}

/* Reduced motion: disable all animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .top-nav,
  .site-footer,
  .sidebar,
  .ad-unit,
  .tools-grid,
  .btn-teal,
  .btn-outline,
  .btn-gold,
  .faq-list,
  .rate-context,
  .result-box__actions,
  .stat-row,
  .breadcrumb,
  .authority-bar,
  .hero-wrap .trust-chips,
  .hero-wrap .hero-badges,
  .hamburger,
  .mobile-panel,
  .scenario-cards,
  nav {
    display: none !important;
  }

  .method-card__body {
    max-height: none !important;
    display: block !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #666;
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  .result-box {
    background: #fff !important;
    border: 2px solid #0D6E6E;
    color: #000 !important;
  }

  .result-box__amount,
  .result-box__stat-value {
    color: #0D6E6E !important;
  }

  .result-box__eyebrow,
  .result-box__primary-label,
  .result-box__stat-label {
    color: #555 !important;
  }

  .method-card {
    border: 1px solid #ccc;
  }

  .method-card__body {
    max-height: none !important;
  }
}

/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */

/* Mobile base < 480px */
body {
  font-size: 15px;
}

@media (min-width: 480px) {
  /* sm: 2-col stat rows active (handled in .stat-row) */
  body {
    font-size: 16px;
  }
}

@media (min-width: 680px) {
  /* md: side-by-side inputs, sidebar appears */
  .input-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-4);
  }
}

@media (min-width: 920px) {
  /* lg: full nav links, 3-col tool grid */
}

@media (min-width: 1160px) {
  /* xl: max-width container cap — enforced via .content-wrap max-width */
}

/* Prevent any element from overflowing viewport on mobile */
@media (max-width: 679px) {
  table, .info-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .result-box__subgrid {
    grid-template-columns: 1fr 1fr;
  }

  /* Minimum font size on mobile — no text below 14px */
  body {
    font-size: max(14px, 0.875rem);
  }
}

/* ============================================================
   STAGE 8 — ADDITIONAL ACCESSIBILITY & PERFORMANCE
   ============================================================ */

/* All interactive elements: :focus-visible only (no mouse flash) */
:focus:not(:focus-visible) {
  outline: none;
}

/* Tap target safety net */
button, [role="button"], a, input, select, textarea, label {
  min-height: 44px;
  min-width: 44px;
}

/* Exception: inline text links don't need 44px height */
p a, li a, td a, .breadcrumb a, .site-footer a {
  min-height: unset;
  min-width: unset;
}

/* DTI gauge aria-label updates via JS; make it announce live */
[aria-label*="DTI gauge"] {
  speak: always;
}

/* Table accessibility: ensure sticky header row is announced */
.info-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--teal);
  color: #fff;
  font-weight: 600;
}

/* Loading perf: prevent layout shift for images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Affordability tier: text must always be visible (not just color) */
.afford-tier {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 600;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-xs);
}

.afford-tier--comfortable { background: var(--teal-pale); color: var(--teal-dark); }
.afford-tier--stretched   { background: var(--gold-pale);  color: var(--gold-dark);  }
.afford-tier--over        { background: #FDECEA;            color: var(--over-color); }
