:root {
  --bg: #fff7f2;
  --card: #ffffff;
  --ink: #2a1f1a;
  --muted: #8a7d75;
  --line: #f0e5dd;
  --brand: #e8562a;
  --brand-dark: #c8410f;
  --like: #34c759;
  --nope: #ff5a5f;
  --shadow: 0 10px 30px rgba(80, 40, 20, 0.12);
  --radius: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

/* Make the `hidden` attribute always win over display rules below. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  overscroll-behavior: none;
}

/* App shell: full-height column that never scrolls at the page level — the
   content area scrolls internally, so the bottom bar is rock-solid. */
body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  max-width: 520px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-top) + 8px) 16px 10px;
}

/* Swipe view fills the screen exactly — no scrolling. */
#view-swipe {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.view { animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 14px;
}
.topbar h1 { font-size: 1.5rem; margin: 0; letter-spacing: -0.02em; }

.ghost-btn {
  border: none;
  background: var(--card);
  width: 42px; height: 42px;
  border-radius: 50%;
  font-size: 1.25rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  color: var(--ink);
}
.ghost-btn:active { transform: scale(0.92); }

/* ---------- buttons ---------- */
.primary-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 6px 16px rgba(232, 86, 42, 0.3);
}
.primary-btn:active { transform: translateY(1px); }
.primary-btn.big { padding: 17px; font-size: 1.08rem; }
.secondary-btn {
  background: #fff;
  color: var(--brand);
  border: 2px solid var(--brand);
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
.secondary-btn.small { padding: 9px 14px; font-size: 0.92rem; }
.danger-btn {
  background: #fff; color: var(--nope);
  border: 2px solid var(--nope);
  border-radius: 12px; padding: 11px 16px; font-weight: 700; cursor: pointer;
}

/* ================= SWIPE DECK ================= */
.deck-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 8px;
}
.deck { position: absolute; inset: 0; }

.card {
  position: absolute;
  inset: 0;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: grab;
  will-change: transform;
  touch-action: pan-y;
  user-select: none;
}
.card:active { cursor: grabbing; }
.card-emoji {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8rem;
  background: linear-gradient(160deg, #fff3ec 0%, #ffe4d6 100%);
}
.card-photo {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: linear-gradient(160deg, #fff3ec 0%, #ffe4d6 100%);
  pointer-events: none;
}
.card-info { z-index: 1; }
.card-info {
  position: relative;
  padding: 20px;
  background: linear-gradient(to top, rgba(255,255,255,0.98) 55%, rgba(255,255,255,0));
}
.card-info h2 { margin: 0 0 6px; font-size: 1.5rem; letter-spacing: -0.02em; }
.card-info .ing-count { color: var(--muted); font-size: 0.9rem; }
.card-info .notes { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

.stamp {
  position: absolute;
  top: 26px;
  padding: 6px 16px;
  font-size: 1.6rem;
  font-weight: 900;
  border: 4px solid;
  border-radius: 12px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.1s;
}
.stamp.like { left: 20px; color: var(--like); border-color: var(--like); transform: rotate(-16deg); }
.stamp.nope { right: 20px; color: var(--nope); border-color: var(--nope); transform: rotate(16deg); }

.deck-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
}
.deck-done {
  margin: auto; padding: 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.deck-empty-emoji { font-size: 4rem; }
.deck-empty .primary-btn { width: auto; padding: 12px 24px; }

/* end-of-round summary */
.swipe-summary { padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.summary-title { margin: 0; font-size: 1.35rem; text-align: center; letter-spacing: -0.02em; }
.summary-sub { margin: 0; color: var(--muted); font-size: 0.9rem; text-align: center; }
.summary-list { display: flex; flex-direction: column; gap: 8px; }
.summary-row { display: flex; align-items: center; gap: 12px; }
.s-thumb { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; flex-shrink: 0;
  background: #fff3ec; display: grid; place-items: center; }
.s-thumb img { width: 100%; height: 100%; object-fit: cover; }
.s-thumb .ic-noimg { width: 55%; height: 55%; }
.s-meta { flex: 1; min-width: 0; }
.s-meta h3 { margin: 0 0 3px; font-size: 1rem; }
.s-add {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--brand);
  background: #fff; color: var(--brand); font-size: 1.25rem; font-weight: 700; cursor: pointer;
  display: grid; place-items: center; line-height: 1;
}
.s-add.on { background: var(--like); border-color: var(--like); color: #fff; }
.s-add:active { transform: scale(0.9); }
.swipe-summary .primary-btn { width: 100%; }
.swipe-summary .primary-btn:disabled { opacity: 0.6; }
.swipe-summary .undo-btn { align-self: center; }

/* swipe action row */
.swipe-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 18px;
}
.round-btn {
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.12s;
}
.round-btn:active { transform: scale(0.88); }
.round-btn.nope { width: 60px; height: 60px; font-size: 1.6rem; color: var(--nope); }
.round-btn.like { width: 60px; height: 60px; font-size: 1.6rem; color: var(--like); }
.round-btn.surprise { width: 52px; height: 52px; font-size: 1.4rem; }
.swipe-under { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 14px; }
.hint { text-align: center; color: var(--muted); font-size: 0.82rem; margin: 0; }
.undo-btn {
  border: none; background: var(--card); color: var(--ink);
  box-shadow: var(--shadow); border-radius: 999px;
  padding: 11px 22px; font-size: 0.95rem; font-weight: 700; cursor: pointer;
}
.undo-btn:active { transform: scale(0.94); }
.swipe-actions { display: flex; gap: 10px; align-items: center; justify-content: center; }
/* "Fertig" — stop the round early and jump to the liked meals. */
.done-btn {
  border: none; background: var(--brand); color: #fff;
  box-shadow: var(--shadow); border-radius: 999px;
  padding: 11px 22px; font-size: 0.95rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.done-btn .ic { stroke: #fff; }
.done-btn:active { transform: scale(0.94); }

/* ================= MEAL GRID (cookbook) ================= */
.meal-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.meal-card {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(80,40,20,0.08);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}
.meal-card:active { transform: scale(0.98); }
.meal-card .card-img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  background: linear-gradient(160deg, #fff3ec, #ffe4d6);
  display: grid; place-items: center; font-size: 3rem;
}
.meal-card .card-img img { width: 100%; height: 100%; object-fit: cover; }
.meal-card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.meal-card h3 { margin: 0; font-size: 1rem; line-height: 1.2; letter-spacing: -0.01em; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-size: 0.72rem; font-weight: 700; color: var(--muted);
  background: #f6efe9; border-radius: 8px; padding: 3px 7px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 3px;
}
.chip .ic { width: 12px; height: 12px; stroke-width: 2.1; }
.chip.kcal { background: #fff0e8; color: var(--brand-dark); }
.chip.price { background: #eefaf0; color: #1f9d4d; }
.chip.match { background: #fff0ec; color: var(--nope); }

/* No-photo placeholder (utensils) — sizes to its container */
.ic-noimg {
  width: 42%; height: 42%; max-width: 76px;
  fill: none; stroke: var(--muted); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0.5;
}
.emoji .ic-noimg, .card-img .ic-noimg { width: 55%; height: 55%; }
.noimg-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  background: linear-gradient(160deg, #fff3ec, #ffe4d6);
}
.card .noimg-wrap { position: absolute; inset: 0; }
.meal-card .add-btn {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.92); color: var(--brand);
  font-size: 1.3rem; font-weight: 700; cursor: pointer; box-shadow: var(--shadow);
  display: grid; place-items: center; line-height: 1;
}
.meal-card .add-btn.on { background: var(--like); color: #fff; }
.meal-card .add-btn:active { transform: scale(0.9); }

.plan-row .emoji img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.plan-row .emoji { width: 44px; height: 44px; overflow: hidden; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; background: #fff3ec; }

/* ================= PLAN ================= */
.plan-meals { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.plan-row {
  background: var(--card); border-radius: 16px; padding: 14px;
  display: flex; align-items: center; gap: 14px; box-shadow: 0 4px 14px rgba(80,40,20,0.06);
}
.plan-row .emoji { font-size: 1.8rem; }
.plan-row .meta { flex: 1; }
.plan-row .meta h3 { margin: 0; font-size: 1.05rem; }
.plan-row .meta span { color: var(--muted); font-size: 0.85rem; }
.plan-row .remove { border: none; background: #fff0ec; color: var(--nope);
  width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; cursor: pointer; }

/* Weekday grouping in the Menüplan */
.day-head {
  margin: 14px 0 2px; font-size: 0.82rem; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand);
}
.day-head:first-child { margin-top: 0; }
.day-head.muted-head { color: var(--muted); }
.plan-row .day-select {
  margin-top: 3px; border: 1px solid #f0ddd3; border-radius: 8px;
  background: #fff8f5; color: var(--muted);
  font-size: 0.82rem; font-family: inherit; padding: 3px 6px;
  max-width: 100%; cursor: pointer;
}

.shopping-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.shopping-card h2 { margin: 0 0 12px; font-size: 1.2rem; }
.shopping-list { list-style: none; margin: 0 0 16px; padding: 0; }
.shopping-list li {
  display: flex; justify-content: space-between;
  padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 0.98rem;
}
.shopping-list li:last-child { border-bottom: none; }
.shopping-list li .spec { color: var(--muted); font-size: 0.85rem; }
.bring-note { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 10px 0 0; }
.bring-logo { font-size: 1.1rem; }

/* ================= SETTINGS ================= */
.settings-card {
  background: var(--card); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.settings-card h2 { margin: 0; font-size: 1.15rem; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
input, textarea, select {
  font: inherit; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px; background: #fff; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); }
.muted { color: var(--muted); font-size: 0.9rem; margin: 0; }
.muted.tiny { font-size: 0.78rem; }
#bringStatus.ok { color: var(--like); font-weight: 700; }
#bringStatus.bad { color: var(--nope); font-weight: 700; }
#listPicker { display: flex; flex-direction: column; gap: 12px; }

.empty-state { text-align: center; color: var(--muted); margin-top: 60px; display: flex;
  flex-direction: column; align-items: center; gap: 16px; }
.empty-state .primary-btn { width: auto; padding: 12px 22px; }

/* ================= TAB BAR ================= */
.tabbar {
  flex: 0 0 auto;
  width: 100%;
  max-width: 520px;
  display: flex;
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.tab {
  flex: 1;
  border: none;
  background: none;
  padding: 10px 0 12px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
}
.tab .ico { width: 25px; height: 25px; opacity: 0.6; }
.tab.active { color: var(--brand); }
.tab.active .ico { opacity: 1; }

/* Crisp line icons (inherit colour, no emoji) */
.ico {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
}
.ghost-btn .ico { width: 21px; height: 21px; }
.ghost-btn.active .ico { fill: #fff; }

/* Inline icons that sit next to text (buttons, chips, badges). */
.ic {
  width: 1.15em; height: 1.15em;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.2em; flex-shrink: 0;
}
.ic-fill { fill: currentColor; stroke: none; }
/* Buttons/badges that pair an icon with a label */
.chip-btn, .undo-btn, .dice-btn, .heart-badge, .match-row .who,
.matches-card h2, .chip.match { display: inline-flex; align-items: center; gap: 6px; }
.match-row .who, .matches-card h2 { display: flex; }
.primary-btn.big { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.primary-btn.big .ic { width: 20px; height: 20px; }
.badge {
  position: absolute; top: 4px; left: 58%;
  background: var(--brand); color: #fff;
  min-width: 18px; height: 18px; border-radius: 9px;
  font-size: 0.68rem; display: grid; place-items: center; padding: 0 4px;
}

/* ================= MODAL ================= */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30,15,8,0.45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.2s ease;
}
.modal-card {
  background: var(--bg); width: 100%; max-width: 520px;
  border-radius: 24px 24px 0 0;
  max-height: 92vh; display: flex; flex-direction: column;
  animation: slideup 0.28s cubic-bezier(0.2,0.8,0.2,1);
  padding-bottom: var(--safe-bottom);
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.modal-head, .modal-foot {
  display: flex; align-items: center; padding: 16px 18px;
}
.modal-head { border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.modal-head .ghost-btn { margin-left: auto; width: 36px; height: 36px; box-shadow: none; background: var(--line); }
.modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-body h3 { margin: 6px 0 0; font-size: 1rem; }
.modal-foot { border-top: 1px solid var(--line); gap: 10px; }
.modal-foot .spacer { flex: 1; }
.modal-foot .primary-btn { width: auto; padding: 12px 22px; }

/* photo picker in the meal editor */
.photo-picker { display: flex; flex-direction: column; gap: 10px; }
.photo-preview {
  width: 100%; aspect-ratio: 16 / 10;
  border-radius: 16px; overflow: hidden;
  background: linear-gradient(160deg, #fff3ec, #ffe4d6);
  display: grid; place-items: center; position: relative;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview .photo-hint { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 0 20px; }
.photo-preview.loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: shimmer 1.1s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%);} to { transform: translateX(100%);} }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 8px 14px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.chip-btn:active { transform: scale(0.96); }
.dice-btn { margin-bottom: 16px; }

.emoji-name-row { display: flex; gap: 10px; }
.emoji-input { width: 58px; text-align: center; font-size: 1.5rem; flex-shrink: 0; }
.name-input { flex: 1; }
.ingredient-rows { display: flex; flex-direction: column; gap: 8px; }
.ing-row { display: flex; gap: 8px; }
.ing-row .ing-name { flex: 2; }
.ing-row .ing-spec { flex: 1; }
.ing-row .del { border: none; background: #fff0ec; color: var(--nope);
  border-radius: 10px; width: 42px; flex-shrink: 0; cursor: pointer; font-size: 1rem; }

/* ================= EDITOR EXTRA FIELDS ================= */
.meta-row { display: flex; gap: 10px; }
.meta-row label { flex: 1; }
.hdr-hint { font-weight: 500; color: var(--muted); font-size: 0.78rem; }
.ing-row .ing-price { flex: 0 0 74px; }
.nutri-editor { display: flex; flex-direction: column; gap: 10px; }
.nutri-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nutri-grid label { font-size: 0.72rem; text-align: center; gap: 4px; }
.nutri-grid input { padding: 9px 4px; text-align: center; }
.nutri-note { color: var(--muted); font-size: 0.8rem; margin: 0; }
.nutri-note.warn { color: var(--brand-dark); }

/* ================= MEAL DETAIL ================= */
.detail-card { overflow: hidden; }
.detail-hero {
  position: relative; height: 230px;
  background: linear-gradient(160deg, #fff3ec, #ffe4d6);
  display: flex; align-items: flex-end;
}
.detail-hero img.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-hero .hero-emoji { position: absolute; inset: 0; display: grid; place-items: center; font-size: 6rem; }
.hero-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.4); color: #fff; font-size: 1rem; cursor: pointer;
}
.detail-hero-title {
  position: relative; z-index: 1; width: 100%;
  padding: 30px 18px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}
.detail-hero-title h2 { margin: 0; color: #fff; font-size: 1.5rem; text-shadow: 0 1px 6px rgba(0,0,0,0.4); }
.detail-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-chips .chip { font-size: 0.8rem; padding: 5px 10px; }

.macros { display: flex; gap: 8px; }
.macro {
  flex: 1; background: #faf4ef; border-radius: 14px; padding: 12px 6px;
  text-align: center; display: flex; flex-direction: column; gap: 2px;
}
.macro .val { font-size: 1.15rem; font-weight: 800; }
.macro .lbl { font-size: 0.7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.macro.kcal .val { color: var(--brand); }
.detail-ings { list-style: none; margin: 0; padding: 0; }
.detail-ings li { display: flex; justify-content: space-between; padding: 8px 2px;
  border-bottom: 1px solid var(--line); font-size: 0.95rem; gap: 10px; }
.detail-ings li:last-child { border-bottom: none; }
.detail-ings .r { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.detail-notes { color: var(--muted); font-size: 0.9rem; }

/* ================= PLAN TOTALS ================= */
.plan-totals {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.plan-totals .tot {
  flex: 1; background: var(--card); border-radius: 14px; padding: 12px;
  text-align: center; box-shadow: 0 4px 14px rgba(80,40,20,0.06);
}
.plan-totals .tot .val { font-size: 1.25rem; font-weight: 800; color: var(--brand); }
.plan-totals .tot .lbl { font-size: 0.72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; }

/* ================= LOGIN ================= */
.login-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px 24px; width: 100%; max-width: 360px; text-align: center;
  display: flex; flex-direction: column; gap: 12px;
}
.login-emoji { font-size: 3rem; }
.login-card h1 { margin: 0; letter-spacing: -0.02em; }
.login-card > p { margin: 0 0 6px; color: var(--muted); }
.login-error { color: var(--nope) !important; font-weight: 700; margin: 0; }

/* ================= MATCH! ================= */
.match-overlay {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 28px;
  background: radial-gradient(circle at 50% 35%, #f2703f, #c8410f);
  color: #fff; animation: fade 0.3s ease;
}
.match-inner {
  text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 16px; max-width: 360px;
}
.match-hearts { font-size: 3.4rem; animation: pop 0.6s ease; }
.match-title { font-size: 2.1rem; font-weight: 900; letter-spacing: -0.02em; }
.match-photo {
  width: 180px; height: 180px; border-radius: 50%; overflow: hidden;
  border: 5px solid #fff; box-shadow: 0 12px 34px rgba(0,0,0,0.3);
  display: grid; place-items: center; font-size: 5rem; background: #ffe4d6;
  animation: pop 0.5s ease;
}
.match-photo img { width: 100%; height: 100%; object-fit: cover; }
.match-text { font-size: 1.15rem; opacity: 0.96; line-height: 1.4; }
.match-text b { font-weight: 800; }
.match-overlay .primary-btn {
  background: #fff; color: var(--brand); width: auto; padding: 14px 30px;
  margin-top: 6px; box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ================= MATCHES (plan) ================= */
.matches-card {
  background: linear-gradient(160deg, #ffffff, #fff2ea);
  border: 1.5px solid #ffd9c7;
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.matches-card h2 { margin: 0 0 10px; font-size: 1.05rem; }
.match-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.match-row .emoji { width: 46px; height: 46px; border-radius: 12px; overflow: hidden;
  flex-shrink: 0; display: grid; place-items: center; background: #fff3ec; font-size: 1.6rem; }
.match-row .emoji img { width: 100%; height: 100%; object-fit: cover; }
.match-row .meta { flex: 1; min-width: 0; }
.match-row .meta h3 { margin: 0; font-size: 1rem; }
.match-row .who { color: var(--brand-dark); font-size: 0.82rem; font-weight: 600; }

/* heart badge on cards liked-by-2+ */
.heart-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: rgba(255,255,255,0.94); border-radius: 999px;
  padding: 3px 8px; font-size: 0.8rem; font-weight: 800; color: var(--brand);
  box-shadow: var(--shadow);
}
.chip.match { background: #fff0ec; color: var(--nope); }

/* ================= FAVORITES ================= */
.topbar-actions { display: flex; gap: 8px; }
.ghost-btn.active { background: var(--brand); color: #fff; }

/* star toggle on grid cards (top-left) */
.meal-card .fav-btn {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.92); cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--shadow); color: #b9a24a;
}
.meal-card .fav-btn .ic { width: 19px; height: 19px; }
.meal-card .fav-btn.on { color: #f4b400; }
.meal-card .fav-btn:active { transform: scale(0.9); }

/* star badge on the big swipe card (top-right) */
.card .fav-badge {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  color: #ffd34d; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.45));
}
.card .fav-badge .ic { width: 27px; height: 27px; }
.card .heart-badge .ic { width: 13px; height: 13px; }

/* star toggle in the detail hero (top-left, mirrors close button) */
.hero-fav {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.4); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.hero-fav .ic { width: 20px; height: 20px; }
.hero-fav.on { color: #ffd34d; }

/* other replaced-emoji icons */
.deck-empty-ic { width: 60px; height: 60px; color: var(--like); stroke-width: 2.2; }
.login-logo {
  width: 54px; height: 54px; margin: 0 auto;
  fill: none; stroke: var(--brand); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.match-hearts-ic { width: 60px; height: 60px; fill: #fff; stroke: none; animation: pop 0.6s ease; }
.matches-card h2 .ic { width: 17px; height: 17px; color: var(--nope); }

/* ================= TOAST ================= */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom));
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: 999px;
  font-size: 0.9rem; font-weight: 600;
  z-index: 200; box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
  max-width: 88%;
}
.toast.bad { background: var(--nope); }
.toast.ok { background: var(--like); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ================= GROUPS & INVITE ================= */
#groupSelect {
  width: 100%; padding: 12px; border-radius: 12px; border: 1px solid #f0ddd3;
  background: #fff8f5; font-family: inherit; font-size: 1rem; color: var(--ink);
  margin-bottom: 10px;
}
.group-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.group-actions .secondary-btn { flex: 1 1 30%; padding: 10px 8px; font-size: 0.88rem; }
.secondary-btn.danger { color: var(--nope); border-color: #f6d5cc; }
.secondary-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.invite-inner { text-align: center; padding: 22px 18px; overflow-y: auto; }
.invite-inner h2 { margin: 0 0 6px; font-size: 1.25rem; }
.invite-qr {
  width: 210px; height: 210px; margin: 14px auto; background: #fff;
  border-radius: 14px; padding: 8px; box-shadow: 0 3px 12px rgba(80,40,20,0.1);
}
.invite-qr svg { display: block; width: 100%; height: 100%; }
.invite-link {
  background: #fff3ec; border-radius: 10px; padding: 10px;
  margin-bottom: 12px; overflow-wrap: anywhere;
}
.invite-link code { font-size: 0.8rem; color: var(--muted); }
.invite-inner .primary-btn,
.invite-inner .secondary-btn { width: 100%; margin-bottom: 8px; }
.invite-inner .close-x {
  margin: 6px auto 0; width: auto; min-width: 140px; height: auto;
  border-radius: 999px; padding: 11px 22px; font-size: 0.95rem; font-weight: 700;
}
