/* Nutrivo — weekly plan + shopping list styles (loaded after app.css) */

/* Generic button (also fixes the previously-unstyled auth modal .btn) */
.btn{
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: #111827;
  font-weight: 800;
  font-size: 14px;
  padding: 11px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .05s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:hover{ box-shadow: 0 2px 10px rgba(17,24,39,.06); }
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity: .55; cursor: not-allowed; }
.btn.primary{
  border: 0;
  color: #fff;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
}

/* Header sign-in button (signed-out state) */
.signInBtn{ padding: 7px 14px; font-size: 13px; border-radius: 999px; }

/* ---- Signed-out gate ---- */
.welcome{ display: none; }
body.is-signed-out .welcome{
  display: flex; flex-direction: column; justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 24px 22px 40px;
}
/* Hide the app chrome until signed in */
body.is-signed-out .content,
body.is-signed-out .tabbar,
body.is-signed-out .topbar .right{ display: none !important; }

.welcomeInner{ max-width: 460px; margin: 0 auto; text-align: center; }
.welcomeLogo{ width: 72px; height: 72px; object-fit: contain; margin-bottom: 18px; }
.welcomeTitle{
  margin: 0; font-size: 28px; line-height: 1.15; font-weight: 900; letter-spacing: -0.01em;
}
.welcomeSub{ margin: 12px 0 26px; color: var(--muted); font-size: 15px; font-weight: 600; line-height: 1.45; }
.welcomeActions{ display: grid; gap: 10px; }
.welcomeActions .btn{ width: 100%; padding: 14px; font-size: 15px; }

/* Home tweaks */
.focusGo{
  appearance: none; border: 0; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(42,166,160,.14); color: var(--brand);
  font-size: 20px; font-weight: 900; line-height: 1;
}
.weekCta{ margin-top: 12px; }
.weekCta .btn{ width: 100%; }

/* ---- Weekly plan ---- */
.wpCard{ padding: 16px; }
.wpHead{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.wpKicker{ font-size: 12px; font-weight: 900; letter-spacing:.04em; text-transform: uppercase; color: var(--brand); }
.wpTitle{ margin: 2px 0 0; font-size: 22px; font-weight: 900; }
.wpTargets{
  margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  background: rgba(42,166,160,.08); color: #111827; font-size: 13px; font-weight: 700;
}
.wpSummary{ margin-top: 10px; font-weight: 700; color: #374151; }
.wpStatus{ margin-top: 8px; }

/* Plan config (meals + days) — toggle pills */
.wpConfig{ margin-top: 14px; display: grid; gap: 14px; padding: 14px; background: #faf9f6; border: 1px solid var(--line); border-radius: 14px; }
.wpConfigGroup{ display: grid; gap: 9px; }
.wpConfigLabel{ font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pillRow{ display: flex; flex-wrap: wrap; gap: 8px; }
.togPill{
  appearance: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  border: 1.5px solid rgba(29,39,51,.14); background: var(--card, #fff); color: #1d2733;
  font-size: 13px; font-weight: 750; padding: 9px 15px; border-radius: 999px;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.togPill.day{ padding: 9px 13px; }
.togPill:active{ transform: scale(.95); }
.togPill.on{
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 6px 14px -8px rgba(31,143,138,.85);
}
/* Option toggles (Quick lunches) read as a SETTING, not a meal: soft tinted "on". */
.optPill.on{
  background: rgba(31,143,138,.12); color: var(--brand);
  border-color: rgba(31,143,138,.45); box-shadow: none;
}
.wpOptHint{ margin-top: 6px; opacity: .82; }

.wpDays{ margin-top: 14px; display: grid; gap: 16px; }
.wpDayPending{ opacity: .55; }
.wpDayPending .wpDayTotals{ font-style: italic; }

.wpHeadBtns{ display: flex; align-items: center; gap: 8px; }
.wpFavesBtn{ appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 800; color: #f0a500; background: #fff7e6; border: 1.5px solid #f6d99a; padding: 8px 13px; border-radius: 999px; }

/* Favorites sheet */
.favOverlay{ position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; background: rgba(17,24,39,.45); opacity: 0; transition: opacity .18s ease; }
.favOverlay.open{ opacity: 1; }
.favSheet{ width: min(560px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--card,#fff); border-radius: 22px 22px 0 0; transform: translateY(14px); transition: transform .2s ease; overflow: hidden; }
.favOverlay.open .favSheet{ transform: translateY(0); }
.favGrip{ width: 40px; height: 4px; border-radius: 99px; background: #d9d5cd; margin: 10px auto 4px; }
.favHead{ display: flex; align-items: center; justify-content: space-between; padding: 8px 18px 12px; border-bottom: 1px solid var(--line); }
.favKicker{ font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.favSheetTitle{ font-family: var(--font-display, Georgia, serif); font-size: 21px; font-weight: 600; color: var(--ink,#1d2733); }
.favClose{ appearance: none; border: 0; background: #f1efe9; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer; color: #5b6675; }
.favBody{ overflow-y: auto; padding: 8px 0; }
.favRow{ display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; -webkit-tap-highlight-color: transparent; }
.favRow:last-child{ border-bottom: 0; }
.favRow:active{ background: rgba(42,166,160,.05); }
.favThumb{ flex: 0 0 auto; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: #eef0f1; }
.favThumb img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.favInfo{ flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.favTitle{ font-size: 14.5px; font-weight: 750; color: var(--ink,#1d2733); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.favMeta{ display: flex; align-items: center; gap: 10px; }
.favStars{ font-size: 12px; color: #f0a500; letter-spacing: 1px; }
.favMade{ font-size: 11px; font-weight: 800; color: #2e9c6b; }
.favEmpty{ padding: 32px 24px; text-align: center; color: var(--muted); font-weight: 600; font-size: 14px; line-height: 1.5; }

.wpDaysBar{ display: flex; justify-content: flex-end; margin-top: 12px; }
.wpExpandAll{
  appearance: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 800;
  color: #1d2733; background: var(--card,#fff); border: 1.5px solid var(--line);
  padding: 7px 13px; border-radius: 999px;
}

.wpDay{ border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.wpDayHead{
  display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%;
  padding: 11px 12px; background: #faf9f6; border:0; border-bottom: 1px solid var(--line);
  cursor:pointer; text-align:left; font:inherit; -webkit-tap-highlight-color:transparent;
}
.wpDay.collapsed .wpDayHead{ border-bottom-color: transparent; }
.wpDayHead:active{ background:#f1efe9; }
.wpDayHeadL{ display:flex; flex-direction:column; gap:2px; min-width:0; flex:1; }
.wpDayName{ font-size:15px; font-weight:900; color: var(--ink,#1d2733); }
.wpDayPreview{ font-size:12px; font-weight:600; color: var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wpDay:not(.collapsed) .wpDayPreview{ display:none; }
.wpDayTotals{ font-size: 12px; font-weight: 800; color: var(--muted); flex:0 0 auto; white-space:nowrap; }
.wpDayChevron{ width:18px; height:18px; color:#9aa3ad; transition: transform .2s ease; flex:0 0 auto; }
.wpDay.collapsed .wpDayChevron{ transform: rotate(-90deg); }

/* Meals: a clean vertical list of tappable rows (thumb + info) */
.wpMeals{ display: flex; flex-direction: column; padding: 8px; overflow: hidden; max-height: 5000px; transition: max-height .28s ease; }
.wpDay.collapsed .wpMeals{ max-height: 0; padding-top: 0; padding-bottom: 0; }
.wpMeal{
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 6px;
  -webkit-tap-highlight-color: transparent;
}
.wpMeals .wpMeal:last-child{ border-bottom: 0; }
.wpMeal:active{ background: rgba(42,166,160,.05); }
.wpMealBadge{ display: inline-flex; gap: 8px; align-items: center; margin-top: 2px; }
.wpBadgeMade{ font-size: 11px; font-weight: 800; color: #2e9c6b; }
.wpBadgeStars{ font-size: 11px; color: #f0a500; letter-spacing: 1px; }

/* Recipe modal: made-it toggle + star rating */
.mealLogRow{ display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; padding: 12px 14px; background: #faf9f6; border-radius: 14px; }
.madeBtn{ appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 800; padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: #1d2733; }
.madeBtn.on{ background: #eef7f1; border-color: #2e9c6b; color: #2e9c6b; }
.starRow{ display: flex; gap: 2px; }
.star{ appearance: none; border: 0; background: none; cursor: pointer; font-size: 26px; line-height: 1; color: #d8d4cc; padding: 0 1px; transition: color .12s ease, transform .12s ease; }
.star.on{ color: #f0a500; }
.star:active{ transform: scale(1.2); }
.wpThumb{
  position: relative; flex: 0 0 auto; width: 64px; height: 64px; border-radius: 14px;
  overflow: hidden; background: #eef0f1;
}
.wpThumb img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.wpSlotTag{
  position: absolute; left: 4px; bottom: 4px;
  background: rgba(17,24,39,.74); color: #fff; font-size: 8.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; padding: 2px 5px; border-radius: 999px;
}
.wpMealInfo{ flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wpMealTitle{ font-weight: 800; font-size: 14.5px; line-height: 1.2; color: #1d2733; }
.wpWhy{ font-size: 12px; font-style: italic; color: var(--brand); font-weight: 700; line-height: 1.25; }
.wpMacros{ font-size: 11.5px; color: var(--muted); font-weight: 700; }
.wpMacros b{ color: #1d2733; }
.wpChevron{ flex: 0 0 auto; font-size: 22px; color: #c3c8cf; font-weight: 400; line-height: 1; }

/* Recipe detail modal */
.mealModalOverlay{
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(17,24,39,.45); opacity: 0; transition: opacity .18s ease;
}
.mealModalOverlay.open{ opacity: 1; }
.mealModal{
  position: relative; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  background: var(--card, #fff); border-radius: 24px 24px 0 0;
  transform: translateY(16px); transition: transform .2s cubic-bezier(.22,.7,.3,1);
}
.mealModalOverlay.open .mealModal{ transform: none; }
@media (min-width: 540px){
  .mealModalOverlay{ align-items: center; }
  .mealModal{ border-radius: 24px; }
}
.mealModalClose{
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  border: 0; cursor: pointer; background: rgba(255,255,255,.9); color: #1d2733; font-size: 22px; line-height: 1;
  box-shadow: 0 2px 8px rgba(17,24,39,.18);
}
.mealModalImg{ height: 190px; background: #eef0f1; }
.mealModalImg img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.mealModalBody{ padding: 18px 20px 26px; }
.mealModalSlot{ font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.mealModalTitle{ margin: 6px 0 12px; font-size: 22px; font-weight: 800; line-height: 1.15; color: #1d2733; }
.mealModalMacros{ display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); font-weight: 700; }
.mealModalMacros b{ color: #1d2733; }
.mealModalWhy{ margin: 14px 0 0; font-style: italic; color: var(--brand); font-weight: 700; }
.mealModalSec{ margin-top: 20px; }
.mealModalSec h4{ margin: 0 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.mIngList{ list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mIngList li{ display: flex; gap: 10px; font-size: 14px; font-weight: 600; color: #1d2733; }
.mIngAmt{ flex: 0 0 84px; font-weight: 800; color: var(--brand); }
.mStepList{ list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: none; }
.mStepList li{ display: flex; gap: 12px; font-size: 14px; line-height: 1.45; color: #2a3540; }
.mStepN{
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(42,166,160,.14); color: var(--brand); font-size: 12px; font-weight: 800;
}
.mealModalLink{ display: inline-block; margin-top: 18px; }
.mealModalSrc{ display: inline-block; margin-top: 20px; font-size: 14px; font-weight: 800; color: var(--brand); text-decoration: none; }
.mealModalSrc:hover{ text-decoration: underline; }

/* ---- Shopping list (redesigned) ---- */
.slTitle{ font-family: var(--font-display, Georgia, serif); font-weight: 600; font-size: 24px; letter-spacing: -.01em; margin: 4px 0 0; color: var(--ink, #1d2733); }

.slHeadCard{
  background: #fff; border: 1px solid var(--card-line, rgba(29,39,51,.07)); border-radius: 20px;
  padding: 18px; box-shadow: var(--card-shadow, 0 8px 28px -14px rgba(29,39,51,.22));
}
.slMeta{ margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft, #5b6675); }
.slHint{ margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--brand); background: rgba(42,166,160,.08); border-radius: 10px; padding: 7px 10px; }
.slProgress{ height: 8px; border-radius: 99px; background: #eeece6; overflow: hidden; margin-top: 14px; }
.slProgressBar{ height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand2)); transition: width .25s ease; }
.slProgressTxt{ margin-top: 7px; font-size: 12px; font-weight: 800; color: var(--ink-soft, #5b6675); }

.slAisleCard{
  background: #fff; border: 1px solid var(--card-line, rgba(29,39,51,.07)); border-radius: 18px;
  overflow: hidden; box-shadow: var(--card-shadow, 0 8px 28px -14px rgba(29,39,51,.22));
}
.slAisleHead{
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; width: 100%;
  background: #faf9f6; border: 0; border-bottom: 1px solid var(--card-line, rgba(29,39,51,.07));
  cursor: pointer; text-align: left; font: inherit; -webkit-tap-highlight-color: transparent;
}
.slAisleHead:active{ background: #f1efe9; }
.slAisleIcon{ font-size: 16px; }
.slAisleName{ flex: 1; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #374151; }
.slAisleAll{ font-size: 11.5px; font-weight: 800; color: var(--brand); background: rgba(42,166,160,.12); border: 0; border-radius: 99px; padding: 5px 11px; cursor: pointer; flex: 0 0 auto; -webkit-tap-highlight-color: transparent; }
.slAisleAll:active{ background: rgba(42,166,160,.22); }
.slAisleCount{ font-size: 12px; font-weight: 800; color: #fff; background: var(--brand); border-radius: 99px; padding: 2px 9px; min-width: 34px; text-align: center; }
.slChevron{ width: 18px; height: 18px; color: #9aa3ad; transition: transform .2s ease; flex: 0 0 auto; }

/* Collapsed: fold the items away to keep the page short. */
.slItems{
  list-style: none; margin: 0; padding: 0;
  overflow: hidden; max-height: 2000px; transition: max-height .25s ease;
}
.slAisleCard.collapsed .slItems{ max-height: 0; }
.slAisleCard.collapsed .slChevron{ transform: rotate(-90deg); }
.slAisleCard.collapsed .slAisleHead{ border-bottom-color: transparent; }
/* Finished aisle: muted + green tick. */
.slAisleCard.done .slAisleHead{ background: #eef7f1; }
.slAisleCard.done .slAisleName{ color: #6b7280; }
.slAisleCard.done .slAisleCount{ background: #2e9c6b; }
.slItem{ display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--card-line, rgba(29,39,51,.06)); }
.slItem:last-child{ border-bottom: 0; }
.slCheckWrap{ position: relative; flex: 0 0 auto; width: 24px; height: 24px; cursor: pointer; }
.slCheck{ position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; cursor: pointer; }
.slBox{
  display: block; width: 24px; height: 24px; border-radius: 8px;
  border: 2px solid #d4d0c8; background: #fff; transition: all .15s ease;
}
.slCheck:checked + .slBox{
  background: linear-gradient(135deg, var(--brand), var(--brand2)); border-color: transparent;
}
.slCheck:checked + .slBox::after{
  content: ""; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.slItemMain{ flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.slQty{ font-size: 12px; font-weight: 800; color: var(--brand); }
.slName{ font-size: 14.5px; font-weight: 650; color: var(--ink, #1d2733); }
/* Checked = flagged to buy: highlight it so your picks stand out. */
.slItem:has(.slCheck:checked){ background: rgba(42,166,160,.07); }
.slItem:has(.slCheck:checked) .slName{ color: var(--ink, #1d2733); font-weight: 750; }
.slAisleCard.noneSelected .slAisleCount{ background: #b6bcc4; }
.slFrom{ font-size: 11px; font-weight: 800; color: var(--ink-soft, #9aa3ad); }

.slEmpty{ text-align: center; padding: 48px 24px; }
.slEmptyIcon{ font-size: 44px; }
.slEmpty .slTitle{ margin-top: 10px; }
.slEmpty .btn{ margin-top: 18px; }

/* Order card */
.slOrderCard{
  background: #fff; border: 1px solid var(--card-line, rgba(29,39,51,.07)); border-radius: 20px;
  padding: 18px; box-shadow: var(--card-shadow, 0 8px 28px -14px rgba(29,39,51,.22));
}
.slOrderHead{ display: flex; align-items: center; gap: 12px; }
.slOrderIcon{
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-size: 20px; background: rgba(42,166,160,.1);
}
.slOrderTitle{ font-family: var(--font-display, Georgia, serif); font-weight: 600; font-size: 18px; color: var(--ink, #1d2733); }
.slOrder{ margin-top: 14px; display: flex; gap: 10px; align-items: stretch; }
.slOrder .btn{ flex: 1; }
.slZip{
  width: 96px; padding: 11px 12px; border: 1.5px solid var(--card-line, rgba(29,39,51,.14)); border-radius: 12px;
  font-size: 15px; font-weight: 800; text-align: center; letter-spacing: .08em;
}
.slOrderNote{ margin-top: 10px; }

/* ---- Kroger priced cart ---- */
.krResult{ margin-top: 14px; }
.krCard{ border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.krBanner{ background: #fff7ed; color: #9a3412; font-size: 12px; font-weight: 800; padding: 8px 12px; }
.krHead{
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; background: #faf9f6; border-bottom: 1px solid var(--line);
}
.krStore{ font-weight: 900; font-size: 14px; }
.krTotal{ font-weight: 900; font-size: 20px; color: var(--brand); }
.krTotal span{ font-size: 11px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.krRows{ display: flex; flex-direction: column; }
.krRow{
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.krRow:last-child{ border-bottom: 0; }
.krImg{ width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; background: #eef0f1; }
.krImgPh{ display: inline-block; }
.krName{ flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.krName b{ font-size: 13px; font-weight: 800; line-height: 1.25; }
.krName small{ color: var(--muted); font-size: 11px; font-weight: 700; }
.krPrice{ font-weight: 900; font-size: 14px; white-space: nowrap; }
.krMiss .krName b, .krMiss .krName{ color: var(--muted); }
.krNoMatch{ font-size: 11px; font-weight: 800; color: #b45309; }
.krUnmatched{ padding: 10px 14px; border-top: 1px solid var(--line); }
.krFoot{ padding: 10px 14px; border-top: 1px solid var(--line); background: #faf9f6; }
.krModality{ display: flex; align-items: center; gap: 10px; padding: 12px 14px 0; border-top: 1px solid var(--line); }
.krModality + .krActions{ border-top: 0; }
.krModLabel{ font-size: 12.5px; font-weight: 800; color: var(--muted); }
.krModSeg{ display: inline-flex; background: #ece9e3; border-radius: 999px; padding: 3px; }
.krMod{ appearance: none; border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 800; color: var(--muted); background: transparent; padding: 6px 16px; border-radius: 999px; transition: all .15s ease; }
.krMod.on{ background: #fff; color: var(--brand); box-shadow: 0 1px 4px rgba(29,39,51,.12); }
.krActions{ display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); background: #faf9f6; }
.krBtn{ flex: 1; }
.krLink{ appearance: none; background: none; border: 0; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 800; color: var(--muted); text-decoration: underline; }
.krCartMsg{ padding: 0 14px 12px; }
.krCartMsg:empty{ display: none; }
.krCartMsg a{ color: var(--brand); font-weight: 800; }

/* ---- Pantry ---- */
.slHeadBtns{ display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.slPantryBtn{
  appearance: none; cursor: pointer;
  border: 1.5px solid var(--card-line, rgba(29,39,51,.14)); background: var(--card,#fff); color: #1d2733;
  font-size: 13px; font-weight: 800; padding: 9px 14px; border-radius: 999px;
}
.pantryOverlay{
  position: fixed; inset: 0; z-index: 65; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(17,24,39,.45); opacity: 0; transition: opacity .18s ease;
  overscroll-behavior: contain;
}
.pantryOverlay.open{ opacity: 1; }
/* Lock the page behind any open sheet so mobile touch-drags don't scroll it. */
body:has(.pantryOverlay.open), body:has(.dpOverlay.open), body:has(.favOverlay.open){ overflow: hidden; }
.pantrySheet{
  width: 100%; max-width: 480px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--card,#fff); border-radius: 24px 24px 0 0;
  transform: translateY(16px); transition: transform .2s cubic-bezier(.22,.7,.3,1);
}
.pantryOverlay.open .pantrySheet{ transform: none; }
/* Only the body scrolls; grip/head/progress/footer stay pinned. */
.pantrySheet > *:not(.pantryBody){ flex: 0 0 auto; }
@media (min-width:540px){ .pantryOverlay{ align-items:center; } .pantrySheet{ border-radius:24px; } }
.pantryGrip{ width: 38px; height: 4px; border-radius: 99px; background: #d8d4cc; margin: 10px auto 4px; }
.pantryHead{ display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 8px 20px 12px; border-bottom: 1px solid var(--card-line, rgba(29,39,51,.07)); }
.pantryTitle{ font-family: var(--font-display, Georgia, serif); font-weight: 600; font-size: 22px; color: #1d2733; }
.pantrySub{ margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--ink-soft,#5b6675); }
.pantryClose{ width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; background: #f0eee8; font-size: 22px; line-height: 1; color: #1d2733; flex: 0 0 auto; }
.pantryBody{ flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 16px 20px; display: grid; gap: 18px; }
.pantryGroup{ display: grid; gap: 10px; }
.pantryGroupHead{ font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-soft,#5b6675); }
.pantryChips{ display: flex; flex-wrap: wrap; gap: 8px; }
.pantryChip{
  appearance: none; cursor: pointer; border: 1.5px solid var(--card-line, rgba(29,39,51,.14)); background: #fff; color: #1d2733;
  font-size: 13px; font-weight: 700; padding: 8px 13px; border-radius: 999px; transition: background .12s, color .12s, border-color .12s;
}
.pantryChip.on{ background: linear-gradient(135deg, var(--brand), var(--brand2)); border-color: transparent; color: #fff; }
.pantryChip.on::before{ content: "✓ "; }
.pantryAddRow{ display: flex; gap: 8px; }
.pantryAddInput{ flex: 1; padding: 10px 12px; border: 1.5px solid var(--card-line, rgba(29,39,51,.14)); border-radius: 12px; font-size: 14px; font-weight: 600; }
.pantryPills{ display: flex; flex-wrap: wrap; gap: 8px; }
.pantryPill{ display: inline-flex; align-items: center; gap: 6px; background: rgba(42,166,160,.12); color: var(--brand); font-size: 13px; font-weight: 700; padding: 6px 6px 6px 12px; border-radius: 999px; }
.pantryPillX{ border: 0; background: rgba(42,166,160,.2); color: var(--brand); width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; }
.pantryFoot{ padding: 14px 20px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--card-line, rgba(29,39,51,.07)); }
.pantrySave, .pantryAddBtn{ background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; border: 0; }
.pantrySave{ width: 100%; }

/* ---- pantry WIZARD (stepwise) ---- */
.pantryWiz .pantryBody{ display:block; padding:18px 20px 8px; }
.pantryProg{ height:4px; background:#eceae4; margin:0 20px; border-radius:99px; overflow:hidden; }
.pantryProgFill{ height:100%; width:20%; background:linear-gradient(90deg,var(--brand),var(--brand2)); border-radius:99px; transition:width .28s cubic-bezier(.22,.7,.3,1); }
.pantryStepHead{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.pantryStepName{ font-family:var(--font-display,Georgia,serif); font-weight:600; font-size:20px; color:#1d2733; }
.pantryAll{ appearance:none; border:0; background:rgba(42,166,160,.12); color:var(--brand); font-size:12.5px; font-weight:800; padding:6px 12px; border-radius:999px; cursor:pointer; flex:0 0 auto; }
.pantryHint{ font-size:13px; font-weight:600; color:var(--ink-soft,#5b6675); margin:6px 0 14px; }
.pantryItemGrid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.pantryItem{ appearance:none; cursor:pointer; display:flex; align-items:center; gap:10px; text-align:left;
  border:1.5px solid var(--card-line,rgba(29,39,51,.12)); background:#fff; border-radius:14px; padding:13px 14px;
  transition:border-color .12s, background .12s, transform .08s; }
.pantryItem:active{ transform:scale(.98); }
.pantryItemCheck{ flex:0 0 auto; width:22px; height:22px; border-radius:50%; border:2px solid var(--card-line,rgba(29,39,51,.22));
  display:grid; place-items:center; font-size:12px; color:transparent; transition:.12s; }
.pantryItemLabel{ font-size:14.5px; font-weight:700; color:#1d2733; line-height:1.2; }
.pantryItem.on{ border-color:var(--brand); background:rgba(42,166,160,.08); }
.pantryItem.on .pantryItemCheck{ background:linear-gradient(135deg,var(--brand),var(--brand2)); border-color:transparent; color:#fff; }
.pantryEmpty{ font-size:13px; color:var(--ink-soft,#5b6675); font-style:italic; margin-top:6px; }
.pantryWizFoot{ display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 20px max(14px,env(safe-area-inset-bottom)); border-top:1px solid var(--card-line,rgba(29,39,51,.07)); }
.pantryStepN{ font-size:13px; font-weight:800; color:var(--ink-soft,#5b6675); }
.pantryBack{ appearance:none; border:1.5px solid var(--card-line,rgba(29,39,51,.14)); background:#fff; color:#1d2733;
  font-size:14px; font-weight:800; padding:11px 20px; border-radius:13px; cursor:pointer; }
.pantryNext{ appearance:none; border:0; cursor:pointer; font-size:15px; font-weight:800; color:#fff; padding:12px 26px; border-radius:13px;
  background:linear-gradient(135deg,var(--brand),var(--brand2)); box-shadow:0 8px 18px -10px rgba(31,143,138,.9); }
.pantryNext.isSave{ padding:12px 22px; }
.pantryAddMini{ margin-top:16px; }
.pantryAddMini .pantryAddBtn{ padding:0 16px; border-radius:12px; font-weight:800; font-size:14px; cursor:pointer; }
.pantryWiz .pantryPills{ margin-top:10px; }

/* ---- plan setup bar (replaces inline config) ---- */
.wpSetupBar{ margin: 14px 0 6px; }
.wpPlanCta{ width:100%; appearance:none; border:0; cursor:pointer; display:flex; align-items:center; justify-content:space-between;
  gap:12px; text-align:left; padding:16px 18px; border-radius:16px; color:#fff;
  background:linear-gradient(135deg,var(--brand),var(--brand2)); box-shadow:0 12px 26px -14px rgba(31,143,138,.9); }
.wpPlanCta b{ font-size:16px; font-weight:850; display:block; }
.wpPlanCta small{ display:block; opacity:.9; font-size:12.5px; font-weight:600; margin-top:2px; }
.wpPlanCtaArrow{ font-size:22px; font-weight:800; flex:0 0 auto; }
.wpSetupSummary{ font-size:12.5px; font-weight:700; color:var(--ink-soft,#5b6675); }
.wpSetupBtns{ display:flex; gap:8px; margin-top:10px; }
.wpSetupEdit{ appearance:none; cursor:pointer; border:1.5px solid var(--card-line,rgba(29,39,51,.14)); background:#fff; color:#1d2733;
  font-size:13.5px; font-weight:800; padding:9px 16px; border-radius:12px; }
.wpSetupGen{ appearance:none; cursor:pointer; border:0; color:#fff; font-size:13.5px; font-weight:800; padding:9px 18px; border-radius:12px;
  background:linear-gradient(135deg,var(--brand),var(--brand2)); box-shadow:0 8px 16px -10px rgba(31,143,138,.9); }
.wpSetupGen:disabled{ opacity:.55; cursor:default; }

/* ---- plan wizard extras (reuses .pantry* wizard shell) ---- */
.pwToggle{ width:100%; appearance:none; cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:14px;
  text-align:left; border:1.5px solid var(--card-line,rgba(29,39,51,.12)); background:#fff; border-radius:16px; padding:15px 16px; }
.pwToggle.on{ border-color:var(--brand); background:rgba(42,166,160,.07); }
.pwToggleText b{ font-size:15px; font-weight:800; color:#1d2733; }
.pwToggleText small{ display:block; font-size:12.5px; color:var(--ink-soft,#5b6675); margin-top:3px; line-height:1.35; }
.pwSwitch{ flex:0 0 auto; width:46px; height:28px; border-radius:99px; background:#dcd8d0; position:relative; transition:background .15s; }
.pwToggle.on .pwSwitch{ background:linear-gradient(135deg,var(--brand),var(--brand2)); }
.pwKnob{ position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:left .16s cubic-bezier(.4,0,.2,1); }
.pwToggle.on .pwKnob{ left:21px; }
.pwQuick{ display:flex; gap:8px; margin-bottom:14px; }
.pwChipSm{ appearance:none; cursor:pointer; border:1.5px solid var(--card-line,rgba(29,39,51,.14)); background:#fff; color:#1d2733;
  font-size:12.5px; font-weight:800; padding:7px 14px; border-radius:999px; }
.pwDayGrid{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.pwDay{ appearance:none; cursor:pointer; border:1.5px solid var(--card-line,rgba(29,39,51,.14)); background:#fff; color:#1d2733;
  font-size:14px; font-weight:800; padding:14px 0; border-radius:13px; transition:.12s; }
.pwDay.on{ border-color:transparent; color:#fff; background:linear-gradient(135deg,var(--brand),var(--brand2)); }
.pwReady{ background:#faf8f3; border-radius:16px; padding:6px 16px; margin:4px 0 14px; }
.pwReadyRow{ display:flex; align-items:center; justify-content:space-between; padding:12px 0; border-bottom:1px solid rgba(29,39,51,.06); }
.pwReadyRow:last-child{ border-bottom:0; }
.pwReadyRow span{ color:var(--ink-soft,#5b6675); font-weight:700; font-size:13.5px; }
.pwReadyRow b{ color:#1d2733; font-weight:800; font-size:14px; }
.pwErr{ color:#c15b5b; font-size:13px; font-weight:700; margin-top:12px; min-height:1em; }
.pwToggleList{ display:grid; gap:10px; }
.pwCuisineGrid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.pwCuisine{ appearance:none; cursor:pointer; border:1.5px solid var(--card-line,rgba(29,39,51,.14)); background:#fff; color:#1d2733;
  font-size:13.5px; font-weight:800; padding:13px 6px; border-radius:12px; transition:.12s; }
.pwCuisine.on{ border-color:transparent; color:#fff; background:linear-gradient(135deg,var(--brand),var(--brand2)); }
/* snack tiles: varied emoji instead of one shared photo */
.wpThumbSnack{ background:linear-gradient(135deg,#f4efe6,#e9e3d7)!important; }
.wpThumbSnack img{ display:none; }
.wpSnackEmoji{ position:absolute; inset:0; display:grid; place-items:center; font-size:26px; }
/* snack SVG placeholder tiles */
.wpThumbSnack .wpSnackIcon{ position:absolute; inset:0; display:grid; place-items:center; color:var(--ink-soft,#8a8577); }
.wpSnackIcon svg{ width:30px; height:30px; }

/* ---- shopping: checkout button + wizard ---- */
.slCheckoutBtn{ width:100%; display:flex; align-items:center; gap:14px; text-align:left; cursor:pointer; border:0; border-radius:18px;
  padding:18px 20px; color:#fff; background:linear-gradient(135deg,var(--brand),var(--brand2)); box-shadow:0 14px 30px -14px rgba(31,143,138,.9); margin-top:4px; }
.slCheckoutBtn:active{ transform:scale(.99); }
.slCheckoutIcon{ font-size:24px; flex:0 0 auto; }
.slCheckoutMain{ flex:1; display:flex; flex-direction:column; min-width:0; }
.slCheckoutMain b{ font-size:17px; font-weight:850; }
.slCheckoutMain small{ font-size:12.5px; opacity:.92; font-weight:600; margin-top:2px; }
.slCheckoutArrow{ font-size:22px; font-weight:800; flex:0 0 auto; }
.coGroup{ margin-top:14px; }
.coGroupHead{ font-size:11px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-soft,#5b6675); margin-bottom:4px; }
.coRow{ display:flex; justify-content:space-between; gap:12px; padding:9px 0; border-bottom:1px solid rgba(29,39,51,.06); font-size:14px; font-weight:600; color:#1d2733; }
.coRow:last-child{ border-bottom:0; }
.coQty{ color:var(--ink-soft,#5b6675); font-weight:700; font-size:13px; flex:0 0 auto; }
.coZip{ width:100%; padding:14px 16px; margin-top:4px; border:1.5px solid var(--card-line,rgba(29,39,51,.14)); border-radius:14px; font-size:18px; font-weight:700; letter-spacing:.06em; text-align:center; }
.coErr{ color:#c15b5b; font-size:13px; font-weight:700; margin-top:12px; min-height:1em; }
.coSheet .krResult{ margin:0; }
.coSheet .krCard{ border:0; box-shadow:none; padding:0; }

/* ---- shopping breakdown (read-only) + shop wizard ---- */
.slItemRO{ padding-left: 2px; }
.swItem .pantryItemLabel{ display:flex; flex-direction:column; align-items:flex-start; gap:2px; }
.swQty{ font-weight:600; color:var(--ink-soft,#5b6675); font-size:11px; }
.swOpt{ width:100%; display:flex; align-items:center; gap:14px; text-align:left; cursor:pointer; margin-top:11px;
  border:1.5px solid var(--card-line,rgba(29,39,51,.14)); background:#fff; border-radius:16px; padding:16px; }
.swOpt:active{ transform:scale(.99); }
.swOptIcon{ font-size:24px; flex:0 0 auto; }
.swOptText{ display:flex; flex-direction:column; min-width:0; }
.swOptText b{ font-size:15.5px; font-weight:800; color:#1d2733; }
.swOptText small{ font-size:12.5px; color:var(--ink-soft,#5b6675); margin-top:2px; }
.swOptPrimary{ border-color:transparent; background:linear-gradient(135deg,var(--brand),var(--brand2)); box-shadow:0 10px 22px -12px rgba(31,143,138,.9); }
.swOptPrimary .swOptText b{ color:#fff; }
.swOptPrimary .swOptText small{ color:#fff; opacity:.9; }
.swSubHead{ font-size:11px; font-weight:800; letter-spacing:.05em; text-transform:uppercase; color:var(--ink-soft,#5b6675); margin:14px 0 8px; }
.swSubHead:first-child{ margin-top:4px; }

/* ---- shop wizard: item rows + "I have it" (pantry) ---- */
.swList{ display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.swRow{ display:flex; align-items:stretch; gap:8px; }
.swRow .swItem{ flex:1; display:flex; align-items:center; gap:10px; text-align:left; cursor:pointer; min-width:0;
  border:1.5px solid var(--card-line,rgba(29,39,51,.12)); background:#fff; border-radius:13px; padding:12px 14px; transition:.12s; }
.swItem .pantryItemCheck{ flex:0 0 auto; width:22px; height:22px; border-radius:50%; border:2px solid var(--card-line,rgba(29,39,51,.22)); display:grid; place-items:center; font-size:12px; color:transparent; transition:.12s; }
.swItem.on{ border-color:var(--brand); background:rgba(42,166,160,.08); }
.swItem.on .pantryItemCheck{ background:linear-gradient(135deg,var(--brand),var(--brand2)); border-color:transparent; color:#fff; }
.swRowLabel{ display:flex; flex-direction:column; gap:1px; min-width:0; font-size:14.5px; font-weight:700; color:#1d2733; }
.swRowLabel .swQty{ font-weight:600; color:var(--ink-soft,#5b6675); font-size:11.5px; }
.swHave{ flex:0 0 auto; appearance:none; cursor:pointer; border:1.5px solid var(--card-line,rgba(29,39,51,.14)); background:#fff;
  color:var(--ink-soft,#5b6675); font-size:12px; font-weight:800; padding:0 12px; border-radius:13px; white-space:nowrap; }
.swHave.on{ border-color:transparent; background:rgba(224,164,88,.18); color:#a9711f; }
.swRow.isHave .swItem{ opacity:.5; }
.swPantryNote{ margin-top:18px; padding:14px 16px; border-radius:14px; background:rgba(224,164,88,.10); border:1px solid rgba(224,164,88,.25); }
.swPantryHead{ font-size:13px; font-weight:800; color:#8a5a1a; }
.swPantryHead small{ font-weight:600; color:var(--ink-soft,#5b6675); }
.swPantryTags{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.swPantryTag{ font-size:12px; font-weight:700; color:#8a5a1a; background:rgba(224,164,88,.2); border-radius:999px; padding:4px 10px; }
.swPantryHint{ font-size:11.5px; color:var(--ink-soft,#5b6675); margin-top:8px; }

/* estimated added-sugar readout */
.wpSugar{ color:#c98a1e; font-weight:800; }
.wpSugar.hi{ color:#c15b5b; }
.mmSugar{ color:#c98a1e; }
.mmSugarNote{ font-size:11px; color:var(--muted,#6b7280); margin-top:6px; font-style:italic; }

/* swap-meal button in the recipe modal */
.mealSwapBtn{ width:100%; margin:4px 0 12px; appearance:none; cursor:pointer; border:1.5px solid rgba(42,166,160,.35);
  background:rgba(42,166,160,.08); color:var(--brand); font-weight:800; font-size:14px; padding:11px; border-radius:13px; }
.mealSwapBtn:active{ transform:scale(.99); }
.mealSwapBtn:disabled{ opacity:.6; cursor:default; }

/* ---- meal plan: horizontal photo tiles per day ---- */
/* minmax(0,1fr) + min-width:0 cap the columns so the horizontal tile scroller
   scrolls INSIDE the card instead of blowing the width out off-screen. */
.wpDays{ gap: 22px !important; grid-template-columns: minmax(0, 1fr); }
.wpDay{ border: 0 !important; border-radius: 0 !important; overflow: visible !important; background: none; min-width: 0; }
.wpDayPending{ opacity: .6; }
.wpDayHead2{ display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.wpDayHead2 .wpDayName{ font-size: 16px; font-weight: 900; color: var(--ink,#1d2733); }
.wpDayHead2 .wpDayTotals{ font-size: 12px; font-weight: 700; color: var(--muted,#6b7280); white-space: nowrap; }

.wpTiles{ display: flex; gap: 12px; min-width: 0; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.wpTiles::-webkit-scrollbar{ display: none; }
.wpTile{ flex: 0 0 168px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: stretch; text-align: left; cursor: pointer; background: none; border: 0; padding: 0; min-width: 0; }
.wpTile:active{ transform: scale(.98); }
.wpTileThumb{ position: relative; width: 168px; height: 116px; border-radius: 15px; overflow: hidden; background: #eceae4; box-shadow: var(--card-shadow); }
.wpTileThumb img{ width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
/* bottom:auto is critical — the base .wpSlotTag sets bottom:4px, which combined
   with top here would stretch the pill into a tall dark oval. */
.wpTile .wpSlotTag{ position: absolute; top: 8px; left: 8px; bottom: auto; right: auto; height: auto; width: auto; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: rgba(17,24,39,.62); backdrop-filter: blur(2px); padding: 3px 8px; border-radius: 999px; }
.wpTileTitle{ font-size: 13px; font-weight: 800; color: var(--ink,#1d2733); margin-top: 9px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wpTileMacros{ font-size: 11px; font-weight: 700; color: var(--muted,#6b7280); margin-top: 3px; }
.wpTileMacros b{ color: var(--ink,#1d2733); }
.wpTileSkel{ flex: 0 0 168px; height: 116px; border-radius: 15px; background: linear-gradient(90deg,#eceae4,#f4f2eb,#eceae4); background-size: 200% 100%; animation: wpShimmer 1.2s infinite; }
@keyframes wpShimmer{ 0%{ background-position: 200% 0; } 100%{ background-position: -200% 0; } }
.wpSetupAvoid{ font-size: 12px; font-weight: 650; color: var(--muted,#6b7280); margin: 4px 0 2px; }
/* Leftover ("cook once, eat twice") slot tag — greenish to distinguish from the slot pill. */
.wpTile .wpSlotLeftover{ background: rgba(46,156,107,.86); }
