*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Basis — Jarvis-Navy */
  --bg: #0a0e17;
  --bg2: #0e1320;
  /* Glas-Oberflächen (Jarvis-Designsprache) */
  --card: rgba(20, 27, 43, 0.72);
  --card-solid: #141b2b;
  --card2: rgba(28, 36, 56, 0.6);
  --border: rgba(255,255,255,0.08);
  --border-glow: rgba(251,146,60,0.22);
  /* Warmer Koch-Akzent (orange/amber) auf Jarvis-Basis */
  --accent: #fb923c;
  --accent2: #f59e0b;
  --accent-grad: linear-gradient(135deg, #fb923c, #f59e0b);
  --accent-dim: rgba(251,146,60,0.15);
  --glow: 0 0 18px rgba(251,146,60,0.35);
  --glow-strong: 0 0 22px rgba(251,146,60,0.55), 0 0 40px rgba(245,158,11,0.2);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --header-h: 54px;
  --nav-h: 66px;
  --radius: 18px;
  /* Kategorie-Farben (Koch-Identität bleibt erhalten) */
  --cat-breakfast: #f59e0b;
  --cat-lunch: #a78bfa;
  --cat-dinner: #38bdf8;
  --cat-snack: #34d399;
}

html { font-size: 16px; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 55% at 15% -5%, rgba(251,146,60,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 90% 100%, rgba(245,158,11,0.07) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Layout ===== */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.tab-content {
  flex: 1;
  padding: 16px 16px calc(var(--nav-h) + 16px);
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

/* ===== Bottom Navigation (Jarvis-Stil: Glas + Icon-Pills) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 14, 23, 0.75);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  padding-top: 6px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 2px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nav-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 28px;
  border-radius: 14px;
  transition: background 0.2s, box-shadow 0.2s;
}

.nav-icon { width: 21px; height: 21px; stroke: currentColor; }

.nav-label {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-btn.active { color: var(--accent); }
.nav-btn.active .nav-icon-wrap {
  background: var(--accent-dim);
  box-shadow: 0 0 12px rgba(251,146,60,0.3);
}

/* ===== Tab Panes ===== */
.tab-pane { display: none; animation: fadeIn 0.2s ease; }
.tab-pane.active { display: block; }

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

/* ===== Page Headers ===== */
.page-header {
  margin-bottom: 20px;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.page-subtitle { font-size: 0.85rem; color: var(--text-muted); }

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 12px;
}

.card-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

/* ===== Profile Tab ===== */
.profile-header {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 12px;
  text-align: center;
}

.calorie-display {
  display: inline-block;
  background: linear-gradient(135deg, rgba(251,146,60,0.15), rgba(245,158,11,0.15));
  border: 1px solid rgba(251,146,60,0.3);
  border-radius: 16px;
  padding: 12px 24px;
  margin: 10px 0;
}
.calorie-number {
  font-size: 2.4rem;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.calorie-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.weight-banner {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #f59e0b;
  display: none;
}

/* ===== Form Styles ===== */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input, .form-select {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus { border-color: var(--accent); }
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%2364748b'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-btn {
  flex: 1;
  min-width: 80px;
  padding: 10px 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.radio-btn.selected {
  background: rgba(251,146,60,0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.tag-input-wrap { display: flex; gap: 8px; }
.tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 30px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(251,146,60,0.15);
  border: 1px solid rgba(251,146,60,0.3);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.8rem;
  color: var(--accent);
}
.tag-remove { cursor: pointer; opacity: 0.7; font-size: 0.9rem; line-height: 1; }
.tag-remove:hover { opacity: 1; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: 14px;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent-grad);
  color: white;
  width: 100%;
}
.btn-primary:hover { opacity: 0.9; }
.btn-ghost {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-success { background: rgba(16,185,129,0.2); border: 1px solid var(--success); color: var(--success); }
.btn-danger { background: rgba(239,68,68,0.15); border: 1px solid var(--danger); color: var(--danger); }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; border-radius: 10px; }

/* ===== Chat Tab ===== */
.chat-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 200px;
}

.chat-bubble {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
}
.chat-bubble.user {
  background: var(--accent-grad);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble.assistant {
  background: var(--card2);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.recipe-card-inline {
  background: var(--bg2);
  border: 1px solid rgba(251,146,60,0.2);
  border-radius: 14px;
  padding: 12px;
  margin-top: 10px;
}
.recipe-card-inline .rc-title { font-weight: 700; margin-bottom: 4px; font-size: 1rem; }
.recipe-card-inline .rc-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.rc-meta span { display: flex; align-items: center; gap: 3px; }
.recipe-actions { display: flex; gap: 8px; }

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  position: sticky;
  bottom: calc(var(--nav-h) + 10px);
  background: var(--bg);
  padding: 8px 0;
}
.chat-input {
  flex: 1;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 140px;
  transition: border-color 0.15s;
  line-height: 1.5;
}
.chat-input:focus { border-color: var(--accent); }
.send-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-grad);
  border: none;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.send-btn:active { opacity: 0.8; }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-filter-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chat-filter-pills::-webkit-scrollbar { display: none; }
.pill {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.pill.active { background: rgba(251,146,60,0.15); border-color: var(--accent); color: var(--accent); }

.typing-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

.clear-chat-btn {
  font-size: 0.75rem;
  color: var(--text-dim);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 8px;
  text-decoration: underline;
}

/* ===== Cook Mode (Queue) ===== */
.cook-queue-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.cook-queue-empty .empty-icon { font-size: 3rem; margin-bottom: 12px; }

.recipe-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
}
.recipe-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 20px 0 0 20px;
}
.recipe-card.cat-breakfast::before { background: var(--cat-breakfast); }
.recipe-card.cat-lunch::before { background: var(--cat-lunch); }
.recipe-card.cat-dinner::before { background: var(--cat-dinner); }
.recipe-card.cat-snack::before { background: var(--cat-snack); }

.recipe-card-body { flex: 1; min-width: 0; }
.recipe-card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.recipe-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.recipe-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cat-badge.breakfast { background: rgba(245,158,11,0.15); color: var(--cat-breakfast); }
.cat-badge.lunch { background: rgba(167,139,250,0.15); color: var(--cat-lunch); }
.cat-badge.dinner { background: rgba(59,130,246,0.15); color: var(--cat-dinner); }
.cat-badge.snack { background: rgba(16,185,129,0.15); color: var(--cat-snack); }

/* ===== Cook Mode (Step-by-Step) ===== */
.cook-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  flex-direction: column;
  padding: 20px;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}
.cook-overlay.open { display: flex; }

.cook-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.cook-recipe-title { font-size: 1.1rem; font-weight: 700; flex: 1; padding-right: 10px; }
.cook-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.cook-progress {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  justify-content: center;
}
.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.2s;
  flex-shrink: 0;
}
.progress-dot.done { background: var(--success); }
.progress-dot.current { background: var(--accent); width: 24px; border-radius: 4px; }

.cook-ingredients {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 20px;
}
.cook-ingredients summary {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cook-ingredients summary::-webkit-details-marker { display: none; }
.cook-ingredients ul { margin-top: 10px; padding-left: 0; list-style: none; }
.cook-ingredients li { font-size: 0.9rem; padding: 4px 0; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.cook-ingredients li:last-child { border-bottom: none; }

.cook-step-area { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.cook-step-num { font-size: 0.78rem; color: var(--text-dim); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px; }
.cook-step-text {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.5;
  flex: 1;
  touch-action: pan-y;
}

.cook-nav { display: flex; gap: 10px; margin-top: 20px; }
.cook-nav .btn { flex: 1; }
.cook-finish-row { margin-top: 12px; }

/* ===== Rating Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}
.modal-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.modal-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }
.star-rating { display: flex; justify-content: center; gap: 10px; margin-bottom: 24px; }
.star { font-size: 2rem; cursor: pointer; opacity: 0.3; transition: opacity 0.1s, transform 0.1s; }
.star.lit { opacity: 1; transform: scale(1.1); }

/* ===== Shopping List Tab ===== */
.shopping-add-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: flex-end; }
.shopping-amount-input { flex: 0 0 130px; }

.shopping-category {
  margin-bottom: 16px;
}
.shopping-cat-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 8px;
  padding: 0 4px;
}
.shopping-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 6px;
  transition: opacity 0.2s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.shopping-item.checked { opacity: 0.4; }
.shopping-item.checked .item-name { text-decoration: line-through; color: var(--text-dim); }

.check-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.shopping-item.checked .check-circle {
  background: var(--success);
  border-color: var(--success);
}
.check-icon { font-size: 0.75rem; color: white; display: none; }
.shopping-item.checked .check-icon { display: block; }

.item-name { flex: 1; font-size: 0.95rem; }
.item-amount { font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; }
.item-delete {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.shopping-item:hover .item-delete { opacity: 1; }

.shopping-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.shopping-count { font-size: 0.8rem; color: var(--text-dim); }

/* ===== Meal Toggles ===== */
.calorie-per-meal { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; min-height: 1.2em; }
.meal-toggle-group { display: flex; gap: 8px; flex-wrap: wrap; }
.meal-toggle {
  flex: 1; min-width: 80px; padding: 10px 8px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text-muted); font-size: 0.82rem; font-weight: 600; text-align: center;
  cursor: pointer; transition: all 0.15s; -webkit-tap-highlight-color: transparent; user-select: none;
}
.meal-toggle.active { background: rgba(251,146,60,0.15); border-color: var(--accent); color: var(--accent); }

/* ===== Quick-Add Grid ===== */
.quick-add-scroll {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 0 12px;
}
.quick-add-scroll::-webkit-scrollbar { display: none; }
.quick-add-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex-shrink: 0; width: 66px; padding: 10px 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  cursor: pointer; transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.quick-add-tile:active { background: rgba(251,146,60,0.15); border-color: var(--accent); transform: scale(0.96); }
.quick-tile-emoji { font-size: 1.5rem; line-height: 1; }
.quick-tile-name {
  font-size: 0.6rem; font-weight: 600; color: var(--text-muted);
  text-align: center; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 58px;
}

/* ===== Shopping Item Emoji ===== */
.item-emoji { font-size: 1.25rem; line-height: 1; flex-shrink: 0; width: 28px; text-align: center; }

/* ===== Archiv Tab ===== */
.archiv-search-row { margin-bottom: 12px; }

.archiv-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.archiv-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 20px 0 0 20px;
}
.archiv-card.cat-breakfast::before { background: var(--cat-breakfast); }
.archiv-card.cat-lunch::before { background: var(--cat-lunch); }
.archiv-card.cat-dinner::before { background: var(--cat-dinner); }
.archiv-card.cat-snack::before { background: var(--cat-snack); }

.archiv-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.archiv-date { font-size: 0.75rem; color: var(--text-dim); }
.archiv-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.archiv-stars { font-size: 0.95rem; margin-bottom: 6px; line-height: 1; }
.archiv-meta {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.archiv-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.archiv-tag {
  background: rgba(251,146,60,0.1);
  border: 1px solid rgba(251,146,60,0.2);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 0.72rem;
  color: var(--accent);
}
.archiv-recook-btn { width: 100%; }

/* ===== Onboarding ===== */
.onboarding-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 150;
  overflow-y: auto;
  padding: 24px 20px 40px;
}
.onboarding-screen.open { display: block; }
.onboarding-logo {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 8px;
}
.onboarding-title {
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.onboarding-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* ===== Mic Button ===== */
.mic-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  margin-bottom: 3px;
}
.mic-btn.recording {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 0 14px rgba(220,38,38,0.6);
  animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(220,38,38,0.6); }
  50% { box-shadow: 0 0 22px rgba(220,38,38,0.9), 0 0 36px rgba(220,38,38,0.3); }
}

/* ===== Voice Overlay ===== */
.voice-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,15,0.92);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: max(40px, env(safe-area-inset-bottom, 40px));
  opacity: 0;
  transition: opacity 0.2s;
  backdrop-filter: blur(8px);
}
.voice-overlay.visible { opacity: 1; }

.voice-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.voice-pulse {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: voicePulse 1.2s ease-in-out infinite;
}
@keyframes voicePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251,146,60,0.5); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 18px rgba(251,146,60,0); }
}
.voice-overlay.locked .voice-pulse { animation: none; }

.voice-duration {
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.voice-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
  max-width: 260px;
}

.voice-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.voice-cancel-btn {
  padding: 12px 24px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.voice-send-btn {
  padding: 12px 28px;
  background: var(--accent-grad);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
}

/* ===== Manual Recipe FAB ===== */
.manual-fab {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px auto 0;
  padding: 14px 24px;
  background: var(--card2);
  border: 1px dashed var(--accent);
  border-radius: 16px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.manual-fab:active { transform: scale(0.97); background: var(--card); }

/* ===== Manual Recipe Modal ===== */
.manual-modal {
  max-height: 88vh;
  overflow-y: auto;
  text-align: left;
  max-width: 520px;
  width: 100%;
}
.manual-ing-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}
.manual-ing-row .form-input { flex: 1; }
.manual-ing-amount { flex: 0 0 70px !important; min-width: 0; }
.manual-ing-unit { flex: 0 0 52px !important; min-width: 0; }
.manual-step-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  align-items: flex-start;
}
.manual-step-num {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  padding-top: 14px;
  flex-shrink: 0;
  width: 18px;
}
.manual-step-input { flex: 1; min-height: 56px; resize: none; }

/* ===== Cook Chat FAB & Bottom Sheet ===== */
.cook-chat-fab {
  position: fixed;
  bottom: 120px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-grad);
  border: none;
  color: white;
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(251,146,60,0.45);
  transition: transform 0.15s, opacity 0.15s;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}
.cook-chat-fab:active { transform: scale(0.92); }

.cook-chat-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56%;
  background: var(--card);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
  z-index: 300;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
}
.cook-chat-sheet.open { transform: translateY(0); }

.cook-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cook-chat-title {
  font-size: 0.88rem;
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cook-chat-header button {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.cook-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cook-chat-bubble {
  max-width: 90%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.cook-chat-bubble.user {
  background: var(--accent-grad);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.cook-chat-bubble.assistant {
  background: var(--card2);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.cook-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.cook-chat-input-row .chat-input { font-size: 0.9rem; }

/* ===== Misc ===== */
.separator { height: 1px; background: var(--border); margin: 16px 0; }
.empty-state { text-align: center; color: var(--text-dim); padding: 30px; font-size: 0.9rem; }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(251,146,60,0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.offline-badge {
  display: none;
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(245,158,11,0.9);
  color: #000;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 500;
}
.offline-badge.visible { display: block; }

/* ===== Portions-Stepper (Einkauf, Kochmodus) ===== */
.portion-stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 6px;
}
.portion-stepper button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: var(--card2);
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.portion-stepper button:active { transform: scale(0.92); }
.portion-stepper span { font-size: 0.85rem; color: var(--text); min-width: 24px; text-align: center; }

/* ===== Einkauf: Rezept-Zuordnung + Rezept-Sektion ===== */
.shopping-item .item-main { flex: 1; min-width: 0; }
.item-recipe {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 1px;
}
.shopping-recipes {
  margin-top: 24px;
}
.shopping-recipes:empty { display: none; }
.shopping-recipes-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.shopping-recipe-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.shopping-recipe-name { font-size: 0.9rem; font-weight: 600; flex: 1; min-width: 0; }

/* ===== Kochmodus: Portionen-Zeile ===== */
.cook-servings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.cook-edit-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  flex-shrink: 0;
  margin-right: 8px;
}

/* ===== Manuell-Modal: Tab-Umschalter (Manuell / KI-Import) ===== */
.manual-tab-switch {
  display: flex;
  gap: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-top: 14px;
}
.manual-tab {
  flex: 1;
  padding: 9px 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.manual-tab.active {
  background: var(--accent-grad);
  color: #fff;
}

/* Archiv: Aktions-Buttons nebeneinander */
.archiv-actions { display: flex; gap: 8px; margin-top: 10px; }
.archiv-actions .btn { flex: 1; }
.archiv-actions .archiv-recook-btn { margin-top: 0; }

/* ============================================================
   Jarvis-Design-Ebene — Header, Profil-Umschalter, Glas & Glow
   (auf Jarvis-Basis, Koch-Identität via warmem Akzent behalten)
   ============================================================ */

/* ── Globaler Header ── */
#app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: rgba(10, 14, 23, 0.7);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}

#header-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-grad);
  box-shadow: 0 0 10px rgba(251,146,60,0.9), 0 0 20px rgba(251,146,60,0.4);
  animation: brandPulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes brandPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px rgba(251,146,60,0.9), 0 0 20px rgba(251,146,60,0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 4px rgba(251,146,60,0.6); }
}

#profileChip {
  display: flex; align-items: center; gap: 7px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 5px 12px 5px 8px;
  color: var(--text);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer; flex-shrink: 0;
  max-width: 55vw;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
#profileChip:hover { border-color: var(--border-glow); }
#profileChip:active { transform: scale(0.96); box-shadow: var(--glow); }
#profileChipEmoji { font-size: 1.1rem; line-height: 1; flex-shrink: 0; }
#profileChipName { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#profileChip svg { opacity: 0.6; flex-shrink: 0; }

/* ── Profil-Umschalter (Bottom Sheet) ── */
#profileSheetBackdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  z-index: 400;
}
#profileSheetBackdrop.open { display: block; }

#profileSheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 401;
  background: var(--card-solid);
  border-top: 1px solid var(--border);
  border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  max-width: 520px; margin: 0 auto;
}
#profileSheet.open { transform: translateY(0); }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 4px auto 12px; }
.sheet-title { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }

.profile-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 14px;
  background: var(--card2); border: 1px solid var(--border);
  margin-bottom: 8px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.profile-row:active { background: var(--accent-dim); }
.profile-row.active { border-color: var(--accent); box-shadow: var(--glow); }
.profile-row-emoji {
  font-size: 1.5rem; line-height: 1;
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg2); border-radius: 50%;
}
.profile-row-info { flex: 1; min-width: 0; }
.profile-row-name { font-size: 0.95rem; font-weight: 700; }
.profile-row-sub { font-size: 0.75rem; color: var(--text-muted); }
.profile-row-check { color: var(--accent); font-weight: 800; font-size: 1.1rem; }
.profile-row-del {
  background: transparent; border: none; color: var(--text-dim);
  cursor: pointer; padding: 6px; border-radius: 8px; display: flex; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.profile-row-del:active { color: var(--danger); background: rgba(239,68,68,0.12); }

.sheet-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 8px; padding: 13px;
  border-radius: 14px; border: 1px dashed var(--accent);
  background: var(--accent-dim); color: var(--accent);
  font-size: 0.92rem; font-weight: 700; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform 0.1s;
}
.sheet-add-btn:active { transform: scale(0.98); }

/* ── Onboarding: Emoji-Auswahl + Zurück ── */
.emoji-pick-row { display: flex; gap: 8px; flex-wrap: wrap; }
.emoji-pick {
  width: 46px; height: 46px; font-size: 1.5rem; line-height: 1;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.emoji-pick.selected {
  border-color: var(--accent); background: var(--accent-dim);
  box-shadow: var(--glow); transform: scale(1.05);
}
#ob-cancel {
  display: flex; align-items: center; gap: 4px;
  background: transparent; border: none;
  color: var(--text-muted); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; padding: 6px 0; margin-bottom: 8px;
  -webkit-tap-highlight-color: transparent;
}

/* ── Glas-Tiefe für Flächen (echtes Glassmorphism) ── */
.card, .profile-header, .recipe-card, .archiv-card, .cook-ingredients,
.shopping-recipe-row, .modal, .recipe-card-inline {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 18px rgba(0,0,0,0.28);
}
.shopping-item, .quick-add-tile {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.chat-bubble.assistant, .cook-chat-bubble.assistant {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ── Glow auf Primär-Aktionen + Fokus ── */
.btn-primary, .send-btn, #todo-add-btn { box-shadow: 0 4px 18px rgba(251,146,60,0.4); }
.btn-primary:active, .send-btn:active { box-shadow: 0 2px 10px rgba(251,146,60,0.3); }
.chat-bubble.user, .cook-chat-bubble.user { box-shadow: 0 4px 16px rgba(251,146,60,0.3); }
.form-input:focus, .form-select:focus, .chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(251,146,60,0.12), 0 0 18px rgba(251,146,60,0.08);
}
