/* ==========================================================================
   Creami Cravings - Modern Ninja Creami Pantry & Recipe Styling System
   ========================================================================== */

:root {
  color-scheme: dark;
  
  --bg-main: #0c0e17;
  --bg-gradient: radial-gradient(circle at 10% 10%, rgba(236, 72, 153, 0.15) 0%, transparent 45%),
                 radial-gradient(circle at 90% 85%, rgba(139, 92, 246, 0.14) 0%, transparent 45%),
                 radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.06) 0%, transparent 60%);
  --bg-card: rgba(20, 24, 39, 0.85);
  --bg-card-hover: rgba(28, 34, 56, 0.95);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --bg-glass-hover: rgba(255, 255, 255, 0.1);
  --bg-input: rgba(12, 14, 23, 0.85);
  --bg-item: rgba(18, 22, 36, 0.6);
  --bg-item-hover: rgba(236, 72, 153, 0.08);
  --bg-modal: #151828;
  --bg-modal-overlay: rgba(6, 8, 14, 0.82);

  --border-glass: rgba(255, 255, 255, 0.09);
  --border-highlight: rgba(236, 72, 153, 0.4);
  --border-item: rgba(255, 255, 255, 0.06);
  
  --primary: #ec4899;
  --primary-glow: rgba(236, 72, 153, 0.35);
  --primary-gradient: linear-gradient(135deg, #ec4899 0%, #d946ef 50%, #8b5cf6 100%);
  --secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  
  --heading-gradient: linear-gradient(135deg, #ffffff 0%, #cbd5e1 55%, #f472b6 100%);
  --badge-bg: rgba(236, 72, 153, 0.15);
  --badge-border: rgba(236, 72, 153, 0.3);
  --badge-text: #f472b6;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-checked: #34d399;
  
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-card-hover: 0 16px 36px -10px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 25px var(--primary-glow);
  --shadow-success-glow: 0 0 25px var(--success-glow);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  
  --bg-main: #f8fafc;
  --bg-gradient: radial-gradient(circle at 10% 10%, rgba(236, 72, 153, 0.1) 0%, transparent 45%),
                 radial-gradient(circle at 90% 85%, rgba(139, 92, 246, 0.1) 0%, transparent 45%),
                 radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.05) 0%, transparent 60%);
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(15, 23, 42, 0.04);
  --bg-glass-hover: rgba(15, 23, 42, 0.08);
  --bg-input: rgba(241, 245, 249, 0.95);
  --bg-item: rgba(248, 250, 252, 0.9);
  --bg-item-hover: rgba(236, 72, 153, 0.08);
  --bg-modal: #ffffff;
  --bg-modal-overlay: rgba(15, 23, 42, 0.55);

  --border-glass: rgba(15, 23, 42, 0.1);
  --border-highlight: rgba(236, 72, 153, 0.4);
  --border-item: rgba(15, 23, 42, 0.08);
  
  --primary: #db2777;
  --primary-glow: rgba(219, 39, 119, 0.25);
  --primary-gradient: linear-gradient(135deg, #db2777 0%, #c026d3 50%, #7c3aed 100%);
  --secondary: #7c3aed;
  --accent-cyan: #0891b2;
  --accent-amber: #d97706;
  --success: #059669;
  --success-glow: rgba(5, 150, 105, 0.25);
  
  --heading-gradient: linear-gradient(135deg, #0f172a 0%, #334155 50%, #db2777 100%);
  --badge-bg: rgba(219, 39, 119, 0.1);
  --badge-border: rgba(219, 39, 119, 0.25);
  --badge-text: #be185d;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-checked: #059669;
  
  --shadow-main: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
  --shadow-card-hover: 0 16px 36px -10px rgba(15, 23, 42, 0.14);
  --shadow-glow: 0 0 25px var(--primary-glow);
  --shadow-success-glow: 0 0 25px var(--success-glow);
}

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

html {
  scrollbar-gutter: stable;
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 60px;
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  position: relative;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--bg-gradient);
  pointer-events: none;
  z-index: -1;
  transform: translateZ(0);
}

/* Custom Smooth Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* Container */
.container {
  max-width: 1540px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Header */
.main-header {
  margin-bottom: 28px;
}

.header-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 12px;
  width: 100%;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  border-radius: 999px;
  color: var(--badge-text);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

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

.header-desktop-only {
  display: inline-flex;
}

.signin-text-desktop {
  display: inline;
}

.signin-text-mobile {
  display: none;
}

.btn-secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-1px);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.btn-header-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2);
}

.btn-header-icon:active {
  transform: scale(0.94);
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2);
}

.theme-toggle-btn:active {
  transform: scale(0.94);
}

[data-theme="dark"] .icon-moon { display: inline-block; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: inline-block; }

.hero-content {
  text-align: center;
  margin-bottom: 28px;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--heading-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto;
}

/* Stats Bar */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
}

.stat-card-highlight {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-card) 100%);
}

.stat-card-highlight:hover {
  border-color: var(--success);
  box-shadow: var(--shadow-success-glow);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--bg-glass);
  flex-shrink: 0;
}

.stat-icon.pink { background: rgba(236, 72, 153, 0.15); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); }
.stat-icon.blue { background: rgba(14, 165, 233, 0.15); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); }

.stat-num {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-text-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.25;
}

.stat-sublabel {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
  line-height: 1.2;
  margin-top: 1px;
}

/* Split Main Layout */
.main-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 1080px) {
  .main-layout {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
}

/* Panel Containers */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-main);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.pantry-panel {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

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

.panel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-pill {
  padding: 3px 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-checked);
}

.pantry-header-buttons {
  display: flex;
  gap: 6px;
}

.btn-xs {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-xs:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-xs.btn-outline {
  background: transparent;
  border-color: var(--border-glass);
  color: var(--text-muted);
}

.btn-xs.btn-outline:hover {
  background: var(--bg-glass-hover);
  color: var(--text-main);
}

/* Search Box */
.search-box {
  position: relative;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search-box input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 0.95rem;
  pointer-events: none;
  opacity: 0.6;
}

.clear-input-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.clear-input-btn:hover {
  color: var(--text-main);
}

/* Quick Add Presets */
.presets-section {
  margin-bottom: 16px;
  flex-shrink: 0;
}

.presets-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 8px;
}

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

.chip {
  padding: 5px 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-body);
}

.chip:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Ingredient Categories & Checkboxes */
.ingredient-list-container {
  overflow-y: auto;
  padding-right: 4px;
  flex-grow: 1;
}

.category-group {
  margin-bottom: 12px;
  border: 1px solid var(--border-item);
  border-radius: var(--radius-md);
  background: var(--bg-item);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.category-group.open {
  border-color: var(--border-glass);
}

.category-header {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
  transition: background-color 0.15s ease;
}

.category-header:hover {
  background: var(--bg-glass-hover);
}

.category-header-title {
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.category-in-stock-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: var(--text-checked);
}

.category-chevron {
  font-size: 0.7rem;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.category-group.open .category-chevron {
  transform: rotate(180deg);
}

.category-items-list {
  padding: 6px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-group:not(.open) .category-items-list {
  display: none;
}

/* Ingredient Checkbox Item */
.ingredient-checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-size: 0.85rem;
  user-select: none;
}

.ingredient-checkbox-item:hover {
  background: var(--bg-item-hover);
}

.ingredient-checkbox-item.checked {
  background: rgba(16, 185, 129, 0.1);
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  background: var(--bg-input);
}

.ingredient-checkbox-item.checked .custom-checkbox {
  background: var(--success);
  border-color: var(--success);
}

.custom-checkbox::after {
  content: "✓";
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s ease;
}

.ingredient-checkbox-item.checked .custom-checkbox::after {
  opacity: 1;
  transform: scale(1);
}

.ingredient-name-text {
  flex-grow: 1;
  transition: color 0.15s;
}

.ingredient-checkbox-item.checked .ingredient-name-text {
  color: var(--text-checked);
  font-weight: 600;
}

.ingredient-recipe-count {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* Right Panel: Recipes Explorer */
.recipes-panel {
  display: flex;
  flex-direction: column;
}

.recipes-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.recipe-search-box {
  flex-grow: 1;
  min-width: 260px;
  margin-bottom: 0;
}

.filter-toggles-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Toggle Switch */
.toggle-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.toggle-container input {
  display: none;
}

.toggle-track {
  width: 38px;
  height: 22px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  position: relative;
  transition: background-color 0.2s, border-color 0.2s;
}

.toggle-track::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background-color 0.2s;
}

.toggle-container input:checked + .toggle-track {
  background: var(--success);
  border-color: var(--success);
}

.toggle-container input:checked + .toggle-track::before {
  transform: translateX(16px);
  background: #ffffff;
}

/* Sort Select */
.sort-select-wrapper select {
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.sort-select-wrapper select:focus {
  border-color: var(--primary);
}

/* Category Tabs */
.category-tabs-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.tab-btn {
  padding: 8px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  font-family: var(--font-body);
}

.tab-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.tab-count {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.72rem;
  font-weight: 700;
}

.tab-btn.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
}

#customActionsContainer,
#tabCustomRecipes {
  display: none;
}

.btn-add-recipe {
  padding: 8px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.btn-add-recipe:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  color: var(--primary);
  transform: translateY(-1px);
}

/* Results Header */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  min-height: 26px;
}

.results-summary {
  font-weight: 600;
}

.active-pantry-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
  min-height: 18px;
  line-height: 1.4;
}

/* Recipe Grid */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  min-height: 400px;
  contain: layout style;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Recipe Card */
.recipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.recipe-card > div:first-child,
.recipe-card-body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

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

.recipe-card.ready-to-make {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-card) 100%);
}

.recipe-card.ready-to-make:hover {
  border-color: var(--success);
  box-shadow: 0 12px 30px -10px rgba(16, 185, 129, 0.4);
}

.recipe-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 8px;
  min-height: 26px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.card-book-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.book-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
}

.book-tag.page-tag {
  font-size: 0.68rem;
  padding: 3px 8px;
  background: var(--bg-item);
  border: 1px solid var(--border-item);
  color: var(--text-dim);
}

.book-tag.base-flavors { background: rgba(20, 184, 166, 0.18); color: #2dd4bf; border-color: rgba(20, 184, 166, 0.4); }
.book-tag.community-legends { background: rgba(249, 115, 22, 0.18); color: #fb923c; border-color: rgba(249, 115, 22, 0.4); }
.book-tag.fan-favorites { background: rgba(236, 72, 153, 0.15); color: #f472b6; border-color: rgba(236, 72, 153, 0.3); }
.book-tag.keto { background: rgba(16, 185, 129, 0.15); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.book-tag.lactose-free { background: rgba(6, 182, 212, 0.15); color: #38bdf8; border-color: rgba(6, 182, 212, 0.3); }
.book-tag.no-protein { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border-color: rgba(139, 92, 246, 0.3); }
.book-tag.custom { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }

/* Multi-Book Banner in Recipe Modal */
.multi-book-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  margin-top: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-item);
  border: 1px solid var(--border-item);
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.multi-book-banner strong {
  color: var(--text-main);
}

.card-actions-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
  min-width: 0;
}

.favorite-btn {
  background: transparent;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--text-dim);
  transition: transform 0.15s ease, color 0.15s ease;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.favorite-btn:hover {
  transform: scale(1.2);
  color: var(--primary);
}

.favorite-btn.is-favorite {
  color: var(--primary);
}

.recipe-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
  color: var(--text-main);
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

/* Match Status Banner */
.match-status-bar {
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.match-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  width: 100%;
  min-width: 0;
  gap: 8px;
  flex-wrap: wrap;
}

.match-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.match-badge.ready {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.match-badge.partial {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.match-badge.low {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.match-percent {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.match-progress-track {
  width: 100%;
  height: 5px;
  background: var(--bg-glass);
  border-radius: 999px;
  overflow: hidden;
}

.match-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary-gradient);
  transition: width 0.3s ease;
}

.match-progress-fill.ready {
  background: var(--success);
}

/* Macro Pills */
.macro-pills {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.macro-pill {
  background: var(--bg-glass);
  border: 1px solid var(--border-item);
  border-radius: var(--radius-sm);
  padding: 6px 3px;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.macro-pill-val {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.macro-pill-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.macro-pill.cal .macro-pill-val { color: #f472b6; }
.macro-pill.pro .macro-pill-val { color: #34d399; }
.macro-pill.carb .macro-pill-val { color: #fbbf24; }
.macro-pill.fat .macro-pill-val { color: #38bdf8; }

/* Ingredients Preview List */
.card-ingredients-preview {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.card-ing-item {
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.card-ing-status {
  font-size: 0.8rem;
  flex-shrink: 0;
}

.card-ing-status.has { color: var(--success); }
.card-ing-status.miss { color: var(--text-dim); opacity: 0.5; }

.card-ing-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.card-ing-item.has .card-ing-text {
  color: var(--text-main);
  font-weight: 500;
}

.card-ing-item.miss .card-ing-text {
  color: var(--text-dim);
}

.card-more-ings {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card Bottom */
.recipe-card-bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.spin-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-view-recipe {
  padding: 8px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-body);
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-view-recipe:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-xl);
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.empty-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 20px;
}

/* Modals & Scroll Containment */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
  overscroll-behavior: contain !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(6, 8, 14, 0.88);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  overscroll-behavior: none;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
  overscroll-behavior: none;
}

.modal-content {
  background: var(--bg-modal);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  padding: 32px;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--text-main);
}

.modal-header {
  margin-bottom: 20px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.modal-meta-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* Modal Macros Grid */
.modal-macro-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  text-align: center;
}

@media (max-width: 600px) {
  .modal-macro-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.modal-macro-item .macro-val {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-macro-item .macro-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

/* Modal Section Headings */
.modal-section-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 20px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modal Ingredients List */
.modal-ingredients-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.modal-ing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-item);
  border: 1px solid var(--border-item);
  border-radius: var(--radius-md);
  gap: 14px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  box-sizing: border-box;
  width: 100%;
}

.modal-ing-row:hover {
  background: var(--bg-item-hover);
}

.modal-ing-row.in-pantry {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.22);
}

.modal-ing-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.modal-ing-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.modal-ing-name {
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--text-main);
  line-height: 1.3;
  word-break: break-word;
}

.modal-ing-notes {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.25;
  word-break: break-word;
}

.modal-ing-amount-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 5px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  min-width: 80px;
  text-align: right;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.modal-ing-amount-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}

.modal-ing-amount-val {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.15;
  white-space: nowrap;
}

.modal-ing-amount-val.empty {
  color: var(--text-dim);
  font-weight: 500;
}

.modal-ing-row.in-pantry .modal-ing-amount-box {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.06);
}

.modal-ing-row.in-pantry .modal-ing-amount-val {
  color: var(--text-checked);
}

/* Actions Toolbar */
.modal-ing-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Legacy group fallback */
.modal-ing-right-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.modal-ing-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-sizing: border-box;
  min-height: 30px;
}

.modal-ing-toggle-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-main);
}

.modal-ing-toggle-btn.in-pantry {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.modal-ing-toggle-btn.in-pantry:hover {
  background: #059669;
  border-color: #059669;
}

@media (max-width: 600px) {
  .modal-ing-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }
  
  .modal-ing-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
  }

  .modal-ing-amount-box {
    min-width: 72px;
    padding: 4px 10px;
  }

  .modal-ing-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
  }

  .modal-ing-actions > * {
    flex: 0 0 auto;
    max-width: 100%;
  }

  .modal-ing-right-group {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* Modal Instructions Steps */
.modal-instructions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.modal-step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 14px;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s, background-color 0.2s;
}

.modal-step-item.completed {
  opacity: 0.55;
  text-decoration: line-through;
}

.step-num-badge {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.modal-step-item.completed .step-num-badge {
  background: var(--text-dim);
}

.step-text {
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Missing Items Alert Callout */
.missing-items-callout {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
}

.missing-items-callout.all-ready {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.missing-items-callout.has-missing {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.missing-items-text {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 3px 0 8px;
  word-break: break-word;
}

/* Buttons */
.btn-primary {
  padding: 10px 20px;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px var(--primary-glow);
  font-family: var(--font-body);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  padding: 10px 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.btn-secondary:hover {
  background: var(--bg-glass-hover);
  color: #ffffff;
}

/* Forms */
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  flex: 1;
}

.form-group.flex-2 { flex: 2; }
.form-group.flex-1 { flex: 1; }

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* Shopping List */
.shopping-list-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 16px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

.shopping-quick-add-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}

.shopping-quick-add-input-box {
  position: relative;
  flex: 1;
}

.shopping-quick-add-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  color: var(--text-main);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

.shopping-quick-add-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.shopping-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-modal);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-height: 240px;
  overflow-y: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.shopping-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-item);
  transition: all var(--transition-fast);
  user-select: none;
}

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

.shopping-autocomplete-item:hover,
.shopping-autocomplete-item.active {
  background: var(--bg-hover);
}

.shopping-autocomplete-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.shopping-autocomplete-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.shopping-autocomplete-name {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.25;
  color: var(--text-main);
}

.shopping-autocomplete-cat {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.2;
}

.shopping-autocomplete-match {
  color: var(--primary);
  font-weight: 700;
}

.shopping-category-group {
  margin-bottom: 12px;
}

.shopping-category-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-glass);
}

.shopping-cat-count {
  margin-left: auto;
  font-size: 0.72rem;
  background: var(--bg-item);
  border: 1px solid var(--border-glass);
  padding: 1px 7px;
  border-radius: 10px;
  color: var(--text-dim);
}

.shopping-category-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shopping-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg-item);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-item);
  transition: all var(--transition-fast);
}

.shopping-item-row:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.shopping-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.shopping-item-check-btn {
  background: transparent;
  border: none;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-check-box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-dim);
  border-radius: 4px;
  display: inline-block;
  transition: all var(--transition-fast);
}

.shopping-item-check-btn:hover .shop-check-box {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.shopping-item-name {
  font-weight: 600;
  font-size: 0.93rem;
  line-height: 1.25;
}

.shopping-item-recipes {
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shopping-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  flex-shrink: 0;
}

.shopping-suggestions-card {
  margin-top: 16px;
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  overflow: hidden;
}

.shopping-suggestions-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  text-align: left;
}

.shopping-suggestions-content {
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-glass);
  max-height: 220px;
  overflow-y: auto;
}

.shopping-suggested-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-item);
}

.shopping-suggested-row:last-child {
  border-bottom: none;
}

.shopping-suggested-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.shopping-suggested-reason {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.shopping-empty-state {
  text-align: center;
  padding: 32px 14px;
}

.shopping-empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.shopping-empty-state p {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 400px;
  margin: 0 auto;
}

/* Offline PWA Grocery Banner */
.offline-banner {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f172a;
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
  padding: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.shopping-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

body.modal-open .toast-container,
body.modal-open .cookie-consent-banner {
  display: none !important;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-modal);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Quick Nutrition & Macro Filter Chips
   ========================================================================== */
.quick-filter-chips-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.quick-filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.filter-chip {
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  background: var(--bg-glass-hover);
  color: var(--text-main);
  border-color: var(--border-highlight);
}

.filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* Recipe Card User Rating Badge */
.recipe-card-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  height: 24px;
  box-sizing: border-box;
  line-height: 1;
}

/* Recipe Card Author Pro Tip Indicator Badge (Hidden on main screen per user request) */
.card-protip-badge {
  display: none !important;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .card-protip-badge {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
}

/* ==========================================================================
   Recipe Modal: Scaling & Unit Mode Controls
   ========================================================================== */
.modal-options-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 18px;
}

.modal-option-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-option-label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.segment-btn-group {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-item);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.segment-btn {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.segment-btn:hover {
  color: var(--text-main);
}

.segment-btn.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.deluxe-active-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f472b6;
  margin-bottom: 18px;
  animation: fadeIn 0.25s ease;
}

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

/* Smart Substitution Chips */
.ing-sub-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.32);
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 3px;
  line-height: 1.25;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ing-sub-chip:hover {
  background: rgba(251, 191, 36, 0.22);
  border-color: rgba(251, 191, 36, 0.5);
}

/* One-Click Grocery Button in Modal Ingredient Row */
.modal-ing-shop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 11px;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-sizing: border-box;
  min-height: 30px;
}

.modal-ing-shop-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text-main);
  border-color: #38bdf8;
}

.modal-ing-shop-btn.in-list {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* Add All Missing Button in Missing Callout */
.btn-add-all-missing {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  cursor: pointer;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  box-sizing: border-box;
  max-width: 100%;
}

.btn-add-all-missing:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: #f59e0b;
  color: #ffffff;
}

/* ==========================================================================
   Defrost 60-Second Bath Timer Widget
   ========================================================================== */
.step-timer-widget {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 6px 0 2px 36px;
  gap: 10px;
  flex-wrap: wrap;
}

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

.timer-icon {
  font-size: 1.15rem;
}

.timer-countdown {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: #06b6d4;
  letter-spacing: 0.03em;
  min-width: 44px;
}

.timer-countdown.pulsing {
  animation: timerPulse 1s infinite alternate;
}

@keyframes timerPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); color: #22d3ee; text-shadow: 0 0 10px rgba(34, 211, 238, 0.5); }
}

.timer-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timer-controls {
  display: flex;
  gap: 6px;
}

.btn-timer-action {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid #06b6d4;
  background: #06b6d4;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-timer-action:hover {
  background: #0891b2;
}

.btn-timer-action.running {
  background: #f59e0b;
  border-color: #f59e0b;
}

.btn-timer-action.done {
  background: var(--success);
  border-color: var(--success);
}

.btn-timer-reset {
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-dim);
  cursor: pointer;
}

.btn-timer-reset:hover {
  color: var(--text-main);
}

/* ==========================================================================
   Official Author Pro Tip Callout Card
   ========================================================================== */
.official-protip-card {
  margin: 20px 0;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.06) 100%);
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.08);
}

.official-protip-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.protip-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b45309;
  background: rgba(245, 158, 11, 0.22);
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

[data-theme="dark"] .protip-badge-pill {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.45);
}

.protip-hack-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.official-protip-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-main);
}

/* ==========================================================================
   Creami Texture Troubleshooter Card
   ========================================================================== */
.spin-troubleshooter-card {
  margin: 20px 0;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.troubleshooter-header {
  margin-bottom: 10px;
}

.troubleshooter-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.troubleshooter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.trouble-item {
  background: var(--bg-item);
  border: 1px solid var(--border-item);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.trouble-q {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 3px;
}

.trouble-a {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.trouble-a strong {
  color: var(--text-main);
}

/* ==========================================================================
   User Rating & Personal Notes Section
   ========================================================================== */
.recipe-user-feedback-section {
  margin: 22px 0 10px;
  padding: 16px;
  background: var(--bg-item);
  border: 1px solid var(--border-item);
  border-radius: var(--radius-md);
}

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

.section-subheading {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.rating-save-status {
  font-size: 0.76rem;
  color: var(--success);
  font-weight: 600;
  transition: opacity 0.3s ease;
}

.rating-stars-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.star-rating {
  display: inline-flex;
  gap: 3px;
}

.star-rating .star {
  font-size: 1.5rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.star-rating .star:hover,
.star-rating .star.hover {
  color: #fde047;
  transform: scale(1.15);
}

.star-rating .star.selected {
  color: #fbbf24;
}

.rating-text-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.recipe-note-wrapper textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-item);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  line-height: 1.4;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.recipe-note-wrapper textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* ==========================================================================
   Google Auth Header Button & User Profile Widget
   ========================================================================== */
.btn-google-signin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0 16px;
  height: 40px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-google-signin:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.2);
}

.btn-google-signin:active {
  transform: scale(0.97);
}

.user-profile-widget {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 4px 12px 4px 6px;
  height: 40px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  background: var(--bg-item);
}

.user-meta-col {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-sync-indicator {
  font-size: 0.68rem;
  font-weight: 600;
  color: #10b981;
}

.btn-signout {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-signout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

/* ==========================================================================
   Google Auth Modal Styling
   ========================================================================== */
.auth-modal-content {
  max-width: 440px;
  text-align: center;
}

.auth-icon-circle {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.auth-sync-perks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
  text-align: left;
}

.perk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-item);
  border: 1px solid var(--border-item);
  padding: 10px 14px;
  border-radius: var(--radius-md);
}

.perk-icon {
  font-size: 1.4rem;
}

.perk-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.perk-text strong {
  font-size: 0.85rem;
  color: var(--text-main);
}

.perk-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.gsi-container {
  display: flex;
  justify-content: center;
  margin: 16px 0 10px;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 16px 0;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-item);
}

.auth-divider span {
  padding: 0 10px;
}

.quick-auth-form {
  text-align: left;
}

/* ==========================================================================
   Recipe Card Community Badges & Made Counters
   ========================================================================== */
.card-community-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  height: 24px;
  box-sizing: border-box;
  line-height: 1;
}

.card-community-rating .rating-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.card-made-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.made-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.made-pill.personal {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.made-pill.community {
  color: #f97316;
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.35);
}

/* ==========================================================================
   Batch Counter Tracker Section in Recipe Modal
   ========================================================================== */
.recipe-batch-tracker-card {
  margin: 18px 0;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.04) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 4px solid #10b981;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.06);
}

.batch-tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.batch-tracker-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.batch-community-pill {
  font-size: 0.76rem;
  color: #f97316;
  background: rgba(249, 115, 22, 0.14);
  border: 1px solid rgba(249, 115, 22, 0.35);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
}

.batch-counter-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.batch-personal-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.batch-counter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.batch-count-number {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  color: #10b981;
  line-height: 1;
}

.batch-times-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.batch-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-batch-action {
  font-family: var(--font-body);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-batch-minus {
  width: 38px;
  height: 38px;
  background: var(--bg-item);
  border: 1px solid var(--border-item);
  color: var(--text-muted);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-batch-minus:hover:not(:disabled) {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.btn-batch-minus:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-batch-plus {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-batch-plus:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.batch-btn-subtext {
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.9;
}

/* ==========================================================================
   Recipe Overall Rating System & Community Reviews
   ========================================================================== */
.recipe-community-rating-card {
  margin: 22px 0 10px;
  padding: 18px;
  background: var(--bg-item);
  border: 1px solid var(--border-item);
  border-radius: var(--radius-md);
}

.community-rating-overview {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-item);
}

@media (max-width: 520px) {
  .community-rating-overview {
    grid-template-columns: 1fr;
  }
}

.comm-score-box {
  text-align: center;
  padding: 10px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
}

.comm-score-big {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fbbf24;
  line-height: 1;
  margin-bottom: 4px;
}

.comm-score-stars {
  font-size: 1rem;
  color: #fbbf24;
  margin-bottom: 4px;
}

.comm-score-count {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.comm-bars-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comm-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
}

.comm-bar-star {
  width: 22px;
  font-weight: 600;
  color: var(--text-muted);
}

.comm-bar-track {
  flex: 1;
  height: 7px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  overflow: hidden;
}

.comm-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.comm-bar-pct {
  width: 20px;
  text-align: right;
  color: var(--text-dim);
  font-weight: 600;
}

.personal-rating-box {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.personal-rating-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

/* ==========================================================================
   Creami Roulette ("Surprise Me" Spin the Wheel)
   ========================================================================== */
.btn-roulette {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 50%, #6366f1 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(236, 72, 153, 0.35);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  white-space: nowrap;
}

.btn-roulette:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.55);
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-roulette:active {
  transform: translateY(0) scale(0.98);
}

.btn-roulette .roulette-icon {
  font-size: 1.15rem;
  display: inline-block;
  transition: transform 0.4s ease;
}

.btn-roulette.spinning .roulette-icon {
  animation: rouletteSpinAnimation 0.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes rouletteSpinAnimation {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Roulette Spin Modal */
#rouletteModalOverlay {
  overscroll-behavior: none;
}

.roulette-modal-content {
  max-width: 480px;
  text-align: center;
  padding: 28px 24px;
  border: 1px solid rgba(236, 72, 153, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 35px rgba(236, 72, 153, 0.2);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.roulette-title-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(236, 72, 153, 0.15);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: 999px;
  color: #f472b6;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.roulette-headline {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #ffffff, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.roulette-subtext {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.roulette-slot-machine {
  background: var(--bg-input);
  border: 2px solid rgba(236, 72, 153, 0.4);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  margin: 16px 0 24px;
  box-shadow: inset 0 4px 18px rgba(0, 0, 0, 0.5), 0 0 15px rgba(236, 72, 153, 0.15);
  overflow: hidden;
  position: relative;
}

.slot-item {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
  line-height: 1.25;
}

.slot-item.blur {
  filter: blur(2.5px);
  opacity: 0.75;
  transform: translateY(2px) scale(0.97);
}

.roulette-winner-announcement {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 10px;
  animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.roulette-winner-badge {
  font-size: 0.78rem;
  font-weight: 800;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.roulette-winner-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.roulette-winner-meta {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.roulette-winner-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

.roulette-winner-actions button {
  min-height: 48px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.roulette-winner-actions button:hover {
  transform: translateY(-2px);
}

/* Modal Winner Banner (When opened from Roulette) */
.roulette-winner-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.16), rgba(168, 85, 247, 0.16));
  border: 1px solid rgba(236, 72, 153, 0.4);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  gap: 12px;
}

.roulette-winner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #f472b6;
}

.btn-modal-spin-again {
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--bg-glass);
  border: 1px solid rgba(236, 72, 153, 0.4);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-modal-spin-again:hover {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  border-color: transparent;
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   Craving Filter Chips (Roadmap Item 12)
   ========================================================================== */
.chip-divider {
  width: 1px;
  height: 20px;
  background: var(--border-glass);
  margin: 0 4px;
  display: inline-block;
  align-self: center;
}

.filter-chip.craving-chip {
  background: rgba(236, 72, 153, 0.08);
  border-color: rgba(236, 72, 153, 0.25);
  color: var(--text-main);
}

.filter-chip.craving-chip:hover {
  background: rgba(236, 72, 153, 0.18);
  border-color: #ec4899;
  transform: translateY(-1px);
}

.filter-chip.craving-chip.active {
  background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.4);
}

/* ==========================================================================
   Fitness & Macro Target Filters Panel (Roadmap Item 10)
   ========================================================================== */
.macro-toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.08);
  color: #60a5fa;
}

.macro-toggle-chip:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: #3b82f6;
  color: #93c5fd;
}

.macro-toggle-chip.active-panel {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.25);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.macro-active-indicator {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #10b981;
}

.macro-sliders-panel {
  background: var(--bg-item);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  animation: fadeInDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.macro-sliders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.macro-sliders-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.macro-header-icon {
  font-size: 1.4rem;
}

.macro-header-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--text-main);
}

.macro-sliders-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.macro-sliders-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.macro-filter-summary {
  font-size: 0.8rem;
  font-weight: 600;
  color: #60a5fa;
}

.macro-sliders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .macro-sliders-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.macro-slider-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-item);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.macro-slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.slider-display {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--primary);
}

.macro-range-input {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-input);
  outline: none;
}

.macro-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* ==========================================================================
   1-Tap Macro Clipboard Export (Roadmap Item 10)
   ========================================================================== */
.macro-export-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -16px;
  margin-bottom: 22px;
  padding: 8px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
  gap: 10px;
}

.btn-copy-macros {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: var(--bg-item);
  border: 1px solid var(--border-item);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-copy-macros:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-copy-macros.copied {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.macro-export-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================================================
   Mobile Friendliness, Bottom Sheet Modals & Touch Ergonomics (Roadmap Item 13)
   ========================================================================== */

/* Modal Drag Handle (for mobile sheet view) */
.modal-handle-bar {
  display: none;
  width: 44px;
  height: 5px;
  background: var(--border-glass);
  border-radius: 999px;
  margin: 0 auto 16px;
  transition: background-color 0.2s ease;
}

/* Mobile View Switcher (Above Main Layout) */
.mobile-section-switcher {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 5px;
  margin-bottom: 18px;
  gap: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.mobile-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  touch-action: manipulation;
}

.mobile-tab-btn.active {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.mobile-tab-count {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.75rem;
  font-weight: 700;
}

.mobile-tab-btn.active .mobile-tab-count {
  background: rgba(255, 255, 255, 0.25);
}

/* Sticky Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-modal);
  border-top: 1px solid var(--border-glass);
  z-index: 950;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.5);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px 4px;
  border-radius: var(--radius-md);
  position: relative;
  flex: 1;
  min-height: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, transform 0.1s ease;
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.bottom-nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-body);
}

.bottom-nav-badge {
  position: absolute;
  top: 2px;
  right: 18%;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Touch Ergonomics on Range Inputs */
.macro-range-input {
  touch-action: pan-y;
  height: 8px;
}

.macro-range-input::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
  border: 2px solid #ffffff;
  -webkit-appearance: none;
}

.macro-range-input::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
  border: 2px solid #ffffff;
}

/* Responsive Rules for Tablets and Phones (<= 768px) */
@media (max-width: 768px) {
  html {
    scrollbar-gutter: auto;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
  }

  body {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
    font-size: 1rem;
    line-height: 1.5;
  }

  .container {
    padding: 14px 14px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .main-layout {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px;
  }

  .panel {
    padding: 20px 16px;
    border-radius: var(--radius-lg);
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Header & Top Bar - Compact Single Row */
  .main-header {
    margin-bottom: 14px;
  }

  .header-top-bar {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-bottom: 10px;
    gap: 8px;
    flex-wrap: nowrap !important;
  }

  #authHeaderContainer {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .header-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    width: auto;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .header-desktop-only {
    display: none !important;
  }

  .signin-text-desktop {
    display: none;
  }

  .signin-text-mobile {
    display: inline;
  }

  .btn-install-text-desktop {
    display: none !important;
  }

  .btn-install-text-mobile {
    display: inline !important;
  }

  .btn-install-pwa {
    padding: 6px 11px;
    font-size: 0.78rem;
  }

  .install-platform-tabs {
    flex-direction: column;
    gap: 6px;
  }

  .btn-header-icon,
  .btn-sound-toggle,
  .theme-toggle-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 1.05rem;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
  }

  .theme-label {
    display: none;
  }

  .btn-secondary-action {
    padding: 0 12px;
    font-size: 0.82rem;
    font-weight: 700;
    height: 36px;
  }

  .btn-google-signin {
    padding: 0 12px;
    font-size: 0.82rem;
    font-weight: 600;
    height: 36px;
    min-height: 36px;
    gap: 6px;
  }

  .btn-google-signin .google-svg {
    width: 15px;
    height: 15px;
  }

  .user-profile-widget {
    padding: 2px 8px 2px 4px;
    height: 36px;
    gap: 6px;
  }

  .user-avatar-circle {
    width: 26px;
    height: 26px;
  }

  .user-name-text {
    max-width: 75px;
    font-size: 0.76rem;
  }

  /* Hero Content - Sleek & Compact */
  .hero-content {
    margin-bottom: 12px;
  }

  .hero-title {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 4px;
  }

  .hero-subtitle {
    font-size: 0.88rem;
    line-height: 1.35;
    margin-bottom: 4px;
  }

  /* Compact Stats Dashboard Bar */
  .stats-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .stat-card-highlight {
    grid-column: 1 / -1 !important;
    order: -1;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    padding: 10px 14px !important;
    gap: 12px !important;
  }

  .stat-card-highlight .stat-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.3rem !important;
    flex-shrink: 0;
  }

  .stat-card-highlight .stat-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    width: auto !important;
  }

  .stat-card-highlight .stat-num {
    font-size: 1.65rem !important;
    line-height: 1 !important;
  }

  .stat-card-highlight .stat-text-group {
    display: flex !important;
    flex-direction: column !important;
  }

  .stat-card-highlight .stat-label {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    margin-top: 0 !important;
    line-height: 1.2 !important;
  }

  .stat-card-highlight .stat-sublabel {
    font-size: 0.72rem !important;
    color: rgba(52, 211, 153, 0.9) !important;
    font-weight: 500 !important;
    line-height: 1.15 !important;
    margin-top: 1px !important;
  }

  .stat-card {
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    align-items: center !important;
    padding: 10px 12px !important;
    gap: 4px 8px !important;
    min-width: 0;
    box-sizing: border-box;
    overflow: visible;
  }

  .stat-info {
    display: contents !important;
  }

  .stat-icon {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 1.2rem !important;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
  }

  .stat-num {
    grid-column: 2 !important;
    grid-row: 1 !important;
    font-size: 1.55rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap;
    overflow: visible;
  }

  .stat-text-group {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    margin-top: 2px !important;
  }

  .stat-label {
    font-size: 0.8rem !important;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.25;
    overflow: visible;
    text-overflow: clip;
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: normal;
  }

  .stat-sublabel {
    font-size: 0.68rem !important;
    color: var(--text-dim);
    font-weight: 500;
    line-height: 1.15;
    margin-top: 1px;
  }



  /* Mobile Section Switcher & Bottom Nav Display */
  .mobile-section-switcher {
    display: flex;
    padding: 6px;
    margin-bottom: 20px;
    gap: 8px;
  }

  .mobile-tab-btn {
    font-size: 1.05rem;
    font-weight: 800;
    min-height: 50px;
    padding: 12px 16px;
    gap: 8px;
  }

  .mobile-tab-icon {
    font-size: 1.25rem;
  }

  .mobile-tab-count {
    font-size: 0.82rem;
    font-weight: 800;
    padding: 3px 9px;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  /* Panel Switching on Mobile */
  .pantry-panel.mobile-panel-hidden,
  .recipes-panel.mobile-panel-hidden {
    display: none !important;
  }

  .pantry-panel {
    position: static;
    max-height: none;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .recipes-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  /* Recipes Explorer Controls */
  .recipes-controls-bar {
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .recipe-search-box {
    width: 100% !important;
    min-width: 0 !important;
  }

  .recipe-search-box input {
    font-size: 1rem !important;
    min-height: 48px;
    padding: 12px 16px 12px 42px;
  }

  .filter-toggles-row {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .toggle-container {
    font-size: 0.92rem;
    font-weight: 600;
    min-height: 44px;
  }

  .sort-select-wrapper {
    width: 100%;
  }

  .sort-select-wrapper select {
    width: 100%;
    min-height: 48px;
    font-size: 0.95rem !important;
    font-weight: 700;
    padding: 10px 14px;
  }

  .btn-roulette {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 1rem;
    font-weight: 800;
  }

  /* Smooth Horizontal Scroll for Tabs & Filter Chips with Rubber-Banding Prevention */
  .category-tabs-bar {
    margin-bottom: 16px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .category-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overscroll-behavior-x: contain !important;
    gap: 10px;
  }

  .category-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex-shrink: 0;
    min-height: 44px;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 700;
  }

  .quick-filter-chips-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overscroll-behavior-x: contain !important;
    gap: 8px;
  }

  .quick-filter-chips-bar::-webkit-scrollbar {
    display: none;
  }

  .quick-filter-label {
    font-size: 0.85rem;
    font-weight: 800;
  }

  .filter-chip {
    flex-shrink: 0;
    min-height: 42px;
    padding: 9px 16px;
    font-size: 0.92rem;
    font-weight: 700;
  }

  .chip-divider {
    display: none;
  }

  /* Preset Chips in Pantry Horizontal Scroll */
  .presets-section {
    margin-bottom: 14px;
  }

  .presets-label {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 8px;
  }

  .preset-chips {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overscroll-behavior-x: contain !important;
    gap: 8px;
  }

  .preset-chips::-webkit-scrollbar {
    display: none;
  }

  .preset-chips .chip {
    flex-shrink: 0;
    min-height: 42px;
    padding: 8px 16px;
    font-size: 0.92rem;
    font-weight: 700;
  }

  /* Single Column Recipe Grid on Mobile / Tablets */
  .recipe-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    gap: 16px;
  }

  .recipe-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 20px 18px;
  }

  .recipe-card-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
  }

  .book-tag {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 12px;
  }

  .match-badge {
    font-size: 0.88rem;
    font-weight: 700;
    padding: 4px 10px;
  }

  .match-percent {
    font-size: 0.88rem;
    font-weight: 700;
  }

  .macro-pills {
    gap: 8px;
    margin-bottom: 16px;
  }

  .macro-pill {
    padding: 8px 4px;
  }

  .macro-pill-val {
    font-size: 1.02rem;
    font-weight: 800;
  }

  .macro-pill-label {
    font-size: 0.74rem;
    font-weight: 700;
  }

  .card-made-row .made-pill {
    font-size: 0.8rem;
    padding: 4px 10px;
  }

  .card-ing-item {
    font-size: 0.92rem;
    padding: 2px 0;
  }

  .card-ing-status {
    font-size: 0.95rem;
  }

  .card-more-ings {
    font-size: 0.82rem;
  }

  .spin-tag {
    font-size: 0.84rem;
    font-weight: 600;
  }

  .btn-view-recipe {
    font-size: 0.95rem;
    font-weight: 700;
    min-height: 46px;
    padding: 10px 18px;
  }

  /* Touch Targets & Generous Sizing for Pantry Checkboxes */
  .panel-title {
    font-size: 1.35rem;
    font-weight: 800;
  }

  .pantry-header-buttons button {
    min-height: 38px;
    padding: 6px 14px;
    font-size: 0.88rem;
    font-weight: 700;
  }

  .search-box input#ingredientSearch {
    font-size: 1rem !important;
    min-height: 48px;
    padding: 12px 16px 12px 42px;
  }

  .category-header {
    min-height: 52px;
    padding: 14px 16px;
  }

  .category-header-title {
    font-size: 1.05rem;
    font-weight: 800;
  }

  .category-in-stock-badge {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 3px 9px;
  }

  .category-chevron {
    font-size: 0.85rem;
  }

  .ingredient-checkbox-item {
    padding: 13px 14px;
    min-height: 50px;
    font-size: 1.02rem;
    touch-action: manipulation;
    gap: 14px;
  }

  .custom-checkbox {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 7px;
    border-width: 2px;
  }

  .custom-checkbox::after {
    font-size: 0.95rem;
    font-weight: 800;
  }

  .ingredient-name-text {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
    white-space: normal;
  }

  .ingredient-recipe-count {
    font-size: 0.82rem;
    font-weight: 600;
  }

  /* Bottom Navigation Touch Sizing */
  .bottom-nav-item {
    min-height: 54px;
    padding: 6px 4px;
  }

  .bottom-nav-icon {
    font-size: 1.35rem;
  }

  .bottom-nav-label {
    font-size: 0.76rem;
    font-weight: 700;
  }

  .bottom-nav-badge {
    font-size: 0.72rem;
    min-width: 18px;
    height: 18px;
  }

  /* Prevent iOS Safari Viewport Auto-Zoom on Input Focus */
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Bottom Sheet Modal Transform on Small Screens (<= 640px) */
@media (max-width: 640px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .modal-content {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 88vh;
    max-height: 88dvh;
    max-height: calc(100dvh - 24px);
    width: 100%;
    padding: 20px 18px max(28px, calc(18px + env(safe-area-inset-bottom, 0px)));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: none;
    border-right: none;
    border-bottom: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .roulette-modal-content {
    padding: 16px 18px max(34px, calc(20px + env(safe-area-inset-bottom, 0px))) !important;
    max-height: 88dvh;
    max-height: calc(100dvh - 20px);
  }

  .roulette-modal-content .roulette-title-badge {
    margin-bottom: 6px;
    font-size: 0.72rem;
    padding: 3px 12px;
  }

  .roulette-modal-content .roulette-headline {
    font-size: 1.25rem;
    margin-bottom: 4px;
  }

  .roulette-modal-content .roulette-subtext {
    font-size: 0.8rem;
    margin-bottom: 10px;
  }

  .roulette-modal-content .roulette-slot-machine {
    padding: 12px 14px;
    margin: 8px 0 10px;
  }

  .roulette-modal-content .slot-item {
    font-size: 1.15rem;
    min-height: 34px;
  }

  .roulette-modal-content .roulette-winner-announcement {
    padding: 12px 14px;
    margin-top: 8px;
  }

  .roulette-modal-content .roulette-winner-badge {
    font-size: 0.72rem;
    margin-bottom: 4px;
  }

  .roulette-modal-content .roulette-winner-title {
    font-size: 1.15rem;
    margin-bottom: 2px;
  }

  .roulette-modal-content .roulette-winner-meta {
    font-size: 0.8rem;
    margin-bottom: 12px;
  }

  .roulette-modal-content .roulette-winner-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 14px;
  }

  .roulette-modal-content .roulette-winner-actions button {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-weight: 700;
    min-height: 48px;
    border-radius: var(--radius-md);
  }

  .toast-container {
    top: 16px;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 420px;
    align-items: center;
  }

  .modal-overlay.active .modal-content {
    transform: translateY(0);
  }

  .modal-handle-bar {
    display: block;
  }

  .modal-close {
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border-radius: 999px;
    font-size: 1.5rem;
  }

  .modal-title {
    font-size: 1.35rem;
    padding-right: 32px; /* ensure no overlap with close button */
  }

  .modal-subtitle {
    font-size: 0.84rem;
  }

  .modal-options-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .segment-btn-group {
    width: 100%;
  }

  .segment-btn {
    flex: 1;
    min-height: 40px;
    text-align: center;
  }

  .modal-macro-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px;
    padding: 12px 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .modal-macro-item {
    min-width: 0;
    overflow: hidden;
  }

  .modal-macro-item .macro-val {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.05rem;
  }

  .btn-copy-macros {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .modal-footer {
    flex-direction: column;
    gap: 10px;
  }

  .modal-footer button,
  .modal-footer .btn-primary,
  .modal-footer .btn-secondary {
    width: 100%;
    min-height: 44px;
  }
}

/* Desktop Guarantee: Always show both panels side-by-side above 768px */
@media (min-width: 769px) {
  .mobile-section-switcher,
  .mobile-bottom-nav {
    display: none !important;
  }

  .pantry-panel,
  .recipes-panel {
    display: flex !important;
  }
}

/* ==========================================================================
   Pints in the Freezer & 16-Hour Timer (Roadmap Item 8)
   ========================================================================== */

/* Ready Badge Pulse Glow */
.badge-count.ready,
.bottom-nav-badge.ready {
  background: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
  animation: badgePulseReady 2.4s infinite ease-in-out;
}

@keyframes badgePulseReady {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

/* Freezer Modal Content */
.freezer-modal-content {
  max-width: 680px;
  padding: 28px 24px;
}

.freezer-modal-header {
  margin-bottom: 20px;
}

.freezer-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.freezer-icon-badge {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  font-size: 1.7rem;
  flex-shrink: 0;
}

/* Native Freeze Timer Push Notification Banner (Roadmap Item 17) */
.freezer-notif-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.25s ease;
}

.freezer-notif-card.active {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.25) 0%, rgba(15, 23, 42, 0.85) 100%);
}

.freezer-notif-card.blocked {
  border-color: rgba(245, 158, 11, 0.4);
}

.freezer-notif-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.freezer-notif-bell {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.freezer-notif-card.active .freezer-notif-bell {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}

.freezer-notif-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.freezer-notif-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.freezer-notif-title-row strong {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.freezer-notif-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.freezer-notif-badge.off {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-muted);
}

.freezer-notif-badge.active {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.freezer-notif-badge.blocked {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.freezer-notif-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.35;
}

.freezer-notif-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-notif-action {
  padding: 8px 14px;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(14, 165, 233, 0.3) 100%);
  color: #e0f2fe;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-notif-action:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.35) 0%, rgba(14, 165, 233, 0.45) 100%);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.btn-notif-action.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

.btn-notif-action.active:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.btn-notif-test {
  padding: 8px 12px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.12);
  color: #d8b4fe;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-notif-test:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: #a855f7;
  color: #ffffff;
  transform: translateY(-1px);
}

.freezer-notif-optin-group {
  margin-top: 10px;
  margin-bottom: 12px;
}

.freezer-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.freezer-checkbox-label input[type="checkbox"] {
  accent-color: #ec4899;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.freezer-tag.notif-tag {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.08);
}

.freezer-tag.notif-tag.sent {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
}

@keyframes highlightPulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  50% { box-shadow: 0 0 25px 5px rgba(56, 189, 248, 0.5); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

.highlight-pulse {
  animation: highlightPulseGlow 1.8s ease-in-out 3;
  border-color: #38bdf8 !important;
}

@media (max-width: 600px) {
  .freezer-notif-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .freezer-notif-actions {
    justify-content: flex-end;
  }
}

/* Quick Add / Log Pint Section */
.freezer-add-section {
  background: var(--bg-item);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 22px;
}

.freezer-toggle-add-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(129, 140, 248, 0.12));
  border: 1px dashed rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  color: #38bdf8;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.freezer-toggle-add-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.freezer-add-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-item);
  animation: fadeInDown 0.2s ease;
}

.freezer-time-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.btn-time-preset {
  padding: 5px 11px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-time-preset:hover {
  color: var(--text-main);
  border-color: var(--border-highlight);
}

.btn-time-preset.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

.freezer-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* Freezer List Header */
.freezer-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.freezer-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

.freezer-timer-legend {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* Freezer Pint Cards List */
.freezer-pints-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.freezer-pint-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.freezer-pint-card.ready {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, var(--bg-card) 100%);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.18);
}

.freezer-card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.freezer-pint-title-group {
  flex: 1;
}

.freezer-pint-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.3;
}

.freezer-meta-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.freezer-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-item);
  background: var(--bg-glass);
  color: var(--text-muted);
}

.freezer-tag.size-standard {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

.freezer-tag.size-deluxe {
  color: #ec4899;
  border-color: rgba(236, 72, 153, 0.35);
  background: rgba(236, 72, 153, 0.08);
}

/* Status Badges */
.freezer-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.freezer-status-badge.chilling {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.freezer-status-badge.ready {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
  animation: readyPulse 2.2s infinite ease-in-out;
}

@keyframes readyPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.03); }
}

/* 16-Hour Countdown Progress Bar */
.freezer-countdown-row {
  margin: 12px 0 10px;
}

.freezer-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 5px;
}

.freezer-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.freezer-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8 0%, #818cf8 100%);
  transition: width 0.4s ease;
}

.freezer-progress-fill.ready {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.freezer-notes-snippet {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
  padding: 6px 10px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--border-highlight);
}

/* Card Action Buttons */
.freezer-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border-glass);
}

.freezer-card-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-spin-enjoyed {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35);
}

.btn-spin-enjoyed:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(16, 185, 129, 0.55);
}

.btn-freezer-recipe {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-freezer-recipe:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
}

.btn-freezer-discard {
  padding: 6px 10px;
  font-size: 0.82rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.btn-freezer-discard:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}

/* Empty Freezer State */
.freezer-empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-lg);
}

.freezer-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.8;
}

.freezer-empty-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.freezer-empty-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto 16px;
  line-height: 1.5;
}

/* Recipe Detail Modal Freezer Controls */
.recipe-modal-freezer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(129, 140, 248, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.86rem;
  color: #38bdf8;
  gap: 10px;
}

.recipe-modal-freezer-banner.ready {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(52, 211, 153, 0.14));
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.btn-freeze-pint-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-freeze-pint-action:hover {
  background: rgba(56, 189, 248, 0.24);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

/* ==========================================================================
   1-Tap Smart Ingredient Substitutions ("What Can I Swap?") (Roadmap Item 16)
   ========================================================================== */

/* Ingredient Row Swap Trigger Badge */
.ing-swap-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 11px;
  border-radius: 999px;
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
  box-sizing: border-box;
  min-height: 30px;
}

.ing-swap-badge:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: #a855f7;
  color: #e9d5ff;
  transform: translateY(-1px);
}

.ing-swap-badge.active-swap {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

.ing-active-swap-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 3px;
  max-width: fit-content;
}

.btn-ing-revert-swap {
  background: transparent;
  border: none;
  color: #f472b6;
  font-weight: 700;
  cursor: pointer;
  padding: 0 2px;
  text-decoration: underline;
  font-size: 0.72rem;
  transition: color 0.15s ease;
}

.btn-ing-revert-swap:hover {
  color: #fb7185;
}

/* Swap Inspector Modal Content */
.swap-modal-content {
  max-width: 660px;
  padding: 28px 24px;
}

.swap-modal-header {
  margin-bottom: 18px;
}

.swap-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.swap-icon-badge {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-md);
  font-size: 1.6rem;
  flex-shrink: 0;
}

/* Selected Ingredient Focus Card */
.swap-focus-card {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(59, 130, 246, 0.06) 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.swap-focus-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.swap-focus-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.swap-focus-category {
  font-size: 0.76rem;
  font-weight: 700;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
}

.swap-focus-role {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.swap-active-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: #34d399;
}

.btn-reset-swap {
  background: transparent;
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reset-swap:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #ffffff;
}

/* Swaps List Header */
.swap-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.swap-section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.swap-legend-pill {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* Swaps Options List & Cards */
.swap-options-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.swap-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.swap-card:hover {
  border-color: var(--border-highlight);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
}

.swap-card.is-active-swap {
  border-color: rgba(168, 85, 247, 0.6);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, var(--bg-card) 100%);
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.25);
}

.swap-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.swap-card-title-group {
  flex: 1;
}

.swap-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.swap-card-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.swap-ratio-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.swap-pantry-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}

/* Swap Details Grid */
.swap-details-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.swap-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-main);
  background: var(--bg-glass);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-item);
}

.swap-detail-item strong {
  color: var(--text-main);
  white-space: nowrap;
}

.swap-pro-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  padding: 8px 10px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  border-left: 3px solid #f59e0b;
}

/* Swap Card Actions */
.swap-card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-glass);
}

.btn-apply-swap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 3px 12px rgba(168, 85, 247, 0.35);
}

.btn-apply-swap:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(168, 85, 247, 0.55);
}

.btn-apply-swap.applied {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   Build-A-Pint Balancing Wizard & Creaminess Score (Roadmap Item 18)
   ========================================================================== */
.bap-modal-container {
  max-width: 820px;
}

.bap-header {
  text-align: center;
  margin-bottom: 12px;
}

.bap-header-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 999px;
  color: #c084fc;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.bap-mode-tabs {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin: 10px auto 20px;
  max-width: 480px;
}

.bap-mode-btn {
  flex: 1;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.bap-mode-btn.active {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(236, 72, 153, 0.35);
}

/* Creaminess & Macro HUD Card */
.bap-hud-card {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.3), inset 0 0 16px rgba(236, 72, 153, 0.06);
}

.bap-hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.bap-score-box {
  flex: 1;
  min-width: 250px;
}

.bap-score-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.bap-score-title {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.bap-score-grade {
  font-size: 0.82rem;
  font-weight: 800;
  color: #34d399;
}

.bap-score-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 6px;
}

.bap-score-num {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 18px rgba(52, 211, 153, 0.45);
}

.bap-score-max {
  font-size: 1.05rem;
  color: var(--text-dim);
  font-weight: 700;
}

.bap-meter-track {
  height: 9px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.bap-meter-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ec4899 0%, #f59e0b 50%, #10b981 100%);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
}

.bap-specs-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.bap-spec-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.bap-spec-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.bap-spin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 999px;
  color: #38bdf8;
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 800;
}

.bap-freeze-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-item);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.bap-science-tip {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid #34d399;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-main);
  transition: all 0.25s ease;
}

.bap-macro-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bap-macro-cell {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-item);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
}

.bap-macro-val {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.bap-macro-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* Config Bar (Title & Size) */
.bap-config-bar {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.bap-title-field {
  flex: 2;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bap-title-field label, .bap-size-field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.bap-input-with-action {
  display: flex;
  gap: 8px;
}

.bap-text-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
}

.bap-text-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.bap-autoname-btn {
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bap-size-field {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bap-size-toggle-group {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 4px;
}

.bap-size-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
}

.bap-size-btn.active {
  background: rgba(236, 72, 153, 0.2);
  border: 1px solid rgba(236, 72, 153, 0.4);
  color: #f472b6;
  font-weight: 800;
}

/* Step Navigation Pills */
.bap-step-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 18px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.bap-step-pills::-webkit-scrollbar {
  display: none;
}

.bap-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-item);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.bap-step-pill.active {
  background: rgba(236, 72, 153, 0.18);
  border-color: rgba(236, 72, 153, 0.5);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.25);
}

.bap-pill-num {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.bap-step-pill.active .bap-pill-num {
  background: var(--primary);
  color: #ffffff;
}

/* Step Content Sections */
.bap-step-content {
  animation: fadeInDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bap-section-header {
  margin-bottom: 14px;
}

.bap-section-header h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
}

.bap-section-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.bap-subhead {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}

/* Ingredient Cards Grid */
.bap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.bap-card {
  background: var(--bg-card);
  border: 1px solid var(--border-item);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  user-select: none;
}

.bap-card:hover {
  border-color: rgba(236, 72, 153, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.bap-card.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.bap-card-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--border-item);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: transparent;
  transition: all 0.15s;
}

.bap-card.active .bap-card-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.bap-card-icon {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.bap-card-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 4px;
  padding-right: 20px;
}

.bap-card-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 10px;
}

.bap-card-macros {
  font-size: 0.72rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 8px;
  width: fit-content;
}

.bap-card-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-item);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  margin-top: 6px;
}

.bap-stepper-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.bap-stepper-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

.bap-stepper-val {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Wizard Footer Actions */
.bap-wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border-glass);
  margin-top: 20px;
}

.bap-save-btn {
  margin-left: auto;
  font-size: 0.95rem;
  padding: 12px 24px;
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.4);
}

/* Badge for recipes in browse cards with Creaminess Score */
.recipe-creaminess-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
  .bap-hud-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .bap-specs-box {
    align-items: stretch;
    flex-direction: row;
    justify-content: space-between;
  }
  
  .bap-config-bar {
    flex-direction: column;
    align-items: stretch;
  }

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

  .bap-wizard-footer {
    flex-wrap: wrap;
  }

  .bap-save-btn {
    width: 100%;
    margin-left: 0;
    order: -1;
  }
}

/* ==========================================================================
   User Management, Tiered Access & Admin Portal (Roadmap Item 15)
   ========================================================================== */

/* Admin Header Button */
.btn-admin-header {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.25) 100%) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #fbbf24 !important;
  font-weight: 800 !important;
}

.btn-admin-header:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35) 0%, rgba(217, 119, 6, 0.45) 100%) !important;
  border-color: #f59e0b !important;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.35) !important;
}

/* Accessible Only Filter Checkbox */
.access-filter-wrap {
  display: flex;
  align-items: center;
}

.access-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.access-filter-label:hover {
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--text-main);
}

.access-filter-label input[type="checkbox"] {
  accent-color: #f59e0b;
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Locked Card Badges & Teaser */
.recipe-card.locked {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.03) 0%, var(--bg-card) 100%);
}

.locked-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  letter-spacing: 0.02em;
}

/* Locked Recipe Teaser Card in Modal */
.locked-recipe-teaser {
  margin: 20px 0;
  padding: 28px 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px dashed rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.locked-teaser-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  animation: pulseLock 2.4s infinite ease-in-out;
}

@keyframes pulseLock {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.locked-teaser-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 8px;
}

.locked-teaser-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 18px;
  line-height: 1.5;
}

.locked-user-status {
  font-size: 0.82rem;
  color: var(--text-dim);
  padding: 6px 14px;
  background: var(--bg-item);
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 8px;
}

.locked-teaser-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Admin Portal Modal */
.admin-modal-content {
  max-width: 860px;
  padding: 28px 24px;
}

.admin-modal-header {
  margin-bottom: 20px;
}

.admin-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-icon-badge {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  font-size: 1.8rem;
  flex-shrink: 0;
}

/* Admin Quick Stats */
.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.admin-stat-card {
  background: var(--bg-item);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
}

.admin-stat-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fbbf24;
}

.admin-stat-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Admin Toolbar */
.admin-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-search-wrap {
  flex: 1;
  min-width: 220px;
}

.admin-search-input {
  width: 100%;
  padding: 9px 14px;
  background: var(--bg-item);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.admin-search-input:focus {
  border-color: #fbbf24;
}

.admin-filter-pills {
  display: flex;
  gap: 6px;
}

/* Admin User Directory List */
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-user-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.admin-user-card:hover {
  border-color: var(--border-highlight);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.admin-user-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.admin-user-info-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(245, 158, 11, 0.4);
}

.admin-user-avatar-initials {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #059669, #0284c7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.1rem;
  border: 2px solid rgba(245, 158, 11, 0.4);
}

.admin-user-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-user-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.admin-user-email {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.admin-user-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.admin-user-badge.admin {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.admin-user-badge.user {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text-muted);
}

/* User Metadata Strip */
.admin-user-stats-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--text-dim);
  padding: 6px 10px;
  background: var(--bg-item);
  border-radius: var(--radius-sm);
}

/* Subscriptions & Category Access Section */
.admin-subs-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-item);
  padding-top: 10px;
}

.admin-subs-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.admin-subs-chips-wrap {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-sub-chip {
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--border-glass);
  background: var(--bg-item);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.btn-sub-chip:hover {
  color: var(--text-main);
  border-color: var(--border-highlight);
}

.btn-sub-chip.active {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.btn-sub-chip.active.all-access {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(236, 72, 153, 0.25));
  border-color: rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  font-weight: 800;
}

/* Admin Action Controls */
.admin-user-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.btn-role-toggle {
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-role-toggle:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #fbbf24;
}

.btn-admin-del-user {
  padding: 5px 8px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-admin-del-user:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

/* ==========================================================================
   Admin Portal Responsive & Mobile Touch Scrolling Optimization
   ========================================================================== */
@media (max-width: 640px) {
  .admin-modal-content {
    max-height: 90dvh !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 16px 14px max(36px, calc(24px + env(safe-area-inset-bottom, 0px))) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain;
  }

  .admin-title-row {
    gap: 10px;
  }

  .admin-icon-badge {
    width: 38px;
    height: 38px;
    font-size: 1.4rem;
  }

  .admin-stats-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }

  .admin-stat-card {
    padding: 10px 4px !important;
  }

  .admin-stat-num {
    font-size: 1.25rem !important;
  }

  .admin-stat-label {
    font-size: 0.62rem !important;
    letter-spacing: 0.02em;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 14px;
  }

  .admin-search-wrap {
    min-width: 100%;
    width: 100%;
  }

  .admin-search-input {
    font-size: 16px !important; /* Prevents iOS Safari auto-zoom */
    padding: 10px 12px;
  }

  .admin-filter-pills {
    display: flex;
    width: 100%;
    gap: 6px;
  }

  .admin-filter-pills .btn-time-preset {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    font-size: 0.74rem;
  }

  #adminRefreshUsersBtn {
    width: 100%;
    padding: 8px;
    font-size: 0.82rem;
  }

  .admin-users-list {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
    padding-bottom: 24px;
    gap: 12px;
  }

  .admin-user-card {
    padding: 14px 12px;
    gap: 12px;
  }

  .admin-user-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .admin-user-info-cluster {
    width: 100%;
    gap: 10px;
  }

  .admin-user-avatar,
  .admin-user-avatar-initials {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    flex-shrink: 0;
  }

  .admin-user-name {
    font-size: 0.95rem;
    word-break: break-word;
  }

  .admin-user-email {
    font-size: 0.76rem;
    word-break: break-all;
  }

  .admin-user-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
  }

  .admin-user-actions .btn-role-toggle {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    font-size: 0.76rem;
    min-height: 38px;
  }

  .admin-user-actions .btn-admin-del-user {
    padding: 8px 12px;
    min-height: 38px;
  }

  .admin-user-stats-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 10px;
    font-size: 0.72rem;
    padding: 8px 10px;
  }

  .admin-subs-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .admin-subs-chips-wrap {
    width: 100%;
    gap: 6px;
  }

  .btn-sub-chip {
    font-size: 0.72rem;
    padding: 6px 10px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }
}

/* --- Header Sound Toggle & PWA Install Button (Roadmap Items 19 & 20) --- */
.btn-sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.btn-sound-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2);
}

.btn-sound-toggle:active {
  transform: scale(0.94);
}

.btn-install-pwa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(236, 72, 153, 0.35);
  transition: all 0.2s ease;
  animation: pulseInstall 3s ease-in-out 3;
}

@keyframes pulseInstall {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.btn-install-pwa:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.65);
}

.btn-install-text-desktop {
  display: inline;
}

.btn-install-text-mobile {
  display: none;
}

/* --- App Footer (Roadmap Item 19) --- */
.app-footer {
  margin-top: 48px;
  padding: 28px 20px 40px;
  border-top: 1px solid var(--border-glass);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.footer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 900px;
  flex-wrap: wrap;
  gap: 12px;
}

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

.footer-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-main);
}

.footer-version-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  background: var(--bg-item);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.footer-link,
.footer-action-btn {
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease;
}

.footer-link:hover,
.footer-action-btn:hover {
  color: var(--primary);
}

.footer-dot {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.footer-disclaimer {
  font-size: 0.75rem;
  color: var(--text-dim);
  max-width: 760px;
  line-height: 1.5;
}

/* --- Kitchen Data Backup Modal (Roadmap Item 20) --- */
.backup-modal-content {
  max-width: 580px;
}

.backup-card-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 18px 0;
}

.backup-card {
  background: var(--bg-item);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.backup-card.danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.04);
}

.backup-card-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.backup-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.backup-options-row {
  display: flex;
  gap: 14px;
  font-size: 0.85rem;
  color: var(--text-main);
  align-items: center;
}

.backup-file-input {
  display: none;
}

/* --- iOS Safari Install Guide Modal --- */
.ios-install-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0;
}

.ios-step-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-item);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.ios-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.ios-step-text {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.45;
}

/* --- Universal Install Guide Modal Tabs --- */
.install-platform-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-item);
  padding: 5px;
  border-radius: var(--radius-sm);
  margin: 16px 0 20px;
  border: 1px solid var(--border-glass);
}

.install-tab-btn {
  flex: 1;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.install-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.install-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.35);
}

.install-steps-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 10px 0 20px;
}

/* --- Cookie & Analytics Consent Banner (Google Consent Mode v2 Ready) --- */
.cookie-consent-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 880px;
  z-index: 900;
  background: var(--bg-modal);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding: 18px 22px;
  animation: slideUpCookie 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpCookie {
  from {
    transform: translate(-50%, 100%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

.cookie-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.cookie-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cookie-banner-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-banner-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.cookie-banner-desc a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-cookie-accept {
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.86rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(236, 72, 153, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-cookie-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.5);
}

.btn-cookie-essential {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--bg-item);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.86rem;
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-cookie-essential:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.btn-cookie-custom {
  padding: 9px 14px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.84rem;
  border: none;
  cursor: pointer;
  transition: color 0.18s ease;
  white-space: nowrap;
}

.btn-cookie-custom:hover {
  color: var(--text-main);
  text-decoration: underline;
}

/* --- Cookie Preferences Modal --- */
.cookie-modal-content {
  max-width: 580px;
}

.cookie-pref-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 18px 0;
}

.cookie-pref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-item);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.cookie-pref-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.cookie-pref-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-pref-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.cookie-badge-always {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  border-radius: 999px;
  text-transform: uppercase;
}

.cookie-pref-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* Custom iOS-style Switch */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-glass);
  transition: 0.25s ease;
  border-radius: 999px;
  border: 1px solid var(--border-glass);
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s ease;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.cookie-switch input:checked + .cookie-slider {
  background: var(--primary);
  border-color: var(--primary);
}

.cookie-switch input:checked + .cookie-slider:before {
  transform: translateX(20px);
}

.cookie-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Mobile Responsive Adjustment */
@media (max-width: 768px) {
  .cookie-consent-banner {
    bottom: 74px; /* Above mobile sticky nav */
    padding: 16px;
    width: calc(100% - 20px);
  }

  .cookie-banner-content {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .cookie-banner-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn-cookie-accept,
  .btn-cookie-essential,
  .btn-cookie-custom {
    width: 100%;
    text-align: center;
    padding: 10px;
  }
}

/* ========================================================
   AVAILABLE FOR PURCHASE & RECIPE PACKS SHOWCASE
   ======================================================== */

/* Results Header Badge Button */
.btn-available-packs {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.38);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-available-packs:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
  color: #fef08a;
}

.btn-packs-icon {
  font-size: 0.95rem;
}

/* Category Tab Lock Indicators */
.tab-lock-indicator {
  font-size: 0.72rem;
  margin-left: 5px;
  opacity: 0.8;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
  transition: opacity 0.2s ease;
}

.tab-btn:hover .tab-lock-indicator {
  opacity: 1;
}

/* Category Pack Promo Hero Card */
.category-pack-promo {
  margin-bottom: 24px;
}

.pack-promo-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  padding: 22px 26px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 20px rgba(245, 158, 11, 0.1);
}

.pack-promo-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 250px;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.15), transparent 70%);
  pointer-events: none;
}

.pack-promo-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.pack-promo-icon {
  font-size: 2.2rem;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 14px;
  flex-shrink: 0;
}

.pack-promo-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.pack-promo-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

.pack-promo-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 18px;
  max-width: 720px;
}

.pack-promo-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-pack-unlock {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #1e1e1e !important;
  font-weight: 800 !important;
  border: none !important;
  padding: 10px 20px !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  transition: all 0.2s ease !important;
}

.btn-pack-unlock:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

/* General Available for Purchase Banner */
.purchase-available-banner {
  margin-top: 32px;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35), 0 0 25px rgba(245, 158, 11, 0.08);
}

.purchase-banner-glow {
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.purchase-banner-body {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px 28px;
  z-index: 1;
}

.purchase-banner-icon {
  font-size: 2.4rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

.purchase-banner-text {
  flex: 1;
}

.purchase-banner-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.purchase-banner-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.purchase-banner-desc {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

.btn-purchase-cta {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #1e1e1e;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.btn-purchase-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.5);
  color: #000;
}

/* Recipe Packs Store Modal */
.recipe-packs-modal-content {
  max-width: 820px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 28px;
}

.recipe-packs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
  margin-bottom: 18px;
}

.recipe-pack-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 18px 20px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.recipe-pack-card:hover {
  border-color: rgba(245, 158, 11, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.recipe-pack-card.vip-bundle {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(30, 41, 59, 0.9) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.15);
}

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

.pack-card-icon {
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  flex-shrink: 0;
}

.pack-card-title-col {
  flex: 1;
}

.pack-card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pack-card-name {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.pack-card-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.pack-card-badge.fan-fav { background: rgba(236, 72, 153, 0.18); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.35); }
.pack-card-badge.keto { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.pack-card-badge.lactose { background: rgba(6, 182, 212, 0.18); color: #38bdf8; border: 1px solid rgba(6, 182, 212, 0.35); }
.pack-card-badge.nopro { background: rgba(139, 92, 246, 0.18); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.35); }
.pack-card-badge.vip { background: linear-gradient(135deg, #f59e0b, #ec4899); color: #fff; border: none; font-weight: 900; }

.pack-card-tagline {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}

.pack-card-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.pack-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border-item);
  padding-top: 12px;
}

.pack-status-available {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fbbf24;
}

.pack-status-active {
  font-size: 0.82rem;
  font-weight: 700;
  color: #34d399;
}

.btn-action-pack.vip-btn {
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%) !important;
  color: #fff !important;
  font-weight: 800 !important;
}

.packs-modal-footer {
  text-align: center;
  border-top: 1px solid var(--border-item);
  padding-top: 16px;
  margin-top: 8px;
}

.packs-footer-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}

@media (max-width: 640px) {
  .purchase-banner-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .btn-purchase-cta {
    width: 100%;
    text-align: center;
  }
  .pack-promo-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .pack-card-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-action-pack {
    width: 100%;
  }
}



