/* ==========================================================================
   SmartCart — vanilla CSS
   Aesthetic: high-contrast cream canvas, deep navy type, mustard-yellow
   selection states, coral-orange illustration panels, sage-green accents.
   ========================================================================== */

:root {
  /* core palette (navy + gold + coral + green on cream neutrals) */
  --navy: #0f2440;
  --navy-700: #29405f;
  --gold: #f2b129;
  --gold-bright: #ffc94a;
  --gold-tint: #fdeec4;
  --coral: #e8755c;
  --coral-tint: #fbded6;
  --green: #4f8b58;
  --green-tint: #dfeada;
  --sage: #dde7d8;

  /* neutrals */
  --cream: #faf4ea;
  --cream-2: #f3ece0;
  --card: #fffdf8;
  --ink-muted: #6d7a8a;
  --line: rgba(15, 36, 64, 0.12);
  --line-soft: rgba(15, 36, 64, 0.07);

  --shadow-sm: 0 6px 16px rgba(15, 36, 64, 0.06);
  --shadow-md: 0 16px 34px rgba(15, 36, 64, 0.1);

  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;
  --pad: clamp(18px, 5.5vw, 26px);
}

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

html {
  background: var(--sage);
  color: var(--navy);
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { margin: 0; min-height: 100vh; }

button, input, select, textarea { color: inherit; font: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: inherit; }

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#app-container {
  position: relative;
  width: min(100%, 430px);
  min-height: 100dvh;
  margin-inline: auto;
  overflow-x: hidden;
  background: var(--cream);
}

.view { display: block; min-height: 100dvh; }
.hidden { display: none !important; }

.view--pad {
  padding: max(20px, env(safe-area-inset-top)) var(--pad)
    max(140px, calc(env(safe-area-inset-bottom) + 120px));
}

.view--cream { background: var(--cream); }
.view--sage { background: var(--sage); }

/* ==========================================================================
   SHARED PRIMITIVE — must stay global
   `.field-input` is reused by the wizard's allergy input on the Home screen,
   so it is intentionally NOT scoped to the auth views.
   ========================================================================== */

.field-input {
  position: relative; /* anchors .password-eye on the sign-in field */
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
}

.field-input:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }

.field-input input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}

.field-input input::placeholder { color: #9aa4b0; }

/* ==========================================================================
   LANDING / SIGN IN / SIGN UP  — merged from teammate's auth branch
   --------------------------------------------------------------------------
   SCOPING CONTRACT: every rule in this section is prefixed with
   `#view-landing` or `.auth-page` (a class that exists only on #view-signin
   and #view-signup). Nothing here can reach the Home, Matches, Recipe,
   Grocery, Saved or Account screens. The teammate's global `.btn-primary`,
   `.btn-secondary`, `.match-badge`, `.tag-chip`, `.wizard-pill` and
   `.tip-card` rules were deliberately NOT imported — the auth-specific
   button look is applied through scoped overrides instead.
   ========================================================================== */

/* ---------- Landing ---------- */

#view-landing {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--sage);
}

#view-landing .landing-scene { position: relative; min-height: 100dvh; overflow: hidden; }

#view-landing .landing-brand {
  position: absolute;
  z-index: 3;
  top: max(48px, calc(env(safe-area-inset-top) + 28px));
  left: 29px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

#view-landing .landing-brand__logo { width: 48px; height: 48px; object-fit: contain; }

#view-landing .landing-copy {
  position: absolute;
  z-index: 3;
  top: max(128px, calc(env(safe-area-inset-top) + 108px));
  left: 25px;
}

#view-landing .display-title {
  margin: 0;
  color: var(--navy);
  font-size: clamp(42px, 11.2vw, 49px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 800;
}

#view-landing .display-title .dot { color: var(--gold); }

#view-landing .auth-subtitle {
  margin: 13px 0 0;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.28;
  font-weight: 500;
}

#view-landing .landing-coral {
  position: absolute;
  z-index: 1;
  top: 34%;
  left: 18%;
  width: 128%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--coral);
}

#view-landing .landing-bear {
  position: absolute;
  z-index: 2;
  top: 34%;
  left: 3%;
  width: 108%;
  height: auto;
  object-fit: contain;
  object-position: bottom left;
  bottom: 0;
}

#view-landing .landing-actions {
  position: absolute;
  z-index: 5;
  right: 21px;
  bottom: max(36px, calc(env(safe-area-inset-bottom) + 20px));
  left: 21px;
  padding: 24px 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 23px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}

/* auth-only button treatment — scoped so global buttons stay untouched */
#view-landing .btn-primary {
  min-height: 52px;
  border-radius: 999px;
}

#view-landing .landing-login {
  display: block;
  width: 100%;
  padding: 16px 12px 2px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

@media (max-height: 690px) {
  #view-landing .landing-brand { top: max(28px, calc(env(safe-area-inset-top) + 16px)); }
  #view-landing .landing-copy { top: max(101px, calc(env(safe-area-inset-top) + 78px)); }
  #view-landing .landing-coral { top: 32%; }
  #view-landing .landing-bear { top: 36%; width: 102%; }
  #view-landing .landing-actions { bottom: max(18px, env(safe-area-inset-bottom)); }
}

/* ---------- Sign in / Sign up shell ---------- */

.auth-page {
  position: relative;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--sage);
}

.auth-page__hero {
  position: relative;
  height: clamp(320px, 36vh, 390px);
  overflow: visible;
}

.auth-page--signup .auth-page__hero {
  height: clamp(347px, calc(46vh - 18px), 477px);
}

.auth-page .auth-back {
  position: absolute;
  z-index: 6;
  top: max(35px, calc(env(safe-area-inset-top) + 18px));
  left: 23px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  margin: 0;
  color: var(--navy);
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
}

.auth-page .auth-brand {
  position: absolute;
  z-index: 5;
  top: max(88px, calc(env(safe-area-inset-top) + 66px));
  left: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

#view-signin .auth-brand {
  top: max(69px, calc(env(safe-area-inset-top) + 47px));
  left: 27px;
}

.auth-page .auth-brand__logo { width: 55px; height: 55px; object-fit: contain; }

.auth-page__copy {
  position: absolute;
  z-index: 5;
  top: 202px;
  left: 28px;
}

#view-signin .auth-page__copy { top: 162px; }
.auth-page--signup .auth-page__copy { top: 184px; }

.auth-page__copy h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(42px, 11vw, 50px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.auth-page__copy h1 span { color: var(--gold); }

.auth-page__copy p {
  margin: 14px 0 0;
  color: var(--navy);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
}

.auth-page__coral {
  position: absolute;
  z-index: 1;
  top: 155px;
  right: -65px;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  background: var(--coral);
}

.auth-page--signup .auth-page__coral {
  top: 196px;
  right: -28px;
  width: 258px;
  height: 258px;
}

.auth-page__bear {
  position: absolute;
  z-index: 3;
  top: 180px;
  right: -20px;
  width: 225px;
  height: auto;
}

/* ---------- Auth sheet ---------- */

.auth-page .auth-sheet {
  position: relative;
  z-index: 7;
  margin-top: 0;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 253, 248, 0.97);
  box-shadow: var(--shadow-md);
}

.auth-sheet--signin {
  margin-right: 24px;
  margin-left: 24px;
  padding: 28px 24px 30px;
  border-radius: 24px;
}

.auth-sheet--signup {
  margin-right: 16px;
  margin-left: 16px;
  padding: 28px 24px 32px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

/* ---------- Auth form fields ---------- */

.auth-page .field { display: grid; gap: 7px; margin-bottom: 14px; }

.auth-page .field__label {
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
}

.auth-page .field-input {
  min-height: 58px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.3);
}

.auth-page .field-input input { font-size: 15px; }
.auth-page .field-input input::placeholder { color: #9298a2; }

/* keep typed text clear of the eye glyph */
.auth-page .field-input:has(.password-eye) input { padding-right: 34px; }

.auth-page .password-eye {
  position: absolute;
  right: 16px;
  width: 20px;
  height: 14px;
  border: 2px solid var(--navy);
  border-radius: 70% 15%;
  transform: rotate(45deg);
}

.auth-page .password-eye::after {
  position: absolute;
  top: 3px;
  left: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--navy);
  content: "";
}

.auth-page .forgot-password {
  display: block;
  width: auto;
  margin: -4px 2px 22px auto;
  padding: 0;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Auth buttons / switch ---------- */

.auth-page .btn-primary {
  min-height: 58px;
  border-radius: 999px;
  font-size: 17px;
}

.auth-page .auth-switch {
  margin: 26px 0 0;
  color: var(--navy-700);
  font-size: 14px;
  text-align: center;
}

/* navy (not gold/blue) for accessible contrast on the cream sheet */
.auth-page .auth-switch button {
  color: var(--navy);
  font-weight: 800;
  text-decoration: underline;
}

.auth-switch--outside {
  position: relative;
  z-index: 8;
  margin: 26px 20px 34px;
  color: var(--navy-700);
  font-size: 14px;
  text-align: center;
}

.auth-switch--outside button {
  color: var(--navy);
  font-weight: 800;
  text-decoration: underline;
}

/* ---------- Auth error banner ---------- */

#view-landing .error-text,
.auth-page .error-text {
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--coral-tint);
  color: #8f3524;
  font-size: 13px;
  font-weight: 600;
}

@media (max-height: 760px) {
  .auth-page__hero { height: 320px; }
  .auth-page--signup .auth-page__hero { height: 347px; }
  .auth-page__copy { top: 152px; }
  #view-signin .auth-page__copy { top: 142px; }
  .auth-page--signup .auth-page__coral { top: 167px; }
  .auth-page__bear { top: 178px; }
  .auth-sheet--signup { padding-top: 24px; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary, .btn-secondary {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--navy);
  color: var(--cream);
  box-shadow: 0 12px 24px rgba(15, 36, 64, 0.22);
}

.btn-primary:hover { background: #14304f; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--navy);
}

#view-landing .btn-primary {
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 12px 22px rgba(242, 177, 41, 0.35);
}

:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 2px; }

/* ==========================================================================
   Top bars
   ========================================================================== */

.topbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  margin-bottom: 18px;
}

.topbar--tall { align-items: start; margin-bottom: 20px; }

.topbar__back {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}
.topbar__back svg { width: 20px; height: 20px; }

.topbar__title {
  grid-column: 2;
  margin: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.topbar__title--big { font-size: 26px; letter-spacing: -0.035em; }

.topbar__sub { margin: 4px 0 0; text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-muted); }

.topbar__step { font-size: 13px; font-weight: 700; color: var(--ink-muted); text-align: right; }

.cart-pill {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--coral);
  color: var(--cream);
}
.cart-pill svg { width: 20px; height: 20px; }

/* ==========================================================================
   Page 1 — Home / filters
   ========================================================================== */

.page-title {
  margin: 2px 0 8px;
  font-size: clamp(32px, 9vw, 40px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
  text-wrap: balance;
}

.page-lead { margin: 0 0 26px; font-size: 15px; line-height: 1.5; color: var(--ink-muted); }

.group-label { margin: 0 0 10px; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }

.pill-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 8px;
  margin-bottom: 26px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.wizard-pill {
  display: grid;
  gap: 5px;
  min-height: 54px;
  align-content: center;
  justify-items: center;
  padding: 8px 4px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  color: var(--navy-700);
}

.wizard-pill__icon { width: 17px; height: 17px; }

.wizard-pill.is-active {
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 6px 14px rgba(242, 177, 41, 0.32);
}

.diet-row .wizard-pill { font-size: 10.5px; }

.budget-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  margin-bottom: 26px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.budget-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 78px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--cream-2);
}

.budget-field:focus-within { border-color: var(--line); background: var(--cream-2); }

.budget-field__sign { font-size: 30px; font-weight: 800; }

.budget-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-align: center;
  line-height: 1;
}

.budget-field__unit { flex-shrink: 0; font-size: 14px; font-weight: 700; color: var(--ink-muted); }

.budget-basis-select {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  border: 2px solid #d9dcdf;
  border-radius: 999px;
  background: #fffdfa;
  color: var(--navy);
  box-shadow: none;
}

.budget-basis-select select {
  min-width: 112px;
  padding: 10px 32px 10px 13px;
  border: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.budget-basis-select svg {
  position: absolute;
  right: 10px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.budget-basis-select:focus-within {
  border-color: #c5c9cd;
  box-shadow: 0 0 0 2px rgba(16, 39, 68, 0.08);
}

.budget-card__hint { margin: 0; font-size: 13px; color: var(--ink-muted); }

.allergy-input-wrap { margin-bottom: 10px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--gold-tint);
  border: 1.5px solid var(--gold);
  font-size: 13px;
  font-weight: 700;
}

.tag-chip button { font-size: 13px; line-height: 1; color: var(--navy-700); }

.tip-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 104px;
  overflow: visible;
  margin-bottom: 24px;
  padding: 10px 16px 10px 10px;
  border-radius: var(--r-md);
  background: var(--gold-tint);
  border-color: var(--gold);
  border-style: solid;
  border-width: 3px;
}

.tip-card__mark {
  width: 96px;
  height: 104px;
  object-fit: contain;
  border-radius: 14px;
  object-position: bottom;
}

.tip-card p {
	margin: 0;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.3;
	color: var(--navy);
	text-align: center;
}

.loading-note {
	margin: 14px 0 0;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--ink-muted);
}

/* ==========================================================================
   Page 2 — Matches
   ========================================================================== */

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  margin-bottom: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--ink-muted);
}

.search-field__icon { width: 19px; height: 19px; flex-shrink: 0; }

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--navy);
  font-size: 15px;
}

.sort-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.sort-row::-webkit-scrollbar { display: none; }

.sort-chip {
  flex-shrink: 0;
  padding: 11px 18px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

.sort-chip.is-active {
  border-color: transparent;
  background: var(--gold);
  color: var(--navy);
  box-shadow: 0 8px 16px rgba(242, 177, 41, 0.28);
}

.scroll-container { display: grid; gap: 14px; }

.empty-note { margin: 28px 0; text-align: center; font-size: 14px; color: var(--ink-muted); }

.match-card {
  position: relative;
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 14px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.match-card__thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: var(--cream-2);
  font-size: 32px;
  cursor: pointer;
}

.match-card__thumb img { width: 100%; height: 100%; object-fit: cover; }

.match-card__body {
  display: grid;
  align-content: center;
  gap: 7px;
  padding-right: 34px;
  cursor: pointer;
}

.match-card__title { margin: 0; font-size: 17px; line-height: 1.18; font-weight: 800; letter-spacing: -0.02em; }

.match-card__meta-row {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy-700);
}

.match-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  align-self: start;
  justify-self: start;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  font-size: 11.5px;
  font-weight: 800;
}

.btn-heart {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--cream-2);
  font-size: 16px;
}

.btn-heart.is-saved { background: var(--coral-tint); }

/* ==========================================================================
   Page 3 — Recipe
   ========================================================================== */

.recipe-hero {
  position: relative;
  overflow: hidden;
  padding: max(20px, env(safe-area-inset-top)) var(--pad) 26px;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  background: var(--coral);
  color: var(--cream);
}

.recipe-hero__actions {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-btn {
  position: relative;
  z-index: 3;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--cream);
  color: var(--navy);
}
.hero-btn svg { width: 20px; height: 20px; }

.recipe-hero__bear {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  width: 190px;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.recipe-hero__copy { position: relative; z-index: 2; margin-top: 20px; max-width: 58%; }

#recipe-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 800;
  text-wrap: balance;
}

#recipe-meta { margin: 8px 0 0; font-size: 14px; font-weight: 600; opacity: 0.95; }

.match-badge--hero { margin-top: 10px; }

.recipe-hero__thumb {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 16px;
  overflow: hidden;
  width: 104px;
  height: 104px;
  border: 3px solid var(--navy);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: var(--shadow-md);
}

.recipe-hero__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recipe-body {
  padding: 22px var(--pad) max(116px, calc(env(safe-area-inset-bottom) + 96px));
}

.servings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 18px;
  margin-bottom: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  font-weight: 700;
}

.servings-row select {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
}

.section__title { margin: 0 0 4px; font-size: 20px; font-weight: 800; letter-spacing: -0.025em; }

.helper-text { margin: 0 0 12px; font-size: 13px; color: var(--ink-muted); }

#ingredient-checklist { margin-bottom: 18px; }

#ingredient-checklist img {
  width: 100%;
  height: 210px !important;
  object-fit: cover;
  border-radius: var(--r-md) !important;
  margin-bottom: 16px !important;
}

.ingredient-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  cursor: pointer;
}
.ingredient-row:last-child { border-bottom: 0; }

.chk {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  flex-shrink: 0;
  width: 25px;
  height: 25px;
  place-items: center;
  margin: 0;
  border: 2px solid #b3bcc6;
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
}

.chk::after {
  content: "";
  width: 13px;
  height: 13px;
  opacity: 0;
  background: var(--navy);
  clip-path: polygon(9% 45%, 35% 70%, 91% 12%, 100% 21%, 35% 88%, 0 54%);
}

.chk:checked { border-color: transparent; background: var(--gold); }
.chk:checked::after { opacity: 1; }

.ingredient-row__name { flex: 1; font-weight: 600; }
.ingredient-row__quantity {
  min-width: 28px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.ingredient-row__price { font-weight: 800; }

.cart-summary {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  margin-bottom: 18px;
  border-radius: var(--r-md);
  background: var(--green-tint);
}

.cart-summary__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--green);
  color: var(--cream);
}
.cart-summary__icon svg { width: 22px; height: 22px; }

.cart-summary__text { flex: 1; }
.cart-summary__have { margin: 0 0 8px; font-size: 14px; font-weight: 800; }

.cart-summary__cost-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.cart-summary__label { margin: 0; font-size: 12.5px; color: #4a5c48; }
.cart-summary__amount { flex-shrink: 0; font-size: 15px; font-weight: 800; }

.instructions-card {
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.instructions-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  font-size: 16px;
  font-weight: 800;
}

.caret { font-size: 18px; color: var(--ink-muted); }

.instructions-body { margin: 0; padding: 0 18px 18px; font-size: 14px; line-height: 1.55; color: var(--navy-700); }

.hero-btn--heart {
  font-size: 19px;
  line-height: 1;
}

/* ==========================================================================
   Page 4 — Grocery list
   ========================================================================== */

.grocery-budget-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 96px;
  grid-template-areas:
    "label bear"
    "amount bear"
    "bar bar";
  align-items: start;
  column-gap: 10px;
  overflow: hidden;
  padding: 18px;
  margin-bottom: 22px;
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.grocery-budget-card__label {
  grid-area: label;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}

.grocery-budget-card__amount {
  grid-area: amount;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0 14px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.grocery-budget-card__amount > span:last-child { font-size: 14px; font-weight: 700; color: var(--ink-muted); letter-spacing: 0; }

.progress {
  grid-area: bar;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--cream-2);
}

.progress__value {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 220ms ease, background-color 220ms ease;
}

.progress__value.is-warning { background: #e89a2f; }
.progress__value.is-over-budget { background: #d94b45; }

.grocery-budget-card__mark {
  grid-area: bear;
  width: 96px;
  height: 84px;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 16px;
  align-self: center;
  justify-self: end;
}

.category-section { margin-bottom: 20px; }

.category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.category-title__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 15px;
}

.grocery-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.grocery-row:last-child { border-bottom: 0; }

.grocery-row__name { font-size: 14px; font-weight: 700; line-height: 1.25; }
.grocery-row__price { font-size: 14px; font-weight: 800; min-width: 52px; text-align: right; }

.grocery-row__actions { display: flex; align-items: center; gap: 4px; white-space: nowrap; }

.grocery-row__delete {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 14px;
}
.grocery-row__delete:hover { background: var(--coral-tint); }

.qty-stepper {
  display: grid;
  grid-template-columns: 28px 24px 28px;
  align-items: center;
  min-height: 32px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}
.qty-stepper button { font-size: 15px; font-weight: 700; }

#grocery-items:empty::after {
  content: "Your grocery list is empty. Add ingredients from a recipe!";
  display: block;
  padding: 34px 0;
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
}

.order-summary {
  padding: 18px;
  margin: 18px 0 0;
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.order-summary__row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-700);
}

.order-summary__row--total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 21px;
  font-weight: 800;
  color: var(--navy);
}

.settings-card {
  position: relative;
  display: grid;
  gap: 12px;
  overflow: hidden;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.settings-card__head { padding-right: 104px; }

.settings-card__title { margin: 0; font-size: 16px; font-weight: 800; }

.settings-card__hint { margin: 4px 0 0; font-size: 13px; color: var(--ink-muted); }

.settings-card__saved { margin: 0; font-size: 13px; font-weight: 700; color: var(--green); }

/* .settings-card__mark {
  position: absolute;
  top: 12px;
  right: 10px;
  width: 96px;
  height: auto;
} */

.settings-card .budget-field { min-height: 66px; }
.settings-card .budget-field input { font-size: 34px; }

/* ==========================================================================
   Saved / Account / toast
   ========================================================================== */

.account-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  margin-bottom: 18px;
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gold-tint);
}
.account-avatar svg { width: 26px; height: 26px; }

.account-email { margin: 0; font-weight: 800; word-break: break-all; }
.account-sub { margin: 3px 0 0; font-size: 13px; color: var(--ink-muted); }

.btn-secondary--block { margin-top: 4px; }

#toast-confirm {
  position: fixed;
  left: 50%;
  bottom: 112px;
  z-index: 30;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Bottom nav
   ========================================================================== */

#bottom-nav {
  position: fixed;
  z-index: 10;
  right: max(0px, calc((100vw - 430px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 430px) / 2));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(16px);
}

.nav-item {
  display: grid;
  min-height: 58px;
  place-items: center;
  gap: 3px;
  border-radius: 16px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 700;
}

.nav-item__icon { display: grid; place-items: center; }
.nav-item__icon svg { width: 21px; height: 21px; }

.nav-item.active { background: var(--gold-tint); color: var(--navy); font-weight: 800; }

@media (prefers-reduced-motion: no-preference) {
  button, .wizard-pill, .sort-chip, .match-card {
    transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, color 160ms ease;
  }
  button:active, .wizard-pill:active, .sort-chip:active { transform: scale(0.97); }
}

.view.hidden {
  display: none !important;
}

.view:not(.hidden) {
  animation: smoothFadeIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes smoothFadeIn {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.store-field {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--cream-2);
  margin-bottom: 12px;
}
.store-field select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}