/* Grocy Meals: native-feel mobile web app.
   Shape system: cards and sheets 22px, grouped lists 16px, inputs 12px, every button and chip a full pill.
   One accent (saffron). Veg / non-veg marks follow the Indian food-label convention (green square, brown-red triangle). */
:root {
  --bg: #f2f2f5; --surface: #fcfcfd; --surface-2: #e8e8ed; --surface-3: #dcdce3;
  --text: #17171b; --muted: #62626d; --faint: #8e8e99; --line: #e2e2e8;
  --accent: #c2410c; --accent-ink: #fdfdfd; --accent-soft: #fbe6da;
  --good: #15803d; --good-soft: #dcf3e3; --warn: #a15c07; --warn-soft: #fbefd5; --bad: #b42318; --bad-soft: #fbe3e0;
  --veg: #15803d; --nonveg: #9a3412; --egg: #b7791f;
  --tabbar: rgb(252 252 253 / .82); --scrim: rgb(23 23 27 / .38);
  --shadow-card: 0 1px 1px rgb(23 23 27 / .04), 0 10px 30px -8px rgb(23 23 27 / .16);
  --shadow-float: 0 6px 20px -4px rgb(194 65 12 / .45);
  --ease: cubic-bezier(.16, 1, .3, 1); --spring: cubic-bezier(.34, 1.4, .64, 1);
  --tabbar-h: 64px;
  color-scheme: light;
}
/* Dark tokens apply when the phone is in dark mode (unless the family picked Light in Settings), or when Dark was picked.
   Keep the two blocks below identical. */
:root[data-theme="dark"] {
  --bg: #0e0e11; --surface: #18181c; --surface-2: #232328; --surface-3: #2e2e35;
  --text: #f3f3f6; --muted: #a3a3ad; --faint: #75757f; --line: #2a2a31;
  --accent: #fb923c; --accent-ink: #1c1009; --accent-soft: #3a2114;
  --good: #4ade80; --good-soft: #13291b; --warn: #f5b942; --warn-soft: #33270f; --bad: #f87171; --bad-soft: #351616;
  --veg: #4ade80; --nonveg: #f08a5d; --egg: #f2c14e;
  --tabbar: rgb(24 24 28 / .8); --scrim: rgb(0 0 0 / .55);
  --shadow-card: 0 1px 1px rgb(0 0 0 / .3), 0 12px 32px -8px rgb(0 0 0 / .6);
  --shadow-float: 0 6px 22px -4px rgb(251 146 60 / .35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e11; --surface: #18181c; --surface-2: #232328; --surface-3: #2e2e35;
    --text: #f3f3f6; --muted: #a3a3ad; --faint: #75757f; --line: #2a2a31;
    --accent: #fb923c; --accent-ink: #1c1009; --accent-soft: #3a2114;
    --good: #4ade80; --good-soft: #13291b; --warn: #f5b942; --warn-soft: #33270f; --bad: #f87171; --bad-soft: #351616;
    --veg: #4ade80; --nonveg: #f08a5d; --egg: #f2c14e;
    --tabbar: rgb(24 24 28 / .8); --scrim: rgb(0 0 0 / .55);
    --shadow-card: 0 1px 1px rgb(0 0 0 / .3), 0 12px 32px -8px rgb(0 0 0 / .6);
    --shadow-float: 0 6px 22px -4px rgb(251 146 60 / .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", Roboto, "Noto Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ph, .ph-fill { font-size: 1.25em; vertical-align: -0.18em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  min-height: 48px; padding: 0 22px; font-weight: 600; background: var(--surface-2); color: var(--text); white-space: nowrap;
  transition: transform .15s var(--ease), background-color .2s; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.tinted { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.plain { background: transparent; color: var(--accent); padding: 0 10px; }
.btn.block { width: 100%; }
.btn.sm { min-height: 38px; padding: 0 16px; font-size: 15px; }
.btn:disabled { opacity: .45; }
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input, input.input, select.input, textarea.input { width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); padding: 12px 14px; font-size: 16px; font-weight: 400; color: var(--text); }
textarea.input { resize: vertical; min-height: 90px; }
.input::placeholder { color: var(--faint); }

/* ---------- shell ---------- */
.appbar { position: sticky; top: 0; z-index: 10; height: calc(48px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0;
  display: flex; align-items: center; justify-content: center; background: var(--tabbar);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid transparent; transition: border-color .2s; }
.appbar.scrolled { border-bottom-color: var(--line); }
.themebtn { position: absolute; right: 8px; bottom: 4px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: none;
  color: var(--muted); display: grid; place-items: center; font-size: 22px; transition: transform .3s var(--spring); }
.themebtn:active { transform: scale(.88) rotate(-20deg); }
html.theme-anim, html.theme-anim * { transition: background-color .3s ease, color .3s ease, border-color .3s ease !important; }
.appbar .t { font-weight: 650; font-size: 17px; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .25s var(--ease); }
.appbar.scrolled .t { opacity: 1; transform: none; }
main { max-width: 560px; margin: 0 auto; padding: 0 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
.view { animation: viewIn .32s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.bigtitle { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.bigtitle h1 { font-size: 34px; line-height: 1.05; letter-spacing: -.02em; margin: 0; font-weight: 750; }
.bigtitle p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

.tabbar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--tabbar); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--line); }
.tabbar button { border: 0; background: none; display: grid; justify-items: center; align-content: center; gap: 3px;
  color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .01em; }
.tabbar button i { font-size: 25px; transition: transform .25s var(--spring); }
.tabbar button.on { color: var(--accent); }
.tabbar button.on i { transform: translateY(-1px) scale(1.06); }
.tabbar button:active i { transform: scale(.9); }

/* segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; border-radius: 999px; min-height: 36px; padding: 0 14px; font-size: 14px; font-weight: 600; color: var(--muted);
  transition: background-color .2s, color .2s, box-shadow .2s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }

/* toast */
.toast { position: fixed; z-index: 60; left: 50%; top: calc(10px + env(safe-area-inset-top)); transform: translate(-50%, -140%);
  max-width: calc(100% - 32px); display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgb(0 0 0 / .25);
  transition: transform .45s var(--spring); }
.toast.show { transform: translate(-50%, 0); }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: 100%; max-width: 360px; display: grid; gap: 18px; }
.appicon { width: 76px; height: 76px; border-radius: 22px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 40px; box-shadow: var(--shadow-float); }
.login h1 { margin: 6px 0 0; font-size: 30px; letter-spacing: -.02em; }
.login p { margin: 0; color: var(--muted); }
.err { color: var(--bad); font-size: 14px; min-height: 1.2em; margin: 0; }

/* ---------- menu ---------- */
.bigtitle .seg { flex: none; margin-bottom: 4px; }
.bigtitle .seg button { min-height: 32px; padding: 0 12px; font-size: 13px; }
.mealtabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.mealtab { position: relative; border: 0; background: var(--surface); border-radius: 16px; padding: 10px 4px 9px; display: grid; justify-items: center; gap: 4px;
  font-size: 12px; font-weight: 650; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); transition: transform .15s var(--ease), box-shadow .2s; }
.mealtab i { font-size: 22px; }
.mealtab:active { transform: scale(.96); }
.mealtab.cur { color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.mealtab.done { color: var(--good); background: var(--good-soft); box-shadow: none; }
.mealtab .tick { position: absolute; top: 6px; right: 7px; font-size: 14px; }
.mealtab .n { font-size: 11px; font-weight: 500; color: var(--faint); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.mealtab.done .n { color: inherit; opacity: .8; }

/* sized so the card and the action buttons both fit above the tab bar on a 375x812 phone */
.stackwrap { position: relative; height: max(360px, min(calc(100dvh - 400px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 580px)); margin-bottom: 16px; }
.card { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: var(--surface);
  box-shadow: var(--shadow-card); touch-action: pan-y; user-select: none; -webkit-user-select: none; will-change: transform;
  transform: translate3d(var(--dx, 0px), 0, 0) rotate(var(--rot, 0deg)); }
.card.settle { transition: transform .5s var(--spring); }
.card.leave { transition: transform .38s var(--ease), opacity .38s; opacity: 0; }
.card.back { transform: scale(calc(.94 + .06 * var(--p, 0))) translateY(calc(16px - 16px * var(--p, 0))); opacity: calc(.6 + .4 * var(--p, 0)); pointer-events: none; }
.card.enter { animation: cardIn .45s var(--spring); }
@keyframes cardIn { from { transform: scale(.94) translateY(16px); } }   /* no opacity: the card behind must never show through */
.media { position: relative; flex: 0 0 42%; min-height: 150px; background: var(--surface-2); overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.media.noimg { display: grid; place-items: center; color: var(--faint); font-size: 48px; }
.stamp { position: absolute; top: 16px; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 15px; letter-spacing: .02em; display: flex; gap: 6px; align-items: center; opacity: 0; }
.stamp.yes { left: 16px; background: var(--good); color: #fdfdfd; opacity: var(--yes, 0); }
.stamp.no { right: 16px; background: var(--bad); color: #fdfdfd; opacity: var(--no, 0); }
.cbody { flex: 1; display: flex; flex-direction: column; padding: 16px 18px 14px; min-height: 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.card h2 { font-size: 25px; line-height: 1.12; letter-spacing: -.015em; margin: 8px 0 6px; }
.parts { color: var(--muted); font-size: 15px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.why { margin-top: auto; padding-top: 10px; display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--text); }
.why i { color: var(--accent); }
.cfoot { display: flex; gap: 8px; margin-top: 12px; }
.cfoot .btn { flex: 1; min-height: 40px; font-size: 14px; }

/* veg marks */
.vm { width: 14px; height: 14px; border: 1.5px solid currentColor; border-radius: 3px; display: inline-grid; place-items: center; flex: none; }
.vm::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vm.nonveg::after { width: 0; height: 0; border-radius: 0; background: none; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid currentColor; }
.t-veg { color: var(--veg); } .t-nonveg { color: var(--nonveg); } .t-egg { color: var(--egg); }

.actions { display: flex; justify-content: center; align-items: center; gap: 26px; }
.fab-round { width: 66px; height: 66px; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 30px; background: var(--surface);
  box-shadow: var(--shadow-card); transition: transform .2s var(--spring); }
.fab-round:active { transform: scale(.9); }
.fab-round.no { color: var(--bad); }
.fab-round.yes { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-float); }
.fab-round.sm { width: 48px; height: 48px; font-size: 21px; color: var(--muted); }

.empty { text-align: center; padding: 44px 20px 32px; display: grid; justify-items: center; gap: 10px; }
.empty .art { width: 84px; height: 84px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 40px; margin-bottom: 4px; }
.empty h2 { margin: 0; font-size: 21px; }
.empty p { margin: 0 0 8px; color: var(--muted); max-width: 32ch; }

/* skeleton */
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skcard { position: absolute; inset: 0; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; display: grid; grid-template-rows: 42% 1fr; }
.skcard .b { padding: 18px; display: grid; gap: 12px; align-content: start; }
.skcap { text-align: center; color: var(--muted); font-size: 14px; margin: -4px 0 0; }

/* grouped lists */
.section-h { font-size: 13px; font-weight: 650; color: var(--muted); margin: 22px 4px 8px; display: flex; justify-content: space-between; align-items: baseline; }
.group { background: var(--surface); border-radius: 16px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 58px; width: 100%; border: 0; background: none; text-align: left; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; border-top: 1px solid var(--line); }
.group.flat .row + .row::before { left: 14px; }
button.row:active, .row.tap:active { background: var(--surface-2); }
.tile { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: var(--surface-2); color: var(--muted); }
.tile.accent { background: var(--accent-soft); color: var(--accent); }
.tile.good { background: var(--good-soft); color: var(--good); }
.tile.warn { background: var(--warn-soft); color: var(--warn); }
.tile.bad { background: var(--bad-soft); color: var(--bad); }
.row .main { flex: 1; min-width: 0; }
.row .main b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .main span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { font-size: 13px; font-weight: 600; color: var(--faint); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.row .end.good { color: var(--good); } .row .end.warn { color: var(--warn); } .row .end.bad { color: var(--bad); } .row .end.accent { color: var(--accent); }
.chev { color: var(--faint); font-size: 16px; }
details.more summary { list-style: none; cursor: pointer; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary .chev { transform: rotate(90deg); }
.chev { transition: transform .2s var(--ease); }

/* pantry */
.search { position: relative; margin-bottom: 12px; }
.search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 40px; background: var(--surface-2); border-color: transparent; min-height: 42px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; scroll-snap-align: start; border: 0; border-radius: 999px; min-height: 36px; padding: 0 14px; font-size: 14px; font-weight: 600;
  background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--text); color: var(--bg); box-shadow: none; }
.chip .c { font-size: 12px; opacity: .7; }
.fab { position: fixed; z-index: 15; right: max(16px, calc(50% - 264px)); bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); font-size: 28px;
  display: grid; place-items: center; box-shadow: var(--shadow-float); transition: transform .2s var(--spring); }
.fab:active { transform: scale(.9); }
.checkbtn { width: 30px; height: 30px; border: 0; background: none; padding: 0; font-size: 26px; color: var(--faint); flex: none; display: grid; place-items: center; }
.checkbtn.on { color: var(--good); }

/* scan */
.scanhero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.scanbtn { position: relative; border-radius: 22px; padding: 18px; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; transition: transform .15s var(--ease); }
.scanbtn:active { transform: scale(.98); }
.scanbtn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-float); }
.scanbtn i { font-size: 34px; }
.scanbtn b { font-size: 17px; display: block; }
.scanbtn span { font-size: 13px; opacity: .8; }
.scanbtn input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.review .item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 12px 14px; position: relative; }
.review .item + .item::before { content: ""; position: absolute; top: 0; left: 54px; right: 0; border-top: 1px solid var(--line); }
.review .item.off .fields { opacity: .4; }
.review .fields { display: grid; gap: 8px; }
.review .fields .r { display: grid; grid-template-columns: 1fr 96px; gap: 8px; }
.review .input { min-height: 42px; padding: 9px 12px; }
.review .name { font-weight: 600; }
.mini { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 0; }
.stickybar { position: sticky; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); margin-top: 12px; display: flex; gap: 10px; }
.stickybar .btn { box-shadow: var(--shadow-card); }

/* settings */
.srow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 54px; position: relative; }
.srow + .srow::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--line); }
.srow .lbl { flex: 1; font-weight: 500; }
.srow .lbl small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.srow input.inline { border: 0; background: none; text-align: right; color: var(--muted); min-height: 40px; width: 55%; font-size: 16px; padding: 0; }
.srow.stack { display: grid; gap: 10px; align-items: stretch; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface); font-size: 16px; display: grid; place-items: center; }
.stepper output { min-width: 28px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background-color .25s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fdfdfd; box-shadow: 0 2px 4px rgb(0 0 0 / .25); transition: transform .3s var(--spring); }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days button { border: 0; border-radius: 999px; min-height: 38px; font-size: 13px; font-weight: 650; background: var(--surface-2); color: var(--muted); }
.days button.on { background: var(--veg); color: #fdfdfd; }
.timeinput { border: 0; background: var(--surface-2); border-radius: 999px; padding: 6px 12px; min-height: 36px; font-weight: 600; }
.learned { padding: 14px; display: grid; gap: 10px; font-size: 15px; }
.learned .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; background: var(--surface-2); }
.pill.good { background: var(--good-soft); color: var(--good); } .pill.bad { background: var(--bad-soft); color: var(--bad); }

/* ---------- sheets ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; transition: opacity .3s; }
.sheet-bg.open { opacity: 1; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .42s var(--ease); }
.sheet.open { transform: translateY(var(--drag, 0px)); }
.sheet.dragging { transition: none; }
.grab { width: 100%; height: 26px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.grab::before { content: ""; width: 38px; height: 5px; border-radius: 999px; background: var(--surface-3); }
.sheet h2 { margin: 2px 0 4px; font-size: 24px; letter-spacing: -.015em; line-height: 1.15; }
.sheet .sub { color: var(--muted); margin: 0 0 14px; font-size: 15px; }
.sheet .stack { display: grid; gap: 10px; }
.sheet .media { border-radius: 16px; height: 190px; flex: none; margin-bottom: 14px; }
.ing { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 15px; position: relative; }
.ing + .ing::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--line); }
.ing .q { color: var(--muted); white-space: nowrap; }
.ing.short .q { color: var(--warn); font-weight: 600; }
.ing.untracked .q { color: var(--faint); }
.status { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.status.cooked { background: var(--good-soft); color: var(--good); } .status.skipped { background: var(--surface-2); color: var(--muted); }
.unitseg { display: flex; gap: 6px; flex-wrap: wrap; }
.unitseg button { border: 0; border-radius: 999px; min-height: 36px; padding: 0 13px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 600; color: var(--muted); }
.unitseg button.on { background: var(--text); color: var(--bg); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .appbar, .tabbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (min-width: 600px) { .bigtitle h1 { font-size: 38px; } }
