/* ==========================================================================
   DishDecipher — Lively & Alert Culinary Intelligence Design System
   Bright, warm, delicious, and energetic. Zero drab blue.
   ========================================================================== */

/* Fonts loaded in parallel via index.html preconnect */

:root {
  /* Lively Warm Culinary Canvas (Fresh, inviting, alert) */
  --bg-main: #faf6f0;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #fff9f2;
  --bg-glass: rgba(255, 255, 255, 0.94);
  
  --border-subtle: rgba(234, 88, 12, 0.14);
  --border-active: rgba(234, 88, 12, 0.5);
  --border-glow: rgba(245, 158, 11, 0.28);
  
  /* Rich, crisp high-contrast text */
  --text-primary: #1c1917;     /* Deep Espresso Charcoal */
  --text-secondary: #57534e;   /* Warm Roasted Chestnut */
  --text-muted: #78716c;       /* Muted Slate */
  
  /* Vibrant, Alert Foodie Accents (Zero blue!) */
  --flame-500: #ff5722;        /* Spicy Paprika Flame */
  --flame-600: #ea580c;
  --amber-400: #f59e0b;        /* Golden Honey */
  --amber-500: #d97706;
  --amber-600: #b45309;
  
  --emerald-400: #10b981;      /* Fresh Garden Basil */
  --emerald-500: #059669;
  --emerald-bg: #ecfdf5;
  --rose-400: #f43f5e;         /* Ripe San Marzano Tomato */
  --rose-500: #e11d48;
  --rose-bg: #fff1f2;
  --purple-400: #8b5cf6;       /* Royal Plum / Aubergine */
  --purple-500: #7c3aed;
  --purple-bg: #f5f3ff;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(180, 83, 9, 0.08);
  --shadow-md: 0 8px 24px rgba(180, 83, 9, 0.10);
  --shadow-lg: 0 16px 36px rgba(180, 83, 9, 0.14);
  --shadow-glow: 0 0 25px rgba(255, 87, 34, 0.18);
  --shadow-glow-active: 0 0 35px rgba(255, 87, 34, 0.32);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Warm ambient glowing blobs (Golden saffron and sunny peach - NO blue!) */
.ambient-glow-1 {
  position: fixed;
  top: -120px;
  right: -80px;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(255, 87, 34, 0.12) 0%, rgba(245, 158, 11, 0.06) 50%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow-2 {
  position: fixed;
  bottom: 40px;
  left: -100px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.10) 0%, rgba(255, 87, 34, 0.04) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Container */
.app-container {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px 100px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Decluttered Collapsible Global Hub Accordion
   ========================================================================== */
.hub-dock-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  max-width: 600px;
}

.hub-dock-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 16px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
  user-select: none;
}
.hub-dock-summary::-webkit-details-marker { display: none; }

.hub-dock-summary:hover {
  color: var(--text-primary);
  border-color: var(--border-active);
  background: #fffaf5;
}

.hub-dock-details[open] .hub-summary-arrow {
  transform: rotate(180deg);
}

.hub-summary-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.hub-dock-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
  margin-top: 8px;
}
.hub-dock-pill::-webkit-scrollbar { display: none; }

.hub-dock-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.hub-dock-item:hover {
  color: var(--text-primary);
  background: #fff4ea;
}

.hub-dock-item.active {
  background: linear-gradient(135deg, rgba(255, 87, 34, 0.12), rgba(245, 158, 11, 0.18));
  color: var(--flame-500);
  border: 1px solid var(--border-active);
  font-weight: 700;
}

/* ==========================================================================
   Header
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.brand-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.brand-link:hover {
  transform: translateY(-1px);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-emblem {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ffedd5, #fed7aa);
  border: 2px solid #ea580c;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.brand-link:hover .brand-emblem {
  transform: rotate(-5deg) scale(1.04);
}

.btn-reset-highlight:hover {
  background: #fff1f2 !important;
  color: #e11d48 !important;
  border-color: #fecdd3 !important;
}

/* ==========================================================================
   Decluttered Collapsed Ingestion Banner (Shown when recipe is active)
   ========================================================================== */
.ingestion-collapsed-banner {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.25s ease;
  flex-wrap: wrap;
}

.collapsed-banner-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.collapsed-chef-icon {
  font-size: 1.5rem;
}

.collapsed-banner-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.collapsed-banner-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.collapsed-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ingestion-card.collapsed {
  display: none !important;
}

.brand-emblem img, .brand-emblem svg {
  width: 34px;
  height: 34px;
}

.brand-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #1c1917 30%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
  -webkit-text-fill-color: #c2410c;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: #fff7ed;
  color: var(--flame-500);
  border-color: var(--border-active);
  transform: translateY(-1px);
}

.btn-vault-badge {
  position: relative;
}

.vault-count-pill {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff5722;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.4);
}

/* ==========================================================================
   Multi-Source Ingestion Card
   ========================================================================== */
.ingestion-card {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.ingestion-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff5722, #f59e0b, #10b981);
}

.ingestion-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.ingestion-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  background: #fdfaf6;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: #fff4ea;
}

.tab-btn.active {
  background: linear-gradient(135deg, #ffedd5, #fed7aa);
  border-color: #f97316;
  color: #c2410c;
  font-weight: 700;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Link Tab Input */
.input-with-action {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.input-with-action input,
.text-area-custom {
  flex: 1;
  background: #fffaf5;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px 18px;
  color: var(--text-primary);
  font-size: 0.96rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-with-action input:focus,
.text-area-custom:focus {
  border-color: #f97316;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

.text-area-custom {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  margin-bottom: 12px;
}

/* Universal Search & Input Clear Buttons */
.btn-input-clear {
  position: absolute;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  font-size: 0.88rem;
  color: #6b7280;
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s ease;
  z-index: 5;
  user-select: none;
}

.btn-input-clear:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  transform: scale(1.1);
}

/* Primary Alert Action Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff5722 0%, #ea580c 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.96rem;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.45);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #fff7ed;
  border-color: var(--border-active);
  color: var(--flame-500);
}

/* Quick sample chips */
.sample-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.sample-chip-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sample-chip {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.sample-chip:hover {
  background: #ffedd5;
  color: #c2410c;
  border-color: #f97316;
  transform: translateY(-1px);
}

/* Photo / Camera Dropzone */
.photo-dropzone {
  border: 2px dashed #fdba74;
  border-radius: var(--radius-md);
  padding: 30px 16px;
  text-align: center;
  cursor: pointer;
  background: #fffaf5;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.photo-dropzone:hover, .photo-dropzone.dragover {
  border-color: #ea580c;
  background: #ffedd5;
}

.dropzone-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.dropzone-text {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

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

.image-preview-wrapper {
  position: relative;
  display: inline-block;
  margin-top: 12px;
}

.image-preview-wrapper img {
  max-height: 180px;
  border-radius: var(--radius-md);
  border: 2px solid #f97316;
  box-shadow: var(--shadow-md);
}

.btn-remove-image {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--rose-500);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 26px;
  height: 26px;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Voice Dictation Panel */
.voice-panel {
  text-align: center;
  padding: 24px 16px;
}

.voice-mic-btn {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-full);
  background: #ffffff;
  border: 2px solid var(--border-subtle);
  color: var(--flame-500);
  font-size: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.25s ease;
  margin-bottom: 16px;
  position: relative;
}

.voice-mic-btn:hover {
  border-color: #f97316;
  transform: scale(1.06);
}

.voice-mic-btn.recording {
  background: linear-gradient(135deg, var(--rose-500), #be123c);
  border-color: var(--rose-400);
  color: white;
  animation: pulse-ring 1.4s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6); }
  70% { box-shadow: 0 0 0 20px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.voice-status-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.voice-transcript-box {
  background: #fffaf5;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  min-height: 70px;
  max-height: 140px;
  overflow-y: auto;
  font-size: 0.94rem;
  color: var(--text-primary);
  text-align: left;
  margin-bottom: 14px;
}

/* ==========================================================================
   Active Recipe Card Display
   ========================================================================== */
.recipe-view {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}
.recipe-view.active {
  display: block;
}

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

.recipe-hero-card {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.recipe-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.recipe-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.recipe-summary {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ReciMe Cookbook Collection Row */
.collection-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.collection-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.collection-pill-btn {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-subtle);
  background: #fffaf5;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.collection-pill-btn:hover {
  background: #ffedd5;
  color: #c2410c;
}

.collection-pill-btn.active {
  background: linear-gradient(135deg, #ff5722, #ea580c);
  color: #ffffff;
  border-color: #ea580c;
}

/* Metric Boxes */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.metric-box {
  background: #fff7ed;
  border: 1px solid rgba(234, 88, 12, 0.18);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.metric-value.highlight {
  color: #ea580c;
}

/* Action Toolbar */
.recipe-action-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-cook-mode {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35) !important;
}

/* ==========================================================================
   Serving Scaler & Unit System Bar
   ========================================================================== */
.serving-scaler-bar {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.scaler-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scaler-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.scaler-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-scale-step {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: #fffaf5;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-scale-step:hover {
  background: #ffedd5;
  color: #ea580c;
  border-color: #f97316;
}

.current-servings-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 800;
  min-width: 24px;
  text-align: center;
  color: #ea580c;
}

.scale-presets {
  display: flex;
  gap: 4px;
}

.scale-preset-btn {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: #fffaf5;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scale-preset-btn:hover {
  background: #ffedd5;
  color: #c2410c;
}

.scale-preset-btn.active {
  background: linear-gradient(135deg, #ff5722, #ea580c);
  color: #ffffff;
  border-color: #ea580c;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

/* Unit System Switcher (Grams, Cups, Ounces) */
.unit-system-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

@media (max-width: 640px) {
  .unit-system-bar {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
  }
}

.unit-pill-group {
  display: inline-flex;
  gap: 4px;
  background: #fffaf5;
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-subtle);
}

.unit-pill-btn {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.unit-pill-btn:hover {
  color: var(--text-primary);
}

.unit-pill-btn.active {
  background: linear-gradient(135deg, #ff5722, #ea580c);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

/* ==========================================================================
   Recipe Content Grid (Ingredients & Steps)
   ========================================================================== */
.recipe-body-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 24px;
}

@media (max-width: 800px) {
  .recipe-body-grid {
    grid-template-columns: 1fr;
  }
}

.ingredients-card,
.directions-card {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border-subtle);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

/* ==========================================================================
   Aisle Groups (Produce, Meat, Dairy, Bakery, Pantry)
   ========================================================================== */
.aisle-group {
  margin-bottom: 18px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
}

.aisle-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #fff7ed;
  color: #c2410c;
  border-bottom: 1px solid var(--border-subtle);
}

/* Specific colorful aisle themes */
.aisle-group[data-aisle="Produce"] .aisle-title {
  background: #ecfdf5;
  color: #047857;
  border-bottom-color: #a7f3d0;
}
.aisle-group[data-aisle="Meat & Seafood"] .aisle-title {
  background: #fff1f2;
  color: #be123c;
  border-bottom-color: #fecdd3;
}
.aisle-group[data-aisle="Dairy & Cold"] .aisle-title {
  background: #fefce8;
  color: #a16207;
  border-bottom-color: #fef08a;
}
.aisle-group[data-aisle="Bakery"] .aisle-title {
  background: #fef3c7;
  color: #b45309;
  border-bottom-color: #fde68a;
}
.aisle-group[data-aisle="Pantry & Spices"] .aisle-title {
  background: #fff7ed;
  color: #c2410c;
  border-bottom-color: #fed7aa;
}

.ingredient-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.ingredient-item:last-child {
  border-bottom: none;
}

.ingredient-item:hover {
  background: #fffaf5;
}

.ingredient-item.checked {
  background: #fbfbfb;
}

.ingredient-item.checked .ingredient-text {
  text-decoration: line-through;
  color: var(--text-muted);
  opacity: 0.7;
}

.ingredient-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #fdba74;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
  margin-top: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.ingredient-checkbox:checked {
  background: #10b981;
  border-color: #10b981;
}

.ingredient-checkbox:checked::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.ingredient-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.45;
}

.ingredient-text strong {
  color: #c2410c;
  font-weight: 700;
}

.prep-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Custom Grocery Item Add Row */
.add-grocery-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1.5px dashed var(--border-subtle);
}

.add-grocery-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-subtle);
  background: #fffaf5;
  font-size: 0.88rem;
  color: var(--text-primary);
  outline: none;
}

.add-grocery-input:focus {
  border-color: #f97316;
  background: #ffffff;
}

/* ==========================================================================
   Directions Steps & Timers
   ========================================================================== */
.step-card {
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  background: #fffaf5;
  transition: all 0.2s ease;
}

.step-card:hover {
  background: #ffffff;
  border-color: var(--border-active);
  box-shadow: var(--shadow-sm);
}

.step-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.step-badge {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.step-instruction {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.step-protip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.86rem;
  color: #166534;
  margin-top: 8px;
}

.step-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #fefce8;
  border: 1px solid #fde047;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: #854d0e;
  cursor: pointer;
  transition: all 0.15s ease;
}

.step-timer-pill:hover {
  background: #fef08a;
  transform: scale(1.03);
}

/* Beverage Pairing Card */
.pairing-card {
  margin-top: 20px;
  background: #fdf4ff;
  border: 1.5px solid #f0abfc;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.pairing-icon {
  font-size: 1.8rem;
}

.pairing-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #86198f;
  margin-bottom: 2px;
}

.pairing-text {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   ReciMe Feature: Personal Kitchen Notes Card
   ========================================================================== */
.kitchen-notes-card {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 24px;
  box-shadow: var(--shadow-sm);
}

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

.notes-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #92400e;
}

.notes-saved-hint {
  font-size: 0.78rem;
  color: #b45309;
  font-weight: 600;
}

.kitchen-notes-textarea {
  width: 100%;
  min-height: 80px;
  border-radius: var(--radius-md);
  border: 1px solid #fcd34d;
  background: #ffffff;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
}

.kitchen-notes-textarea:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* ==========================================================================
   Hands-Free Fullscreen Cook Mode Modal
   High-contrast kitchen counter readable view with wake lock!
   ========================================================================== */
.cook-mode-overlay {
  position: fixed;
  inset: 0;
  background: #1c1917; /* High contrast kitchen slate */
  color: #fafaf9;
  z-index: 1000;
  display: none;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
}

.cook-mode-overlay.active {
  display: flex;
}

.cook-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cook-mode-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fbbf24;
}

.wake-lock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fafaf9;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.wake-lock-toggle.active {
  background: #10b981;
  border-color: #34d399;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

.cook-progress-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  margin-bottom: 30px;
  overflow: hidden;
}

.cook-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff5722, #f59e0b, #10b981);
  width: 0%;
  transition: width 0.3s ease;
}

.cook-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  text-align: center;
}

.cook-step-number {
  font-size: 1.1rem;
  font-weight: 800;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.cook-step-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.2rem;
  line-height: 1.4;
  color: #ffffff;
  margin-bottom: 32px;
}

@media (max-width: 640px) {
  .cook-step-text {
    font-size: 1.6rem;
  }
}

/* Giant Timer in Cook Mode */
.giant-timer-box {
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin: 0 auto 32px;
  max-width: 440px;
  width: 100%;
}

.timer-countdown {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3.5rem;
  font-weight: 800;
  color: #fbbf24;
}

.timer-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cook-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 780px;
  margin: 24px auto 0;
  width: 100%;
}

.btn-cook-nav {
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   AI Sous Chef Drawer
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 990;
  display: none;
}
.drawer-backdrop.active {
  display: block;
}

.drawer-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 640px;
  margin: 0 auto;
  background: #ffffff;
  border-top: 2px solid #fdba74;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 40px rgba(180, 83, 9, 0.2);
  z-index: 995;
  display: none;
  flex-direction: column;
  max-height: 85vh;
  padding: 22px;
  animation: slideUp 0.25s ease forwards;
}
.drawer-panel.active {
  display: flex;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border-subtle);
}

.drawer-title {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ea580c;
}

.chef-chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  padding-right: 4px;
}

.chat-bubble {
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 90%;
}

.chat-bubble.assistant {
  background: #fff7ed;
  border: 1.5px solid #fed7aa;
  color: var(--text-primary);
  align-self: flex-start;
}

.chat-bubble.user {
  background: linear-gradient(135deg, #ff5722, #ea580c);
  color: #ffffff;
  font-weight: 600;
  align-self: flex-end;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

.chef-quick-prompts {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.chef-quick-prompts::-webkit-scrollbar { display: none; }

.prompt-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: #fffaf5;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}

.prompt-pill:hover {
  background: #ffedd5;
  color: #c2410c;
  border-color: #f97316;
}

.chef-input-row {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   Modals (QR, Vault, Conversions, Settings)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1010;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}
.modal-backdrop.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: 20px;
  padding: 24px;
  max-width: 520px;
  width: 100%;
  max-height: calc(100dvh - 32px);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.04);
  text-align: center;
  color: var(--text-primary);
  margin: auto;
  box-sizing: border-box;
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.modal-subtitle {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.45;
}

/* Custom Scrollbar for Modal Content */
.modal-content::-webkit-scrollbar {
  width: 5px;
}
.modal-content::-webkit-scrollbar-track {
  background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 8px;
}

.qr-canvas-container {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 2px solid #fdba74;
  display: inline-block;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(180, 83, 9, 0.15);
}

.qr-canvas-container svg, .qr-canvas-container canvas {
  display: block;
  width: 220px;
  height: 220px;
}

/* Conversion Tables */
.conversion-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: #ffffff;
}

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

.conversion-table th {
  background: #fff7ed;
  padding: 11px 14px;
  color: #c2410c;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--border-subtle);
}

.conversion-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

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

.conversion-table tr:hover td {
  background: #fffaf5;
}

/* Calculator Grid */
.calc-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.calc-stat-box {
  background: #fffaf5;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}

.calc-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 2px;
}

.calc-stat-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ea580c;
  font-family: 'JetBrains Mono', monospace;
}

/* Toast Notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1c1917;
  border: 1px solid #fdba74;
  color: #ffffff;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.toast-notice.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

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

/* ==========================================================================
   Heart Favorite Suite (The Good Ones)
   ========================================================================== */
.btn-favorite-heart {
  background: none;
  border: none;
  font-size: 1.85rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
}
.btn-favorite-heart:hover {
  transform: scale(1.22);
}
.btn-favorite-heart:active {
  transform: scale(1.4);
}
.btn-favorite-heart.favorited {
  animation: heartPop 0.35s ease;
}
@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.45); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   Camera Viewfinder & Split Photo Choice Grid
   ========================================================================== */
.visually-hidden-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.photo-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 540px) {
  .photo-choice-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }
}
.photo-action-card {
  background: #fffaf5;
  border: 1.5px solid #fdba74;
  border-radius: var(--radius-md);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-family: inherit;
}
.photo-action-card:hover {
  background: #ffedd5;
  border-color: #ea580c;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.photo-action-card .action-icon {
  font-size: 2.2rem;
  line-height: 1;
}
.photo-action-card .action-title {
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text-primary);
}
.photo-action-card .action-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.camera-viewfinder-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  min-height: 320px;
  height: 360px;
  flex-shrink: 0 !important;
  margin: 0 auto 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #09090b;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  border: 2px solid #ea580c;
  display: flex;
  flex-direction: column;
}

.camera-viewfinder-container video {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  display: block;
  background: #000;
  flex-shrink: 0;
}

.viewfinder-top-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 25;
  pointer-events: auto;
}

.viewfinder-pill-btn {
  background: rgba(15, 15, 20, 0.72);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  padding: 6px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.viewfinder-pill-btn:hover {
  background: rgba(15, 15, 20, 0.92);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

.viewfinder-pill-btn:active {
  transform: scale(0.95);
}

.viewfinder-reticle {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 78%;
  height: 52%;
  max-width: 320px;
  max-height: 200px;
  border-radius: 16px;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.22);
}

.viewfinder-reticle::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background:
    linear-gradient(to right, #ea580c 20px, transparent 20px) top left,
    linear-gradient(to bottom, #ea580c 20px, transparent 20px) top left,
    linear-gradient(to left, #ea580c 20px, transparent 20px) top right,
    linear-gradient(to bottom, #ea580c 20px, transparent 20px) top right,
    linear-gradient(to right, #ea580c 20px, transparent 20px) bottom left,
    linear-gradient(to top, #ea580c 20px, transparent 20px) bottom left,
    linear-gradient(to left, #ea580c 20px, transparent 20px) bottom right,
    linear-gradient(to top, #ea580c 20px, transparent 20px) bottom right;
  background-repeat: no-repeat;
  background-size: 22px 22px;
}

.viewfinder-scan-beam {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ea580c, #f59e0b, #ea580c, transparent);
  box-shadow: 0 0 10px #ea580c;
  animation: scanBeamAnim 2.2s ease-in-out infinite alternate;
}

@keyframes scanBeamAnim {
  0% { top: 6px; opacity: 0.3; }
  50% { opacity: 0.9; }
  100% { top: calc(100% - 8px); opacity: 0.4; }
}

.viewfinder-overlay-guide {
  position: absolute;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 10, 9, 0.82);
  color: #ffffff;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  pointer-events: none;
  white-space: nowrap;
  z-index: 15;
  border: 1px solid rgba(255, 255, 255, 0.22);
  max-width: 90%;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.camera-controls {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  z-index: 25;
}

.camera-shutter-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid #ea580c;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.65), 0 6px 18px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.camera-shutter-btn:hover {
  transform: scale(1.06);
  border-color: #ff5722;
}

.camera-shutter-btn:active {
  transform: scale(0.92);
  background: #ffedd5;
}

.camera-shutter-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ea580c, #f97316);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
}

/* Pantry Snapshot Preview Card */
.pantry-photo-preview-card {
  position: relative;
  background: #fffaf5;
  border: 2px solid #fdba74;
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
  flex-shrink: 0 !important;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pantry-preview-thumb-wrap {
  position: relative;
  width: 100%;
  max-height: 250px;
  border-radius: 10px;
  overflow: hidden;
  background: #1c1917;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pantry-preview-thumb-wrap img {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
  display: block;
}

.pantry-preview-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.pantry-preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Pantry Prompt & Storage
   ========================================================================== */
.pantry-prompt-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1.5px solid #fdba74;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
}
.pantry-prompt-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pantry-prompt-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #c2410c;
}
.pantry-prompt-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.pantry-shelves-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  min-height: 240px !important;
  flex-shrink: 0 !important;
  margin-bottom: 16px !important;
}

#pantry-modal-backdrop .modal-content {
  max-height: calc(100vh - 40px) !important;
  max-height: calc(100dvh - 40px) !important;
  overflow-y: auto !important;
}

.pantry-view-mode-toggle {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}
.pantry-view-btn {
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pantry-view-btn.active {
  background: #ffffff;
  color: #ea580c;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-weight: 700;
}

.shelf-items-table {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}
.shelf-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.84rem;
  transition: all 0.15s ease;
}
.shelf-item-row:hover {
  border-color: #fdba74;
  background: #fffaf5;
}
.shelf-item-name {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex: 1;
}
.shelf-item-name:hover {
  color: #ea580c;
}
.shelf-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-shelf-action {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-shelf-action:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text-primary);
}
.btn-shelf-action.delete {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.2);
}
.btn-shelf-action.delete:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.pantry-shelf-box {
  background: #fffaf5;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  flex-shrink: 0;
}
.shelf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.shelf-count {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}
.shelf-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}
.shelf-chip,
.pantry-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  user-select: none;
}
.shelf-chip:hover,
.pantry-tag-chip:hover {
  border-color: #fdba74;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.08);
}
.shelf-chip.matched {
  background: #fff7ed !important;
  border-color: #ea580c !important;
  color: #9a3412 !important;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.2);
}
.shelf-chip.dimmed {
  opacity: 0.25;
  filter: grayscale(80%);
}
.shelf-chip.highlight-dupe {
  animation: pulse-dupe 1.2s infinite alternate ease-in-out;
}
@keyframes pulse-dupe {
  0% { transform: scale(1); border-color: #ea580c; }
  100% { transform: scale(1.05); border-color: #c2410c; box-shadow: 0 0 10px rgba(234, 88, 12, 0.4); }
}

.btn-remove-chip,
.pantry-tag-chip .remove-item {
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.15s;
}
.btn-remove-chip:hover,
.pantry-tag-chip .remove-item:hover {
  color: #ef4444;
  transform: scale(1.15);
}

.btn-shelf-clear {
  transition: color 0.15s;
}
.btn-shelf-clear:hover {
  color: #ef4444 !important;
  text-decoration: underline;
}

/* Deduplication Review Card Styles */
.dedup-group-card {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dedup-group-card:hover {
  border-color: #fdba74;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.06);
}
.dedup-group-card.excluded {
  opacity: 0.55;
  background: #f8fafc;
}
.dedup-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}
.dedup-group-reason {
  font-size: 0.72rem;
  color: #c2410c;
  font-weight: 700;
  background: #fff7ed;
  padding: 2px 6px;
  border-radius: 4px;
}
.dedup-items-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.dedup-item-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-weight: 600;
}
.dedup-item-tag.active-target {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.dedup-merge-arrow {
  color: #ea580c;
  font-weight: 800;
  font-size: 0.85rem;
}
.dedup-merge-result {
  font-size: 0.82rem;
  font-weight: 700;
  color: #166534;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pantry-badge-onhand {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  margin-left: 6px;
}
.pantry-badge-need {
  display: inline-block;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  margin-left: 6px;
}

.btn-pantry-badge {
  position: relative;
}
.pantry-count-pill {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ea580c;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.suggestion-card {
  background: #fffaf5;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.suggestion-card:hover {
  background: #ffedd5;
  border-color: #ea580c;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.suggestion-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.suggestion-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 6px;
}
.suggestion-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.suggestion-match-pill {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Mobile-First Screen Width & Overflow Protection (<= 600px)
   ========================================================================== */
@media (max-width: 600px) {
  .app-container {
    padding: 12px 12px 90px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app-header {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
  }

  .brand-wrapper {
    gap: 8px;
  }

  .brand-title {
    font-size: 1.32rem;
  }

  .brand-subtitle {
    font-size: 0.72rem;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions {
    gap: 5px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .ingestion-card {
    padding: 14px 12px;
    margin-bottom: 20px;
  }

  /* 4 Tabs in a clean 2x2 grid so all 4 are 100% visible on screen */
  .ingestion-tabs {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    overflow-x: visible !important;
  }

  .tab-btn {
    justify-content: center;
    padding: 9px 8px;
    font-size: 0.82rem;
    white-space: normal;
    text-align: center;
  }

  /* Stack input and button vertically on mobile */
  .input-with-action {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .input-with-action input {
    width: 100% !important;
    padding: 12px 14px;
    font-size: 0.92rem;
  }

  .input-with-action .btn-primary {
    width: 100% !important;
    justify-content: center;
    padding: 12px;
    font-size: 0.96rem;
  }

  .sample-chips-row {
    justify-content: center;
    gap: 5px;
  }

  .sample-chip {
    padding: 4px 10px;
    font-size: 0.76rem;
  }

  .recipe-hero-card {
    padding: 16px 14px;
  }

  .recipe-title {
    font-size: 1.55rem;
  }

  .recipe-action-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .recipe-action-toolbar .btn-cook-mode {
    grid-column: span 2;
    padding: 12px;
    font-size: 1rem;
  }

  .collapsed-banner-actions {
    width: 100%;
    margin-top: 6px;
  }

  .collapsed-banner-actions button {
    flex: 1;
    justify-content: center;
  }
}

/* ==========================================================================
   Main Introduction & Branching Hub Architecture
   ========================================================================== */
.main-hub-section {
  display: block;
  margin-bottom: 28px;
  animation: fadeIn 0.25s ease;
}

.hub-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
  border: 1.5px solid #fdba74;
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  text-align: center;
  margin-bottom: 22px;
  box-shadow: 0 4px 20px rgba(234, 88, 12, 0.08);
}

.hub-hero-badge {
  display: inline-block;
  background: #ffedd5;
  color: #c2410c;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  border: 1px solid #fdba74;
  margin-bottom: 12px;
}

.hub-hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hub-hero-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 620px;
  margin: 0 auto;
}

.hub-resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #ffffff;
  border: 1.5px solid #ea580c;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 18px;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.12);
}

/* Branch Grid */
.hub-branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.hub-portal-card {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hub-portal-card:hover {
  transform: translateY(-4px);
  border-color: #ea580c;
  box-shadow: 0 12px 28px -8px rgba(234, 88, 12, 0.18);
}

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

.portal-icon-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.portal-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: #f3f4f6;
  color: var(--text-muted);
}

.portal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.portal-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 16px;
  flex-grow: 1;
}

.portal-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #ea580c;
  background: #fff7ed;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid #fed7aa;
  width: fit-content;
  transition: all 0.15s;
}

.hub-portal-card:hover .portal-action-pill {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

/* Subview Navigation Header */
.subview-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.btn-subview-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-subview-back:hover {
  background: #fff7ed;
  border-color: #ea580c;
  color: #c2410c;
}

/* 1-Tap App Update Highlight Button */
.btn-update-highlight {
  background: #fff7ed;
  border: 1.5px solid #fdba74;
  color: #ea580c;
  position: relative;
  transition: all 0.2s ease;
}

.btn-update-highlight:hover {
  background: #ffedd5;
  border-color: #ea580c;
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.2);
}

.btn-update-highlight:active {
  transform: rotate(180deg) scale(0.92);
}

/* Floating Update Available Banner */
.floating-update-banner {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  color: #fff;
  border: 1.5px solid rgba(251, 146, 60, 0.6);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: slideDownUpdate 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDownUpdate {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.floating-update-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ==========================================================================
   Monthly Usage & Activity Analytics Modal & Badges
   ========================================================================== */
.btn-usage-badge {
  position: relative;
}

.usage-count-pill {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.portal-usage:hover {
  border-color: #2563eb;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.15);
}
.portal-usage .portal-icon-box {
  background: rgba(37, 99, 235, 0.1);
}
.portal-usage .portal-tag {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.usage-stat-card {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  text-align: center;
  transition: all 0.2s ease;
}
.usage-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: #ea580c;
}
.usage-stat-card .stat-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}
.usage-stat-card .stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-heading);
}
.usage-stat-card .stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

.activity-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  gap: 8px;
}
.activity-event-row:hover {
  background: #fffaf5;
}
.activity-event-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.activity-event-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.activity-event-info {
  min-width: 0;
  flex: 1;
}
.activity-event-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-event-detail {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-event-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-mono);
}

@media (max-width: 540px) {
  .usage-stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ==========================================================================
   Settings Feedback Section
   ========================================================================== */
.settings-feedback-card {
  background: #fffaf5;
  border: 1.5px solid #fed7aa;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.settings-feedback-card:hover {
  border-color: #fdba74;
}

.feedback-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.feedback-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(234, 88, 12, 0.1);
  color: var(--brand-orange);
}

.feedback-type-chips {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.feedback-chip {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.feedback-chip:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

.feedback-chip.active {
  background: #fff7ed;
  border-color: #ea580c;
  color: #ea580c;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.15);
}

.feedback-emoji-rating {
  display: flex;
  gap: 4px;
}

.emoji-rating-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 2px 5px;
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  line-height: 1;
}

.emoji-rating-btn:hover {
  transform: scale(1.2);
  background: #ffedd5;
}

.emoji-rating-btn.active {
  background: #fed7aa;
  border-color: #fb923c;
  transform: scale(1.15);
}

.feedback-textarea:focus {
  border-color: #ea580c !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

.btn-souschef-highlight {
  background: rgba(234, 88, 12, 0.1);
  border: 1.5px solid #fdba74;
  color: var(--brand-orange);
  transition: all 0.2s ease;
}
.btn-souschef-highlight:hover {
  background: var(--brand-orange);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   20. "What Do I Want to Eat?" Restaurant Locator & Craving Scout Styles
   ========================================================================== */
.restaurant-section {
  max-width: 960px;
  margin: 0 auto 30px;
}

.restaurant-search-hero {
  background: linear-gradient(135deg, #fffaf5 0%, #fff7ed 50%, #ffedd5 100%);
  border: 1.5px solid #fed7aa;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.restaurant-search-hero::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.restaurant-hero-header {
  margin-bottom: 18px;
}

.restaurant-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #c2410c;
  background: #fff;
  border: 1px solid #fdba74;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.restaurant-hero-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.restaurant-hero-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.restaurant-inputs-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .restaurant-inputs-grid {
    grid-template-columns: 1fr;
  }
}

.restaurant-input-wrap {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.restaurant-input-wrap:focus-within {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

.restaurant-input-icon {
  font-size: 1.1rem;
  margin-right: 8px;
  user-select: none;
}

.restaurant-text-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text-primary);
  padding: 8px 0;
  min-width: 0;
}

.btn-gps-loc {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-gps-loc:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-search-restaurants {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
}

.cravings-deck-wrapper {
  margin-top: 10px;
}

.cravings-deck-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.cravings-chips-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.craving-chip {
  background: #ffffff;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.craving-chip:hover {
  background: #ffedd5;
  border-color: #fb923c;
  transform: translateY(-1px);
}

.distance-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  align-items: center;
}

.distance-chip {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.distance-chip:hover {
  border-color: #0284c7;
  color: #0369a1;
}

.distance-chip.active {
  background: #f0f9ff;
  border-color: #0284c7;
  color: #0369a1;
  font-weight: 700;
}

.vibe-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
}

.vibe-chip {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vibe-chip:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

.vibe-chip.active {
  background: #fff7ed;
  border-color: #ea580c;
  color: #c2410c;
  font-weight: 700;
}

.restaurant-distance-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  margin-left: 6px;
  white-space: nowrap;
}

.restaurant-results-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

@media (max-width: 480px) {
  .restaurant-results-container {
    grid-template-columns: 1fr;
  }
}

.restaurant-card {
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.restaurant-card:hover {
  border-color: #fdba74;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.restaurant-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.restaurant-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px;
}

.restaurant-neighborhood {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.restaurant-badges-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.badge-rating {
  font-size: 0.76rem;
  font-weight: 700;
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-price {
  font-size: 0.74rem;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 1px 6px;
  border-radius: 999px;
}

.signature-dish-banner {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1px solid #fdba74;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.signature-dish-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #c2410c;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.signature-dish-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.what-makes-special-box {
  background: #fafaf9;
  border-left: 3.5px solid var(--brand-orange);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.special-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: #78716c;
  text-transform: uppercase;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.special-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.42;
  margin: 0;
}

.restaurant-address-row {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.restaurant-vibe-pill {
  font-size: 0.72rem;
  background: #f5f5f4;
  color: #57534e;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 600;
}

.restaurant-card-footer-meta {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.vibe-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 600;
}

.restaurant-phone-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none !important;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px 10px;
  transition: all 0.2s ease;
}

.restaurant-phone-link:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.restaurant-actions-toolbar,
.restaurant-actions-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr 1.35fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 520px) {
  .restaurant-actions-toolbar,
  .restaurant-actions-bar {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .btn-action-cook {
    grid-column: 1 / -1;
    padding: 11px 14px !important;
    font-size: 0.88rem !important;
    box-shadow: 0 3px 10px rgba(234, 88, 12, 0.22) !important;
  }
}

.btn-rest-action,
.btn-restaurant-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  font-size: 0.79rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none !important;
  transition: all 0.18s ease;
  white-space: nowrap;
  box-sizing: border-box;
  text-align: center;
  user-select: none;
  border: 1px solid transparent;
}

/* 📍 Directions */
.btn-action-maps {
  background: #f0fdf4;
  color: #15803d !important;
  border-color: #bbf7d0;
}
.btn-action-maps:hover {
  background: #dcfce7;
  border-color: #86efac;
  transform: translateY(-1px);
}

/* 🌐 Menu / Web */
.btn-action-web,
.btn-action-site {
  background: #f8fafc;
  color: #334155 !important;
  border-color: #cbd5e1;
}
.btn-action-web:hover,
.btn-action-site:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a !important;
  transform: translateY(-1px);
}

/* 🤍 Wishlist */
.btn-action-wishlist,
.btn-action-bookmark {
  background: #fff1f2;
  color: #be123c !important;
  border-color: #fecdd3;
}
.btn-action-wishlist:hover,
.btn-action-bookmark:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  transform: translateY(-1px);
}
.btn-action-wishlist.active,
.btn-action-bookmark.active {
  background: #e11d48;
  color: #ffffff !important;
  border-color: #e11d48;
}

/* ⚡ Cook at Home */
.btn-action-cook {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  color: #c2410c !important;
  border: 1.5px solid #fb923c;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.15);
}
.btn-action-cook:hover {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #ffffff !important;
  border-color: #ea580c;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.28);
  transform: translateY(-1px);
}

.bucket-list-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #fecdd3;
  color: #e11d48;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none !important;
}

/* ==========================================================================
   Mobile Modals, Drawers & Windows System (<= 640px)
   ========================================================================== */
@media (max-width: 640px) {
  /* Backdrops fit phone viewports cleanly without edge bleed */
  .modal-backdrop {
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    align-items: flex-end !important; /* Bottom-sheet feel on mobile */
  }

  /* Modal Card: self-contained, scrolls inside, never overflows screen */
  .modal-content {
    max-width: 100% !important;
    width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    border-radius: 24px 24px 16px 16px !important;
    padding: 20px 15px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    margin: 0 auto !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.32) !important;
  }

  .modal-title {
    font-size: 1.15rem !important;
  }

  .modal-subtitle {
    font-size: 0.8rem !important;
    margin-bottom: 12px !important;
  }

  /* Prevent iOS Safari from zooming into the page on form input focus */
  .modal-content input[type="text"],
  .modal-content input[type="password"],
  .modal-content input[type="email"],
  .modal-content input[type="search"],
  .modal-content select,
  .modal-content textarea,
  .input-with-action {
    font-size: 16px !important;
  }

  /* Pantry Modal on Mobile */
  .pantry-scanner-card {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 12px !important;
  }
  .pantry-scanner-card > div:last-child {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .pantry-scanner-card label,
  .pantry-scanner-card button {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
  }

  /* Mobile Live Camera Viewfinder & Preview */
  .camera-viewfinder-container {
    min-height: 280px !important;
    height: 310px !important;
    flex-shrink: 0 !important;
    border-radius: 16px !important;
    margin-bottom: 12px !important;
  }
  .camera-viewfinder-container video {
    min-height: 280px !important;
    height: 310px !important;
    object-fit: cover !important;
  }
  .viewfinder-reticle {
    width: 84% !important;
    height: 55% !important;
  }
  .camera-shutter-btn {
    width: 58px !important;
    height: 58px !important;
  }
  .camera-shutter-inner {
    width: 42px !important;
    height: 42px !important;
    font-size: 1.15rem !important;
  }

  /* Settings Modal on Mobile */
  .update-card > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .update-card button {
    align-self: flex-start !important;
  }
  .feedback-type-chips {
    gap: 5px !important;
  }
  .feedback-chip {
    font-size: 0.74rem !important;
    padding: 4px 8px !important;
  }

  /* Conversions Modal on Mobile */
  .ingestion-tabs {
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 6px !important;
    gap: 6px !important;
    scrollbar-width: none;
  }
  .ingestion-tabs::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    flex-shrink: 0 !important;
  }
  .conversion-table th,
  .conversion-table td {
    padding: 8px 10px !important;
    font-size: 0.8rem !important;
  }

  /* Bucket List & Vault Modal Cards on Mobile */
  .bucket-list-item-row {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }
  .bucket-list-item-row > div:last-child {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 6px !important;
  }

  /* AI Sous Chef Drawer Mobile Polish */
  .drawer-panel {
    padding: 18px 14px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: 88dvh !important;
    border-radius: 22px 22px 0 0 !important;
  }
  .chef-chat-messages {
    max-height: 46dvh !important;
  }

  /* Cook Mode Overlay Mobile Polish */
  .cook-mode-overlay {
    padding: 16px 14px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ==========================================================================
   TapCook Zero-Typing Interactive Matcher Studio
   ========================================================================== */
.tapcook-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tapcook-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #fdf2f8 100%);
  border: 1px solid #fbcfe8;
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  box-shadow: 0 6px 20px rgba(219, 39, 119, 0.07);
}

.tapcook-categories-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tapcook-group-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.tapcook-group-card:hover {
  border-color: #fbcfe8;
}

.tapcook-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.tapcook-group-icon {
  font-size: 1.25rem;
}

.tapcook-group-title {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text-primary);
  flex: 1;
}

.tapcook-group-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.tapcook-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tapcook-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  min-height: 40px;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tapcook-chip:hover {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #be185d;
  transform: translateY(-1px);
}

.tapcook-chip.active {
  background: linear-gradient(135deg, #be185d 0%, #db2777 100%) !important;
  border-color: #be185d !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(190, 24, 93, 0.35) !important;
  transform: translateY(-1px) scale(1.02);
}

.tapcook-chip.pantry-match::after {
  content: "🟢";
  font-size: 0.65rem;
  margin-left: 2px;
}

.tapcook-action-bar-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid #fbcfe8;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: 0 8px 24px rgba(190, 24, 93, 0.12);
  position: sticky;
  bottom: 16px;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.tapcook-summary-info {
  flex: 1;
  min-width: 0;
}

.btn-submit-tapcook {
  padding: 12px 24px !important;
  font-size: 0.94rem !important;
  font-weight: 700 !important;
  border-radius: var(--radius-full) !important;
  white-space: nowrap !important;
  cursor: pointer;
}

/* Match Result Meal Card */
.tapcook-meal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tapcook-meal-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #fbcfe8;
}

.tapcook-meal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.tapcook-meal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
}

.tapcook-meal-summary {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tapcook-meal-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tapcook-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tapcook-badge.badge-macro {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #be185d;
}

.tapcook-ingredients-box {
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.tapcook-meal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* Pantry Batch Gallery & Interactive Item List Styling */
#pantry-batch-gallery::-webkit-scrollbar {
  height: 4px;
}
#pantry-batch-gallery::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}
#pantry-batch-gallery::-webkit-scrollbar-thumb {
  background: #fdba74;
  border-radius: 4px;
}

#detected-items-list::-webkit-scrollbar {
  width: 4px;
}
#detected-items-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}
#detected-items-list::-webkit-scrollbar-thumb {
  background: #fdba74;
  border-radius: 4px;
}



/* Barcode scanner + product badges */
.btn-scan-barcode { padding: 8px 16px; font-size: 0.85rem; min-height: 44px; }
.btn-add-pantry-item, #btn-add-pantry-item { min-height: 44px; }
.barcode-scan-container { position: relative; margin-bottom: 14px; border-radius: var(--radius-md); overflow: hidden; background: #000; }
.barcode-scan-container video { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.barcode-scan-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.65); color: #fff; font-weight: 700; font-size: 0.8rem; padding: 4px 12px; border-radius: 20px; }
.btn-scan-cancel { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); min-height: 44px; min-width: 44px; padding: 8px 20px; }
.pb { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 8px; font-size: 0.68rem; font-weight: 800; line-height: 1.5; color: #fff; vertical-align: middle; }
.pb-nova-1 { background: #16a34a; } .pb-nova-2 { background: #65a30d; } .pb-nova-3 { background: #ea580c; } .pb-nova-4 { background: #dc2626; }
.pb-nutri-a { background: #038141; } .pb-nutri-b { background: #85bb2f; } .pb-nutri-c { background: #eab308; color: #422006; } .pb-nutri-d { background: #ee8100; } .pb-nutri-e { background: #e63e11; }
.pb-origin { background: #e0f2fe; color: #075985; font-weight: 700; }
.pb-unknown { background: #d1d5db; color: #374151; }
