:root {
  --bg-app: #080c14;
  --bg-surface: #0f172a;
  --bg-card: #141e33;
  --bg-card-hover: #1e2942;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #0ea5e9;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-emerald: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.12);
  --accent-blue: #38bdf8;
  --accent-blue-subtle: rgba(56, 189, 248, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-subtle: rgba(245, 158, 11, 0.12);
  --accent-rose: #f43f5e;
  --accent-rose-subtle: rgba(244, 63, 94, 0.14);
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.45;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Viewport Container */
.app-container {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
  padding-bottom: calc(72px + var(--safe-bottom));
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-badge {
  width: 38px;
  height: 38px;
  background: transparent;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo-badge img,
.brand-logo-badge svg {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: block;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.household-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--accent-blue);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.household-pill:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.3);
}

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

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background-color: var(--accent-rose);
  border-radius: 50%;
}

/* Tabs View */
.tab-view {
  display: none;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.tab-view.active {
  display: block;
}

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

/* Executive Metric Strip */
.metrics-strip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metrics-group {
  display: flex;
  gap: 20px;
}

.metric-unit {
  display: flex;
  flex-direction: column;
}

.metric-number {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.metric-number.fresh { color: var(--accent-emerald); }
.metric-number.warning { color: var(--accent-amber); }
.metric-number.urgent { color: var(--accent-rose); }

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

.btn-quick-action {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-quick-action:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent-emerald);
}

.btn-quick-action svg {
  width: 15px;
  height: 15px;
}

/* STORAGE FILTER - CLEAN RESPONSIVE WRAP (NO TRUNCATION) */
.filter-scroll-wrapper {
  margin-bottom: 12px;
}

.filter-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
}

.filter-pill {
  flex: 1 1 calc(20% - 6px);
  min-width: 68px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
  user-select: none;
  text-align: center;
  white-space: nowrap;
}

.filter-pill svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
  flex-shrink: 0;
}

.filter-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.16);
}

.filter-pill.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

/* Shopping Catalog Selector & Quick Chips */
.shopping-catalog-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px dashed rgba(56, 189, 248, 0.35);
  color: var(--accent-blue);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  margin-top: 8px;
}

.shopping-catalog-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-blue);
}

.shopping-catalog-btn svg {
  width: 14px;
  height: 14px;
}

.quick-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.quick-chip-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 9px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-chip-item:hover {
  border-color: var(--accent-blue);
  color: #fff;
}

/* Search Bar */
.search-wrapper {
  position: relative;
  margin-bottom: 14px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 36px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus {
  border-color: var(--border-focus);
}

/* Product Card - Professional Minimalist */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.product-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.product-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.product-icon-box {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.product-icon-box svg {
  width: 20px;
  height: 20px;
}

.product-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.product-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.non-food-tag {
  font-size: 10px;
  font-weight: 600;
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.baby-tag {
  font-size: 10px;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.product-sub-row {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-author {
  font-size: 11px;
  color: var(--text-muted);
}

.product-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* Status Badges */
.status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-pill.fresh {
  background: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
}
.status-pill.fresh .status-dot { background: var(--accent-emerald); }

.status-pill.warning {
  background: var(--accent-amber-subtle);
  color: var(--accent-amber);
}
.status-pill.warning .status-dot { background: var(--accent-amber); }

.status-pill.expired {
  background: var(--accent-rose-subtle);
  color: var(--accent-rose);
}
.status-pill.expired .status-dot { background: var(--accent-rose); }

/* Card Actions */
.item-actions {
  display: flex;
  gap: 4px;
}

.btn-tool {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tool:hover {
  background: var(--bg-card-hover);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-tool svg {
  width: 14px;
  height: 14px;
}

/* Catalog Picker - Step Navigation */
.section-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.catalog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.catalog-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.catalog-card-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.catalog-card-icon svg {
  width: 18px;
  height: 18px;
}

.catalog-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.catalog-card-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Products in Category */
.products-subgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.product-pick-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.product-pick-card:hover {
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

.product-pick-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
}

.product-pick-icon svg {
  width: 22px;
  height: 22px;
}

.product-pick-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

/* Step 3 Form */
.form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

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

.chip-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  background: var(--bg-card-hover);
  color: #fff;
}

.chip-btn.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
  font-weight: 600;
}

.input-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 9px 12px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.input-box:focus {
  border-color: var(--border-focus);
}

.presets-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.preset-chip-btn {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--accent-blue);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip-btn:hover {
  background: rgba(56, 189, 248, 0.2);
}

.info-banner {
  background: rgba(16, 185, 129, 0.06);
  border-left: 3px solid var(--accent-emerald);
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  color: #a7f3d0;
  line-height: 1.4;
}

.btn-primary-action {
  background: #0284c7;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-primary-action:hover {
  background: #0369a1;
}

/* Recipes */
.recipe-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recipe-header-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.recipe-badge-icon {
  width: 40px;
  height: 40px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-amber);
  flex-shrink: 0;
}

.recipe-badge-icon svg {
  width: 20px;
  height: 20px;
}

.recipe-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.recipe-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.recipe-meta-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.recipe-nutrition-bar {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.saved-pill {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}

.recipe-box-list {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  color: #cbd5e1;
}

.recipe-section-head {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 11.5px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.recipe-ing-row {
  padding: 3px 0;
  line-height: 1.45;
  color: #e2e8f0;
}

.recipe-steps-flow {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.recipe-step-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #cbd5e1;
}

.recipe-chef-tip-box {
  background: rgba(245, 158, 11, 0.07);
  border-left: 3px solid #f59e0b;
  border-radius: 4px 8px 8px 4px;
  padding: 10px 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #fde68a;
}

.recipe-chef-tip-title {
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Family Card */
.family-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.invite-code-pill {
  background: var(--bg-surface);
  border: 1px dashed rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  margin: 10px 0;
}

.invite-code-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent-blue);
  font-family: monospace;
}

/* Bottom Nav - Executive Obsidian & Emerald Style */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  height: calc(62px + var(--safe-bottom));
  background: rgba(9, 14, 23, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  padding: 6px 4px calc(6px + var(--safe-bottom)) 4px;
  z-index: 50;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  position: relative;
  padding: 6px 2px;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover {
  color: #f1f5f9;
}

.nav-item svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.1;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.nav-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.nav-item.active {
  color: #10b981;
}

.nav-item.active svg {
  stroke: #10b981;
  transform: translateY(-1px) scale(1.05);
  filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.4));
}

.nav-item.active .nav-label {
  color: #ffffff;
  font-weight: 700;
}

.nav-badge-count {
  position: absolute;
  top: 0px;
  right: 22%;
  background: var(--accent-rose);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 8px;
  border: 2px solid var(--bg-surface);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

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

.modal-heading {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn svg {
  width: 18px;
  height: 18px;
}

/* Social SSO Auth */
.social-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 10px 0 6px 0;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

.social-auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-social:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-social svg {
  flex-shrink: 0;
}

/* Empty View */
.empty-view {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-view-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}

/* Shopping List Styles */
.shopping-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all 0.15s ease;
}

.shopping-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.shopping-card.bought {
  opacity: 0.55;
  background: rgba(20, 30, 51, 0.5);
}

.shopping-card.bought .shopping-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.shopping-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.shopping-check-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.02);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
  padding: 0;
}

.shopping-check-btn svg {
  display: none;
}

.shopping-check-btn.pending:hover {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
}

.shopping-check-btn.pending:hover svg {
  display: block;
  width: 13px;
  height: 13px;
  stroke: var(--accent-emerald);
  stroke-width: 2.2;
}

.shopping-check-btn.bought,
.shopping-check-btn.checked,
.shopping-card.bought .shopping-check-btn {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #ffffff;
}

.shopping-check-btn.bought svg,
.shopping-check-btn.checked svg,
.shopping-card.bought .shopping-check-btn svg {
  display: block;
  width: 14px;
  height: 14px;
  stroke: #ffffff;
  stroke-width: 2.5;
}

.shopping-card.in-cart-done {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.35);
  opacity: 0.72;
}

.shopping-card.in-cart-done .shopping-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.shopping-card.in-cart-done .shopping-sub {
  text-decoration: line-through;
  opacity: 0.75;
}

.shopping-cart-bar {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 95, 70, 0.25));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

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

.btn-finish-shopping {
  background: var(--accent-emerald);
  color: #fff;
  border: none;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-finish-shopping:hover {
  background: #059669;
  transform: translateY(-1px);
}

.variant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.variant-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.variant-chip:hover {
  border-color: var(--accent-blue);
  color: #fff;
}

.variant-chip.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
  font-weight: 600;
}

.timing-pill {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.timing-pill.active {
  background: rgba(2, 132, 199, 0.15);
  border-color: var(--accent-blue);
  color: #fff;
  font-weight: 600;
}

.date-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}

.date-chip:hover {
  border-color: var(--accent-blue);
  color: #fff;
}

.planned-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(2, 132, 199, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 6px;
}

.shopping-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.shopping-sub {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

/* Shopping Plan Sub-Tabs (Current vs Planned) */
.shopping-plan-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.plan-sub-tab {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  user-select: none;
}

.plan-sub-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.plan-sub-tab.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-blue);
  color: #ffffff;
}

/* Custom Product Badge in Catalog */
.custom-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 1px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}

.product-pick-card {
  position: relative;
}

.btn-delete-custom-prod {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 2;
}

.btn-delete-custom-prod:hover {
  background: #ef4444;
  color: #fff;
}

/* Shopping Accordion Groups */
.shopping-accordion {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.18s ease;
}

.shopping-accordion.open {
  border-color: rgba(255, 255, 255, 0.16);
}

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

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.accordion-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-icon {
  font-size: 19px;
  line-height: 1;
}

.accordion-heading {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  display: block;
}

.accordion-sub {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-top: 1px;
}

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

.accordion-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.2px;
}

.badge-current {
  background: rgba(2, 132, 199, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(2, 132, 199, 0.35);
}

.badge-planned {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

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

.chevron-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.22s ease;
}

.shopping-accordion.open .chevron-icon {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 12px 14px 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-delete-list {
  background: transparent;
  border: none;
  color: var(--accent-rose);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: all 0.15s ease;
}

.btn-delete-list:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.15);
}

/* Confirm Purchases Expiry & OCR Modal */
.confirm-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.confirm-item-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.quick-days-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.btn-scan-date {
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-scan-date:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: #10b981;
}

/* Archive Action Toolbar */
.archive-action-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.btn-clear-archive {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear-archive:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: #ef4444;
  color: #fff;
}

.btn-restore-bought {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-restore-bought:hover {
  background: rgba(56, 189, 248, 0.18);
  color: #fff;
  border-color: #38bdf8;
}

/* Interactive Recipe Ingredients Filter Box */
.recipe-ingredient-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
}

.recipe-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding: 2px;
}

.recipe-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
  transition: all 0.15s ease;
}

.recipe-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.recipe-chip.selected {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
  font-weight: 600;
}

.recipe-chip .chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
}

.recipe-chip.selected .chip-dot {
  background: #10b981;
}

.btn-web-search {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-web-search:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.btn-web-search.google:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.btn-web-search.eda:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}

/* Interactive Recipe Card Actions */
.recipe-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.btn-cook-recipe {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #10b981;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-cook-recipe:hover {
  background: rgba(16, 185, 129, 0.22);
  color: #fff;
  border-color: #10b981;
}

.btn-recipe-web-link {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-recipe-web-link:hover {
  border-color: #fbbf24;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
}

/* ================= AUTH GATE SCREEN ================= */
.auth-gate-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 30px 20px;
  background: radial-gradient(circle at 50% 10%, rgba(16, 185, 129, 0.12) 0%, rgba(15, 23, 42, 0) 70%), var(--bg-surface);
}

.auth-gate-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-gate-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.auth-gate-logo {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  margin-bottom: 4px;
}

.auth-gate-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.auth-gate-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.auth-tabs-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.auth-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-tab-btn.active {
  background: var(--bg-surface);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
