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

:root {
  --blue: #2d5f9e;
  --blue-dark: #204878;
  --brand-wordmark: #000000;
  --brand-orange: #F68D2E;
  --orange: #F68D2E;
  --orange-dark: #a45100;
  /* Accessible orange for normal text and white-on-orange controls. The
     brighter brand orange remains available for nonessential decoration. */
  --orange-text: #a45100;
  --lime: #2d5f9e;
  --lime-dim: #204878;
  /* Canonical page surfaces. Route bundles may arrange content, but public
     masthead and canvas colors are owned here so wrapper order cannot change
     the visual system. Legacy --bg aliases remain for component compatibility. */
  --surface-canvas: #ffffff;
  --surface-muted: #f0f4f8;
  --surface-task: #f8fafc;
  --surface-card: #ffffff;
  --surface-public-top: linear-gradient(135deg, #f8fbff 0%, #edf2fb 100%);
  --bg: var(--surface-canvas);
  --bg-alt: var(--surface-muted);
  --bg-card: var(--surface-card);
  --bg-input: var(--surface-canvas);
  --border: #d1d9e0;
  --border-light: #9aadbe;
  --text: #221f20;
  --text-muted: #3C3950;
  --text-faint: #5b6472;
  --heading: #000000;
  --white: #ffffff;
  --red: #D22730;
  --green: #1e7a2e;
  --radius: 10px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
  --max-width: 1100px;
  --font: 'Work Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --type-ui: 1rem;
  --type-body: 1.0625rem;
  --type-reading: 1.125rem;
  --leading-body: 1.65;
  --leading-reading: 1.7;
  --measure-reading: 70ch;
  --site-nav-sticky-offset: 69px;
  --site-nav-current-offset: var(--site-nav-sticky-offset);
}

html.nav-is-hidden { --site-nav-current-offset: 0px; }

html { scroll-behavior: smooth; font-size: var(--type-ui); }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--type-ui); line-height: 1.6; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--lime); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--lime-dim); text-decoration: underline; }
button, input, select, textarea { font: inherit; }
small, sub, sup { font-size: var(--type-ui); }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
section { padding: 80px 0; }

/* Explicit page surfaces replace the old DOM-position stripe. These classes
   describe intent and remain stable when a block is inserted or its wrapper
   changes. Route bundles may still own specialized component backgrounds. */
.page-section { background: var(--surface-canvas); }
.page-section--default { background: var(--surface-canvas); }
.page-section--muted { background: var(--surface-muted); }
.page-section--accent { background: var(--blue); color: #fff; }

/* Four page-top contracts. Public landing, detail, and document pages share
   one approved light-blue surface; task flows use the neutral task canvas.
   Route classes may arrange metadata, but may not own top color or H1 scale. */
.page-top { border-bottom: 1px solid var(--border); }
.page-top--landing,
.page-top--detail,
.page-top--document { background: var(--surface-public-top); }
.page-top--task { background: var(--surface-task); }
.page-top h1 {
  margin: 0 0 12px;
  color: var(--heading);
  font-weight: 800;
  line-height: 1.15;
}
.page-top--landing h1 {
  max-width: 850px;
  margin-bottom: 24px;
  font-size: clamp(2.35rem, 5vw, 4.15rem);
  line-height: 1.08;
}
.page-top--detail h1,
.page-top--document h1 {
  max-width: 850px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}
.page-top--task h1 {
  max-width: 780px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}
.page-top h1 em { color: var(--blue); font-style: normal; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-bottom: 12px; }
h3 { font-size: clamp(1.05rem, 2.5vw, 1.25rem); margin-bottom: 8px; }
h4 { font-size: var(--type-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); margin-bottom: 8px; }
p { color: var(--text); font-size: var(--type-body); line-height: var(--leading-body); margin-bottom: 16px; }
p:last-child { margin-bottom: 0; }

.section-label { display: inline-block; font-size: var(--type-ui); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #ffffff; background: var(--blue); border-radius: 4px; padding: 5px 12px; margin-bottom: 20px; }
/* Shared funding-state badges used by program, journey, and admin views. */
.status-badge { display: inline-block; font-size: var(--type-ui); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; color: #fff; background: #6b7280; }
.status-available, .status-open, .status-active, .status-accepting-applications { background: var(--green); }
.status-unknown { background: #6b7280; }
.status-funding-low, .status-paused, .status-transitioning, .status-pending, .status-launching, .status-opening-soon, .status-expiring, .status-closing { background: var(--orange-dark); }
.status-closed, .status-expired, .status-ended, .status-expired-carryforward, .status-disaster-activated { background: var(--red); }
.status-seasonal, .status-limited, .status-periodic, .status-conditional, .status-contingent, .status-varies, .status-varies-by-district, .status-check-availability, .status-period-announced-annually { background: var(--blue); }
.status-waitlist, .status-waitlist-only, .status-waitlist-open, .status-waitlisted, .status-open-waitlist { background: #7c3aed; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: var(--type-ui); font-weight: 600; padding: 13px 26px; border-radius: 8px; border: none; cursor: pointer; text-decoration: none; transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition); line-height: 1; }
.btn-primary { background: var(--lime); color: #ffffff; }
.btn-primary:hover { background: var(--lime-dim); color: #ffffff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(64, 126, 201, 0.3); }
.btn-secondary { background: var(--orange-dark); color: #ffffff; }
.btn-secondary:hover { background: #843f00; color: #ffffff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(164, 81, 0, 0.3); }
.btn-accent,
.site-nav .language-toggle a[aria-current="page"] { background: var(--brand-orange); color: #1a1a1a; }
.btn-accent:hover { background: var(--brand-orange); color: #1a1a1a; text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(246, 141, 46, 0.42); }
.btn-outline { background: transparent; color: var(--lime); border: 1.5px solid rgba(64, 126, 201, 0.5); }
.btn-outline:hover { background: rgba(64, 126, 201, 0.08); border-color: var(--lime); text-decoration: none; }

/* Shared minimal confirmation/error pages generated by browser routes. */
.system-message-page {
  min-height: 100vh;
  padding: 48px 16px;
  background: #f8fafc;
  color: #0f172a;
}
.system-message-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.system-message-card h1 { margin: 0 0 12px; font-size: 1.375rem; }
.system-message-card p { margin: 0 0 12px; color: #334155; line-height: 1.55; }
.system-message-action {
  display: inline-block;
  margin-top: 6px;
  padding: 12px 22px;
  color: #fff;
  background: var(--orange-dark);
  border-radius: 8px;
  font-weight: 700;
}
.system-message-action:hover { color: #fff; text-decoration: none; background: #843f00; }
.system-message-card .system-message-muted { margin-top: 18px; color: #64748b; font-size: var(--type-ui); }

/* Shared 404 and lead-accept framing. */
.simple-status-page { margin: 0; }
.simple-status-main { display: flex; align-items: center; justify-content: center; min-height: 70vh; padding: 40px 20px; text-align: center; }
.simple-status-content { width: 100%; max-width: 480px; }

/* ===== ELIGIBILITY QUIZ (/qualify) ===== */
.quiz-field { margin-bottom: 22px; }
.quiz-field > label { display: block; font-weight: 700; margin-bottom: 8px; color: var(--heading); }
.quiz-fieldset { min-width: 0; padding: 0; border: 0; }
.quiz-fieldset > legend { display: block; width: 100%; margin-bottom: 8px; padding: 0; color: var(--heading); font-weight: 700; }
.quiz-field select { width: 100%; max-width: 460px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: var(--type-ui); font-family: var(--font); background: #fff; }
.quiz-hint,
.qualify-why { font-size: var(--type-ui); color: var(--text); margin-top: 8px; }
.persona-chips,
.persona-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.persona-chips { gap: 10px; }
.persona-group-label { display: block; margin-bottom: 10px; color: var(--text); font-size: var(--type-ui); font-weight: 600; }
.persona-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 14px; border: 1.5px solid var(--border); border-radius: 999px; cursor: pointer; font-size: var(--type-ui); transition: background-color var(--transition), border-color var(--transition); user-select: none; }
.persona-chip:hover,
.persona-chip:has(input:focus-visible) { border-color: var(--blue); }
.persona-chip:has(input:checked) { border-color: var(--blue); background: rgba(64,126,201,0.08); }
.persona-chip input { width: auto; margin: 0; accent-color: var(--blue); cursor: pointer; }
.saved-profile-notice { margin-bottom: 24px; padding: 16px 18px; border: 1px solid rgba(64,126,201,0.35); border-left: 4px solid var(--blue); border-radius: 10px; background: rgba(64,126,201,0.06); }
.saved-profile-notice p { margin: 0 0 12px; }
.saved-profile-notice .btn { padding: 9px 14px; }
.quiz-capture-card > label { display: block; margin: 10px 0 6px; font-weight: 700; }
.quiz-results { margin-top: 28px; }
.qualify-total { font-size: 1.05rem; margin: 4px 0 18px; }
.qualify-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.qualify-card { display: block; padding: 16px 18px; text-decoration: none; }
.qualify-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hero-quiz-cta { margin: 4px 0 28px; }

/* ===== NAV ===== */
.site-nav { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.97); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 12px 0; transition: transform 180ms ease, box-shadow 180ms ease; }
.site-nav.nav-hidden { transform: translateY(-100%); }
.site-nav .container { max-width: 1440px; }
.site-nav .nav-inner { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 44px; align-items: center; gap: 18px; min-height: 44px; }
.site-nav .nav-brand { position: relative; grid-column: 1; grid-row: 1; justify-self: start; display: inline-flex; align-items: center; gap: 0; min-width: 0; font-size: 1.42rem; font-weight: 800; color: var(--brand-wordmark); letter-spacing: -0.035em; word-spacing: normal; text-decoration: none; white-space: nowrap; line-height: 1; }
.site-nav .nav-brand::before { content: ''; display: inline-block; width: 28px; height: 28px; flex-shrink: 0; color: var(--brand-orange); background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F68D2E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0z'/><circle cx='12' cy='10' r='3'/></svg>") no-repeat center / contain; }
.site-nav .nav-brand:hover { color: var(--brand-wordmark); text-decoration: none; }
.site-nav .nav-wordmark { color: var(--brand-wordmark); font-weight: 800; word-spacing: normal; }
.site-nav .nav-wordmark > span { color: var(--brand-orange); }
.site-nav .nav-brand .city-label { display: none; }
.site-nav .nav-links { grid-column: 2; grid-row: 1; justify-self: start; display: flex; align-items: center; gap: 0; max-width: none; margin: 0; padding: 0; list-style: none; flex-wrap: nowrap; }
@media (min-width: 1280px) {
  .site-nav .nav-links { gap: 8px; }
}
.site-nav .nav-links li { position: relative; margin: 0; }
.site-nav .nav-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--type-ui); font-weight: 550; color: var(--text); padding: 7px 6px; border-radius: 6px; transition: color var(--transition); text-decoration: none; white-space: nowrap; cursor: pointer; }
.site-nav .nav-links a:hover { color: var(--blue); background: transparent; box-shadow: none; text-decoration: none; }
.site-nav .nav-links a[aria-current="page"],
.site-nav .nav-group-link.nav-section-active { color: var(--blue); background: transparent; box-shadow: none; }
.site-nav .nav-submenu { display: none; position: absolute; top: calc(100% - 2px); left: 0; right: auto; z-index: 110; width: max-content; min-width: 190px; margin: 0; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14); list-style: none; text-align: left; }
.site-nav .nav-group.nav-group-open > .nav-submenu,
.site-nav .nav-group:not(.nav-group-suppressed):focus-within > .nav-submenu { display: grid; }
.site-nav .nav-submenu::before { content: ''; position: absolute; top: -2px; right: 0; left: 0; height: 2px; }
.site-nav .nav-submenu a { display: flex; justify-content: flex-start; width: 100%; padding: 9px 12px; text-align: left; }
.site-nav .hamburger { display: none; flex: 0 0 44px; align-items: center; justify-content: center; width: 44px; height: 44px; background: none; border: none; cursor: pointer; padding: 0; color: var(--brand-orange); }
.site-nav .hamburger svg { width: 26px; height: 26px; }
.site-nav .hamburger .i-close { display: none; }
.site-nav .hamburger.open .i-menu { display: none; }
.site-nav .hamburger.open .i-close { display: block; }
.site-nav .nav-actions { grid-column: 3; grid-row: 1; justify-self: end; display: flex; align-items: center; gap: 10px; }
.site-nav .nav-account { color: var(--blue-dark); font-size: var(--type-ui); font-weight: 650; white-space: nowrap; text-decoration: none; }
.site-nav .nav-account:hover { color: var(--blue); text-decoration-line: underline; }
.site-nav .language-toggle { display: inline-flex; align-items: stretch; min-height: 44px; padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text-faint); font-size: var(--type-ui); font-weight: 700; line-height: 1; transition: border-color var(--transition), box-shadow var(--transition); }
.site-nav .language-toggle:hover,
.site-nav .language-toggle:focus-within { border-color: var(--brand-orange); box-shadow: 0 4px 14px rgba(246,141,46,0.16); }
.site-nav .language-toggle a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 6px 9px; border-radius: 0; color: var(--blue-dark); text-decoration: none; transition: background-color var(--transition), color var(--transition); }
.site-nav .language-toggle a + a { border-left: 1px solid var(--border); }
.site-nav .language-toggle a:hover { background: rgba(246,141,46,0.12); color: var(--heading); text-decoration: none; }
.site-nav a.nav-cta { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--type-ui); font-weight: 700; color: #1a1a1a; background: var(--brand-orange); padding: 8px 12px; border-radius: 7px; text-decoration: none; transition: background-color var(--transition), color var(--transition); white-space: nowrap; }
.site-nav a.nav-cta:hover { background: var(--brand-orange); color: #1a1a1a; box-shadow: 0 6px 20px rgba(246,141,46,0.35); text-decoration: none; }
.site-nav .nav-mobile-cta,
.site-nav .nav-mobile-account { display: none; }

/* A consistent keyboard ring for interactive controls that do not provide a
   stronger component-specific focus treatment. */
:where(a, button, summary, [role="button"], [tabindex]):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

@media (max-width: 1279px) {
  :root { --site-nav-sticky-offset: 69px; }
  .site-nav .nav-inner { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: 44px; gap: 12px; }
  .site-nav .nav-brand { position: absolute; top: 50%; left: 50%; z-index: 2; grid-column: auto; grid-row: auto; transform: translate(-50%, -50%); }
  .site-nav .nav-brand .city-label { display: none; }
  .site-nav .hamburger { grid-column: 1; grid-row: 1; justify-self: start; display: inline-flex; }
  .site-nav .nav-actions { grid-column: 3; grid-row: 1; }
  .site-nav .nav-account { display: none; }
  .site-nav a.nav-cta { display: none; }
  .site-nav .nav-links { grid-column: 1 / -1; grid-row: 1; display: none; flex-direction: column; align-items: stretch; justify-self: stretch; position: absolute; top: calc(100% + 4px); left: 0; right: 0; width: auto; max-width: none; max-height: calc(100dvh - var(--site-nav-sticky-offset) - 8px); overflow-x: clip; overflow-y: auto; overscroll-behavior: contain; background: #fff; border: 1px solid var(--border); border-radius: 0 0 12px 12px; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 12px 30px rgba(15,23,42,0.14); z-index: 99; }
  .site-nav .nav-links.open { display: flex; }
  .site-nav .nav-links > li { width: 100%; }
  .site-nav .nav-links > li > a { display: flex; width: 100%; min-height: 46px; padding: 10px 8px; font-size: var(--type-ui); border-radius: 7px; white-space: normal; overflow-wrap: anywhere; }
  .site-nav .nav-submenu { position: static; width: 100%; min-width: 0; margin: 2px 0 8px; padding: 2px 0 2px 14px; border: 0; border-left: 2px solid var(--border); border-radius: 0; box-shadow: none; }
  .site-nav .nav-group > .nav-submenu { display: grid; }
  .site-nav .nav-submenu::before { content: none; }
  .site-nav .nav-submenu a { min-height: 44px; padding: 9px 10px; }
  .site-nav .nav-mobile-account { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
  .site-nav .nav-mobile-cta { display: block; margin-top: 8px; }
  .site-nav .nav-links .nav-mobile-cta > a { justify-content: center; background: var(--brand-orange); color: #1a1a1a; font-weight: 700; }
}
@media (max-width: 600px) {
  .site-nav .nav-brand { font-size: 1.12rem; gap: 0; }
  .site-nav .nav-brand::before { width: 22px; height: 22px; }
}
@media (max-width: 360px) {
  .site-nav .container { padding-inline: 6px; }
  .site-nav .nav-inner { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px; }
  .site-nav .nav-brand { font-size: 1rem; }
  .site-nav .nav-brand::before { width: 18px; height: 18px; }
  .site-nav .language-toggle a { min-width: 44px; padding-inline: 6px; }
}

/* Text-only browser resizing can enlarge the root font without changing the
   viewport or activating a width media query. In that mode the full link row
   cannot reflow safely, so the canonical nav uses a centered wordmark row and
   a separate hamburger row at every viewport. nav.js maintains this class
   from the computed root size; no inline presentation is added to the site. */
html.text-resized { --site-nav-sticky-offset: 137px; }
html.text-resized .site-nav .nav-inner { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: auto 44px; gap: 12px; }
html.text-resized .site-nav .nav-brand { position: static; grid-column: 1 / -1; grid-row: 1; justify-self: center; max-width: 100%; transform: none; }
html.text-resized .site-nav .nav-brand,
html.text-resized .site-nav .nav-wordmark { min-width: 0; white-space: normal; text-align: center; overflow-wrap: anywhere; }
html.text-resized .site-nav .nav-brand .city-label { display: none; }
html.text-resized .site-nav .nav-actions { grid-column: 3; grid-row: 2; }
html.text-resized .site-nav .nav-account { display: none; }
html.text-resized .site-nav .hamburger { grid-column: 1; grid-row: 2; justify-self: start; display: inline-flex; }
html.text-resized .site-nav a.nav-cta { display: none; }
html.text-resized .site-nav .nav-links { grid-column: 1 / -1; grid-row: 2; display: none; flex-direction: column; align-items: stretch; justify-self: stretch; position: absolute; top: calc(100% + 4px); left: 0; right: 0; width: auto; max-width: none; max-height: calc(100dvh - var(--site-nav-sticky-offset) - 8px); overflow-x: clip; overflow-y: auto; overscroll-behavior: contain; background: #fff; border: 1px solid var(--border); padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 12px 30px rgba(15,23,42,0.14); z-index: 99; }
html.text-resized .site-nav .nav-links.open { display: flex; }
html.text-resized .site-nav .nav-links > li { width: 100%; }
html.text-resized .site-nav .nav-links > li > a { display: flex; width: 100%; min-height: 46px; padding: 10px 8px; white-space: normal; overflow-wrap: anywhere; }
html.text-resized .site-nav .nav-submenu { position: static; width: 100%; min-width: 0; box-shadow: none; }
html.text-resized .site-nav .nav-submenu::before { content: none; }
html.text-resized .site-nav .nav-group > .nav-submenu { display: grid; }
html.text-resized .site-nav .nav-mobile-account { display: block; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
html.text-resized .site-nav .nav-mobile-cta { display: block; margin-top: 8px; }
html.text-resized .site-nav .nav-links .nav-mobile-cta > a { justify-content: center; background: var(--brand-orange); color: #1a1a1a; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .site-nav { transition: none; }
  .filters-bar, .agg-filters, .profile-sidebar, .program-detail-sidebar { transition: none; }
}
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--blue); color: #fff; padding: 10px 18px; border-radius: 0 0 8px 0; font-weight: 600; text-decoration: none; }
.skip-link:focus { left: 0; }

/* ===== HERO ===== */
/* Shared masthead layout. Surface color belongs exclusively to the page-top
   contract above so task flows cannot inherit a public landing surface. */
.hero,
.page-hero { padding: 48px 0 56px; }
.hero-sub,
.page-hero-sub,
.page-hero .advertise-lead { max-width: 720px; margin: 0 0 28px; color: var(--text-muted); font-size: clamp(1.05rem,2vw,1.2rem); line-height: 1.7; }
.page-hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--blue); font-size: var(--type-ui); font-weight: 700; letter-spacing: 0.11em; line-height: 1.35; text-transform: uppercase; }
.page-hero-eyebrow::before { content: ''; display: block; width: 28px; height: 2px; background: var(--brand-orange); border-radius: 2px; }
.page-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.page-hero > .container > :last-child { margin-bottom: 0; }
@media (max-width: 600px) {
  .hero,
  .page-hero { padding: 36px 0 42px; }
  .page-top--landing h1 { font-size: clamp(2.15rem, 11vw, 3.1rem); }
}

/* ===== FORM ===== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
label { font-size: var(--type-ui); font-weight: 600; color: var(--text); }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="search"], input[type="password"], input[type="number"], input[type="date"], textarea, select { background: var(--bg-input); border: 1.5px solid var(--border-light); border-radius: 8px; color: var(--text); font-size: var(--type-ui); font-family: var(--font); padding: 11px 14px; width: 100%; transition: border-color var(--transition), box-shadow var(--transition); }
select { appearance: none; -webkit-appearance: none; }
input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus, input[type="url"]:focus, input[type="search"]:focus, input[type="password"]:focus, input[type="number"]:focus, input[type="date"]:focus, textarea:focus, select:focus { outline: none; border-color: var(--lime); box-shadow: 0 0 0 3px rgba(45,95,158,0.22); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
textarea { resize: vertical; min-height: 110px; }
.cf-turnstile { max-width: 100%; overflow: hidden; }
.form-submit-row,
.exit-capture-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.cta-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; }

/* Compact chip rows shared by directory filters and program metadata. */
.category-chips,
.program-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* Breadcrumbs appear across content, aggregate, city, program, and profile
   routes. Route bundles own spacing only; typography and link treatment live
   here once. */
.breadcrumb { color: var(--text-faint); font-size: var(--type-ui); }
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Funding comparison tables are rendered on both city and state aggregate
   pages. The shared class is the component boundary; route bundles retain
   only their deliberately different responsive breakpoints. */
.city-compare { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.city-compare-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--type-ui); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.city-compare-table th,
.city-compare-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.city-compare-table thead th { background: var(--bg-alt); font-size: var(--type-ui); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); white-space: nowrap; }
.city-compare-table tbody th[scope="row"] { font-weight: 700; color: var(--heading); white-space: nowrap; }
.city-compare-table tbody tr:last-child th,
.city-compare-table tbody tr:last-child td { border-bottom: none; }
.city-compare-table tbody tr:hover th,
.city-compare-table tbody tr:hover td { background: rgba(64,126,201,0.04); }

/* Aggregate and program pages use the same conversion-band frame. Their copy
   widths and mobile button widths stay route-owned because those differ. */
.agg-cta,
.program-cta { padding: 56px 0; border-top: 1px solid var(--border); }
.agg-cta h2,
.program-cta h2 { font-size: 1.5rem; margin-bottom: 12px; }
.agg-cta .btn,
.program-cta .btn { margin: 0 8px; }

/* Full-width primary conversion bands on discovery and partner pages. */
.cta-section,
.page-partners-programs .partner-final-cta { padding: 80px 0; background: var(--blue); color: #fff; text-align: center; }

/* Shared low-key report/suggestion disclosure. These two forms render on
   different route families but are one browser component. */
.report-flag { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.report-flag > summary { color: var(--text-muted); cursor: pointer; font-size: var(--type-ui); font-weight: 600; }
.report-flag > summary:hover { color: var(--text); }
.report-flag-form,
.suggest-form { display: grid; max-width: 480px; margin-top: 12px; gap: 10px; }
.report-flag-form label,
.suggest-form label { display: block; color: var(--text); font-size: var(--type-ui); font-weight: 600; }
.report-flag-form input,
.report-flag-form select,
.report-flag-form textarea,
.suggest-form input,
.suggest-form select,
.suggest-form textarea { width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--border-light); border-radius: 8px; box-sizing: border-box; font: inherit; }
.report-flag-form textarea,
.suggest-form textarea { resize: vertical; }
.report-flag-check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.report-flag-check input { width: auto; margin: 0; }
.report-flag-msg { min-height: 1em; margin: 4px 0 0; font-size: var(--type-ui); }
.report-flag-msg.is-error { color: var(--red); }
.report-flag-msg.is-ok { color: var(--green); }
.report-flag .hp-field,
.suggest-form .hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ===== FOOTER ===== */
/* .site-footer base, .footer-inner, .footer-brand[/ strong/ a], and
   .footer-disclaimer are defined in the second FOOTER block below, which the
   cascade already resolved to (it comes later, identical values except
   .footer-disclaimer which it intentionally overrides). Only the rules unique to
   this section remain here, so the duplicates are removed without any visual change. */
.site-footer p { color: rgba(255,255,255,0.65); margin: 0; }
.site-footer p a { color: #F68D2E; }
.site-footer .footer-disclaimer a { color: rgba(255,255,255,0.72); }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  section { padding: 56px 0; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .deals-grid,
  .testimonials-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Ad placeholders stay collapsed until advertising code activates them. */
.ad-unit { display: none; max-width: 728px; margin: 32px auto; text-align: center; min-height: 90px; }
.ad-unit.active { display: block; }
.ad-unit-label { margin-bottom: 4px; color: var(--text-faint); font-size: var(--type-ui); letter-spacing: 0.05em; text-transform: uppercase; }

/* ===== FOOTER ===== */
.site-footer { padding: 48px 0; background: #0a0a0a; border-top: 1px solid rgba(255,255,255,0.1); color: #ffffff; }
.footer-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-brand { min-width: 0; font-size: var(--type-ui); color: rgba(255,255,255,0.65); line-height: 1.7; overflow-wrap: anywhere; }
.footer-brand strong { color: #ffffff; font-weight: 600; }
.site-footer .footer-brand a { color: #F68D2E; text-decoration: underline; }
.footer-links { display: flex; gap: 20px; font-size: var(--type-ui); flex-wrap: wrap; align-items: center; }
.site-footer .footer-links a { color: rgba(255,255,255,0.72); transition: color var(--transition); }
.site-footer .footer-links a:hover { color: #ffffff; text-decoration: none; }
.footer-disclaimer { font-size: var(--type-ui); color: rgba(255,255,255,0.65); max-width: 480px; line-height: 1.6; margin-top: 24px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .footer-inner { flex-direction: column; gap: 20px; }
}

/* Save buttons (program pages + contractor cards) */
.save-btn.saved { border-color: var(--lime); color: var(--lime); }
.contractor-save { margin-top: 10px; background: none; border: 1px solid var(--border); border-radius: 6px; padding: 4px 12px; font-size: var(--type-ui); color: var(--text-muted); cursor: pointer; font-family: var(--font); }
.contractor-save:hover,
.tm-chip:hover { border-color: var(--blue); color: var(--blue); }
/* Aggregate-landing hero icon (Lucide, replaces the old emoji) */
/* Ways-to-save deals (js/retail-deals.js): program-page slot + /deals page */
.deals-section { padding: 48px 0; }
.deals-heading { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.deals-sub { font-size: var(--type-ui); color: var(--text-muted); margin-bottom: 24px; }
.deals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.deal-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; }
.deal-card.deal-affiliate { border-left: 4px solid var(--orange); }
.deal-free-label { display: inline-block; align-self: flex-start; font-size: var(--type-ui); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--lime); background: rgba(64,126,201,0.08); padding: 2px 8px; border-radius: 999px; margin-bottom: 10px; }
.deal-ad-label { display: inline-block; align-self: flex-start; font-size: var(--type-ui); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 10px; }
.deal-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 2px; }
.deal-retailer { font-size: var(--type-ui); color: var(--text-faint); margin: 0 0 10px; }
.deal-blurb { font-size: var(--type-ui); color: var(--text-muted); line-height: 1.5; margin: 0 0 14px; flex: 1; }
.deal-region { font-size: var(--type-ui); color: var(--text-faint); font-style: italic; margin: 0 0 12px; }
.deal-cta { align-self: flex-start; }
.deal-disclosure { font-size: var(--type-ui); color: var(--text-faint); margin: 10px 0 0; }
/* Address autocomplete dropdown (js/address-autocomplete.js) */
.addr-suggest-wrap { position: relative; }
.addr-suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 50; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); margin-top: 4px; overflow: hidden; }
.addr-suggest-item { padding: 10px 14px; font-size: var(--type-ui); cursor: pointer; }
.addr-suggest-item:hover, .addr-suggest-item.active { background: rgba(64,126,201,0.08); }
.addr-suggest-google { padding: 6px 14px; font-size: var(--type-ui); color: var(--text-faint); border-top: 1px solid var(--border); text-align: right; }

/* Lucide icons */
.lucide { width: 1em; height: 1em; vertical-align: -0.125em; }

/* Cookie consent banner */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: #1a1a2e; color: #e0e0e0;
  padding: 16px 24px; display: flex; align-items: center; justify-content: center;
  gap: 16px; font-size: var(--type-ui); box-shadow: 0 -2px 12px rgba(0,0,0,0.25);
}
body .cookie-banner a { color: #7aa9e0; text-decoration: underline; }
.cookie-banner button {
  background: var(--blue-dark, #2d5f9e); color: #fff; border: none; border-radius: 6px;
  min-height: 44px; padding: 8px 20px; font-weight: 600; cursor: pointer; white-space: nowrap;
  font-size: var(--type-ui);
}
.cookie-banner button:hover { opacity: 0.9; }
.cookie-banner .cookie-decline {
  background: transparent; color: #aaa; border: 1px solid #555;
}
@media (max-width: 640px) {
  .cookie-banner { flex-direction: column; text-align: center; gap: 10px; padding: 14px 16px; }
}

/* Small cross-route state and accessibility primitives. Component presentation
   belongs in the owning route sheet; these names describe meaning, not a bag
   of declarations copied out of old inline styles. */
.feedback-error { color: var(--red); }
.feedback-success { color: var(--green); }
.text-center { text-align: center; }
.is-hidden { display: none !important; }
.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; }

/* Shared framing for the 404 and explicit lead-accept interstitials. */
.simple-status-value { margin-bottom: 8px; color: var(--blue); font-size: clamp(2.8rem, 12vw, 4rem); }
.simple-status-copy { margin-bottom: 24px; font-size: 1.1rem; }

/* Contractor directory card on /contractors. */
.contractor-card { min-width: 0; background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 10px; transition: border-color 0.15s, box-shadow 0.15s; }
.contractor-card:hover { border-color: var(--blue); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.contractor-card.grant-approved { border-color: var(--green); }
.contractor-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; }
.contractor-header h3 { min-width: 0; overflow-wrap: anywhere; font-size: 1.05rem; font-weight: 700; margin: 0; line-height: 1.3; }
.contractor-name-link { color: var(--heading); text-decoration: none; }
.contractor-name-link:hover { color: var(--blue); text-decoration: underline; }
.contractor-badge { background: var(--green); color: #fff; font-size: var(--type-ui); font-weight: 700; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.contractor-meta { display: flex; gap: 12px; font-size: var(--type-ui); color: var(--text-faint); }
.contractor-category { font-weight: 600; color: var(--blue); }
.contractor-verified { display: flex; flex-wrap: wrap; gap: 6px; }
.verified-pill { display: inline-flex; align-items: center; gap: 4px; background: rgba(34,197,94,0.1); color: #15803d; font-size: var(--type-ui); font-weight: 600; padding: 3px 8px; border-radius: 999px; border: 1px solid rgba(34,197,94,0.3); }

/* Unclaimed public-records seed cards (contractor directory). Amber/neutral,
   clearly "unverified", never the green Grant-Approved treatment. */
.contractor-card.unclaimed { border-color: rgba(245,158,11,0.35); }
.contractor-unclaimed-chip { display: inline-block; max-width: 100%; padding: 3px 10px; background: rgba(245,158,11,0.16); color: #b45309; font-size: var(--type-ui); font-weight: 700; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.03em; overflow-wrap: anywhere; }
.contractor-claim-link { display: inline-block; margin-top: 10px; font-weight: 600; font-size: var(--type-ui); color: #b45309; text-decoration: none; }
.contractor-claim-link:hover { text-decoration: underline; }

.quiz-capture-card input[type="email"] { margin-bottom: 10px; }
.quiz-capture-turnstile { margin: 10px 0; }
.contractor-consent { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; font-size: var(--type-ui); line-height: 1.6; color: var(--text-faint); text-align: left; }
.contractor-consent input[type="checkbox"] { margin-top: 3px; flex: 0 0 auto; width: 16px; height: 16px; }
.contractor-consent a { color: var(--orange-text); text-decoration: underline; }

/* Lead accept confirm page (email link interstitial) */
.lead-accept-confirm-form { margin: 0 0 18px; }
.lead-accept-confirm-note { font-size: var(--type-ui); color: #64748b; max-width: 460px; margin: 0 auto 10px; }
.lead-accept-confirm-note a { color: var(--blue); }

/* ============================================================
   TESTIMONIALS: form page, hub, and the homepage/city slots.
   ============================================================ */
.testimonial-page { max-width: 640px; margin: 0 auto; padding: 48px 20px 64px; }
.testimonial-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg, 12px); padding: 32px 28px; }
.testimonial-card h1 { font-size: 1.6rem; margin: 0 0 10px; }
.testimonial-card p { color: var(--text-muted); }
.tm-field { margin: 18px 0 0; }
.tm-label { display: block; font-weight: 600; font-size: var(--type-ui); margin-bottom: 8px; }
.tm-field textarea, .tm-field input[type="text"] { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; font-family: var(--font); font-size: var(--type-ui); background: var(--bg-input, #fff); }
.tm-field textarea:focus, .tm-field input[type="text"]:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.tm-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.tm-chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 9px 16px; font-family: var(--font); font-size: var(--type-ui); font-weight: 600; color: var(--text); cursor: pointer; transition: background-color var(--transition), border-color var(--transition), color var(--transition); }
.tm-chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.tm-stars { display: flex; gap: 4px; }
.tm-star { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; background: none; border: none; cursor: pointer; padding: 8px; color: var(--border); }
.tm-star svg { width: 28px; height: 28px; }
.tm-star.on { color: var(--orange); }
.tm-star.on svg { fill: var(--orange); }
.tm-consent label { display: flex; gap: 10px; align-items: flex-start; font-size: var(--type-ui); color: var(--text); cursor: pointer; }
.tm-consent input { margin-top: 3px; }
.testimonial-page .btn-primary { margin-top: 22px; }
.field-error { color: #dc3545; font-size: var(--type-ui); margin: 6px 0 0; }

.testimonials-hub { max-width: 980px; margin: 0 auto; padding: 48px 20px 64px; }
.testimonials-hub-head h1 { font-size: 2rem; margin: 0 0 10px; }
.testimonials-hub-head p { color: var(--text-muted); max-width: 640px; }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 28px; }
.tm-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg, 12px); padding: 22px; margin: 0; display: flex; flex-direction: column; }
.tm-card blockquote { margin: 0 0 14px; font-size: var(--type-ui); line-height: 1.6; color: var(--text); flex: 1; }
.tm-card blockquote::before { content: '\201C'; color: var(--orange); font-size: 1.6em; line-height: 0; vertical-align: -0.35em; margin-right: 2px; }
.tm-card figcaption { font-size: var(--type-ui); color: var(--text-muted); font-weight: 600; }
.tm-badge { display: inline-block; background: rgba(63,142,72,0.12); color: var(--green, #3f8e48); font-size: var(--type-ui); font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.tm-badge-pro,
.tm-badge-progress { background: rgba(64,126,201,0.12); color: var(--blue); }
.testimonials-empty { text-align: center; padding: 56px 20px; }
.testimonials-empty h2 { margin-bottom: 8px; }
.testimonials-empty p { color: var(--text-muted); max-width: 480px; margin: 0 auto 20px; }

/* Slots on the homepage + city pages: hidden until JS confirms content. */
.tm-slot { padding: 40px 0 8px; }
.tm-slot-head { font-size: 1.25rem; font-weight: 800; margin: 0 0 4px; }
.tm-slot-sub { font-size: var(--type-ui); color: var(--text-muted); margin: 0 0 16px; }
.tm-slot .testimonials-grid { margin-top: 0; }
.tm-slot-more { display: inline-block; margin-top: 14px; font-size: var(--type-ui); font-weight: 600; }

/* Canonical footer meta row (copyright, support, insurance) + the consent
   checkbox sizing fix (a global input width rule was stretching it). */
.site-footer .footer-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; min-width: 0; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.12); font-size: var(--type-ui); overflow-wrap: anywhere; }
.site-footer .footer-meta > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.site-footer .footer-meta span, .site-footer .footer-meta a { color: rgba(255,255,255,0.55); text-decoration: none; }
.site-footer .footer-meta a:hover,
.site-footer .cookie-preferences-control:hover { color: #fff; text-decoration: underline; }
.site-footer .cookie-preferences-control { min-height: 44px; margin: -8px 0; padding: 8px 0; border: 0; background: transparent; color: rgba(255,255,255,0.55); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.tm-consent input[type="checkbox"] { width: auto; flex: 0 0 auto; }
/* Outcome badge variants: in-progress (blue) and helped-but-not-funded
   (orange) join the green funded badge. */
.tm-badge-helped { background: rgba(246,141,46,0.14); color: var(--orange-dark, #d2691e); }

/* Respect operating-system motion preferences. Keep transitions effectively
   instantaneous without disabling state changes or final animation frames. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Useful print output for guides, program details, and application paperwork.
   Navigation, consent, advertising, and conversion UI do not belong on paper. */
@media print {
  @page { margin: 0.6in; }
  html, body { background: #fff; color: #000; }
  body { padding: 0; }
  .site-nav,
  .site-footer,
  .cookie-banner,
  .ad-unit,
  .program-contractor-slot,
  .city-sponsor-section,
  .tm-slot,
  .program-cta,
  .exit-capture-card { display: none !important; }
  .container { max-width: none; padding-left: 0; padding-right: 0; }
  .guide-article,
  .program-detail-body { max-width: none; padding-top: 0; }
  .detail-card,
  .application-paperwork { break-inside: avoid; box-shadow: none; }
  .city-compare { overflow: visible; }
  a { color: inherit; text-decoration: underline; }
}
