/* ============================================================
   Core7 Nutrition Evaluator — Style Sheet
   Health/wellness aesthetic: greens, earth tones, warm whites
   ============================================================ */

/* ── Custom Properties ── */
:root {
  /* Greens */
  --green-950: #0F2318;
  --green-900: #1A3C2A;
  --green-800: #245234;
  --green-700: #2D6A4F;
  --green-600: #40916C;
  --green-500: #52B788;
  --green-400: #74C69D;
  --green-200: #B7E4C7;
  --green-100: #D8F3DC;
  --green-50:  #F0FAF4;

  /* Earth / Amber */
  --earth-700: #7D5A0A;
  --earth-500: #C9963A;
  --earth-400: #E8B84A;
  --earth-200: #F5DFA8;
  --earth-100: #FBF3E0;
  --earth-50:  #FEFAF3;

  /* Neutrals */
  --gray-900: #111827;
  --gray-800: #1F2937;
  --gray-700: #374151;
  --gray-500: #6B7280;
  --gray-400: #9CA3AF;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;
  --white:    #FFFFFF;

  /* Semantic */
  --bg:         #F7FAF8;
  --bg-card:    #FFFFFF;
  --text-dark:  #1A2B1F;
  --text-mid:   #3D5044;
  --text-light: #6B8576;
  --border:     #D5E8DA;

  /* Status */
  --status-critical: #C0392B;
  --status-low:      #E67E22;
  --status-fair:     #D4AC0D;
  --status-good:     #27AE60;
  --status-optimal:  #16A085;

  /* Spacing & Shape */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-full: 9999px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --shadow-card: 0 2px 12px rgba(26,60,42,.07);

  /* Transitions */
  --transition: 220ms cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

/* ── Utilities ── */
.hidden { display: none !important; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── Hero ── */
.hero {
  position: relative;
  background: linear-gradient(145deg, var(--green-950) 0%, var(--green-800) 45%, var(--green-700) 100%);
  padding: 72px 0 0;
  overflow: hidden;
  color: var(--white);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(82,183,136,.18) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(232,184,74,.10) 0%, transparent 60%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; text-align: center; }

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-svg {
  width: 40px;
  height: 40px;
  color: var(--green-400);
}

.brand-name {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--white);
}

.brand-name strong {
  font-weight: 800;
  color: var(--green-400);
}

.brand-by {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  border-left: 1px solid rgba(255,255,255,.2);
  padding-left: 10px;
  line-height: 1;
}

.hero-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 20px;
}

.hero-title em {
  font-style: italic;
  color: var(--green-400);
}

.hero-subtitle {
  font-size: clamp(15px, 2vw, 18px);
  color: rgba(255,255,255,.75);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 56px;
}

.badge {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  backdrop-filter: blur(8px);
}

.hero-wave {
  margin-top: -2px;
  line-height: 0;
}
.hero-wave svg { width: 100%; height: 80px; }

/* ── Sections ── */
.section { padding: 64px 0; }

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-light);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── Meal Cards ── */
.meal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.meal-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.meal-card:focus-within {
  border-color: var(--green-500);
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(64,145,108,.12);
}

.meal-card--wide { width: 100%; }

.meal-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.meal-emoji {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.meal-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.meal-hint {
  font-size: 12px;
  color: var(--text-light);
}

.meal-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-dark);
  background: var(--gray-50);
  resize: vertical;
  transition: border-color var(--transition);
  line-height: 1.55;
}

.meal-input::placeholder { color: var(--gray-400); }

.meal-input:focus {
  outline: none;
  border-color: var(--green-500);
  background: var(--white);
}

/* ── Analyze Button ── */
.cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.btn-analyze {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  padding: 16px 40px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(45,106,79,.35);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.btn-analyze:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(45,106,79,.45);
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
}

.btn-analyze:active { transform: translateY(0); }

.btn-analyze-icon { font-size: 20px; }

.cta-note {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
}

/* ── Loading ── */
#loading-section { background: var(--bg); }

.loading-card {
  max-width: 440px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.loading-spinner {
  width: 52px;
  height: 52px;
  border: 4px solid var(--green-100);
  border-top-color: var(--green-600);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 0.9s linear infinite;
}

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

.loading-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.loading-text {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 24px;
  min-height: 20px;
}

.loading-progress {
  height: 6px;
  background: var(--green-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-600), var(--green-400));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* ── Results: Header ── */
.results-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  margin-bottom: 48px;
  align-items: start;
}

/* Score Card */
.score-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 36px;
  display: flex;
  align-items: center;
  gap: 28px;
  box-shadow: var(--shadow-card);
}

.score-ring-wrap {
  position: relative;
  flex-shrink: 0;
}

.score-ring {
  width: 120px;
  height: 120px;
  transform: rotate(0deg);
}

#score-ring-fill {
  transition: stroke-dashoffset 1.2s cubic-bezier(.4,0,.2,1), stroke 0.5s;
}

.score-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  line-height: 1;
}

.score-number {
  display: block;
  font-size: 32px;
  font-weight: 800;
  color: var(--green-700);
  line-height: 1;
}

.score-denom {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 500;
}

.score-info { flex: 1; }

.score-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.score-message {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 12px;
}

.score-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Foods Card */
.foods-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  box-shadow: var(--shadow-card);
}

.foods-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.foods-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.food-tag {
  display: flex;
  flex-direction: column;
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--green-900);
  max-width: 180px;
}

.food-tag.not-found {
  background: var(--earth-50);
  border-color: var(--earth-200);
  color: var(--earth-700);
}

.food-match {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-light);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Results: Blocks ── */
.results-block {
  margin-bottom: 56px;
}

.block-header {
  margin-bottom: 28px;
}

.block-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.block-subtitle {
  font-size: 15px;
  color: var(--text-light);
}

/* Legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-mid);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Nutrient Sections ── */
.nutrient-sections {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.nutrient-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--border);
}

.nutrient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.nutrient-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.nutrient-item:hover { box-shadow: var(--shadow-md); }

.nutrient-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.nutrient-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.nutrient-status {
  font-size: 14px;
  line-height: 1;
}
.nutrient-status.met     { color: var(--status-good); }
.nutrient-status.optimal { color: var(--status-optimal); }
.nutrient-status.partial { color: var(--status-fair); }
.nutrient-status.low     { color: var(--status-low); }
.nutrient-status.critical{ color: var(--status-critical); }

.nutrient-amounts {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.amount-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

.amount-rda {
  font-size: 12px;
  color: var(--text-light);
}

.amount-pct {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
}

.nutrient-bar-track {
  height: 6px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.nutrient-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  width: 0;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

/* ── Benefits Grid ── */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.benefit-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.benefit-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.benefit-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--green-500));
}

.benefit-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.benefit-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.benefit-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.benefit-description {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.5;
}

.benefit-relevance {
  margin-left: auto;
  text-align: center;
  flex-shrink: 0;
}

.relevance-score {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 3px;
}

.relevance-label {
  font-size: 10px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.benefit-gaps {
  margin-bottom: 12px;
}

.gaps-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: 8px;
}

.gap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gap-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.gaps-ok {
  font-size: 13px;
  color: var(--status-good);
  font-weight: 500;
}

.benefit-detail {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-style: italic;
}

/* ── Beyond Nutrition Section ── */
.beyond-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.beyond-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.beyond-card:hover {
  box-shadow: var(--shadow-md);
}

.beyond-card-accent {
  height: 3px;
  background: var(--card-accent, var(--green-500));
}

.beyond-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition);
  list-style: none;
}

.beyond-card-header:hover {
  background: var(--gray-50);
}

.beyond-card-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.beyond-card-label {
  flex: 1;
  min-width: 0;
}

.beyond-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

.beyond-card-subtitle {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 1px;
}

.beyond-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.beyond-card-count {
  font-size: 12px;
  color: var(--text-light);
  background: var(--gray-100);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  font-weight: 500;
}

.beyond-chevron {
  font-size: 11px;
  color: var(--text-light);
  transition: transform var(--transition);
  line-height: 1;
}

.beyond-card.open .beyond-chevron {
  transform: rotate(180deg);
}

.beyond-card-body {
  display: none;
  padding: 4px 20px 20px;
  border-top: 1px solid var(--border);
}

.beyond-card.open .beyond-card-body {
  display: block;
}

.beyond-ingredient {
  display: flex;
  align-items: baseline;
  gap: 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  line-height: 1.55;
  flex-wrap: wrap;
}

.beyond-ingredient:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.beyond-ingredient-name {
  font-weight: 600;
  color: var(--text-dark);
  flex-shrink: 0;
  margin-right: 6px;
}

.beyond-ingredient-sep {
  color: var(--text-light);
  margin-right: 6px;
  flex-shrink: 0;
}

.beyond-ingredient-benefit {
  color: var(--text-mid);
}

.beyond-note {
  background: var(--earth-50);
  border: 1px solid var(--earth-200);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 13px;
  color: var(--earth-700);
  line-height: 1.7;
  font-style: italic;
}

.beyond-note-emphasis {
  background: var(--green-50);
  border-color: var(--green-200);
  color: var(--green-800);
  margin-top: 10px;
  font-size: 14px;
}

/* ── CTA Block ── */
.cta-block {
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--green-950) 0%, var(--green-800) 50%, var(--green-700) 100%);
  position: relative;
  overflow: hidden;
  margin-bottom: 40px;
}

.cta-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 60% at 90% 10%, rgba(82,183,136,.2) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 5% 90%, rgba(232,184,74,.12) 0%, transparent 60%);
  pointer-events: none;
}

.cta-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 60px 40px;
}

.cta-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.cta-logo-svg { width: 36px; height: 36px; }

.cta-logo-text {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--white);
}

.cta-logo-text strong {
  font-weight: 800;
  color: var(--green-400);
}

.cta-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
  line-height: 1.2;
}

.cta-body {
  font-size: clamp(15px, 2vw, 17px);
  color: rgba(255,255,255,.8);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

.cta-benefits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 36px;
}

.cta-benefits span {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(6px);
}

.btn-cta {
  display: inline-block;
  background: var(--green-400);
  color: var(--green-950);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  padding: 16px 44px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px rgba(116,198,157,.35);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  letter-spacing: 0.01em;
}

.btn-cta:hover {
  transform: translateY(-2px);
  background: var(--green-300);
  box-shadow: 0 8px 32px rgba(116,198,157,.5);
}

.cta-fine {
  margin-top: 16px;
  font-size: 13px;
  color: rgba(255,255,255,.45);
}

/* Try Again */
.try-again-row {
  text-align: center;
  padding-bottom: 20px;
}

.btn-try-again {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 10px 24px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mid);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.btn-try-again:hover {
  border-color: var(--green-500);
  color: var(--green-700);
}

/* ── Footer ── */
.footer {
  background: var(--green-950);
  color: rgba(255,255,255,.6);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,.8);
}

.footer-logo-svg {
  width: 26px;
  height: 26px;
  color: var(--green-400);
}

.footer-links a {
  color: var(--green-400);
  font-size: 14px;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--green-300); }

.footer-disclaimer {
  font-size: 12px;
  max-width: 600px;
  line-height: 1.65;
  color: rgba(255,255,255,.35);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .section { padding: 48px 0; }

  .meal-grid {
    grid-template-columns: 1fr;
    margin-bottom: 36px;
  }

  .results-header {
    grid-template-columns: 1fr;
  }

  .score-card {
    flex-direction: column;
    text-align: center;
  }

  .score-info { text-align: center; }

  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .nutrient-grid {
    grid-template-columns: 1fr;
  }

  .cta-inner { padding: 40px 24px; }

  .hero { padding: 52px 0 0; }
}

@media (max-width: 480px) {
  .score-card { padding: 24px 20px; }
  .foods-card { padding: 20px; }
  .cta-inner { padding: 32px 20px; }

  .btn-analyze {
    width: 100%;
    justify-content: center;
    padding: 16px 24px;
  }
}

/* ── Lead Capture Modal ── */
.lead-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10, 24, 15, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayIn 0.2s ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lead-modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 44px 40px 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(10, 24, 15, 0.32), 0 4px 16px rgba(10, 24, 15, 0.12);
  animation: modalIn 0.25s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lead-modal-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 22px;
}

.lead-logo-svg {
  width: 32px;
  height: 32px;
  color: var(--green-600);
}

.lead-logo-text {
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--text-dark);
}

.lead-logo-text strong {
  font-weight: 800;
  color: var(--green-600);
}

.lead-modal-headline {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  line-height: 1.2;
  margin-bottom: 12px;
}

.lead-modal-sub {
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
  line-height: 1.65;
  margin-bottom: 28px;
}

.lead-field {
  margin-bottom: 16px;
}

.lead-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.lead-required {
  color: var(--status-critical);
}

.lead-optional {
  font-weight: 400;
  color: var(--text-light);
}

.lead-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-dark);
  background: var(--gray-50);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.lead-input::placeholder { color: var(--gray-400); }

.lead-input:focus {
  border-color: var(--green-500);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(64,145,108,.12);
}

.lead-input.error {
  border-color: var(--status-critical);
  box-shadow: 0 0 0 3px rgba(192,57,43,.10);
}

.lead-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 24px;
  margin-top: 4px;
}

.lead-checkbox {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--green-600);
  cursor: pointer;
}

.lead-checkbox-label {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.55;
  cursor: pointer;
}

.btn-get-results {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  padding: 15px 32px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(45,106,79,.35);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  margin-bottom: 16px;
}

.btn-get-results:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(45,106,79,.45);
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
}

.btn-get-results:active { transform: translateY(0); }

.btn-get-results-arrow { font-size: 18px; }

.lead-privacy {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  line-height: 1.55;
}

@media (max-width: 520px) {
  .lead-modal {
    padding: 32px 24px 28px;
  }

  .lead-modal-headline {
    font-size: 22px;
  }
}

/* ── Food Row Inputs ── */
.meal-card-header-text {
  flex: 1;
  min-width: 0;
}

.food-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.food-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.food-name-input,
.food-amount-input {
  min-width: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-dark);
  background: var(--gray-50);
  transition: border-color var(--transition), background var(--transition);
}

.food-name-input {
  flex: 7;
}

.food-amount-input {
  flex: 3;
}

.food-name-input::placeholder,
.food-amount-input::placeholder {
  color: var(--gray-400);
}

.food-name-input:focus,
.food-amount-input:focus {
  outline: none;
  border-color: var(--green-500);
  background: var(--white);
}

.btn-remove-row {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: none;
  color: var(--gray-400);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.btn-remove-row:hover {
  border-color: var(--status-critical);
  color: var(--status-critical);
  background: rgba(192, 57, 43, .06);
}

.btn-add-food {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: 1.5px dashed var(--green-400);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--green-600);
  cursor: pointer;
  margin-top: 4px;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.btn-add-food:hover {
  background: var(--green-50);
  border-color: var(--green-500);
  color: var(--green-700);
}

.btn-clear-meal {
  flex-shrink: 0;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}

.btn-clear-meal:hover {
  color: var(--text-mid);
  background: var(--gray-100);
}

@media (max-width: 480px) {
  .food-row {
    flex-wrap: wrap;
  }

  .food-name-input {
    flex: 1 1 100%;
  }

  .food-amount-input {
    flex: 1 1 calc(100% - 40px);
  }
}

/* ── Clickable badge ── */
.badge-clickable {
  cursor: pointer;
  text-decoration: underline dotted rgba(255,255,255,.5);
  transition: background var(--transition), border-color var(--transition);
}

.badge-clickable:hover,
.badge-clickable:focus {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.35);
  outline: none;
}

/* ── Micronutrients Popup ── */
.micro-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(10, 24, 15, 0.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayIn 0.2s ease;
}

.micro-popup {
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px 36px 28px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s cubic-bezier(.34,1.56,.64,1);
}

.micro-popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: none;
  color: var(--text-light);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.micro-popup-close:hover {
  border-color: var(--green-500);
  color: var(--green-700);
  background: var(--green-50);
}

.micro-popup-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 18px;
  padding-right: 24px;
}

.micro-popup-list {
  columns: 2;
  column-gap: 24px;
  list-style: none;
  margin-bottom: 20px;
}

.micro-popup-list li {
  font-size: 13px;
  color: var(--text-mid);
  padding: 5px 0;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 7px;
  break-inside: avoid;
}

.micro-popup-list li::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-500);
  flex-shrink: 0;
}

.micro-popup-statement {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.7;
  border-top: 1.5px solid var(--border);
  padding-top: 16px;
  font-style: italic;
}

@media (max-width: 520px) {
  .micro-popup {
    padding: 28px 20px 22px;
    max-height: 85vh;
  }

  .micro-popup-list {
    columns: 1;
  }
}
