/*--------------------------------------------------------------
  HeartChart Dashboard Components
  
  New dashboard card components from Figma redesign.
  Uses AMFM design tokens from base.css.
  
  Figma: https://www.figma.com/design/tg3U3gNcIYMn9aY9JYrIZc/AMFM-Portal?node-id=14-4832
  
  @since 2026-01-29
--------------------------------------------------------------*/

/* =============================================================================
   CARD WRAPPER (shared pattern for all dashboard cards)
   ============================================================================= */

.hc-card {
  background: var(--amfm-bg-primary, #ffffff);
  border-radius: var(--amfm-radius-xl, 16px);
  box-shadow: var(--amfm-shadow-card, 
    0px 12px 16px -4px rgba(10, 13, 18, 0.08),
    0px 4px 6px -2px rgba(10, 13, 18, 0.03),
    0px 2px 2px -1px rgba(10, 13, 18, 0.04));
  padding: var(--amfm-spacing-md, 8px);
}

.hc-card__inner {
  border: 1px solid var(--amfm-border-primary, rgba(0, 0, 0, 0.08));
  border-radius: var(--amfm-radius-md, 8px);
  overflow: hidden;
}

/* Error state */
.hc-card.hc-error {
  padding: var(--amfm-spacing-4xl, 32px);
  text-align: center;
  color: var(--amfm-text-tertiary, #535862);
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-sm, 14px);
}

/* =============================================================================
   SECTION TITLES (Key Insights, etc.)
   Mirrors .amfm-page-title responsive behavior but remains visible on mobile
   Handles both direct application and Elementor widget nesting
   ============================================================================= */

.amfm-section-title,
h2.amfm-section-title,
.amfm-section-title .elementor-heading-title,
.amfm-section-title h2,
.elementor-widget-heading.amfm-section-title .elementor-heading-title {
  font-family: 'Financier Display', Georgia, serif !important;
  font-size: 36px !important;
  font-weight: 300 !important;
  line-height: 44px !important;
  letter-spacing: -0.72px !important;
  color: var(--amfm-text-primary, #181d27) !important;
  margin: 0 0 var(--amfm-spacing-3xl, 24px) 0;
  padding: 0;
}

/* Tablet breakpoint - matches .amfm-page-title */
@media screen and (max-width: 1024px) {
  .amfm-section-title,
  h2.amfm-section-title,
  .amfm-section-title .elementor-heading-title,
  .amfm-section-title h2,
  .elementor-widget-heading.amfm-section-title .elementor-heading-title {
    font-size: 28px !important;
    line-height: 36px !important;
    letter-spacing: -0.56px !important;
  }
}

/* Mobile breakpoint - smaller but still visible (unlike page titles) */
@media screen and (max-width: 768px) {
  .amfm-section-title,
  h2.amfm-section-title,
  .amfm-section-title .elementor-heading-title,
  .amfm-section-title h2,
  .elementor-widget-heading.amfm-section-title .elementor-heading-title {
    font-size: 24px !important;
    line-height: 32px !important;
    letter-spacing: -0.48px !important;
    margin-bottom: var(--amfm-spacing-xl, 16px);
  }
}

/* =============================================================================
   DASHBOARD HEADER CARD - Header Section
   ============================================================================= */

.hc-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--amfm-spacing-xl, 16px);
  padding: var(--amfm-spacing-3xl, 24px) var(--amfm-spacing-4xl, 32px);
}

.hc-dashboard-header__title {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-lg, 18px);
  font-weight: 600;
  line-height: var(--amfm-leading-lg, 28px);
  color: var(--amfm-text-primary, #181d27);
  margin: 0;
}

.hc-dashboard-header__actions {
  display: flex;
  align-items: center;
  gap: var(--amfm-spacing-lg, 12px);
}

/* Divider */
.hc-divider {
  height: 1px;
  background-color: var(--amfm-border-secondary, #e9eaeb);
  margin: 0;
}

/* =============================================================================
   GHOST BUTTON (text-only with icon)
   ============================================================================= */

.hc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--amfm-spacing-xs, 4px);
  padding: 10px 14px;
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-sm, 14px);
  font-weight: 600;
  line-height: var(--amfm-leading-sm, 20px);
  text-decoration: none;
  border-radius: var(--amfm-radius-md, 8px);
  cursor: pointer;
  transition: all var(--amfm-transition-fast, 0.15s ease);
  border: none;
  background: transparent;
}

.hc-btn--ghost {
  color: var(--amfm-text-tertiary, #535862);
}

.hc-btn--ghost:hover {
  background: var(--amfm-neutral-50, #f9fafb);
  color: var(--amfm-text-secondary, #414651);
}

.hc-btn--ghost .hc-icon {
  color: var(--amfm-neutral-400, #a4a7ae);
}

.hc-btn--ghost:hover .hc-icon {
  color: var(--amfm-text-tertiary, #535862);
}

/* =============================================================================
   DASHBOARD CONTENT & GRID
   ============================================================================= */

.hc-dashboard-content {
  padding: var(--amfm-spacing-4xl, 32px);
}

.hc-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.5fr;
  gap: var(--amfm-spacing-xl, 16px);
}

/* =============================================================================
   STAT CARDS - Base Styles
   ============================================================================= */

.hc-stat-card {
  background: var(--amfm-bg-primary, #ffffff);
  border: 1px solid var(--amfm-border-primary, rgba(0, 0, 0, 0.08));
  border-radius: var(--amfm-radius-md, 8px);
  padding: var(--amfm-spacing-3xl, 24px);
  display: flex;
  flex-direction: column;
  gap: var(--amfm-spacing-xl, 16px);
  overflow: hidden;
}

/* Icon styling */
.hc-stat-card__icon {
  color: var(--amfm-text-primary, #181d27);
  flex-shrink: 0;
}

.hc-stat-card__icon--large {
  width: 80px;
  height: 80px;
}

/* Header with label and number */
.hc-stat-card__header {
  display: flex;
  flex-direction: column;
  gap: var(--amfm-spacing-xxs, 2px);
}

.hc-stat-card__label {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-xs, 12px);
  font-weight: 600;
  line-height: var(--amfm-leading-xs, 18px);
  color: var(--amfm-neutral-500, #717680);
  text-transform: none;
}

.hc-stat-card__number {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 38px;
  letter-spacing: -0.6px;
  color: var(--amfm-text-primary, #181d27);
}

.hc-stat-card__total {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-2xl, 24px);
  font-weight: 500;
  line-height: 38px;
  color: var(--amfm-neutral-500, #717680);
}

/* =============================================================================
   STAT CARD - Respondents (spans 3 columns)
   ============================================================================= */

.hc-stat-card--respondents {
  grid-column: 1 / 4;
  flex-direction: row;
  align-items: center;
  gap: var(--amfm-spacing-xl, 16px);
  padding: var(--amfm-spacing-2xl, 20px) var(--amfm-spacing-xl, 16px);
}

.hc-stat-card--respondents .hc-stat-card__content {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hc-stat-card--respondents .hc-stat-card__label {
  font-size: var(--amfm-text-sm, 14px);
  font-weight: 500;
  line-height: var(--amfm-leading-sm, 20px);
}

.hc-stat-card--respondents .hc-stat-card__value {
  display: flex;
  align-items: baseline;
  gap: var(--amfm-spacing-md, 8px);
}

.hc-stat-card--respondents .hc-stat-card__number {
  font-size: 36px;
  line-height: 44px;
  letter-spacing: -0.72px;
}

/* =============================================================================
   STAT CARD - Pie Chart (spans 2 rows)
   ============================================================================= */

.hc-stat-card--pie {
  grid-column: 4;
  grid-row: 1 / 3;
  align-items: center;
  justify-content: flex-start;
  gap: var(--amfm-spacing-3xl, 24px);
  padding: var(--amfm-spacing-4xl, 32px);
}

.hc-pie-wrapper {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

.hc-pie-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.hc-pie-title {
  font-family: var(--amfm-font-display, 'Financier Display', Georgia, serif);
  font-size: 30px;
  font-weight: 300;
  line-height: 38px;
  color: var(--amfm-text-primary, #181d27);
  text-align: center;
  margin: 0;
}

/* =============================================================================
   LEGEND
   ============================================================================= */

.hc-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--amfm-spacing-lg, 12px);
  width: 100%;
  max-width: 280px;
}

.hc-legend__item {
  display: flex;
  align-items: center;
  gap: var(--amfm-spacing-xl, 16px);
}

.hc-legend__color {
  width: 32px;
  height: 20px;
  border-radius: var(--amfm-spacing-3xl, 24px);
  flex-shrink: 0;
}

.hc-legend__percent {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-sm, 14px);
  font-weight: 700;
  line-height: var(--amfm-leading-sm, 20px);
  color: var(--amfm-text-primary, #181d27);
  min-width: 32px;
}

.hc-legend__label {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-sm, 14px);
  font-weight: 400;
  line-height: var(--amfm-leading-sm, 20px);
  color: var(--amfm-text-primary, #181d27);
}

/* =============================================================================
   STAT LIST (breakdown rows)
   ============================================================================= */

.hc-stat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.hc-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--amfm-spacing-md, 8px) 0;
  border-bottom: 1px solid var(--amfm-border-secondary, #e9eaeb);
}

.hc-stat-row:last-child {
  border-bottom: none;
}

.hc-stat-row__label {
  font-family: 'Open Sans', var(--amfm-font-body, sans-serif);
  font-size: 13px;
  font-weight: 400;
  line-height: 24px;
  color: var(--amfm-text-secondary, #414651);
}

.hc-stat-row__value {
  font-family: 'Open Sans', var(--amfm-font-body, sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 24px;
  color: var(--amfm-text-secondary, #414651);
}

/* =============================================================================
   ICON STYLES
   ============================================================================= */

.hc-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.hc-icon svg {
  display: block;
}

/* =============================================================================
   RESPONSIVE - Tablet (1024px and below)
   ============================================================================= */

@media screen and (max-width: 1024px) {
  .hc-dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  /* Respondents spans full width */
  .hc-stat-card--respondents {
    grid-column: 1 / -1;
  }
  
  /* Pie chart moves to full width below stats - stack vertically for sidebar constraint */
  .hc-stat-card--pie {
    grid-column: 1 / -1;
    grid-row: auto;
    flex-direction: column;
    align-items: center;
    gap: var(--amfm-spacing-3xl, 24px);
  }
  
  .hc-legend {
    max-width: none;
  }
  
  .hc-pie-wrapper {
    width: 180px;
    height: 180px;
  }
  
  /* Header stacks on tablet */
  .hc-dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--amfm-spacing-lg, 12px);
  }
  
  .hc-dashboard-header__actions {
    width: 100%;
    flex-wrap: wrap;
  }
}

/* =============================================================================
   RESPONSIVE - Mobile (768px and below)
   ============================================================================= */

@media screen and (max-width: 768px) {
  .hc-card {
    padding: var(--amfm-spacing-xs, 4px);
  }
  
  .hc-dashboard-header {
    padding: var(--amfm-spacing-xl, 16px);
  }
  
  .hc-dashboard-header__title {
    font-size: var(--amfm-text-base, 16px);
    line-height: var(--amfm-leading-base, 24px);
  }
  
  .hc-dashboard-content {
    padding: var(--amfm-spacing-xl, 16px);
  }
  
  .hc-dashboard-grid {
    grid-template-columns: 1fr;
    gap: var(--amfm-spacing-lg, 12px);
  }
  
  /* Respondents vertical on mobile */
  .hc-stat-card--respondents {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  
  .hc-stat-card--respondents .hc-stat-card__icon--large {
    width: 48px;
    height: 48px;
  }
  
  .hc-stat-card--respondents .hc-stat-card__number {
    font-size: 28px;
    line-height: 36px;
  }
  
  /* Pie chart stacks vertically on mobile */
  .hc-stat-card--pie {
    flex-direction: column;
    padding: var(--amfm-spacing-3xl, 24px);
  }
  
  .hc-pie-wrapper {
    width: 160px;
    height: 160px;
  }
  
  .hc-pie-title {
    font-size: var(--amfm-text-2xl, 24px);
    line-height: var(--amfm-leading-xl, 32px);
  }
  
  /* Stat cards */
  .hc-stat-card {
    padding: var(--amfm-spacing-xl, 16px);
    gap: var(--amfm-spacing-lg, 12px);
  }
  
  .hc-stat-card__number {
    font-size: var(--amfm-text-2xl, 24px);
    line-height: var(--amfm-leading-xl, 32px);
  }
  
  /* Buttons wrap */
  .hc-btn {
    padding: 8px 10px;
    font-size: 13px;
  }
  
  .hc-btn .hc-icon {
    width: 18px;
    height: 18px;
  }
}

/* =============================================================================
   RESPONSIVE - Small Mobile (480px and below)
   ============================================================================= */

@media screen and (max-width: 480px) {
  .hc-dashboard-header__actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .hc-btn {
    justify-content: flex-start;
  }
  
  .hc-legend__item {
    gap: var(--amfm-spacing-md, 8px);
  }
  
  .hc-legend__color {
    width: 24px;
    height: 16px;
  }
  
  .hc-legend__percent {
    font-size: 13px;
    min-width: 28px;
  }
  
  .hc-legend__label {
    font-size: 13px;
  }
}

/* =============================================================================
   SPIRITUAL SNAPSHOT CARD
   Two side-by-side donut charts for Following Jesus & Connected to God
   ============================================================================= */

.hc-spiritual-snapshot-card .hc-card__inner {
  padding: var(--amfm-spacing-4xl, 32px);
}

/* Card subtitle - matches Figma Text lg/Semibold */
.hc-card-header__subtitle {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-lg, 18px);
  font-weight: 600;
  line-height: var(--amfm-leading-lg, 28px);
  color: var(--amfm-text-primary, #181d27);
  margin: 0 0 var(--amfm-spacing-3xl, 24px) 0;
}

/* Dual Chart Grid - two charts side by side */
.hc-dual-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--amfm-spacing-xl, 16px);
}

/* Individual chart column - matches Figma */
.hc-chart-column {
  background: var(--amfm-bg-primary, #ffffff);
  border: 1px solid var(--amfm-border-secondary-alt, rgba(0, 0, 0, 0.08));
  border-radius: var(--amfm-radius-md, 8px);
  padding: var(--amfm-spacing-4xl, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--amfm-spacing-3xl, 24px);
}

/* Chart wrapper - 240px per Figma */
.hc-chart-wrapper {
  width: 240px;
  height: 240px;
  flex-shrink: 0;
}

.hc-chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Chart headline - matches Figma Display md/Light */
.hc-chart-headline {
  font-family: var(--amfm-font-display, 'Financier Display', Georgia, serif);
  font-size: 36px;
  font-weight: 300;
  line-height: 44px;
  letter-spacing: -0.72px;
  color: var(--amfm-text-primary, #181d27);
  text-align: center;
  margin: 0;
}

/* Chart legend (vertical list below headline) - matches Figma specs */
.hc-chart-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--amfm-spacing-md, 8px);
  width: 100%;
}

.hc-chart-legend__item {
  display: flex;
  align-items: flex-start;
  gap: var(--amfm-spacing-xl, 16px);
}

/* Text container within legend item */
.hc-chart-legend__text {
  display: flex;
  flex: 1;
  gap: var(--amfm-spacing-xs, 4px);
  align-items: flex-start;
}

/* Legend color pill - 40x24px per Figma */
.hc-chart-legend__color {
  width: 40px;
  height: 24px;
  border-radius: var(--amfm-spacing-3xl, 24px);
  flex-shrink: 0;
}

/* Legend text - Text md/Bold for percent */
.hc-chart-legend__percent {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-md, 16px);
  font-weight: 700;
  line-height: var(--amfm-leading-md, 24px);
  color: var(--amfm-text-primary, #181d27);
  flex-shrink: 0;
}

/* Legend text - Text md/Regular for label */
.hc-chart-legend__label {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-md, 16px);
  font-weight: 400;
  line-height: var(--amfm-leading-md, 24px);
  color: var(--amfm-text-primary, #181d27);
}

/* =============================================================================
   SPIRITUAL SNAPSHOT - RESPONSIVE
   ============================================================================= */

@media screen and (max-width: 1024px) {
  /* Stack charts vertically when sidebar constrains content area */
  .hc-dual-chart-grid {
    grid-template-columns: 1fr;
    gap: var(--amfm-spacing-xl, 16px);
  }
  
  .hc-chart-column {
    padding: var(--amfm-spacing-3xl, 24px);
  }
  
  .hc-chart-wrapper {
    width: 200px;
    height: 200px;
  }
  
  .hc-chart-headline {
    font-size: 28px;
    line-height: 36px;
    letter-spacing: -0.56px;
  }
  
  .hc-chart-legend__percent,
  .hc-chart-legend__label {
    font-size: var(--amfm-text-sm, 14px);
    line-height: var(--amfm-leading-sm, 20px);
  }
  
  .hc-chart-legend__color {
    width: 32px;
    height: 20px;
  }
}

@media screen and (max-width: 768px) {
  .hc-spiritual-snapshot-card .hc-card__inner {
    padding: var(--amfm-spacing-xl, 16px);
  }
  
  /* Further reduce sizes for mobile (already stacked at 1024px) */
  .hc-dual-chart-grid {
    gap: var(--amfm-spacing-lg, 12px);
  }
  
  .hc-chart-wrapper {
    width: 180px;
    height: 180px;
  }
  
  .hc-chart-headline {
    font-size: 24px;
    line-height: 32px;
    letter-spacing: -0.48px;
  }
}

@media screen and (max-width: 480px) {
  .hc-chart-column {
    padding: var(--amfm-spacing-xl, 16px);
  }
  
  .hc-chart-wrapper {
    width: 160px;
    height: 160px;
  }
  
  .hc-chart-legend__item {
    gap: var(--amfm-spacing-md, 8px);
  }
  
  .hc-chart-legend__color {
    width: 24px;
    height: 16px;
  }
  
  .hc-chart-legend__percent,
  .hc-chart-legend__label {
    font-size: 13px;
  }
}

/* =============================================================================
   RELATIONSHIP HEALTH VISUALIZATION CARD
   ============================================================================= */

.hc-relationship-health-card .hc-card__inner {
  padding: var(--amfm-spacing-4xl, 32px);
}

/* Card Header */
.hc-card-header {
  margin-bottom: var(--amfm-spacing-3xl, 24px);
}

.hc-card-header__title {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-lg, 18px);
  font-weight: 600;
  line-height: var(--amfm-leading-lg, 28px);
  color: var(--amfm-text-primary, #181d27);
  margin: 0;
}

/* Content Layout: Controls + Chart side by side (controls left, chart right) */
.hc-relationship-health-content {
  display: grid;
  grid-template-columns: 1fr 2.5fr;
  gap: var(--amfm-spacing-3xl, 24px);
  align-items: start;
}

/* Chart Container */
.hc-relationship-health-chart {
  border-radius: var(--amfm-radius-md, 8px);
  position: relative;
  overflow: hidden;
}

.hc-relationship-health-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

/* No data message */
.hc-no-data {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-sm, 14px);
  color: var(--amfm-text-tertiary, #535862);
  text-align: center;
  padding: var(--amfm-spacing-4xl, 32px);
}

/* =============================================================================
   FILTER CONTROLS
   ============================================================================= */

.hc-relationship-health-controls {
  display: flex;
  flex-direction: column;
  gap: var(--amfm-spacing-xl, 16px);
  padding-top: var(--amfm-spacing-4xl, 32px);
}

.hc-filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--amfm-spacing-sm, 6px);
}

.hc-filter-group__label {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-sm, 14px);
  font-weight: 600;
  line-height: var(--amfm-leading-sm, 20px);
  color: var(--amfm-neutral-600, #717680);
  margin: 0 0 var(--amfm-spacing-xs, 4px) 0;
}

.hc-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--amfm-spacing-xs, 4px);
}

/* Filter Button Base */
.hc-filter-btn {
  background-color: var(--amfm-bg-secondary, #f6f0e4);
  border: 1px solid var(--amfm-neutral-400, #b99988);
  color: var(--amfm-neutral-400, #b99988);
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  padding: 5px 10px;
  border-radius: var(--amfm-radius-sm, 4px);
  cursor: pointer;
  transition: all var(--amfm-transition-fast, 0.15s ease);
  white-space: nowrap;
}

.hc-filter-btn:hover {
  background-color: var(--amfm-neutral-400, #b99988);
  color: var(--amfm-bg-secondary, #f6f0e4);
}

.hc-filter-btn:focus {
  outline: 2px solid var(--amfm-brand-primary, #aa6140);
  outline-offset: 2px;
}

/* Active state */
.hc-filter-btn.active {
  background-color: var(--amfm-neutral-400, #b99988);
  color: var(--amfm-bg-secondary, #f6f0e4);
}

/* D3 category labels - styling to match the viz */
.category_label {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 10pt;
}

/* =============================================================================
   RELATIONSHIP HEALTH - RESPONSIVE
   ============================================================================= */

@media screen and (max-width: 1200px) {
  .hc-relationship-health-content {
    grid-template-columns: 1fr;
  }
  
  .hc-relationship-health-controls {
    padding-top: var(--amfm-spacing-xl, 16px);
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--amfm-spacing-lg, 12px);
  }
  
  .hc-filter-group {
    flex: 1 1 200px;
    min-width: 180px;
  }
}

/* Tablet/mobile (800px and below) - slight padding around chart */
@media screen and (max-width: 800px) {
  .hc-relationship-health-chart {
    padding: var(--amfm-spacing-md, 8px);
  }
}

@media screen and (max-width: 768px) {
  .hc-relationship-health-card .hc-card__inner {
    padding: var(--amfm-spacing-xl, 16px);
  }
  
  .hc-filter-group {
    flex: 1 1 100%;
  }
  
  .hc-filter-buttons {
    gap: var(--amfm-spacing-xxs, 2px);
  }
  
  .hc-filter-btn {
    font-size: 10px;
    padding: 4px 8px;
  }
}

/* Small mobile - SVG scales to fit, no horizontal scroll needed */
@media screen and (max-width: 500px) {
  .hc-relationship-health-chart {
    padding: var(--amfm-spacing-sm, 6px);
  }
}

/* =============================================================================
   CAUTION FLAGS CARD
   Top 3 caution flags with progress bars and national averages
   ============================================================================= */

/* Card inner padding - matches spiritual snapshot and other cards */
.hc-caution-flags-card .hc-card__inner {
  padding: var(--amfm-spacing-4xl, 32px);
}

/* Card Header with Tabs */
.hc-card-header--with-tabs .hc-card-header__row {
  display: flex;
  align-items: center;
  gap: var(--amfm-spacing-xl, 16px);
  padding-bottom: var(--amfm-spacing-3xl, 24px);
}

/* Remove bottom margin from subtitle when in header row */
.hc-card-header--with-tabs .hc-card-header__row .hc-card-header__subtitle {
  margin: 0;
}

.hc-card-header__divider {
  height: 1px;
  background-color: var(--amfm-border-secondary, #e9eaeb);
  margin-bottom: 0;
}

.hc-card-header__headline {
  font-family: var(--amfm-font-display, 'Financier Display', Georgia, serif);
  font-size: 24px;
  font-weight: 300;
  line-height: 32px;
  color: var(--amfm-text-primary, #181d27);
  margin: 0;
  padding-top: var(--amfm-spacing-3xl, 24px);
  padding-bottom: var(--amfm-spacing-5xl, 40px);
  max-width: 800px;
}

.hc-highlight {
  color: #4f8392;
}

/* Tabs */
.hc-tabs {
  display: flex;
  gap: var(--amfm-spacing-xs, 4px);
  padding: var(--amfm-spacing-xs, 4px);
  border: 1px solid var(--amfm-border-secondary, #e9eaeb);
  border-radius: var(--amfm-radius-lg, 10px);
}

.hc-tab {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: var(--amfm-text-quaternary, #717680);
  background: transparent;
  border: none;
  padding: var(--amfm-spacing-md, 8px) var(--amfm-spacing-lg, 12px);
  border-radius: var(--amfm-radius-sm, 6px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hc-tab--active {
  color: var(--amfm-text-primary, #181d27);
  background-color: var(--amfm-bg-secondary-alt, #f5f5f5);
  box-shadow: 0px 1px 3px 0px rgba(10, 13, 18, 0.1),
              0px 1px 2px -1px rgba(10, 13, 18, 0.1);
}

.hc-tab:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Caution Grid - 3 columns */
.hc-caution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--amfm-spacing-xl, 16px);
}

/* Individual Caution Stat Card */
.hc-caution-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--amfm-spacing-3xl, 24px);
  padding: var(--amfm-spacing-3xl, 24px) var(--amfm-spacing-4xl, 32px) var(--amfm-spacing-4xl, 32px);
  background: var(--amfm-bg-primary, white);
  border: 1px solid var(--amfm-border-secondary-alt, rgba(0, 0, 0, 0.08));
  border-radius: var(--amfm-radius-md, 8px);
  text-align: center;
}

/* Stat Header (Percentage + Label) */
.hc-caution-stat__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hc-caution-stat__percent {
  font-family: var(--amfm-font-display, 'Financier Display', Georgia, serif);
  font-size: 48px;
  font-weight: 300;
  line-height: 60px;
  letter-spacing: -0.96px;
  color: var(--amfm-text-primary, #181d27);
}

.hc-caution-stat__label {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: var(--amfm-text-primary, #181d27);
}

/* Progress Bar Container */
.hc-progress-container {
  width: 100%;
  max-width: 288px;
  position: relative;
}

/* National Average Marker */
.hc-progress-avg {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Left-align label to start at marker */
}

.hc-progress-avg__label {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  color: var(--amfm-text-quaternary, #717680);
  white-space: nowrap;
  margin-bottom: var(--amfm-spacing-sm, 6px);
}

.hc-progress-avg__marker {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--amfm-text-primary, #181d27);
}

/* Progress Bar */
.hc-progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--amfm-bg-tertiary, #e9eaeb);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 24px; /* Space for national average label + marker */
}

.hc-progress-bar__fill {
  height: 100%;
  background-color: #4f8392;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Progress Scale */
.hc-progress-scale {
  display: flex;
  justify-content: space-between;
  margin-top: var(--amfm-spacing-sm, 6px);
}

.hc-progress-scale span {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  color: var(--amfm-text-quaternary, #717680);
}

/* Take Action */
.hc-caution-stat__action {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 256px;
  text-align: center;
}

.hc-caution-stat__action-title {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--amfm-text-primary, #181d27);
}

.hc-caution-stat__action-text {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: var(--amfm-text-secondary, #414651);
}

/* Button */
.hc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--amfm-spacing-xs, 4px);
  padding: var(--amfm-spacing-md, 8px) var(--amfm-spacing-lg, 12px);
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-decoration: none;
  border-radius: var(--amfm-radius-md, 8px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hc-button--secondary {
  color: var(--amfm-text-secondary, #414651);
  background: var(--amfm-bg-primary, white);
  border: 1px solid var(--amfm-border-primary, #d5d7da);
  box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05),
              inset 0px 0px 0px 1px rgba(10, 13, 18, 0.18),
              inset 0px -2px 0px 0px rgba(10, 13, 18, 0.05);
}

.hc-button--secondary:hover {
  background: var(--amfm-bg-secondary, #f9fafb);
}

/* =============================================================================
   CAUTION FLAGS - SINGLES (Simplified cards)
   Progress bar but no national averages, no buttons
   ============================================================================= */

/* Singles cards have simpler layout */
.hc-caution-stat--simple {
  gap: var(--amfm-spacing-xl, 16px);
}

/* Progress container without national average marker - no top margin needed */
.hc-progress-container--simple .hc-progress-bar {
  margin-top: 0;
}

/* Singles action text is standalone (no "Take Action:" prefix) */
.hc-caution-stat--simple .hc-caution-stat__action {
  padding-top: var(--amfm-spacing-md, 8px);
  border-top: 1px dashed var(--amfm-border-secondary, #e9eaeb);
}

/* Tab content visibility controlled by JS */
.hc-tab-content[style*="display: none"] {
  display: none !important;
}

/* =============================================================================
   TOP 3 EXPRESSED NEEDS CARD
   Similar to Caution Flags but with centered text and resources list
   ============================================================================= */

/* Card inner padding - matches caution flags and other cards */
.hc-top3-needs-card .hc-card__inner {
  padding: var(--amfm-spacing-4xl, 32px);
}

/* Needs grid - same 3 column layout */
.hc-needs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--amfm-spacing-xl, 16px);
  width: 100%;
}

/* Individual need stat card */
.hc-needs-stat {
  display: flex;
  flex-direction: column;
  gap: var(--amfm-spacing-3xl, 24px);
  padding: var(--amfm-spacing-3xl, 24px) var(--amfm-spacing-4xl, 32px) var(--amfm-spacing-4xl, 32px);
  background: var(--amfm-bg-primary, #ffffff);
  border: 1px solid var(--amfm-border-secondary-alt, rgba(0, 0, 0, 0.08));
  border-radius: var(--amfm-radius-sm, 8px);
  align-items: center;
  text-align: center;
}

/* Simplified variant (no national average) */
.hc-needs-stat--simple {
  gap: var(--amfm-spacing-xl, 16px);
}

/* Header: percentage + label */
.hc-needs-stat__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* Large percentage number */
.hc-needs-stat__percent {
  font-family: var(--amfm-font-display, 'Financier Display', Georgia, serif);
  font-weight: 300;
  font-size: 48px;
  line-height: 60px;
  letter-spacing: -0.96px;
  color: var(--amfm-text-primary, #181d27);
}

/* Label below percentage */
.hc-needs-stat__label {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-weight: 600;
  font-size: 14px;
  line-height: 20px;
  color: var(--amfm-text-primary, #181d27);
}

/* Resources section */
.hc-needs-stat__resources {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 256px;
}

/* Resources title */
.hc-needs-stat__resources-title {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--amfm-text-primary, #181d27);
  margin-bottom: var(--amfm-spacing-xs, 4px);
}

/* Resources list */
.hc-needs-stat__resources-list {
  list-style: disc;
  margin: 0;
  padding: 0 0 0 21px;
  text-align: left;
  width: 100%;
}

.hc-needs-stat__resources-list li {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: var(--amfm-text-secondary, #414651);
  margin-bottom: 0;
}

.hc-needs-stat__resources-list li a {
  color: var(--amfm-text-secondary, #414651);
  text-decoration: none;
}

.hc-needs-stat__resources-list li a:hover {
  text-decoration: underline;
}

/* Content wrapper for recommendation + resources */
.hc-needs-stat__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--amfm-spacing-xl, 16px);
  width: 100%;
}

/* Recommendation text */
.hc-needs-stat__recommendation {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: var(--amfm-text-secondary, #414651);
  text-align: center;
  max-width: 280px;
}

/* =============================================================================
   TOP 3 EXPRESSED NEEDS - RESPONSIVE
   ============================================================================= */

/* Constrained screens - sidebar visible, columns tight (800px-1200px) */
@media screen and (max-width: 1200px) and (min-width: 769px) {
  .hc-needs-stat__percent {
    font-size: 36px;
    line-height: 44px;
  }
  
  .hc-needs-stat__label {
    font-size: 12px;
  }
  
  .hc-needs-stat {
    padding: var(--amfm-spacing-xl, 16px);
  }
  
  .hc-needs-stat__resources-list li {
    font-size: 12px;
    line-height: 18px;
  }
}

@media screen and (max-width: 1024px) {
  .hc-needs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hc-needs-grid .hc-needs-stat:last-child {
    max-width: calc(50% - 8px);
  }
}

@media screen and (max-width: 768px) {
  .hc-top3-needs-card .hc-card__inner {
    padding: var(--amfm-spacing-xl, 16px);
  }
  
  .hc-needs-grid {
    grid-template-columns: 1fr;
  }
  
  .hc-needs-grid .hc-needs-stat:last-child {
    max-width: 100%;
  }
  
  .hc-needs-stat__percent {
    font-size: 36px;
    line-height: 44px;
  }
}

@media screen and (max-width: 500px) {
  .hc-needs-stat {
    padding: var(--amfm-spacing-xl, 16px);
  }
}

/* =============================================================================
   CAUTION FLAGS - RESPONSIVE
   ============================================================================= */

/* Constrained screens - sidebar visible, columns tight (800px-1200px) */
@media screen and (max-width: 1200px) and (min-width: 769px) {
  .hc-progress-avg__label {
    font-size: 10px;
    line-height: 14px;
  }
  
  .hc-caution-stat__percent {
    font-size: 36px;
    line-height: 44px;
  }
  
  .hc-caution-stat__label {
    font-size: 12px;
  }
}

@media screen and (max-width: 1024px) {
  .hc-caution-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hc-caution-grid .hc-caution-stat:last-child {
    grid-column: 1 / -1;
    max-width: 50%;
    justify-self: center;
  }
  
  .hc-card-header__headline {
    font-size: 22px;
    line-height: 30px;
  }
}

@media screen and (max-width: 768px) {
  .hc-card-header--with-tabs .hc-card-header__row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hc-caution-grid {
    grid-template-columns: 1fr;
  }
  
  .hc-caution-grid .hc-caution-stat:last-child {
    max-width: 100%;
  }
  
  .hc-card-header__headline {
    font-size: 20px;
    line-height: 28px;
  }
  
  .hc-caution-stat__percent {
    font-size: 36px;
    line-height: 44px;
  }
}

@media screen and (max-width: 500px) {
  .hc-caution-stat {
    padding: var(--amfm-spacing-xl, 16px);
  }
  
  .hc-card-header__headline {
    font-size: 18px;
    line-height: 26px;
    padding-bottom: var(--amfm-spacing-3xl, 24px);
  }
}

/* =============================================================================
   NEWLY MARRIED CARD
   Two-column layout with gender stats, needs, and butterfly chart
   ============================================================================= */

.hc-newly-married-card .hc-card__inner {
  padding: var(--amfm-spacing-4xl, 32px);
}

/* Card Header - uppercase bold title */
.hc-newly-married-card .hc-card-header {
  margin-bottom: var(--amfm-spacing-xl, 16px);
}

.hc-newly-married-card .hc-card-header__title {
  font-family: 'Open Sans', var(--amfm-font-body, sans-serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--amfm-text-primary, #1d1c1a);
  margin: 0;
}

/* Two Column Layout */
.hc-nm-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--amfm-spacing-xl, 16px);
}

.hc-nm-layout__left,
.hc-nm-layout__right {
  border: 1px solid var(--amfm-border-secondary-alt, #efebe3);
  border-radius: var(--amfm-radius-md, 8px);
  padding: var(--amfm-spacing-4xl, 32px);
}

/* =============================================================================
   GENDER STATS ROW
   ============================================================================= */

.hc-gender-stats {
  display: flex;
  gap: var(--amfm-spacing-xl, 16px);
  margin-bottom: var(--amfm-spacing-4xl, 32px);
}

.hc-gender-stat {
  flex: 1;
  background: #f7f7f7;
  border-radius: var(--amfm-radius-md, 8px);
  padding: var(--amfm-spacing-3xl, 24px);
  display: flex;
  flex-direction: column;
  gap: var(--amfm-spacing-3xl, 24px);
}

/* Icon + Label row (inline) */
.hc-gender-stat__header {
  display: flex;
  align-items: center;
  gap: var(--amfm-spacing-md, 8px);
}

.hc-gender-stat__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hc-gender-stat__icon .hc-icon {
  width: 24px;
  height: 24px;
}

.hc-gender-stat__label {
  font-family: 'Open Sans', var(--amfm-font-body, sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 24px;
  color: var(--amfm-text-primary, #1d1c1a);
}

.hc-gender-stat__count {
  display: flex;
  align-items: baseline;
  gap: var(--amfm-spacing-xs, 4px);
}

.hc-gender-stat__number {
  font-family: 'Open Sans', var(--amfm-font-body, sans-serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 48px;
  letter-spacing: 0.24px;
  color: var(--amfm-text-primary, #1d1c1a);
}

.hc-gender-stat__total {
  font-family: 'Open Sans', var(--amfm-font-body, sans-serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: 0.48px;
  color: var(--amfm-text-primary, #1d1c1a);
  opacity: 0.25;
}

/* =============================================================================
   NEEDS SECTION (Where they want help)
   ============================================================================= */

.hc-needs-section {
  display: flex;
  flex-direction: column;
  gap: var(--amfm-spacing-xl, 16px);
}

.hc-needs-section__title {
  font-family: var(--amfm-font-display, 'Financier Display', Georgia, serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 40px;
  letter-spacing: 0.24px;
  color: var(--amfm-text-primary, #1d1c1a);
  margin: 0;
}

/* Needs Callout - Green left border accent */
.hc-needs-callout {
  background: linear-gradient(90deg, rgba(229, 229, 229, 0.2) 0%, white 100%);
  border-left: 4px solid #76936b;
  border-radius: var(--amfm-radius-md, 8px);
  padding: var(--amfm-spacing-xl, 16px) var(--amfm-spacing-3xl, 24px);
}

.hc-needs-callout__title {
  font-family: 'Open Sans', var(--amfm-font-body, sans-serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 24px;
  color: var(--amfm-text-primary, #1d1c1a);
  margin: 0 0 var(--amfm-spacing-xs, 4px) 0;
}

.hc-needs-callout__desc {
  font-family: 'Open Sans', var(--amfm-font-body, sans-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 20px;
  color: var(--amfm-text-primary, #1d1c1a);
  margin: 0;
}

/* =============================================================================
   BUTTERFLY CHART SECTION (Right Column)
   ============================================================================= */

.hc-butterfly-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--amfm-spacing-3xl, 24px);
}

/* Header */
.hc-butterfly-header {
  text-align: center;
  width: 100%;
}

.hc-butterfly-header__subtitle {
  font-family: 'Open Sans', var(--amfm-font-body, sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 24px;
  color: var(--amfm-text-primary, #1d1c1a);
  margin: 0;
}

.hc-butterfly-header__title {
  font-family: var(--amfm-font-display, 'Financier Display', Georgia, serif);
  font-size: 48px;
  font-weight: 300;
  line-height: 56px;
  letter-spacing: -0.96px;
  color: var(--amfm-text-primary, #1d1c1a);
  margin: 0;
}

/* Legend Row */
.hc-butterfly-legend {
  display: flex;
  justify-content: center;
  gap: var(--amfm-spacing-xl, 16px);
  width: 100%;
}

.hc-butterfly-legend__item {
  display: flex;
  align-items: center;
  gap: var(--amfm-spacing-md, 8px);
  width: 112px;
}

.hc-butterfly-legend__item--men {
  justify-content: flex-end;
}

.hc-butterfly-legend__item--women {
  justify-content: flex-start;
}

.hc-butterfly-legend__line {
  flex: 1;
  height: 2px;
  background: currentColor;
  position: relative;
}

.hc-butterfly-legend__item--men .hc-butterfly-legend__line {
  background: linear-gradient(90deg, #76936b 0%, #627a59 100%);
}

.hc-butterfly-legend__item--women .hc-butterfly-legend__line {
  background: linear-gradient(90deg, #97a691 0%, #adbea6 100%);
}

/* Add arrow tips */
.hc-butterfly-legend__item--men .hc-butterfly-legend__line::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 6px solid #76936b;
}

.hc-butterfly-legend__item--women .hc-butterfly-legend__line::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid #adbea6;
}

.hc-butterfly-legend__label {
  font-family: 'Open Sans', var(--amfm-font-body, sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 24px;
  color: var(--amfm-text-primary, #1d1c1a);
  white-space: nowrap;
}

/* =============================================================================
   BUTTERFLY CHART BARS
   ============================================================================= */

.hc-butterfly-chart {
  display: flex;
  flex-direction: column;
  gap: var(--amfm-spacing-lg, 12px);
  width: 100%;
}

.hc-butterfly-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hc-butterfly-row__bars {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}

/* Individual bars - extend from center */
.hc-butterfly-bar {
  flex: 1;
  height: 24px;
  display: flex;
  max-width: 50%;
}

.hc-butterfly-bar--men {
  justify-content: flex-end;
}

.hc-butterfly-bar--women {
  justify-content: flex-start;
}

.hc-butterfly-bar__fill {
  height: 100%;
  min-width: 4px; /* Ensure visible even at 0% */
  transition: width 0.3s ease;
}

/* Men bar - darker green, rounded left side */
.hc-butterfly-bar--men .hc-butterfly-bar__fill {
  background: linear-gradient(90deg, #76936b 0%, #627a59 100%);
  border-radius: 48px 0 0 48px;
}

/* Women bar - lighter green, rounded right side */
.hc-butterfly-bar--women .hc-butterfly-bar__fill {
  background: linear-gradient(270deg, #adbea6 0%, #97a691 100%);
  border-radius: 0 48px 48px 0;
}

/* Label below bars */
.hc-butterfly-row__label {
  text-align: center;
  margin-top: var(--amfm-spacing-xs, 4px);
}

.hc-butterfly-row__percent {
  font-family: 'Open Sans', var(--amfm-font-body, sans-serif);
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  color: var(--amfm-text-primary, #1d1c1a);
}

.hc-butterfly-row__text {
  font-family: 'Open Sans', var(--amfm-font-body, sans-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 20px;
  color: var(--amfm-text-primary, #1d1c1a);
  margin-left: var(--amfm-spacing-xs, 4px);
}

/* Empty state */
.hc-empty-state {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 14px;
  color: var(--amfm-text-tertiary, #535862);
  text-align: center;
  padding: var(--amfm-spacing-3xl, 24px);
}

/* =============================================================================
   NEWLY MARRIED CARD - RESPONSIVE
   ============================================================================= */

@media screen and (max-width: 1200px) {
  .hc-butterfly-header__title {
    font-size: 36px;
    line-height: 44px;
  }
  
  .hc-needs-section__title {
    font-size: 28px;
    line-height: 36px;
  }
}

@media screen and (max-width: 1024px) {
  .hc-nm-layout {
    grid-template-columns: 1fr;
  }
  
  .hc-gender-stats {
    flex-wrap: wrap;
  }
  
  .hc-gender-stat {
    flex: 1 1 calc(50% - 8px);
    min-width: 200px;
  }
}

@media screen and (max-width: 768px) {
  .hc-newly-married-card .hc-card__inner {
    padding: var(--amfm-spacing-xl, 16px);
  }
  
  .hc-nm-layout__left,
  .hc-nm-layout__right {
    padding: var(--amfm-spacing-xl, 16px);
  }
  
  .hc-gender-stat {
    padding: var(--amfm-spacing-xl, 16px);
  }
  
  .hc-gender-stat__number {
    font-size: 24px;
    line-height: 32px;
  }
  
  .hc-gender-stat__total {
    font-size: 18px;
    line-height: 24px;
  }
  
  .hc-butterfly-header__title {
    font-size: 28px;
    line-height: 36px;
  }
  
  .hc-needs-section__title {
    font-size: 24px;
    line-height: 32px;
  }
  
  .hc-butterfly-row__percent,
  .hc-butterfly-row__text {
    font-size: 13px;
  }
}

@media screen and (max-width: 500px) {
  .hc-gender-stats {
    flex-direction: column;
  }
  
  .hc-gender-stat {
    flex: 1 1 100%;
  }
  
  .hc-butterfly-legend {
    gap: var(--amfm-spacing-md, 8px);
  }
  
  .hc-butterfly-legend__item {
    width: 90px;
  }
  
  .hc-butterfly-bar {
    height: 20px;
  }
}

/* =============================================================================
   COHORT / DENOMINATOR LABELS
   ============================================================================= */

.hc-cohort-label {
  font-size: var(--amfm-text-xs, 12px);
  font-style: italic;
  color: var(--amfm-neutral-500, #717680);
  margin: var(--amfm-spacing-sm, 4px) 0 0;
  line-height: 1.4;
}

.hc-stat-card .hc-cohort-label {
  margin-top: auto;
  padding-top: var(--amfm-spacing-sm, 4px);
}

.hc-stat-card--pie .hc-cohort-label,
.hc-chart-column .hc-cohort-label {
  align-self: flex-start;
}

.hc-caution-grid .hc-cohort-label,
.hc-needs-grid .hc-cohort-label {
  grid-column: 1 / -1;
  text-align: left;
}

/* =============================================================================
   CAMPUS FILTER SELECTOR
   ============================================================================= */

.hc-campus-filter {
  position: relative;
  display: flex;
  align-items: center;
}

/* Separator line before the campus selector */
.hc-campus-filter::before {
  content: '';
  display: block;
  width: 1px;
  height: 20px;
  background: var(--amfm-border-secondary, #e9eaeb);
  margin-right: var(--amfm-spacing-lg, 12px);
}

.hc-campus-selector {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  border: 1px solid var(--amfm-border-primary, rgba(0, 0, 0, 0.08));
  border-radius: var(--amfm-radius-md, 8px);
  padding: 10px 36px 10px 14px;
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-sm, 14px);
  font-weight: 600;
  line-height: var(--amfm-leading-sm, 20px);
  color: var(--amfm-text-tertiary, #535862);
  cursor: pointer;
  transition: all var(--amfm-transition-fast, 0.15s ease);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%23535862' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

.hc-campus-selector:hover {
  background-color: var(--amfm-neutral-50, #f9fafb);
  color: var(--amfm-text-secondary, #414651);
}

.hc-campus-selector:focus {
  outline: 2px solid var(--amfm-brand-500, #2e90fa);
  outline-offset: 1px;
}

.hc-campus-selector:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive: stack actions on mobile */
@media screen and (max-width: 768px) {
  .hc-campus-filter::before {
    display: none;
  }
  .hc-campus-selector {
    width: 100%;
  }
}


/* =============================================================================
   HEARTCHART MODALS (Link + Deployment Guide)
   ============================================================================= */

.hc-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.hc-modal--active {
  visibility: visible;
  opacity: 1;
}

.hc-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 13, 18, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.hc-modal__content {
  position: relative;
  width: 90vw;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--amfm-bg-primary, #ffffff);
  border-radius: var(--amfm-radius-xl, 16px);
  box-shadow: var(--amfm-shadow-card,
    0px 12px 16px -4px rgba(10, 13, 18, 0.08),
    0px 4px 6px -2px rgba(10, 13, 18, 0.03),
    0px 2px 2px -1px rgba(10, 13, 18, 0.04));
  overflow: hidden;
}

body.hc-modal-open {
  overflow: hidden;
}

/* ---- Header ---- */

.hc-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--amfm-border-primary, rgba(0, 0, 0, 0.08));
  flex-shrink: 0;
}

.hc-modal__title {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--amfm-text-primary, #181d27);
  margin: 0;
}

.hc-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: var(--amfm-radius-md, 8px);
  cursor: pointer;
  color: var(--amfm-text-tertiary, #535862);
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.hc-modal__close:hover {
  background: var(--amfm-neutral-50, #f9fafb);
  color: var(--amfm-text-primary, #181d27);
}

/* ---- Body ---- */

.hc-modal__body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hc-modal__intro {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-sm, 14px);
  color: var(--amfm-text-tertiary, #535862);
  line-height: 1.6;
  margin: 0 0 20px;
}

/* ---- Shared button styles ---- */

.hc-modal__btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--amfm-text-secondary, #414651);
  background: transparent;
  border: 1px solid var(--amfm-border-primary, rgba(0, 0, 0, 0.08));
  border-radius: var(--amfm-radius-md, 8px);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.hc-modal__btn-outline:hover {
  background: var(--amfm-neutral-50, #f9fafb);
}

.hc-modal__btn-outline .hc-icon {
  width: 16px;
  height: 16px;
}

.hc-modal__btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-sm, 14px);
  font-weight: 500;
  color: #ffffff;
  background: #7D8E90;
  border: none;
  border-radius: var(--amfm-radius-md, 8px);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  margin-top: 20px;
  transition: background 0.15s ease;
}

.hc-modal__btn-primary:hover,
.hc-modal__btn-primary:focus {
  background: #6b7d7e;
  color: #ffffff;
}

.hc-modal__btn-primary .hc-icon {
  width: 18px;
  height: 18px;
}

/* ---- HeartChart Link modal specifics ---- */

.hc-modal__section-label {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-sm, 14px);
  font-weight: 600;
  color: var(--amfm-text-primary, #181d27);
  margin: 0 0 8px;
}

.hc-modal__logo-section {
  margin-bottom: 20px;
}

.hc-modal__logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
}

#hc-logo-container {
  position: relative;
  display: inline-block;
}

#hc-logo-container img,
#hc-logo-container .church-logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
  transition: filter 0.2s ease;
}

#hc-spinner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  z-index: 10;
}

.hc-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: hcSpin 0.8s linear infinite;
}

@keyframes hcSpin {
  to { transform: rotate(360deg); }
}

.hc-modal__hint {
  font-size: 12px;
  color: var(--amfm-text-quaternary, #717680);
  margin: 6px 0 0;
  line-height: 1.4;
}

.hc-modal__dropdown {
  width: 100%;
  padding: 8px 12px;
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-sm, 14px);
  color: var(--amfm-text-secondary, #414651);
  background: var(--amfm-bg-primary, #ffffff);
  border: 1px solid var(--amfm-border-primary, rgba(0, 0, 0, 0.08));
  border-radius: var(--amfm-radius-md, 8px);
  margin-bottom: 12px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23535862' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

.hc-modal__dropdown:focus {
  outline: 2px solid var(--amfm-brand-500, #2e90fa);
  outline-offset: 1px;
}

.hc-modal__link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  margin-bottom: 16px;
}

.hc-modal__link-row a {
  color: var(--amfm-text-tertiary, #535862) !important;
  text-decoration: underline;
  font-size: var(--amfm-text-sm, 14px);
  word-break: break-all;
  overflow-wrap: break-word;
  min-width: 0;
  flex: 1;
}

.hc-modal__qr-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.hc-modal__qr-frame {
  width: 180px;
  height: 180px;
  overflow: hidden;
  position: relative;
}

/* The QR library renders at 1000x1000 internally; scale to fit the frame */
.hc-modal__qr-frame > div {
  transform: scale(0.18);
  transform-origin: top left;
  position: absolute;
  top: 0;
  left: 0;
}

/* ---- Deployment Guide modal specifics ---- */

.hc-modal__section {
  border-bottom: 1px solid var(--amfm-border-primary, rgba(0, 0, 0, 0.08));
  padding: 14px 0;
}

.hc-modal__section:last-of-type {
  border-bottom: none;
}

.hc-modal__section summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: var(--amfm-text-sm, 14px);
  font-weight: 500;
  color: var(--amfm-text-primary, #181d27);
  position: relative;
  padding-right: 24px;
}

.hc-modal__section summary::-webkit-details-marker,
.hc-modal__section summary::marker {
  display: none;
  content: '';
}

.hc-modal__section summary::after {
  content: "\2304";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--amfm-text-tertiary, #535862);
  transition: transform 0.2s ease;
}

.hc-modal__section[open] summary::after {
  transform: rotate(180deg);
}

.hc-modal__section p {
  font-family: var(--amfm-font-body, 'Inter', sans-serif);
  font-size: 13px;
  color: var(--amfm-text-tertiary, #535862);
  line-height: 1.6;
  margin: 10px 0 0;
}

/* ---- Responsive ---- */

@media screen and (max-width: 600px) {
  .hc-modal__content {
    width: 95vw;
    max-height: 90vh;
  }

  .hc-modal__header {
    padding: 16px 16px 12px;
  }

  .hc-modal__body {
    padding: 16px;
  }

  .hc-modal__link-row {
    flex-wrap: wrap;
  }

  .hc-modal__qr-frame {
    width: 150px;
    height: 150px;
  }

  .hc-modal__qr-frame > div {
    transform: scale(0.15);
  }
}
