/* ==========================================================================
   LET'S FIT (letsfit.online) - EDITORIAL NUTRITION & RECIPES DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* Editorial Warm Color Palette */
  --bg-page: #FCFBF9;
  --bg-card: #FFFFFF;
  --bg-surface: #F6F5F2;
  --bg-subtle: #F0EEEA;
  
  /* Accent: Deep Forest Green & Sage */
  --accent-forest: #2B4C3F;
  --accent-forest-hover: #1E382E;
  --accent-sage: #EBF2ED;
  --accent-sage-text: #214336;
  --accent-gold: #C28E3A;
  --accent-gold-light: #FAF4EB;

  /* Typography Colors */
  --text-primary: #141414;
  --text-secondary: #6E6D6B;
  --text-muted: #9E9D9A;
  
  /* Borders & Shadows */
  --border-subtle: #EAE7E1;
  --border-hover: #D6D2CA;
  --border-focus: #2B4C3F;
  --shadow-soft: 0 4px 20px -2px rgba(20, 20, 20, 0.04), 0 2px 6px -1px rgba(20, 20, 20, 0.02);
  --shadow-elevated: 0 20px 40px -8px rgba(20, 20, 20, 0.06), 0 4px 12px -2px rgba(20, 20, 20, 0.03);

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Grotesk', ui-monospace, monospace;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
  line-height: 1.6;
  color: var(--text-primary);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, textarea {
  font-family: inherit;
}

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

::selection {
  background: var(--accent-sage);
  color: var(--accent-forest);
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   HEADER / NAVBAR
   ========================================================================== */
.header {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(252, 251, 249, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.brand-leaf-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-sage);
  color: var(--accent-forest);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-dot {
  color: var(--accent-forest);
}

/* Header Nav Links */
.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link-badge {
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: var(--accent-sage);
  color: var(--accent-forest);
  letter-spacing: 0.02em;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--accent-forest);
  border: 1px solid var(--accent-forest);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.nav-btn:hover {
  background: var(--accent-forest-hover);
  border-color: var(--accent-forest-hover);
  transform: translateY(-1px);
}

.capsule-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.95rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-forest);
  background: var(--accent-sage);
  border: 1px solid rgba(43, 76, 63, 0.15);
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.capsule-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-forest);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.home-hero {
  padding: 5rem 0 4rem 0;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-forest);
  background: var(--accent-sage);
  border: 1px solid rgba(43, 76, 63, 0.18);
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
}

.hero-headline {
  font-size: clamp(2.4rem, 5.2vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.hero-subheadline {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 2.25rem auto;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--accent-forest);
  border: 1px solid var(--accent-forest);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px rgba(43, 76, 63, 0.2);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent-forest-hover);
  border-color: var(--accent-forest-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(43, 76, 63, 0.28);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.65rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-soft);
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface);
}

.hero-stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.hero-stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-stat-icon {
  color: var(--accent-forest);
}

/* ==========================================================================
   UNIFIED SEARCH & COLLAPSIBLE FILTER HUB
   ========================================================================== */
.filter-hub-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-soft);
}

.filter-hub-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-input-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-text-input {
  width: 100%;
  height: 48px;
  padding: 0 2.8rem 0 3rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  outline: none;
  transition: all var(--transition-fast);
}

.search-text-input:focus {
  border-color: var(--accent-forest);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(43, 76, 63, 0.08);
}

.btn-clear-search {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-filter-toggle {
  height: 48px;
  padding: 0 1.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-soft);
  flex-shrink: 0;
}

.btn-filter-toggle:hover {
  background: var(--bg-surface);
  border-color: var(--border-hover);
}

.btn-filter-toggle.has-active-filters {
  border-color: var(--accent-forest);
  background: var(--accent-sage);
  color: var(--accent-sage-text);
}

.btn-filter-toggle .filter-toggle-icon {
  color: var(--accent-forest);
}

.btn-filter-toggle .filter-chevron-icon {
  transition: transform var(--transition-normal);
  color: var(--text-muted);
}

.btn-filter-toggle.open .filter-chevron-icon {
  transform: rotate(180deg);
  color: var(--accent-forest);
}

.filter-active-counter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--accent-forest);
  color: #FFFFFF;
  border-radius: var(--radius-full);
}

/* Accordion Drawer */
.filter-drawer {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.3s ease;
  margin-top: 0;
}

.filter-drawer.open {
  max-height: 650px;
  opacity: 1;
  margin-top: 1.25rem;
}

.filter-drawer-inner {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
}

.filter-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-clear-all-filters {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  min-height: 36px;
}

.btn-clear-all-filters:hover {
  color: #B91C1C;
  background: rgba(185, 28, 28, 0.06);
}

.filter-groups-grid {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  min-width: 78px;
}

.filter-pill-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.filter-pill-btn {
  padding: 0.45rem 0.95rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  cursor: pointer;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.filter-pill-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: #FFFFFF;
}

/* Active Filter Pill: Solid Deep Forest Green (#2b4c3f) with White Text */
.filter-pill-btn.active {
  background: var(--accent-forest) !important;
  border-color: var(--accent-forest) !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(43, 76, 63, 0.22);
}

/* ==========================================================================
   FOOD DATABASE SHOWCASE & CARD GRID
   ========================================================================== */
.foods-section {
  padding: 3rem 0 5rem 0;
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.food-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  position: relative;
}

.food-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
  border-color: var(--border-hover);
}

.food-card-media,
.recipe-card-media,
.food-card-image-wrap,
.recipe-card-img-wrap {
  width: 100%;
  height: 180px;
  background-color: #f3f4f6;
  position: relative;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
}

.food-card-image,
.food-card-img,
.recipe-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 16px 16px 0 0;
  display: block;
  transition: opacity 0.3s ease, transform 0.5s ease;
}

.food-card:hover .food-card-image,
.food-card:hover .food-card-img,
.recipe-card:hover .recipe-card-img {
  transform: scale(1.05);
}

.card-badges-row {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  right: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.card-status-badge {
  padding: 0.25rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.card-status-badge.badge-unit {
  background: rgba(43, 76, 63, 0.92);
  color: #FFFFFF;
}

.card-status-badge.badge-meal {
  background: rgba(194, 142, 58, 0.92);
  color: #FFFFFF;
}

.card-diet-badge {
  padding: 0.25rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(20, 20, 20, 0.04);
}

.card-diet-badge.diet-pescatarian, .capsule-badge.diet-pescatarian {
  background: #E8F5F3;
  color: #164E46;
  border-color: rgba(22, 78, 70, 0.25);
}

.card-diet-badge.diet-vegan, .capsule-badge.diet-vegan {
  background: #EEF7EE;
  color: #215C28;
  border-color: rgba(33, 92, 40, 0.25);
}

.card-diet-badge.diet-vegetarian, .capsule-badge.diet-vegetarian {
  background: #FDF6E7;
  color: #7A4F08;
  border-color: rgba(122, 79, 8, 0.25);
}

.card-diet-badge.diet-non-vegetarian, .capsule-badge.diet-non-vegetarian {
  background: #FAF0F0;
  color: #7A2424;
  border-color: rgba(122, 36, 36, 0.25);
}

.card-prep-time {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(20, 20, 20, 0.82);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(6px);
}

.food-card-body {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category-meta {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.food-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.food-card-macros-rich {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.macro-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.macro-pill.protein {
  background: var(--accent-sage);
  border-color: rgba(43, 76, 63, 0.2);
  color: var(--accent-forest);
}

.macro-pill.fiber {
  background: var(--accent-gold-light);
  border-color: rgba(194, 142, 58, 0.2);
  color: #925C15;
}

.m-unit {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
}

.food-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1.35rem;
  flex: 1;
}

.food-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  background: var(--accent-forest);
  color: #FFFFFF;
  border: 1px solid var(--accent-forest);
  transition: all var(--transition-fast);
}

.food-card-btn:hover {
  background: var(--accent-forest-hover);
  border-color: var(--accent-forest-hover);
}

.empty-filter-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.empty-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  color: var(--text-muted);
}

/* ==========================================================================
   RECIPES DIRECTORY STYLES (recipes.html)
   ========================================================================== */
.recipes-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.recipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-elevated);
}

.recipe-card-overlay-badges {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  right: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recipe-prep-pill {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(20, 20, 20, 0.85);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
}

.recipe-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.recipe-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.recipe-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.recipe-ingredients-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  margin-bottom: 1.25rem;
  font-size: 0.78rem;
}

.preview-label {
  font-weight: 700;
  color: var(--text-primary);
  margin-right: 0.35rem;
}

.preview-text {
  color: var(--text-secondary);
}

.recipe-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  background: var(--accent-forest);
  color: #FFFFFF;
  border: 1px solid var(--accent-forest);
  transition: all var(--transition-fast);
  margin-top: auto;
}

.recipe-card-cta:hover {
  background: var(--accent-forest-hover);
}

/* ==========================================================================
   DYNAMIC DETAIL PAGE & GRANULAR NUTRITION (foods.html)
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 3rem 0 5rem 0;
}

/* Detail Page Skeleton & Smooth Content Reveal System */
.skeleton {
  background: #f1f3f5;
  background: linear-gradient(90deg, #f1f3f5 25%, #e9ecef 37%, #f1f3f5 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 8px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

#detail-skeleton {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  width: 100%;
}

#detail-content {
  display: none;
  opacity: 0;
  flex-direction: column;
  gap: 2.5rem;
  width: 100%;
  transition: opacity 0.2s ease-in-out;
}

#detail-content.loaded {
  opacity: 1;
}

.nutrition-split-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated);
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  overflow: hidden;
}

.image-column {
  position: relative;
  background-color: var(--bg-surface);
  min-height: 480px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
}

.food-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: none !important;
  transition: none !important;
  animation: none !important;
}

.image-overlay-badge {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.overlay-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.overlay-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.score-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-forest);
}

.details-column {
  padding: 3rem 3.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-forest);
  margin-bottom: 0.85rem;
}

.food-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.food-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 2rem;
}

.counter-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.counter-info {
  display: flex;
  flex-direction: column;
}

.counter-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.serving-weight-hint {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.counter-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.35rem;
  box-shadow: var(--shadow-soft);
}

.counter-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: var(--bg-surface);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  user-select: none;
}

.counter-btn:hover:not(:disabled) {
  background: var(--accent-forest);
  color: #FFFFFF;
}

.counter-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.quantity-display {
  min-width: 58px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.presets-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: -1rem;
  margin-bottom: 1.75rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.preset-chip {
  padding: 0.25rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.preset-chip:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-surface);
}

.preset-chip.active {
  background: var(--accent-forest);
  border-color: var(--accent-forest);
  color: #FFFFFF;
}

/* Primary Macro Grid */
.macro-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.macro-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem 0.8rem;
  text-align: center;
}

.macro-card.highlight {
  background: var(--accent-sage);
  border-color: rgba(43, 76, 63, 0.2);
}

.macro-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.macro-card.highlight .macro-label {
  color: var(--accent-forest);
}

.macro-value-group {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.macro-number {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.macro-card.highlight .macro-number {
  color: var(--accent-forest);
}

.macro-unit {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Secondary Granular Nutrition Row */
.granular-nutrition-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 2rem;
}

.granular-cell {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.g-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.g-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Micronutrient List */
.micronutrients-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.75rem;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.micro-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-forest);
  background: var(--accent-sage);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.micronutrient-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.micro-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid transparent;
}

.micro-left {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.micro-icon-wrap {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-sage);
  color: var(--accent-forest);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.micro-title {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.micro-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-top: 1px;
}

.micro-val-tag {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-forest);
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* Complete Meal Recipe Card Details */
.recipe-detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 3rem;
  box-shadow: var(--shadow-elevated);
}

.recipe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
}

.recipe-detail-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-top: 0.35rem;
}

.recipe-meta-pills {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.meta-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.meta-pill strong {
  color: var(--text-primary);
}

.recipe-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 3rem;
}

.recipe-col-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-sage);
}

.recipe-ingredients-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recipe-ing-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.ing-check-bullet {
  color: var(--accent-forest);
  font-weight: 800;
}

.recipe-instructions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recipe-step-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-forest);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-text {
  flex: 1;
}

/* ==========================================================================
   AI VISION FOOD SCANNER SECTION
   ========================================================================== */
.scanner-section {
  padding: 3rem 0 6rem 0;
}

.scanner-box-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated);
  padding: 3.5rem;
  position: relative;
  overflow: hidden;
}

.scanner-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.scanner-title-area {
  max-width: 620px;
}

.scanner-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0.5rem 0 0.75rem 0;
}

.scanner-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.scanner-quota-wrap {
  display: flex;
  align-items: center;
}

.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-forest);
  background: var(--accent-sage);
  border: 1px solid rgba(43, 76, 63, 0.2);
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 2px rgba(20, 20, 20, 0.03);
  transition: all var(--transition-fast);
}

.quota-badge strong {
  font-weight: 800;
  color: var(--accent-forest);
}

.quota-badge.depleted {
  background: #FEF2F2;
  color: #991B1B;
  border-color: rgba(239, 68, 68, 0.25);
}

.quota-badge.depleted strong {
  color: #991B1B;
}

.quota-badge svg {
  flex-shrink: 0;
}

.scanner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: stretch;
}

.scanner-dropzone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

.scanner-dropzone:hover, .scanner-dropzone.drag-active {
  border-color: var(--accent-forest);
  background: rgba(235, 242, 237, 0.35);
}

.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.upload-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-forest);
  box-shadow: var(--shadow-soft);
}

.upload-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.upload-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 280px;
}

.upload-btn-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.btn-upload-browse {
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--accent-forest);
  border: none;
  border-radius: var(--radius-full);
}

.btn-demo-trigger {
  padding: 0.55rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
}

.scanner-preview-box {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
}

.preview-img-wrap {
  width: 100%;
  height: 280px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  background: #000;
}

.scanner-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scanner-overlay-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #2B4C3F, #10B981, transparent);
  box-shadow: 0 0 15px #10B981;
  animation: scanLaser 2.2s ease-in-out infinite;
  display: none;
}

@keyframes scanLaser {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 98%; opacity: 0; }
}

.preview-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.btn-remove-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #DC2626;
  background: transparent;
  border: none;
}

.btn-start-analyze {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #FFFFFF;
  background: var(--accent-forest);
  border: 1px solid var(--accent-forest);
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(43, 76, 63, 0.2);
}

.scanner-output-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  min-height: 360px;
}

.scanner-loading-state {
  display: none;
  text-align: center;
  padding: 2rem 1rem;
}

.loading-spinner-ring {
  width: 54px;
  height: 54px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-forest);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem auto;
}

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

.loading-status-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.loading-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.scanner-results-container {
  display: none;
}

.result-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.result-food-name {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
}

.result-portion-summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.result-confidence-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--accent-sage);
  color: var(--accent-forest);
  border: 1px solid rgba(43, 76, 63, 0.2);
  white-space: nowrap;
}

.result-macro-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.result-macro-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem 0.6rem;
  text-align: center;
}

.result-macro-box.highlight {
  background: var(--accent-sage);
  border-color: rgba(43, 76, 63, 0.2);
}

.result-macro-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.result-macro-box.highlight .result-macro-label {
  color: var(--accent-forest);
}

.result-macro-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.result-macro-box.highlight .result-macro-val {
  color: var(--accent-forest);
}

.result-macro-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.result-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.result-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--accent-forest);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 1px 3px rgba(20, 20, 20, 0.03);
}

.result-tag::before {
  content: "•";
  color: var(--accent-forest);
  font-size: 1rem;
  line-height: 1;
}

.result-ingredients-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.ingredients-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.ingredient-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ingredient-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}

.ing-name {
  font-weight: 600;
  color: var(--text-primary);
}

.ing-weight {
  font-family: var(--font-mono);
  color: var(--accent-forest);
  font-weight: 700;
}

.result-bio-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.btn-reset-scan {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-forest);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.btn-reset-scan:hover {
  border-color: var(--accent-forest);
}

/* ==========================================================================
   SCANNER ALERT / RATE LIMIT CARD
   ========================================================================== */
.scanner-alert-box {
  display: none;
  text-align: center;
  padding: 2.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-top: 0.5rem;
}

.scanner-alert-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
}

.scanner-alert-icon.warning {
  background: #FEF3C7;
  color: #D97706;
}

.scanner-alert-icon.danger {
  background: #FEE2E2;
  color: #DC2626;
}

.scanner-alert-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.scanner-alert-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 380px;
  margin: 0 auto 1.5rem auto;
}

.scanner-alert-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   SKELETON LOADERS
   ========================================================================== */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, #f0ede6 25%, #f8f6f2 50%, #f0ede6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.skeleton-image {
  width: 100%;
  height: 200px;
}

.skeleton-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-badge {
  width: 80px;
  height: 16px;
  border-radius: var(--radius-full);
}

.skeleton-title {
  width: 70%;
  height: 24px;
}

.skeleton-macros {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.skeleton-pill {
  width: 50px;
  height: 26px;
  border-radius: var(--radius-full);
}

.skeleton-text {
  width: 100%;
  height: 14px;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-btn {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-md);
  margin-top: 0.75rem;
}

/* ==========================================================================
   RECIPE DETAIL MODAL
   ========================================================================== */
.recipe-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.recipe-modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.recipe-modal-backdrop.active .recipe-modal-dialog {
  transform: translateY(0) scale(1);
}

.recipe-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
}

.recipe-modal-close:hover {
  background: #ffffff;
  transform: scale(1.08);
}

.recipe-modal-hero {
  position: relative;
  height: 240px;
  background: var(--bg-surface);
  overflow: hidden;
}

.recipe-modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-modal-content {
  padding: 2rem;
}

.recipe-modal-header {
  margin-bottom: 1.5rem;
}

.recipe-modal-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin: 0.5rem 0 0.75rem 0;
}

.recipe-modal-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.recipe-modal-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.recipe-modal-meta-pill strong {
  color: var(--text-primary);
}

.recipe-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin: 1.5rem 0;
}

@media (max-width: 640px) {
  .recipe-modal-grid {
    grid-template-columns: 1fr;
  }
  .recipe-modal-content {
    padding: 1.25rem;
  }
  .recipe-modal-hero {
    height: 180px;
  }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0 2rem 0;
  background: var(--bg-page);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.footer-link {
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-source {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE USABILITY
   ========================================================================== */
@media (max-width: 1040px) {
  .food-grid, .recipes-grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .scanner-grid {
    grid-template-columns: 1fr;
  }
  .recipe-columns-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@media (max-width: 960px) {
  .nutrition-split-card {
    grid-template-columns: 1fr;
    max-width: 620px;
    margin: 0 auto;
  }

  .image-column {
    min-height: 320px;
  }

  .details-column {
    padding: 2.25rem 1.75rem;
  }

  .scanner-box-wrapper, .recipe-detail-card {
    padding: 2rem 1.5rem;
  }

  .food-title, .scanner-title {
    font-size: 1.95rem;
  }

  .macro-grid, .granular-nutrition-grid {
    gap: 0.6rem;
  }

  .macro-number {
    font-size: 1.25rem;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0.85rem 0;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 0.85rem;
  }

  .header-nav {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .header-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-links {
    display: flex;
    gap: 0.45rem;
    flex-shrink: 0;
  }

  .nav-link {
    padding: 0.45rem 0.85rem;
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    font-size: 0.82rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }

  .nav-btn {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
  }

  .hero-headline {
    font-size: clamp(2.1rem, 6.5vw, 2.85rem);
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    gap: 0.75rem;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .hero-stats-row {
    flex-direction: column;
    gap: 0.85rem;
    align-items: center;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
  }

  .filter-hub-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .btn-filter-toggle {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .food-grid, .recipes-grid-container {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }

  .result-macro-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }

  .granular-nutrition-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .macro-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .counter-btn {
    min-width: 48px;
    min-height: 48px;
  }
}

@media (max-width: 580px) {
  .details-column {
    padding: 1.75rem 1.25rem;
  }

  .food-title, .scanner-title {
    font-size: 1.65rem;
  }

  .counter-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .counter-controls {
    justify-content: space-between;
    width: 100%;
  }

  .counter-btn {
    min-width: 50px;
    min-height: 50px;
    font-size: 1.45rem;
  }

  .micro-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .micro-val-tag {
    align-self: flex-start;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .brand {
    font-size: 1.15rem;
  }

  .brand-leaf-icon {
    width: 24px;
    height: 24px;
  }

  .home-hero {
    padding: 3rem 0 2.5rem 0;
  }

  .hero-subheadline {
    font-size: 0.95rem;
  }

  .filter-hub-wrapper {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .filter-drawer-inner {
    padding: 1rem 0.85rem;
  }

  .filter-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .filter-pill-group {
    width: 100%;
  }

  .filter-pill-btn {
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
    min-height: 42px;
  }

  .details-column {
    padding: 1.5rem 1rem;
  }

  .food-title, .scanner-title {
    font-size: 1.5rem;
  }

  .presets-row {
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .preset-chip {
    min-height: 42px;
    padding: 0.45rem 0.85rem;
  }

  .macro-card {
    padding: 0.85rem 0.65rem;
  }

  .macro-number {
    font-size: 1.3rem;
  }

  .granular-cell {
    padding: 0.75rem 0.5rem;
  }

  .scanner-box-wrapper {
    padding: 1.25rem 0.85rem;
  }

  .upload-prompt {
    padding: 2rem 1rem;
  }

  .upload-btn-row {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .btn-upload-browse, .btn-demo-trigger {
    width: 100%;
    justify-content: center;
    min-height: 46px;
  }

  .result-macro-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
  }

  .result-macro-card {
    padding: 0.85rem 0.65rem;
  }

  .result-macro-val {
    font-size: 1.25rem;
  }

  .ingredient-pill {
    width: 100%;
    justify-content: space-between;
  }

  .recipe-meta-pills {
    flex-direction: column;
    gap: 0.4rem;
  }
}

/* ==========================================================================
   LEGAL PAGES (Privacy Policy & Terms of Service)
   ========================================================================== */
.legal-page-main {
  padding: 1.5rem 0 4rem 0;
  background: var(--bg-page);
}

.legal-container {
  width: 100%;
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  line-height: 1.7;
  color: #374151;
}

.legal-header {
  text-align: center;
  margin-bottom: 2.25rem;
}

.legal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-sage);
  color: var(--accent-forest);
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
  border: 1px solid rgba(43, 76, 63, 0.12);
}

.legal-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111827;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.legal-subtitle {
  font-size: 1.05rem;
  color: #4B5563;
  max-width: 640px;
  margin: 0 auto 1.25rem auto;
  line-height: 1.6;
}

.legal-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.legal-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-full);
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
  color: #6B7280;
  font-weight: 600;
}

.legal-meta-pill strong {
  color: #111827;
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.75rem;
  box-shadow: var(--shadow-soft);
}

.legal-toc {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.25rem;
}

.legal-toc-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6B7280;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legal-toc-list {
  margin: 0 0 0 1.35rem;
  padding: 0;
  color: #4B5563;
  font-size: 0.95rem;
  line-height: 1.7;
}

.legal-toc-list li {
  margin-bottom: 0.4rem;
}

.legal-toc-list a {
  color: var(--accent-forest);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.legal-toc-list a:hover {
  text-decoration: underline;
}

.legal-section {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #F3F4F6;
}

.legal-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.legal-section h2, .legal-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: #111827;
  line-height: 1.35;
}

.legal-section:first-of-type h2 {
  margin-top: 0;
}

.legal-section p, .legal-card p {
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin: 1.25rem 0 0.5rem 0;
}

.legal-section ul, .legal-section ol {
  margin: 0.75rem 0 1.25rem 1.35rem;
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.65;
}

.legal-section li {
  margin-bottom: 0.45rem;
}

.legal-section li strong {
  color: #111827;
}

.legal-callout {
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin: 1.25rem 0;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.legal-callout-info {
  background: var(--accent-sage);
  border: 1px solid rgba(43, 76, 63, 0.2);
  color: var(--accent-sage-text);
}

.legal-callout-info .legal-callout-icon {
  color: var(--accent-forest);
}

.legal-callout-warning {
  background: #FFFBEB;
  border: 1px solid rgba(194, 142, 58, 0.3);
  color: #78350F;
}

.legal-callout-warning .legal-callout-icon {
  color: #D97706;
}

.legal-callout-icon {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.legal-callout-content {
  font-size: 0.9rem;
  line-height: 1.6;
}

.legal-callout-content strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.legal-table-wrapper {
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-md);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.legal-table th {
  background: #F9FAFB;
  color: #111827;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #E5E7EB;
}

.legal-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #E5E7EB;
  color: #374151;
  vertical-align: top;
}

.legal-table tr:last-child td {
  border-bottom: none;
}

.legal-table td strong {
  color: #111827;
}

.legal-contact-box {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.legal-contact-email {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-forest);
}

.legal-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-forest);
  color: #FFFFFF;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  transition: background var(--transition-fast);
}

.legal-contact-btn:hover {
  background: var(--accent-forest-hover);
  color: #FFFFFF;
}

@media (max-width: 768px) {
  .legal-card {
    padding: 1.5rem 1.25rem;
  }
  .legal-title {
    font-size: 1.75rem;
  }
  .legal-contact-box {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   CUSTOM THEMED SCROLLABLE DROPDOWNS
   ========================================================================== */
.custom-dropdown-wrap {
  position: relative;
  flex: 0 0 auto;
  min-width: 195px;
}

.custom-dropdown-trigger {
  width: 100%;
  height: 46px;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-primary);
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all 0.2s ease;
  user-select: none;
}

.custom-dropdown-trigger:hover {
  border-color: var(--accent-forest);
  background: #fafaf9;
}

.custom-dropdown-trigger:focus,
.custom-dropdown-wrap.open .custom-dropdown-trigger {
  outline: none;
  border-color: var(--accent-forest);
  box-shadow: 0 0 0 3px rgba(43, 76, 63, 0.12);
}

.dropdown-trigger-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  flex: 1;
}

.dropdown-arrow-icon {
  color: var(--accent-forest);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.custom-dropdown-wrap.open .dropdown-arrow-icon {
  transform: rotate(180deg);
}

.custom-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  z-index: 100;
  display: none;
  padding: 0.35rem;
  box-sizing: border-box;
}

.custom-dropdown-wrap.open .custom-dropdown-menu {
  display: block;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Thin custom scrollbar */
.custom-dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.custom-dropdown-menu::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.custom-dropdown-item {
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-dropdown-item:hover {
  background: #f8fafc;
  color: var(--accent-forest);
  font-weight: 600;
}

.custom-dropdown-item.active {
  background: var(--accent-sage, #e6ede8);
  color: var(--accent-forest, #2B4C3F);
  font-weight: 700;
}

.custom-dropdown-item.active::after {
  content: "✓";
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent-forest);
  margin-left: 0.5rem;
}

