/* ================================================================
   THYME — Grocery Planning App
   Design System & Component Styles
   
   Structure:
   1.  Design Tokens (custom properties)
   2.  Base Reset
   3.  App Shell & Layout
   4.  Typography
   5.  Navigation (header + bottom nav)
   6.  Buttons & Interactive
   7.  HOME screen
   8.  SCAN screen
   9.  LIST screen
   10. PROFILE screen
   11. Health Alternative Panel
   12. Animations & Keyframes
   13. Dark mode (data-theme="dark")
   ================================================================ */


/* ----------------------------------------------------------------
   1. DESIGN TOKENS
   ---------------------------------------------------------------- */
:root {
  /* === BRAND PALETTE — Herb Garden ===
     Inspired by fresh thyme: deep sage greens, warm cream, honey gold.
     Developer note: swap these to rebrand. Keep semantic names intact. */

  --clr-bg:             #f2f1ea;   /* warm kitchen cream */
  --clr-surface:        #f8f7f2;   /* cards, panels */
  --clr-surface-2:      #ffffff;   /* elevated surface */
  --clr-surface-off:    #eae7dd;   /* inset/offset bg */
  --clr-border:         #d4d0c3;   /* subtle border */
  --clr-divider:        #e0dcd2;   /* list separators */

  --clr-text:           #1b2a1e;   /* deep forest */
  --clr-text-muted:     #5f7365;   /* muted sage */
  --clr-text-faint:     #a4b4a0;   /* placeholder/disabled */
  --clr-text-inv:       #f2f1ea;   /* text on dark bg */

  --clr-primary:        #3a6b4f;   /* thyme herb green */
  --clr-primary-hover:  #2d5540;
  --clr-primary-deep:   #1e3b2c;   /* used in hero card bg */
  --clr-primary-hl:     #cce0d4;   /* highlight/selected bg */
  --clr-primary-light:  #e4f1ea;   /* very light green tint */

  --clr-accent:         #c4913a;   /* honey/saffron */
  --clr-accent-light:   #f0e3c0;

  --clr-success:        #3c7a52;
  --clr-error:          #b83c3c;
  --clr-warning:        #c07a2e;

  /* Hero card gradient stops */
  --hero-grad-start:    #1e3b2c;
  --hero-grad-mid:      #2d5c40;
  --hero-grad-end:      #3d7a55;

  /* === TYPOGRAPHY === */
  --font-display: 'Zodiak', 'Georgia', serif;
  --font-body:    'Work Sans', system-ui, -apple-system, sans-serif;

  /* Fluid type scale — never hardcode font sizes */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem); /* 12–14px */
  --text-sm:   clamp(0.875rem, 0.82rem + 0.28vw, 1rem);     /* 14–16px */
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem); /* 16–18px */
  --text-lg:   clamp(1.125rem, 1rem    + 0.65vw, 1.375rem); /* 18–22px */
  --text-xl:   clamp(1.4rem,   1.1rem  + 1.2vw,  2rem);     /* 22–32px */

  /* === SPACING (4px base) === */
  --sp-1:  0.25rem;  /*  4px */
  --sp-2:  0.5rem;   /*  8px */
  --sp-3:  0.75rem;  /* 12px */
  --sp-4:  1rem;     /* 16px */
  --sp-5:  1.25rem;  /* 20px */
  --sp-6:  1.5rem;   /* 24px */
  --sp-8:  2rem;     /* 32px */
  --sp-10: 2.5rem;   /* 40px */
  --sp-12: 3rem;     /* 48px */

  /* === BORDER RADIUS === */
  --r-sm:   0.375rem;
  --r-md:   0.5rem;
  --r-lg:   0.75rem;
  --r-xl:   1rem;
  --r-2xl:  1.5rem;
  --r-full: 9999px;

  /* === SHADOWS === */
  --shadow-sm:   0 1px 3px rgba(27, 42, 30, 0.07), 0 1px 2px rgba(27, 42, 30, 0.04);
  --shadow-md:   0 4px 12px rgba(27, 42, 30, 0.09), 0 2px 4px rgba(27, 42, 30, 0.04);
  --shadow-lg:   0 12px 32px rgba(27, 42, 30, 0.12);
  --shadow-card: 0 2px 8px rgba(27, 42, 30, 0.06), 0 1px 2px rgba(27, 42, 30, 0.04);

  /* === TRANSITIONS === */
  --t-fast: 130ms ease;
  --t-base: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --t-slow: 360ms cubic-bezier(0.16, 1, 0.3, 1);

  /* === LAYOUT === */
  --app-max:    430px;
  --header-h:   56px;
  --nav-h:      72px;
  --pad:        var(--sp-4);
  --pad-lg:     var(--sp-6);
}


/* ----------------------------------------------------------------
   2. BASE RESET
   ---------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--clr-text);
  background: var(--clr-bg);
  min-height: 100dvh;
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button { cursor: pointer; background: none; border: none; color: inherit; font: inherit; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.2; }
p { text-wrap: pretty; max-width: 68ch; }

:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection {
  background: var(--clr-primary-hl);
  color: var(--clr-text);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ----------------------------------------------------------------
   3. APP SHELL & LAYOUT
   ---------------------------------------------------------------- */

/* Desktop wrapper: center the mobile app on wide screens */
body::before {
  content: '';
  display: block;
  position: fixed;
  inset: 0;
  background: var(--clr-surface-off);
  z-index: -2;
}

/* The card shadow around the app on desktop */
#app-wrapper {
  position: relative;
  max-width: var(--app-max);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--clr-bg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 0 1px var(--clr-border), var(--shadow-lg);
  overflow: hidden;
}

/* Main scrollable content sits between header and nav */
#main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: var(--header-h);
  padding-bottom: var(--nav-h);
  -webkit-overflow-scrolling: touch;
  scroll-padding-top: var(--sp-4);
}

/* Each screen is hidden by default */
.screen {
  display: none;
  padding: var(--pad) var(--pad) var(--sp-8);
  min-height: calc(100dvh - var(--header-h) - var(--nav-h));
  animation: fadeIn 200ms ease both;
}
.screen.screen--active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Shared section title */
.section-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-3);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}


/* ----------------------------------------------------------------
   4. TYPOGRAPHY HELPERS
   ---------------------------------------------------------------- */
.t-display {
  font-family: var(--font-display);
  font-weight: 700;
}
.t-label {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.text-link {
  font-size: var(--text-sm);
  color: var(--clr-primary);
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-1) 0;
  transition: color var(--t-fast);
}
.text-link:hover { color: var(--clr-primary-hover); }


/* ----------------------------------------------------------------
   5. NAVIGATION
   ---------------------------------------------------------------- */

/* ── App Header ── */
.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max);
  height: var(--header-h);
  background: var(--clr-bg);
  border-bottom: 1px solid var(--clr-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  z-index: 100;
  /* Frosted glass on browsers that support it */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--clr-bg) 92%, transparent);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--clr-primary);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.header-logo svg { color: var(--clr-primary); flex-shrink: 0; }

.header-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--clr-text);
  text-align: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Theme toggle button */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-muted);
  background: transparent;
  transition: background var(--t-fast), color var(--t-fast);
}
.theme-toggle:hover {
  background: var(--clr-surface-off);
  color: var(--clr-text);
}

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max);
  height: var(--nav-h);
  background: var(--clr-surface-2);
  border-top: 1px solid var(--clr-divider);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--clr-surface-2) 94%, transparent);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: var(--sp-2) 0;
  color: var(--clr-text-faint);
  transition: color var(--t-base);
  position: relative;
}
.nav-item.nav-item--active {
  color: var(--clr-primary);
}
/* Active dot indicator */
.nav-item.nav-item--active::after {
  content: '';
  position: absolute;
  bottom: 6px;
  width: 4px;
  height: 4px;
  border-radius: var(--r-full);
  background: var(--clr-primary);
}
.nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}
.nav-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Center scan button — slightly elevated */
.nav-item--scan .nav-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  background: var(--clr-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(58, 107, 79, 0.4);
  margin-top: -14px;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.nav-item--scan:hover .nav-icon-wrap,
.nav-item--scan.nav-item--active .nav-icon-wrap {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(58, 107, 79, 0.5);
}
.nav-item--scan { color: var(--clr-text-faint); }
.nav-item--scan svg { color: white; }
.nav-item--scan::after { display: none; }


/* ----------------------------------------------------------------
   6. BUTTONS & INTERACTIVE
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: none;
  transition: background var(--t-base), color var(--t-base),
              box-shadow var(--t-base), transform var(--t-fast);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--clr-primary);
  color: white;
  box-shadow: 0 2px 6px rgba(58, 107, 79, 0.3);
}
.btn--primary:hover {
  background: var(--clr-primary-hover);
  box-shadow: 0 3px 10px rgba(58, 107, 79, 0.35);
}

.btn--secondary {
  background: var(--clr-primary-light);
  color: var(--clr-primary-hover);
  border: 1px solid var(--clr-primary-hl);
}
.btn--secondary:hover {
  background: var(--clr-primary-hl);
}

.btn--ghost {
  background: transparent;
  color: var(--clr-text-muted);
  border: 1px solid var(--clr-border);
}
.btn--ghost:hover {
  background: var(--clr-surface-off);
  color: var(--clr-text);
}

.btn--full { width: 100%; }

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Chip filters */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--clr-surface-2);
  color: var(--clr-text-muted);
  border: 1px solid var(--clr-border);
  cursor: pointer;
  transition: all var(--t-base);
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--clr-primary-hl);
  color: var(--clr-primary);
}
.chip.chip--active {
  background: var(--clr-primary);
  color: white;
  border-color: var(--clr-primary);
  box-shadow: 0 2px 6px rgba(58, 107, 79, 0.3);
}
.chip svg { width: 13px; height: 13px; }

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--clr-border);
  border-radius: var(--r-full);
  transition: background var(--t-base);
  cursor: pointer;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: var(--r-full);
  background: white;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base);
}
.toggle-switch input:checked + .toggle-track {
  background: var(--clr-primary);
}
.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(18px);
}
.toggle-switch input:focus-visible + .toggle-track {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}


/* ----------------------------------------------------------------
   7. HOME SCREEN
   ---------------------------------------------------------------- */

/* Greeting */
.greeting {
  padding: var(--sp-5) 0 var(--sp-4);
}
.greeting-label {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  font-weight: 400;
  margin-bottom: var(--sp-1);
}
.greeting-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--clr-text);
  line-height: 1.1;
}

/* Hero "list ready" card */
.hero-card {
  background: linear-gradient(135deg,
    var(--hero-grad-start) 0%,
    var(--hero-grad-mid)   55%,
    var(--hero-grad-end)   100%);
  border-radius: var(--r-2xl);
  padding: var(--sp-6);
  color: white;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t-base), box-shadow var(--t-base);
  box-shadow: 0 8px 24px rgba(30, 59, 44, 0.35);
  margin-bottom: var(--sp-6);
}
.hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(30, 59, 44, 0.45);
}
.hero-card:active { transform: scale(0.98); }

/* Decorative circles */
.hero-card::before,
.hero-card::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.hero-card::before {
  width: 180px; height: 180px;
  top: -60px; right: -40px;
}
.hero-card::after {
  width: 100px; height: 100px;
  bottom: -30px; right: 60px;
}

/* Decorative thyme sprig (top right) */
.hero-sprig {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 64px;
  height: 80px;
  opacity: 0.2;
  color: white;
}

/* "Ready" badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--r-full);
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: var(--sp-4);
  backdrop-filter: blur(8px);
}
.hero-badge svg { width: 13px; height: 13px; color: #7effc7; }

.hero-count {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--sp-1);
}
.hero-count-label {
  font-size: var(--text-sm);
  opacity: 0.75;
  font-weight: 400;
  margin-bottom: var(--sp-4);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  opacity: 0.85;
  margin-bottom: var(--sp-5);
}
.hero-meta-item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-weight: 500;
}
.hero-meta-item svg { width: 14px; height: 14px; }
.hero-sep { opacity: 0.5; }

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--r-full);
  padding: var(--sp-2) var(--sp-5);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background var(--t-base);
}
.hero-cta:hover { background: rgba(255, 255, 255, 0.32); }
.hero-cta svg { width: 14px; height: 14px; }

/* Preview chips section */
.preview-section {
  margin-bottom: var(--sp-6);
}
.preview-chips {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  /* Hide scrollbar */
  scrollbar-width: none;
}
.preview-chips::-webkit-scrollbar { display: none; }

.preview-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-3);
  min-width: 68px;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: border-color var(--t-base), transform var(--t-fast);
  flex-shrink: 0;
  box-shadow: var(--shadow-card);
}
.preview-chip:hover {
  border-color: var(--clr-primary-hl);
  transform: translateY(-1px);
}
.chip-emoji { font-size: 1.4rem; line-height: 1; }
.chip-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--clr-text-muted);
  text-align: center;
  white-space: nowrap;
}

/* Recent receipts */
.receipts-section { margin-bottom: var(--sp-6); }
.receipts-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.receipt-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: border-color var(--t-base);
  box-shadow: var(--shadow-card);
}
.receipt-item:hover { border-color: var(--clr-primary-hl); }
.receipt-icon {
  width: 40px;
  height: 40px;
  background: var(--clr-primary-light);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary);
  flex-shrink: 0;
}
.receipt-icon svg { width: 18px; height: 18px; }
.receipt-info { flex: 1; }
.receipt-store {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text);
}
.receipt-meta {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  margin-top: 2px;
}
.receipt-total {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text);
}
.receipt-chevron {
  color: var(--clr-text-faint);
  width: 16px;
  height: 16px;
}

/* Scan CTA at bottom of home */
.home-scan-cta {
  margin-top: var(--sp-2);
}


/* ----------------------------------------------------------------
   8. SCAN SCREEN
   ---------------------------------------------------------------- */
.scan-screen { padding: var(--pad); }

/* States toggle */
.scan-state { display: none; }
.scan-state.scan-state--active { display: block; }

/* ── Upload state ── */
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-10) var(--sp-6);
  background: var(--clr-surface-2);
  border: 2px dashed var(--clr-border);
  border-radius: var(--r-2xl);
  cursor: pointer;
  transition: border-color var(--t-base), background var(--t-base);
  margin-bottom: var(--sp-5);
}
.upload-area:hover {
  border-color: var(--clr-primary-hl);
  background: var(--clr-primary-light);
}
.upload-area:active { transform: scale(0.99); }

.upload-icon-wrap {
  width: 72px;
  height: 72px;
  background: var(--clr-primary-light);
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary);
  margin-bottom: var(--sp-4);
}
.upload-icon-wrap svg { width: 32px; height: 32px; }

.upload-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--sp-2);
}
.upload-hint {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  margin-bottom: var(--sp-1);
}
.upload-hint-small {
  font-size: var(--text-xs);
  color: var(--clr-text-faint);
  margin-bottom: var(--sp-5);
}
.upload-btn { pointer-events: none; }

/* Tips */
.scan-tips {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: var(--sp-4);
}
.scan-tips h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: var(--sp-3);
}
.scan-tips ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.scan-tips li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
}
.scan-tips li svg { width: 14px; height: 14px; color: var(--clr-primary); flex-shrink: 0; }

/* ── Parsing state ── */
.parsing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-12) var(--sp-6);
}
.parsing-sprig {
  width: 56px;
  height: 56px;
  color: var(--clr-primary);
  margin-bottom: var(--sp-5);
}
.parsing-sprig.spinning {
  animation: spinSlow 2s linear infinite;
}
.parsing-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--sp-2);
}
.parsing-hint {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  margin-bottom: var(--sp-6);
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--clr-surface-off);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: var(--sp-3);
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-primary-hover));
  border-radius: var(--r-full);
  transition: width 0.4s ease;
}
.parsing-step {
  font-size: var(--text-xs);
  color: var(--clr-text-faint);
  font-style: italic;
}

/* ── Results state ── */
.results-header {
  margin-bottom: var(--sp-5);
}
.results-store-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--clr-primary-light);
  color: var(--clr-primary);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  border: 1px solid var(--clr-primary-hl);
}
.store-badge svg { width: 12px; height: 12px; }
.results-total {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--clr-text);
}
.results-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--sp-1);
}
.results-date {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}

/* Parsed items list */
.parsed-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.parsed-item {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  animation: slideInUp 250ms ease both;
  box-shadow: var(--shadow-card);
}
/* Stagger animation for each item */
.parsed-item:nth-child(1) { animation-delay: 0ms; }
.parsed-item:nth-child(2) { animation-delay: 60ms; }
.parsed-item:nth-child(3) { animation-delay: 120ms; }
.parsed-item:nth-child(4) { animation-delay: 180ms; }
.parsed-item:nth-child(5) { animation-delay: 240ms; }
.parsed-item:nth-child(6) { animation-delay: 300ms; }
.parsed-item:nth-child(7) { animation-delay: 360ms; }
.parsed-item:nth-child(8) { animation-delay: 420ms; }

.parsed-item__category-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--clr-primary-hl);
  flex-shrink: 0;
}
.parsed-item__body { flex: 1; min-width: 0; }
.parsed-item__raw {
  font-size: var(--text-xs);
  color: var(--clr-text-faint);
  font-family: monospace;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.parsed-item__clean {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text);
}
.parsed-item__price {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text);
  white-space: nowrap;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}


/* ----------------------------------------------------------------
   9. LIST SCREEN
   ---------------------------------------------------------------- */

/* Meta strip */
.list-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) 0;
  flex-wrap: wrap;
}
.list-meta__store {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-primary);
}
.list-meta__store svg { width: 14px; height: 14px; }
.list-meta__sep { color: var(--clr-text-faint); }
.list-meta__day {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  font-weight: 500;
}
.list-meta__count {
  font-size: var(--text-xs);
  background: var(--clr-surface-off);
  color: var(--clr-text-muted);
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  border: 1px solid var(--clr-border);
}

/* Filter chips row */
.filter-chips-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  padding-bottom: var(--sp-3);
}
.filter-chips-row .chip {
  justify-content: center;
  text-align: center;
}

/* List section */
.list-section {
  margin-bottom: var(--sp-5);
}
.list-section__title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--clr-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: var(--sp-3);
  padding-left: var(--sp-2);
}

/* Individual list item */
.list-item {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  margin-bottom: var(--sp-2);
  overflow: hidden;
  transition: border-color var(--t-base);
  box-shadow: var(--shadow-card);
}
.list-item:hover { border-color: var(--clr-primary-hl); }

.list-item__row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
}

/* Custom checkbox */
.list-item__check {
  width: 22px;
  height: 22px;
  border-radius: var(--r-md);
  border: 2px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--t-base);
  background: transparent;
}
.list-item__check svg {
  width: 12px;
  height: 12px;
  color: white;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.list-item.checked .list-item__check {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
}
.list-item.checked .list-item__check svg { opacity: 1; }

.list-item__content { flex: 1; min-width: 0; }
.list-item__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--t-fast);
}
.list-item.checked .list-item__name {
  text-decoration: line-through;
  color: var(--clr-text-faint);
}
.list-item__qty {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  margin-top: 1px;
}
.list-item.checked .list-item__qty { color: var(--clr-text-faint); }
.list-item__cadence {
  font-size: var(--text-xs);
  color: var(--clr-text-faint);
  font-style: italic;
}

/* Leaf health badge */
.list-item__leaf {
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-primary-light);
  color: var(--clr-primary);
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--t-base), transform var(--t-fast);
  border: 1px solid var(--clr-primary-hl);
}
.list-item__leaf:hover {
  background: var(--clr-primary-hl);
  transform: scale(1.1);
}
.list-item__leaf.leaf--active {
  background: var(--clr-primary);
  color: white;
  border-color: var(--clr-primary);
}
.list-item__leaf svg { width: 14px; height: 14px; }

/* Expanded health alternative panel */
.health-alt-panel {
  display: none;
  background: var(--clr-primary-light);
  border-top: 1px solid var(--clr-primary-hl);
  padding: var(--sp-4);
  animation: slideDown 200ms ease both;
}
.health-alt-panel.panel--open {
  display: block;
}
.health-alt-panel__header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-3);
}
.health-alt-panel__header svg { width: 13px; height: 13px; }

.health-alt-product {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--sp-2);
}
.health-alt-reasons {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
}
.health-alt-reason {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}
.health-alt-reason svg { width: 12px; height: 12px; color: var(--clr-primary); flex-shrink: 0; margin-top: 2px; }

.health-alt-matches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-bottom: var(--sp-4);
}
.health-match-tag {
  font-size: 10px;
  font-weight: 600;
  background: var(--clr-primary-hl);
  color: var(--clr-primary-hover);
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  border: 1px solid var(--clr-primary-hl);
}

.health-alt-btns {
  display: flex;
  gap: var(--sp-2);
}

/* Add item button */
.add-item-btn {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: transparent;
  border: 1.5px dashed var(--clr-border);
  border-radius: var(--r-xl);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  cursor: pointer;
  transition: all var(--t-base);
  margin-bottom: var(--sp-4);
}
.add-item-btn:hover {
  border-color: var(--clr-primary-hl);
  color: var(--clr-primary);
  background: var(--clr-primary-light);
}
.add-item-btn svg { width: 16px; height: 16px; }

/* Add item inline input */
.add-item-input-row {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.add-item-input {
  flex: 1;
  padding: var(--sp-3) var(--sp-4);
  background: var(--clr-surface-2);
  border: 1.5px solid var(--clr-primary-hl);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  color: var(--clr-text);
  outline: none;
}
.add-item-input:focus { border-color: var(--clr-primary); }
.add-item-input::placeholder { color: var(--clr-text-faint); }

/* Done bar */
.list-done-bar {
  padding-top: var(--sp-2);
}


/* ----------------------------------------------------------------
   10. PROFILE SCREEN
   ---------------------------------------------------------------- */
.settings-section {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-card);
}
.settings-section__title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--sp-1);
}
.settings-section__hint {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  margin-bottom: var(--sp-4);
}

/* Store selector */
.store-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2);
}
.store-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-4) var(--sp-3);
  background: var(--clr-surface-off);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: all var(--t-base);
  text-align: center;
}
.store-option:hover { border-color: var(--clr-primary-hl); }
.store-option.selected {
  border-color: var(--clr-primary);
  background: var(--clr-primary-light);
}
.store-option__name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: 2px;
}
.store-option__city {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}
.store-option .selected-ring {
  display: none;
  width: 14px;
  height: 14px;
  border-radius: var(--r-full);
  background: var(--clr-primary);
  margin-bottom: var(--sp-2);
}
.store-option.selected .selected-ring {
  display: block;
}

/* Health toggles */
.health-toggles {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.health-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--clr-divider);
}
.health-toggle-item:last-child { border-bottom: none; }
.health-toggle-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--clr-text);
}
.health-toggle-desc {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  margin-top: 1px;
}

/* Household picker */
.household-picker {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.picker-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-muted);
  background: var(--clr-surface-off);
  cursor: pointer;
  transition: all var(--t-base);
}
.picker-btn:hover {
  border-color: var(--clr-primary-hl);
  color: var(--clr-primary);
  background: var(--clr-primary-light);
}
.picker-btn svg { width: 16px; height: 16px; }
.picker-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--clr-text);
  min-width: 2ch;
  text-align: center;
}
.picker-label {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
}

/* Day selector */
.day-selector {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.day-btn {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  border: 1.5px solid var(--clr-border);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--clr-text-muted);
  background: var(--clr-surface-off);
  cursor: pointer;
  transition: all var(--t-base);
}
.day-btn:hover { border-color: var(--clr-primary-hl); color: var(--clr-primary); }
.day-btn.day-selected {
  background: var(--clr-primary);
  color: white;
  border-color: var(--clr-primary);
  box-shadow: 0 2px 6px rgba(58, 107, 79, 0.3);
}

/* Privacy note */
.privacy-note {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--clr-surface-off);
  border-radius: var(--r-xl);
  margin-top: var(--sp-2);
}
.privacy-note svg {
  width: 18px;
  height: 18px;
  color: var(--clr-primary);
  flex-shrink: 0;
  margin-top: 2px;
}
.privacy-note p {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  line-height: 1.5;
}

/* Profile top section */
.profile-user {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) 0 var(--sp-5);
}
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--clr-primary-light), var(--clr-primary-hl));
  border: 2px solid var(--clr-primary-hl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
}
.profile-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--clr-text);
}
.profile-trips {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  margin-top: var(--sp-1);
}


/* ----------------------------------------------------------------
   11. ANIMATIONS
   ---------------------------------------------------------------- */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to   { opacity: 1; max-height: 400px; }
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
@keyframes checkPop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--clr-surface-off) 25%,
    var(--clr-border)      50%,
    var(--clr-surface-off) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--r-sm);
}


/* ----------------------------------------------------------------
   12. DARK MODE  (developer: add to [data-theme="dark"])
   ---------------------------------------------------------------- */
[data-theme="dark"] {
  --clr-bg:            #0d1a10;
  --clr-surface:       #121f15;
  --clr-surface-2:     #182a1c;
  --clr-surface-off:   #162018;
  --clr-border:        #263a2c;
  --clr-divider:       #1e3022;

  --clr-text:          #c2d9bc;
  --clr-text-muted:    #789870;
  --clr-text-faint:    #485e45;
  --clr-text-inv:      #0d1a10;

  --clr-primary:       #5aaa78;
  --clr-primary-hover: #70c090;
  --clr-primary-deep:  #3a8a58;
  --clr-primary-hl:    #1a3a26;
  --clr-primary-light: #142018;

  --clr-accent:        #dfb850;
  --clr-accent-light:  #3a3010;

  --clr-success:       #5aaa78;
  --clr-error:         #e06060;
  --clr-warning:       #e09840;

  --hero-grad-start:   #0d1f14;
  --hero-grad-mid:     #1a3a28;
  --hero-grad-end:     #2a5a3e;

  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:   0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* System dark mode fallback (when user hasn't toggled manually) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --clr-bg:            #0d1a10;
    --clr-surface:       #121f15;
    --clr-surface-2:     #182a1c;
    --clr-surface-off:   #162018;
    --clr-border:        #263a2c;
    --clr-divider:       #1e3022;
    --clr-text:          #c2d9bc;
    --clr-text-muted:    #789870;
    --clr-text-faint:    #485e45;
    --clr-text-inv:      #0d1a10;
    --clr-primary:       #5aaa78;
    --clr-primary-hover: #70c090;
    --clr-primary-deep:  #3a8a58;
    --clr-primary-hl:    #1a3a26;
    --clr-primary-light: #142018;
    --clr-accent:        #dfb850;
    --clr-accent-light:  #3a3010;
    --hero-grad-start:   #0d1f14;
    --hero-grad-mid:     #1a3a28;
    --hero-grad-end:     #2a5a3e;
    --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg:   0 12px 32px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.25);
  }
}

/* ================================================================
   THYME v2 — NEW COMPONENT STYLES
   Added for ThymePro features, welcome screen, and extended UI.
   Appended below the original styles.
   ================================================================ */


/* ----------------------------------------------------------------
   NAV UPDATE: 5 tabs
   ---------------------------------------------------------------- */
.bottom-nav {
  grid-template-columns: repeat(5, 1fr);
}

/* Pro tab — amber/gold accent when active */
.nav-item--pro { color: var(--clr-text-faint); }
.nav-item--pro.nav-item--active {
  color: var(--clr-accent);
}
.nav-item--pro.nav-item--active::after {
  background: var(--clr-accent);
}

/* Smaller nav labels for 5-tab layout */
.nav-label { font-size: 9px; }


/* ----------------------------------------------------------------
   WELCOME SCREEN
   ---------------------------------------------------------------- */
.screen-welcome {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--clr-bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  min-height: 100dvh;
  animation: none; /* No slide-in on welcome */
}
.screen-welcome.screen--hidden {
  display: none;
}

.welcome-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-8) var(--sp-6) var(--sp-10);
  max-width: 340px;
  margin: auto;
  width: 100%;
}

.welcome-sprig {
  width: 72px;
  height: 108px;
  color: var(--clr-primary);
  opacity: 0.85;
  margin-bottom: var(--sp-5);
}

.welcome-wordmark {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--clr-primary);
  margin-bottom: var(--sp-6);
}
.welcome-wordmark-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--clr-text);
}

.welcome-headline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 700;
  color: var(--clr-text);
  line-height: 1.1;
  margin-bottom: var(--sp-4);
  letter-spacing: -0.02em;
}

.welcome-sub {
  font-size: var(--text-base);
  color: var(--clr-text-muted);
  line-height: 1.6;
  margin-bottom: var(--sp-6);
  max-width: 280px;
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: flex-start;
  width: 100%;
  margin-bottom: var(--sp-8);
}
.welcome-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  text-align: left;
}
.welcome-feature svg { width: 15px; height: 15px; color: var(--clr-primary); flex-shrink: 0; margin-top: 3px; }

.welcome-ctas {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  width: 100%;
  margin-bottom: var(--sp-5);
}
.welcome-cta-btn { font-size: var(--text-base); padding: var(--sp-4) var(--sp-6); }

.welcome-footer {
  font-size: var(--text-xs);
  color: var(--clr-text-faint);
}

/* ----------------------------------------------------------------
   PRO TAG / BADGE (inline + standalone)
   ---------------------------------------------------------------- */
.pro-tag-inline {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: linear-gradient(135deg, #92400e, #b45309);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px var(--sp-2);
  border-radius: var(--r-full);
  white-space: nowrap;
}
.pro-tag-inline svg { width: 10px; height: 10px; }
.pro-tag-lg { font-size: var(--text-xs); padding: var(--sp-1) var(--sp-3); }
.pro-tag-lg svg { width: 13px; height: 13px; }

/* Pro plan teaser on home screen */
.pro-plan-teaser {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: var(--r-xl);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  cursor: pointer;
  transition: transform var(--t-fast);
}
.pro-plan-teaser:hover { transform: translateY(-1px); }
.pro-plan-text {
  flex: 1;
  font-size: var(--text-xs);
  font-weight: 500;
  color: #78350f;
}
.pro-plan-arrow { width: 14px; height: 14px; color: #b45309; }

[data-theme="dark"] .pro-plan-teaser {
  background: linear-gradient(135deg, #3a2a0e, #4a3010);
  border-color: #8a5e10;
}
[data-theme="dark"] .pro-plan-text { color: #fcd34d; }

/* Pro upgrade pill in profile header */
.pro-upgrade-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: linear-gradient(135deg, #92400e, #b45309);
  color: white;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  cursor: pointer;
  border: none;
  margin-left: auto;
  transition: opacity var(--t-fast);
}
.pro-upgrade-pill:hover { opacity: 0.9; }
.pro-upgrade-pill svg { width: 12px; height: 12px; }

/* ----------------------------------------------------------------
   PRO DASHBOARD COMPONENTS
   ---------------------------------------------------------------- */
.pro-screen-header {
  padding: var(--sp-4) 0 var(--sp-2);
}
.pro-screen-title { margin-bottom: var(--sp-1); }
.pro-screen-sub {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
}

.pro-section-card {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: border-color var(--t-base), transform var(--t-fast);
}
.pro-section-card:hover { border-color: var(--clr-primary-hl); }
.pro-section-card:active { transform: scale(0.99); }
.pro-section-card--muted { opacity: 0.7; cursor: default; }
.pro-section-card--muted:hover { border-color: var(--clr-border); transform: none; }

.pro-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.pro-card-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pro-card-icon svg { width: 18px; height: 18px; }
.pro-card-icon--plan      { background: var(--clr-primary-light); color: var(--clr-primary); }
.pro-card-icon--meals     { background: #fef3c7; color: #b45309; }
.pro-card-icon--savings   { background: #d1fae5; color: #065f46; }
.pro-card-icon--health    { background: #fee2e2; color: #b91c1c; }
.pro-card-icon--essentials{ background: #ede9fe; color: #6d28d9; }
.pro-card-icon--share     { background: var(--clr-surface-off); color: var(--clr-text-muted); }

[data-theme="dark"] .pro-card-icon--meals     { background: #3a2800; color: #fcd34d; }
[data-theme="dark"] .pro-card-icon--savings   { background: #0a2a1a; color: #34d399; }
[data-theme="dark"] .pro-card-icon--health    { background: #2a0a0a; color: #f87171; }
[data-theme="dark"] .pro-card-icon--essentials{ background: #1a0a2a; color: #a78bfa; }

.pro-card-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pro-card-title > span:first-child { font-size: var(--text-sm); font-weight: 600; color: var(--clr-text); }
.pro-card-sub { font-size: var(--text-xs); color: var(--clr-text-muted); }

.pro-card-arrow, .pro-view-all { color: var(--clr-text-faint); }
.pro-card-arrow { width: 16px; height: 16px; }
.pro-view-all {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--clr-primary);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  padding: var(--sp-1) 0;
}

.pro-card-stats {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.pro-stat {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  font-weight: 500;
}
.pro-stat svg { width: 12px; height: 12px; }
.pro-stat--savings { color: var(--clr-success); font-weight: 600; }

/* Recipe preview chips in pro dashboard */
.pro-recipe-preview {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.pro-recipe-preview::-webkit-scrollbar { display: none; }
.pro-recipe-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--clr-surface-off);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  min-width: 80px;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.pro-recipe-chip:hover { border-color: var(--clr-primary-hl); }
.pro-recipe-chip__emoji { font-size: 1.2rem; }
.pro-recipe-chip__name { font-size: 10px; font-weight: 600; color: var(--clr-text); text-align: center; }
.pro-recipe-chip__time { font-size: 9px; color: var(--clr-text-faint); }

/* Savings mini preview in pro dashboard */
.pro-savings-mini { display: flex; flex-direction: column; gap: var(--sp-1); margin-top: var(--sp-2); }
.pro-savings-mini-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  padding: var(--sp-1) 0;
  border-bottom: 1px solid var(--clr-divider);
}
.pro-savings-mini-row:last-child { border-bottom: none; }
.pro-savings-mini-row.best { color: var(--clr-success); font-weight: 600; }
.pro-savings-mini-row > span:first-child { flex: 1; }
.mini-total { font-weight: 600; }
.mini-save { color: var(--clr-success); font-weight: 600; background: var(--clr-primary-light); padding: 1px 5px; border-radius: var(--r-full); }
.mini-ref  { color: var(--clr-text-faint); font-size: 10px; }

/* Health mini in pro dashboard */
.pro-health-mini { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.health-mini-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
}
.health-mini-tag--good { background: var(--clr-primary-light); color: var(--clr-primary-hover); border: 1px solid var(--clr-primary-hl); }
.health-mini-tag--flag { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
[data-theme="dark"] .health-mini-tag--flag { background: #3a2500; color: #fcd34d; border-color: #5a3a10; }

/* Essentials mini in pro dashboard */
.pro-essentials-mini { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-2); }
.essential-mini-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
}
.essential-mini-name { flex: 1; color: var(--clr-text); }
.essential-mini-days { color: var(--clr-text-muted); font-weight: 500; }
.text-urgent { color: var(--clr-error); font-weight: 700; }

.essential-urgency-dot {
  width: 8px; height: 8px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}
.urgency-now  { background: var(--clr-error); }
.urgency-soon { background: var(--clr-accent); }
.urgency-fine { background: var(--clr-success); }

.pro-all-good { font-size: var(--text-xs); color: var(--clr-success); font-weight: 500; }
.pro-coming-soon {
  font-size: 10px; font-weight: 700; color: var(--clr-text-faint);
  background: var(--clr-surface-off);
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
}

/* ----------------------------------------------------------------
   RECIPE CARDS
   ---------------------------------------------------------------- */
.recipe-card {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  margin-bottom: var(--sp-3);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-base);
}
.recipe-card:hover { border-color: var(--clr-primary-hl); }
.recipe-card--open { border-color: var(--clr-primary-hl); }

.recipe-card__header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  cursor: pointer;
}
.recipe-emoji { font-size: 1.5rem; flex-shrink: 0; }
.recipe-info { flex: 1; min-width: 0; }
.recipe-name { font-size: var(--text-sm); font-weight: 600; color: var(--clr-text); }
.recipe-meta { font-size: var(--text-xs); color: var(--clr-text-muted); margin-top: 2px; }
.recipe-toggle-icon { width: 16px; height: 16px; color: var(--clr-text-faint); flex-shrink: 0; }

.recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  padding: 0 var(--sp-4) var(--sp-3);
}
.recipe-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--clr-primary-hover);
  background: var(--clr-primary-light);
  border: 1px solid var(--clr-primary-hl);
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
}

.recipe-detail {
  padding: 0 var(--sp-4) var(--sp-4);
  border-top: 1px solid var(--clr-divider);
  animation: slideInUp 200ms ease both;
}
.recipe-desc {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  line-height: 1.5;
  padding: var(--sp-3) 0;
  max-width: 100%;
}

.recipe-ingredients { display: flex; flex-direction: column; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.recipe-ing-group {}
.recipe-ing-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-2);
}
.recipe-ing-title svg { width: 13px; height: 13px; }
.recipe-ing-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  padding: var(--sp-1) 0;
}
.recipe-ing-item svg { width: 12px; height: 12px; flex-shrink: 0; }
.recipe-ing-item--have  svg { color: var(--clr-primary); }
.recipe-ing-item--missing svg { color: var(--clr-text-faint); }
.recipe-ing-item--have  span { color: var(--clr-text); }
.recipe-ing-item--missing span { color: var(--clr-text-muted); }
.ing-qty { color: var(--clr-text-faint); font-size: var(--text-xs); margin-left: auto; }

.btn--done { background: var(--clr-success) !important; cursor: default; }

/* ----------------------------------------------------------------
   SAVINGS SCREEN
   ---------------------------------------------------------------- */
.savings-banner {
  background: linear-gradient(135deg, var(--clr-primary-deep), var(--clr-primary));
  color: white;
  border-radius: var(--r-2xl);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-5);
}
.savings-banner__headline { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--sp-2); }
.savings-banner__sub { font-size: var(--text-sm); opacity: 0.85; }
.savings-banner__sub strong { font-weight: 700; }

.savings-table-card {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  overflow: hidden;
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-card);
}
.savings-table-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--clr-divider);
}
.savings-table {}
.savings-table-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  font-size: 10px;
  font-weight: 700;
  color: var(--clr-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--clr-divider);
}
.savings-table-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--clr-divider);
  transition: background var(--t-fast);
}
.savings-table-row:last-child { border-bottom: none; }
.savings-row--current { background: var(--clr-primary-light); }
.savings-row--best    { background: #d1fae5; }
[data-theme="dark"] .savings-row--best { background: #0a2a1a; }

.savings-store-name { font-size: var(--text-sm); font-weight: 600; color: var(--clr-text); display: flex; align-items: center; gap: var(--sp-2); }
.best-badge    { font-size: 9px; font-weight: 700; background: var(--clr-success); color: white; padding: 1px 5px; border-radius: var(--r-full); }
.current-badge { font-size: 9px; font-weight: 700; background: var(--clr-primary); color: white; padding: 1px 5px; border-radius: var(--r-full); }
.savings-total { font-size: var(--text-sm); font-weight: 700; color: var(--clr-text); }
.savings-diff  { font-size: var(--text-xs); font-weight: 600; white-space: nowrap; }
.savings-pos   { color: var(--clr-success); }
.savings-neg   { color: var(--clr-error); }
.savings-note  { font-size: 10px; color: var(--clr-text-faint); padding: var(--sp-2) var(--sp-4); font-style: italic; }

.deals-section { margin-bottom: var(--sp-5); }
.deals-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-3);
}
.deal-highlight-card {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: var(--sp-4);
  margin-bottom: var(--sp-2);
  box-shadow: var(--shadow-card);
}
.deal-item-name { font-size: var(--text-sm); font-weight: 600; color: var(--clr-text); margin-bottom: var(--sp-2); }
.deal-stores { display: flex; flex-direction: column; gap: var(--sp-1); }
.deal-store-row { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-xs); }
.deal-store-best { color: var(--clr-success); font-weight: 600; }
.deal-best-label  { font-weight: 700; background: var(--clr-success); color: white; padding: 1px 5px; border-radius: var(--r-full); font-size: 9px; }
.deal-your-label  { font-weight: 700; background: var(--clr-primary); color: white; padding: 1px 5px; border-radius: var(--r-full); font-size: 9px; }
.deal-store-row > span:nth-child(2) { flex: 1; color: var(--clr-text-muted); }
.deal-price       { font-weight: 700; color: var(--clr-text); }
.deal-price--yours{ color: var(--clr-text-muted); }
.deal-promo       { font-size: 9px; background: #fef3c7; color: #92400e; padding: 1px 5px; border-radius: var(--r-full); }
.deal-save        { font-size: 10px; color: var(--clr-success); font-weight: 700; }

/* ----------------------------------------------------------------
   HEALTH INSIGHTS SCREEN
   ---------------------------------------------------------------- */
.health-summary-card {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-card);
}
.health-summary-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--sp-3);
}
.health-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.health-summary-tag {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
}
.health-summary-tag svg { width: 11px; height: 11px; flex-shrink: 0; }
.health-summary-tag--good { background: var(--clr-primary-light); color: var(--clr-primary-hover); border: 1px solid var(--clr-primary-hl); }
.health-summary-tag--flag { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
[data-theme="dark"] .health-summary-tag--flag { background: #3a2500; color: #fcd34d; border-color: #5a3a10; }

.health-macros {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}
.health-macro {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-3);
  background: var(--clr-surface-off);
  border-radius: var(--r-lg);
  text-align: center;
}
.macro-label { font-size: 10px; color: var(--clr-text-faint); font-weight: 500; margin-bottom: var(--sp-1); }
.macro-value { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; color: var(--clr-text); }
.macro-sub   { font-size: 9px; color: var(--clr-text-faint); margin-top: 1px; }

.health-conflicts-card {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: var(--r-xl);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
[data-theme="dark"] .health-conflicts-card { background: #3a2500; border-color: #5a3a10; }
.health-section-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-3);
}
.health-section-title svg { width: 13px; height: 13px; }
.swaps-title { margin-top: var(--sp-2); margin-bottom: var(--sp-3); }
.health-conflict-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.health-conflict-item:last-child { border-bottom: none; }
.conflict-name { font-weight: 600; color: var(--clr-text); }
.conflict-goal { color: #92400e; font-weight: 500; }

/* Swap suggestion cards */
.swap-suggestion-card {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}
.swap-rank {
  width: 24px; height: 24px;
  border-radius: var(--r-full);
  background: var(--clr-primary-light);
  color: var(--clr-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  margin-bottom: var(--sp-3);
}
.swap-body {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.swap-from, .swap-to { flex: 1; }
.swap-from-label, .swap-to-label {
  font-size: 10px;
  color: var(--clr-text-faint);
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}
.swap-from-name { font-size: var(--text-sm); font-weight: 600; color: var(--clr-text-muted); }
.swap-to-name   { font-size: var(--text-sm); font-weight: 700; color: var(--clr-primary); }
.swap-arrow { width: 16px; height: 16px; color: var(--clr-text-faint); flex-shrink: 0; }
.swap-arrow svg { width: 16px; height: 16px; }
.swap-reasons { display: flex; flex-direction: column; gap: var(--sp-1); margin-bottom: var(--sp-2); }
.swap-reason {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}
.swap-reason svg { width: 11px; height: 11px; color: var(--clr-primary); flex-shrink: 0; margin-top: 2px; }
.swap-goals { display: flex; gap: var(--sp-1); flex-wrap: wrap; }

/* ----------------------------------------------------------------
   WEEKLY PLAN SCREEN
   ---------------------------------------------------------------- */
.plan-week-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) 0 var(--sp-3);
}
.plan-week-label { font-size: var(--text-sm); font-weight: 600; color: var(--clr-text); }
.plan-store {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  color: var(--clr-primary);
  font-weight: 600;
}
.plan-store svg { width: 13px; height: 13px; }

.plan-card {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-card);
}
.plan-card-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--sp-3);
}
.plan-card-title svg { width: 16px; height: 16px; color: var(--clr-primary); }
.plan-card-desc { font-size: var(--text-xs); color: var(--clr-text-muted); margin-bottom: var(--sp-3); }
.plan-card--settings { border-style: dashed; }
.plan-toggle { margin-top: var(--sp-2); }

.plan-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.plan-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-3);
  background: var(--clr-surface-off);
  border-radius: var(--r-lg);
}
.plan-stat-num { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; color: var(--clr-text); }
.plan-stat-lbl { font-size: 10px; color: var(--clr-text-faint); text-align: center; }
.plan-savings-tip {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--clr-success);
  font-weight: 600;
  background: #d1fae5;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-lg);
}
[data-theme="dark"] .plan-savings-tip { background: #0a2a1a; }
.plan-savings-tip svg { width: 13px; height: 13px; }

.plan-recipe-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--clr-divider);
  cursor: pointer;
}
.plan-recipe-row:last-of-type { border-bottom: none; }
.plan-recipe-emoji { font-size: 1.2rem; }
.plan-recipe-name  { flex: 1; font-size: var(--text-sm); font-weight: 500; color: var(--clr-text); }
.plan-recipe-meta  { font-size: var(--text-xs); color: var(--clr-text-faint); }

.plan-health-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.plan-health-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
}
.plan-health-tag--good { background: var(--clr-primary-light); color: var(--clr-primary-hover); border: 1px solid var(--clr-primary-hl); }
.plan-health-tag--flag { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

.plan-essential-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--clr-divider);
}
.plan-essential-row:last-child { border-bottom: none; }
.plan-essential-days { margin-left: auto; font-weight: 600; color: var(--clr-text-muted); }

/* ----------------------------------------------------------------
   UPGRADE / MARKETING SCREEN
   ---------------------------------------------------------------- */
.upgrade-hero {
  text-align: center;
  padding: var(--sp-6) 0 var(--sp-5);
}
.upgrade-pro-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: linear-gradient(135deg, #92400e, #b45309);
  color: white;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  margin-bottom: var(--sp-4);
}
.upgrade-pro-badge svg { width: 14px; height: 14px; }
.upgrade-headline {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  font-weight: 700;
  color: var(--clr-text);
  line-height: 1.15;
  margin-bottom: var(--sp-3);
  letter-spacing: -0.02em;
}
.upgrade-sub { font-size: var(--text-sm); color: var(--clr-text-muted); }

.upgrade-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  justify-content: center;
  margin-bottom: var(--sp-6);
}
.upgrade-benefit-pill {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-full);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--clr-text);
}

.upgrade-table-card {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  overflow: hidden;
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-card);
}
.upgrade-table-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--clr-text);
  padding: var(--sp-4) var(--sp-4) var(--sp-2);
}
.upgrade-table {}
.upgrade-table-header {
  display: grid;
  grid-template-columns: 1fr 40px 40px;
  padding: var(--sp-2) var(--sp-4);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-text-faint);
  border-bottom: 1px solid var(--clr-divider);
}
.upgrade-table-row {
  display: grid;
  grid-template-columns: 1fr 40px 40px;
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-xs);
  border-bottom: 1px solid var(--clr-divider);
  align-items: center;
}
.upgrade-table-row:last-child { border-bottom: none; }
.upgrade-table-divider { height: 1px; background: var(--clr-primary-hl); margin: var(--sp-1) 0; }
.check-free { color: var(--clr-text-muted); text-align: center; font-size: var(--text-sm); }
.check-pro  { color: var(--clr-primary); text-align: center; font-size: var(--text-sm); font-weight: 700; }
.check-none { color: var(--clr-text-faint); text-align: center; font-size: var(--text-sm); }
.pro-col    { color: var(--clr-primary); font-weight: 700; }

.upgrade-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.upgrade-feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--clr-primary-light);
  border: 1px solid var(--clr-primary-hl);
  border-radius: var(--r-xl);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--clr-primary-hover);
  text-align: center;
}
.upgrade-feature-card svg { width: 22px; height: 22px; color: var(--clr-primary); }

.upgrade-cta-section { margin-bottom: var(--sp-5); text-align: center; }
.upgrade-cta-btn { font-size: var(--text-base); padding: var(--sp-4) var(--sp-6); margin-bottom: var(--sp-3); }
.upgrade-pricing { font-size: var(--text-xs); color: var(--clr-text-muted); margin-bottom: var(--sp-2); }
.upgrade-trust  { font-size: 10px; color: var(--clr-text-faint); }

.upgrade-already-pro {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--clr-primary-light);
  border: 1px solid var(--clr-primary-hl);
  border-radius: var(--r-xl);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-xs);
  color: var(--clr-primary-hover);
  margin-bottom: var(--sp-6);
}
.upgrade-already-pro svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ----------------------------------------------------------------
   LOCATION SCREEN
   ---------------------------------------------------------------- */
.location-intro {
  text-align: center;
  padding: var(--sp-6) 0 var(--sp-5);
}
.location-intro-icon {
  width: 56px; height: 56px;
  background: var(--clr-primary-light);
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--clr-primary);
  margin: 0 auto var(--sp-4);
}
.location-intro-icon svg { width: 24px; height: 24px; }
.location-intro-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; color: var(--clr-text); margin-bottom: var(--sp-2); }
.location-intro-sub { font-size: var(--text-sm); color: var(--clr-text-muted); }

.location-input-group { margin-bottom: var(--sp-5); }
.location-input-label { font-size: var(--text-sm); font-weight: 600; color: var(--clr-text); display: block; margin-bottom: var(--sp-2); }
.location-input-row { display: flex; gap: var(--sp-2); }
.location-input {
  flex: 1;
  padding: var(--sp-3) var(--sp-4);
  background: var(--clr-surface-2);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  color: var(--clr-text);
  outline: none;
  transition: border-color var(--t-base);
}
.location-input:focus { border-color: var(--clr-primary); }

.location-stores-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-3);
}
.location-stores-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.location-store-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--clr-surface-2);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: border-color var(--t-base), background var(--t-base);
  box-shadow: var(--shadow-card);
}
.location-store-item:hover { border-color: var(--clr-primary-hl); }
.store-item--selected { border-color: var(--clr-primary); background: var(--clr-primary-light); }

.store-item-radio { flex-shrink: 0; }
.radio-dot {
  width: 18px; height: 18px;
  border-radius: var(--r-full);
  border: 2px solid var(--clr-border);
  transition: all var(--t-base);
}
.radio-dot--active {
  border-color: var(--clr-primary);
  background: var(--clr-primary);
  box-shadow: inset 0 0 0 3px white;
}

.store-item-info { flex: 1; min-width: 0; }
.store-item-name { font-size: var(--text-sm); font-weight: 600; color: var(--clr-text); }
.store-item-address { font-size: var(--text-xs); color: var(--clr-text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-1); flex-shrink: 0; }
.store-item-dist { font-size: var(--text-xs); color: var(--clr-text-muted); font-weight: 500; }
.store-item-deals {
  display: flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 700;
  color: #92400e; background: #fef3c7;
  padding: 1px 5px; border-radius: var(--r-full);
}
.store-item-deals svg { width: 9px; height: 9px; }

/* Location summary card in profile */
.location-summary {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--clr-surface-off);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: border-color var(--t-base);
}
.location-summary:hover { border-color: var(--clr-primary-hl); }
.location-summary-left { display: flex; align-items: center; gap: var(--sp-3); flex: 1; }
.location-summary-left svg { width: 18px; height: 18px; color: var(--clr-primary); flex-shrink: 0; }
.location-summary-city { font-size: var(--text-sm); font-weight: 600; color: var(--clr-text); }
.location-summary-store { font-size: var(--text-xs); color: var(--clr-text-muted); margin-top: 2px; }
.location-summary svg:last-child { width: 16px; height: 16px; color: var(--clr-text-faint); }

/* ----------------------------------------------------------------
   ESSENTIALS MANAGEMENT SCREEN
   ---------------------------------------------------------------- */
.essentials-intro {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  line-height: 1.6;
  margin-bottom: var(--sp-5);
}
.essentials-group-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-3);
}
.essentials-group-title svg { width: 13px; height: 13px; }
.essential-item-card {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-2xl);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow-card);
}
.essential-item-card--urgent { border-color: var(--clr-error); background: #fff5f5; }
[data-theme="dark"] .essential-item-card--urgent { background: #2a0a0a; }
.essential-item-top { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.essential-item-emoji { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.essential-item-info { flex: 1; }
.essential-item-name { font-size: var(--text-sm); font-weight: 700; color: var(--clr-text); }
.essential-item-brand { font-size: var(--text-xs); color: var(--clr-text-muted); margin-top: 2px; }
.essential-item-status { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-1); flex-shrink: 0; }
.urgency-pill {
  font-size: 10px; font-weight: 700;
  padding: 2px var(--sp-2); border-radius: var(--r-full); white-space: nowrap;
}
.urgency-pill--now  { background: #fee2e2; color: #b91c1c; }
.urgency-pill--soon { background: #fef3c7; color: #92400e; }
.urgency-pill--fine { background: var(--clr-primary-light); color: var(--clr-primary); }
[data-theme="dark"] .urgency-pill--now  { background: #2a0a0a; color: #f87171; }
[data-theme="dark"] .urgency-pill--soon { background: #3a2500; color: #fcd34d; }
.essential-item-days { font-size: 10px; color: var(--clr-text-faint); }

.essential-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--clr-divider);
  padding-top: var(--sp-3);
}
.essential-best-price { font-size: var(--text-xs); color: var(--clr-success); font-weight: 600; }
.essential-actions { display: flex; align-items: center; gap: var(--sp-3); }
.essential-always-keep {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  cursor: pointer;
}
.essential-always-keep input { accent-color: var(--clr-primary); }

/* ----------------------------------------------------------------
   LIST SCREEN UPDATES: deal badges + nutrition panels
   ---------------------------------------------------------------- */

/* Deal badge shown below item name */
.deal-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 10px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 2px var(--sp-2);
  border-radius: var(--r-full);
  margin-top: var(--sp-1);
}
.deal-badge svg { width: 9px; height: 9px; }
[data-theme="dark"] .deal-badge { background: #3a2500; color: #fcd34d; border-color: #5a3a10; }

/* Nutrition expand button */
.list-item__nutrition-btn {
  width: 26px; height: 26px;
  border-radius: var(--r-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-surface-off);
  color: var(--clr-text-faint);
  border: 1px solid var(--clr-border);
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--t-base);
}
.list-item__nutrition-btn:hover { background: var(--clr-surface-2); color: var(--clr-text-muted); border-color: var(--clr-primary-hl); }
.list-item__nutrition-btn.btn-active { background: var(--clr-primary-light); color: var(--clr-primary); border-color: var(--clr-primary-hl); }
.list-item__nutrition-btn svg { width: 12px; height: 12px; }

/* Nutrition panel (expandable inline) */
.nutrition-panel {
  display: none;
  background: var(--clr-surface-off);
  border-top: 1px solid var(--clr-divider);
  padding: var(--sp-3) var(--sp-4);
  animation: slideDown 200ms ease both;
}
.nutrition-panel.panel--open { display: block; }
.nutrition-panel__serving { font-size: 10px; color: var(--clr-text-faint); margin-bottom: var(--sp-2); }
.nutrition-panel__macros {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
}
.nutrition-macro-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-2);
  background: var(--clr-surface-2);
  border-radius: var(--r-sm);
}
.macro-num { font-size: var(--text-sm); font-weight: 700; color: var(--clr-text); }
.macro-key { font-size: 9px; color: var(--clr-text-faint); }
.nutrition-panel__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.nutr-tag {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--r-full);
}
.nutr-tag--good { background: var(--clr-primary-light); color: var(--clr-primary); border: 1px solid var(--clr-primary-hl); }
.nutr-tag--neutral { background: var(--clr-surface-2); color: var(--clr-text-muted); border: 1px solid var(--clr-border); }
.nutr-tag--flag { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* Essentials reminder strip on list screen */
.essentials-reminder {
  margin-bottom: var(--sp-4);
}
.essentials-reminder:empty { display: none; }
.essentials-reminder-card {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border: 1px solid #c4b5fd;
  border-radius: var(--r-xl);
  padding: var(--sp-3) var(--sp-4);
}
[data-theme="dark"] .essentials-reminder-card { background: linear-gradient(135deg, #1a0a2a, #2a1040); border-color: #4a3060; }
.essentials-reminder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.essentials-reminder-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: #4c1d95;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.essentials-reminder-title svg { width: 12px; height: 12px; }
[data-theme="dark"] .essentials-reminder-title { color: #a78bfa; }
.essentials-reminder-items { display: flex; flex-direction: column; gap: var(--sp-1); }
.essentials-reminder-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: #4c1d95;
}
[data-theme="dark"] .essentials-reminder-item { color: #c4b5fd; }
.essentials-reminder-item span:first-child { flex: 1; }
.reminder-add-btn {
  font-size: 10px;
  font-weight: 700;
  color: #6d28d9;
  background: rgba(109,40,217,0.12);
  border: 1px solid #c4b5fd;
  border-radius: var(--r-full);
  padding: 2px 8px;
  cursor: pointer;
  transition: background var(--t-fast);
  white-space: nowrap;
}
.reminder-add-btn:hover { background: rgba(109,40,217,0.2); }

/* ----------------------------------------------------------------
   EMPTY STATE
   ---------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--clr-text-faint);
  font-size: var(--text-sm);
}

/* ----------------------------------------------------------------
   FILTER "DEALS" CHIP STATE
   ---------------------------------------------------------------- */
/* filter-chips-row override removed */


/* ================================================================
   ONBOARDING CAROUSEL
   ================================================================ */

/* Full-page overlay, hidden by default */
.screen-onboarding {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--clr-bg);
  flex-direction: column;
  align-items: stretch;
  max-width: var(--app-max);
  left: 50%;
  transform: translateX(-50%);
}
.screen-onboarding.onb--visible {
  display: flex;
}

/* ── Top row: dots + skip ── */
.onb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-6) var(--sp-5) var(--sp-4);
  flex-shrink: 0;
}

.onb-dots {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.onb-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--clr-border);
  transition: all var(--t-base);
}
.onb-dot--active {
  width: 24px;
  background: var(--clr-primary);
}

.onb-skip {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--clr-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-1) 0;
  transition: color var(--t-fast);
}
.onb-skip:hover { color: var(--clr-text); }

/* ── Slide content area ── */
.onb-slide-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--sp-6) var(--sp-4);
  text-align: center;
  transition: opacity 180ms ease, transform 220ms ease;
}

/* Large icon circle */
.onb-icon-circle {
  width: 112px;
  height: 112px;
  border-radius: var(--r-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-8);
  flex-shrink: 0;
}
.onb-icon-circle svg {
  width: 48px;
  height: 48px;
}

.onb-headline {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2rem);
  font-weight: 700;
  color: var(--clr-text);
  line-height: 1.15;
  margin-bottom: var(--sp-4);
  letter-spacing: -0.02em;
}
.onb-body {
  font-size: var(--text-base);
  color: var(--clr-text-muted);
  line-height: 1.65;
  max-width: 300px;
}

/* Tip chip shown on some slides */
.onb-tip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--clr-primary-light);
  border: 1px solid var(--clr-primary-hl);
  color: var(--clr-primary-hover);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-full);
  margin-top: var(--sp-4);
}
.onb-tip svg { width: 13px; height: 13px; }

/* ── Bottom CTA ── */
.onb-footer {
  padding: var(--sp-4) var(--sp-5) var(--sp-8);
  flex-shrink: 0;
}
.onb-next-btn {
  font-size: var(--text-base);
  padding: var(--sp-4) var(--sp-6);
}
.onb-next-btn svg { width: 18px; height: 18px; }

/* ----------------------------------------------------------------
   HEADER BACK BUTTON
   ---------------------------------------------------------------- */
.header-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-full);
  background: var(--clr-surface-off);
  border: none;
  color: var(--clr-text);
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
  flex-shrink: 0;
}
.header-back-btn:hover  { background: var(--clr-border); }
.header-back-btn:active { transform: scale(0.94); }

/* ----------------------------------------------------------------
   LOCATION SCREEN — Store Search Bar & State Detection
   ---------------------------------------------------------------- */
.location-state-detected {
  font-size: var(--text-xs);
  color: var(--clr-primary);
  font-weight: 600;
  margin-top: var(--sp-2);
  padding-left: var(--sp-2);
}
.location-state-unknown {
  color: var(--clr-text-faint);
  font-weight: 400;
}

.store-search-row {
  margin-bottom: var(--sp-3);
}
.store-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.store-search-icon {
  position: absolute;
  left: var(--sp-3);
  width: 15px;
  height: 15px;
  color: var(--clr-text-faint);
  pointer-events: none;
  flex-shrink: 0;
}
.store-search-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-10) var(--sp-3) var(--sp-8);
  background: var(--clr-surface-2);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-full);
  font-size: var(--text-sm);
  color: var(--clr-text);
  outline: none;
  transition: border-color var(--t-base);
}
.store-search-input:focus { border-color: var(--clr-primary); }
.store-search-input::placeholder { color: var(--clr-text-faint); }

.store-search-clear {
  position: absolute;
  right: var(--sp-2);
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--clr-surface-off);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--clr-text-muted);
  transition: background var(--t-fast);
}
.store-search-clear:hover { background: var(--clr-border); }
.store-search-clear svg { width: 12px; height: 12px; }

/* "Not available in state" count label */
.location-stores-filtered {
  font-size: 10px;
  color: var(--clr-text-faint);
  font-weight: 400;
  margin-left: var(--sp-2);
}

/* Make the store list scrollable when there are many results */
.location-stores-list {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--clr-border) transparent;
}
.location-stores-list::-webkit-scrollbar { width: 4px; }
.location-stores-list::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 2px; }

/* ----------------------------------------------------------------
   LIST SCREEN — Top Search / Add Bar & Autocomplete
   ---------------------------------------------------------------- */
.list-add-bar {
  position: relative;
  margin-bottom: var(--sp-4);
}

.list-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.list-search-icon {
  position: absolute;
  left: var(--sp-4);
  width: 16px;
  height: 16px;
  color: var(--clr-primary);
  pointer-events: none;
  flex-shrink: 0;
}
.list-search-input {
  flex: 1;
  min-width: 0;
  padding: var(--sp-4) var(--sp-10) var(--sp-4) var(--sp-10);
  background: var(--clr-surface-2);
  border: 2px solid var(--clr-primary-hl);
  border-radius: var(--r-2xl);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--clr-text);
  outline: none;
  transition: border-color var(--t-base), box-shadow var(--t-base);
  box-shadow: var(--shadow-sm);
}
.list-search-input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-light);
}
.list-search-input::placeholder {
  color: var(--clr-text-faint);
  font-weight: 400;
}
.list-search-clear {
  position: absolute;
  right: var(--sp-3);
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--clr-surface-off);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--clr-text-muted);
  transition: background var(--t-fast);
}
.list-search-clear:hover { background: var(--clr-border); }
.list-search-clear svg   { width: 13px; height: 13px; }

/* Autocomplete dropdown */
.list-search-dropdown {
  position: absolute;
  top: calc(100% + var(--sp-2));
  left: 0;
  right: 0;
  background: var(--clr-surface-2);
  border: 1.5px solid var(--clr-primary-hl);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  overflow: hidden;
  animation: slideInUp 150ms ease both;
  max-height: 320px;
  overflow-y: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  transition: background var(--t-fast);
  border-bottom: 1px solid var(--clr-divider);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.dropdown-item--highlighted {
  background: var(--clr-primary-light);
  outline: none;
}
.dropdown-item:active { background: var(--clr-primary-hl); }

.dropdown-item-emoji {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.dropdown-item-text { flex: 1; min-width: 0; }
.dropdown-item-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-item-brand {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.store-brand-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--clr-primary-light);
  color: var(--clr-primary);
  border: 1px solid var(--clr-primary-hl);
  padding: 1px 5px;
  border-radius: var(--r-full);
}
.dropdown-item-category {
  font-size: 10px;
  color: var(--clr-text-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

/* "Add custom item" row at bottom of dropdown */
.dropdown-item--custom {
  border-top: 1px solid var(--clr-divider);
  background: var(--clr-surface-off);
}
.dropdown-item--custom:hover { background: var(--clr-primary-light); }
.dropdown-item--custom .dropdown-item-name { color: var(--clr-primary); }
.dropdown-item--custom svg {
  width: 14px; height: 14px;
  color: var(--clr-primary);
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   AUTOCOMPLETE — Category Group Header
   ---------------------------------------------------------------- */
.dropdown-category-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--clr-primary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--clr-primary-light);
  border-bottom: 1px solid var(--clr-primary-hl);
  position: sticky;
  top: 0;
}
.dropdown-category-header svg { width: 12px; height: 12px; }
.dropdown-cat-count {
  font-weight: 500;
  color: var(--clr-primary);
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.75;
}

/* ================================================================
   WELCOME SCREEN — Sign-Up Form
   ================================================================ */

.welcome-signup-area {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  width: 100%;
}

.signup-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.signup-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-left: var(--sp-1);
}
.signup-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--clr-surface-2);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-xl);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--clr-text);
  outline: none;
  transition: border-color var(--t-base), box-shadow var(--t-base);
  box-shadow: var(--shadow-sm);
}
.signup-input:focus {
  border-color: var(--clr-primary);
  box-shadow: 0 0 0 3px var(--clr-primary-light);
}
.signup-input::placeholder { color: var(--clr-text-faint); font-weight: 400; }

/* Email / Phone toggle tabs */
.contact-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}
.contact-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-full);
  border: 1.5px solid var(--clr-border);
  background: var(--clr-surface-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text-muted);
  cursor: pointer;
  transition: all var(--t-base);
}
.contact-tab svg { width: 14px; height: 14px; }
.contact-tab:hover { border-color: var(--clr-primary-hl); color: var(--clr-primary); }
.contact-tab--active {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(58,107,79,0.3);
}

/* Divider between submit and sign-in */
.signup-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-1) 0;
}
.signup-divider::before,
.signup-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--clr-divider);
}
.signup-divider span {
  font-size: var(--text-xs);
  color: var(--clr-text-faint);
  font-weight: 500;
}

/* Success state shown after sign-up */
.signup-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-6) 0;
  animation: slideInUp 300ms ease both;
}
.signup-success-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--r-full);
  background: var(--clr-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: var(--sp-5);
  box-shadow: 0 4px 16px rgba(58,107,79,0.35);
  animation: checkPop 400ms cubic-bezier(0.16,1,0.3,1) both;
}
.signup-success-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--sp-3);
}
.signup-success-msg {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  line-height: 1.6;
}
.signup-success-msg strong {
  color: var(--clr-primary);
  font-weight: 600;
}
.signup-success-sub {
  font-size: var(--text-xs);
  color: var(--clr-text-faint);
  margin-top: var(--sp-2);
}

/* Input error state */
.signup-input.input--error {
  border-color: var(--clr-error);
  box-shadow: 0 0 0 3px rgba(184,60,60,0.1);
}

/* ================================================================
   WELCOME SCREEN — Sign-In Form
   ================================================================ */
.signin-back-row {
  margin-bottom: var(--sp-4);
}
.signin-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-1) 0;
  transition: color var(--t-fast);
}
.signin-back-btn:hover { color: var(--clr-text); }
.signin-back-btn svg  { flex-shrink: 0; }

.signin-heading {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--sp-1);
  letter-spacing: -0.01em;
}
.signin-subhead {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  margin-bottom: var(--sp-5);
}

/* Password field with show/hide toggle */
.signin-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.signin-password-wrap .signup-input {
  padding-right: var(--sp-10);
}
.signin-show-pw {
  position: absolute;
  right: var(--sp-3);
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--clr-text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast);
}
.signin-show-pw:hover { color: var(--clr-text-muted); }
.signin-show-pw svg { width: 16px; height: 16px; }

.signin-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: calc(var(--sp-1) * -1);
  margin-bottom: var(--sp-1);
}

/* Prototype disclaimer note */
.signin-proto-note {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: 10px;
  color: var(--clr-text-faint);
  line-height: 1.5;
  background: var(--clr-surface-off);
  border-radius: var(--r-lg);
  padding: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-2);
}
.signin-proto-note svg { width: 12px; height: 12px; flex-shrink: 0; margin-top: 1px; }

/* ----------------------------------------------------------------
   CREATE ACCOUNT FORM — Name row + Terms
   ---------------------------------------------------------------- */
.name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.signup-terms {
  font-size: 10px;
  color: var(--clr-text-faint);
  text-align: center;
  line-height: 1.6;
  margin-top: var(--sp-2);
}

/* ================================================================
   PLAN COMPARISON  (profile tab — Free vs ThymePro)
   ================================================================ */

#plan-section {
  margin: 0 0 var(--sp-4);
}

/* Free-tier header row: badge + upgrade pill */
.plan-free-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--clr-surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--clr-border);
}

.plan-free-badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--clr-text-muted);
  background: var(--clr-surface-off);
  border: 1px solid var(--clr-border);
  border-radius: 99px;
  padding: 4px 10px;
  letter-spacing: 0.03em;
}

.plan-compare-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-2);
  padding: 0 var(--sp-1);
}

/* 2-column grid */
.plan-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.plan-col {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.plan-col--pro {
  border-color: #b45309;
  background: #fffbf2;
}
[data-theme="dark"] .plan-col--pro {
  background: rgba(180, 83, 9, 0.08);
  border-color: rgba(180, 83, 9, 0.4);
}

.plan-col-head {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: var(--sp-2) var(--sp-3);
  background: var(--clr-surface-off);
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--clr-border);
}

.plan-col--pro .plan-col-head {
  background: #fef3c7;
  color: #92400e;
  border-bottom-color: #fde68a;
}
[data-theme="dark"] .plan-col--pro .plan-col-head {
  background: rgba(180, 83, 9, 0.15);
  color: #fbbf24;
  border-bottom-color: rgba(180, 83, 9, 0.3);
}

/* Individual feature row */
.plan-feat {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  line-height: 1.35;
  padding: 5px var(--sp-3);
  border-bottom: 1px solid var(--clr-border);
}
.plan-feat:last-child { border-bottom: none; }

.plan-feat svg { width: 12px; height: 12px; flex-shrink: 0; margin-top: 1px; }

.plan-feat--ok   { color: var(--clr-text); }
.plan-feat--ok svg { color: var(--clr-primary); }
.plan-feat--pro  { color: #92400e; }
[data-theme="dark"] .plan-feat--pro { color: #fbbf24; }
.plan-feat--pro svg { color: #b45309; }
.plan-feat--locked { color: var(--clr-text-faint); }
.plan-feat--locked svg { color: var(--clr-text-faint); }

/* Pro active banner (shown when user is Pro) */
.plan-active-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(135deg, #fef3c7 0%, #fffbf0 100%);
  border: 1px solid #fde68a;
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-3);
}
[data-theme="dark"] .plan-active-banner {
  background: linear-gradient(135deg, rgba(180,83,9,0.15) 0%, rgba(146,64,14,0.08) 100%);
  border-color: rgba(180,83,9,0.35);
}

.plan-active-label {
  font-size: var(--text-xs);
  color: #92400e;
  font-weight: 500;
  margin-left: auto;
}
[data-theme="dark"] .plan-active-label { color: #fbbf24; }

.plan-features-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
}

/* ================================================================
   PRO BLUR / TEASE  (free-tier Pro tab overlay)
   ================================================================ */

/* Preview card — first card shown fully with lock icon */
.pro-tease-preview {
  opacity: 0.9;
}
.pro-lock-icon {
  color: #b45309 !important;
  opacity: 0.7;
}

/* Wrapper containing blurred cards + fade + CTA */
.pro-blur-wrapper {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* The blurred inner cards */
.pro-blur-inner {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  opacity: 0.55;
}

/* Gradient that fades the blurred content into the upgrade card */
.pro-blur-fade {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 72%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(242, 241, 234, 0.60) 50%,
    rgba(242, 241, 234, 0.97) 100%
  );
  pointer-events: none;
}
[data-theme="dark"] .pro-blur-fade {
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(28, 28, 24, 0.60) 50%,
    rgba(28, 28, 24, 0.97) 100%
  );
}

/* Upgrade CTA card floats above the blur */
.pro-upgrade-cta-card {
  position: relative;
  z-index: 2;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-4);
  margin-top: calc(-1 * var(--sp-2));
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  text-align: center;
}

.pro-upgrade-cta-headline {
  font-family: var(--font-display, 'Zodiak', serif);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--clr-text);
  margin: 0 0 var(--sp-2);
}

.pro-upgrade-cta-body {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  line-height: 1.6;
  margin: 0 0 var(--sp-3);
  padding: 0 var(--sp-2);
}

/* Perk chips row */
.pro-upgrade-cta-perks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.pro-upgrade-cta-perks span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border-radius: 99px;
  padding: 4px 10px;
}
[data-theme="dark"] .pro-upgrade-cta-perks span {
  color: #fbbf24;
  background: rgba(180,83,9,0.15);
}
.pro-upgrade-cta-perks svg {
  width: 12px; height: 12px;
}

.pro-upgrade-cta-fine {
  font-size: 10px;
  color: var(--clr-text-faint);
  margin-top: var(--sp-2);
}

/* ================================================================
   ALLERGY SETUP SCREEN
   ================================================================ */

#screen-allergies {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.allergy-scroll {
  padding: var(--sp-4) var(--sp-4) var(--sp-8);
  max-width: 520px;
  margin: 0 auto;
}

/* Hero */
.allergy-hero {
  text-align: center;
  padding: var(--sp-5) 0 var(--sp-4);
}
.allergy-shield-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-3);
  color: var(--clr-primary);
}
.allergy-shield-wrap svg { width: 30px; height: 30px; }

.allergy-title {
  font-family: var(--font-display, 'Zodiak', serif);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--clr-text);
  margin: 0 0 var(--sp-2);
  line-height: 1.25;
}
.allergy-sub {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

/* Family member tabs */
.allergy-member-tabs {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}
.allergy-member-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--clr-text-muted);
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: 99px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.allergy-member-tab svg { width: 13px; height: 13px; }
.allergy-member-tab--active {
  color: var(--clr-primary);
  border-color: var(--clr-primary);
  background: rgba(58, 107, 79, 0.08);
}

/* Add member inline form */
.allergy-add-member-form {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  margin-bottom: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
}
.allergy-name-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--clr-text);
  outline: none;
}
.allergy-name-input::placeholder { color: var(--clr-text-faint); }

/* Search row */
.allergy-search-row {
  margin-bottom: var(--sp-4);
}

/* Allergen groups */
.allergen-group {
  margin-bottom: var(--sp-4);
}
.allergen-group-head {
  margin-bottom: var(--sp-2);
}
.allergen-group-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.allergen-group-label svg { width: 12px; height: 12px; }
.allergen-group-note {
  display: block;
  font-size: 10px;
  color: var(--clr-text-faint);
  margin-top: 2px;
}

/* Chip grid */
.allergen-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.allergen-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 99px;
  border: 1.5px solid var(--clr-border);
  background: var(--clr-surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--clr-text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.allergen-chip:hover {
  border-color: var(--clr-primary);
  background: rgba(58,107,79,0.05);
}
.allergen-chip__emoji { font-size: 15px; }
.allergen-chip__check { width: 13px; height: 13px; color: #fff; margin-left: 2px; }

.allergen-chip--on {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: #fff;
}
.allergen-chip--on:hover {
  background: #2d5540;
  border-color: #2d5540;
}

.allergy-no-results {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  text-align: center;
  padding: var(--sp-4);
}

/* Selected allergen bar */
.allergy-selected-bar {
  margin: var(--sp-3) 0;
}
.allergy-selected-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-text-muted);
  margin-bottom: var(--sp-2);
}
.allergy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.allergy-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.2);
}
[data-theme="dark"] .allergy-tag { background: rgba(220,38,38,0.15); color: #fca5a5; }
.allergy-tag button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  color: inherit;
  opacity: 0.7;
}
.allergy-tag button svg { width: 12px; height: 12px; }

/* CTA section */
.allergy-cta-wrap {
  margin-top: var(--sp-5);
}
.allergy-footer-note {
  text-align: center;
  font-size: 11px;
  color: var(--clr-text-faint);
  margin-top: var(--sp-3);
}

/* ================================================================
   ALLERGY FLAG BADGE  (on grocery list items)
   ================================================================ */

.allergy-flag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.09);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 99px;
  padding: 2px 7px;
  margin-top: 3px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="dark"] .allergy-flag-badge {
  background: rgba(220,38,38,0.15);
  color: #fca5a5;
  border-color: rgba(220,38,38,0.3);
}
.allergy-flag-badge svg { width: 10px; height: 10px; flex-shrink: 0; }

/* ================================================================
   VOICE CAPTURE BUTTON  (list search bar)
   ================================================================ */

.voice-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--clr-surface-off);
  color: var(--clr-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  margin-left: 4px;
}
.voice-btn svg { width: 16px; height: 16px; }
.voice-btn:hover {
  background: var(--clr-primary);
  color: #fff;
}
.voice-btn--listening {
  background: #dc2626 !important;
  color: #fff !important;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.25);
  animation: pulse-mic 1s ease infinite;
}
@keyframes pulse-mic {
  0%, 100% { box-shadow: 0 0 0 4px rgba(220,38,38,0.25); }
  50%       { box-shadow: 0 0 0 8px rgba(220,38,38,0.10); }
}

/* ================================================================
   CROSS-REFERENCE BANNER  (home screen, after receipt scan)
   ================================================================ */

.crossref-banner {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: var(--sp-4) 0 0;
}
.crossref-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--clr-surface-off);
  border-bottom: 1px solid var(--clr-border);
}
.crossref-header svg { width: 16px; height: 16px; color: var(--clr-primary); flex-shrink: 0; }
.crossref-headline {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--clr-text);
}
.crossref-close {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--clr-text-muted);
  display: flex;
}
.crossref-close svg { width: 14px; height: 14px; }

.crossref-section {
  padding: var(--sp-2) var(--sp-4);
  border-top: 1px solid var(--clr-border);
}
.crossref-section-title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-1);
}
.crossref-section--missed .crossref-section-title { color: #b45309; }
.crossref-section--extra  .crossref-section-title { color: var(--clr-text-muted); }
.crossref-section-title svg { width: 11px; height: 11px; }
.crossref-row {
  font-size: var(--text-xs);
  color: var(--clr-text);
  padding: 2px 0;
  text-transform: capitalize;
}
.crossref-more {
  font-size: 11px;
  color: var(--clr-text-faint);
  margin-top: 2px;
}

/* ================================================================
   NEW PRODUCT RECOMMENDATIONS  (home screen)
   ================================================================ */

.new-products-based-on {
  font-size: 11px;
  color: var(--clr-text-faint);
}

.new-products-scroll {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--sp-2);
  scrollbar-width: none;
}
.new-products-scroll::-webkit-scrollbar { display: none; }

.new-product-card {
  flex-shrink: 0;
  width: 144px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.new-product-badge {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 99px;
}
.new-product-badge--new      { background: #dcfce7; color: #15803d; }
.new-product-badge--trending { background: #fef3c7; color: #92400e; }
.new-product-badge--popular  { background: #ede9fe; color: #6d28d9; }
.new-product-badge--featured { background: #dbeafe; color: #1d4ed8; }
[data-theme="dark"] .new-product-badge--new      { background: rgba(21,128,61,0.2);  color: #86efac; }
[data-theme="dark"] .new-product-badge--trending { background: rgba(146,64,14,0.2);  color: #fcd34d; }
[data-theme="dark"] .new-product-badge--popular  { background: rgba(109,40,217,0.2); color: #c4b5fd; }
[data-theme="dark"] .new-product-badge--featured { background: rgba(29,78,216,0.2);  color: #93c5fd; }

.new-product-emoji {
  font-size: 28px;
  margin-bottom: 2px;
}
.new-product-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--clr-text);
  line-height: 1.3;
  padding-right: 28px; /* avoid badge overlap */
}
.new-product-brand {
  font-size: 11px;
  color: var(--clr-text-muted);
}
.new-product-price {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--clr-primary);
  margin-top: 2px;
}
.new-product-reason {
  font-size: 10px;
  color: var(--clr-text-faint);
  line-height: 1.4;
}
.new-product-add {
  margin-top: var(--sp-2);
  width: 100%;
  padding: 6px 0;
  background: var(--clr-surface-off);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-md);
  font-size: 11px;
  font-weight: 600;
  color: var(--clr-primary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.new-product-add:hover {
  background: var(--clr-primary);
  color: #fff;
  border-color: var(--clr-primary);
}

/* ================================================================
   ALLERGY SETTINGS CARD  (profile tab)
   ================================================================ */

.allergy-settings-card {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: var(--sp-3) var(--sp-3);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.allergy-settings-card:hover {
  border-color: var(--clr-primary);
  background: rgba(58,107,79,0.04);
}
.allergy-settings-card:active {
  background: rgba(58,107,79,0.08);
}

.allergy-settings-card__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(58,107,79,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-primary);
}
.allergy-settings-card__icon svg { width: 17px; height: 17px; }

.allergy-settings-card__body {
  flex: 1;
  min-width: 0;
}

.allergy-settings-card__empty {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.allergy-settings-card__cta {
  font-size: var(--text-xs);
  color: var(--clr-primary);
  font-weight: 600;
}

.allergy-settings-card__arrow {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--clr-text-faint);
  margin-top: 2px;
}

/* Per-person row inside the card */
.allergy-setting-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--sp-2);
}
.allergy-setting-row:last-child { margin-bottom: 0; }
.allergy-setting-row__who {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-text-muted);
}

.allergy-setting-member {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--clr-border);
}
.allergy-setting-member__name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-text-muted);
}
.allergy-setting-member__name svg { width: 11px; height: 11px; }

/* Chips inside the card */
.allergy-setting-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.allergy-setting-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(220, 38, 38, 0.07);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.15);
}
[data-theme="dark"] .allergy-setting-chip {
  background: rgba(220,38,38,0.15);
  color: #fca5a5;
}
.allergy-setting-more {
  font-size: 11px;
  color: var(--clr-text-faint);
  align-self: center;
}
.allergy-setting-none {
  font-size: 11px;
  color: var(--clr-text-faint);
}

/* Members note below the card */
.allergy-settings-members-note {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--clr-text-faint);
  margin-top: var(--sp-2);
}
.allergy-settings-members-note svg { width: 12px; height: 12px; }

/* ================================================================
   ALLERGEN INFO TOOLTIP + OTHER CUSTOM INPUT
   ================================================================ */

/* Group header top row: label + info icon */
.allergen-group-head__top {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* Info icon button */
.allergen-info-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--clr-border);
  background: var(--clr-surface);
  color: var(--clr-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}
.allergen-info-btn svg { width: 12px; height: 12px; }
.allergen-info-btn:hover {
  border-color: var(--clr-primary);
  color: var(--clr-primary);
  background: rgba(58,107,79,0.06);
}

/* Info panel (toggled open/closed) */
.allergen-info-panel {
  margin-top: var(--sp-2);
  padding: var(--sp-3);
  background: rgba(58, 107, 79, 0.06);
  border: 1px solid rgba(58, 107, 79, 0.15);
  border-radius: var(--r-md);
  animation: fadeSlideIn 0.2s ease;
}
[data-theme="dark"] .allergen-info-panel {
  background: rgba(58, 107, 79, 0.12);
  border-color: rgba(58, 107, 79, 0.25);
}
.allergen-info-panel p {
  font-size: 12px;
  line-height: 1.65;
  color: var(--clr-text);
  margin: 0;
}

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

/* "Other" custom allergen section */
.allergen-group--other {
  border-top: 1px solid var(--clr-border);
  padding-top: var(--sp-4);
  margin-top: var(--sp-2);
}

.custom-allergen-row {
  margin-top: var(--sp-2);
}
.custom-allergen-input-wrap {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}
.custom-allergen-input {
  flex: 1;
  padding: 9px 12px;
  font-size: var(--text-sm);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-lg);
  background: var(--clr-surface);
  color: var(--clr-text);
  outline: none;
  transition: border-color 0.15s;
}
.custom-allergen-input::placeholder { color: var(--clr-text-faint); }
.custom-allergen-input:focus { border-color: var(--clr-primary); }

.custom-allergen-add-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--clr-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.custom-allergen-add-btn svg { width: 16px; height: 16px; }
.custom-allergen-add-btn:hover { background: #2d5540; }

/* Custom allergen chips look slightly different */
.allergen-chip--custom {
  border-style: dashed;
}

/* Custom allergen chip with remove (X) button */
.allergen-chip-wrap {
  display: inline-flex;
  position: relative;
}
.allergen-chip-wrap--custom {
  position: relative;
}

.allergen-chip__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--clr-border);
  background: var(--clr-surface);
  color: #b91c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.allergen-chip__remove svg { width: 10px; height: 10px; }
.allergen-chip__remove:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

/* ================================================================
   EMPTY STATES
   ================================================================ */
.home-empty-state, .list-empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
}
.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(58,107,79,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-4);
  color: var(--clr-primary);
}
.empty-state-icon svg { width: 28px; height: 28px; }
.empty-state-title {
  font-family: var(--font-display, 'Zodiak', serif);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--clr-text);
  margin: 0 0 var(--sp-2);
}
.empty-state-sub {
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  line-height: 1.6;
  margin: 0 0 var(--sp-4);
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}
.empty-state-actions {
  max-width: 280px;
  margin: 0 auto var(--sp-3);
}
.empty-state-hint {
  font-size: 11px;
  color: var(--clr-text-faint);
}

/* Sign Out modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--clr-surface);
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-5);
  max-width: 300px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.modal-message {
  font-family: var(--font-display, 'Zodiak', serif);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--clr-text);
  margin: 0 0 var(--sp-5);
}
.modal-actions {
  display: flex;
  gap: var(--sp-3);
}
.modal-btn {
  flex: 1;
}
.signout-btn {
  color: #b91c1c;
  border-color: rgba(220,38,38,0.2);
}
.signout-btn:hover {
  background: rgba(220,38,38,0.08);
  border-color: #b91c1c;
}
.signout-btn svg { width: 16px; height: 16px; }

/* Location autocomplete suggestions */
.location-suggestions {
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-lg);
  margin-top: var(--sp-1);
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.location-suggestion {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--clr-text);
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--clr-border);
}
.location-suggestion:last-child { border-bottom: none; }
.location-suggestion:hover { background: rgba(58,107,79,0.06); }
.location-suggestion svg { width: 14px; height: 14px; color: var(--clr-primary); flex-shrink: 0; }

.store-distance {
  font-size: 11px;
  font-weight: 600;
  color: var(--clr-primary);
  margin-top: 2px;
}
