/* ============================================================
   PovertyLevelCalculator.com — Main Stylesheet v2
   Design: Accessible, senior-friendly, pastel-accented blue
   ============================================================ */

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:         #042C53;
  --blue:         #1A6BBF;
  --blue-mid:     #0E4F94;
  --blue-light:   #EBF4FF;
  --blue-muted:   #90BDE8;
  --blue-pale:    #C4DFFE;
  --pastel-sky:   #D6EEFF;
  --pastel-mint:  #D4F5E9;
  --pastel-peach: #FFE8D6;
  --pastel-lemon: #FFF8D6;
  --pastel-lilac: #EDE8FF;
  --amber:        #FCCD00;
  --amber-dark:   #D4AC00;
  --amber-light:  #FFFBE6;
  --green-bg:     #D4F5E9;
  --green-border: #7DD9B5;
  --green-text:   #0D6B43;
  --green-mid:    #1A8A57;
  --green-muted:  #2EAD70;
  --gray-50:      #F9FAFB;
  --gray-100:     #F3F4F6;
  --gray-200:     #E5E7EB;
  --gray-300:     #D1D5DB;
  --gray-400:     #9CA3AF;
  --gray-500:     #6B7280;
  --gray-600:     #4B5563;
  --gray-700:     #374151;
  --gray-800:     #1F2937;
  --gray-900:     #111827;
  --info-bg:      #EBF4FF;
  --info-border:  #93C5FD;
  --info-text:    #1E40AF;
  --warn-bg:      #FFFBEB;
  --warn-border:  #FCD34D;
  --warn-text:    #92400E;
  --danger-bg:    #FEF2F2;
  --danger-text:  #991B1B;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-base: 17px;
  --line-height: 1.75;
  --page-max:   1120px;
  --gap:        24px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
}

html { font-size: var(--font-size-base); scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: var(--line-height);
  color: var(--gray-800);
  background: #fff;
  overflow-x: hidden; /* prevent any element causing horizontal scroll */
}

a { color: var(--blue); }
a:hover { color: var(--blue-mid); }
img { max-width: 100%; height: auto; display: block; }

.page-wrap { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gap); }
.full-bleed { width: 100%; }

/* TOP BAR */
.top-bar {
  background: var(--navy);
  color: var(--blue-muted);
  font-size: 13px;
  padding: 8px var(--gap);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.top-bar .disclaimer { color: var(--blue-muted); }
.top-bar .updated    { color: var(--blue-pale); white-space: nowrap; font-weight: 600; }

/* NAVIGATION */
.site-nav {
  background: var(--blue);
  padding: 0 var(--gap);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 3px 12px rgba(4,44,83,0.25);
}
.nav-logo {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  padding: 16px 0;
  margin-right: 28px;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity .2s;
}
.nav-logo:hover { opacity: 0.85; color: #fff; }
.nav-logo span  { color: var(--blue-pale); font-weight: 400; }
.nav-links { display: flex; flex: 1; }
.nav-link {
  color: var(--blue-pale);
  font-size: 14px;
  padding: 17px 14px;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.nav-link:hover  { color: #fff; border-bottom-color: rgba(255,255,255,0.35); }
.nav-link.active { color: #fff; border-bottom-color: var(--amber); }
.nav-states-btn {
  margin-left: auto;
  background: var(--amber);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 20px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}
.nav-states-btn:hover { background: var(--amber-dark); color: var(--navy); transform: scale(1.03); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

/* PAGE HERO */
.page-hero {
  background: linear-gradient(135deg, var(--blue-mid) 0%, var(--blue) 100%);
  padding: 40px var(--gap) 36px;
  color: #fff;
}
.page-hero h1 {
  font-size: 34px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}
.page-hero .hero-sub {
  font-size: 18px;
  color: var(--blue-pale);
  margin-bottom: 28px;
  max-width: 680px;
  line-height: 1.6;
}
.hero-tabs { display: flex; gap: 4px; margin-top: 8px; flex-wrap: nowrap; }
.hero-tab {
  background: rgba(255,255,255,0.15);
  color: var(--blue-pale);
  border: none;
  padding: 12px 18px;
  font-size: 14px;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.hero-tab:hover  { background: rgba(255,255,255,0.25); color: #fff; }
.hero-tab.active { background: #fff; color: var(--blue-mid); font-weight: 700; }

/* When hero has tabs, remove bottom padding so tabs connect to calc-wrap */
.page-hero:has(.hero-tabs) { padding-bottom: 0; }

/* CALCULATOR */
.calc-wrap {
  background: var(--pastel-sky);
  padding: 32px var(--gap) 32px;
  border-bottom: 3px solid var(--blue-light);
}
/* Remove top padding when calc-wrap follows a tabbed hero */
.page-hero:has(.hero-tabs) + .calc-wrap {
  padding-top: 0;
}
.calc-box {
  background: #fff;
  border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
  padding: 32px;
  box-shadow: 0 8px 32px rgba(26,107,191,0.12);
  border: 1px solid var(--blue-light);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.calc-grid   { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; margin-bottom: 20px; }
.calc-grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; margin-bottom: 20px; }
.field-label {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.field-label .req { color: #DC2626; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: var(--font);
  color: var(--gray-800);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(26,107,191,0.12);
}
.radio-group { display: flex; gap: 20px; padding: 10px 0; flex-wrap: wrap; }
.radio-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  cursor: pointer;
  color: var(--gray-700);
  font-weight: 500;
}
.radio-group input[type="radio"] { width: 18px; height: 18px; accent-color: var(--blue); }

/* BUTTONS */
.btn-group { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 30px;
  font-size: 16px;
  font-family: var(--font);
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 4px 14px rgba(26,107,191,0.3); }
.btn-primary:hover { background: var(--blue-mid); color: #fff; box-shadow: 0 6px 20px rgba(26,107,191,0.4); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 2px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); color: var(--gray-900); }
.btn-amber { background: var(--amber); color: var(--navy); box-shadow: 0 4px 14px rgba(245,166,35,0.3); }
.btn-amber:hover { background: var(--amber-dark); color: #fff; }

/* RESULTS */
.result-strip {
  background: var(--pastel-mint);
  border: 2px solid var(--green-border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;
}
.result-strip.hidden { display: none; }
.res-item label {
  font-size: 12px;
  color: var(--green-mid);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  display: block;
  margin-bottom: 4px;
}
.res-item .val { font-size: 32px; font-weight: 800; color: var(--green-text); line-height: 1.1; }
.res-item .sub { font-size: 13px; color: var(--green-muted); margin-top: 4px; }

/* CONTENT AREA */
.content-area { padding: 36px var(--gap) 20px; }
.page-cols { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; min-width: 0; }
.main-col { min-width: 0; }
.sidebar-col { min-width: 0; width: 300px; }

/* TYPOGRAPHY */
.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 14px;
}
.content-section { margin-bottom: 40px; }
.content-section h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 16px;
  padding-bottom: 12px;
  padding-left: 16px;
  border-left: 5px solid var(--blue);
  border-bottom: 2px solid var(--gray-100);
  line-height: 1.25;
  letter-spacing: -0.3px;
}
.content-section h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--gray-800);
  margin: 28px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--pastel-peach);
  line-height: 1.3;
}
.content-section h4 { font-size: 16px; font-weight: 700; color: var(--gray-700); margin: 20px 0 8px; }
.content-section p { font-size: 17px; color: var(--gray-700); line-height: 1.8; margin-bottom: 14px; }
.content-section ul, .content-section ol { font-size: 17px; color: var(--gray-700); padding-left: 24px; line-height: 2; margin-bottom: 14px; }
.check-list { list-style: none; padding: 0; }
.check-list li { font-size: 17px; color: var(--gray-700); padding: 5px 0 5px 28px; position: relative; line-height: 1.65; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green-mid); font-weight: 800; font-size: 16px; }

/* CALLOUT BOXES */
.info-box {
  background: var(--pastel-lemon);
  border-left: 5px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  font-size: 16px;
  color: var(--gray-800);
  margin-bottom: 20px;
  line-height: 1.7;
}
.warn-box {
  background: var(--warn-bg);
  border-left: 5px solid #F59E0B;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  font-size: 16px;
  color: var(--warn-text);
  margin-bottom: 20px;
  line-height: 1.7;
}
.success-box {
  background: var(--pastel-mint);
  border-left: 5px solid var(--green-mid);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  font-size: 16px;
  color: var(--green-text);
  margin-bottom: 20px;
  line-height: 1.7;
}

/* DATA TABLES */
.table-caption { font-size: 13px; color: var(--gray-500); margin-bottom: 8px; font-style: italic; }
.data-table { width: 100%; border-collapse: collapse; font-size: 16px; margin-bottom: 20px; border-radius: var(--radius); overflow: hidden; }
.data-table th { background: var(--blue); color: #fff; padding: 13px 16px; text-align: left; font-weight: 700; font-size: 14px; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.data-table tbody tr:nth-child(even) td { background: var(--pastel-sky); }
.data-table tbody tr:hover td { background: var(--blue-light); }
.data-table tfoot td, .data-table tr.table-footer td { font-weight: 700; background: var(--pastel-mint); color: var(--green-text); border-top: 2px solid var(--green-border); }
.data-table .amount { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }

/* PROGRAM CARDS */
.card-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-bottom: 36px; }
.prog-card {
  background: #fff;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-decoration: none;
  display: block;
  transition: box-shadow .2s, transform .15s, border-color .2s;
  position: relative;
  overflow: hidden;
}
.prog-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--blue); transition: background .2s; }
.prog-card:hover { box-shadow: 0 8px 28px rgba(26,107,191,0.15); border-color: var(--blue-light); }
.prog-card:hover::before { background: var(--amber); }
.prog-card .card-icon  { font-size: 28px; margin-bottom: 12px; }
.prog-card .card-title { font-size: 17px; font-weight: 700; color: var(--gray-900); line-height: 1.3; }
.prog-card .card-desc  { font-size: 15px; color: var(--gray-600); margin-top: 8px; line-height: 1.6; }
.prog-card .card-link  { font-size: 14px; color: var(--blue); margin-top: 14px; display: block; font-weight: 700; }

/* STATE HERO */
.state-hero { background: linear-gradient(135deg, var(--blue-mid) 0%, var(--blue) 100%); padding: 28px var(--gap); }
.breadcrumb { font-size: 14px; color: var(--blue-muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--blue-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue-pale); }
.breadcrumb span { color: var(--blue-pale); margin: 0 6px; }
.state-hero h1 { font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 14px; line-height: 1.25; letter-spacing: -0.3px; }
.hero-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-block; border-radius: 20px; padding: 5px 13px; font-size: 13px; font-weight: 600; }
.badge-updated { background: rgba(52,211,153,0.2); border: 1px solid rgba(52,211,153,0.4); color: #6EE7B7; }
.badge-info    { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25); color: var(--blue-pale); }
.badge-success { background: rgba(52,211,153,0.25); border: 1px solid rgba(52,211,153,0.5); color: #6EE7B7; }

/* ANCHOR NAV */
.anchor-nav { background: var(--blue-mid); padding: 0 var(--gap); display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
.anchor-nav::-webkit-scrollbar { display: none; }
.anchor-link { color: var(--blue-pale); font-size: 14px; padding: 11px 16px; text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; transition: color .15s, border-color .15s; }
.anchor-link:hover { color: #fff; }
.anchor-link.active { color: #fff; border-bottom-color: var(--amber); }

/* SIDEBAR */
.sticky-sidebar { position: sticky; top: 72px; }
.side-card { background: #fff; border: 2px solid var(--gray-200); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 18px; }
.side-card.rx-card { border-color: #2E7D32; }
.side-card-head { background: var(--blue); color: #fff; font-size: 14px; font-weight: 700; padding: 13px 18px; }
.side-card-head.navy { background: var(--navy); color: var(--blue-pale); }
.side-row { display: flex; justify-content: space-between; align-items: baseline; padding: 13px 18px; border-bottom: 1px solid var(--gray-100); font-size: 15px; gap: 8px; }
.side-row:last-child { border-bottom: none; padding-bottom: 16px; }
.side-row .key { color: var(--gray-500); flex-shrink: 0; }
.side-row .val { font-weight: 700; color: var(--gray-900); text-align: right; }
.side-row .val.green { color: var(--green-text); }
.side-row .val a { color: var(--blue); text-decoration: none; font-weight: 500; }
.side-link-list a { display: flex; align-items: center; justify-content: space-between; padding: 11px 18px; border-bottom: 1px solid var(--gray-100); font-size: 15px; color: var(--blue); text-decoration: none; font-weight: 500; transition: background .1s; }
.side-link-list a:last-child { border-bottom: none; padding-bottom: 16px; }
.side-link-list a:hover { background: var(--pastel-sky); }
.side-link-list a .arrow { color: var(--gray-400); font-size: 14px; }
.side-cta { background: linear-gradient(135deg, var(--blue-mid), var(--blue)); border-radius: var(--radius-lg); padding: 20px; text-align: center; margin-bottom: 18px; }
.side-cta p { font-size: 15px; color: var(--blue-pale); margin-bottom: 12px; line-height: 1.5; font-weight: 500; }
.side-cta a { display: block; background: var(--amber); color: var(--navy); font-size: 15px; font-weight: 700; padding: 11px; border-radius: 30px; text-decoration: none; transition: background .15s, transform .1s; }
.side-cta a:hover { background: var(--amber-dark); color: var(--navy); transform: scale(1.02); }

/* HELPFUL LINKS */
.helpful-links { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.helpful-links a { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--blue); text-decoration: none; padding: 13px 16px; background: var(--gray-50); border: 2px solid var(--gray-200); border-radius: var(--radius); font-weight: 500; transition: background .1s, border-color .15s, padding-left .15s; width: 100%; box-sizing: border-box; }
.mobile-jump-nav { display: none; }
.helpful-links a:hover { background: var(--pastel-sky); border-color: var(--blue); padding-left: 20px; }
.helpful-links a .arrow { margin-left: auto; color: var(--gray-400); font-size: 14px; }

/* ALL-STATES GRID */
.all-states-section { background: var(--gray-50); border-top: 2px solid var(--gray-200); padding: 28px var(--gap); }
.state-btn-grid { display: grid; grid-template-columns: repeat(10,1fr); gap: 8px; margin-top: 12px; }
.state-btn { background: #fff; border: 2px solid var(--gray-200); border-radius: var(--radius); padding: 9px 4px; font-size: 13px; font-weight: 700; color: var(--blue); text-align: center; text-decoration: none; transition: background .1s, border-color .1s, transform .1s; }
.state-btn:hover  { background: var(--pastel-sky); border-color: var(--blue); transform: scale(1.05); }
.state-btn.current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* AD SLOTS — invisible containers, AdSense fills automatically */
.ad-slot { width: 100%; overflow: hidden; display: block; }
.ad-slot-leaderboard { min-height: 90px; margin-bottom: 28px; }
.ad-slot-rectangle   { min-height: 250px; margin-bottom: 18px; }
.ad-slot-banner      { min-height: 60px; margin-bottom: 18px; }
.ad-slot ins { display: block; width: 100%; }

/* FOOTER */
.site-footer { background: var(--navy); color: var(--blue-muted); padding: 40px var(--gap) 20px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; margin-bottom: 28px; }
.footer-col h4 { color: #fff; font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.footer-col p  { font-size: 14px; line-height: 1.7; color: var(--blue-muted); }
.footer-col a  { color: var(--blue-muted); text-decoration: none; display: block; margin-bottom: 8px; font-size: 14px; transition: color .1s; }
.footer-col a:hover { color: #fff; }
.footer-disclaimer { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 16px; margin-bottom: 12px; font-size: 13px; color: #5B8DB8; line-height: 1.75; }
.footer-disclaimer a { color: var(--blue-muted); }
.footer-bottom { font-size: 13px; color: #5B8DB8; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.footer-bottom a { color: #5B8DB8; text-decoration: none; }
.footer-bottom a:hover { color: var(--blue-pale); }
.footer-bottom .sep { color: rgba(255,255,255,0.15); }

/* UTILITY */
.text-muted { color: var(--gray-500); }
.text-small { font-size: 15px; }
.text-center { text-align: center; }
.mt-0  { margin-top: 0; }    .mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* TABLET */
@media (max-width: 960px) {
  .footer-grid  { grid-template-columns: 1fr 1fr; }
  .page-cols    { grid-template-columns: 1fr; }
  .sidebar-col  { display: none; }
  .card-grid    { grid-template-columns: 1fr 1fr; }
  .state-btn-grid { grid-template-columns: repeat(7,1fr); }
  .calc-grid    { grid-template-columns: 1fr 1fr; }
}

/* MOBILE */
@media (max-width: 640px) {
  :root { --gap: 16px; --font-size-base: 16px; }
  .top-bar { font-size: 12px; flex-direction: column; gap: 2px; text-align: center; padding: 7px var(--gap); }
  .top-bar .updated { display: none; }
  .site-nav  { flex-wrap: wrap; padding: 0 var(--gap); }
  .nav-logo  { font-size: 15px; flex: 1; }
  .nav-toggle { display: block; }
  .nav-links { display: none; flex-direction: column; width: 100%; background: var(--blue-mid); order: 3; }
  .nav-links.open { display: flex; }
  .nav-link  { padding: 14px var(--gap); border-bottom: 1px solid rgba(255,255,255,0.1); }
  .nav-link.active { background: rgba(255,255,255,0.1); }
  .nav-states-btn { display: none; }
  .nav-rx-btn { display: none; }
  .page-hero h1  { font-size: 24px; }
  .state-hero h1 { font-size: 21px; }
  .mobile-jump-nav { display: block !important; margin-bottom: 8px; }
  .hero-tab { font-size: 13px; padding: 9px 6px; }

  /* Segmented control on mobile */
  .hero-tabs { width: 100%; background: rgba(0,0,0,0.25); border-radius: 8px; padding: 3px; gap: 3px; margin-top: 16px; flex-wrap: nowrap; box-sizing: border-box; }
  .hero-tab { flex: 1; min-width: 0; border-radius: 6px; padding: 10px 4px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hero-tab.active { background: #fff; color: var(--navy); }
  .calc-box  { padding: 20px 16px; }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-grid-2 { grid-template-columns: 1fr; }
  .result-strip { grid-template-columns: 1fr; gap: 14px; }
  .res-item .val { font-size: 26px; }
  .content-section h2 { font-size: 20px; }
  .content-section h3 { font-size: 17px; }
  .card-grid { grid-template-columns: 1fr; }
  .state-btn-grid { grid-template-columns: repeat(5,1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .anchor-link { font-size: 13px; padding: 10px 12px; }
  .btn { padding: 13px 24px; font-size: 16px; }
  .btn-group { flex-direction: column; align-items: stretch; width: 100%; }
  .btn-group .btn { text-align: center; width: 100%; }

  /* Global mobile padding — ensure no content touches screen edge */
  .page-wrap { padding-left: var(--gap); padding-right: var(--gap); box-sizing: border-box; }
  .content-area { padding-left: var(--gap); padding-right: var(--gap); }
  .content-section { overflow-x: hidden; }
  .main-col, .sidebar-col { min-width: 0; max-width: 100%; }

  /* Anchor nav — scroll horizontally, don't overflow */
  .anchor-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap; }
  .anchor-nav::-webkit-scrollbar { display: none; }
  .anchor-link { white-space: nowrap; flex-shrink: 0; }

  /* Pill/flex wraps — prevent overflow */
  [style*="display:flex"] { max-width: 100%; }

  /* Tables — scroll container handles overflow, cells scale down */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 9px 10px; font-size: 13px; }

  /* Helpful links — scale down on mobile */
  .helpful-links a { font-size: 14px; padding: 10px 12px; }
  .helpful-links a .arrow { flex-shrink: 0; }

  /* Result strip stacks vertically */
  .result-strip { grid-template-columns: 1fr; }

  /* Pre-footer widgets stack */
  .pre-footer-grid { grid-template-columns: 1fr !important; }

  /* Inline style grids that might overflow */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  [style*="min-width"] { min-width: 0 !important; }
}
