/* ================================================================
   css/pages/housing-needs-assessment.css — Housing Needs Assessment page specific styles
   Depends on: css/site-theme.css, css/layout.css
   ================================================================ */

/* ----------------------------------------------------------------
   Hero controls
   ---------------------------------------------------------------- */
.hna-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hna-hero h1 { margin: 0; font-size: 1.35rem; }
.hna-hero p { margin: .35rem 0 0; color: var(--muted); max-width: 85ch; }
.hna-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hna-controls select,
.hna-controls input { border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 10px; padding: .55rem .65rem; font: inherit; }
.hna-controls button { border: 1px solid var(--border); background: color-mix(in oklab, var(--card) 70%, var(--accent) 30%); color: var(--text); border-radius: 10px; padding: .55rem .7rem; font: inherit; cursor: pointer; font-weight: 800; }

/* ----------------------------------------------------------------
   Grid layout
   ---------------------------------------------------------------- */
.hna-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-top: 14px; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
@media (max-width: 980px) {
  .span-8,
  .span-6,
  .span-4 { grid-column: span 12; }
}

/* ----------------------------------------------------------------
   Cards
   ---------------------------------------------------------------- */
.chart-card { border: 1px solid var(--border); background: var(--card); border-radius: 16px; padding: 14px; }
.chart-card h2 { margin: 0 0 8px; font-size: 1.05rem; }
.chart-card p { margin: .35rem 0; color: var(--muted); }

/* ----------------------------------------------------------------
   Stats strip
   ---------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat { border: 1px solid var(--border); border-radius: 14px; padding: 10px; background: color-mix(in oklab, var(--card) 82%, var(--bg2) 18%); text-align: center; }
.stat .k { font-size: .86rem; color: var(--muted); font-weight: 700; }
.stat .v { margin-top: 4px; font-size: 1.1rem; font-weight: 900; color: var(--text); }
.stat .s { margin-top: 2px; font-size: .82rem; color: var(--muted); }

/* ----------------------------------------------------------------
   Map and chart containers
   ---------------------------------------------------------------- */
#hnaMap { height: 62vh; min-height: 520px; width: 100%; border-radius: 14px; border: 1px solid var(--border); overflow: hidden; }

@media (max-width: 640px) {
  #hnaMap { height: 50vh; min-height: 260px; border-radius: 8px; }
  .chart-box { height: 260px; min-height: 260px; }
  .chart-box.tall { height: 320px; min-height: 320px; }
}
.chart-box { position: relative; height: 360px; min-height: 360px; }
.chart-box.tall { height: 440px; min-height: 440px; }

/* ----------------------------------------------------------------
   Banner
   ---------------------------------------------------------------- */
.banner { display: none; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--warn-dim); color: var(--text); font-weight: 700; }
.banner.show { display: block; }
.banner[data-kind="warn"] { background: color-mix(in oklab, var(--warn-dim, rgba(180,83,9,.10)) 100%, transparent); border-color: color-mix(in srgb, var(--warn, #b45309) 30%, transparent); color: var(--warn, #b45309); }
.banner[data-kind="info"] { background: color-mix(in oklab, var(--info-dim, rgba(29,78,216,.09)) 100%, transparent); border-color: color-mix(in srgb, var(--info, #1d4ed8) 30%, transparent); color: var(--info, #1d4ed8); }

/* ----------------------------------------------------------------
   Methodology details/summary
   ---------------------------------------------------------------- */
details { border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; background: color-mix(in oklab, var(--card) 84%, var(--bg2) 16%); }
details summary { cursor: pointer; font-weight: 900; color: var(--text); }
.methodology a { color: var(--text); text-decoration: underline; }
.methodology li { margin: .35rem 0; color: var(--muted); }

/* ----------------------------------------------------------------
   Map overlay controls — pill toggle buttons
   ---------------------------------------------------------------- */
.hna-map-overlay-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 6px 0;
}
.hna-overlay-label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 2px;
}
/* Hide native checkbox — keep accessible, keyboard-focusable */
.layer-toggle {
  display: inline-flex;
}
.layer-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.layer-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: .84rem;
  font-weight: 600;
  user-select: none;
  transition: background .15s, border-color .15s, opacity .15s, color .15s;
  color: var(--muted);
}
/* Active (checked) state */
.layer-toggle:has(input:checked) .layer-toggle-pill {
  background: color-mix(in oklab, var(--card) 65%, var(--accent) 35%);
  border-color: var(--accent);
  color: var(--text);
}
/* Dim when inactive */
.layer-toggle:not(:has(input:checked)) .layer-toggle-pill {
  opacity: .55;
}
.layer-toggle:hover .layer-toggle-pill {
  border-color: var(--accent);
  opacity: 1;
}
/* Focus ring for keyboard users */
.layer-toggle input[type="checkbox"]:focus-visible + .layer-toggle-pill {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.6);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  flex-shrink: 0;
}
.legend-swatch {
  display: inline-block;
  width: 13px;
  height: 9px;
  border-radius: 2px;
  border: 1.5px solid;
  flex-shrink: 0;
}
.hna-layer-status {
  color: var(--muted);
  font-size: .82rem;
  font-style: italic;
  margin-left: 4px;
}
/* ----------------------------------------------------------------
   Pill badge
   ---------------------------------------------------------------- */
.pill { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in oklab, var(--card) 80%, var(--accent) 20%); font-weight: 900; font-size: .82rem; }

/* ----------------------------------------------------------------
   Headship segmented control (native radio inputs styled as buttons)
   ---------------------------------------------------------------- */
.headship-buttons {
  display: flex;
  gap: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  overflow: hidden;
}
.headship-label {
  flex: 1;
  display: flex;
  align-items: stretch;
  border-right: 1px solid var(--border);
}
.headship-label:last-child {
  border-right: none;
}
/* Hide native radio visually but keep it accessible */
.headship-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.headship-label span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
  color: var(--text);
}
.headship-label:hover span {
  background: var(--surface, var(--card));
}
.headship-label input[type="radio"]:checked + span {
  background: var(--accent);
  color: #fff;
}
.headship-label input[type="radio"]:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 30%, transparent);
  position: relative;
  z-index: 1;
}

/* ----------------------------------------------------------------
   Labor Market section
   ---------------------------------------------------------------- */
.labor-market-section { margin-top: 14px; }
.labor-market-section h2 { margin: 0 0 10px; font-size: 1.05rem; }

.metric-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.metric-cards-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 980px) {
  .metric-cards,
  .metric-cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .metric-cards,
  .metric-cards-4 { grid-template-columns: 1fr; }
}
.metric-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: color-mix(in oklab, var(--card) 82%, var(--bg2) 18%);
  text-align: center;
}
.metric-card .mc-label { font-size: .84rem; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.metric-card .mc-value { font-size: 1.3rem; font-weight: 900; color: var(--text); }
.metric-card .mc-sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
/* Spans the full grid width — used for no-data fallback messages inside .metric-cards */
.metric-cards-note { grid-column: 1 / -1; font-size: .9rem; color: var(--muted); }

.chart-container { margin-bottom: 14px; }

/* ----------------------------------------------------------------
   Prop 123 / HB 22-1093 compliance section
   ---------------------------------------------------------------- */
.prop123-section { margin-top: 0; }
.prop123-section h2 { margin: 0 0 10px; font-size: 1.05rem; }
.prop123-section h3 { margin: 0 0 6px; font-size: .95rem; font-weight: 700; color: var(--text); }

.prop123-cards-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 980px) {
  .prop123-cards-row { grid-template-columns: 1fr; }
}

.baseline-card,
.fast-track-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: color-mix(in oklab, var(--card) 82%, var(--bg2) 18%);
}
.growth-tracking {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: color-mix(in oklab, var(--card) 82%, var(--bg2) 18%);
}

.compliance-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  margin-top: 6px;
}
.compliance-status.on-track { background: var(--good-dim); color: var(--good); border: 1px solid var(--good); }
.compliance-status.below-target { background: var(--warn-dim); color: var(--warn); border: 1px solid var(--warn); }
.compliance-status.no-data { background: color-mix(in oklab, var(--muted) 18%, var(--card) 82%); color: var(--muted); border: 1px solid var(--border); }
.compliance-status.eligible { background: var(--info-dim); color: var(--info); border: 1px solid var(--info); }
.compliance-status.not-eligible { background: var(--bad-dim); color: var(--bad); border: 1px solid var(--bad); }

.timeline-chart { position: relative; height: 220px; min-height: 220px; margin-top: 10px; }

.scenario-proj-notice {
  margin: 10px 0 0;
  padding: 8px 12px;
  background: var(--warn-dim, #fef3c7);
  color: var(--warn, #92400e);
  border-radius: 6px;
  font-size: .9rem;
}

.compliance-checklist { margin: 0; padding: 0; list-style: none; width: 100%; box-sizing: border-box; overflow-y: auto; max-height: 600px; }
.checklist-item {
  display: grid;
  /* icon | checkbox (both auto-width) | text fills remaining space */
  grid-template-columns: auto auto 1fr;
  align-items: flex-start;
  column-gap: 8px;
  padding: 10px 12px;
  margin: 2px 0;
  border-bottom: none;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: .9rem;
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
  line-height: 1.5;
  min-width: 0;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.checklist-item > .checklist-status-icon {
  grid-column: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  padding-top: 2px;
}
.checklist-item > input[type="checkbox"]  { grid-column: 2; margin-top: 2px; }
.checklist-item > .checklist-item-content { grid-column: 3; }
.checklist-item:hover {
  background: color-mix(in oklab, var(--accent) 6%, var(--card) 94%);
  border-color: color-mix(in oklab, var(--accent) 20%, var(--border) 80%);
}
.checklist-item + .checklist-item { border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; }
.checklist-item:first-child { border-radius: 8px 8px 0 0; }
.checklist-item:last-child  { border-radius: 0 0 8px 8px; border-bottom: none; }
.checklist-item:only-child  { border-radius: 8px; }
.checklist-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0; /* safety if ever wrapped in flex */
}
.checklist-item label { cursor: pointer; display: block; overflow-wrap: break-word; word-break: break-word; }
.checklist-item.done {
  background: color-mix(in oklab, var(--good) 7%, var(--card) 93%);
  border-color: color-mix(in oklab, var(--good) 25%, var(--border) 75%);
}
.checklist-item.done label { color: var(--muted); text-decoration: line-through; }

/* Status icon (✓, ⏳, ⚠️) */
.checklist-status-icon {
  flex-shrink: 0;
  font-size: .85rem;
  margin-top: 3px;
  min-width: 18px;
  text-align: center;
}

/* Item content wrapper (label + completed date) */
.checklist-item-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* Completed-on timestamp */
.checklist-date-completed {
  font-size: .8rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 2px;
}

/* Explanatory note under each checklist item label */
.checklist-item-note {
  font-size: var(--tiny, .78rem);
  color: var(--muted);
  margin: 4px 0 0;
  line-height: 1.5;
}
.checklist-item-note a { color: var(--accent); text-decoration: underline; }
.checklist-item.done .checklist-item-note { display: none; }

/* Warning state: DOLA deadline within 30 days */
.checklist-item.warning {
  background: var(--warn-dim);
  border-radius: 4px;
  padding-left: 6px;
  margin-left: -6px;
}
.checklist-item.warning label { color: var(--warn); font-weight: 600; }

/* Pending state (not yet checked) */
.checklist-item.pending .checklist-status-icon { color: var(--muted); }

/* Done state */
.checklist-item.done .checklist-status-icon { color: var(--accent); }

@media (max-width: 640px) {
  .compliance-checklist { padding: 0; }
  .checklist-item {
    gap: 10px;
    padding: 8px 10px;
    font-size: .88rem;
    line-height: 1.45;
  }
  .checklist-item input[type="checkbox"] { min-width: 20px; min-height: 20px; }
  .chfa-checklist-item { padding: 8px 10px; gap: 10px; }
}

@media (max-width: 480px) {
  .checklist-item { gap: 6px; }
  .chfa-checklist-item { gap: 8px; }
}

@media (max-width: 400px) {
  .checklist-item { font-size: .84rem; }
  .chfa-checklist-item { font-size: .84rem; }
}

.resources-section { margin-top: 0; }
.resources-section ul { margin: 6px 0 0; padding: 0 0 0 1.2rem; }
.resources-section li { margin: .35rem 0; color: var(--muted); font-size: .9rem; }
.resources-section a { color: var(--text); text-decoration: underline; }

.prop123-stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.prop123-stat { font-size: .9rem; color: var(--muted); }
.prop123-stat strong { color: var(--text); }

/* ----------------------------------------------------------------
   Action Plan two-column grid (responsive)
   ---------------------------------------------------------------- */
.action-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}
@media (max-width: 640px) {
  .action-plan-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------------
   Scenario projection view toggle labels (WCAG 2.5.5 touch targets)
   ---------------------------------------------------------------- */
.proj-view-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 500;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  transition: background .15s, border-color .15s, color .15s;
  user-select: none;
}
.proj-view-label:hover {
  background: color-mix(in oklab, var(--accent) 6%, var(--card) 94%);
  border-color: color-mix(in oklab, var(--accent) 30%, var(--border) 70%);
}
.proj-view-label:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}
/* Hide the native radio dot — the label itself is the visual control */
.proj-view-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Scenario assumption range slider (WCAG 2.5.5: min-height 44px) */
.scenario-range {
  flex: 1;
  min-height: 44px;
  accent-color: var(--accent);
}

/* ----------------------------------------------------------------
   DOLA filing deadline badge (rendered by renderDolaFilingStatus)
   ---------------------------------------------------------------- */
.dola-filing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 500;
  border: 1px solid currentColor;
  margin-bottom: 4px;
}
.dola-filing-filed   { background: var(--good-dim); color: var(--good); }
.dola-filing-normal  { background: color-mix(in oklab, var(--accent) 15%, var(--card) 85%); color: var(--accent); }
.dola-filing-urgent  { background: var(--warn-dim); color: var(--warn); border-color: var(--warn); }

/* ----------------------------------------------------------------
   Accordion section (details/summary styled to match existing)
   ---------------------------------------------------------------- */
.accordion-section { margin-top: 10px; }

/* ----------------------------------------------------------------
   Commuting flows table
   ---------------------------------------------------------------- */
.commuting-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .88rem; }
.commuting-table th { text-align: left; color: var(--muted); font-weight: 700; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.commuting-table td { padding: 5px 8px; color: var(--text); border-bottom: 1px solid var(--border); }
.commuting-table tr:last-child td { border-bottom: none; }

/* === HNA waiting/loading state === */
.hna-waiting{padding:20px;text-align:center;background:var(--card);border-radius:8px;margin-bottom:16px;border:1px dashed var(--border)}
.hna-waiting-text{color:var(--muted);font-size:.95rem;margin-bottom:8px}
.hna-waiting-dashes{font-size:1.4rem;color:var(--border);letter-spacing:.2em;animation:hna-pulse 2s ease-in-out infinite}
@keyframes hna-pulse{0%,100%{opacity:.4}50%{opacity:1}}

/* ================================================================
   PMA Methodology section — coverage labels, CHFA checklist
   ================================================================ */

/* ── Coverage bar ────────────────────────────────────────────── */
.pma-coverage-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
  padding: 8px 12px;
  background: color-mix(in oklab, var(--card) 85%, var(--bg2) 15%);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .88rem;
}
.pma-coverage-label { color: var(--muted); font-weight: 700; }
.pma-coverage-pill {
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--card) 60%, var(--bg2) 40%);
  border: 1px solid var(--border);
}
.pma-coverage-warn {
  color: var(--warn);
  background: var(--warn-dim);
  border: 1px solid var(--warn);
  border-radius: 6px;
  padding: 4px 10px;
  font-weight: 600;
  font-size: .85rem;
}

/* ── Coverage warning on market-analysis page ─────────────── */
.pma-coverage-warning {
  margin-top: .4rem;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--warn-dim);
  border: 1px solid var(--warn);
  color: var(--warn);
  font-size: .85rem;
  font-weight: 600;
}

/* ── CHFA Requirements panel ─────────────────────────────── */
.chfa-requirements-panel {
  background: color-mix(in oklab, var(--card) 80%, var(--accent) 5%);
  border: 1px solid color-mix(in oklab, var(--border) 60%, var(--accent) 40%);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.chfa-requirements-panel h3 { margin: 0 0 8px; font-size: 1rem; }
.chfa-req-list { margin: 0 0 8px; padding: 0 0 0 1.4rem; }
.chfa-req-list > li { margin: .45rem 0; color: var(--text); font-size: .92rem; }
.chfa-req-list ul { margin: .25rem 0; padding: 0 0 0 1.2rem; }
.chfa-req-list ul li { margin: .2rem 0; color: var(--muted); font-size: .88rem; }
.chfa-req-disclaimer {
  margin: 8px 0 0;
  padding: 7px 12px;
  border-left: 3px solid var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, var(--card) 92%);
  border-radius: 0 6px 6px 0;
  font-size: .88rem;
  color: var(--muted);
}

/* ── PMA Workflow diagram ─────────────────────────────────── */
.pma-workflow {
  margin-bottom: 14px;
}
.pma-workflow h3 { font-size: 1rem; margin-bottom: 10px; }
.pma-workflow-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 10px;
}
.pma-workflow-step {
  flex: 1 1 120px;
  min-width: 100px;
  background: color-mix(in oklab, var(--card) 82%, var(--bg2) 18%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}
.pma-workflow-step strong { display: block; font-size: .9rem; margin-bottom: 4px; }
.pma-workflow-step p { margin: 0; font-size: .8rem; color: var(--muted); }
.pma-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: .85rem;
  margin: 0 auto 6px;
}
.pma-workflow-arrow {
  align-self: center;
  padding: 0 6px;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 700;
}
.pma-workflow-note {
  margin: 6px 0 0;
  font-size: .84rem;
  color: var(--muted);
  padding: 6px 10px;
  background: color-mix(in oklab, var(--card) 75%, var(--bg2) 25%);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}
@media (max-width: 700px) {
  .pma-workflow-steps { flex-direction: column; }
  .pma-workflow-arrow { transform: rotate(90deg); padding: 4px 0; }
}

/* ── CHFA PMA Checklist ───────────────────────────────────── */
.chfa-checklist-panel {
  background: color-mix(in oklab, var(--card) 82%, var(--bg2) 18%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.chfa-checklist-panel h3 { margin: 0 0 6px; font-size: 1rem; }
.chfa-checklist {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}
.chfa-checklist-item {
  /* Match compliance-checklist grid: checkbox | content */
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  margin: 2px 0;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px;
  font-size: .9rem;
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
  line-height: 1.5;
  min-width: 0;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.chfa-checklist-item:hover {
  background: color-mix(in oklab, var(--accent) 6%, var(--card) 94%);
  border-color: color-mix(in oklab, var(--accent) 20%, var(--border) 80%);
}
.chfa-checklist-item + .chfa-checklist-item { border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; }
.chfa-checklist-item:first-child { border-radius: 8px 8px 0 0; }
.chfa-checklist-item:last-child  { border-radius: 0 0 8px 8px; }
.chfa-checklist-item:only-child  { border-radius: 8px; }
.chfa-checklist-item--done {
  background: color-mix(in oklab, var(--good) 7%, var(--card) 93%);
  border-color: color-mix(in oklab, var(--good) 25%, var(--border) 75%) !important;
}
.chfa-checklist-item > input[type="checkbox"] {
  grid-column: 1;
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.chfa-checklist-content {
  grid-column: 2;
  min-width: 0;
}
.chfa-checklist-content label {
  display: block;
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  color: var(--text);
  overflow-wrap: break-word;
  word-break: break-word;
}
.chfa-checklist-note { display: block; font-size: .8rem; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.chfa-checklist-item--done .chfa-checklist-content label { text-decoration: line-through; color: var(--muted); }
.chfa-checklist-item--done .chfa-checklist-note { display: none; }
.chfa-capture-rate-badge {
  font-size: .75rem;
  font-weight: 900;
  padding: 1px 8px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent) 15%, var(--card) 85%);
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* ── Checklist progress bar ──────────────────────────────── */
.chfa-checklist-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.chfa-progress-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.chfa-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width .3s ease;
}
.chfa-progress-label { font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* ── Resources ───────────────────────────────────────────── */
.chfa-resources { margin-top: 0; }
.chfa-resources h3 { font-size: 1rem; margin: 0 0 6px; }
.chfa-resources ul { margin: 4px 0 0; padding: 0 0 0 1.2rem; }
.chfa-resources li { margin: .35rem 0; font-size: .9rem; color: var(--muted); }
.chfa-resources a { color: var(--text); text-decoration: underline; }

/* ── PMA methodology section heading ────────────────────── */
.pma-methodology-section h2 { margin-bottom: 6px; }

/* ── Scenario comparison enhancements ───────────────────── */
.scenario-freshness-badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent) 12%, var(--card) 88%);
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent 70%);
  margin-left: 6px;
  vertical-align: middle;
}
.scenario-need-summary {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: color-mix(in oklab, var(--accent) 8%, var(--card) 92%);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  font-size: .88rem;
  color: var(--text);
}
.scenario-need-summary .scenario-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
@media (max-width: 600px) {
  .scenario-need-summary .scenario-summary-grid { grid-template-columns: 1fr; }
}
.scenario-summary-col {
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,.04);
}
.scenario-summary-col .sc-label {
  font-size: .78rem;
  color: var(--muted);
  margin: 0 0 2px;
}
.scenario-summary-col .sc-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.scenario-data-quality {
  margin: 6px 0 0;
  font-size: .8rem;
  color: var(--muted);
  font-style: italic;
}
.scenario-data-quality.dq-warn {
  color: var(--warn);
}

/* ── Scenario export button ──────────────────────────────── */
.scenario-export-btn {
  padding: 6px 12px;
  font-size: .82rem;
  cursor: pointer;
  min-height: 44px;
  white-space: nowrap;
}
