:root {
  --bg: #0b0a0e;
  --bg-elev: #161520;
  --bg-elev-2: #1f1d2b;
  --border: #2a2838;
  --border-bright: #3a3650;
  --text: #f5f3f7;
  --muted: #908ca3;
  --accent: #22d3ee;
  --accent-2: #14b8a6;
  --accent-fg: #02212b;
  --success: #4ade80;
  --danger: #f87171;
  --cal: #ffb547;
  --protein: #ff6b8a;
  --carbs: #62b6ff;
  --fat: #c084fc;
  --gradient-warm: linear-gradient(135deg, #22d3ee 0%, #14b8a6 100%);
  --gradient-cool: linear-gradient(135deg, #62b6ff 0%, #c084fc 100%);
  --gradient-bg:
    radial-gradient(ellipse 130% 80% at 50% -20%,
      rgba(139, 92, 246, 0.22) 0%,
      rgba(139, 92, 246, 0.10) 28%,
      rgba(139, 92, 246, 0.03) 55%,
      transparent 85%),
    radial-gradient(ellipse 110% 70% at 50% 115%,
      rgba(34, 211, 238, 0.10) 0%,
      rgba(34, 211, 238, 0.04) 35%,
      transparent 75%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 0 1px rgba(34, 211, 238, 0.3), 0 12px 32px rgba(34, 211, 238, 0.2);
}

* { box-sizing: border-box; }

/* Prevent the iOS text caret from appearing on non-editable UI chrome.
   Inputs, textareas, selects, and modal content stay selectable. */
#app {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, select, .modal-card {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
input, textarea {
  caret-color: var(--accent);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  background-image: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}
html { height: -webkit-fill-available; }

#app {
  max-width: 540px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 0 calc(72px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  background: rgba(11, 10, 14, 0.75);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  z-index: 10;
  border-bottom: 1px solid var(--border);
  padding: 14px 16px 10px;
}

.brand {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand span {
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.5));
  flex: 0 0 auto;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.18s;
  font-family: inherit;
}
.tab:hover { color: var(--text); border-color: var(--border-bright); }
.tab.active {
  background: var(--gradient-warm);
  color: var(--accent-fg);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.3);
}

main { padding: 16px; }

.view { display: none; animation: fade 0.22s ease-out; }
.view.active { display: block; }

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

h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 8px 0 6px;
  line-height: 1.1;
}
h1 .accent {
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 4px 0 4px;
}
.muted { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.empty {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.hero { margin: 4px 0 16px; }

.dropzone {
  display: block;
  border: 2px dashed var(--border-bright);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-elev) 0%, var(--bg-elev-2) 100%);
  padding: 40px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  position: relative;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}
.dropzone::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(34, 211, 238, 0.08), transparent 70%);
  opacity: 0;
  transition: opacity 0.2s;
}
.dropzone:hover { border-color: var(--accent); transform: translateY(-1px); }
.dropzone:hover::before { opacity: 1; }
.dropzone:active { transform: scale(0.99); }
.dz-icon {
  font-size: 44px;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 12px rgba(34, 211, 238, 0.4));
}
.dz-title { font-weight: 700; font-size: 17px; }
.dz-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.preview { margin-top: 16px; }
.preview img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.row { display: flex; gap: 10px; margin-top: 12px; }
.row.spread { justify-content: space-between; align-items: center; }
.row .btn { flex: 1; }
.row.spread .btn { flex: 0 0 auto; }

.btn {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s, background 0.15s, border-color 0.15s, box-shadow 0.2s;
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn:hover { border-color: var(--border-bright); }
.btn.primary {
  background: var(--gradient-warm);
  color: var(--accent-fg);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.25);
}
.btn.primary:hover {
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.4);
}
.btn.ghost { background: transparent; }
.btn.small { padding: 8px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* Subtle action button — cyan-tinted, not gradient. For routine confirmations
   in Settings where we don't want to compete with the upgrade CTA. */
.btn.subtle {
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.28);
  color: var(--accent);
  box-shadow: none;
}
.btn.subtle:hover {
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.5);
}

/* Upgrade CTA: "premium dark" — deep teal/navy gradient with cyan border
   glow. Less vibrant than .primary so the diamond icon reads clearly and
   the button feels like a premium upsell, not a system action. */
.btn.upgrade-cta {
  background: linear-gradient(135deg, #0a1d28 0%, #0e3a3f 100%);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.4);
  box-shadow:
    0 6px 20px rgba(34, 211, 238, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}
.btn.upgrade-cta:hover {
  background: linear-gradient(135deg, #0e2a3a 0%, #0e4a4f 100%);
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow:
    0 8px 24px rgba(34, 211, 238, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.upgrade-cta-icon {
  display: inline-block;
  margin-right: 6px;
  font-size: 1.05em;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.7));
}

.list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list-item {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s;
}
.list-item:hover { border-color: var(--border-bright); }
.list-item .name {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  min-width: 0;
}
.list-item .name::placeholder { color: var(--muted); font-style: italic; }
.list-item .qty {
  width: 56px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 9px;
  font-size: 14px;
  text-align: right;
  font-family: inherit;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: border-color 0.15s;
}
.list-item .qty::-webkit-outer-spin-button,
.list-item .qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.list-item .qty:focus { border-color: var(--accent); }

.list-item .unit {
  width: 78px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 28px 7px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23908ca3' d='M5 6L0 0h10z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  transition: border-color 0.15s;
}
.list-item .unit:focus { border-color: var(--accent); }
.list-item .unit option {
  background: var(--bg-elev-2);
  color: var(--text);
}
.list-item .remove {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.15s;
}
.list-item .remove:hover { color: var(--danger); }

.list-item.checked .name { text-decoration: line-through; color: var(--muted); }

.checkbox {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-bright);
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
  position: relative;
  transition: all 0.15s;
}
.checkbox.checked {
  background: var(--gradient-warm);
  border-color: transparent;
}
.checkbox.checked::after {
  content: "✓";
  color: var(--accent-fg);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
}

.form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.form label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  transition: border-color 0.15s;
  position: relative;
  padding-left: 44px;
}
.form label:hover { border-color: var(--border-bright); }
.form label::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.form label:nth-child(1)::before { background: var(--cal); box-shadow: 0 0 8px var(--cal); }
.form label:nth-child(2)::before { background: var(--protein); box-shadow: 0 0 8px var(--protein); }
.form label:nth-child(3)::before { background: var(--carbs); box-shadow: 0 0 8px var(--carbs); }
.form label:nth-child(4)::before { background: var(--fat); box-shadow: 0 0 8px var(--fat); }
.form input {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 17px;
  text-align: right;
  width: 100px;
  outline: none;
  font-family: inherit;
  font-weight: 600;
}
.form input::placeholder {
  color: var(--muted);
  opacity: 0.35;
  font-weight: 500;
}

.recipes { display: flex; flex-direction: column; gap: 12px; }
.recipe-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  padding-right: 60px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
}
.recipe-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-warm);
  opacity: 0;
  transition: opacity 0.2s;
}
.recipe-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}
.recipe-card:hover::before { opacity: 1; }
.recipe-card:active { transform: translateY(0); }
.recipe-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.macro-pill {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.macro-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.macro-pill.cal { color: var(--cal); border-color: rgba(255, 181, 71, 0.3); }
.macro-pill.cal::before { background: var(--cal); box-shadow: 0 0 6px var(--cal); }
.macro-pill.protein { color: var(--protein); border-color: rgba(255, 107, 138, 0.3); }
.macro-pill.protein::before { background: var(--protein); box-shadow: 0 0 6px var(--protein); }
.macro-pill.carbs { color: var(--carbs); border-color: rgba(98, 182, 255, 0.3); }
.macro-pill.carbs::before { background: var(--carbs); box-shadow: 0 0 6px var(--carbs); }
.macro-pill.fat { color: var(--fat); border-color: rgba(192, 132, 252, 0.3); }
.macro-pill.fat::before { background: var(--fat); box-shadow: 0 0 6px var(--fat); }
.macro-pill strong { color: inherit; }
.recipe-missing {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.recipe-missing.has-missing strong { color: var(--accent); }
.recipe-missing.complete { color: var(--success); }
.recipe-missing.complete::before { content: "✓ "; font-weight: 800; }

/* ---------- Heart button (cookbook) ---------- */
.heart-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 2;
  transition: transform 0.12s, border-color 0.15s, background 0.15s, color 0.15s;
}
.heart-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}
.heart-btn:hover {
  border-color: var(--border-bright);
  color: var(--text);
}
.heart-btn:active { transform: scale(0.92); }
.heart-btn.saved {
  color: var(--protein);
  background: rgba(255, 107, 138, 0.12);
  border-color: rgba(255, 107, 138, 0.4);
}
.heart-btn.saved:hover {
  background: rgba(255, 107, 138, 0.18);
  border-color: rgba(255, 107, 138, 0.6);
}

/* Modal header layout: title left, heart right */
.recipe-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-right: 40px; /* leave room for the close ✕ */
  margin-bottom: 4px;
}
.recipe-modal-header h2 {
  flex: 1;
  margin: 0;
  padding-right: 0;
}
.recipe-modal-header .heart-btn {
  position: static;
  flex: 0 0 auto;
  margin-top: 2px;
}

.status {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}
.status.error { color: var(--danger); border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: end center;
  animation: fade 0.22s;
}
.modal-card {
  background: var(--bg-elev);
  background-image: radial-gradient(circle at 100% 0%, rgba(34, 211, 238, 0.08), transparent 50%);
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 22px 22px 32px;
  overflow-y: auto;
  position: relative;
  border: 1px solid var(--border);
  border-bottom: none;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}
.modal-card h2 { margin-top: 0; padding-right: 40px; }
.modal-card h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 22px 0 10px;
}
.modal-card ol, .modal-card ul {
  padding-left: 20px;
  margin: 0;
}
.modal-card ol li, .modal-card ul li {
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.55;
}
.modal-card ol li::marker {
  color: var(--accent);
  font-weight: 700;
}
.modal-card .add-missing {
  margin-top: 18px;
  width: 100%;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-warm);
  color: var(--accent-fg);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  z-index: 200;
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.35);
  animation: toast-in 0.22s;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Recipes header actions ---------- */
.recipes-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#cuisineBtn {
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Cuisine modal options ---------- */
.cuisine-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.cuisine-option {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.cuisine-option:hover {
  border-color: var(--border-bright);
  background: var(--bg-elev);
}
.cuisine-option.active {
  background: var(--gradient-warm);
  color: var(--accent-fg);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.3);
}

/* ---------- Uncertain inventory items ---------- */
.list-item.uncertain {
  border-color: rgba(255, 181, 71, 0.4);
  background: linear-gradient(90deg, var(--bg-elev), rgba(255, 181, 71, 0.05));
}
.uncertain-badge {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 181, 71, 0.15);
  border: 1px solid rgba(255, 181, 71, 0.5);
  color: var(--cal);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.uncertain-badge:hover,
.uncertain-badge:active {
  background: rgba(255, 181, 71, 0.3);
  transform: scale(1.08);
}

.hidden { display: none !important; }

/* ---------- Topbar row (avatar L · brand C · spacer R) ---------- */
.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  gap: 8px;
}
.topbar-row .brand { margin-bottom: 0; flex: 1; justify-content: center; }
.topbar-spacer { width: 32px; flex: 0 0 32px; }

/* Profile button */
.profile-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-warm);
  color: var(--accent-fg);
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  font-family: inherit;
  display: grid;
  place-items: center;
  transition: transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(34, 211, 238, 0.3);
}
.profile-btn:hover { box-shadow: 0 4px 12px rgba(34, 211, 238, 0.5); }
.profile-btn:active { transform: scale(0.95); }

/* Profile dropdown — Claude-style */
.profile-menu {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 56px);
  left: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: calc(100vw - 24px);
  max-width: 320px;
  z-index: 50;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: fade 0.15s;
}
.profile-menu-header {
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.profile-menu-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-warm);
  color: var(--accent-fg);
  font-weight: 800;
  font-size: 16px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.profile-menu-info { min-width: 0; flex: 1; }
.profile-menu-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-menu-plan-row { margin-top: 2px; }
.profile-menu-plan {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.profile-menu-plan.free { color: var(--muted); }
.profile-menu-plan.pro {
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.profile-menu-usage {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev-2);
}
.usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}
.usage-label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.usage-icon { font-size: 14px; }
.usage-count { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.usage-resets {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.profile-menu-section { padding: 6px; }
.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}
.profile-menu-item:hover { background: var(--bg-elev-2); }
.profile-menu-item-icon {
  width: 22px;
  display: inline-flex;
  justify-content: center;
  font-size: 15px;
}
.profile-menu-item-arrow {
  margin-left: auto;
  color: var(--muted);
  font-weight: 700;
}
.profile-menu-item.upgrade-item {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(192, 132, 252, 0.12));
  border: 1px solid rgba(34, 211, 238, 0.3);
  margin-bottom: 4px;
  color: var(--text);
}
.profile-menu-item.upgrade-item:hover {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(192, 132, 252, 0.2));
}

/* ---------- Bottom navigation ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(11, 10, 14, 0.85);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  max-width: 540px;
  margin: 0 auto;
}
.bnav {
  background: transparent;
  border: 0;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 0.15s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
}
.bnav svg { width: 22px; height: 22px; }
.bnav:active { transform: scale(0.94); }
.bnav.active {
  color: var(--accent);
}
.bnav.active svg {
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.5));
}

/* ---------- Billing toggle inside paywall ---------- */
.billing-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin: 14px 0 10px;
}
.billing-toggle-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.billing-toggle-btn.active {
  background: var(--gradient-warm);
  color: var(--accent-fg);
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.3);
}
.save-pill {
  background: var(--success);
  color: #03261a;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.billing-toggle-btn.active .save-pill {
  background: rgba(2, 33, 43, 0.25);
  color: var(--accent-fg);
}

/* Pricing layout */
.tier-price {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.tier-price .price-amount { color: var(--text); }
.tier-price .price-period { font-size: 14px; font-weight: 600; color: var(--muted); }
.tier-billed {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 600;
}
.tier-current {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  padding: 6px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Settings page (distinct backdrop) ---------- */
.view#view-goals.active {
  /* Edge-to-edge solid panel — fully covers the cosmic gradient so it
     reads as a separate, calmer "settings" surface. */
  margin: -16px -16px 0;
  padding: 14px 16px calc(72px + env(safe-area-inset-bottom));
  background: #0f0e16;
  border-top: 1px solid var(--border);
  min-height: calc(100dvh - 110px);
  box-shadow: inset 0 12px 28px rgba(0, 0, 0, 0.45);
}
.view#view-goals.active h2 {
  font-size: 22px;
  margin: 4px 0 8px;
}

.settings-back {
  background: transparent;
  border: 0;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 4px;
  transition: color 0.15s, transform 0.08s;
  -webkit-tap-highlight-color: transparent;
}
.settings-back:hover { color: var(--accent); }
.settings-back:active { transform: translateX(-2px); }
.settings-back svg { width: 18px; height: 18px; }

/* ---------- Settings page sections ---------- */
.section-h {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 24px 0 8px;
}
.section-h:first-of-type { margin-top: 12px; }
.settings-block {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: 0; }
.settings-label { color: var(--muted); font-weight: 500; }
.settings-value { color: var(--text); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }

.plan-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.15);
  color: var(--success);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.settings-actions .btn { width: 100%; }
.btn.danger {
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.3);
}
.btn.danger:hover {
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.08);
}

/* ---------- Auth overlay ---------- */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  background-image: var(--gradient-bg);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.auth-overlay.hidden { display: none !important; }
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 16px 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.clerk-mount {
  width: 100%;
  overflow: hidden;
}

/* Force Clerk form to fit our card width and flatten any nested card */
.clerk-mount,
.clerk-mount * {
  box-sizing: border-box !important;
}
/* Nuke ALL nested Clerk containers' borders, backgrounds, padding */
.clerk-mount > div,
.clerk-mount > div > div,
.clerk-mount [class*="cl-rootBox"],
.clerk-mount [class*="cl-card"],
.clerk-mount [class*="cl-cardBox"],
.clerk-mount [class*="cl-main"],
.clerk-mount [class*="cl-internal"] {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0 !important;
}
/* Hide Clerk's dev-mode footer banner */
.clerk-mount [class*="cl-internal-development"],
.clerk-mount [data-clerk-development],
.cl-internalDevelopmentMode,
[class*="developmentMode"] {
  display: none !important;
}
.clerk-mount .cl-form,
.clerk-mount .cl-formFieldRow,
.clerk-mount .cl-formField,
.clerk-mount .cl-formFieldInput,
.clerk-mount [class*="cl-form"] {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Hide Clerk's own header (we have our own) */
.clerk-mount .cl-header,
.clerk-mount [class*="cl-header"] {
  display: none !important;
}

/* Make social buttons readable: white bg + dark icon, except Facebook (blue) */
.clerk-mount .cl-socialButtonsIconButton,
.clerk-mount .cl-socialButtonsBlockButton,
.clerk-mount [class*="socialButtonsIconButton"],
.clerk-mount [class*="socialButtonsBlockButton"] {
  background-color: #ffffff !important;
  border-color: #ffffff !important;
  color: #0b0a0e !important;
}
.clerk-mount [class*="socialButtonsIconButton"]:hover,
.clerk-mount [class*="socialButtonsBlockButton"]:hover {
  background-color: #f0f0f0 !important;
}
.clerk-mount [class*="socialButtonsIconButton__facebook"],
.clerk-mount [class*="socialButtonsBlockButton__facebook"] {
  background-color: #1877f2 !important;
  border-color: #1877f2 !important;
  color: #ffffff !important;
}
.clerk-mount [class*="socialButtonsIconButton__facebook"]:hover,
.clerk-mount [class*="socialButtonsBlockButton__facebook"]:hover {
  background-color: #0f6ae0 !important;
}
/* Apple icon: ensure it's black on white (Clerk sometimes inverts it) */
.clerk-mount [class*="providerIcon__apple"],
.clerk-mount [class*="providerIcon__apple"] svg,
.clerk-mount [class*="providerIcon__apple"] svg path {
  fill: #0b0a0e !important;
  color: #0b0a0e !important;
  filter: none !important;
}
/* Make sure the divider "or" is readable */
.clerk-mount [class*="dividerLine"] {
  background-color: var(--border) !important;
}
.clerk-mount [class*="dividerText"] {
  color: var(--muted) !important;
}

/* Cleaner footer — flat, no dark stripe, same padding as form */
.clerk-mount .cl-footer,
.clerk-mount [class*="cl-footer"],
.clerk-mount [class*="cl-footerAction"],
.clerk-mount [class*="cl-footerPages"],
.clerk-mount [class*="cl-internalFooter"] {
  background: transparent !important;
  background-image: none !important;
  background-color: transparent !important;
  padding: 12px 0 0 !important;
  border: none !important;
  box-shadow: none !important;
}
.clerk-mount [class*="cl-footerAction"] a {
  color: var(--accent) !important;
}

/* Kill the orange "Development mode" banner */
.clerk-mount [class*="cl-internalDevelopment"],
.clerk-mount [class*="DevelopmentMode"],
.clerk-mount [class*="developmentMode"],
.clerk-mount [data-localization-key*="development"],
.cl-internalDevelopment {
  display: none !important;
}
/* Fallback: hide any element whose text is "Development mode" via attribute */
.clerk-mount [class*="cl-badge"]:has(> *:only-child),
.clerk-mount [class*="cl-internal"]:last-child {
  background: transparent !important;
  background-image: none !important;
}

/* Kill the diagonal-stripe pattern Clerk uses on dev footer */
.clerk-mount [style*="repeating-linear-gradient"],
.clerk-mount [style*="stripe"] {
  background: transparent !important;
  background-image: none !important;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 18px;
}
.auth-brand svg { width: 22px; height: 22px; color: var(--accent); flex: 0 0 auto; }
.auth-brand span {
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}
.auth-sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; line-height: 1.5; }
.auth-sub strong { color: var(--text); }
.clerk-mount { min-height: 280px; }
.auth-loading {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  margin: 18px 0 0;
}

/* ---------- Dashboard (home) ---------- */
.dash-greeting { margin: 4px 0 18px; }
.dash-time {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 4px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.dash-heading {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.15;
}
.dash-heading .accent {
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dash-scan-card {
  width: 100%;
  background: linear-gradient(135deg, var(--bg-elev) 0%, rgba(34, 211, 238, 0.06) 100%);
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  transition: transform 0.1s, border-color 0.18s, box-shadow 0.18s;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.12);
  margin-bottom: 24px;
}
.dash-scan-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
.dash-scan-card:active { transform: scale(0.99); }
.dash-scan-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(34, 211, 238, 0.4));
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  background: rgba(34, 211, 238, 0.1);
  border-radius: 14px;
  display: grid;
  place-items: center;
}
.dash-scan-body { flex: 1; min-width: 0; }
.dash-scan-title { font-size: 16px; font-weight: 700; }
.dash-scan-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.dash-scan-arrow {
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  flex: 0 0 auto;
}

.dash-section { margin-bottom: 24px; }
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.dash-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.dash-recipe-mini {
  background: linear-gradient(135deg, var(--bg-elev) 0%, var(--bg-elev-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.18s;
  position: relative;
  overflow: hidden;
}
.dash-recipe-mini::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-warm);
  opacity: 0.65;
}
.dash-recipe-mini:last-child { margin-bottom: 0; }
.dash-recipe-mini:hover {
  border-color: var(--border-bright);
  transform: translateX(2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.dash-recipe-mini:hover::before { opacity: 1; }
.dash-recipe-mini-info { flex: 1; min-width: 0; }
.dash-recipe-mini-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}
.dash-recipe-mini-pills {
  display: flex;
  gap: 5px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.dash-recipe-mini-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.02em;
}
.dash-recipe-mini-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.dash-recipe-mini-pill.cal { color: var(--cal); border-color: rgba(255, 181, 71, 0.35); }
.dash-recipe-mini-pill.protein { color: var(--protein); border-color: rgba(255, 107, 138, 0.35); }
.dash-recipe-mini-pill.carbs { color: var(--carbs); border-color: rgba(98, 182, 255, 0.35); }
.dash-recipe-mini-pill.fat { color: var(--fat); border-color: rgba(192, 132, 252, 0.35); }
.dash-recipe-mini-arrow {
  color: var(--muted);
  font-size: 22px;
  flex: 0 0 auto;
  line-height: 1;
}

.dash-macros {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.dash-macro-pill {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 6px;
  text-align: center;
}
.dash-macro-val {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.dash-macro-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dash-macro-pill.cal { border-color: rgba(255, 181, 71, 0.3); }
.dash-macro-pill.cal .dash-macro-val { color: var(--cal); }
.dash-macro-pill.protein { border-color: rgba(255, 107, 138, 0.3); }
.dash-macro-pill.protein .dash-macro-val { color: var(--protein); }
.dash-macro-pill.carbs { border-color: rgba(98, 182, 255, 0.3); }
.dash-macro-pill.carbs .dash-macro-val { color: var(--carbs); }
.dash-macro-pill.fat { border-color: rgba(192, 132, 252, 0.3); }
.dash-macro-pill.fat .dash-macro-val { color: var(--fat); }

.dash-empty-hint {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 18px;
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  margin: 0;
}

/* ---------- Paywall modal ---------- */
.paywall-tiers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.paywall-tier {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}
.paywall-tier.featured { order: -1; }
.paywall-tier.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  position: relative;
}
.paywall-tier .tier-name {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
}
.paywall-tier.featured .tier-name {
  background: var(--gradient-warm);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.paywall-tier .tier-price {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.paywall-tier .tier-price .price-amount { color: var(--text); font-size: 28px; }
.paywall-tier .tier-price .price-period { font-size: 14px; font-weight: 600; color: var(--muted); }
.paywall-tier ul {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text);
  flex: 1;
}
.paywall-tier ul li {
  padding: 6px 0;
  padding-left: 18px;
  position: relative;
}
.paywall-tier ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
}
.tier-yearly {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 8px 0 0;
}

/* ---------- Merge / confirm scan modal ---------- */
.merge-card {
  max-width: 560px;
}
.merge-section {
  margin-top: 18px;
}
.merge-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.merge-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.merge-toggle-all {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  font-weight: 600;
}
.merge-toggle-all:hover {
  text-decoration: underline;
}
.merge-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.merge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: opacity 0.15s, border-color 0.15s;
  opacity: 0.55;
}
.merge-row.checked {
  opacity: 1;
  border-color: rgba(34, 211, 238, 0.4);
}
.merge-row.uncertain.checked {
  border-color: rgba(245, 158, 11, 0.5);
}
.merge-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  padding: 0;
}
.merge-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
}
.merge-checkbox.checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b0a0e;
  font-size: 14px;
  font-weight: 800;
}
.merge-name {
  flex: 1;
  font-size: 15px;
  color: var(--text);
  text-transform: capitalize;
}
.merge-qty {
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
}
.merge-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
}
.merge-remove:hover {
  color: var(--danger);
}

/* ---------- Grocery add row ---------- */
.grocery-add-row {
  display: flex;
  gap: 8px;
  margin: 4px 0 14px;
}
.grocery-add-row input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.grocery-add-row input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---------- Inventory pro tip ---------- */
.pro-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(34, 211, 238, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 12px;
  margin: 4px 0 14px;
}
.pro-tip-icon {
  font-size: 18px;
  line-height: 1.3;
  flex-shrink: 0;
}
.pro-tip-body {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  opacity: 0.9;
}
.pro-tip-body strong {
  color: var(--accent);
  font-weight: 700;
}
.merge-empty {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  margin: 4px 0 0;
}
.merge-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.merge-add-row input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.merge-add-row input:focus {
  outline: none;
  border-color: var(--accent);
}
.merge-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
}
.merge-actions .btn {
  min-width: 160px;
}
