/* =========================================================
   snaprigo — design system
   Clean & minimal: near-white canvas, one confident green,
   crisp line icons (no emoji chrome), neutral grotesk type.
   ========================================================= */
:root {
  --bg:        #F7F8F6;
  --bg-dk:     #EAECE6; /* a touch darker than --bg — for cards that float over the app rather than sit flush with it */
  --surface:   #FFFFFF;
  --green:     #15724B;
  --green-lt:  #2A8F62;
  --green-soft:#EAF1EC;
  --green-deep:#0E4831;
  --ink:       #16201B;
  --muted:     #6A7771;
  --line:      #E7EBE7;

  /* One accent: green. Kept as variables so older rules resolve. */
  --accent:    #15724B;
  --accent-dk: #0E4831;

  --radius:    20px;
  --radius-sm: 14px;
  --shadow:    0 10px 30px rgba(20, 36, 28, 0.07);
  --shadow-sm: 0 3px 12px rgba(20, 36, 28, 0.05);
  --shadow-lg: 0 -16px 50px rgba(20, 36, 28, 0.16);

  /* One clean, neutral grotesk for the whole product. Headlines just
     use the heavier weights — no separate "display" face needed. */
  --font-display: 'Hanken Grotesk', system-ui, sans-serif;
  --font-body:    'Hanken Grotesk', system-ui, sans-serif;

  --appbar-h: 60px;
  --tabbar-h: 62px; /* bottom nav height (excl. safe-area inset) */
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bg); font-family: var(--font-body); color: var(--ink); -webkit-font-smoothing: antialiased; }

.app {
  position: relative;
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  overflow-x: hidden;
}

/* Shared: every inline icon is a stroked line SVG that inherits color. */
svg { display: block; }

/* ============ TOP APP BAR ============ */
.appbar {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--appbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(247, 248, 246, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(231, 235, 231, 0.8);
}
/* Brand: optional logo mark + wordmark, pinned to the left. Doubles as
   a home button (see data-tab="home" in index.html) — same look, just
   clickable, so tapping the wordmark also takes you home. */
.brand {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
/* logo.png is cropped tight to the mark, so its height maps 1:1 to the
   visible size — 26px reads the same height as the 21px/800 wordmark. */
.brand-logo { height: 26px; width: auto; display: block; }
.wordmark {
  font-family: var(--font-display); font-weight: 800; font-size: 21px;
  letter-spacing: -0.02em; color: var(--green);
}
/* Profile: pinned to the right, avatar closest to the edge. */
.profile-btn {
  display: flex; align-items: center; gap: 9px;
  background: none; border: none; cursor: pointer; padding: 4px;
  font-family: var(--font-body); color: var(--ink);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
  box-shadow: var(--shadow-sm);
}
.avatar svg { width: 18px; height: 18px; }
.avatar.guest { background: var(--surface); color: var(--green-lt); border: 1.5px solid var(--line); }
.profile-label { font-size: 14px; font-weight: 700; }

/* ============ SCREEN / PAGES ============ */
.screen { padding: 0 20px calc(104px + env(safe-area-inset-bottom)); }
.page { display: none; padding-top: 18px; animation: rise .35s ease; }
.page.is-active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.page-head { margin-bottom: 18px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--green-lt); margin-bottom: 7px; }
.page-title { font-family: var(--font-display); font-weight: 800; font-size: 33px; line-height: 1.06; letter-spacing: -0.025em; }

/* Info (i) button — sits right next to a page's eyebrow label, opens the
   PAGE_INFO sheet for that page (see app.js). Home has no eyebrow row and
   is intentionally excluded. */
.page-head-top { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.page-head-top .eyebrow { margin-bottom: 0; }
.page-info-btn {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 18px; height: 18px; padding: 0; border: none; background: none;
  color: var(--green-lt); opacity: .8; cursor: pointer;
}
.page-info-btn svg { width: 15px; height: 15px; }
.page-info-btn:active { transform: scale(.85); opacity: 1; }
.hint { color: var(--muted); font-size: 15px; line-height: 1.5; margin-bottom: 18px; }

/* ============ HOME — HERO ============ */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius); padding: 26px 24px 24px;
  background: linear-gradient(158deg, #1B8157 0%, #15724B 58%, #0E4831 100%);
  color: #fff; box-shadow: var(--shadow); margin-bottom: 22px;
}
.hero-greeting { font-size: 14px; font-weight: 600; opacity: .85; margin-bottom: 8px; }
.hero-title { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.1; letter-spacing: -0.025em; margin-bottom: 20px; }
.hero-cta { width: auto; min-width: 188px; background: #fff; color: var(--green); box-shadow: 0 6px 18px rgba(14, 72, 49, .25); }
.hero-cta:hover { background: #fff; filter: brightness(.98); }

/* ============ STAT CARDS ============ */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-bottom: 28px; }
.stat {
  background: var(--surface); border-radius: var(--radius-sm); padding: 15px 13px;
  box-shadow: var(--shadow-sm); text-align: left; border: 1px solid var(--line);
}
.stat-ico { color: var(--green-lt); }
.stat-ico svg { width: 20px; height: 20px; }
.stat-num { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1.1; margin-top: 8px; letter-spacing: -0.01em; }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 1px; }

/* ============ SECTIONS ============ */
.section { margin-bottom: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.015em; }
.link { background: none; border: none; cursor: pointer; color: var(--green-lt); font-family: var(--font-body); font-weight: 700; font-size: 14px; }
.link:active { opacity: .6; }

/* Horizontal recipe rail */
.recipe-rail {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.recipe-rail::-webkit-scrollbar { display: none; }
.rail-card {
  flex: 0 0 150px; scroll-snap-align: start; cursor: pointer;
  background: var(--surface); border-radius: var(--radius-sm); padding: 14px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
}
.rail-card:active { transform: scale(.97); }
.rail-emoji { width: 100%; height: 72px; border-radius: 12px; background: var(--green-soft); display: grid; place-items: center; margin-bottom: 11px; }
.rail-name { font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.2; letter-spacing: -0.01em; }
.rail-meta { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* Recipe thumbnails: real food photo, clipped to the rounded tile.
   If a photo fails to load it falls back to the dish emoji (.thumb-fallback). */
.rail-emoji, .recipe-emoji, .rd-emoji { overflow: hidden; }
.thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-fallback { display: grid; place-items: center; width: 100%; height: 100%; }
.rail-emoji .thumb-fallback { font-size: 34px; }
.recipe-emoji .thumb-fallback { font-size: 27px; }
.rd-emoji .thumb-fallback { font-size: 38px; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; font-size: 16px;
  padding: 16px 20px; border-radius: var(--radius-sm);
  transition: transform .12s ease, filter .15s ease, background .15s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(1.06); }
/* Accent now resolves to the same confident green (one accent). */
.btn-accent { background: var(--green); color: #fff; box-shadow: var(--shadow-sm); }
.btn-accent:hover { filter: brightness(1.06); }
.btn-ghost { display: inline-block; width: 100%; background: none; border: none; cursor: pointer; color: var(--muted); font-family: var(--font-body); font-weight: 600; font-size: 14px; padding: 12px; }
.btn-ghost:hover { color: var(--ink); }

.block-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.015em; display: flex; align-items: center; gap: 8px; margin-bottom: 13px; }
.count { font-family: var(--font-body); font-size: 13px; font-weight: 700; background: var(--green-soft); color: var(--green); padding: 2px 9px; border-radius: 999px; }

/* ============ VIEWFINDER (signature) ============ */
.viewfinder { position: relative; aspect-ratio: 3 / 4; width: 100%; border-radius: var(--radius); overflow: hidden; background: #0E1A14; box-shadow: var(--shadow); margin-bottom: 16px; }
.viewfinder-video { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .5s ease; }
.viewfinder.has-camera .viewfinder-video { opacity: 1; }
.viewfinder-permission { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 26px; gap: 8px; background: radial-gradient(120% 90% at 50% 0%, #15724B 0%, #0E3A28 70%, #0A1812 100%); color: #fff; }
.viewfinder.has-camera .viewfinder-permission, .viewfinder.sampled .viewfinder-permission { display: none; }
.permission-icon { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px; background: rgba(255,255,255,.12); color: #fff; }
.permission-icon svg { width: 32px; height: 32px; }
.viewfinder-permission h2 { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.viewfinder-permission p { font-size: 14px; line-height: 1.5; color: rgba(255,255,255,.82); max-width: 260px; margin-bottom: 8px; }
.viewfinder-permission .btn { width: auto; min-width: 200px; background: #fff; color: var(--green); }
.viewfinder.sampled { background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.12), transparent 45%), linear-gradient(160deg, #1B8157, #0E4831); }
.viewfinder.sampled::after { content: "Sample fridge"; position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; font-size: 14px; font-weight: 600; letter-spacing: .04em; color: rgba(255,255,255,.55); }
.viewfinder-frame { position: absolute; inset: 14px; z-index: 4; pointer-events: none; }
.bracket { position: absolute; width: 30px; height: 30px; border: 3px solid rgba(255,255,255,.9); }
.bracket.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.bracket.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.bracket.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.bracket.br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.scan-line { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent, #5BE49B, transparent); box-shadow: 0 0 18px 4px rgba(91,228,155,.6); opacity: 0; }
.viewfinder.scanning .scan-line { opacity: 1; animation: sweep 1.4s ease-in-out infinite; }
@keyframes sweep { 0% { top: 4%; } 50% { top: 96%; } 100% { top: 4%; } }
.viewfinder-status { position: absolute; left: 0; right: 0; bottom: 16px; z-index: 5; text-align: center; color: #fff; font-size: 14px; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.5); pointer-events: none; }
.btn-scan { margin-bottom: 22px; }
.scan-dot { width: 10px; height: 10px; border-radius: 50%; background: #5BE49B; box-shadow: 0 0 0 0 rgba(91,228,155,.7); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(91,228,155,.6); } 70% { box-shadow: 0 0 0 8px rgba(91,228,155,0); } 100% { box-shadow: 0 0 0 0 rgba(91,228,155,0); } }

/* ============ CHIPS / RECIPES ============ */
.results { animation: rise .4s ease; }
.results-block { margin-bottom: 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 600; padding: 9px 14px; border-radius: 999px; animation: pop .3s ease both; }
.chip .emoji { font-size: 15px; }
@keyframes pop { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1); } }
.chips-toggle .chip { cursor: pointer; transition: all .15s ease; }
.chips-toggle .chip.on { background: var(--green); border-color: var(--green); color: #fff; }

/* Grouped taste categories on the Tastes page */
.taste-group { margin-bottom: 20px; }
.taste-group-title { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--green-lt); margin-bottom: 11px; }

.recipe-list { display: flex; flex-direction: column; gap: 12px; }
.recipe { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); animation: rise .35s ease both; cursor: pointer; }
.recipe:active { transform: scale(.99); }
.recipe-emoji { flex: 0 0 54px; height: 54px; border-radius: 14px; background: var(--green-soft); display: grid; place-items: center; }
.recipe-info { flex: 1; min-width: 0; }
.recipe-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.recipe-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.recipe-meta .ready { color: var(--green-lt); font-weight: 700; }
.recipe-add { flex: 0 0 auto; border: none; cursor: pointer; width: 38px; height: 38px; border-radius: 11px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; transition: all .15s ease; }
.recipe-add svg { width: 18px; height: 18px; }
.recipe-add:hover { background: var(--green); color: #fff; }
.recipe-add:active { transform: scale(.9); }
/* "Added to plan" state — filled green with a check. */
.recipe-add.added { background: var(--green); color: #fff; }

/* ============ PLAN ============ */
.meal-picker { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.meal-card { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer; transition: all .15s ease; }
.meal-card.on { border-color: var(--green); background: var(--green-soft); }
.meal-card .meal-emoji { font-size: 22px; }
.meal-card .meal-name { flex: 1; font-weight: 600; font-size: 15px; }
.meal-card .meal-check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; transition: all .15s ease; }
.meal-card .meal-check svg { width: 13px; height: 13px; opacity: 0; }
.meal-card.on .meal-check { background: var(--green); border-color: var(--green); }
.meal-card.on .meal-check svg { opacity: 1; }
.grocery { margin-top: 22px; animation: rise .4s ease; }
.grocery-head { display: flex; align-items: center; justify-content: space-between; }
.grocery-head .btn-ghost { width: auto; padding: 6px 4px; }
.aisle { margin-bottom: 16px; }
.aisle-name { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--green-lt); margin-bottom: 8px; }
.grocery-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 12px; padding: 12px 14px; margin-bottom: 7px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.grocery-check { width: 22px; height: 22px; border-radius: 7px; flex: 0 0 auto; border: 2px solid var(--line); cursor: pointer; display: grid; place-items: center; color: #fff; transition: all .15s ease; }
.grocery-check svg { width: 12px; height: 12px; opacity: 0; }
.grocery-check.checked { background: var(--green); border-color: var(--green); }
.grocery-check.checked svg { opacity: 1; }
/* Same card language as the Plan summary's .purchase-row (emoji + name +
   sub-line + a value on the side), just mirrored: there the sub-line is
   the quantity and the side is the price; here the sub-line is the est.
   price and the side is the quantity, since the quantity is what you're
   actually shopping for. */
.grocery-emoji { font-size: 20px; flex: 0 0 auto; }
.grocery-info { flex: 1; min-width: 0; }
.grocery-item.done .grocery-name { text-decoration: line-through; color: var(--muted); }
.grocery-name { font-weight: 700; font-size: 15px; }
.grocery-sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.grocery-qty { color: var(--muted); font-size: 14px; font-weight: 600; flex: 0 0 auto; }

/* ============ FRIDGE ============ */
.fridge-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 12px; padding: 10px 12px; margin-bottom: 7px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.fridge-emoji { font-size: 20px; flex: 0 0 auto; }
.fridge-info { flex: 1; min-width: 0; }
.fridge-name { font-weight: 600; font-size: 15px; }
.fridge-expiry { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.fridge-expiry.soon { color: #A8791C; }
.fridge-expiry.expired { color: #B84B42; }
.fridge-del { border: none; cursor: pointer; background: none; color: var(--muted); flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.fridge-del:hover { background: var(--green-soft); color: var(--green); }
.fridge-del svg { width: 14px; height: 14px; }

/* ============ BOTTOM TAB BAR ============ */
.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 440px; z-index: 25; display: flex; justify-content: space-around; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.tab { flex: 1; background: none; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-family: var(--font-body); font-weight: 600; padding: 4px; transition: color .15s ease; }
.tab-ico { display: grid; place-items: center; }
.tab-ico svg { width: 22px; height: 22px; }
.tab-label { font-size: 11px; letter-spacing: .02em; }
.tab.is-active { color: var(--green); }
.tab.is-active .tab-ico { transform: translateY(-1px); }

/* ============ OVERLAYS: backdrop + bottom sheets ============ */
/* Backdrop + sheets stop above the tab bar: the bottom nav is always
   visible and tappable (switching tabs dismisses any open sheet). */
.backdrop { position: fixed; inset: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 40; background: rgba(12, 22, 17, .45); backdrop-filter: blur(2px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: 100%; max-width: 440px; z-index: 41;
  background: var(--bg); border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg); animation: slideUp .3s cubic-bezier(.2,.8,.2,1);
  max-height: calc(92dvh - var(--tabbar-h)); overflow: hidden;
  display: flex; flex-direction: column;
}
/* `display: flex` above overrides the browser's built-in [hidden] rule
   (author styles win over the UA stylesheet regardless of specificity),
   so without this the sheet stays visible — an empty box stuck on
   screen — even while its `hidden` attribute is set. This restores it. */
.sheet[hidden] { display: none; }
/* Content scrolls in here, independently of the sheet frame, so the X
   (a direct, non-scrolling child of .sheet) always stays reachable. */
.sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 22px 26px; }
@keyframes slideUp { from { transform: translateX(-50%) translateY(100%); } to { transform: translateX(-50%) translateY(0); } }
.sheet-grip { width: 42px; height: 5px; border-radius: 999px; background: var(--line); margin: 4px auto 18px; }
.sheet-x {
  position: absolute; top: 14px; right: 16px; z-index: 1;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: grid; place-items: center; color: var(--muted);
}
.sheet-x svg { width: 15px; height: 15px; }
.sheet-x:active { transform: scale(.92); }

/* Profile sheet */
.profile-card { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar-lg { width: 56px; height: 56px; font-size: 24px; }
.avatar-lg svg { width: 26px; height: 26px; }
.profile-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.profile-sub { color: var(--muted); font-size: 14px; margin-top: 1px; }
.menu-list { list-style: none; margin: 18px 0 8px; }
.menu-row { display: flex; align-items: center; gap: 13px; background: var(--surface); border-radius: 13px; padding: 15px 16px; margin-bottom: 9px; font-weight: 600; font-size: 15px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); cursor: pointer; color: var(--ink); }
.menu-ico { color: var(--green-lt); display: grid; place-items: center; }
.menu-ico svg { width: 19px; height: 19px; }
.menu-row .chev { margin-left: auto; color: var(--muted); display: grid; place-items: center; }
.menu-row .chev svg { width: 18px; height: 18px; }

/* Recipe detail sheet */
.sheet-tall { min-height: 60dvh; }
.rd-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.rd-emoji { width: 72px; height: 72px; border-radius: 18px; background: var(--green-soft); display: grid; place-items: center; flex: 0 0 auto; }
.rd-title { font-family: var(--font-display); font-weight: 800; font-size: 23px; line-height: 1.12; letter-spacing: -0.02em; }
.rd-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.rd-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--green); background: var(--green-soft); padding: 5px 11px; border-radius: 999px; }
.rd-tag svg { width: 13px; height: 13px; }
.rd-section-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; margin: 22px 0 12px; }
.rd-ing { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rd-ing:last-child { border-bottom: none; }
.rd-ing-dot { width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; }
.rd-ing-dot svg { width: 11px; height: 11px; }
.rd-ing-dot.have { background: var(--green); color: #fff; }
.rd-ing-dot.need { background: #fff; border: 1.5px solid var(--line); color: var(--muted); }
.rd-ing-name { flex: 1; font-weight: 600; font-size: 15px; }
.rd-ing-name .need-tag { font-size: 11px; font-weight: 700; color: var(--muted); margin-left: 7px; }
.rd-ing-qty { color: var(--muted); font-size: 14px; font-weight: 600; }
.rd-step { display: flex; gap: 13px; margin-bottom: 15px; }
.rd-step-num { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 14px; display: grid; place-items: center; }
.rd-step-text { flex: 1; font-size: 15px; line-height: 1.5; padding-top: 3px; }
.rd-actions { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; }
.rd-actions .btn svg { width: 16px; height: 16px; }

/* ============ TOAST ============ */
.toast { position: fixed; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(10px); background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; padding: 11px 18px; border-radius: 999px; z-index: 50; opacity: 0; transition: opacity .25s ease, transform .25s ease; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ VALUE METRICS (Home) ============ */
.stats { grid-template-columns: 1.4fr 1fr; }
.stat-hero { background: linear-gradient(158deg, #1B8157 0%, #15724B 58%, #0E4831 100%); border: none; color: #fff; }
.stat-hero .stat-ico { color: rgba(255,255,255,.85); }
.stat-hero .stat-num { font-size: 28px; }
.stat-hero .stat-label { color: rgba(255,255,255,.75); }

/* Stat cards are tappable buttons now (money / meals / grocery sheets). */
button.stat { font-family: var(--font-body); cursor: pointer; text-align: left; transition: transform .12s ease; }
button.stat:active { transform: scale(.97); }
.stat-wide { grid-column: 1 / -1; display: flex; align-items: center; gap: 13px; padding: 15px 16px; }
.stat-wide .stat-ico { color: var(--green); }
.stat-wide .stat-ico svg { width: 22px; height: 22px; }
.stat-wide-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.stat-wide-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.stat-wide .stat-label { margin-top: 0; }
.stat-wide .chev { color: var(--muted); display: grid; place-items: center; transform: rotate(0); }
.stat-wide .chev svg { width: 16px; height: 16px; }

/* ============ TRACKING SHEETS (money + meals rescued) ============ */
.track-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-btn { border: none; cursor: pointer; background: none; font-family: var(--font-body); font-weight: 700; font-size: 13px; color: var(--muted); padding: 6px 14px; border-radius: 999px; transition: all .15s ease; }
.seg-btn.on { background: var(--green); color: #fff; }
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.period-arrow { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 20px; font-weight: 700; color: var(--green); box-shadow: var(--shadow-sm); display: grid; place-items: center; padding-bottom: 2px; }
.period-arrow:active { transform: scale(.92); }
.period-label { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.track-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 6px; }
.track-cell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow-sm); }
.track-cell.good { background: var(--green-soft); border-color: transparent; }
.track-num { font-family: var(--font-display); font-weight: 800; font-size: 23px; letter-spacing: -0.01em; }
.track-cell.good .track-num { color: var(--green); }

.receipt-form { display: grid; grid-template-columns: 1fr 84px auto; gap: 8px; }
.receipt-form input {
  width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface);
  font-family: var(--font-body); font-size: 15px; font-weight: 600; color: var(--ink);
  outline: none; box-shadow: var(--shadow-sm);
}
.receipt-form input:focus { border-color: var(--green-lt); }
.receipt-form .btn { width: auto; padding: 13px 18px; }

.purchase-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 7px; box-shadow: var(--shadow-sm); }
.purchase-emoji { font-size: 20px; }
.purchase-info { flex: 1; min-width: 0; }
.purchase-name { font-weight: 700; font-size: 15px; }
.purchase-sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.purchase-amt { font-weight: 700; font-size: 15px; color: var(--ink); }
.purchase-amt.good { color: var(--green); }

/* Weekly-list meal cards get a secondary "You have x/y" line. */
.meal-sub { display: block; font-size: 12.5px; font-weight: 600; color: var(--green-lt); margin-top: 2px; }

/* "overview" affordance chip at the end of the Home preview rows */
.chip-more { border-style: dashed; color: var(--green-lt); background: none; gap: 4px; }
.chip-more svg { width: 14px; height: 14px; }

/* ============ WEEKLY PLANNER (Plan tab) ============ */
.page-plan { padding-bottom: 78px; } /* room for the sticky summary bar */
.day-row { display: flex; gap: 7px; margin-bottom: 14px; }
.day-pill {
  flex: 1; min-width: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 9px 2px; font-family: var(--font-body); transition: all .15s ease;
}
.day-pill .day-name { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.day-pill .day-num { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--ink); }
.day-pill.today { border-color: var(--green-lt); }
.day-pill.today .day-name { color: var(--green-lt); }
.day-pill.on { background: var(--green); border-color: var(--green); }
.day-pill.on .day-name, .day-pill.on .day-num { color: #fff; }
.day-pill:active { transform: scale(.95); }

.plan-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 18px; font-weight: 600; font-size: 14.5px;
  box-shadow: var(--shadow-sm);
}
.switch { position: relative; width: 46px; height: 27px; flex: 0 0 auto; border: none; cursor: pointer; border-radius: 999px; background: var(--line); transition: background .2s ease; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left .2s ease; }
.switch.on { background: var(--green); }
.switch.on .knob { left: 22px; }

.slot { margin-bottom: 18px; }
.slot-label { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--green-lt); margin-bottom: 8px; }
.slot-add {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 17px; cursor: pointer; border: 1.5px dashed var(--line); border-radius: var(--radius-sm);
  background: none; color: var(--muted); font-family: var(--font-body); font-weight: 600; font-size: 15px;
  transition: all .15s ease;
}
.slot-add:hover { color: var(--green); border-color: var(--green-lt); }
.slot-add svg { width: 16px; height: 16px; }
.slot-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.slot-btn { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--green-soft); cursor: pointer; font-size: 13px; display: grid; place-items: center; }
.slot-btn:active { transform: scale(.9); }

/* Sticky week summary bar — floats just above the bottom nav */
.plan-summary {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px);
  width: calc(100% - 32px); max-width: 408px; z-index: 24;
  display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap;
  background: var(--ink); color: #fff; border: none; border-radius: 999px;
  padding: 13px 18px; cursor: pointer; box-shadow: var(--shadow);
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
}
.plan-summary:active { transform: translateX(-50%) scale(.98); }
.plan-summary .dot { opacity: .45; }
.plan-summary .cost { color: #5BE49B; font-weight: 800; }

/* ============ GROCERY TAB ============ */
.money-header {
  width: 100%; display: flex; align-items: center; gap: 11px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); padding: 14px 16px; margin-bottom: 18px;
  font-family: var(--font-body); font-size: 15px; font-weight: 600; color: var(--ink); text-align: left;
}
.money-header > svg { width: 20px; height: 20px; color: var(--green); flex: 0 0 auto; }
.money-header-text { flex: 1; }
.money-header-text strong { font-family: var(--font-display); font-weight: 800; }
.money-header .chev { color: var(--muted); display: grid; place-items: center; }
.money-header .chev svg { width: 16px; height: 16px; }
.money-header:active { transform: scale(.98); }

/* ============ USE IT SOON (Home) ============ */
.chip-soon { border-color: #F1D9A7; background: #FDF6E7; }
.use-soon-list { margin-top: 14px; }

/* ============ SCAN: editable inventory ============ */
.scans-left { text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; margin: -12px 0 20px; min-height: 16px; }
.chip-edit { padding-right: 8px; }
.chip-x { border: none; cursor: pointer; margin-left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.chip-x:hover { background: var(--green); color: #fff; }
.add-ing { position: relative; margin: 14px 0; }
.add-ing input {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface);
  font-family: var(--font-body); font-size: 15px; font-weight: 600; color: var(--ink);
  outline: none; box-shadow: var(--shadow-sm);
}
.add-ing input:focus { border-color: var(--green-lt); }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 10;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); overflow: hidden;
}
.suggestion { display: flex; align-items: center; gap: 9px; width: 100%; border: none; cursor: pointer; background: none; padding: 12px 16px; font-family: var(--font-body); font-size: 15px; font-weight: 600; color: var(--ink); text-align: left; }
.suggestion:hover { background: var(--green-soft); }
.suggestion.none { color: var(--muted); cursor: default; }

/* ============ ONBOARDING QUIZ + PAYWALL ============ */
.quiz { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; }
.quiz-inner { max-width: 440px; min-height: 100dvh; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.quiz-brand { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; color: var(--green); margin-bottom: 26px; }
.quiz-hero { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px 0; }
.quiz-q { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.12; letter-spacing: -0.025em; margin-bottom: 12px; }
.quiz-progress { display: flex; gap: 6px; margin-bottom: 10px; }
.qdot { flex: 1; height: 4px; border-radius: 999px; background: var(--line); transition: background .2s ease; }
.qdot.on { background: var(--green); }
.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.quiz-opt {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 16px 18px; font-family: var(--font-body); font-weight: 600; font-size: 16px; color: var(--ink);
  box-shadow: var(--shadow-sm); transition: all .15s ease;
}
.quiz-opt:active { transform: scale(.98); }
.quiz-opt.on { border-color: var(--green); background: var(--green-soft); color: var(--green-deep); }
.quiz-result { text-align: center; align-items: center; }
.quiz-amount { font-family: var(--font-display); font-weight: 800; font-size: 64px; letter-spacing: -0.03em; color: var(--green); line-height: 1; margin: 14px 0 16px; }
.quiz-amount .per { font-size: 20px; color: var(--muted); font-weight: 700; margin-left: 4px; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 16px; }
.plan-card {
  position: relative; cursor: pointer; text-align: left;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 16px 15px; font-family: var(--font-body); transition: all .15s ease;
  display: flex; flex-direction: column; gap: 5px;
}
.plan-card.on { border-color: var(--green); background: var(--green-soft); }
.plan-badge { position: absolute; top: -10px; right: 12px; background: var(--green); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.plan-name { font-size: 13px; font-weight: 700; color: var(--muted); }
.plan-price { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; color: var(--ink); }
.plan-price .per { font-size: 13px; color: var(--muted); font-weight: 700; }
.quiz-fineprint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 12px; }
.quiz-fineprint a { color: var(--green); font-weight: 700; text-decoration: underline; text-decoration-color: var(--line); }
.quiz-fineprint a:hover { text-decoration-color: var(--green); }

/* Sign-up: OAuth placeholder buttons (UI-only — no backend configured yet) */
.oauth-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.btn-oauth {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; cursor: pointer; border-radius: var(--radius-sm);
  padding: 14px 18px; font-family: var(--font-body); font-weight: 700; font-size: 15px;
  transition: transform .12s ease, filter .15s ease;
}
.btn-oauth:active { transform: scale(.98); }
.btn-oauth-google { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); box-shadow: var(--shadow-sm); }
.btn-oauth-google:hover { background: var(--green-soft); }
.btn-oauth-apple { background: #000; color: #fff; border: none; }
.btn-oauth-apple:hover { filter: brightness(1.15); }
.oauth-ico { flex: 0 0 auto; display: block; }
.oauth-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.oauth-divider::before, .oauth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Paywall: "Have a gift code?" link + slide-in side panel */
.gift-link { margin-top: 14px; }
.side-backdrop {
  position: fixed; inset: 0; z-index: 64; background: rgba(12, 22, 17, .45);
  opacity: 0; transition: opacity .25s ease;
}
.side-backdrop.show { opacity: 1; }
.side-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 65;
  width: min(86vw, 380px); background: var(--bg);
  padding: calc(20px + env(safe-area-inset-top)) 22px 26px;
  box-shadow: -16px 0 40px rgba(20, 36, 28, 0.18);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column; gap: 14px;
}
/* Same [hidden]-vs-`display` fix as .sheet above. */
.side-panel[hidden] { display: none; }
.side-panel.open { transform: translateX(0); }
.side-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.side-panel-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.015em; }
.side-panel-head .sheet-x { position: static; }

/* Paywall: personalized projected-savings banner above the plan cards */
.savings-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--green-soft); color: var(--green-deep); border-radius: var(--radius-sm);
  padding: 13px 15px; font-size: 13.5px; font-weight: 600; line-height: 1.4; margin-bottom: 16px;
}
.savings-ico { flex: 0 0 auto; color: var(--green); display: grid; place-items: center; }
.savings-ico svg { width: 20px; height: 20px; }

/* Sign-up / welcome-back forms (inside the quiz flow) */
.quiz-form-hero { flex: 0 0 auto; padding-bottom: 8px; }
.quiz-form { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 8px 0 20px; }
.quiz-field { display: flex; flex-direction: column; gap: 6px; }
.quiz-field > span { font-size: 13px; font-weight: 700; color: var(--muted); }
.quiz-field input {
  width: 100%; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; font-family: var(--font-body); font-weight: 600; font-size: 16px; color: var(--ink);
  box-shadow: var(--shadow-sm); outline: none; transition: border-color .15s ease;
}
.quiz-field input:focus { border-color: var(--green-lt); }
.quiz-field input.invalid { border-color: #C4574A; }
.field-error { font-size: 13px; font-weight: 600; color: #C4574A; }

/* Notifications sheet */
.notif-row { align-items: center; }
.notif-info { display: flex; flex-direction: column; gap: 3px; padding-right: 12px; }
.notif-msg { background: var(--green-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 4px; }
.switch:disabled { opacity: .45; cursor: not-allowed; }

/* About snaprigo sheet */
.about-copy { font-size: 14.5px; line-height: 1.6; color: var(--ink); margin-bottom: 12px; }
.about-copy p + p { margin-top: 10px; }
.about-founder { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.about-mail { color: var(--green); font-weight: 700; text-decoration: none; }
.about-mail:hover { text-decoration: underline; }
.about-version { text-align: center; color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 18px; }

/* Page info sheet: numbered "how to use it" steps + plain bullet lists */
.page-info-list { list-style: none; margin: 0 0 20px; counter-reset: pinfo; }
.page-info-list li { display: flex; gap: 13px; margin-bottom: 14px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.page-info-list li:last-child { margin-bottom: 0; }
.page-info-list.ordered li { counter-increment: pinfo; }
.page-info-list.ordered li::before {
  content: counter(pinfo); flex: 0 0 26px; height: 26px; border-radius: 50%;
  background: var(--green); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 13px;
  display: grid; place-items: center;
}
.page-info-list.unordered li::before {
  content: ''; flex: 0 0 7px; width: 7px; height: 7px; margin-top: 8px;
  border-radius: 50%; background: var(--green-lt);
}

/* Log out (profile sheet) */
.logout-btn { color: #C4574A; }
.logout-btn:hover { color: #A83E32; }

/* ============ LANDING (new visitors, before the quiz) ============ */
.landing { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; }
.landing-inner { max-width: 440px; min-height: 100dvh; margin: 0 auto; padding: calc(22px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.landing-inner .quiz-brand { text-align: center; margin-bottom: 6px; }

/* Hero visual: a floating phone-frame mockup of the real scan screen. */
.landing-mock { position: relative; display: flex; justify-content: center; padding: 22px 0 10px; }
.landing-mock-glow {
  position: absolute; top: -10%; left: 50%; transform: translateX(-50%);
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(21,114,75,.22) 0%, rgba(21,114,75,0) 70%);
  z-index: 0;
}
.phone-frame {
  position: relative; z-index: 1; width: 190px; aspect-ratio: 9 / 18.5;
  background: #0E1A14; border-radius: 30px; padding: 8px;
  box-shadow: 0 24px 46px rgba(20, 36, 28, 0.28), 0 4px 10px rgba(20, 36, 28, 0.12);
  transform: rotate(-4deg);
}
.phone-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 46px; height: 14px; border-radius: 999px; background: #0E1A14; z-index: 2; }
.phone-screen {
  position: relative; width: 100%; height: 100%; border-radius: 23px; overflow: hidden;
  background: var(--bg); display: flex; flex-direction: column; gap: 8px; padding: 20px 9px 9px;
}
.mock-viewfinder {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #1B8157 0%, #0E3A28 70%, #0A1812 100%);
  display: grid; place-items: center; color: rgba(255,255,255,.85);
}
.mock-viewfinder .bracket { width: 14px; height: 14px; border-width: 2px; }
.mock-viewfinder .bracket.tl { top: 5px; left: 5px; }
.mock-viewfinder .bracket.tr { top: 5px; right: 5px; }
.mock-viewfinder .bracket.bl { bottom: 5px; left: 5px; }
.mock-viewfinder .bracket.br { bottom: 5px; right: 5px; }
.mock-viewfinder .mock-cam { width: 22px; height: 22px; }
.mock-scan-line { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, #5BE49B, transparent); box-shadow: 0 0 10px 2px rgba(91,228,155,.6); animation: sweep 1.8s ease-in-out infinite; }
.mock-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.mock-chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; font-size: 8px; font-weight: 700; color: var(--ink); box-shadow: var(--shadow-sm); }
.mock-recipe { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 6px 7px; box-shadow: var(--shadow-sm); }
.mock-recipe-thumb { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; background: var(--green-soft); display: grid; place-items: center; font-size: 11px; }
.mock-recipe-lines { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.mock-recipe-lines span { display: block; height: 4px; border-radius: 999px; background: var(--line); }
.mock-recipe-lines span:first-child { width: 78%; background: var(--muted); opacity: .5; }
.mock-recipe-lines span:last-child { width: 46%; }

.landing-hero { padding: 20px 0 6px; }
.landing-hero .page-title { text-align: center; }
.landing-hero .eyebrow { text-align: center; }

.landing-features { list-style: none; margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.feature-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.feature-ico {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px;
  background: linear-gradient(158deg, #1B8157 0%, #0E4831 100%);
  color: #fff; display: grid; place-items: center; box-shadow: 0 6px 14px rgba(14, 72, 49, .22);
}
.feature-ico svg { width: 21px; height: 21px; }
.feature-copy { display: flex; flex-direction: column; gap: 2px; }
.feature-title { font-weight: 700; font-size: 15px; letter-spacing: -0.005em; }
.feature-sub { font-size: 12.5px; color: var(--muted); font-weight: 500; }

.landing-cta { font-size: 17px; padding: 18px 20px; margin-top: 24px; }
.landing-footer { display: flex; justify-content: center; gap: 20px; margin-top: auto; padding-top: 28px; }
.landing-footer a { color: var(--muted); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.landing-footer a:hover { color: var(--green); text-decoration: underline; }

/* ============ WEEKLY RECAP + STREAK (Home) ============ */
.streak-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft); color: var(--green-deep); font-weight: 700; font-size: 13.5px; padding: 8px 14px; border-radius: 999px; margin-bottom: 14px; }
.recap-card {
  position: relative; overflow: hidden; cursor: pointer; width: 100%; text-align: left;
  border: none; border-radius: var(--radius); padding: 20px 22px;
  background: linear-gradient(158deg, #1B8157 0%, #15724B 58%, #0E4831 100%);
  color: #fff; box-shadow: var(--shadow); margin-bottom: 22px;
  font-family: var(--font-body); animation: rise .35s ease;
}
.recap-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.7); margin-bottom: 10px; }
.recap-stats { display: flex; gap: 18px; }
.recap-cell .recap-num { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -0.02em; line-height: 1.05; }
.recap-cell .recap-label { font-size: 11.5px; font-weight: 600; color: rgba(255,255,255,.75); margin-top: 2px; }
.recap-x { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border: none; border-radius: 50%; cursor: pointer; background: rgba(255,255,255,.16); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.recap-x:hover { background: rgba(255,255,255,.3); }

/* ============ INSTALL HINT (PWA, one-time) ============ */
.install-hint { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 22px; box-shadow: var(--shadow-sm); animation: rise .35s ease; }
.install-hint img { width: 36px; height: 36px; border-radius: 9px; }
.install-hint-text { flex: 1; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.install-hint-text .sub { color: var(--muted); font-weight: 600; font-size: 12px; }
.install-hint .btn { width: auto; padding: 9px 15px; font-size: 13.5px; border-radius: 11px; }
.install-hint .chip-x { margin: 0; }

/* ============ LEFTOVER MODE ============ */
.leftover-btn {
  width: 100%; display: flex; align-items: center; gap: 13px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); padding: 15px 16px; margin: -14px 0 28px;
  font-family: var(--font-body); color: var(--ink); text-align: left; transition: transform .12s ease;
}
.leftover-btn:active { transform: scale(.98); }
.leftover-btn .stat-ico { color: var(--green); }
.leftover-btn .stat-ico svg { width: 22px; height: 22px; }
.leftover-btn .chev { color: var(--muted); display: grid; place-items: center; }
.leftover-btn .chev svg { width: 16px; height: 16px; }
.leftover-link { margin: -8px 0 18px; }
.leftover-count { font-size: 13px; font-weight: 700; color: var(--green-lt); margin: 10px 0 6px; }

/* ============ RECIPE FEEDBACK (thumbs) ============ */
.card-thumbs { display: flex; flex-direction: column; gap: 5px; flex: 0 0 auto; }
.thumb-btn { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; font-size: 12px; display: grid; place-items: center; padding: 0; transition: all .15s ease; filter: grayscale(1); opacity: .55; }
.thumb-btn.on { filter: none; opacity: 1; background: var(--green-soft); border-color: var(--green); }
.thumb-btn:active { transform: scale(.88); }
.rd-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.rd-thumbs .thumb-btn { width: 36px; height: 36px; font-size: 16px; border-radius: 11px; }

/* ============ SERVING STEPPER (recipe detail) ============ */
.serving-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; margin-top: 18px; box-shadow: var(--shadow-sm); font-weight: 600; font-size: 14.5px; }
.stepper { display: inline-flex; align-items: center; gap: 12px; }
.stepper-btn { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 10px; background: var(--green-soft); color: var(--green); cursor: pointer; font-size: 18px; font-weight: 800; display: grid; place-items: center; padding-bottom: 2px; }
.stepper-btn:disabled { opacity: .35; cursor: default; }
.stepper-btn:active:not(:disabled) { transform: scale(.9); }
.stepper-num { font-family: var(--font-display); font-weight: 800; font-size: 18px; min-width: 20px; text-align: center; }

/* ============ SUBSTITUTIONS (recipe detail) ============ */
.swap-hint { border: none; cursor: pointer; background: var(--green-soft); color: var(--green); font-family: var(--font-body); font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-left: 7px; white-space: nowrap; }
.swap-hint:active { transform: scale(.94); }
.swap-reveal { background: var(--green-soft); border-radius: 12px; padding: 10px 14px; margin: 2px 0 8px 31px; font-size: 13.5px; line-height: 1.5; }
.swap-reveal .swap-opt { display: block; padding: 3px 0; }
.swap-reveal .swap-have { display: inline-block; color: var(--green); font-weight: 800; font-size: 12px; margin-left: 6px; }
.swap-reveal .swap-ratio { color: var(--muted); font-weight: 600; font-size: 12.5px; }

/* ============ HOME FOOTER (recap link + feedback mailto) ============ */
.home-footer { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0 18px; }
.feedback-link { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; border-bottom: 1px dashed var(--line); padding-bottom: 1px; }
.feedback-link:hover { color: var(--ink); }

/* ============ ADD TO HOME SCREEN — shared iOS instructions ============
   Three numbered steps used by both the landing banner's popover and the
   post-paywall modal (js/installPrompts.js). Simplified illustrations,
   not a pixel copy of Apple's real share sheet. */
.ios-steps { display: flex; gap: 10px; margin: 14px 0 4px; }
.ios-step { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.ios-step-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--green); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 12px;
  display: grid; place-items: center; flex: 0 0 auto;
}
.ios-step-text { font-size: 12px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.ios-step-text-only { padding-top: 22px; }

/* Step 1: mini phone silhouette with the Share icon badged where it
   actually sits — bottom-center on iPhone, top-right on iPad. */
.ios-mini-phone {
  position: relative; width: 46px; height: 78px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface);
}
.ios-share-badge {
  position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  width: 24px; height: 24px; border-radius: 50%; background: var(--green);
  color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-sm);
  animation: ios-bounce 1.6s ease-in-out infinite;
}
.ios-share-badge svg { width: 13px; height: 13px; }
.ios-mini-phone.ipad { width: 62px; }
.ios-mini-phone.ipad .ios-share-badge { left: auto; right: -8px; bottom: auto; top: -8px; transform: none; }
@keyframes ios-bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px); } }
.ios-mini-phone.ipad .ios-share-badge { animation-name: ios-bounce-ipad; }
@keyframes ios-bounce-ipad { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Step 2: simplified share-sheet — a couple of plain rows, then the "Add
   to Home Screen" row boxed off exactly like someone circling it. */
.ios-sheet-mock { width: 100%; max-width: 108px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); padding: 6px; display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.ios-sheet-row { display: block; height: 7px; border-radius: 4px; background: var(--line); }
.ios-sheet-row.hl { height: auto; background: none; border: 1.5px solid var(--green); border-radius: 6px; padding: 3px 4px; }
.ios-sheet-hl-box { display: flex; align-items: flex-start; gap: 3px; font-size: 8px; font-weight: 700; line-height: 1.25; color: var(--green-deep); }
.ios-sheet-hl-box svg { width: 9px; height: 9px; flex: 0 0 auto; margin-top: 1px; }

/* ============ PROMPT 1 — slim banner (landing page, pre-quiz) ============ */
.a2hs-banner-wrap { position: sticky; top: 0; z-index: 5; }
.a2hs-banner {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: calc(10px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 10px calc(14px + env(safe-area-inset-left));
  animation: rise .3s ease;
}
.a2hs-banner-tap {
  flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0;
  background: none; border: none; cursor: pointer; text-align: left;
  font-family: var(--font-body); color: var(--ink); padding: 6px;
}
.a2hs-banner-emoji { font-size: 16px; flex: 0 0 auto; }
.a2hs-banner-text { flex: 1; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a2hs-banner-chev { flex: 0 0 auto; color: var(--muted); display: grid; place-items: center; }
.a2hs-banner-chev svg { width: 15px; height: 15px; }
.a2hs-banner-x {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
}
.a2hs-banner-x:hover { background: var(--green); color: #fff; }

/* Compact popover, anchored under the banner — not a full-screen takeover. */
.a2hs-popover {
  position: absolute; left: 16px; right: 16px; top: 100%; margin-top: 8px; z-index: 6;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 16px; animation: rise .2s ease;
}
.a2hs-popover-title { font-family: var(--font-display); font-weight: 700; font-size: 14px; margin-bottom: 2px; }

/* ============ PROMPT 2 — full modal (inside the app, post-paywall) ============ */
/* Centered dialog instead of a bottom sheet: same .sheet/backdrop
   machinery (×, outside-click, Escape all still work), just repositioned
   to the middle of the screen with a pop-in instead of a slide-up, and a
   card background a touch darker than the app's so it reads as its own
   surface floating above the dimmed backdrop. */
.sheet-center {
  left: 50%; right: auto; bottom: auto; top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 40px); max-width: 400px;
  max-height: 86dvh;
  border-radius: var(--radius);
  background: var(--bg-dk);
  animation: popCenter .25s cubic-bezier(.2,.8,.2,1);
}
.sheet-center .sheet-scroll { padding: 46px 22px 26px; } /* extra top clearance — no grip here, so clear the × button by hand */
@keyframes popCenter {
  from { transform: translate(-50%, -50%) scale(.94); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Small phone-home-screen mockup: the real snaprigo icon among generic
   app icons, built entirely from CSS — no stock photo needed. */
.a2hs-mock {
  background: linear-gradient(158deg, #1B8157 0%, #0E4831 100%);
  border-radius: var(--radius-sm); padding: 16px; margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.a2hs-mock-row { display: flex; gap: 12px; justify-content: center; }
.a2hs-mock-icon { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 3px 8px rgba(0,0,0,.18); }
.a2hs-mock-icon-app { background: #fff; padding: 0; overflow: hidden; display: grid; place-items: center; outline: 2px solid rgba(255,255,255,.85); outline-offset: 2px; }
.a2hs-mock-icon-app img { width: 100%; height: 100%; object-fit: cover; display: block; }

.a2hs-modal-title { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -0.015em; margin-bottom: 8px; }
.a2hs-modal-text { font-size: 14.5px; line-height: 1.5; color: var(--ink); margin-bottom: 10px; }
.a2hs-modal-reassure { font-size: 12.5px; line-height: 1.45; color: var(--muted); background: var(--green-soft); border-radius: 11px; padding: 10px 12px; margin-bottom: 18px; }
#a2hs-modal-body .btn-primary { margin-bottom: 6px; font-size: 14.5px; padding: 14px 12px; white-space: nowrap; }
#a2hs-modal-body .ios-steps { margin-bottom: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
