/* ================================================================
   AFRIFIT — COMPLETE DESIGN SYSTEM
   Palette: Forest Green / Matcha / Cacao / Honey / Cream
   Fonts: Playfair Display (headings) + Inter (body)
   ================================================================ */

/* ── CUSTOM PROPERTIES ───────────────────────────────────────── */
:root {
  /* Brand Colors */
  --forest:        #2C5E3B;
  --forest-dark:   #1e4429;
  --forest-light:  #3d7a50;
  --matcha:        #7E9F3D;
  --matcha-light:  #9bbf55;
  --cacao:         #5A4032;
  --cacao-dark:    #4a3528;
  --cacao-light:   #7a5a48;
  --honey:         #F1C40F;
  --honey-dark:    #d4ac0d;
  --honey-light:   #f7dc6f;
  --cream:         #FDFBF7;
  --cream-dark:    #EDE9E1;
  --cream-darker:  #ddd6cc;
  --white:         #FFFFFF;

  /* Semantic */
  --danger:  #e74c3c;
  --warning: #e67e22;
  --success: #27ae60;
  --info:    #3498db;

  /* Macro Colors */
  --clr-protein: #3498db;
  --clr-carbs:   #F1C40F;
  --clr-fat:     #e67e22;
  --clr-fiber:   #2C5E3B;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  --text-xs:   0.6875rem;   /* 11px */
  --text-sm:   0.8125rem;   /* 13px */
  --text-base: 1rem;        /* 16px */
  --text-lg:   1.125rem;    /* 18px */
  --text-xl:   1.25rem;     /* 20px */
  --text-2xl:  1.5rem;      /* 24px */
  --text-3xl:  1.875rem;    /* 30px */
  --text-4xl:  2.25rem;     /* 36px */
  --text-5xl:  3rem;        /* 48px */

  /* Spacing (4px base) */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Border Radius */
  --r-sm:   6px;
  --r:      10px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-full: 999px;

  /* Shadows */
  --sh-xs: 0 1px 3px rgba(44,94,59,0.07);
  --sh-sm: 0 2px 8px rgba(44,94,59,0.09);
  --sh:    0 4px 16px rgba(44,94,59,0.11);
  --sh-md: 0 8px 28px rgba(44,94,59,0.13);
  --sh-lg: 0 16px 48px rgba(44,94,59,0.16);

  /* Transitions */
  --tr-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --tr:      0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --tr-slow: 0.4s  cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --max-w: 1280px;
  --header-h: 68px;
}

/* ── RESET ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--cacao);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { text-decoration: none; color: inherit; }
input, select, textarea { font-family: inherit; }

/* ── TYPOGRAPHY ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--forest);
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p  { line-height: 1.7; }

.text-sm   { font-size: var(--text-sm); }
.text-xs   { font-size: var(--text-xs); }
.text-muted { color: var(--cacao-light); }
em         { font-style: italic; color: var(--forest); }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
@media (max-width: 640px) { .container { padding: 0 var(--sp-4); } }

.hidden { display: none !important; }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.625rem 1.25rem;
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--tr);
  white-space: nowrap;
  border: 2px solid transparent;
  line-height: 1.4;
}
.btn svg { width: 16px; height: 16px; }

.btn--green {
  background: var(--forest);
  color: var(--white);
  border-color: var(--forest);
  box-shadow: 0 2px 8px rgba(44,94,59,0.3);
}
.btn--green:hover {
  background: var(--forest-dark);
  border-color: var(--forest-dark);
  box-shadow: 0 4px 16px rgba(44,94,59,0.4);
  transform: translateY(-1px);
}

.btn--honey {
  background: var(--honey);
  color: var(--cacao);
  border-color: var(--honey);
  box-shadow: 0 2px 8px rgba(241,196,15,0.35);
}
.btn--honey:hover {
  background: var(--honey-dark);
  border-color: var(--honey-dark);
  box-shadow: 0 4px 16px rgba(241,196,15,0.45);
  transform: translateY(-1px);
}
.btn--honey:disabled {
  background: var(--cream-darker);
  color: var(--cacao-light);
  border-color: var(--cream-darker);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  color: var(--cacao-light);
  border-color: var(--cream-dark);
}
.btn--ghost:hover {
  background: var(--cream-dark);
  color: var(--cacao);
}

.btn--outline {
  background: transparent;
  color: var(--forest);
  border-color: var(--forest);
}
.btn--outline:hover {
  background: var(--forest);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(44,94,59,0.3);
  transform: translateY(-1px);
}

.btn--sm  { padding: 0.4rem 0.875rem; font-size: var(--text-xs); }
.btn--lg  { padding: 0.875rem 1.75rem; font-size: var(--text-base); }
.btn--full { width: 100%; justify-content: center; border-radius: var(--r-md); }

/* ── BADGES ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
}
.badge--green  { background: rgba(44,94,59,0.1);  color: var(--forest); }
.badge--honey  { background: rgba(241,196,15,0.15); color: #a08800; }
.badge--cacao  { background: rgba(90,64,50,0.1);  color: var(--cacao); }
.badge--matcha { background: rgba(126,159,61,0.12); color: #5a7a1a; }
.badge--danger { background: rgba(231,76,60,0.1); color: #c0392b; }

/* ── PANELS / CARDS ──────────────────────────────────────────── */
.panel {
  background: var(--white);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--sh-sm);
  border: 1px solid var(--cream-dark);
  transition: box-shadow var(--tr);
}
.panel:hover { box-shadow: var(--sh); }

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}
.panel__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-lg);
  color: var(--forest);
}
.panel__title svg { width: 20px; height: 20px; }

.panel__section-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  color: var(--forest);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 2px solid var(--cream-dark);
}
.panel__section-title svg { width: 18px; height: 18px; }

/* ── FORM ELEMENTS ───────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cacao);
  margin-bottom: var(--sp-2);
}
.form-input, .form-select {
  width: 100%;
  padding: 0.625rem var(--sp-4);
  border: 2px solid var(--cream-dark);
  border-radius: var(--r);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  color: var(--cacao);
  background: var(--cream);
  transition: border-color var(--tr), box-shadow var(--tr);
  outline: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(44,94,59,0.12);
}
.form-group { flex: 1; }

/* ── HEADER ──────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--forest);
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.header__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
}
.header__logo-icon {
  font-size: 1.75rem;
  line-height: 1;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.site-logo {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.site-logo--sm {
  width: 34px;
  height: 34px;
}
.header__logo-icon .site-logo {
  margin-top: 0;
}
.footer__brand-link .site-logo,
.footer__logo .site-logo {
  display: block;
  flex-shrink: 0;
}
.header__logo-name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.06em;
}

/* Branded wordmark — gradient on dark surfaces (site header) */
.brand-wordmark {
  background: linear-gradient(120deg, #FDFBF7 0%, #F7DC6F 38%, #9BBF55 72%, #FDFBF7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Branded wordmark — gradient on light surfaces (dash header, cards) */
.brand-wordmark--on-light {
  background: linear-gradient(120deg, #1e4429 0%, #2C5E3B 35%, #7E9F3D 68%, #d4ac0d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.brand-tagline {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--honey);
  white-space: nowrap;
}

.header__logo-tagline {
  display: block;
  font-size: var(--text-xs);
  color: var(--honey);
  font-weight: 600;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.header__nav {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.header__nav-link {
  color: rgba(255,255,255,0.85);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--tr);
  white-space: nowrap;
}

/* Support for mobile dropdown version of nav links */
.header__nav.open .header__nav-link {
  color: var(--cacao);
  padding: 0.5rem 0;
}
.header__nav-link:hover { color: var(--honey); }
.header__menu-btn {
  display: none;
  color: var(--white);
  padding: var(--sp-2);
}
.header__menu-btn svg { width: 24px; height: 24px; }

@media (max-width: 900px) {
  .header__nav { display: none; }
  .header__menu-btn { display: flex; }
  .header__logo-tagline { display: none; }

  /* Mobile dropdown nav */
  .header__inner {
    position: relative;
  }
  .header__nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--cream-dark);
    padding: var(--sp-4) var(--sp-6);
    gap: var(--sp-2);
    box-shadow: var(--sh-sm);
    z-index: 100;
    animation: slideDown 0.2s ease;
  }

  /* Backdrop for nicer mobile menu experience (cool UI feature) */
  body.nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    top: var(--header-h, 68px);
    background: rgba(0, 0, 0, 0.25);
    z-index: 90;
    animation: fadeIn 0.15s ease;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .header__nav.open .header__nav-link {
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--cream-dark);
  }
  .header__nav.open .header__nav-link:last-child {
    border-bottom: none;
  }
}

/* ── HERO ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: var(--cream);
  padding: var(--sp-16) 0 var(--sp-12);
  overflow: hidden;
}
.hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-6);
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: rgba(44,94,59,0.08);
  color: var(--forest);
  border: 1.5px solid rgba(44,94,59,0.2);
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 600;
  animation: fadeInUp 0.5s ease both;
}
.hero__badge svg { width: 15px; height: 15px; }
.hero__title {
  font-size: clamp(var(--text-3xl), 6vw, 3.75rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--cacao);
  animation: fadeInUp 0.6s 0.1s ease both;
}
.hero__title em {
  color: var(--forest);
  font-style: italic;
}
.hero__subtitle {
  max-width: 580px;
  font-size: var(--text-lg);
  color: var(--cacao-light);
  animation: fadeInUp 0.6s 0.2s ease both;
}
.hero__actions {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 0.6s 0.3s ease both;
}
.hero__stats {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  margin-top: var(--sp-4);
  animation: fadeInUp 0.6s 0.4s ease both;
}
.hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.hero__stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--forest);
}
.hero__stat-label {
  font-size: var(--text-xs);
  color: var(--cacao-light);
  font-weight: 500;
}
.hero__stat-divider {
  color: var(--cream-darker);
  font-size: var(--text-xl);
}

/* Decorative circles */
.hero__decoration { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero__deco-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.06;
  background: var(--forest);
}
.hero__deco-circle--1 { width: 600px; height: 600px; top: -200px; right: -150px; }
.hero__deco-circle--2 { width: 400px; height: 400px; bottom: -150px; left: -100px; }
.hero__deco-circle--3 { width: 200px; height: 200px; top: 50px; left: 10%; opacity: 0.04; }

/* ── HOW IT WORKS ────────────────────────────────────────────── */
.how-it-works {
  background: var(--forest);
  padding: var(--sp-10) 0;
}
.how-it-works__steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.step {
  flex: 1;
  min-width: 180px;
  max-width: 240px;
  text-align: center;
  padding: var(--sp-4);
}
.step__icon {
  font-size: 2.5rem;
  margin-bottom: var(--sp-3);
  display: block;
}
.step__title {
  font-family: var(--font-heading);
  color: var(--white);
  font-size: var(--text-base);
  margin-bottom: var(--sp-2);
}
.step__desc {
  color: rgba(255,255,255,0.7);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.step__arrow {
  color: var(--honey);
  font-size: var(--text-2xl);
  align-self: center;
  margin-top: -1.5rem;
  flex-shrink: 0;
}
@media (max-width: 640px) { .step__arrow { display: none; } }

/* ── SECTIONS ────────────────────────────────────────────────── */
.section { padding: var(--sp-16) 0; scroll-margin-top: calc(var(--header-h) + 24px); }
.section--alt { background: var(--cream-dark); }

.section__header {
  text-align: center;
  margin-bottom: var(--sp-10);
}
.section__title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  margin-bottom: var(--sp-3);
}
.section__subtitle {
  max-width: 540px;
  margin: 0 auto;
  color: var(--cacao-light);
  font-size: var(--text-base);
}

/* ── TABS ────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-8);
  background: var(--cream);
  border-radius: var(--r-full);
  padding: var(--sp-1);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--sh-xs);
  border: 1px solid var(--cream-darker);
}
.tab {
  padding: 0.5rem 1.25rem;
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cacao-light);
  transition: all var(--tr);
  cursor: pointer;
  white-space: nowrap;
}
.tab--active {
  background: var(--forest);
  color: var(--white);
  box-shadow: var(--sh-xs);
}
.tab:not(.tab--active):hover {
  background: var(--cream-dark);
  color: var(--cacao);
}

/* ── MEALS GRID (polished FoodGrid per spec) ─────────────────── */
.meals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.meals-grid__loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-12);
  color: var(--cacao-light);
}

/* MealCard / FoodCard — white bg, 12px radius, subtle shadow, split top/bottom */
.meal-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--cream-dark);
  transition: box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  animation: fadeInUp 0.4s ease both;
  height: 100%;
}
.meal-card:hover {
  box-shadow: var(--sh-md);
}

/* Top Image Frame - immersive zoom container (per latest spec) */
.image-frame {
  height: 160px;
  width: 100%;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  position: relative;
}

/* The inner food visual that completely fills the frame and gets scaled on hover */
.food-image {
  width: 100%;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  background: #f9f6f1;
  transform: scale(1.15);
}

/* When using real <img>, make it fill and cover */
.food-image[src] {
  object-fit: cover;
  display: block;
}

/* Explicit transition on the image element itself (for real photos) */
img.food-image {
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* For emoji fallback, center the content */
.food-image:not([src]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cinematic immersive zoom: ONLY the image inside scales up (whether real <img> or emoji container), card stays perfectly still */
.food-card:hover .food-image {
  transform: scale(1);
}

/* Region-specific fills / gradients so the "image" area has character and fills completely */
.food-image--nigerian {
  background: linear-gradient(180deg, #f0f7f2 0%, #f9f6f1 100%);
}
.food-image--west-african {
  background: linear-gradient(180deg, #f8f4e8 0%, #f9f6f1 100%);
}
.food-image--international {
  background: linear-gradient(180deg, #f0f5eb 0%, #f9f6f1 100%);
}

/* Large centered emoji that participates in the zoom (fills the visual space) */
.food-emoji {
  font-size: 4.5rem;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.12));
}

/* Bottom Details Area — generous 20px padding, contains all content + button */
.meal-card__content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.meal-card__name {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--cacao);
  line-height: 1.25;
  margin: 0 0 2px 0;
}

.meal-card__tags {
  display: flex;
  gap: 6px;
  margin-bottom: 2px;
}

.meal-card__tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cream-dark);
  color: var(--cacao-light);
  letter-spacing: 0.02em;
}

.meal-card__desc {
  font-size: var(--text-xs);
  color: var(--cacao-light);
  line-height: 1.45;
  margin: 2px 0 6px;
  /* Clamp for visual consistency across cards */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 3.1em;
}

.meal-card__calories {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
  margin-bottom: 10px;
}

.meal-card__cal-value {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--forest);
}

.meal-card__cal-unit {
  font-size: var(--text-sm);
  color: var(--cacao-light);
  font-weight: 500;
}

/* Full-width "Load Meal" button anchored at bottom of details area */
.meal-card__btn {
  width: 100%;
  justify-content: center;
  margin-top: auto;
  padding: 10px 14px;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Extra hover affordance on the card's primary CTA (complements .btn--green) */
.meal-card__btn:hover {
  opacity: 0.94;
}

/* ================================================================
   HERO BANNER CAROUSEL
   Full-bleed cinematic background images with auto-rotation.
   ================================================================ */

.hero-banner {
  position: relative;
  height: 560px;
  overflow: hidden;
  background: #1a2e1f;
}
@media (max-width: 768px) { .hero-banner { height: 500px; } }
@media (max-width: 480px) { .hero-banner { height: 520px; } }

.hero-banner__track {
  display: flex;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: transform;
}

.hero-banner__slide {
  flex: 0 0 100%;
  min-width: 100%;
  max-width: 100%;
  height: 100%;
  position: relative;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(10, 28, 15, 0.88) 0%,
    rgba(10, 28, 15, 0.55) 55%,
    rgba(10, 28, 15, 0.15) 100%
  );
}

.hero-banner__content {
  position: relative;
  z-index: 2;
  padding-bottom: 80px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: bannerFadeIn 0.6s ease both;
}
@keyframes bannerFadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-banner__chip {
  display: inline-block;
  background: rgba(241,196,15,0.15);
  color: var(--honey);
  border: 1px solid rgba(241,196,15,0.35);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: fit-content;
}

.hero-banner__title {
  font-family: var(--font-heading);
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin: 0;
}
.hero-banner__title em {
  color: var(--honey);
  font-style: italic;
}

.hero-banner__desc {
  font-size: var(--text-base);
  color: rgba(255,255,255,0.82);
  line-height: 1.65;
  max-width: 500px;
}

.hero-banner__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.btn--outline-white {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.55);
  border-radius: var(--r-full);
  padding: 0.625rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  transition: all var(--tr);
}
.btn--outline-white:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.85);
}

.hero-banner__stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.hero-banner__stat {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.65);
  font-weight: 500;
}
.hero-banner__stat span {
  color: var(--honey);
  font-weight: 700;
}
.hero-banner__stat-divider {
  color: rgba(255,255,255,0.25);
  font-size: 1.2rem;
}

/* --- Dots --- */
.hero-banner__dots {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.hero-banner__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}
.hero-banner__dot.active {
  width: 28px;
  border-radius: 4px;
  background: var(--honey);
}

/* --- Arrows --- */
.hero-banner__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--tr);
  backdrop-filter: blur(6px);
}
.hero-banner__arrow:hover { background: rgba(255,255,255,0.25); }
.hero-banner__arrow--prev { left: 20px; }
.hero-banner__arrow--next { right: 20px; }
@media (max-width: 480px) {
  .hero-banner__arrow { display: none; }
}

/* ================================================================
   FACTS TICKER — Scrolling nutrition facts strip
   ================================================================ */

.facts-ticker {
  background: var(--forest);
  padding: 10px 0;
  overflow: hidden;
  position: relative;
}
.facts-ticker::before,
.facts-ticker::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}
.facts-ticker::before { left: 0; background: linear-gradient(to right, var(--forest), transparent); }
.facts-ticker::after  { right: 0; background: linear-gradient(to left, var(--forest), transparent); }

.facts-ticker__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
  animation: tickerScroll 40s linear infinite;
  width: max-content;
}
.facts-ticker__inner:hover { animation-play-state: paused; }

@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.facts-ticker__item {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.88);
  font-weight: 500;
}
.facts-ticker__sep {
  color: var(--honey);
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ================================================================
   INTERSTITIAL SECTIONS (injected by JS between carousels)
   ================================================================ */

/* --- Health Tips Card --- */
.interstitial-tips {
  background: linear-gradient(135deg, var(--forest) 0%, #1e4429 100%);
  border-radius: var(--r-xl);
  padding: var(--sp-8) var(--sp-8);
  margin: var(--sp-6) 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-4);
  position: relative;
  overflow: hidden;
}
.interstitial-tips::before {
  content: '💡';
  position: absolute;
  right: -20px;
  top: -20px;
  font-size: 8rem;
  opacity: 0.06;
  pointer-events: none;
}
@media (max-width: 768px) {
  .interstitial-tips { grid-template-columns: 1fr; padding: var(--sp-6); }
}

.interstitial-tips__header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}
.interstitial-tips__header h3 {
  color: #fff;
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  margin: 0;
}
.interstitial-tips__header span {
  font-size: 1.5rem;
}

.tip-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  transition: background var(--tr);
  cursor: default;
}
.tip-card:hover { background: rgba(255,255,255,0.12); }

.tip-card__icon {
  font-size: 2rem;
  margin-bottom: var(--sp-3);
  display: block;
}
.tip-card__title {
  font-family: var(--font-heading);
  color: var(--honey);
  font-size: var(--text-base);
  margin-bottom: var(--sp-2);
  font-weight: 700;
}
.tip-card__body {
  color: rgba(255,255,255,0.75);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* --- Nigerian Superfoods Banner --- */
.interstitial-superfood {
  border-radius: var(--r-xl);
  overflow: hidden;
  margin: var(--sp-6) 0;
  position: relative;
  min-height: 220px;
  display: flex;
  align-items: center;
}
.interstitial-superfood__bg {
  position: absolute;
  inset: 0;
  background-image: url('../images/health-tips-banner.png');
  background-size: cover;
  background-position: center;
}
.interstitial-superfood__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(44,94,59,0.95) 40%, rgba(44,94,59,0.6) 100%);
}
.interstitial-superfood__content {
  position: relative;
  z-index: 2;
  padding: var(--sp-8) var(--sp-8);
  max-width: 520px;
}
.interstitial-superfood__content h3 {
  color: #fff;
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-3);
  line-height: 1.25;
}
.interstitial-superfood__content h3 em {
  color: var(--honey);
  font-style: italic;
}
.interstitial-superfood__content p {
  color: rgba(255,255,255,0.82);
  font-size: var(--text-base);
  line-height: 1.65;
  margin-bottom: var(--sp-5);
}
.interstitial-superfood__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.superfood-pill {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
}

/* --- Nutrition Stats Banner --- */
.interstitial-stats {
  background: var(--cream-dark);
  border: 1.5px solid var(--cream-darker);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
  margin: var(--sp-6) 0;
  text-align: center;
}
.interstitial-stats__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--forest);
  margin-bottom: var(--sp-2);
}
.interstitial-stats__sub {
  color: var(--cacao-light);
  font-size: var(--text-base);
  margin-bottom: var(--sp-8);
}
.interstitial-stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}
@media (max-width: 640px) {
  .interstitial-stats__grid { grid-template-columns: 1fr 1fr; }
}
.stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}
.stat-block__value {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--forest);
  line-height: 1;
}
.stat-block__label {
  font-size: var(--text-sm);
  color: var(--cacao-light);
  font-weight: 500;
}

/* ================================================================
   CATEGORY INTRO BANNERS
   Injected before specific carousel groups — image + text split.
   ================================================================ */

.category-intro-banner {
  border-radius: var(--r-xl);
  overflow: hidden;
  margin: var(--sp-2) 0 var(--sp-4);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 200px;
  box-shadow: var(--sh-md);
}
@media (max-width: 640px) {
  .category-intro-banner { grid-template-columns: 1fr; }
  .category-intro-banner__img { height: 180px; }
}

.category-intro-banner--right {
  direction: rtl;
}
.category-intro-banner--right > * { direction: ltr; }

.category-intro-banner__img {
  position: relative;
  overflow: hidden;
  min-height: 200px;
  background-size: cover;
  background-position: center;
}
.category-intro-banner__img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.08);
}

.category-intro-banner__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-6);
  background: var(--white);
}

.category-intro-banner--dark .category-intro-banner__body {
  background: linear-gradient(135deg, #1e3a28 0%, #2C5E3B 100%);
}

.category-intro-banner__chip {
  display: inline-block;
  background: rgba(44,94,59,0.1);
  color: var(--forest);
  border: 1px solid rgba(44,94,59,0.2);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: fit-content;
}
.category-intro-banner--dark .category-intro-banner__chip {
  background: rgba(241,196,15,0.15);
  color: var(--honey);
  border-color: rgba(241,196,15,0.3);
}

.category-intro-banner__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--cacao);
  line-height: 1.25;
  margin: 0;
}
.category-intro-banner--dark .category-intro-banner__title {
  color: #fff;
}
.category-intro-banner__title em {
  color: var(--forest);
  font-style: italic;
}
.category-intro-banner--dark .category-intro-banner__title em {
  color: var(--honey);
}

.category-intro-banner__desc {
  font-size: var(--text-sm);
  color: var(--cacao-light);
  line-height: 1.65;
  margin: 0;
}
.category-intro-banner--dark .category-intro-banner__desc {
  color: rgba(255,255,255,0.75);
}

.category-intro-banner__tips {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: 0;
  margin: 0;
}
.category-intro-banner__tip {
  font-size: var(--text-xs);
  color: var(--cacao-light);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.5;
}
.category-intro-banner--dark .category-intro-banner__tip {
  color: rgba(255,255,255,0.7);
}
.category-intro-banner__tip::before {
  content: '✓';
  color: var(--matcha);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.category-intro-banner__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  width: fit-content;
}
.category-intro-banner--dark .category-intro-banner__action {
  color: var(--honey);
}

/* ================================================================
   MODERN FOOD CATALOGUE — HORIZONTAL CAROUSELS (mob.co.uk inspired)
   Clean, appetizing, browseable rows instead of overwhelming grids.
   Reuses .meal-card for consistency + existing beautiful hover zoom.
   ================================================================ */

.quick-meals-catalogue {
  margin-top: var(--sp-6);
}

.catalogue-topbar {
  margin-bottom: var(--sp-4);
}

/* Drag-to-scroll visual feedback */
.meal-carousel.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.carousel-group {
  margin-bottom: var(--sp-10);
}

.carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  padding: 0 var(--sp-1);
}

.carousel-header__title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cacao);
  display: flex;
  align-items: center;
  gap: 10px;
}

.carousel-header__count {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--cacao-light);
  background: var(--cream-dark);
  padding: 2px 10px;
  border-radius: 999px;
}

.carousel-header__see-all {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-full);
  transition: all var(--tr-fast);
  text-decoration: none;
}

.carousel-header__see-all:hover {
  background: var(--forest);
  color: var(--white);
  transform: translateX(1px);
}

.carousel-wrapper {
  position: relative;
  padding: 4px 0 12px;
}

.meal-carousel {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 8px 4px;
  margin: 0 -4px;
  scrollbar-width: none; /* Firefox */
}

.meal-carousel::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.meal-carousel .meal-card {
  flex: 0 0 auto;
  width: 262px;
  scroll-snap-align: start;
  box-shadow: var(--sh-sm);
  border: 1px solid var(--cream-dark);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.meal-carousel .meal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
}

/* More editorial / appetizing image treatment in carousels */
.meal-carousel .image-frame {
  height: 168px; /* taller for stronger visual impact */
  box-shadow: inset 0 -20px 30px -10px rgba(0,0,0,0.06); /* subtle depth at bottom of photo */
}

/* Highlights row gets even more presence */
.carousel-group[data-group="highlights"] .meal-carousel .image-frame {
  height: 178px;
  box-shadow: inset 0 -26px 36px -12px rgba(44,94,59,0.09);
}

.carousel-group[data-group="highlights"] .carousel-header__title {
  color: var(--forest);
  font-weight: 800;
}

.carousel-group[data-group="highlights"] .carousel-header {
  border-bottom: 2px solid rgba(44, 94, 59, 0.08);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.meal-carousel .meal-card__content {
  padding: 16px;
}

.meal-carousel .meal-card__name {
  font-size: 1.02rem;
  line-height: 1.2;
}

.meal-carousel .meal-card__desc {
  font-size: 0.72rem;
  -webkit-line-clamp: 2;
  min-height: 2.1em;
}

.meal-carousel .meal-card__cal-value {
  font-size: 1.2rem;
}

.meal-carousel .meal-card__btn {
  padding: 8px 12px;
  font-size: 0.78rem;
}

/* Elegant arrow controls */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--cream-dark);
  box-shadow: var(--sh-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cacao);
  cursor: pointer;
  transition: all var(--tr-fast);
  font-size: 18px;
  line-height: 1;
  user-select: none;
}

.carousel-arrow:hover {
  background: var(--forest);
  color: var(--white);
  border-color: var(--forest);
  box-shadow: var(--sh);
  transform: translateY(-50%) scale(1.05);
}

.carousel-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.carousel-arrow.left  { left: -6px; }
.carousel-arrow.right { right: -6px; }

@media (max-width: 640px) {
  .carousel-arrow {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }
  .meal-carousel .meal-card {
    width: 230px;
  }
  .meal-carousel .image-frame {
    height: 132px;
  }
}

/* Subtle edge hint that more content exists (modern touch) */
.carousel-wrapper::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 12px;
  width: 38px;
  background: linear-gradient(to left, var(--cream), transparent);
  pointer-events: none;
  z-index: 1;
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  opacity: 0.6;
}

/* Full Collection Modal — clean, modern, handles the 160+ items gracefully */
.collection-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(44, 94, 59, 0.18);
  backdrop-filter: blur(6px);
  padding: 20px;
}

.collection-modal.open {
  display: flex;
}

.collection-modal__panel {
  background: var(--white);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 1080px;
  max-height: 92vh;
  box-shadow: var(--sh-lg);
  border: 1px solid var(--cream-dark);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.collection-modal__header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--cream-dark);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.collection-modal__title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cacao);
  flex: 1;
  min-width: 180px;
}

.collection-modal__search {
  flex: 1;
  min-width: 220px;
  max-width: 340px;
  position: relative;
}

.collection-modal__search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--r-full);
  font-size: 0.95rem;
  background: var(--cream);
}

.collection-modal__search .search-icon {
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
}

.collection-modal__filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 24px 14px;
  border-bottom: 1px solid var(--cream-dark);
  background: linear-gradient(to bottom, var(--cream), transparent);
}

.collection-modal__pill {
  font-size: 0.78rem;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--cream-dark);
  background: var(--white);
  color: var(--cacao-light);
  cursor: pointer;
  transition: all 0.15s ease;
}

.collection-modal__pill.active,
.collection-modal__pill:hover {
  background: var(--forest);
  color: white;
  border-color: var(--forest);
}

.collection-modal__body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.collection-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

/* Small result count inside modal */
.collection-modal__results-count {
  font-size: 0.8rem;
  color: var(--cacao-light);
  padding: 0 4px 8px;
}

.collection-modal__close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--cacao-light);
  cursor: pointer;
  padding: 0 4px;
}

.collection-modal__close:hover {
  color: var(--cacao);
}

/* ── CALCULATOR SECTION ──────────────────────────────────────── */
.calculator-section { background: var(--cream); }

#meal-builder {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.calculator-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: var(--sp-8);
  align-items: start;
}
@media (max-width: 1024px) {
  .calculator-layout { grid-template-columns: 1fr; }
}

/* ── SEARCH ──────────────────────────────────────────────────── */
.search-wrapper { position: relative; margin-bottom: var(--sp-4); }

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: var(--sp-4);
  width: 18px;
  height: 18px;
  color: var(--cacao-light);
  pointer-events: none;
  flex-shrink: 0;
}
.search-input {
  width: 100%;
  padding: 0.75rem var(--sp-10) 0.75rem 2.75rem;
  border: 2px solid var(--cream-dark);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  color: var(--cacao);
  background: var(--cream);
  transition: border-color var(--tr), box-shadow var(--tr);
  outline: none;
}
.search-input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(44,94,59,0.12);
  background: var(--white);
}
.search-input::placeholder { color: var(--cacao-light); }

.search-spinner {
  position: absolute;
  right: var(--sp-4);
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--cream-dark);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.search-clear {
  position: absolute;
  right: var(--sp-4);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cream-dark);
  color: var(--cacao);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--tr);
}
.search-clear:hover { background: var(--cream-darker); }
.search-clear svg { width: 12px; height: 12px; }

/* Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + var(--sp-2));
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  border: 1.5px solid var(--cream-dark);
  z-index: 50;
  max-height: 280px;
  max-height: min(45dvh, 320px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  animation: fadeIn 0.15s ease;
}
.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  cursor: pointer;
  transition: background var(--tr-fast);
  border-bottom: 1px solid var(--cream-dark);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--cream); }
.search-result-item__icon { font-size: 1.25rem; flex-shrink: 0; }
.search-result-item__info { flex: 1; min-width: 0; }
.search-result-item__name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--cacao);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-item__meta {
  font-size: var(--text-xs);
  color: var(--cacao-light);
  margin-top: 2px;
}
.search-result-item__cal {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--forest);
  white-space: nowrap;
  flex-shrink: 0;
}
.search-no-results, .search-error {
  padding: var(--sp-6);
  text-align: center;
  color: var(--cacao-light);
  font-size: var(--text-sm);
}
.search-error { color: var(--danger); }
.search-hint {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  color: var(--cacao-light);
  margin-top: var(--sp-2);
  padding: 0 var(--sp-2);
}
.search-hint svg { width: 12px; height: 12px; flex-shrink: 0; }

.fruit-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: var(--sp-2);
}
.fruit-search-chips__label {
  font-size: var(--text-xs);
  color: var(--cacao-light);
  margin-right: 0.15rem;
}
.fruit-search-chip {
  border: 1px solid rgba(44, 94, 59, 0.16);
  background: rgba(126, 159, 61, 0.1);
  color: var(--forest);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.fruit-search-chip:hover,
.fruit-search-chip:focus-visible {
  background: rgba(44, 94, 59, 0.12);
  border-color: rgba(44, 94, 59, 0.28);
  outline: none;
}

/* ── QUICK MEAL BANNER ───────────────────────────────────────── */
.quick-meal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(44,94,59,0.08);
  border: 1.5px solid rgba(44,94,59,0.2);
  border-radius: var(--r);
  margin-bottom: var(--sp-4);
  animation: slideIn 0.3s ease;
}
.quick-meal-banner__info {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--forest);
  min-width: 0;
}
.quick-meal-banner__info svg { width: 16px; height: 16px; flex-shrink: 0; }
.quick-meal-banner__clear {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--cacao-light);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  border: 1px solid var(--cream-dark);
  background: var(--white);
  transition: all var(--tr-fast);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.quick-meal-banner__clear svg { width: 12px; height: 12px; }
.quick-meal-banner__clear:hover { border-color: var(--danger); color: var(--danger); }

/* ── INGREDIENT LIST ─────────────────────────────────────────── */
.ingredient-list {
  min-height: 120px;
  max-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  margin-bottom: var(--sp-4);
  scrollbar-width: thin;
  scrollbar-color: var(--cream-darker) transparent;
}
.ingredient-list::-webkit-scrollbar { width: 4px; }
.ingredient-list::-webkit-scrollbar-thumb { background: var(--cream-darker); border-radius: 4px; }

.ingredient-list__empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--cacao-light);
}
.ingredient-list__empty-icon { font-size: 2.5rem; margin-bottom: var(--sp-3); }
.ingredient-list__empty p { font-size: var(--text-sm); line-height: 1.5; }

/* Ingredient Item */
.ingredient-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--cream);
  border-radius: var(--r);
  margin-bottom: var(--sp-2);
  border: 1.5px solid var(--cream-dark);
  animation: slideIn 0.25s ease;
  transition: border-color var(--tr-fast);
}
.ingredient-item:hover { border-color: var(--cream-darker); }
.ingredient-item__emoji { font-size: 1.25rem; flex-shrink: 0; }
.ingredient-item__info { flex: 1; min-width: 0; }
.ingredient-item__name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--cacao);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ingredient-item__qty {
  font-size: var(--text-xs);
  color: var(--cacao-light);
  margin-top: 1px;
}
.ingredient-item__cal {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--forest);
  white-space: nowrap;
  flex-shrink: 0;
}
.ingredient-item__remove {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cacao-light);
  transition: all var(--tr-fast);
  flex-shrink: 0;
  cursor: pointer;
}
.ingredient-item__remove svg { width: 14px; height: 14px; }
.ingredient-item__remove:hover { background: rgba(231,76,60,0.1); color: var(--danger); }

/* Quick Meal ingredient item (read-only) */
.ingredient-item--quickmeal {
  opacity: 0.85;
  border-style: dashed;
}

/* ── RUNNING TOTAL ───────────────────────────────────────────── */
.running-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: rgba(44,94,59,0.06);
  border-radius: var(--r);
  margin-bottom: var(--sp-4);
  border: 1.5px solid rgba(44,94,59,0.12);
}
.running-total__main {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--cacao);
}
.running-total__main svg { width: 16px; height: 16px; color: var(--honey-dark); }
.running-total__label { font-weight: 500; }
.running-total__value { font-weight: 700; color: var(--forest); }
.running-total__count { font-size: var(--text-xs); color: var(--cacao-light); }

/* ── BUILDER ACTIONS ─────────────────────────────────────────── */
.builder-actions { display: flex; flex-direction: column; gap: var(--sp-3); }
.analyze-hint {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--cacao-light);
  margin-top: calc(-1 * var(--sp-2));
}

/* ── RESULTS EMPTY ───────────────────────────────────────────── */
.results-empty {
  text-align: center;
  padding: var(--sp-12) var(--sp-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}
.results-empty__art {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: var(--sp-2);
}
.results-empty__icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  z-index: 2;
}
.results-empty__rings { position: absolute; inset: 0; }
.results-empty__ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(44,94,59,0.12);
  animation: pulse 3s ease infinite;
}
.results-empty__ring--1 { inset: 5px; animation-delay: 0s; }
.results-empty__ring--2 { inset: 15px; animation-delay: 0.5s; }
.results-empty__ring--3 { inset: 25px; animation-delay: 1s; }

.results-empty h3 { color: var(--cacao); }
.results-empty p { color: var(--cacao-light); max-width: 280px; font-size: var(--text-sm); }

.results-empty__features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  justify-content: center;
  margin-top: var(--sp-2);
}
.results-empty__feature {
  background: var(--cream-dark);
  border-radius: var(--r-full);
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
  color: var(--cacao);
  font-weight: 500;
}

/* ── RESULTS LOADING ─────────────────────────────────────────── */
.results-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-12);
  text-align: center;
  color: var(--cacao-light);
  font-size: var(--text-sm);
}
.results-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--cream-dark);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── RESULT SOURCE BANNER ────────────────────────────────────── */
.result-source-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(241,196,15,0.1);
  border: 1.5px solid rgba(241,196,15,0.35);
  border-radius: var(--r);
  font-size: var(--text-sm);
  color: #8a6e00;
  margin-bottom: var(--sp-5);
}
.result-source-banner svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── RESULTS CONTENT ─────────────────────────────────────────── */
.results-content { display: flex; flex-direction: column; gap: var(--sp-5); }

/* ── CALORIES CARD ───────────────────────────────────────────── */
.calories-card {
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-light) 100%);
  border: none;
  color: var(--white);
}
.calories-card .panel__section-title { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.15); }
.calories-card:hover { box-shadow: var(--sh-lg); }

.calories-card__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.calories-card__icon { font-size: 3rem; flex-shrink: 0; }
.calories-card__main { flex: 1; }
.calories-card__value {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  line-height: 1;
}
.calories-card__value span:first-child {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--white);
}
.calories-card__unit {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.7);
  font-weight: 400;
}
.calories-card__label {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.7);
  margin-top: var(--sp-1);
}
.calories-card__rating {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 700;
  background: rgba(255,255,255,0.15);
  color: var(--white);
  white-space: nowrap;
}

.calories-breakdown {
  display: flex;
  gap: var(--sp-6);
  flex-wrap: wrap;
  padding-top: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,0.15);
}
.cal-source {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.8);
}
.cal-source__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-source__dot--protein { background: #74b9ff; }
.cal-source__dot--carbs   { background: var(--honey); }
.cal-source__dot--fat     { background: #fdcb6e; }
.cal-source strong { color: var(--white); margin-left: 2px; }

/* ── MACROS PANEL ────────────────────────────────────────────── */
.macros-layout {
  display: flex;
  gap: var(--sp-6);
  align-items: center;
}
@media (max-width: 500px) { .macros-layout { flex-direction: column; } }

.macro-chart-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.macro-chart-wrapper canvas { width: 100% !important; height: 100% !important; }
.macro-chart-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
#macro-chart-total {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--cacao);
}
.macro-chart-center__label {
  font-size: var(--text-xs);
  color: var(--cacao-light);
}

.macro-bars { flex: 1; display: flex; flex-direction: column; gap: var(--sp-4); }

.macro-bar-item {}
.macro-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-1);
}
.macro-bar-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--cacao);
}
.macro-bar-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.macro-bar-values {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: var(--text-sm);
}
.macro-bar-val { font-weight: 700; color: var(--cacao); }
.macro-bar-dv  { font-size: var(--text-xs); color: var(--cacao-light); }

.macro-bar-track {
  height: 8px;
  background: var(--cream-dark);
  border-radius: var(--r-full);
  overflow: hidden;
}
.macro-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  width: 0%;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── HEALTH SCORE ────────────────────────────────────────────── */
.health-score {
  display: flex;
  gap: var(--sp-6);
  align-items: center;
}
@media (max-width: 480px) { .health-score { flex-direction: column; } }

.health-score__ring-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}
.health-score__svg { width: 100%; height: 100%; }
.health-score__number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-direction: column;
}
.health-score__value {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--forest);
  line-height: 1;
}
.health-score__max {
  font-size: var(--text-xs);
  color: var(--cacao-light);
}

.health-score__info { flex: 1; }
.health-score__grade {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--forest);
  margin-bottom: var(--sp-2);
}
.health-score__desc {
  font-size: var(--text-sm);
  color: var(--cacao-light);
  line-height: 1.5;
  margin-bottom: var(--sp-4);
}
.health-score__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  color: var(--cacao-light);
}
.legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── PROS & CONS ─────────────────────────────────────────────── */
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
@media (max-width: 480px) { .pros-cons { grid-template-columns: 1fr; } }

.pros-cons__header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 700;
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-3);
  border-bottom: 2px solid currentColor;
}
.pros-cons__header svg { width: 16px; height: 16px; }
.pros-cons__header--pros { color: var(--success); }
.pros-cons__header--cons { color: var(--warning); }

.pros-cons__list { display: flex; flex-direction: column; gap: var(--sp-2); }
.pros-cons__item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--cacao);
  line-height: 1.4;
  animation: fadeInUp 0.3s ease both;
}
.pros-cons__item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.pros-cons__item--pro::before { background: var(--success); }
.pros-cons__item--con::before { background: var(--warning); }

/* ── MICRONUTRIENTS ──────────────────────────────────────────── */
.micros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-4);
}
.micro-item {
  background: var(--cream);
  border-radius: var(--r);
  padding: var(--sp-4);
  border: 1px solid var(--cream-dark);
  transition: border-color var(--tr-fast);
}
.micro-item:hover { border-color: var(--matcha); }
.micro-item__label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--cacao-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-2);
}
.micro-item__value {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--cacao);
  margin-bottom: var(--sp-2);
}
.micro-item__value span { font-size: var(--text-xs); font-weight: 400; color: var(--cacao-light); }
.micro-item__track {
  height: 4px;
  background: var(--cream-dark);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: var(--sp-1);
}
.micro-item__fill {
  height: 100%;
  border-radius: var(--r-full);
  width: 0%;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.micro-item__dv { font-size: var(--text-xs); color: var(--cacao-light); }

/* ── SMART TIPS ──────────────────────────────────────────────── */
.tips-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.tip-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--cream);
  border-radius: var(--r);
  border-left: 3px solid var(--matcha);
  font-size: var(--text-sm);
  color: var(--cacao);
  line-height: 1.5;
  animation: fadeInUp 0.3s ease both;
}
.tip-item__icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ── FOOTER ──────────────────────────────────────────────────── */
.footer {
  background: var(--cacao-dark);
  color: rgba(255, 255, 255, 0.82);
  margin-top: auto;
  border-top: 3px solid var(--matcha);
}
.footer__main {
  padding: var(--sp-12) 0 var(--sp-10);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, 1fr);
  gap: var(--sp-8) var(--sp-6);
  align-items: start;
}
.footer__brand-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  margin-bottom: var(--sp-4);
  transition: color var(--tr-fast);
}
.footer__brand-link:hover { color: var(--honey); }
.footer__tagline {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.68);
  max-width: 280px;
  margin: 0;
}
.footer__heading {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--honey);
  margin: 0 0 var(--sp-4);
}
.footer__nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.footer__nav a {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color var(--tr-fast);
}
.footer__nav a:hover {
  color: var(--matcha-light);
}
.footer__bottom {
  padding: var(--sp-5) 0;
  background: rgba(0, 0, 0, 0.12);
}
.footer__bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.footer__copyright {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}
.footer__disclaimer {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
  text-align: right;
  max-width: 520px;
  line-height: 1.5;
}
/* Footer contact — links only (form lives on About) */
.footer__col--contact .footer__nav a[href^="mailto:"] {
  word-break: break-all;
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer__brand-col {
    grid-column: 1 / -1;
  }
  .footer__tagline { max-width: none; }
}
@media (max-width: 540px) {
  .footer__main { padding: var(--sp-10) 0 var(--sp-8); }
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
  .footer__bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .footer__disclaimer { text-align: left; }
}

/* ── MODAL ───────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(44,64,50,0.5);
  backdrop-filter: blur(4px);
}
.modal__content {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  width: 100%;
  max-width: 440px;
  animation: scaleIn 0.2s ease;
}
.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--sp-6);
  border-bottom: 1px solid var(--cream-dark);
}
.modal__subtitle {
  font-size: var(--text-xs);
  color: var(--cacao-light);
  margin-bottom: 2px;
}
.modal__title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  color: var(--cacao);
  line-height: 1.3;
  font-weight: 600;
  max-width: 280px;
}
.modal__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cacao-light);
  transition: all var(--tr-fast);
  flex-shrink: 0;
  cursor: pointer;
}
.modal__close svg { width: 18px; height: 18px; }
.modal__close:hover { background: var(--cream-dark); color: var(--cacao); }

.modal__body { padding: var(--sp-6); }
.modal__form-row {
  display: flex;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.modal__preview {
  background: var(--cream);
  border-radius: var(--r);
  padding: var(--sp-4);
  border: 1px solid var(--cream-dark);
}
.modal__preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--cream-dark);
}
.modal__preview-row:last-child { border-bottom: none; }
.modal__preview-row span { color: var(--cacao-light); }
.modal__preview-row strong { color: var(--cacao); }

/* ── LOCAL UNIT HINT ─────────────────────────────────────── */
.unit-hint {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--cacao-light);
  background: rgba(44, 94, 59, 0.06);
  border: 1px solid rgba(44, 94, 59, 0.15);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  margin-bottom: var(--sp-3);
  min-height: 2.2rem;
  transition: all 0.2s ease;
}
.unit-hint:empty { display: none; }
.unit-hint__gram {
  font-weight: 700;
  color: var(--forest);
  font-size: 0.82rem;
}
.unit-hint__desc {
  color: var(--cacao-light);
}
.unit-hint__desc strong {
  color: var(--cacao);
  font-weight: 600;
}

.modal__footer {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--cream-dark);
}

/* ── LOADING SPINNER (reusable) ──────────────────────────────── */
.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--cream-dark);
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0);     }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1);    }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 0.2; transform: scale(1.05); }
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  /* Tablet: 2 cards per row */
  .meals-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .section { padding: var(--sp-12) 0; }
  .hero { padding: var(--sp-12) 0 var(--sp-10); }
  .hero__stats { gap: var(--sp-4); }
  .macros-layout { flex-direction: column; align-items: flex-start; }
  .macro-chart-wrapper { margin: 0 auto; }
  .modal__form-row { flex-direction: column; }
  .calories-card__inner { flex-wrap: wrap; }

  /* Better tablet experience */
  .panel { padding: var(--sp-5); }
  .results { padding: var(--sp-5); }
}

@media (max-width: 600px) {
  /* Mobile: 1 card per row */
  .meals-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Slightly more compact image frame on phones */
  .image-frame {
    height: 140px;
  }
  .food-emoji {
    font-size: 3.75rem;
  }
  .meal-card__content {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  h1 { font-size: var(--text-3xl); }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { text-align: center; justify-content: center; }
  .hero__title { font-size: var(--text-3xl); line-height: 1.1; }
  .hero__subtitle { font-size: var(--text-base); }
  .tabs { gap: var(--sp-1); padding: 3px; }
  .tab { padding: 0.4rem 0.875rem; font-size: var(--text-xs); }
  .panel { padding: var(--sp-4); }
  .micros-grid { grid-template-columns: 1fr 1fr; }

  /* Extra small phone polish */
  .search-input { font-size: var(--text-base); padding: 0.75rem var(--sp-10) 0.75rem 2.75rem; }
  .ingredient-item { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
  .ingredient-item__actions { width: 100%; justify-content: flex-end; }
  .quick-meal-banner { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }

  /* Search and results on tiny screens */
  .search-result-item { padding: var(--sp-3); }
  .search-result-item__meta { font-size: 10px; }
}

/* ================================================================
   DASHBOARD — LAYOUT, HISTORY CARDS, SIDEBAR CARDS
   ================================================================ */

/* Dashboard layout wrapper */
.dash-layout {
  background: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.dash-layout > main {
  flex: 1;
}

/* Dashboard header */
.dash-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--cream-dark);
  box-shadow: 0 2px 12px rgba(44,94,59,0.08);
}
.dash-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

/* Dashboard nav */
.dash-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.dash-nav a {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--cacao-light);
  transition: all var(--tr);
}
.dash-nav a:hover { background: var(--cream); color: var(--cacao); }
.dash-nav a.active {
  background: rgba(44,94,59,0.1);
  color: var(--forest);
  font-weight: 600;
}

/* Dash user area */
.dash-user {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.dash-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--forest), var(--matcha));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

/* Mobile menu button */
.dash-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  color: var(--cacao);
  transition: background var(--tr-fast);
}
.dash-menu-btn:hover { background: var(--cream); }
.dash-menu-btn svg { width: 20px; height: 20px; }

/* Dashboard main content */
.dash-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
}

/* Dashboard 2-col grid */
.dash-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--sp-6);
  align-items: start;
}

/* Dashboard sidebar + content */
.dash-sidebar { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.dash-content { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }

/* Dashboard card */
.dash-card {
  background: var(--white);
  border-radius: var(--r-lg);
  border: 1px solid var(--cream-dark);
  box-shadow: var(--sh-xs);
  overflow: hidden;
  transition: box-shadow var(--tr);
}
.dash-card:hover { box-shadow: var(--sh-sm); }
.dash-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--cream-dark);
}
.dash-card__title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--forest);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-card__title svg { width: 16px; height: 16px; }

/* Health Hub AI chat */
.grok-chat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.grok-chat__messages {
  min-height: 160px;
  max-height: 280px;
  overflow-y: auto;
  padding: var(--sp-3);
  background: rgba(255, 255, 255, 0.55);
  border-radius: var(--r-lg);
  font-size: var(--text-sm);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  -webkit-overflow-scrolling: touch;
}
.grok-chat__bubble {
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 92%;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.grok-chat__bubble--user {
  background: var(--honey);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.grok-chat__bubble--ai {
  background: rgba(44, 94, 59, 0.1);
  color: var(--forest);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.grok-chat__thinking { font-style: italic; opacity: 0.85; }
.grok-chat__quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.grok-chat__quick-replies[hidden] {
  display: none !important;
}
.grok-chat__chip {
  border: 1px solid rgba(44, 94, 59, 0.25);
  background: rgba(44, 94, 59, 0.06);
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: var(--font-body);
}
.grok-chat__chip:hover {
  background: rgba(44, 94, 59, 0.14);
}
.grok-chat__chip:active { transform: scale(0.97); }
.grok-chat__input {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  width: 100%;
}
.grok-chat__field {
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 48px;
  max-height: 120px;
  resize: none;
  overflow-y: auto;
  overflow-x: hidden;
  line-height: 1.45;
  padding: 12px 14px !important;
  white-space: pre-wrap;
  word-break: break-word;
  field-sizing: content;
}
.grok-chat__send {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 0 !important;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.grok-chat__send svg,
.grok-chat__send i {
  width: 20px;
  height: 20px;
}

/* Dashboard empty state */
.dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-10) var(--sp-6);
  text-align: center;
  color: var(--cacao-light);
}
.dash-empty svg { width: 32px; height: 32px; opacity: 0.4; }
.dash-empty p { font-size: var(--text-sm); }

/* Progress rings */
.progress-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
  padding: var(--sp-5);
}
.progress-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  text-align: center;
}
.progress-ring {
  position: relative;
  width: 80px;
  height: 80px;
}
.progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.progress-ring circle.bg {
  fill: none;
  stroke: var(--cream-dark);
  stroke-width: 8;
}
.progress-ring circle.fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(0.4,0,0.2,1);
}
.progress-ring--cal circle.fill { stroke: var(--danger); }
.progress-ring--pro circle.fill { stroke: var(--clr-protein); }
.progress-ring--crb circle.fill { stroke: var(--clr-carbs); }
.progress-ring--fat circle.fill { stroke: var(--clr-fat); }

.progress-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--cacao);
}
.progress-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--cacao);
}
.progress-sub {
  font-size: 10px;
  color: var(--cacao-light);
  margin-top: -4px;
}

/* History list */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* History item card */
.history-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--cream-dark);
  cursor: pointer;
  transition: background var(--tr-fast), transform var(--tr-fast);
  position: relative;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover {
  background: rgba(44,94,59,0.035);
}
.history-item::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--forest);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transform: scaleY(0.5);
  transition: opacity var(--tr-fast), transform var(--tr-fast);
}
.history-item:hover::after {
  opacity: 1;
  transform: scaleY(1);
}

.history-item__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  background: rgba(44,94,59,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  overflow: hidden;
}
.history-item__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.history-item__info { flex: 1; min-width: 0; }
.history-item__name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--cacao);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.history-item__meta {
  font-size: var(--text-xs);
  color: var(--cacao-light);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.history-item__cals {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--forest);
  white-space: nowrap;
  flex-shrink: 0;
}
.history-item__chevron {
  color: var(--cream-darker);
  flex-shrink: 0;
  transition: transform var(--tr-fast), color var(--tr-fast);
}

/* === Horizontal Recent Meals scroller (dashboard) === */
.recent-scroller-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  color: var(--cacao-light);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.recent-scroller {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.recent-scroller::-webkit-scrollbar { display: none; }

.recent-card {
  flex: 0 0 168px;
  scroll-snap-align: start;
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--sh-xs);
  cursor: pointer;
  transition: transform .2s cubic-bezier(0.4,0,0.2,1), box-shadow .2s;
  font-size: 13px;
}
.recent-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-sm);
}
.recent-card__image {
  height: 92px;
  width: 100%;
  background: #f4f1e9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.recent-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-card__emoji {
  font-size: 2.1rem;
  line-height: 1;
}
.recent-card__body {
  padding: 8px 10px 10px;
}
.recent-card__name {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.25;
  color: var(--cacao);
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: normal;
  overflow-wrap: break-word;
}
.recent-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}
.recent-card__cals {
  font-weight: 700;
  color: var(--forest);
}
.recent-card__score {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(44,94,59,0.08);
  color: var(--forest);
}
.history-item__chevron svg { width: 16px; height: 16px; }
.history-item:hover .history-item__chevron {
  transform: translateX(3px);
  color: var(--forest);
}

/* Recommendation cards */
.rec-card {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r);
  margin: var(--sp-2) var(--sp-4);
  font-size: var(--text-xs);
  line-height: 1.5;
}
.rec-card--info  { background: rgba(52,152,219,0.08); color: #1a6fa8; }
.rec-card--success { background: rgba(39,174,96,0.08); color: #1e6e3a; }
.rec-card--warning { background: rgba(230,126,34,0.08); color: #a05010; }
.rec-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.rec-text { flex: 1; }

/* ================================================================
   MEAL DETAIL MODAL — PREMIUM REDESIGN
   ================================================================ */

/* Modal overlay fix */
#meal-detail-modal {
  background: rgba(30,50,40,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Modal content box */
#meal-detail-modal .modal__content {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  box-shadow: 0 24px 80px rgba(30,50,40,0.35);
  width: 100%;
  max-width: 820px;
  /* CRITICAL: use height (not just max-height) so flex children get a real bounded height to scroll within */
  height: 90vh;
  max-height: 90vh;
}

/* Close button */
#modal-close-btn {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: var(--white);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--tr-fast);
  z-index: 10;
  line-height: 1;
}
#modal-close-btn:hover { background: rgba(255,255,255,0.35); }

/* ── Modal Hero Header ── */
#modal-header {
  background: linear-gradient(135deg, var(--forest-dark) 0%, var(--forest) 50%, var(--forest-light) 100%);
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
  position: relative;
  overflow: hidden;
}
#modal-header::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
#modal-header::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -30px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
#modal-meal-name {
  color: var(--white);
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 700;
  margin: 0 0 var(--sp-2);
  line-height: 1.2;
  position: relative;
  z-index: 1;
  padding-right: var(--sp-10);
}
#modal-meal-meta {
  color: rgba(255,255,255,0.7);
  font-size: var(--text-xs);
  letter-spacing: 0.03em;
  position: relative;
  z-index: 1;
  margin-bottom: var(--sp-5);
}

/* Header stats strip (score + cals) */
.meal-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(255,255,255,0.12);
  border-radius: var(--r-lg);
  backdrop-filter: blur(4px);
  margin-top: var(--sp-1);
  position: relative;
  z-index: 1;
}
#modal-score .badge {
  font-size: var(--text-xs);
  padding: var(--sp-1) var(--sp-3);
}
#modal-cals {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white) !important;
}
#modal-cals strong { font-weight: 900; }

/* Scrollable modal body */
.modal-body-scroll {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  scrollbar-width: thin;
  scrollbar-color: var(--cream-darker) transparent;
}
.modal-body-scroll::-webkit-scrollbar { width: 5px; }
.modal-body-scroll::-webkit-scrollbar-thumb { background: var(--cream-darker); border-radius: 4px; }

/* ── Section Cards ── */
.meal-detail-section {
  background: var(--cream);
  border-radius: var(--r-lg);
  border: 1px solid var(--cream-dark);
  overflow: hidden;
  transition: box-shadow var(--tr);
}
.meal-detail-section:hover { box-shadow: var(--sh-sm); }

.meal-detail-section--success {
  background: rgba(39,174,96,0.04);
  border-color: rgba(39,174,96,0.2);
}
.meal-detail-section--warning {
  background: rgba(230,126,34,0.04);
  border-color: rgba(230,126,34,0.2);
}

.meal-detail-section__header {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.6);
}
.meal-detail-section__header h3 {
  font-size: var(--text-base);
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--cacao);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.meal-detail-section--success .meal-detail-section__header h3 { color: #1e6e3a; }
.meal-detail-section--warning .meal-detail-section__header h3 { color: #a05010; }

/* ── Macros Grid ── */
.meal-macros-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: var(--sp-4);
  gap: var(--sp-3);
}

.meal-macro-card {
  border-radius: var(--r-md);
  overflow: hidden;
  text-align: center;
  border: 1.5px solid transparent;
  transition: transform var(--tr), box-shadow var(--tr);
  background: var(--white);
}
.meal-macro-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-sm);
}

/* Color-coded top bar per macro */
.meal-macro-card::before {
  content: '';
  display: block;
  height: 5px;
  width: 100%;
}
.meal-macro-card--protein { border-color: rgba(52,152,219,0.25); }
.meal-macro-card--protein::before { background: linear-gradient(90deg, #3498db, #5dade2); }
.meal-macro-card--carbs   { border-color: rgba(241,196,15,0.35); }
.meal-macro-card--carbs::before   { background: linear-gradient(90deg, #F1C40F, #f7dc6f); }
.meal-macro-card--fat     { border-color: rgba(230,126,34,0.3); }
.meal-macro-card--fat::before     { background: linear-gradient(90deg, #e67e22, #f0a34e); }
.meal-macro-card--fiber   { border-color: rgba(44,94,59,0.25); }
.meal-macro-card--fiber::before   { background: linear-gradient(90deg, #2C5E3B, #3d7a50); }

.meal-macro-card__inner {
  padding: var(--sp-4) var(--sp-3) var(--sp-3);
}
.meal-macro-value {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 2px;
  color: var(--cacao);
}
.meal-macro-card--protein .meal-macro-value { color: #2980b9; }
.meal-macro-card--carbs   .meal-macro-value { color: #b7950b; }
.meal-macro-card--fat     .meal-macro-value { color: #ca6f1e; }
.meal-macro-card--fiber   .meal-macro-value { color: var(--forest); }

.meal-macro-unit {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--cacao-light);
  margin-left: 1px;
}
.meal-macro-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--cacao);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.meal-macro-desc {
  font-size: 10px;
  color: var(--cacao-light);
  line-height: 1.3;
}

/* ── Pros / Cons Lists ── */
.meal-list {
  list-style: none;
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.meal-list__item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r);
  font-size: var(--text-sm);
  color: var(--cacao);
  line-height: 1.5;
  position: relative;
  transition: background var(--tr-fast);
}
.meal-list__item:hover { background: rgba(0,0,0,0.03); }

.meal-list__item--success {
  background: rgba(39,174,96,0.06);
  border-left: 3px solid #27ae60;
  color: #1a4d2a;
  padding-left: var(--sp-3);
}
.meal-list__item--success::before {
  content: '✓';
  font-weight: 700;
  color: #27ae60;
  flex-shrink: 0;
  font-size: 0.85rem;
  margin-top: 1px;
}

.meal-list__item--warning {
  background: rgba(230,126,34,0.06);
  border-left: 3px solid #e67e22;
  color: #5a3010;
  padding-left: var(--sp-3);
}
.meal-list__item--warning::before {
  content: '!';
  font-weight: 900;
  color: #e67e22;
  flex-shrink: 0;
  font-size: 0.85rem;
  width: 16px;
  height: 16px;
  background: rgba(230,126,34,0.15);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* Strip the bullet "•" from JS-rendered items since we add pseudo-elements */
.meal-list__item--success,
.meal-list__item--warning {
  /* JS adds "• text" — we hide the dot with text-indent trick */
}

/* ── Micronutrients Grid ── */
.meal-micros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--sp-3);
  padding: var(--sp-4);
}
.meal-micro-card {
  background: var(--white);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--cream-dark);
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
  position: relative;
  overflow: hidden;
}
.meal-micro-card:hover {
  border-color: var(--matcha);
  box-shadow: var(--sh-xs);
}
.meal-micro-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--matcha), var(--forest));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1);
}
.meal-micro-card:hover::after { transform: scaleX(1); }

.meal-micro-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--cacao-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-2);
}
.meal-micro-value {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--cacao);
  line-height: 1.1;
  margin-bottom: var(--sp-1);
}
.meal-micro-unit {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--cacao-light);
  margin-left: 2px;
}

/* Mini DV progress bar */
.meal-micro-card .micro-bar {
  height: 3px;
  background: var(--cream-dark);
  border-radius: var(--r-full);
  overflow: hidden;
  margin: var(--sp-2) 0 var(--sp-1);
}
.meal-micro-card .micro-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--matcha), var(--forest));
  border-radius: var(--r-full);
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
}

.meal-micro-pct {
  font-size: 10px;
  color: var(--cacao-light);
}

/* ── Smart Tips (inside modal) ── */
.meal-detail-section .meal-list .meal-list__item {
  background: rgba(255,255,255,0.7);
  border-radius: var(--r);
  border: 1px solid var(--cream-dark);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  line-height: 1.5;
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
.meal-detail-section .meal-list .meal-list__item:hover {
  border-color: var(--matcha);
  box-shadow: var(--sh-xs);
  background: var(--white);
}

/* ── Modal Footer Buttons ── */
.modal-footer-btns {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-6);
  border-top: 1px solid var(--cream-dark);
  background: var(--white);
}
.modal-footer-btns .btn { flex: 1; justify-content: center; }

/* ── Responsive: Modal ── */
@media (max-width: 640px) {
  .meal-macros-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .meal-micros-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  #modal-meal-name { font-size: 1.25rem; }
  .meal-detail-header { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
}

/* ── Responsive: Dashboard Grid ── */
@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-sidebar { order: 2; }
  .dash-content { order: 1; }
}
@media (max-width: 640px) {
  .dash-header__inner { padding: 0 var(--sp-4); }
  .dash-main { padding: var(--sp-5) var(--sp-4); }
  .dash-user span { display: none; }
  .dash-menu-btn { display: flex; }
  .dash-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--cream-dark);
    flex-direction: column;
    align-items: stretch;
    padding: var(--sp-3) var(--sp-4);
    box-shadow: var(--sh-sm);
    z-index: 99;
    gap: var(--sp-1);
  }
  .dash-nav.open {
    display: flex;
    animation: slideDown 0.2s ease;
  }
  .dash-nav a {
    border-radius: var(--r);
    padding: var(--sp-3) var(--sp-4);
  }
  .progress-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ================================================================
   DRINKS & SNACKS EXPANSION
   ================================================================ */

/* ── Card gradient backgrounds for drink / snack fallback ─── */
.food-image--drinks {
  background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 40%, #22d3ee 100%);
}
.food-image--snacks {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 50%, #ef4444 100%);
}

/* ── Drink & Snack tab accent colors ─── */
.tab--drinks {
  --tab-accent: #0ea5e9;
}
.tab--drinks.tab--active,
.tab--drinks:hover {
  color: #0ea5e9;
  border-bottom-color: #0ea5e9;
}
.tab--snacks {
  --tab-accent: #f59e0b;
}
.tab--snacks.tab--active,
.tab--snacks:hover {
  color: #f59e0b;
  border-bottom-color: #f59e0b;
}

/* ── Category Callout Banner (above tabs) ─── */
.category-callout {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--white);
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: var(--sp-6);
  box-shadow: 0 2px 12px rgba(44,94,59,0.06);
}
.category-callout__item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  transition: background 0.2s;
}
.category-callout__item:hover {
  background: var(--cream-lighter);
}
.category-callout__item--meals {
  border-left: 4px solid var(--forest);
}
.category-callout__item--drinks {
  border-left: 4px solid #0ea5e9;
}
.category-callout__item--snacks {
  border-left: 4px solid #f59e0b;
}
.category-callout__icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}
.category-callout__item div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.category-callout__item strong {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--cacao);
  font-family: var(--font-body);
}
.category-callout__item span {
  font-size: var(--text-xs);
  color: var(--cacao-light);
  line-height: 1.3;
}
.category-callout__divider {
  width: 1px;
  background: var(--cream-dark);
  flex-shrink: 0;
}

/* ── Calculator section hint banner ─── */
.calc-hint-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(90deg, rgba(44,94,59,0.04) 0%, rgba(14,165,233,0.04) 50%, rgba(245,158,11,0.04) 100%);
  border: 1px solid var(--cream-dark);
  border-radius: var(--r-lg);
}
.calc-hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-body);
}
.calc-hint-chip--meal {
  background: rgba(44,94,59,0.1);
  color: var(--forest);
  border: 1px solid rgba(44,94,59,0.2);
}
.calc-hint-chip--drink {
  background: rgba(14,165,233,0.1);
  color: #0369a1;
  border: 1px solid rgba(14,165,233,0.25);
}
.calc-hint-chip--snack {
  background: rgba(245,158,11,0.12);
  color: #b45309;
  border: 1px solid rgba(245,158,11,0.3);
}
.calc-hint-sep {
  color: var(--cream-darker);
  font-size: var(--text-sm);
  font-weight: 400;
}
.calc-hint-text {
  font-size: var(--text-xs);
  color: var(--cacao-light);
  font-style: italic;
}

/* ── Category pill badges on drink/snack cards ─── */
.meal-card__category-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}
.meal-card__category-pill--drinks {
  background: rgba(14,165,233,0.12);
  color: #0369a1;
  border: 1px solid rgba(14,165,233,0.25);
}
.meal-card__category-pill--snacks {
  background: rgba(245,158,11,0.12);
  color: #b45309;
  border: 1px solid rgba(245,158,11,0.3);
}

/* ── Teal button for drinks ─── */
.btn--teal {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: var(--white);
  border-color: transparent;
}
.btn--teal:hover:not(:disabled) {
  background: linear-gradient(135deg, #0284c7, #0891b2);
  box-shadow: 0 4px 14px rgba(14,165,233,0.3);
  transform: translateY(-1px);
}

/* ── Amber button for snacks ─── */
.btn--amber {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: var(--white);
  border-color: transparent;
}
.btn--amber:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706, #ea580c);
  box-shadow: 0 4px 14px rgba(245,158,11,0.3);
  transform: translateY(-1px);
}

/* ── Responsive: stack category callout on mobile ─── */
@media (max-width: 640px) {
  .category-callout {
    flex-direction: column;
  }
  .category-callout__divider {
    width: 100%;
    height: 1px;
  }
  .category-callout__item--meals,
  .category-callout__item--drinks,
  .category-callout__item--snacks {
    border-left: none;
    border-top: 4px solid;
  }
  .category-callout__item--meals  { border-color: var(--forest); }
  .category-callout__item--drinks { border-color: #0ea5e9; }
  .category-callout__item--snacks { border-color: #f59e0b; }

  .calc-hint-banner {
    justify-content: center;
    text-align: center;
  }
}

\n

/* ─── DAILY LOGIN STREAK UI (PREMIUM) ───────────────────────── */
.dash-streak {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--cream);
  border: 1px solid var(--cream-darker);
  padding: 4px 10px;
  border-radius: var(--r-full);
  margin-right: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #ff7b00;
  box-shadow: var(--sh-sm);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dash-streak.pulse {
  animation: streakPulse 0.5s ease;
}

@keyframes streakPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* Modal Overlay & Base Particles */
.streak-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 20, 15, 0.6); /* Dark semi-transparent overlay */
  backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
}

.streak-modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Background Confetti Container (Static/Slow drift) */
.streak-bg-confetti {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1s ease;
}
.streak-modal-overlay.visible .streak-bg-confetti {
  opacity: 0.6;
}

/* Premium Modal Card */
.streak-modal {
  background: #fdfdf9; /* Warm off-white */
  border-radius: 24px;
  padding: 56px 24px 20px;
  text-align: center;
  width: 100%;
  max-width: 420px;
  max-height: min(88dvh, 640px);
  box-shadow: 0 30px 60px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.5) inset;
  transform: translateY(40px) scale(0.95);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 10;
  margin-top: 44px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.streak-modal-overlay.visible .streak-modal {
  transform: translateY(0) scale(1);
}

/* Centerpiece Avatar Overlapping Top Edge */
.streak-avatar-wrapper {
  position: absolute;
  top: -46px;
  left: 50%;
  transform: translateX(-50%);
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(0,0,0,0.15), 0 0 0 6px white;
  z-index: 12;
}

.streak-avatar-wrapper::before {
  content: '';
  position: absolute;
  top: -10%; left: -10%; right: -10%; bottom: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,160,0,0.4) 0%, rgba(33,158,188,0.3) 50%, rgba(42,157,143,0.1) 100%);
  z-index: -1;
  filter: blur(12px);
  animation: pulseGlow 3s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.15); opacity: 1; }
}

.streak-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  position: relative;
  overflow: hidden; /* clips profile photo to circle */
  z-index: 1;
}

.streak-avatar-crown {
  position: absolute;
  top: -12px;
  right: -8px;
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
  animation: floatFlame 3s ease-in-out infinite;
  z-index: 10;
}

.streak-avatar-base-icon {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  background: white;
  border-radius: 50%;
  padding: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 10;
}

.streak-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Content Styles */
.streak-congrats {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--forest);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.streak-modal__title {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  color: var(--cacao);
  line-height: 1.1;
  margin-bottom: 16px;
}

.streak-modal__subtitle {
  color: var(--cacao);
  font-size: 1.1rem;
  margin-bottom: 32px;
  font-weight: 500;
}

/* Dashed Streak Box */
.streak-dashed-box {
  background: rgba(220, 240, 220, 0.5); /* Very light green */
  border: 2px dashed rgba(42, 157, 143, 0.4);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  text-align: left;
}

.streak-dashed-box__icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 4px 8px rgba(255,120,0,0.3));
  flex-shrink: 0;
  animation: floatFlame 2s ease-in-out infinite alternate;
}

.streak-dashed-box__content {
  display: flex;
  flex: 1;
  align-items: center;
}

.streak-dashed-box__left {
  flex: 1;
  padding-right: 16px;
  border-right: 1px solid rgba(42, 157, 143, 0.2);
}

.streak-dashed-box__right {
  flex: 1;
  padding-left: 16px;
}

.streak-stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cacao-light);
  margin-bottom: 4px;
}

.streak-stat-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--forest);
  text-transform: uppercase;
  line-height: 1.2;
}

.streak-stat-text {
  font-size: 0.85rem;
  color: var(--cacao-light);
  line-height: 1.4;
}

/* Pulsing Button */
.streak-modal__body-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.streak-modal__close {
  background: #6a9955; /* The specific green from reference */
  color: white;
  border: none;
  border-radius: 30px;
  padding: 16px 32px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 16px rgba(106, 153, 85, 0.3);
  animation: pulseButton 2s infinite;
  flex-shrink: 0;
  margin-top: 12px;
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.streak-modal__close:hover {
  background: #5c8749;
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(106, 153, 85, 0.4);
}

@keyframes pulseButton {
  0% { box-shadow: 0 0 0 0 rgba(106, 153, 85, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(106, 153, 85, 0); }
  100% { box-shadow: 0 0 0 0 rgba(106, 153, 85, 0); }
}

/* Dynamic Particle Emojis */
.health-particle {
  position: absolute;
  font-size: 2rem;
  pointer-events: none;
  z-index: 15;
  opacity: 0;
  transform-origin: center;
}

@keyframes particleBurst {
  0% { transform: translate(0, 0) scale(0.5) rotate(0deg); opacity: 1; }
  20% { opacity: 1; transform: translate(var(--tx), var(--ty)) scale(1.2) rotate(var(--rot)); }
  100% { transform: translate(calc(var(--tx) * 1.5), calc(var(--ty) + 200px)) scale(0.8) rotate(calc(var(--rot) * 2)); opacity: 0; }
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .streak-modal {
    padding: 52px 18px 16px;
    margin-top: 38px;
    max-height: min(92dvh, 600px);
  }
  .streak-avatar-wrapper {
    top: -42px;
    width: 86px;
    height: 86px;
  }
  .streak-modal__close {
    padding: 14px 20px;
    font-size: 0.92rem;
  }
  .streak-modal__title {
    font-size: 1.35rem;
  }
  .streak-stat-value {
    font-size: 1.5rem;
  }
  .streak-dashed-box {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .streak-dashed-box__content {
    flex-direction: column;
    width: 100%;
  }
  .streak-dashed-box__left {
    padding-right: 0;
    padding-bottom: 12px;
    border-right: none;
    border-bottom: 1px solid rgba(42, 157, 143, 0.2);
    width: 100%;
  }
  .streak-dashed-box__right {
    padding-left: 0;
    padding-top: 12px;
    width: 100%;
  }
}


/* Legacy alias — auth card inline legal links */
.footer__legal {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  font-size: var(--text-sm);
}
.footer__legal a {
  color: var(--cacao-light);
  text-decoration: none;
  transition: color var(--tr-fast);
}
.footer__legal a:hover {
  color: var(--forest);
  text-decoration: underline;
}

/* ================================================================
   NATIVE APP TWEAKS (.capacitor-native)
   Website unchanged — rules apply only inside the Capacitor shell.
   ================================================================ */

/* Hide website chrome */
.capacitor-native .header,
.capacitor-native .dash-header {
  display: none !important;
}

.capacitor-native .footer {
  display: none !important;
}

/* Scroll & touch — only on body (never html: breaks Android WebView scroll) */
.capacitor-native {
  height: auto;
  overflow: visible;
}

.capacitor-native html {
  scroll-behavior: auto !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  height: auto !important;
}

.capacitor-native body {
  scroll-behavior: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  touch-action: auto;
  overscroll-behavior-y: auto;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  min-height: 100%;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: auto !important;
}

/* Never freeze page scroll in the native shell (html lock breaks Android WebView) */
html.capacitor-native.yfc-scroll-locked,
html.capacitor-native.yfc-scroll-locked body {
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  position: relative !important;
  top: auto !important;
  width: auto !important;
}

.capacitor-native body.yfc-native-scroll-lock {
  overflow: hidden !important;
}

/* Carousels must not steal vertical page scroll (pan-x was freezing mid-scroll) */
.capacitor-native .meal-carousel,
.capacitor-native .recent-scroller,
.capacitor-native .tabs,
.capacitor-native .hh-week-scroll {
  touch-action: auto;
  scroll-snap-type: none;
}

.capacitor-native .search-dropdown,
.capacitor-native .ingredient-list,
.capacitor-native .collection-modal__body,
.capacitor-native .planner-modal__results,
.capacitor-native .modal-body-scroll {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

/* ================================================================
   BOTTOM TAB BAR (APP ONLY)
   ================================================================ */
.app-bottom-nav {
  display: none; /* hidden by default on web */
}

.capacitor-native .app-bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: var(--white);
  border-top: 1px solid var(--cream-dark);
  padding-bottom: env(safe-area-inset-bottom); /* iOS notch support */
  z-index: 9999;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.capacitor-native .app-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--cacao-light);
  flex: 1;
  height: 100%;
  gap: 4px;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.capacitor-native .app-tab-btn i {
  width: 24px;
  height: 24px;
}

.capacitor-native .app-tab-btn span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.capacitor-native .app-tab-btn.active {
  color: var(--forest);
}

.capacitor-native .app-tab-btn.active i {
  stroke-width: 2.5px;
}

/* ================================================================
   NATIVE PROFILE SETTINGS (APP ONLY)
   ================================================================ */
/* Converts the profile web form into an iOS-style settings list */
.capacitor-native .profile-section {
  background: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: 28px;
}

.capacitor-native .profile-section__header {
  background: transparent;
  border: none;
  padding: 0 0 8px 16px;
}

.capacitor-native .profile-section__title {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--cacao-light);
  letter-spacing: 0.05em;
  font-family: var(--font-body);
}

.capacitor-native .profile-section__body {
  padding: 0;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--cream-dark);
}

.capacitor-native .profile-form-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

.capacitor-native .form-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--cream-dark);
  margin: 0;
}

.capacitor-native .form-group:last-child {
  border-bottom: none;
}

.capacitor-native .form-label {
  margin: 0;
  font-weight: 600;
  font-size: 13px;
  color: var(--cacao-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.capacitor-native .form-input,
.capacitor-native .form-select {
  width: 100%;
  max-width: 100%;
  text-align: left;
  direction: ltr;
  border: 1px solid var(--cream-dark) !important;
  background: var(--cream) !important;
  padding: 10px 12px !important;
  border-radius: 8px;
  color: var(--cacao) !important;
  box-shadow: none !important;
  font-size: 16px;
}

.capacitor-native .profile-form-actions {
  padding: 18px 16px 24px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--cream-dark);
  margin-top: 12px;
}

.capacitor-native .danger-item {
  padding: 16px;
  flex-direction: row;
  align-items: center;
}

.capacitor-native .danger-item__info h4 {
  font-size: 15px;
}

/* ================================================================
   NATIVE BACK FAB (replaces green top bar — full-bleed content)
   ================================================================ */
.app-top-bar,
.app-back-fab {
  display: none;
}

.capacitor-native .app-top-bar {
  display: none !important;
}

.capacitor-native .app-back-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  z-index: 9000;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--forest);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.capacitor-native .app-back-fab svg {
  width: 22px;
  height: 22px;
}

.capacitor-native .auth-back {
  display: none;
}

/* ================================================================
   NATIVE SETTINGS LINKS (profile)
   ================================================================ */
.app-settings-links {
  display: none;
}

.capacitor-native .app-settings-links {
  display: block;
}

.capacitor-native .app-settings-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.capacitor-native .app-settings-list__item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--cacao);
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid var(--cream-dark);
  transition: background 0.15s;
}

.capacitor-native .app-settings-list__item:last-child a {
  border-bottom: none;
}

.capacitor-native .app-settings-list__item a:active {
  background: var(--cream);
}

.capacitor-native .app-settings-list__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--cream);
  color: var(--forest);
  flex-shrink: 0;
}

.capacitor-native .app-settings-list__icon svg {
  width: 16px;
  height: 16px;
}

.capacitor-native .app-settings-list__chevron {
  margin-left: auto;
  color: var(--cacao-light);
  opacity: 0.5;
}

.capacitor-native .app-settings-list__chevron svg {
  width: 18px;
  height: 18px;
}

.capacitor-native .app-settings-list__btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: transparent;
  text-align: left;
  color: var(--danger);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-bottom: 1px solid var(--cream-dark);
}

.capacitor-native .app-settings-list__btn:active {
  background: var(--cream);
}

/* Native login page — full width, no desktop split layout */
.capacitor-native .auth-body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  align-items: stretch;
  justify-content: flex-start;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
}

.capacitor-native .auth-layout {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.capacitor-native .auth-panel {
  width: 100%;
  padding: 48px 0 16px;
  overflow: visible;
}

.capacitor-native .auth-image {
  display: none !important;
}

.capacitor-native .auth-content {
  max-width: 100%;
  margin: 0;
}

.capacitor-native .auth-header h2 {
  font-size: 1.65rem;
}

.capacitor-native .form-input,
.capacitor-native .auth-form .form-input {
  font-size: 16px;
}

/* About / legal pages — full bleed, no header overlap */
.capacitor-native .about-page,
.capacitor-native .legal-page {
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
}

.capacitor-native.tut-active .app-bottom-nav {
  display: none !important;
}

.capacitor-native.tut-active body {
  padding-bottom: 0;
}

/* ================================================================
   NATIVE HOME / HERO POLISH
   ================================================================ */
.capacitor-native .hero-banner {
  min-height: 58vh;
}

.capacitor-native .hero-banner__content {
  padding-top: var(--sp-6);
}

.capacitor-native .hero-banner__title {
  font-size: clamp(1.6rem, 6vw, 2.2rem);
}

.capacitor-native .profile-page-header {
  display: none;
}

.capacitor-native .dash-layout,
.capacitor-native .profile-layout {
  min-height: auto;
  width: 100%;
  overflow: visible;
}

.capacitor-native .dash-layout > main {
  flex: none;
  width: 100%;
  overflow: visible;
}

.capacitor-native .profile-layout > main {
  flex: none;
  width: 100%;
  overflow: visible;
}

.capacitor-native .profile-main {
  max-width: 100%;
  width: 100%;
  padding: 12px 16px var(--sp-6);
  box-sizing: border-box;
}

.capacitor-native .profile-hero {
  flex-direction: row;
  align-items: center;
  text-align: left;
  padding: 16px;
  margin-bottom: 12px;
  gap: 14px;
}

.capacitor-native .profile-avatar {
  width: 56px;
  height: 56px;
  font-size: 1.35rem;
}

.capacitor-native .profile-hero-info h2 {
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.capacitor-native .profile-hero-info p {
  font-size: 12px;
  margin-bottom: 8px;
}

.capacitor-native .profile-stats {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.capacitor-native .profile-stat__val {
  font-size: 0.95rem;
}

.capacitor-native .profile-stat__label {
  font-size: 10px;
}

.capacitor-native .profile-section__header svg {
  display: none;
}

.capacitor-native .goals-preview {
  margin: 0 16px 16px;
}

.capacitor-native .diet-hero {
  min-height: 220px;
}

.capacitor-native .diet-hero__title {
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.capacitor-native .danger-zone__header {
  padding-left: 16px;
}

.capacitor-native .legal-back {
  display: none;
}

/* ================================================================
   NATIVE BRANDED DIALOGS & PICKERS
   ================================================================ */
.yfc-dialog-overlay,
.yfc-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 22, 12, 0.55);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.yfc-picker-overlay {
  align-items: flex-end;
  padding: 0;
}

.yfc-dialog--visible,
.yfc-picker--visible {
  opacity: 1;
}

.yfc-dialog {
  width: min(400px, 100%);
  background: var(--white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  transform: translateY(12px) scale(0.96);
  transition: transform 0.28s ease;
}

.yfc-dialog--visible .yfc-dialog,
.yfc-picker--visible .yfc-picker {
  transform: translateY(0) scale(1);
}

.yfc-dialog__stripe,
.yfc-picker__header {
  background: linear-gradient(90deg, var(--forest), var(--matcha));
}

.yfc-dialog__stripe {
  height: 5px;
}

.yfc-dialog--success .yfc-dialog__stripe {
  background: linear-gradient(90deg, var(--forest), var(--matcha));
}

.yfc-dialog--error .yfc-dialog__stripe {
  background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.yfc-dialog--error .yfc-dialog__title {
  color: #c0392b;
}

.yfc-dialog__body {
  padding: 22px 20px 18px;
}

.yfc-dialog__title,
.yfc-picker__title {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--forest);
}

.yfc-dialog__message {
  margin: 0 0 18px;
  color: var(--cacao-light);
  font-size: 0.95rem;
  line-height: 1.55;
}

.yfc-dialog__actions {
  display: flex;
  gap: 10px;
}

.yfc-dialog__actions .btn {
  flex: 1;
}

.yfc-picker {
  width: 100%;
  max-height: 70vh;
  background: var(--white);
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.28s ease;
}

.yfc-picker__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  color: var(--white);
}

.yfc-picker__title {
  margin: 0;
  color: var(--white);
  font-size: 1rem;
}

.yfc-picker__close {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.yfc-picker__list {
  overflow-y: auto;
  max-height: calc(70vh - 60px);
  padding: 8px 0 calc(16px + env(safe-area-inset-bottom, 0px));
}

.yfc-picker__option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  background: transparent;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  color: var(--cacao);
  cursor: pointer;
  border-bottom: 1px solid var(--cream-dark);
}

.yfc-picker__option:active {
  background: var(--cream);
}

.yfc-picker__option--selected .yfc-picker__radio {
  border-color: var(--forest);
  box-shadow: inset 0 0 0 5px var(--forest);
}

.yfc-picker__radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--cream-dark);
  flex-shrink: 0;
}

.yfc-picker__label {
  line-height: 1.4;
}

.capacitor-native select.native-select-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.capacitor-native .native-select-trigger {
  width: 100%;
  text-align: left;
  cursor: pointer;
  appearance: none;
}

/* Profile native spacing */
.capacitor-native .profile-pref-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 16px !important;
}

.capacitor-native .profile-pref-row .btn {
  width: 100%;
  justify-content: center;
}

.capacitor-native .goals-preview {
  margin: 12px 16px 16px;
  padding: 16px;
}

.capacitor-native .goals-preview__grid {
  gap: 10px;
}

.capacitor-native .goals-preview__item {
  padding: 12px 10px;
  min-width: 0;
}

.capacitor-native .goals-preview__val {
  font-size: 1.1rem;
}

.capacitor-native .profile-form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 16px 20px;
  margin-top: 8px;
}

.capacitor-native .profile-form-actions .btn {
  width: 100%;
  justify-content: center;
}

.capacitor-native .profile-section[aria-labelledby="section-personal"] {
  margin-bottom: 36px;
}

.capacitor-native .profile-section[aria-labelledby="section-personal"] .profile-form-actions {
  padding: 18px 16px 24px;
  margin-top: 12px;
  border-top: 1px solid var(--cream-dark);
}

.capacitor-native .profile-section[aria-labelledby="section-account"] {
  margin-top: 8px;
}

.capacitor-native .profile-section[aria-labelledby="section-account"] .profile-section__header {
  padding-top: 4px;
  margin-bottom: 10px;
}

.profile-account-list {
  display: flex;
  flex-direction: column;
}

.profile-account-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--cream-dark);
}

.profile-account-row--last {
  border-bottom: none;
}

.profile-account-row__main {
  flex: 1;
  min-width: 0;
}

.profile-account-row__label {
  font-weight: 600;
  color: var(--cacao);
  margin-bottom: 6px;
  font-size: 14px;
}

.profile-account-row__value {
  font-size: var(--text-sm);
  color: var(--cacao-light);
  line-height: 1.45;
  word-break: break-word;
}

.profile-account-row__badge {
  flex-shrink: 0;
  font-size: 11px;
  background: rgba(44, 94, 59, 0.1);
  color: var(--forest);
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
  margin-top: 2px;
}

.capacitor-native .profile-account-row {
  padding: 18px 16px;
  gap: 16px;
}

.capacitor-native .profile-account-row__label {
  margin-bottom: 8px;
}

.capacitor-native .profile-account-row__value {
  font-size: 15px;
  line-height: 1.5;
}

.capacitor-native .hh-plan-header {
  gap: 20px;
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.capacitor-native .hh-plan-header__left {
  gap: 14px;
}

.capacitor-native .hh-plan-header__title {
  margin-bottom: 8px;
}

.capacitor-native .hh-plan-header__sub {
  margin-bottom: 4px;
}

.capacitor-native .hh-plan-header__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.capacitor-native .hh-plan-header__actions .btn {
  width: 100%;
  justify-content: center;
}

.capacitor-native .app-settings-list__item a,
.capacitor-native .app-settings-list__btn {
  min-height: 48px;
}

.capacitor-native .app-tab-btn svg {
  stroke: currentColor;
  color: inherit;
}

.capacitor-native .app-settings-list__icon svg,
.capacitor-native .app-settings-list__chevron svg {
  stroke: currentColor;
}

