/* ══════════════════════════════════════════════════════════
   unified.css — glue layer for the unified app
   Loads LAST, after style.css (classic components) and
   v2/v2.css + v2/app.css (the v2 shell). Resolves the few
   cross-sheet conflicts and styles the pieces that moved.
═══════════════════════════════════════════════════════════ */

/* style.css sets body{display:flex} for the old fixed-sidebar layout;
   the v2 shell is a block page (topbar + .ap-body flex row). */
body.appv2 { display: block; }

/* The centered search pill must never collide with the right controls —
   the location label can be a street name, not just a zip. */
.ap-topbar-search { width: min(760px, calc(100vw - 880px)); }
#loc-label {
  max-width: 150px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 1280px) {
  .ap-topbar-search { position: static; transform: none; flex: 1; width: auto; }
}

/* Views need room — results has its own right sidebar */
.ap-main { max-width: 1340px; }
#results-view .results-content { padding: 0 24px 40px 0; }
#results-view .results-layout { align-items: flex-start; }

/* ── Topbar search pill: submit button + spinner ─────────── */
.topbar-search-btn {
  display: flex; align-items: center; justify-content: center;
  background: var(--green); color: #fff;
  border: none; border-radius: 999px;
  height: 36px; padding: 0 18px;
  font: inherit; font-size: 13.5px; font-weight: 700;
  cursor: pointer; flex-shrink: 0;
  transition: background .13s;
}
.topbar-search-btn:hover { background: var(--green-hover); }
.topbar-search-btn:disabled { opacity: .7; cursor: default; }
.topbar-search-btn .spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sidebar badge (My List count) ───────────────────────── */
.ap-nav-badge {
  margin-left: auto;
  background: var(--green); color: #fff;
  font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 1px 8px;
}

/* ── Location dialog ─────────────────────────────────────── */
.location-dialog {
  border: none; border-radius: 18px;
  padding: 0; background: transparent;
  width: min(760px, calc(100vw - 40px));
  margin: auto;   /* the global margin reset kills native <dialog> centering */
}
.location-dialog::backdrop { background: rgba(16,24,40,.45); }
.location-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 24px 80px rgba(16,24,40,.25);
}
.location-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.location-header h2 { font-size: 19px; font-weight: 800; }
.location-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.location-error { margin-top: 12px; margin-bottom: 0; }
.location-footer {
  display: flex; justify-content: flex-end;
  margin-top: 16px;
}

/* Address row inside the dialog (classes reused from style.css but the
   dialog is narrower than the old home form) */
.location-card .search-address-row { display: block; }
.location-card .search-address-row input {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font: inherit; font-size: 15px;
  padding: 13px 15px;
  outline: none;
}
.location-card .search-address-row input:focus { border-color: var(--green); }
.location-card .store-picker { box-shadow: none; border: 1px solid var(--border); }
.location-card .store-map { min-height: 240px; }
.location-card .store-list { max-height: 240px; overflow-y: auto; }

/* ── Popular tiles inside the v2 category grid ───────────── */
#popular-grid .popular-tile {
  border-width: 1px;
  border-radius: 14px;
  padding: 16px 8px 12px;
  gap: 8px;
}

/* ── Results view topline (back + heading) ───────────────── */
.results-topline {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.results-topline .results-heading { margin-bottom: 0; }

/* Bottom bar sits inside the main column now, not viewport-wide */
#results-view .bottom-bar {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 18px;
}

/* ── Meals / Community views ─────────────────────────────── */
.view-title { font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.view-sub { font-size: 14px; color: var(--ink-2); margin: 6px 0 22px; max-width: 640px; }
.view-meal-grid { max-width: 980px; }
.view-note {
  margin-top: 26px;
  background: var(--green-tint);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  max-width: 640px;
}
.coming-soon-pill {
  display: inline-block;
  background: var(--orange-tint); color: var(--orange);
  font-size: 11px; font-weight: 800;
  border-radius: 999px; padding: 2px 9px;
  vertical-align: middle; margin-left: 6px;
}

/* Meal preview cards: no fake prices — muted "coming soon" line */
.ap-meal-price em { color: var(--muted); }

/* ── Store cards: default (no location yet) state ────────── */
.ap-store-card small { min-height: 14px; }

/* ══════════════════════════════════════════════════════════
   Meal cards (grid) + detail page
═══════════════════════════════════════════════════════════ */
.meal-live { transition: box-shadow .13s, transform .1s; }
.meal-live:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.meals-loading { color: var(--muted); font-size: 14px; padding: 20px 0; }

/* ── Back link ───────────────────────────────────────────── */
.meal-back {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; color: var(--ink-2);
  padding: 4px 0; margin-bottom: 18px;
}
.meal-back:hover { color: var(--green); }

/* ── Two-column page: main + right rail ──────────────────── */
.meal-detail {
  display: grid; grid-template-columns: minmax(0, 1fr) 336px;
  gap: 26px; align-items: start;
}
.meal-detail-main { min-width: 0; display: flex; flex-direction: column; gap: 22px; }

/* ── Hero ────────────────────────────────────────────────── */
.meal-hero { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: 26px; align-items: start; }
.meal-hero-media {
  position: relative; border-radius: 18px; overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--orange-tint);
}
.meal-hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meal-media-ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--orange-tint), var(--green-tint));
}
.meal-media-ph-emoji { font-size: 68px; line-height: 1; filter: saturate(.9); }
.meal-media-ph-label {
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  color: var(--muted); text-transform: uppercase;
}
.meal-fav {
  position: absolute; top: 12px; right: 12px;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 18px; line-height: 1; cursor: pointer; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(16,24,40,.12);
}
.meal-fav.is-saved { color: #e23; }

.meal-hero-info { display: flex; flex-direction: column; }
.meal-d-title { font-size: 30px; font-weight: 800; letter-spacing: -.6px; line-height: 1.1; }
.meal-d-meta { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0; }
.meal-d-meta-i { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.meal-d-desc { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); margin-bottom: 14px; max-width: 46ch; }
.meal-d-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.meal-tag {
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; font-weight: 700; color: var(--ink-2);
}
.meal-cta-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #fff; border: none; border-radius: 12px;
  padding: 13px 18px; font: inherit; font-size: 15px; font-weight: 800;
  cursor: pointer; transition: background .13s; margin-bottom: 10px;
}
.meal-cta-primary:hover { background: var(--green-hover); }
.meal-cta-primary.is-added { background: var(--green-hover); }
.meal-cta-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--surface); color: var(--ink); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 12px 18px; font: inherit; font-size: 14.5px; font-weight: 700;
  cursor: pointer; transition: border-color .13s;
}
.meal-cta-secondary:hover { border-color: var(--green); }
.meal-cta-ic { font-size: 16px; }

/* ── Stat strip ──────────────────────────────────────────── */
.meal-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden;
}
.meal-stat { display: flex; align-items: center; gap: 11px; padding: 15px 16px; }
.meal-stat + .meal-stat { border-left: 1px solid var(--border); }
.meal-stat-ic { font-size: 20px; }
.meal-stat-val { display: block; font-size: 16px; font-weight: 800; }
.meal-stat-label { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* ── Ingredients + Instructions ──────────────────────────── */
.meal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.meal-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; }
.meal-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.meal-panel-head h3 { font-size: 17px; font-weight: 800; }
.meal-serv-pill {
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 11px; font-size: 11.5px; font-weight: 700; color: var(--muted);
}

.meal-ing-list { display: flex; flex-direction: column; }
.meal-ing-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.meal-ing-row:last-child { border-bottom: none; }
.meal-ing-media { flex-shrink: 0; }
.meal-ing-ph, .meal-ing-img {
  width: 38px; height: 38px; border-radius: 10px; display: block;
}
.meal-ing-ph {
  display: flex; align-items: center; justify-content: center; font-size: 19px;
  background: var(--bg); border: 1px solid var(--border);
}
.meal-ing-ph-glyph { opacity: .4; font-size: 15px; }
.meal-ing-img { object-fit: cover; }
.meal-ing-nm { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.meal-ing-opt { font-size: 12px; font-weight: 500; color: var(--muted); font-style: italic; }
.meal-ing-amt { flex-shrink: 0; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }

.meal-steps { display: flex; flex-direction: column; }
.meal-step { border-bottom: 1px solid var(--border); }
.meal-step:last-child { border-bottom: none; }
.meal-step > summary {
  display: flex; align-items: center; gap: 11px; padding: 12px 0;
  cursor: pointer; list-style: none; font-size: 14px; font-weight: 700;
}
.meal-step > summary::-webkit-details-marker { display: none; }
.meal-step-num {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--green-tint); color: var(--green);
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.meal-step-t { flex: 1; min-width: 0; }
.meal-step-chev { color: var(--muted); font-size: 16px; transition: transform .15s; }
.meal-step[open] .meal-step-chev { transform: rotate(180deg); }
.meal-step-b { padding: 0 0 13px 35px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }

/* ── Right rail ──────────────────────────────────────────── */
.meal-rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.meal-rail-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.meal-rail-head { display: flex; align-items: center; justify-content: space-between; }
.meal-rail-head h3 { font-size: 16px; font-weight: 800; }
.meal-rail-note { font-size: 12px; font-weight: 600; color: var(--muted); }
.meal-rail-sub { font-size: 12.5px; color: var(--muted); margin: 3px 0 14px; }
.meal-rail-loading { font-size: 13px; color: var(--muted); padding: 14px 0; line-height: 1.6; }
.meal-rail-noaddr { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.meal-rail-locbtn {
  display: block; margin-top: 10px; background: var(--green); color: #fff;
  border: none; border-radius: 9px; padding: 8px 14px; font: inherit;
  font-size: 13px; font-weight: 700; cursor: pointer;
}

.meal-store-rank { display: flex; flex-direction: column; gap: 9px; }
.meal-store-row {
  display: flex; align-items: center; gap: 11px;
  border: 1.5px solid var(--border); border-radius: 12px; padding: 11px 13px;
}
.meal-store-row.is-best { border-color: var(--green); background: var(--green-tint); }
.meal-store-badge {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.meal-store-badge.walmart { background: var(--blue-walmart); }
.meal-store-badge.kroger  { background: var(--blue-kroger); }
.meal-store-badge.aldi    { background: var(--red-aldi); }
.meal-store-nm { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.meal-store-partial {
  font-size: 9.5px; font-weight: 800; text-transform: uppercase;
  color: var(--orange); background: var(--orange-tint);
  padding: 1px 6px; border-radius: 999px;
}
.meal-store-cost { text-align: right; }
.meal-store-amt { display: block; font-size: 16px; font-weight: 800; }
.meal-store-per { font-size: 11px; font-weight: 600; color: var(--muted); }
.meal-store-row.is-unavail { opacity: .6; }
.meal-store-unavail { font-size: 12px; font-weight: 700; color: var(--muted); }
.meal-store-best { font-size: 11px; font-weight: 800; color: var(--green); }
.meal-store-delta { font-size: 11px; font-weight: 700; color: var(--muted); }

.meal-tip-card {
  display: flex; gap: 12px; background: #fff8e6; border: 1px solid #f5e2ac;
  border-radius: 16px; padding: 16px 18px;
}
.meal-tip-icon { font-size: 20px; line-height: 1.2; }
.meal-tip-card strong { font-size: 14px; font-weight: 800; }
.meal-tip-card p { font-size: 13px; line-height: 1.5; color: var(--ink-2); margin-top: 3px; }

.meal-nutri { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.meal-nutri-cell {
  background: var(--bg); border: 1px solid var(--border); border-radius: 11px;
  padding: 11px 6px; text-align: center;
}
.meal-nutri-v { display: block; font-size: 16px; font-weight: 800; }
.meal-nutri-l { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 2px; }

.meal-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.meal-share-btn {
  flex: 1; min-width: 88px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 11px;
  padding: 11px 8px; font: inherit; font-size: 12px; font-weight: 700; color: var(--ink-2);
  cursor: pointer; transition: border-color .13s;
}
.meal-share-btn:hover { border-color: var(--green); color: var(--green); }
.meal-share-btn span { font-size: 16px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1120px) {
  .meal-detail { grid-template-columns: 1fr; }
  .meal-rail { position: static; }
}
@media (max-width: 720px) {
  .meal-hero { grid-template-columns: 1fr; }
  .meal-stats { grid-template-columns: repeat(2, 1fr); }
  .meal-stat:nth-child(3) { border-left: none; }
  .meal-stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .meal-cols { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   Meal store picker — basket vs recipe-cost vs leftover
═══════════════════════════════════════════════════════════ */
.meal-store-dialog {
  border: none; border-radius: 22px; padding: 0; background: transparent;
  width: min(500px, calc(100vw - 28px)); margin: auto;
}
.meal-store-dialog::backdrop { background: rgba(16,24,40,.5); }
.msd-card {
  position: relative; background: var(--surface); border-radius: 22px;
  padding: 20px 20px 18px; box-shadow: 0 24px 80px rgba(16,24,40,.3);
  max-height: 92vh; overflow-y: auto;
}
.msd-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.msd-title { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.msd-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.msd-close {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: none; border: none; cursor: pointer; font-size: 15px; color: var(--muted);
}
.msd-close:hover { background: var(--bg); color: var(--ink); }

.msd-list { display: flex; flex-direction: column; gap: 9px; }
.msd-store {
  display: flex; align-items: flex-start; gap: 11px; width: 100%; text-align: left;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 12px 13px; cursor: pointer; font: inherit; transition: border-color .12s, background .12s;
}
.msd-store:hover { border-color: var(--green); }
.msd-store.is-sel { border-color: var(--green); background: var(--green-tint); }
.msd-radio {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; margin-top: 2px;
  border: 2px solid var(--border); background: var(--surface); position: relative;
}
.msd-store.is-sel .msd-radio { border-color: var(--green); }
.msd-store.is-sel .msd-radio::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--green);
}
.msd-store-body { flex: 1; min-width: 0; }
.msd-store-top { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; flex-wrap: wrap; }
.msd-store-badge {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  color: #fff; font-size: 9.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.msd-store-badge.walmart { background: var(--blue-walmart); }
.msd-store-badge.kroger  { background: var(--blue-kroger); }
.msd-store-badge.aldi    { background: var(--red-aldi); }
.msd-store-nm { font-size: 15px; font-weight: 800; }
.msd-tag {
  font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .3px;
}
.msd-tag--upfront { background: var(--green-tint); color: var(--green); }
.msd-tag--value { background: var(--orange-tint); color: var(--orange); }
.msd-tag--partial { background: #fdecec; color: var(--red-aldi); }

.msd-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.msd-metric {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 9px; display: flex; flex-direction: column; gap: 1px;
}
.msd-m-label { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.msd-m-sub { font-size: 9.5px; color: var(--muted); }
.msd-m-val { font-size: 16px; font-weight: 800; margin-top: 2px; }
.msd-m-recipe { color: var(--green); }
.msd-extra-note { font-size: 11px; color: var(--muted); margin-top: 8px; }

/* Ingredient breakdown for the selected store */
.msd-breakdown { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.msd-bd-head { font-size: 13px; margin-bottom: 8px; }
.msd-bd-cols, .msd-bd-row {
  display: grid; grid-template-columns: 1.6fr 0.9fr 0.9fr 0.8fr 0.9fr 0.7fr;
  gap: 6px; align-items: center;
}
.msd-bd-cols {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.msd-bd-row { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 11.5px; }
.msd-bd-ing { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 600; }
.msd-bd-nm { min-width: 0; }
.msd-bd-notes { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 2px; font-weight: 400; }
.msd-byweight { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.msd-was { font-size: 10px; color: #dc2626; font-weight: 700; margin-top: 1px; white-space: nowrap; }
.msd-was s { color: var(--muted); font-weight: 600; }
.msd-bd-img, .msd-bd-ph { width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0; }
.msd-bd-img { object-fit: contain; background: #f8f9fc; border: 1px solid var(--border); }
.msd-bd-ph { background: #f1f3f6; border: 1px solid var(--border); }
.msd-bd-c { color: var(--ink-2); }
.msd-bd-total { font-weight: 800; color: var(--ink); text-align: right; }
.msd-showall {
  background: none; border: none; color: var(--green); font: inherit; font-size: 12.5px;
  font-weight: 700; cursor: pointer; padding: 10px 0 2px; width: 100%; text-align: center;
}

.msd-note {
  display: flex; gap: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.4;
  background: var(--bg); border-radius: 10px; padding: 9px 11px; margin-top: 12px;
}
.msd-footer { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.msd-add {
  background: var(--green); color: #fff; border: none; border-radius: 12px;
  padding: 13px; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
}
.msd-add:hover { background: var(--green-hover); }
.msd-cancel {
  background: none; border: none; color: var(--muted); font: inherit; font-size: 13.5px;
  font-weight: 700; cursor: pointer; padding: 4px;
}
@media (max-width: 480px) {
  .msd-bd-cols, .msd-bd-row { grid-template-columns: 1.4fr 0.9fr 0.8fr 0.7fr; }
  .msd-bd-cols span:nth-child(3), .msd-bd-row .msd-bd-c:nth-child(3),
  .msd-bd-cols span:nth-child(5), .msd-bd-row .msd-bd-c:nth-child(5) { display: none; }
}

/* ══════════════════════════════════════════════════════════
   My List — meal grouping (quick panel) + full page
═══════════════════════════════════════════════════════════ */

/* ── Right quick panel: collapsible meal groups ──────────── */
.list-meal { border-bottom: 1px solid var(--border); }
.list-meal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; cursor: pointer; user-select: none;
}
.list-meal-head:hover { background: var(--bg); }
.list-meal-emoji {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; overflow: hidden;
  background: var(--orange-tint); display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.meal-thumb-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.list-meal-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-meal-name { font-size: 13.5px; font-weight: 800; }
.list-meal-sub { font-size: 11px; color: var(--muted); }
.list-meal-total { font-size: 13.5px; font-weight: 800; color: var(--green); }
.list-meal-arrow { color: var(--muted); font-size: 15px; transition: transform .15s; }
.list-meal-arrow.open { transform: rotate(180deg); }
.list-meal-items { background: var(--bg); }
.list-row--in-meal { padding-left: 30px; border-bottom: 1px solid var(--border); }
.list-row--in-meal:last-child { border-bottom: none; }

/* ── Full My List page ───────────────────────────────────── */
.mlp-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.mlp-head-titles { display: flex; align-items: baseline; gap: 12px; }
.mlp-count { font-size: 14px; font-weight: 600; color: var(--muted); }
.mlp-ghost {
  background: none; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-2);
  cursor: pointer;
}
.mlp-ghost:hover { border-color: var(--red-aldi); color: var(--red-aldi); }

.mlp-section { margin-bottom: 26px; }
.mlp-section-title { font-size: 15px; font-weight: 800; margin-bottom: 12px; }

/* Meal card */
.mlp-meal {
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  overflow: hidden; margin-bottom: 14px;
}
.mlp-meal-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.mlp-meal-media {
  width: 60px; height: 60px; flex-shrink: 0; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, var(--orange-tint), var(--green-tint));
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.mlp-meal-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mlp-meal-titles strong { font-size: 16px; font-weight: 800; }
.mlp-meal-meta { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.mlp-meal-count { font-size: 12px; color: var(--muted); }
.mlp-meal-total { font-size: 17px; font-weight: 800; }
.mlp-meal-actions { display: flex; align-items: center; gap: 8px; }
.mlp-btn {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 9px;
  padding: 7px 12px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink);
  cursor: pointer;
}
.mlp-btn:hover { border-color: var(--green); color: var(--green); }
.mlp-icon {
  width: 32px; height: 32px; border-radius: 8px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; font-size: 14px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.mlp-icon:hover { background: var(--bg); color: var(--ink); }
.mlp-toggle { transition: transform .15s; }
.mlp-toggle.open { transform: rotate(180deg); }
.mlp-remove:hover { border-color: var(--red-aldi); color: var(--red-aldi); }

.mlp-meal-table { border-top: 1px solid var(--border); }
.mlp-table-head, .mlp-ing {
  display: grid; grid-template-columns: 1fr 130px 92px 30px; align-items: center; gap: 10px;
  padding: 9px 18px;
}
.mlp-table-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); background: var(--bg);
}
.mlp-ing { border-top: 1px solid var(--border); }
.mlp-ing:first-child { border-top: none; }
.mlp-ing-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.mlp-ing-img, .mlp-ing-ph { width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0; }
.mlp-ing-img { object-fit: contain; background: #f8f9fc; border: 1px solid var(--border); }
.mlp-ing-ph { background: #f1f3f6; border: 1px solid var(--border); }
.mlp-ing-name { font-size: 13.5px; font-weight: 600; min-width: 0; }
.mlp-ing-name a { color: inherit; text-decoration: none; }
.mlp-ing-name a:hover { color: var(--green); }
.mlp-ing-name small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.mlp-ing-store { font-size: 13px; font-weight: 700; color: var(--green); }
.mlp-ing-price { font-size: 13.5px; font-weight: 800; text-align: right; }
.mlp-ing-remove {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 13px; width: 26px; height: 26px; border-radius: 6px;
}
.mlp-ing-remove:hover { background: var(--bg); color: var(--red-aldi); }

/* Standalone items */
.mlp-loose { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.mlp-loose .mlp-ing:first-child { border-top: none; }

/* Foot total */
.mlp-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 4px 0; border-top: 2px solid var(--border); margin-top: 8px;
}
.mlp-foot span { font-size: 14px; color: var(--ink-2); }
.mlp-foot strong { font-size: 22px; font-weight: 800; }
.mlp-empty { color: var(--muted); font-size: 14px; padding: 40px 0; text-align: center; }

@media (max-width: 640px) {
  .mlp-table-head { display: none; }
  .mlp-ing { grid-template-columns: 1fr auto 30px; }
  .mlp-ing-store { display: none; }
}

/* ── Auth dialog: forgot-password / back links ───────────── */
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.auth-linkbtn {
  background: none; border: none; cursor: pointer; padding: 4px 0;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--green);
}
.auth-linkbtn:hover { text-decoration: underline; }
.auth-tabs[hidden] { display: none; }

/* ── Sidebar legal footer + auth fineprint links ─────────── */
.ap-footer { margin-top: auto; padding: 0 4px; display: flex; gap: 16px; }
.ap-footer a { font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.ap-footer a:hover { color: var(--ink-2); text-decoration: underline; }
.auth-fineprint a { color: var(--green); text-decoration: none; }
.auth-fineprint a:hover { text-decoration: underline; }

/* ═══════════════ Meals page (category rows + rich cards) ═══════════════ */
.meals-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.meals-title { font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.meals-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.meals-head-actions { display: flex; gap: 10px; flex-shrink: 0; }
.meals-hbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13.5px;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.meals-hbtn:hover { border-color: var(--green); background: var(--green-tint); }
.meals-caret { font-size: 10px; color: var(--muted); }
.meals-filter-wrap { position: relative; }
.meals-filter-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; min-width: 210px;
}
.meals-filter-item {
  display: block; width: 100%; text-align: left; padding: 9px 12px;
  border: none; background: none; border-radius: 8px; color: var(--ink);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.meals-filter-item:hover { background: var(--green-tint); color: var(--green); }

/* Category sections */
.msection { margin-bottom: 32px; }
.msection-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 13px; }
.msection-title { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.msection-title--grid { font-size: 23px; margin: 4px 0 18px; }
.msection-viewall { background: none; border: none; color: var(--green); font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.msection-viewall:hover { text-decoration: underline; }
.msection-back { background: none; border: none; color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 4px 0; margin-bottom: 8px; }
.msection-back:hover { color: var(--ink); }

.mrow {
  display: flex; gap: 16px; overflow-x: auto; padding: 2px 2px 10px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.mrow::-webkit-scrollbar { height: 8px; }
.mrow::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.mrow .mcard { flex: 0 0 224px; scroll-snap-align: start; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }

/* Rich meal card */
.mcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: box-shadow .14s, transform .1s;
}
.mcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.mcard-media { position: relative; aspect-ratio: 4 / 3; background: var(--orange-tint); overflow: hidden; }
.mcard-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.mcard-emoji { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 46px; }
.mcard-bookmark {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--ink-2); box-shadow: 0 2px 6px rgba(16,24,40,.14); padding: 0;
}
.mcard-bookmark svg { width: 15px; height: 15px; }
.mcard-bookmark:hover { color: var(--green); }
.mcard-bookmark.is-saved { color: var(--green); }
.mcard-bookmark.is-saved svg { fill: var(--green); stroke: var(--green); }
.mcard-tag {
  position: absolute; top: 10px; left: 10px;
  background: rgba(255,255,255,.92); color: var(--ink); font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(2px);
}
.mcard-body { padding: 14px 15px 16px; display: flex; flex-direction: column; flex: 1; }
.mcard-title { font-size: 16px; font-weight: 800; line-height: 1.25; letter-spacing: -.2px; }
.mcard-meta { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.mcard-meta-i { display: inline-flex; align-items: center; gap: 5px; }
.mcard-ic { width: 14px; height: 14px; flex-shrink: 0; opacity: .85; }
.mcard-meta-dot { font-size: 9px; opacity: .7; }
.mcard-divider { border-top: 1px solid var(--border); margin: auto 0 11px; }
.mcard-price { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.mcard-total { font-size: 25px; font-weight: 800; color: var(--green); line-height: 1.05; letter-spacing: -.5px; }
.mcard-price-label { font-size: 12px; color: var(--muted); margin-top: 1px; }

@media (max-width: 640px) {
  .meals-head-actions { width: 100%; }
  .meals-title { font-size: 25px; }
  .mrow .mcard { flex-basis: 200px; }
}

/* ═══════════════ Home hero ═══════════════ */
.home-hero {
  display: grid; grid-template-columns: auto auto auto minmax(0, 1fr); gap: 22px 34px; align-items: center;
  background: #faf6ed;
  border: 1px solid var(--border); border-radius: 20px;
  padding: 14px 30px; margin-bottom: 24px; overflow: hidden;
}
.home-hero-title { font-size: 32px; font-weight: 800; letter-spacing: -1px; line-height: 1.08; color: var(--ink); }
.hh-accent { color: var(--green); }
.home-hero-sub { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); max-width: 470px; line-height: 1.5; }
.home-hero-stores { display: flex; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.hh-store { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.home-hero-stores .ap-store-logo {
  width: 26px; height: 26px; font-size: 13px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.hh-more { font-size: 13px; font-weight: 600; color: var(--muted); }
.home-hero-media {
  position: relative; overflow: hidden;
  margin: -14px 0;
  display: flex; align-items: flex-end; justify-content: center;
  height: 234px;
}
.home-hero-img { height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: bottom center; display: block; }
.home-hero-badges { display: flex; flex-direction: column; gap: 10px; justify-content: center; flex-shrink: 0; }
.hero-badges-soon { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
.hero-badge { display: block; line-height: 0; cursor: default; }
.hero-badge img { height: 40px; width: auto; display: block; border-radius: 8px; }
@media (max-width: 1120px) { .home-hero-badges { display: none; } }
@media (max-width: 820px) {
  .home-hero { grid-template-columns: 1fr; padding: 22px 24px; }
  .home-hero-media, .home-hero-badges { display: none; }
  .home-hero-title { font-size: 27px; }
}

/* ═══════════════ Address autocomplete ═══════════════ */
.search-address-row { position: relative; }
/* In-flow inside the card so the modal grows to contain the list (rather than
   the list dangling below the card onto the backdrop). */
.addr-suggest {
  margin: 8px 0 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  max-height: 320px; overflow-y: auto;
}
.addr-sugg-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 12px; border-radius: 10px; cursor: pointer;
}
.addr-sugg-item:hover { background: #f3f4f6; }
.addr-sugg-pin { flex-shrink: 0; margin-top: 2px; color: var(--muted); }
.addr-sugg-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.addr-sugg-line1 {
  font-weight: 700; font-size: 14.5px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.addr-sugg-line2 {
  font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
