:root {
  --rerc-green: #00573f;
  --forest: #173f35;
  --river: #1b6a8f;
  --river-light: #e8f3f7;
  --gold: #f2c14e;
  --ink: #1b1f23;
  --muted: #52615b;
  --line: #cbd5d0;
  --mist: #f4f7f5;
  --white: #ffffff;
  --danger: #9b2c2c;
  --shadow: 0 12px 30px rgba(23, 63, 53, 0.12);
  --header-height: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 86px; }
body { margin: 0; color: var(--ink); background: var(--mist); font-family: "Source Sans 3", "Public Sans", Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.5; letter-spacing: 0; }
body, button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { min-height: 44px; }
button { cursor: pointer; }
a { color: var(--river); }
img { display: block; max-width: 100%; }
svg { width: 19px; height: 19px; flex: 0 0 auto; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.3rem); line-height: 1.05; }
h2 { margin: 0; font-size: 1.65rem; line-height: 1.15; }
h3 { margin: 0; font-size: 1.08rem; line-height: 1.25; }
p { margin: 0; }
.eyebrow { margin: 0 0 5px; color: var(--rerc-green); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
.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; }
.skip-link { position: fixed; z-index: 9999; top: 8px; left: 8px; min-height: 44px; padding: 10px 14px; color: var(--rerc-green); background: var(--white); border: 2px solid var(--rerc-green); border-radius: 4px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; box-shadow: 0 0 0 2px var(--forest); }

.agency-header { position: sticky; z-index: 1000; top: 0; display: grid; grid-template-columns: minmax(280px, auto) 1fr auto; align-items: center; min-height: var(--header-height); padding: 8px max(20px, calc((100vw - 1500px) / 2)); color: var(--white); background: var(--rerc-green); border-bottom: 4px solid var(--gold); }
.program-identity { display: inline-flex; min-width: 0; align-items: center; gap: 11px; color: var(--white); text-decoration: none; }
.program-identity > span:last-child { display: grid; min-width: 0; }
.program-identity strong { line-height: 1.15; }
.program-identity small { color: #dbeae4; }
.program-mark { display: grid; width: 48px; height: 44px; place-items: center; border: 2px solid var(--gold); border-radius: 4px; font-size: 0.9rem; font-weight: 900; }
.independent-label { justify-self: center; padding: 5px 9px; border: 1px solid rgba(255,255,255,0.45); border-radius: 4px; color: #e6f1ed; font-size: 0.78rem; font-weight: 700; }
.agency-actions { display: flex; align-items: center; gap: 4px; }
.agency-actions a, .agency-actions button { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; padding: 8px 10px; color: var(--white); background: transparent; border: 0; border-radius: 4px; font-weight: 700; text-decoration: none; }
.agency-actions a:hover, .agency-actions button:hover { background: rgba(255,255,255,0.13); }

.photo-scene { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 310px; align-items: end; gap: 34px; padding: 48px max(24px, calc((100vw - 1500px) / 2)); overflow: hidden; color: var(--white); background: var(--forest) url("assets/hero-outdoor.jpg") center 54% / cover no-repeat; isolation: isolate; }
.photo-scene::before { position: absolute; z-index: -1; inset: 0; content: ""; background: rgba(7,42,31,0.68); }
.scene-copy { max-width: 760px; padding-bottom: 8px; }
.scene-copy .eyebrow { color: #cce9d9; }
.scene-copy > p:not(.eyebrow) { max-width: 650px; margin: 14px 0 20px; font-size: 1.1rem; }
.primary-action, .primary-button, .secondary-button, .icon-text-button, .file-button, .rercie-button, .download-actions a, .writer-actions > a { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: 6px; font-weight: 800; text-decoration: none; }
.primary-action { color: #17251f; background: var(--gold); border: 2px solid var(--gold); }
.scene-catalog { display: grid; grid-template-columns: repeat(3, minmax(92px, 1fr)); align-self: end; background: rgba(255,255,255,0.96); color: var(--ink); border-radius: 8px; box-shadow: var(--shadow); }
.scene-catalog div { padding: 13px 16px; border-right: 1px solid var(--line); }
.scene-catalog div:last-child { border-right: 0; }
.scene-catalog strong, .scene-catalog span { display: block; }
.scene-catalog strong { color: var(--rerc-green); font-size: 1.35rem; }
.scene-catalog span { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.photo-credit { position: absolute; right: 12px; bottom: 7px; font-size: 0.72rem; }
.photo-credit a { display: inline-flex; min-height: 44px; align-items: center; color: inherit; }

.workflow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1500px; margin: 0 auto; background: var(--white); border-bottom: 1px solid var(--line); }
.workflow-steps button { display: flex; min-width: 0; min-height: 66px; align-items: center; gap: 11px; padding: 10px 18px; color: var(--muted); background: var(--white); border: 0; border-right: 1px solid var(--line); text-align: left; }
.workflow-steps button:last-child { border-right: 0; }
.workflow-steps button > span:first-child { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 2px solid var(--line); border-radius: 50%; font-weight: 800; }
.workflow-steps button > span:last-child { display: grid; min-width: 0; }
.workflow-steps strong { color: var(--ink); }
.workflow-steps small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-steps button.active { color: var(--rerc-green); box-shadow: inset 0 -4px 0 var(--rerc-green); }
.workflow-steps button.active > span:first-child { color: var(--white); background: var(--rerc-green); border-color: var(--rerc-green); }
.workflow-steps button:disabled { cursor: not-allowed; color: #76847e; background: #f1f4f2; opacity: 0.72; }
.workflow-steps button:disabled strong { color: #617069; }
.workflow-steps button:disabled > span:first-child { background: #f1f4f2; border-color: #9eaaa5; }

.explorer-shell { display: grid; grid-template-columns: minmax(0, 1fr) 390px; max-width: 1500px; margin: 0 auto; background: var(--white); border-bottom: 1px solid var(--line); }
.explorer-main { min-width: 0; padding: 28px 30px 72px; }
.filter-toggle { display: none; }
.wizard-flow { margin-bottom: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: 0 5px 18px rgba(23,63,53,0.07); }
.wizard-heading { padding: 22px 24px 17px; border-bottom: 1px solid var(--line); }
.wizard-heading > p:last-child { max-width: 700px; margin-top: 7px; color: var(--muted); }
.wizard-panel { padding: 22px 24px 26px; }
.wizard-panel + .wizard-panel { border-top: 1px solid var(--line); }
.panel-heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 18px; }
.panel-heading p { margin-top: 3px; color: var(--muted); }
.panel-step { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; color: var(--white); background: var(--rerc-green); border-radius: 50%; font-weight: 800; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.state-change-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
.state-change-controls p { flex: 1 1 260px; margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.4; }
.state-change-controls .secondary-button { flex: 0 0 auto; }
.field-wide { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, fieldset legend { color: var(--forest); font-weight: 800; }
.field input, .field select, .field textarea, .results-toolbar select { width: 100%; min-width: 0; padding: 9px 11px; color: var(--ink); background: var(--white); border: 1px solid #8d9f97; border-radius: 4px; }
.field textarea { min-height: 118px; resize: vertical; }
.profile-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.status-message { color: var(--muted); font-size: 0.9rem; }
.required-note { margin-top: 10px; color: var(--muted); font-size: 0.9rem; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(155,44,44,0.12); }
.wizard-controls { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; }
.wizard-controls button { min-width: 112px; padding: 9px 14px; color: var(--white); background: var(--rerc-green); border: 1px solid var(--rerc-green); border-radius: 6px; font-weight: 800; }
.wizard-controls button[data-wizard-back] { color: var(--rerc-green); background: var(--white); }
[data-community-gated][hidden] { display: none !important; }
.profile-summary { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.profile-summary-content { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.question-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 20px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset legend { margin-bottom: 9px; }
.check-list { display: grid; gap: 4px; }
.check-list label { display: flex; min-height: 40px; align-items: flex-start; gap: 9px; padding: 7px 5px; border-radius: 4px; cursor: pointer; }
.check-list > [hidden] { display: none !important; }
.check-list label:hover { background: var(--mist); }
.supplemental-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.check-list input, .toggle-row input, .language-options input { width: 19px; height: 19px; min-height: 0; margin: 3px 0 0; accent-color: var(--rerc-green); }
.compact-fields { align-items: end; margin-top: 20px; }
.toggle-row { display: flex; min-height: 52px; align-items: flex-start; gap: 10px; padding: 10px 12px; background: #fff9e8; border-left: 4px solid var(--gold); border-radius: 4px; cursor: pointer; }
.toggle-row span { display: grid; }
.toggle-row small { color: var(--muted); }
.priority-summary { margin-top: 13px; color: var(--muted); }
.primary-button { color: var(--white); background: var(--rerc-green); border: 1px solid var(--rerc-green); }
.secondary-button, .icon-text-button, .file-button { color: var(--rerc-green); background: var(--white); border: 1px solid var(--rerc-green); }
.secondary-button:hover, .icon-text-button:hover, .file-button:hover { color: var(--white); background: var(--rerc-green); }
.icon-button { display: inline-grid; width: 44px; height: 44px; padding: 0; place-items: center; color: var(--rerc-green); background: var(--white); border: 1px solid var(--line); border-radius: 4px; }
.file-button { position: relative; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.rercie-button { color: var(--forest); background: var(--gold); border: 1px solid #d1a22f; }

.matches-workspace { scroll-margin-top: 88px; }
#results[hidden], #resultsToolbar[hidden], #fundingViewSwitch[hidden], #fundingCalendar[hidden] { display: none !important; }
.results-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 16px; }
.results-heading > div:first-child { max-width: 760px; }
.results-heading p:last-child { margin-top: 6px; color: var(--muted); }
.match-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.count-badge { display: inline-grid; min-width: 24px; height: 24px; place-items: center; padding: 0 6px; color: var(--white); background: var(--rerc-green); border-radius: 8px; font-size: 0.78rem; }
.mode-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 6px 0 16px; overflow: hidden; background: var(--white); border: 1px solid var(--rerc-green); border-radius: 6px; }
.mode-tabs button { display: inline-flex; min-width: 0; min-height: 46px; align-items: center; justify-content: center; gap: 7px; padding: 8px; color: var(--rerc-green); background: var(--white); border: 0; border-right: 1px solid var(--rerc-green); font-weight: 800; }
.mode-tabs button:last-child { border-right: 0; }
.mode-tabs button.active { color: var(--white); background: var(--rerc-green); }
.mode-tabs button[data-mode="Resource"].active { background: var(--river); }
.mode-tabs button[data-mode="Case Study"].active { background: #8a6b16; }
.result-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; border: 1px solid var(--line); border-radius: 6px; }
.result-stats div { min-width: 0; padding: 10px 13px; border-right: 1px solid var(--line); }
.result-stats div:last-child { border-right: 0; }
.result-stats strong, .result-stats span { display: block; }
.result-stats strong { color: var(--rerc-green); font-size: 1.25rem; }
.result-stats span { color: var(--muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.next-deadline { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 72px; margin-bottom: 14px; padding: 11px 14px; background: #f4f8f5; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-left: 5px solid var(--gold); }
.next-deadline.empty { border-left-color: var(--line); }
.next-deadline-icon { display: grid; width: 40px; height: 40px; place-items: center; color: var(--forest); background: #ffedb0; border-radius: 50%; }
.next-deadline > div { display: grid; min-width: 0; gap: 2px; }
.next-deadline-label { color: var(--muted); font-size: 0.74rem; font-weight: 800; text-transform: uppercase; }
.next-deadline strong { color: var(--forest); font-size: 1.05rem; }
.next-deadline #nextDeadlineMeta { color: var(--muted); font-size: 0.88rem; }
.next-deadline > a { display: inline-flex; min-height: 44px; align-items: center; padding: 8px 11px; color: var(--rerc-green); border: 1px solid var(--rerc-green); border-radius: 4px; font-weight: 800; text-decoration: none; }
.next-deadline > a[hidden] { display: none; }
.coverage-note { margin-top: -5px; color: var(--muted); font-size: 0.82rem; }
.funding-view-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; padding: 9px 11px; background: #f4f8f5; border: 1px solid var(--line); border-radius: 6px; }
.funding-view-switch > span { color: var(--forest); font-size: 0.82rem; font-weight: 800; text-transform: uppercase; }
.funding-view-switch > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--rerc-green); border-radius: 4px; }
.funding-view-switch button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 7px; padding: 7px 12px; color: var(--rerc-green); background: var(--white); border: 0; }
.funding-view-switch button + button { border-left: 1px solid var(--rerc-green); }
.funding-view-switch button.active { color: var(--white); background: var(--rerc-green); }
.funding-calendar { margin-bottom: 18px; padding: 16px; background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--rerc-green); border-radius: 6px; }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.calendar-controls { display: flex; align-items: center; gap: 6px; }
.calendar-controls .secondary-button { min-height: 44px; }
.calendar-month-title { margin: 0 0 9px; color: var(--forest); font-size: 1.1rem; text-transform: capitalize; }
.calendar-grid-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--line); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(90px, 1fr)); min-width: 680px; background: var(--line); gap: 1px; }
.calendar-weekday { padding: 8px 5px; color: var(--white); background: var(--forest); font-size: 0.76rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-day { display: grid; align-content: start; gap: 4px; min-height: 104px; padding: 7px; overflow: hidden; background: var(--white); }
.calendar-day.outside { background: #eef3f1; }
.calendar-day.today { box-shadow: inset 0 0 0 3px var(--gold); }
.calendar-day.has-deadline { background: #f4f8f5; }
.calendar-day > strong { color: var(--forest); font-size: 0.82rem; }
.calendar-day a, .calendar-day span:not(.calendar-more) { display: -webkit-box; overflow: hidden; color: var(--rerc-green); font-size: 0.72rem; font-weight: 700; line-height: 1.2; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.calendar-day a:hover { text-decoration: underline; }
.calendar-more { color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.calendar-agenda { margin-top: 17px; }
.calendar-agenda > h4 { margin-bottom: 7px; }
.calendar-agenda-item { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.calendar-agenda-item time { color: var(--forest); font-weight: 800; }
.calendar-agenda-item div { display: grid; gap: 2px; }
.calendar-agenda-item a { color: var(--rerc-green); font-weight: 800; }
.calendar-agenda-item small { color: var(--muted); }
.results-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.results-toolbar label { display: grid; grid-template-columns: auto auto; align-items: center; gap: 7px; font-weight: 700; }
.results-toolbar select { width: auto; min-height: 44px; }
.legacy-exports { display: flex; gap: 7px; margin-left: auto; }
.legacy-exports button { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; padding: 8px 11px; color: var(--rerc-green); background: var(--white); border: 1px solid var(--rerc-green); border-radius: 4px; font-weight: 800; }
.case-study-collections { display: grid; grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr); gap: 26px; padding: 18px 2px; border-bottom: 1px solid var(--line); }
.case-study-collections[hidden] { display: none !important; }
.case-study-collections h3 { margin-top: 2px; font-size: 1.05rem; }
.case-study-collections p:last-child { margin-top: 4px; color: var(--muted); }
.case-study-collections ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 22px; margin: 0; padding-left: 20px; }
.case-study-collections li { padding: 3px 0; }
.case-study-collections a { display: inline-flex; min-height: 40px; align-items: center; color: var(--river); font-weight: 800; }
.active-filters { min-height: 28px; padding: 7px 0; color: var(--muted); font-size: 0.9rem; }
.results, .result-group { display: grid; gap: 10px; }
.result-group { padding-bottom: 24px; }
.result-group + .result-group { padding-top: 20px; border-top: 3px solid var(--line); }
.result-group-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; padding: 3px 2px; }
.result-group-heading p { margin-top: 3px; color: var(--muted); }
.result-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 16px 17px; background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--rerc-green); border-radius: 6px; box-shadow: 0 3px 11px rgba(23,63,53,0.06); }
.result-card.resource { border-left-color: var(--river); }
.result-card.case-study { border-left-color: #8a6b16; }
.result-card.closed { border-left-color: #725b22; }
.card-kicker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 5px; color: var(--muted); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; }
.pill { display: inline-block; padding: 3px 6px; color: var(--rerc-green); background: var(--mist); border-radius: 4px; }
.resource .pill { color: var(--river); background: var(--river-light); }
.case-study .pill { color: #654e10; background: #fff2c7; }
.result-card h4 { margin: 0; font-size: 1.05rem; line-height: 1.25; }
.result-card h4 a { display: inline-flex; min-height: 44px; align-items: center; color: var(--ink); text-decoration: none; }
.result-card h4 a:hover { color: var(--rerc-green); text-decoration: underline; }
.organization { margin: 3px 0 8px; color: var(--muted); font-weight: 700; }
.summary, .details { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; }
.summary { margin: 0 0 8px; -webkit-line-clamp: 2; }
.details { margin: 0; color: var(--muted); font-size: 0.9rem; -webkit-line-clamp: 2; }
.details strong { color: var(--ink); }
.match-reason { margin: 9px 0 6px; padding-left: 10px; color: var(--forest); border-left: 3px solid var(--gold); font-size: 0.92rem; }
.case-link { display: inline-flex; min-height: 44px; align-items: center; color: var(--rerc-green); font-weight: 800; }
.result-card details { margin-top: 8px; border-top: 1px solid var(--line); }
.result-card summary { min-height: 44px; padding: 10px 0; color: var(--rerc-green); font-weight: 800; cursor: pointer; }
.score { align-self: start; min-width: 70px; padding: 8px; color: var(--rerc-green); background: var(--mist); border-radius: 4px; text-align: center; }
.score strong, .score span { display: block; }
.score strong { font-size: 1.15rem; }
.score span { font-size: 0.72rem; text-transform: uppercase; }
.empty-state, .empty-copy { color: var(--muted); }
.empty-state { padding: 24px; background: #fffaf0; border-left: 5px solid var(--gold); }

.plan-rail { position: sticky; top: var(--header-height); max-height: calc(100vh - var(--header-height)); overflow-y: auto; background: #f8faf9; border-left: 1px solid var(--line); }
.plan-rail-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 21px 20px 17px; color: var(--white); background: var(--forest); border-bottom: 4px solid var(--gold); }
.plan-rail-heading .eyebrow { color: #cce9d9; }
.plan-rail-heading .icon-button { color: var(--white); background: transparent; border-color: rgba(255,255,255,0.45); }
.rail-section { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.rail-section > p, .rail-section > div { margin-top: 9px; }
.rail-section .section-heading + * { margin-top: 10px; }
.map-status { color: var(--muted); font-size: 0.78rem; }
.community-map { width: 100%; min-height: 205px; background: #dcebe5; border: 1px solid var(--line); border-radius: 6px; }
.osm-map-frame { display: block; width: 100%; min-height: 205px; border: 0; }
.map-placeholder { margin: 0; padding: 16px 14px 4px; color: var(--muted); }
.map-fallback-link { display: inline-flex; min-height: 44px; align-items: center; margin: 0 10px 8px; color: var(--rerc-green); font-weight: 800; }
.map-attribution { display: inline-flex; min-height: 44px; align-items: center; padding: 0 10px; }
.roadmap, .deadline-list, .funding-sequence { display: grid; gap: 8px; }
.roadmap-item, .deadline-item { padding: 10px 0; border-top: 1px solid var(--line); }
.funding-sequence-section .section-note { margin: 8px 0 0; color: var(--muted); font-size: 0.84rem; line-height: 1.45; }
.funding-sequence-summary { margin: 0; color: var(--forest); font-size: 0.84rem; font-weight: 800; }
.funding-sequence-phase { display: grid; gap: 7px; margin-top: 8px; padding: 12px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid #477da1; border-radius: 6px; }
.funding-sequence-phase[data-phase="design"] { border-left-color: var(--gold); }
.funding-sequence-phase[data-phase="build"] { border-left-color: var(--rerc-green); }
.funding-sequence-phase[data-phase="operate"] { border-left-color: #9a533d; }
.funding-sequence-phase > header { display: flex; align-items: center; gap: 8px; }
.funding-sequence-phase h4, .funding-sequence-item h5 { margin: 0; color: var(--forest); overflow-wrap: anywhere; }
.funding-sequence-phase h4 { font-size: 0.98rem; }
.funding-phase-number { display: inline-grid; width: 28px; height: 28px; place-items: center; flex: 0 0 28px; color: var(--white); background: var(--forest); border-radius: 50%; font-size: 0.78rem; font-weight: 900; }
.funding-phase-purpose, .funding-phase-outputs, .funding-phase-empty { margin: 0; font-size: 0.8rem; line-height: 1.4; }
.funding-phase-purpose { color: var(--text); font-weight: 800; }
.funding-phase-outputs, .funding-phase-empty { color: var(--muted); }
.funding-sequence-item { display: grid; gap: 5px; margin-top: 4px; padding: 10px 0 0; border-top: 1px solid var(--line); }
.funding-sequence-item h5 { font-size: 0.9rem; line-height: 1.3; }
.funding-sequence-step { width: fit-content; padding: 3px 6px; color: var(--forest); background: #edf6f0; border-radius: 3px; font-size: 0.7rem; font-weight: 900; }
.funding-sequence-timing, .funding-sequence-prepares { margin: 0; font-size: 0.77rem; line-height: 1.4; overflow-wrap: anywhere; }
.funding-sequence-timing { color: var(--forest); font-weight: 800; }
.funding-sequence-prepares { color: var(--muted); }
.funding-sequence-caveat { margin: 4px 0 0; padding: 9px 10px; color: #5c4b18; background: #fff8df; border-left: 3px solid var(--gold); font-size: 0.76rem; line-height: 1.4; }
.roadmap-item:first-child, .deadline-item:first-child { border-top: 0; }
.planner-status { padding: 8px 10px; color: var(--forest); background: #edf6f0; border-left: 3px solid var(--rerc-green); }
.roadmap-item { display: grid; gap: 7px; }
.roadmap-item label { font-weight: 800; overflow-wrap: anywhere; }
.roadmap-stage-label { color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.roadmap-item select { min-height: 44px; padding: 8px 10px; color: var(--ink); background: var(--white); border: 1px solid #8d9f97; border-radius: 4px; font: inherit; }
.deadline-item { display: grid; gap: 8px; min-width: 0; padding: 13px 0; }
.deadline-item h3 { margin: 0; color: var(--forest); font-size: 0.96rem; line-height: 1.25; overflow-wrap: anywhere; }
.deadline-main { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; }
.deadline-main time { color: var(--text); font-weight: 800; }
.deadline-label, .deadline-status, .timing-class { display: inline-flex; width: fit-content; min-height: 28px; align-items: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--forest); background: #f4f8f5; font-size: 0.74rem; font-weight: 800; line-height: 1.2; }
.deadline-label.urgent, .deadline-label.soon { border-color: #d5a52c; background: #fff3c7; }
.deadline-label.past, .deadline-status.closed, .timing-class.closed { color: #6d2f27; border-color: #d8b0aa; background: #fff3f1; }
.deadline-status.rolling, .timing-class.rolling { border-color: #7aab88; background: #eef8f1; }
.deadline-detail { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.4; overflow-wrap: anywhere; }
.deadline-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.deadline-footer small { color: var(--muted); }
.deadline-footer a { color: var(--rerc-green); font-size: 0.8rem; font-weight: 800; }
.calendar-timing-summary { margin: -3px 0 10px; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.timing-detail { display: inline-block; margin-top: 4px; }
.project-notes { display: grid; gap: 12px; }
.plan-exports h3 { margin-bottom: 12px; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.action-grid > * { min-width: 0; }
.action-grid .rercie-button { grid-column: 1 / -1; }
.danger-button { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; margin-top: 12px; padding: 8px 11px; color: var(--danger); background: #fff7f5; border: 1px solid #d8b0aa; border-radius: 4px; font-weight: 800; }

.saved-tray { position: fixed; z-index: 1500; right: 18px; bottom: 18px; display: grid; width: min(420px, calc(100vw - 36px)); max-height: min(640px, calc(100vh - 36px)); overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 56px rgba(12,40,31,0.26); }
.saved-tray[hidden] { display: none; }
.saved-tray > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px; border-bottom: 1px solid var(--line); }
.saved-tray-items { display: grid; gap: 8px; min-height: 120px; padding: 14px 17px; overflow-y: auto; }
.saved-tray > .primary-button { margin: 0 17px 17px; }

.download-band, .writer-band { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: center; gap: 34px; padding: 42px max(24px, calc((100vw - 1240px) / 2)); }
.download-band { background: var(--river-light); border-top: 1px solid #bed7df; }
.download-band p:not(.eyebrow) { max-width: 700px; margin-top: 7px; color: var(--muted); }
.download-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.download-actions a { color: var(--rerc-green); background: var(--white); border: 1px solid var(--rerc-green); }
.contribute-band { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: center; gap: 34px; padding: 38px max(24px, calc((100vw - 1240px) / 2)); background: #f4f8f5; border-top: 1px solid var(--line); }
.contribute-band p:not(.eyebrow) { max-width: 760px; margin-top: 7px; color: var(--muted); }
.contribute-actions { display: grid; gap: 8px; min-width: 220px; }
.contribute-actions a, .contribute-actions button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; color: var(--white); background: var(--rerc-green); border: 1px solid var(--rerc-green); border-radius: 4px; cursor: pointer; font: inherit; font-weight: 800; text-decoration: none; }
.contribute-actions a + a, .contribute-actions button + button { color: var(--rerc-green); background: var(--white); }
.writer-band { grid-template-columns: minmax(220px, 280px) minmax(300px, 1fr) minmax(280px, 390px); color: var(--white); background: var(--forest); }
.writer-band .eyebrow { color: #bfe7d0; }
.rercie-mascot { display: block; width: min(280px, 100%); height: auto; aspect-ratio: 16 / 9; align-self: center; justify-self: center; object-fit: contain; object-position: center; background: #f4f8f5; border: 4px solid var(--gold); border-radius: 8px; }
.rercie-copy { display: grid; gap: 8px; }
.writer-note { color: #ffecaf; font-weight: 700; }
.writer-actions { display: grid; gap: 8px; }
.writer-actions > a { color: var(--forest); background: var(--gold); border: 1px solid var(--gold); }
.writer-actions span { color: #d8e6e0; font-size: 0.88rem; }
.writer-actions a:not(:first-child), .verification-links a { color: #d3eef7; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 28px max(24px, calc((100vw - 1240px) / 2)); color: #dce7e2; background: #0f2f28; }
.site-footer p { max-width: 840px; margin-top: 5px; }
.site-footer a { display: inline-flex; flex: 0 0 auto; min-height: 44px; align-items: center; color: #d3eef7; }

.mobile-nav { display: none; }
.app-dialog { width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 20px 70px rgba(10,38,29,0.28); }
.app-dialog::backdrop { background: rgba(8,32,25,0.68); }
.compact-dialog { width: min(600px, calc(100vw - 32px)); }
.dialog-shell { display: grid; max-height: calc(100vh - 34px); padding: 22px; overflow-y: auto; gap: 15px; }
.dialog-shell > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dialog-shell > footer { display: flex; justify-content: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
.contribution-dialog { width: min(960px, calc(100vw - 32px)); }
.contribution-dialog .dialog-shell { grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.contribution-dialog .dialog-shell > footer { flex-wrap: wrap; gap: 8px; }
.contribution-frame { min-height: 430px; height: min(720px, calc(100vh - 230px)); overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--mist); }
.contribution-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--white); }
.comparison-table { min-height: 180px; overflow: auto; }
.comparison-table table { width: 100%; border-collapse: collapse; }
.comparison-table th, .comparison-table td { min-width: 180px; padding: 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.comparison-table th { background: var(--mist); }
.language-options { display: grid; gap: 8px; }
.language-options label { display: flex; min-height: 58px; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.language-options label:has(input:checked) { border-color: var(--rerc-green); background: var(--mist); }
.language-options span { display: grid; }
.language-options small, .dialog-note { color: var(--muted); }

@media (max-width: 1180px) {
  .agency-header { grid-template-columns: minmax(280px, 1fr) auto; }
  .independent-label { display: none; }
  .explorer-shell { grid-template-columns: minmax(0, 1fr) 340px; }
  .explorer-main { padding-left: 22px; padding-right: 22px; }
  .scene-catalog { grid-template-columns: 1fr; }
  .scene-catalog div { min-width: 118px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .scene-catalog div:last-child { border-bottom: 0; }
}

@media (max-width: 960px) {
  .photo-scene { grid-template-columns: 1fr; min-height: 290px; }
  .scene-catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 430px); }
  .scene-catalog div { border-right: 1px solid var(--line); border-bottom: 0; }
  .explorer-shell { grid-template-columns: 1fr; }
  .plan-rail { position: static; max-height: none; border-top: 4px solid var(--gold); border-left: 0; }
  .plan-rail-heading { position: sticky; z-index: 20; top: var(--header-height); }
  .filter-toggle { display: inline-flex; width: 100%; min-height: 48px; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; color: var(--rerc-green); background: var(--white); border: 1px solid var(--rerc-green); border-radius: 6px; font-weight: 800; }
  .filters:not(.open) { display: none; }
  .filters.open { display: block; }
  .download-band, .writer-band { grid-template-columns: 1fr; }
  .download-actions { justify-content: flex-start; }
  .writer-actions { grid-column: auto; max-width: 520px; }
}

@media (max-width: 680px) {
  html { scroll-padding-top: 124px; }
  :root { --header-height: 62px; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.4rem; }
  .agency-header { grid-template-columns: minmax(0, 1fr) auto; min-height: var(--header-height); padding: 6px 10px; }
  .program-identity { gap: 7px; }
  .program-identity { min-height: 44px; }
  .wizard-controls button, .choice-pager-controls button { min-width: 44px; }
  .verification-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
  .verification-links a { display: inline-flex; min-height: 44px; align-items: center; }
  .program-mark { width: 40px; height: 40px; font-size: 0.74rem; }
  .program-identity strong { font-size: 0.82rem; }
  .program-identity small { font-size: 0.72rem; }
  .agency-actions > a { display: none; }
  .agency-actions button { width: 44px; padding: 0; justify-content: center; }
  .agency-actions button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .photo-scene { min-height: 245px; gap: 18px; padding: 27px 18px 34px; background-position: center; }
  .photo-scene::before { background: rgba(7,42,31,0.74); }
  .scene-copy > p:not(.eyebrow) { margin: 10px 0 15px; font-size: 1rem; }
  .primary-action { width: 100%; }
  .scene-catalog { width: 100%; }
  .scene-catalog div { min-width: 0; padding: 7px 9px; text-align: center; }
  .scene-catalog strong { font-size: 1.1rem; }
  .scene-catalog span { font-size: 0.72rem; }
  .photo-credit { left: 18px; right: auto; font-size: 0.64rem; }
  .workflow-steps { position: sticky; z-index: 900; top: var(--header-height); }
  .workflow-steps button { min-height: 56px; justify-content: center; gap: 5px; padding: 6px 3px; text-align: center; }
  .workflow-steps button > span:first-child { width: 25px; height: 25px; font-size: 0.74rem; }
  .workflow-steps button > span:last-child { display: block; }
  .workflow-steps strong { font-size: 0.74rem; }
  .workflow-steps small { display: none; }
  .explorer-main { padding: 16px 14px 40px; }
  .wizard-heading, .wizard-panel { padding-left: 16px; padding-right: 16px; }
  .field-grid, .question-grid, .profile-summary-content { grid-template-columns: 1fr; }
  .state-change-controls { align-items: stretch; flex-direction: column; }
  .state-change-controls .secondary-button { width: 100%; justify-content: center; }
  .supplemental-filters { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .question-grid { gap: 20px; }
  .case-study-collections { grid-template-columns: 1fr; }
  .profile-actions { align-items: stretch; flex-direction: column; }
  .profile-actions .primary-button { width: 100%; }
  .check-list label { min-height: 44px; }
  .results-heading { align-items: stretch; flex-direction: column; }
  .match-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-tabs button:nth-child(2) { border-right: 0; }
  .mode-tabs button:nth-child(-n+2) { border-bottom: 1px solid var(--rerc-green); }
  .result-stats div { padding: 8px 3px; text-align: center; }
  .result-stats strong { font-size: 1.02rem; }
  .result-stats span { font-size: 0.62rem; }
  .next-deadline { grid-template-columns: 40px minmax(0, 1fr); padding: 11px 10px; }
  .next-deadline > a { grid-column: 2; justify-self: start; }
  .funding-view-switch { align-items: stretch; flex-direction: column; }
  .funding-view-switch > div { width: 100%; }
  .funding-calendar { padding: 12px 10px; }
  .calendar-heading { align-items: stretch; flex-direction: column; }
  .calendar-controls { justify-content: space-between; }
  .calendar-grid { min-width: 610px; grid-template-columns: repeat(7, minmax(78px, 1fr)); }
  .calendar-day { min-height: 90px; }
  .calendar-agenda-item { grid-template-columns: 92px minmax(0, 1fr); gap: 8px; }
  .results-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-toolbar label { grid-template-columns: 1fr; gap: 3px; }
  .results-toolbar select { width: 100%; }
  .case-study-collections ul { grid-template-columns: 1fr; }
  .legacy-exports { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-left: 0; }
  .result-card { grid-template-columns: 1fr; padding: 14px; }
  .score { justify-self: start; }
  .result-group-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .result-group-heading p:not(.eyebrow) { display: none; }
  .plan-rail-heading { position: static; }
  .rail-section { padding-left: 16px; padding-right: 16px; }
  .action-grid { grid-template-columns: 1fr; }
  .action-grid .rercie-button { grid-column: auto; }
  .download-band, .contribute-band, .writer-band { grid-template-columns: 1fr; padding: 34px 18px; }
  .download-actions { display: grid; width: 100%; }
  .download-actions a { width: 100%; }
  .contribute-actions { width: 100%; }
  .site-footer { align-items: flex-start; flex-direction: column; padding: 26px 18px; }
  .saved-tray { right: 8px; bottom: calc(72px + env(safe-area-inset-bottom)); width: calc(100vw - 16px); max-height: calc(100vh - 150px); }
  .mobile-nav { position: fixed; z-index: 1400; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--white); border-top: 1px solid var(--line); box-shadow: 0 -5px 18px rgba(23,63,53,0.12); }
  .mobile-nav a, .mobile-nav button { display: flex; min-width: 0; min-height: 62px; align-items: center; justify-content: center; flex-direction: column; gap: 2px; padding: 5px 2px; color: var(--forest); background: var(--white); border: 0; font-size: 0.7rem; font-weight: 800; text-decoration: none; }
  .mobile-icon { position: relative; display: inline-grid; place-items: center; }
  .mobile-icon b { position: absolute; top: -8px; right: -13px; display: grid; min-width: 19px; height: 19px; place-items: center; padding: 0 4px; color: var(--white); background: var(--rerc-green); border-radius: 8px; font-size: 0.64rem; }
  .app-dialog, .compact-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .dialog-shell { max-height: calc(100vh - 18px); padding: 16px; }
  .contribution-dialog .dialog-shell { padding: 12px; }
  .contribution-frame { min-height: 56dvh; height: calc(100dvh - 215px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .agency-actions, .workflow-steps, .filter-toggle, .filters, .match-actions, .results-toolbar, .plan-rail, .mobile-nav, .download-band, .writer-band { display: none !important; }
  .agency-header { position: static; color: var(--ink); background: var(--white); border-bottom: 2px solid var(--rerc-green); }
  .program-identity { color: var(--ink); }
  .photo-scene { min-height: auto; color: var(--ink); background: var(--white); }
  .photo-scene::before, .scene-catalog, .photo-credit { display: none; }
  .explorer-shell { display: block; }
  .explorer-main { padding: 0; }
  .result-card { break-inside: avoid; box-shadow: none; }
}
/* Planner runtime rules are external so the strict content security policy remains intact. */
.planner-card-action,
#workflowSteps button,
.choice-pager-controls button,
#savedTray button,
#compareDialog button,
#shareDialog button,
#languageDialog button,
#planWorkspace button,
#planWorkspace a,
#plannerMobileNav button,
#plannerMobileNav a { min-width: 44px; min-height: 44px; }
.choice-pager-controls { display: grid; grid-template-columns: minmax(44px, auto) 1fr minmax(44px, auto); align-items: center; gap: 0.5rem; position: sticky; bottom: 0; z-index: 3; padding: 0.5rem 0; background: var(--surface, #fff); }
.choice-pager-status { margin: 0; text-align: center; font-size: 0.875rem; }
#plannerMobileNav { display: none; }
@media (max-width: 760px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  #plannerMobileNav { position: fixed; display: grid; grid-template-columns: repeat(4, 1fr); left: 0; right: 0; bottom: 0; z-index: 1000; min-height: 64px; padding: 4px 4px env(safe-area-inset-bottom); background: #fff; border-top: 1px solid #c8d0ca; box-shadow: 0 -4px 18px rgba(0,0,0,0.12); }
  #plannerMobileNav a, #plannerMobileNav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: transparent; color: #163d2a; text-decoration: none; font: inherit; font-size: 0.75rem; padding: 3px; }
  #plannerMobileNav svg { width: 20px; height: 20px; }
  .check-list label { display: flex; align-items: center; min-height: 44px; }
  .wizard-controls { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 4; justify-content: space-between; padding: 0.65rem 16px; background: var(--white); border-top: 1px solid var(--line); }
  .choice-pager-controls { bottom: calc(64px + env(safe-area-inset-bottom)); }
}
