/* Mise web app. Colors, type and spacing come from the Mise design system (ds/tokens.css),
   components from ds/bundle.css. The short names below are kept for the older screens
   (Pantry, Me) until they are redesigned. */
:root {
  --app:var(--surface-page); --s1:var(--surface-raised); --s2:var(--surface-fill); --s3:var(--surface-strong);
  --line2:var(--line-strong);
  --t1:var(--ink); --t2:var(--ink-2); --t3:var(--ink-3);
  --accent-ink:var(--on-accent);
  --dim:var(--scrim);

  --safe-t:env(safe-area-inset-top, 0px);
  --safe-b:env(safe-area-inset-bottom, 0px);
  --tabbar:calc(54px + var(--safe-b));
  --spring:cubic-bezier(.32,.72,0,1); /* iOS sheet curve */
}

* { box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
/* At least the full screen: on first launch iOS can size the page 62 pt short (no status bar) and clip what's below. */
html { background:var(--app); -webkit-text-size-adjust:100%; min-height:var(--app-h, 100dvh); }
body {
  background:var(--app); color:var(--t1); min-height:100dvh;
  font:16px/1.45 var(--font-text);
  -webkit-font-smoothing:antialiased;
  /* App chrome isn't text you select or long-press. Content that is, opts back in. */
  -webkit-user-select:none; user-select:none; -webkit-touch-callout:none;
  overscroll-behavior-y:none;
  overflow-x:clip; /* a phone app never scrolls sideways */
}
.selectable, input, textarea { -webkit-user-select:text; user-select:text; }
button { font:inherit; color:inherit; border:0; background:none; cursor:pointer; touch-action:manipulation; }
.sprite { position:absolute; width:0; height:0; }
.i { width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.num { font-variant-numeric:tabular-nums; }
.hidden { display:none !important; }

/* ---------- screens ---------- */
.screen {
  /* Like a native large title: content starts below the 44pt bar row, clear of the status bar's soft edge. */
  padding:calc(var(--safe-t) + 36px) 18px calc(var(--tabbar) + 28px);
  max-width:560px; margin:0 auto;
}
.top { display:flex; justify-content:space-between; align-items:flex-end; margin:8px 2px 16px; }
.kicker { font-size:13px; color:var(--t2); font-weight:500; }
.h1 { font-size:34px; font-weight:700; letter-spacing:-.03em; line-height:1.1; }
.h2 { font-size:20px; font-weight:700; letter-spacing:-.02em; line-height:1.2; }
.meta { font-size:13px; color:var(--t2); }

/* Compact title that slides in once the large title scrolls away, like a UINavigationBar. */
.navbar {
  position:fixed; top:0; left:0; right:0; z-index:20;
  height:calc(var(--safe-t) + 44px); padding-top:var(--safe-t);
  display:grid; place-items:center; font-weight:600; font-size:17px;
  background:color-mix(in srgb, var(--app) 78%, transparent);
  -webkit-backdrop-filter:saturate(180%) blur(20px); backdrop-filter:saturate(180%) blur(20px);
  border-bottom:.5px solid var(--line2);
  opacity:0; visibility:hidden; pointer-events:none; transition:opacity .2s, visibility 0s .2s;
}
/* Blur only while visible: WebKit still blurs the backdrop of an element at opacity 0. */
.navbar:not(.on) { -webkit-backdrop-filter:none; backdrop-filter:none; }
.navbar.on { opacity:1; visibility:visible; transition:opacity .2s; }
/* Behind the status bar before the navbar shows, so content never scrolls under the clock. */
.statusbar-scrim { position:fixed; top:0; left:0; right:0; height:var(--safe-t); background:var(--app); z-index:19; }

/* ---------- surfaces ---------- */
.dot { width:7px; height:7px; border-radius:50%; background:var(--ok); flex:none; }
.dot.low { background:var(--low); }

/* ---------- controls ---------- */
.seg { position:relative; display:flex; background:var(--s1); border:1px solid var(--line); border-radius:14px; padding:3px; }
.seg button { position:relative; z-index:1; flex:1; color:var(--t2); font-size:14px; font-weight:600; padding:8px 0; border-radius:11px; transition:color .25s; }
.seg button.on { color:var(--t1); }
.seg .thumb { position:absolute; top:3px; bottom:3px; left:3px; width:calc((100% - 6px) / 3); border-radius:11px; background:var(--s3); transition:transform .3s cubic-bezier(.25,.1,.25,1); }
.seg[data-i="1"] .thumb { transform:translateX(100%); }
.seg[data-i="2"] .thumb { transform:translateX(200%); }
.btn {
  height:50px; border-radius:14px; font-weight:600; font-size:16px;
  display:flex; align-items:center; justify-content:center; gap:8px; padding:0 16px; width:100%;
  transition:transform .12s, opacity .12s;
}
.btn:active, .pressable:active { transform:scale(.97); opacity:.85; }
.btn.pri { background:var(--accent); color:var(--accent-ink); box-shadow:inset 0 1px 0 rgba(255,255,255,.25); }
.btn.sec { background:var(--s2); color:var(--t1); }
.btn.sm { height:36px; font-size:14px; border-radius:11px; width:auto; }
.btn[disabled] { opacity:.45; pointer-events:none; }
.btn .i { width:20px; height:20px; }
.iconbtn { width:36px; height:36px; border-radius:50%; background:var(--s2); display:grid; place-items:center; color:var(--t2); flex:none; }
.iconbtn .i { width:20px; height:20px; }
.field { width:100%; background:var(--s2); border:1px solid var(--line2); border-radius:12px; color:var(--t1); font:16px/1.35 ui-monospace, "SF Mono", Menlo, monospace; padding:12px; outline:none; }
.field:focus { border-color:var(--accent); }

/* ---------- Now ---------- */
.hero { margin-top:12px; padding:18px; }
.hero .name { font-size:24px; font-weight:700; letter-spacing:-.02em; line-height:1.15; margin:2px 0 6px; }
.hero .stock { display:flex; align-items:center; gap:8px; font-size:13.5px; margin-top:12px; color:var(--ok); font-weight:500; }
.hero .acts { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:16px; }
.hero .acts.single { grid-template-columns:1fr; }
.alts { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.alt { text-align:left; padding:12px; background:var(--s1); border:1px solid var(--line); border-radius:16px; }
.alt .nm { font-size:14.5px; font-weight:600; line-height:1.25; }
.alt .meta { font-size:12px; margin-top:2px; }
.empty { text-align:center; padding:28px 12px; color:var(--t2); font-size:14px; }

/* ---------- Shop ---------- */
.order { padding:18px; }
.order .hd { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--t2); }
.order .hd .i { width:16px; height:16px; color:var(--accent); }
.order .when { font-size:22px; font-weight:700; letter-spacing:-.02em; margin:4px 0 2px; }
.order .total { display:flex; align-items:baseline; justify-content:space-between; margin:16px 0 4px; }
.order .total b { font-size:28px; font-weight:700; letter-spacing:-.02em; }

/* ---------- bottom sheet ---------- */
.sheet-layer { position:fixed; inset:0; z-index:40; }
.sheet-dim { position:absolute; inset:0; background:var(--dim); opacity:0; transition:opacity .4s; }
.sheet {
  position:absolute; left:0; right:0; bottom:0; max-height:calc(100dvh - var(--safe-t) - 12px);
  max-width:560px; margin:0 auto;
  background:var(--s1); border-radius:30px 30px 0 0; border-top:1px solid var(--line2);
  padding:10px 20px calc(var(--safe-b) + 20px);
  overflow-y:auto; overscroll-behavior:contain;
  transform:translateY(100%); transition:transform .5s var(--spring);
  touch-action:none; /* short sheet: every gesture is ours (drag to close) */
}
.sheet.scrolls { touch-action:pan-y; }
.sheet .grab { touch-action:none; }
.sheet-dim { touch-action:none; }
html.sheet-open, html.sheet-open body { overflow:hidden; overscroll-behavior:none; }
.sheet-layer.open .sheet-dim { opacity:1; }
.sheet-layer.open .sheet { transform:translateY(0); }
.sheet.dragging { transition:none; }
.grab { width:38px; height:5px; border-radius:3px; background:var(--s3); margin:0 auto 18px; }
.logged { display:flex; gap:12px; align-items:center; }
.okc { width:46px; height:46px; border-radius:50%; background:var(--ok-soft); color:var(--ok); display:grid; place-items:center; flex:none; }
.okc .i { width:24px; height:24px; stroke-width:2.4; animation:pop .5s var(--spring); }
@keyframes pop { from { transform:scale(.3); opacity:0; } }
.tops { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px; }
.top-o { text-align:left; background:var(--s2); border-radius:16px; padding:12px; border:1px solid var(--line); }
.top-o b { display:block; font-size:14.5px; font-weight:600; }
.top-o span { font-size:12.5px; color:var(--t2); }
.faceid { display:grid; place-items:center; gap:10px; margin:6px 0 18px; text-align:center; }
.faceid .glyph { width:64px; height:64px; border-radius:18px; background:var(--accent-soft); color:var(--accent); display:grid; place-items:center; }
.faceid .glyph .i { width:34px; height:34px; stroke-width:1.6; }
.bigtotal { font-size:40px; font-weight:700; letter-spacing:-.03em; }

[data-gap="8"] { margin-top:8px; } [data-gap="10"] { margin-top:10px; } [data-gap="14"] { margin-top:14px; }
[data-gap="16"] { margin-top:16px; } [data-gap="18"] { margin-top:18px; } [data-gap="28"] { margin-top:28px; }
.grow { flex:1; }

/* ---------- tab bar ---------- */
.tabbar {
  /* Placed from the measured height, not bottom:0, which iOS gets wrong on a first frame. */
  position:fixed; left:0; right:0; top:calc(var(--app-h, 100dvh) - var(--tabbar)); z-index:30; height:var(--tabbar);
  padding:6px 8px var(--safe-b); display:flex; justify-content:space-around;
  background:color-mix(in srgb, var(--app) 80%, transparent);
  -webkit-backdrop-filter:saturate(180%) blur(20px); backdrop-filter:saturate(180%) blur(20px);
  border-top:.5px solid var(--line2);
}
.tab { display:flex; flex-direction:column; align-items:center; gap:2px; font-size:10.5px; color:var(--t3); font-weight:600; width:72px; position:relative; }
.tab .i { width:26px; height:26px; transition:transform .3s var(--spring); }
.tab:active .i { transform:scale(.85); }
.tab.on { color:var(--t1); }
.tab.on .i { color:var(--accent); }
.tab .badge { position:absolute; top:-2px; left:calc(50% + 6px); min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--out); color:#fff; font-size:11px; display:grid; place-items:center; }

/* ---------- toast ---------- */
.toast {
  position:fixed; left:0; right:0; margin:0 auto; width:max-content; top:calc(var(--safe-t) + 8px); z-index:60; max-width:calc(100% - 32px);
  transform:translateY(-120%); opacity:0; visibility:hidden;
  transition:transform .45s var(--spring), opacity .25s, visibility 0s .45s;
  background:var(--s3); color:var(--t1); border-radius:22px; padding:10px 16px; font-size:14px; font-weight:500;
  box-shadow:0 10px 30px rgba(0,0,0,.3);
}
/* Fully gone when hidden: parked under the status bar, its shadow hazed the top of every screen. */
.toast.on { transform:translateY(0); opacity:1; visibility:visible; transition:transform .45s var(--spring), opacity .15s; }

/* ---------- pairing ---------- */
.pair { min-height:100dvh; display:flex; flex-direction:column; justify-content:center; gap:16px; padding:calc(var(--safe-t) + 24px) 24px calc(var(--safe-b) + 24px); max-width:480px; margin:0 auto; }
.logo { width:64px; height:64px; border-radius:18px; background:var(--accent); color:var(--accent-ink); display:grid; place-items:center; }
.logo .i { width:34px; height:34px; stroke-width:2; }
.hint { font-size:13px; color:var(--t3); }
.hint code { font:12px ui-monospace, "SF Mono", Menlo, monospace; color:var(--t2); -webkit-user-select:all; user-select:all; }

/* ---------- motion ---------- */
/* "backwards", not "both": a transform animation that stays filled makes the screen the containing
   block for fixed children, so the action bar would scroll with the page. */
.enter { animation:.28s cubic-bezier(.2,.8,.2,1) backwards fade-in; }
@keyframes fade-in { from { opacity:0; transform:translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  * { animation:none !important; transition:none !important; }
}


/* ============ Now (see the Now canvas in the design system) ============ */
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.ic { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex:none; display:block; }
.btn-ic { width:20px; height:20px; }
.now-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin:8px 2px 16px; }
.now-head h1 { margin:0; }
.now-stack { display:flex; flex-direction:column; gap:16px; }
#now-notices:not(:empty) { margin-bottom:16px; }
#now-body { margin-top:16px; }
.dots { list-style:none; display:flex; gap:6px; margin-bottom:4px; }
.dots .dot { width:30px; height:30px; border-radius:50%; display:grid; place-items:center; background:transparent; }
.dots .dot .ic { width:17px; height:17px; }
.dots .dot--done { background:var(--ok-soft); color:var(--ok); }
.dots .dot--skipped { box-shadow:inset 0 0 0 1.5px var(--line-strong); color:var(--ink-3); }
.dots .dot--now { background:var(--accent); color:var(--on-accent); }
.dots .dot--later { background:var(--surface-fill); color:var(--ink-3); }

.hero { padding:18px; display:grid; gap:16px; }
.hero__top { display:flex; gap:16px; align-items:center; }
.hero__text { min-width:0; display:grid; gap:10px; }
.hero__name { margin:0; }
.hero__name--dim { color:var(--ink-2); }
.hero__line { margin:0; font:400 15px/1.6 var(--font-text); color:var(--ink-2); }
.hero__acts { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
.meal-label { margin:0 0 2px; font:600 13px/1.3 var(--font-text); color:var(--accent-text); }
.btn-outline { background:var(--surface-raised); box-shadow:inset 0 0 0 1px var(--line-strong); }

.plate { position:relative; flex:none; }
.plate--112 { width:112px; height:112px; }
.plate--dim { opacity:.45; }
.plate svg { position:absolute; inset:0; width:100%; height:100%; }
.plate__disc { fill:var(--surface-fill); }
.ring { fill:none; stroke-width:3; }
.ring-veg { stroke:var(--food-veg); }
.ring-carb { stroke:var(--food-carb); }
.ring-prot { stroke:var(--food-protein); }
.plate .plate__icon { position:absolute; left:28.5%; top:28.5%; width:43%; height:43%; stroke-width:1.4; color:var(--ink); }

.chips { display:flex; flex-wrap:wrap; gap:6px; }
.chip { display:inline-flex; align-items:center; gap:5px; height:28px; padding:0 10px 0 8px; border-radius:var(--radius-chip); background:var(--surface-fill); color:var(--ink-2); font:500 13px/1 var(--font-text); white-space:nowrap; }
.chip .ic { width:16px; height:16px; }
.chip--ok { background:var(--ok-soft); color:var(--ok); }
.chip--low { background:var(--low-soft); color:var(--low); }
.chip--out { background:var(--out-soft); color:var(--out); }

.tiles { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
.tile { display:flex; align-items:center; gap:10px; padding:10px; border-radius:var(--radius-tile); background:var(--surface-raised); border:1px solid var(--line); text-align:left; min-width:0; transition:transform .12s; }
button.tile:active { transform:scale(.97); }
.tile__pic { width:44px; height:44px; border-radius:50%; background:var(--surface-fill); display:grid; place-items:center; color:var(--ink); flex:none; }
.tile__text { min-width:0; }
.tile__name { font:600 14.5px/1.25 var(--font-text); display:block; }
.tile__meta { display:flex; align-items:center; gap:4px; font:400 12.5px/1.2 var(--font-text); color:var(--ink-2); margin-top:2px; }
.tile__meta .ic { width:13px; height:13px; }
.now-label { margin:0 2px -8px; }
.link-btn { font:600 14px/1 var(--font-text); color:var(--accent-text); padding:15px 10px; min-height:44px; }
.link-btn--big { font-size:15px; padding:14px 4px; }
.check-btn { width:44px; height:44px; display:grid; place-items:center; }
.check-btn span { width:26px; height:26px; border-radius:50%; box-shadow:inset 0 0 0 1.5px var(--line-strong); display:grid; place-items:center; color:var(--ink-3); }
.check-btn .ic { width:14px; height:14px; stroke-width:2.4; }

.strip { display:flex; align-items:center; gap:10px; padding:4px 4px 4px 12px; border-radius:var(--radius-tile); background:var(--low-soft); color:var(--low); }
.strip > .ic { width:18px; height:18px; }
.strip__text { flex:1; font:600 14px/1.3 var(--font-text); }
.strip__btn { width:44px; height:44px; display:grid; place-items:center; color:var(--low); }
.strip__btn .ic { width:20px; height:20px; }
.banner__chevron { width:18px; height:18px; color:var(--accent-text); }

/* The logged sheet */
.logged-head { display:flex; gap:12px; align-items:center; }
.logged-head .okc { width:44px; height:44px; border-radius:50%; background:var(--ok-soft); color:var(--ok); display:grid; place-items:center; flex:none; }
.logged-head .okc .ic { stroke-width:2.4; }
.logged-head__text { flex:1; min-width:0; }
.logged-head__text h2 { margin:0; }
.logged-head__time { margin-top:2px; font:400 13px/1.3 var(--font-text); color:var(--ink-3); }
.used-row { display:flex; flex-wrap:wrap; gap:6px; margin-top:16px; }
.used { display:inline-flex; align-items:center; gap:6px; height:32px; padding:0 10px 0 6px; border-radius:var(--radius-round); background:var(--surface-fill); color:var(--ink); font:500 13px/1 var(--font-text); font-variant-numeric:tabular-nums; white-space:nowrap; }
.used .ic { width:18px; height:18px; color:var(--ink-2); }
.used--note { white-space:normal; height:auto; min-height:32px; padding:6px 12px 6px 8px; color:var(--ink-2); }
.logged-sub { margin:28px 0 12px; }
.tops { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:8px; }
.topup { display:flex; flex-direction:column; align-items:center; gap:8px; padding:14px 6px 12px; border-radius:var(--radius-tile); background:var(--surface-fill); text-align:center; min-width:0; }
.topup[aria-pressed="true"] { background:var(--ok-soft); box-shadow:inset 0 0 0 1px var(--ok); }
.topup__pic { width:48px; height:48px; border-radius:50%; display:grid; place-items:center; background:var(--surface-raised); color:var(--ink); }
.topup[aria-pressed="true"] .topup__pic { color:var(--ok); }
.topup__name { font:600 13px/1.25 var(--font-text); }
.logged-label { margin:24px 2px 8px; color:var(--ink-2); }
.logged-full { margin-top:16px; }

/* Now, once the meal is logged */
.m-seg[hidden] { display:none; }
.logged-sub--first { margin-top:4px; }
.topup:disabled { opacity:.6; }

/* ---------- splash ---------- */
#splash { position:fixed; inset:0; z-index:100; display:grid; place-items:center; background:var(--app); transition:opacity .3s; }
#splash img { border-radius:20px; }
#splash.gone { opacity:0; pointer-events:none; }


/* ---------- the order (order.js) ---------- */
.sheet.sheet--full { height:calc(100dvh - var(--safe-t) - 12px); display:flex; flex-direction:column; padding:10px 0 0; overflow:hidden; }
.sheet--full .grab { margin-bottom:10px; flex:none; }
.os { display:flex; flex-direction:column; flex:1; min-height:0; }
.os--busy .os-scroll, .os--busy .os-foot { opacity:.7; pointer-events:none; }
.os-head { padding:0 20px 14px; display:grid; gap:10px; border-bottom:1px solid var(--line); }
.os-title { display:flex; align-items:center; gap:10px; }
.os-title h2 { flex:1; margin:0; }
.os-pic { width:36px; height:36px; border-radius:50%; background:var(--surface-fill); display:grid; place-items:center; color:var(--ink); flex:none; }
.os-pic .ic { width:20px; height:20px; }
.os-pic--off { color:var(--ink-3); }
.os-pic--ask { background:var(--surface-raised); color:var(--low); }
.os-pic--big { width:44px; height:44px; }
.os-sum { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; }
.os-total { margin:0; font:700 40px/1 var(--font-display); letter-spacing:-.03em; }
.os-meta { margin:4px 0 0; font:400 13px/1.35 var(--font-text); color:var(--ink-2); }
.m-pill .ic { width:14px; height:14px; stroke-width:2.2; }
.os-min { display:grid; gap:6px; }
.os-bar { height:8px; border-radius:4px; background:var(--surface-fill); overflow:hidden; }
.os-bar__fill { display:block; width:0; height:100%; border-radius:4px; background:var(--accent); }
.os-scroll { flex:1; overflow-y:auto; overscroll-behavior:contain; touch-action:pan-y; padding:14px 18px 16px; }
.os-chev { width:18px; height:18px; color:var(--ink-3); flex:none; }
.os-gtitle { min-width:0; margin:0; font:600 13px/1.65 var(--font-text); color:var(--ink-2); }
.os-group--first { margin-top:0; }
.os-group .m-pill { flex:none; }
.os-line { position:relative; border-bottom:0; }
.os-hit { position:absolute; inset:0; z-index:0; border-radius:12px; } /* the row's tap target: opens the stepper */
.os-line > .mpicbtn, .os-line .os-mise, .os-line .link-btn { position:relative; z-index:1; }
.os-line .mrow__text { padding:10px 0; }
.os-mise { padding:4px 0; margin:-4px 0; }
.os-price { flex:none; min-width:58px; text-align:right; font:500 15px/1 var(--font-text); color:var(--ink); }
.os-units { flex:none; font:500 14px/1 var(--font-text); color:var(--ink-2); }
.os-item--fresh { margin:0 -12px; padding:0 12px; background:var(--accent-soft); animation:os-fresh 2.4s ease-out 1.2s forwards; }
@keyframes os-fresh { to { background:transparent; } }
@media (prefers-reduced-motion: reduce) { .os-item--fresh { animation:none; background:transparent; } }
.os-group { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:22px 4px 8px; }
.os-group .m-section-label, .os-group .os-meta { margin:0; }
.os-list { padding:0 12px; }
.os-item { border-bottom:1px solid var(--line); }
.os-item:last-child { border-bottom:0; }
.os-struck { color:var(--ink-3); text-decoration:line-through; }
.os-edit { display:flex; align-items:center; gap:8px; padding:0 0 12px 56px; }
.os-stepper { display:flex; align-items:center; border-radius:var(--radius-control); background:var(--surface-fill); }
.os-step { width:44px; height:40px; display:grid; place-items:center; color:var(--ink); }
.os-step:disabled { color:var(--ink-3); }
.os-step .ic { width:18px; height:18px; stroke-width:2.2; }
.os-qty { min-width:24px; text-align:center; font:600 15px/1 var(--font-text); }
.os-remove { height:40px; padding:0 8px; display:flex; align-items:center; gap:6px; color:var(--out); font:600 14px/1 var(--font-text); }
.os-remove .ic { width:18px; height:18px; }
.os-foot { padding:12px 20px calc(var(--safe-b) + 14px); border-top:1px solid var(--line); background:var(--surface-raised); display:grid; gap:4px; }
.os-skip { color:var(--ink-2); }

.pick-head, .pay-head { display:flex; gap:14px; align-items:center; }
.pick-head h2, .pay-head h2 { margin:0; }
.pick-options { display:grid; gap:8px; margin-top:18px; }
.pick-opt { display:flex; align-items:center; gap:12px; width:100%; padding:12px; border-radius:var(--radius-tile); background:var(--surface-fill); text-align:left; }
.pick-opt[aria-checked="true"] { background:var(--accent-soft); box-shadow:inset 0 0 0 1.5px var(--accent); }
.pick-radio { width:24px; height:24px; border-radius:50%; flex:none; display:grid; place-items:center; box-shadow:inset 0 0 0 1.5px var(--line-strong); color:transparent; }
.pick-opt[aria-checked="true"] .pick-radio { background:var(--accent); box-shadow:none; color:var(--on-accent); }
.pick-radio .ic { width:14px; height:14px; stroke-width:2.6; }
.pick-text { flex:1; min-width:0; display:grid; }
.pick-text .os-meta { margin:0; }
.pick-name { font:600 15px/1.3 var(--font-text); }
.pick-price { font:500 15px/1 var(--font-text); }
.pick-acts, .pay-acts { display:grid; gap:4px; margin-top:20px; }

/* Pages pushed inside the order sheet: an item, a product pick. */
.osi-photo { position:relative; height:168px; border-radius:22px; background:var(--surface-fill); border:1px solid var(--line); display:grid; place-items:center; overflow:hidden; color:var(--ink); }
.osi-photo img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:#fff; z-index:1; }
.osi-photo__ic .ic { width:84px; height:84px; stroke-width:1.3; }
.osi-name { margin:14px 0 0; }
.osi-product { margin-top:2px; }
.osi-facts { display:flex; flex-wrap:wrap; align-items:center; gap:4px 12px; margin-top:8px; }
.osi-facts .os-meta { margin:0; }
.osi-price { font:600 17px/1 var(--font-text); }
.osi-sec { margin:20px 4px 8px; }
.osi-order { display:flex; align-items:center; gap:10px; padding:10px 14px; }
.osi-total { flex:1; font:500 15px/1 var(--font-text); }
.osi-meals { display:grid; gap:8px; padding:0 4px; }
.osi-meal { margin:0; font:400 15px/1.6 var(--font-text); color:var(--ink-2); }
.osi-others { margin-top:20px; }
.osp-title { flex:1; min-width:0; margin:0; }
.osp-for { margin:12px 0 0; font:400 15px/1.6 var(--font-text); color:var(--ink-2); }
.pick-opt .mx { flex:none; }
.pick-text .mrow__meta { margin-top:3px; }
.pay-acts a.m-btn { text-decoration:none; }
.pay-note { text-align:center; }
.pay-done { margin-top:4px; width:100%; }
.okc--big { width:52px; height:52px; }
.okc--low { background:var(--low-soft); color:var(--low); }
.steps { list-style:none; margin:22px 0 0; padding:0; }
.step { display:flex; gap:12px; align-items:flex-start; position:relative; padding-bottom:16px; }
.step:not(:last-child)::before { content:""; position:absolute; left:13px; top:30px; bottom:2px; width:2px; background:var(--line-strong); }
.step--done:not(:last-child)::before { background:var(--ok); }
.step__dot { width:28px; height:28px; border-radius:50%; flex:none; display:grid; place-items:center; box-shadow:inset 0 0 0 1.5px var(--line-strong); color:transparent; }
.step__dot .ic { width:15px; height:15px; stroke-width:2.6; }
.step--done .step__dot { background:var(--ok-soft); color:var(--ok); box-shadow:none; }
.step--now .step__dot { background:var(--accent); box-shadow:none; }
.step__text { display:grid; padding-top:4px; }
.step__text .os-meta { margin:2px 0 0; }
.step__name { font:600 15px/1.3 var(--font-text); }
.step--later .step__name { color:var(--ink-2); }
.att-text { margin:18px 0 0; font:400 15px/1.45 var(--font-text); }
.att-q { margin:20px 0 10px; font:600 15px/1.3 var(--font-text); }
.att-acts { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
.m-banner--low { background:var(--low-soft); }
.m-banner--low .m-banner__icon { color:var(--low); }

.oc { padding:16px; display:grid; gap:14px; margin:0 0 16px; }
.oc-top { display:flex; align-items:center; gap:10px; }
.oc-title { margin:0; font:600 15px/1.3 var(--font-text); }
.oc-top .os-meta { margin:1px 0 0; }
.oc-mid { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.oc .os-total { font-size:34px; }
.oc-of { font:500 17px/1 var(--font-text); letter-spacing:0; color:var(--ink-2); }
.oc-food { display:flex; align-items:center; padding-right:6px; }
.oc-food__pic { width:34px; height:34px; margin-right:-6px; border-radius:50%; background:var(--surface-fill); box-shadow:0 0 0 2px var(--surface-raised); display:grid; place-items:center; color:var(--ink); }
.oc-food__pic .ic { width:18px; height:18px; }
.oc-food__more { font:600 12px/1 var(--font-text); color:var(--ink-2); }
.pantry-soon { margin-top:8px; }

/* ---------- Pantry (pantry.js) ---------- */
.pmeta { margin:2px 0 0; font:400 13px/1.35 var(--font-text); color:var(--ink-2); }
.psec { margin:22px 4px 8px; }
.psec--row { display:flex; align-items:baseline; justify-content:space-between; }
.psec--row .m-section-label, .psec--row .pmeta { margin:0; }
.psec--row .m-section-label { display:flex; align-items:center; gap:6px; }
.psec--row .m-section-label svg { width:14px; height:14px; flex:none; }
.pdisc { width:40px; height:40px; border-radius:50%; background:var(--surface-fill); display:grid; place-items:center; color:var(--ink); flex:none; }
.pdisc .ic { width:22px; height:22px; }
.pdisc--accent { background:var(--surface-raised); color:var(--accent-text); }
.psearch { display:flex; align-items:center; gap:8px; width:100%; height:var(--size-field); padding:0 12px; margin-bottom:14px; border-radius:var(--radius-control); background:var(--surface-fill); color:var(--ink-3); font:400 16px/1 var(--font-text); text-align:left; }
.psearch .ic { width:18px; height:18px; }
.pcount { padding:16px; display:grid; gap:12px; background:var(--accent-soft); border-color:transparent; margin-bottom:6px; }
.pcount__top { display:flex; gap:12px; align-items:center; }
.pcount__t { margin:0; font:600 16px/1.3 var(--font-text); }
.ptiles { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:8px; }
.ptile { display:grid; gap:8px; padding:10px; border-radius:var(--radius-tile); background:var(--surface-raised); border:1px solid var(--line); text-align:left; min-width:0; align-content:start; }
.ptile__name { font:600 14px/1.25 var(--font-text); overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.ptile__meta { display:flex; align-items:center; gap:4px; font:400 12.5px/1.2 var(--font-text); color:var(--ink-2); }
.ptile__meta .ic { width:13px; height:13px; }
.ptile__meta--warn { color:var(--low); }
.plist { padding:0 14px; }
.pchev { width:18px; height:18px; color:var(--ink-3); }
.padd { height:32px; padding:0 12px; border-radius:var(--radius-chip); background:var(--accent-soft); color:var(--accent-text); font:600 13px/1 var(--font-text); display:inline-flex; align-items:center; gap:4px; flex:none; }
.padd .ic { width:14px; height:14px; stroke-width:2.4; }
.pchips { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.pchip { height:34px; padding:0 14px; border-radius:var(--radius-chip); background:var(--surface-fill); color:var(--ink-2); font:600 13.5px/1 var(--font-text); }
.pchip[aria-pressed="true"] { background:var(--ink); color:var(--surface-page); }

/* the quick count */
.pc { display:flex; flex-direction:column; flex:1; min-height:0; padding:0 18px calc(var(--safe-b) + 14px); }
.pc-head { display:flex; align-items:center; gap:8px; }
.pc-back { width:44px; height:44px; display:grid; place-items:center; color:var(--accent-text); }
.pc-back:disabled { opacity:.35; }
.pc-progress { flex:1; margin:0; text-align:center; font:600 15px/1 var(--font-text); }
.pc-bar { margin:10px 0 0; height:6px; }
.pc-item { display:grid; justify-items:center; gap:6px; text-align:center; margin-top:22px; }
.pc-item h2 { margin:8px 0 0; }
.pc-pic { width:180px; height:180px; border-radius:40px; background:var(--surface-fill); display:grid; place-items:center; overflow:hidden; color:var(--ink); }
.pc-pic .ic { width:84px; height:84px; stroke-width:1.2; }
.pc-pic__img { width:100%; height:100%; object-fit:contain; background:#fff; }
.pc-acts { display:grid; gap:8px; margin-top:auto; padding-top:18px; }
.pc-answer { display:flex; align-items:center; gap:14px; width:100%; min-height:64px; padding:10px 16px 10px 12px; border-radius:var(--radius-tile); background:var(--surface-raised); border:1px solid var(--line); text-align:left; }
.pc-answer__t { display:block; font:600 16px/1.3 var(--font-text); }
.pc-answer .pmeta { display:block; margin:0; }
.pc-meter { display:flex; gap:3px; align-items:flex-end; justify-content:center; width:40px; height:40px; padding:9px 0; border-radius:12px; background:var(--surface-fill); flex:none; }
.pc-meter i { width:6px; border-radius:2px; background:var(--line-strong); }
.pc-meter i:nth-child(1) { height:8px; } .pc-meter i:nth-child(2) { height:14px; } .pc-meter i:nth-child(3) { height:20px; }
.pc-meter--ok i { background:var(--ok); }
.pc-meter--low i:nth-child(1) { background:var(--low); }
.pc-done { flex:1; display:grid; place-content:center; justify-items:center; gap:10px; text-align:center; }
.pc-done h2 { margin:0; }
.pc-done__ok { width:72px; height:72px; }

/* search */
.ps-head { display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.ps-field { flex:1; }
.ps-cancel { font:500 16px/1 var(--font-text); color:var(--accent-text); padding:12px 2px; }
.ps-plus { width:40px; height:40px; border-radius:50%; background:var(--accent); color:var(--on-accent); display:grid; place-items:center; flex:none; }
.ps-plus .ic { width:20px; height:20px; stroke-width:2.4; }
.ps-stepper { display:flex; align-items:center; border-radius:20px; background:var(--accent-soft); color:var(--accent-text); flex:none; font:700 15px/1 var(--font-text); }
.ps-stepper button { width:36px; height:40px; display:grid; place-items:center; color:var(--accent-text); }
.ps-stepper .ic { width:16px; height:16px; stroke-width:2.4; }
.ps-bar { position:fixed; left:12px; right:12px; top:calc(var(--app-h, 100dvh) - var(--tabbar) - 70px); display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:var(--radius-card); background:var(--ink); color:var(--surface-page); box-shadow:var(--shadow-toast); z-index:30; max-width:536px; margin:0 auto; }
.ps-bar .ic { width:20px; height:20px; }
.ps-bar button { font:600 14px/1 var(--font-text); color:var(--surface-page); padding:8px 2px; }

/* one item */
.pback { display:inline-flex; align-items:center; gap:2px; height:44px; margin:-6px 0 6px -8px; padding:0 8px 0 4px; color:var(--accent-text); font:400 17px/1 var(--font-text); }
.pback .ic { width:24px; height:24px; }
.pi-photos { height:260px; border-radius:28px; background:#fff; border:1px solid var(--line); display:flex; overflow-x:auto; scroll-snap-type:x mandatory; }
.pi-photos img { flex:0 0 100%; height:100%; object-fit:contain; scroll-snap-align:center; }
.pi-photos__ic { flex:1; display:grid; place-items:center; background:var(--surface-fill); color:var(--ink); }
.pi-photos__ic .ic { width:110px; height:110px; stroke-width:1.1; }
.pi-name { margin:16px 0 0; font-size:28px; }
.pi-product { margin:4px 0 0; font:400 15px/1.35 var(--font-text); color:var(--ink-2); }
.pi-price { display:flex; align-items:center; gap:8px; margin-top:10px; flex-wrap:wrap; }
.pi-price__v { font:700 22px/1 var(--font-display); }
.pi-price .pmeta { margin:0; }
.pi-cheaper { display:flex; align-items:center; gap:12px; margin-top:14px; padding:10px 10px 10px 12px; border-radius:var(--radius-tile); background:var(--ok-soft); }
.pi-cheaper__t { display:block; font:600 14px/1.3 var(--font-text); }
.pi-small { width:auto; padding:0 14px; flex:none; }
.pi-stock { margin-top:14px; padding:16px; display:grid; gap:12px; }
.pi-stock__top { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.pi-stock__level { font-size:16px; font-weight:600; }
.pi-stock__meta { margin-left:0; }
.pi-stock__level .mstat { font-size:16px; font-weight:600; }
.pi-stock__level .mstat .ic { width:18px; height:18px; }
.pi-stock__order { display:flex; align-items:center; gap:10px; padding-top:12px; border-top:1px solid var(--line); font:400 14px/1.3 var(--font-text); }
.pi-stock__order .ic { width:20px; height:20px; color:var(--ink-2); }
.pi-meals { display:flex; flex-wrap:wrap; gap:8px; }
.pi-meal { display:inline-flex; align-items:center; gap:8px; height:40px; padding:0 14px 0 6px; border-radius:20px; background:var(--surface-raised); border:1px solid var(--line); font:500 14px/1 var(--font-text); }
.pi-meal__pic { width:30px; height:30px; border-radius:50%; background:var(--surface-fill); display:grid; place-items:center; }
.pi-meal__pic .ic { width:17px; height:17px; }
.pi-meal__day { color:var(--ink-2); font-weight:400; }
.pi-kv { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; border-bottom:1px solid var(--line); font:400 15px/1.3 var(--font-text); }
.pi-kv:last-child { border-bottom:0; }
.pi-kv span:last-child { color:var(--ink-2); text-align:right; }
.pi-kv--sub { min-height:36px; padding-left:14px; font-size:14px; color:var(--ink-2); }
.pi-ingredients { margin:12px 4px 0; font:400 13px/1.45 var(--font-text); color:var(--ink-2); }
.pi-ingredients b { color:var(--ink); font-weight:600; }

/* how much is left? */
.pf-title { margin:0; text-align:center; }
.pf-step { display:flex; align-items:center; justify-content:center; gap:28px; margin:24px 0 18px; }
.pf-big { width:64px; height:64px; border-radius:50%; background:var(--surface-fill); display:grid; place-items:center; color:var(--ink); }
.pf-big .ic { width:26px; height:26px; stroke-width:2.2; }
.pf-value { text-align:center; min-width:96px; }
.pf-value .pmeta { margin:4px 0 0; }
.pf-n { margin:0; font:700 56px/1 var(--font-display); letter-spacing:-.03em; }
.pf-quick { justify-content:center; }
.pf-note { margin:8px 0 0; text-align:center; font:400 13px/1.35 var(--font-text); color:var(--ok); }
.pf-note--low { color:var(--low); }
.pc-pack { display:inline-flex; align-items:center; gap:8px; height:40px; margin-top:10px; padding:0 16px 0 10px; border-radius:20px; background:var(--surface-raised); border:1px solid var(--line-strong); font:600 16px/1 var(--font-text); }
.pc-pack .ic { width:20px; height:20px; color:var(--ink-2); }
.plink { font:600 14px/1 var(--font-text); color:var(--accent-text); padding:6px 0; }

/* ---------- Plan (plan.js) ---------- */
.wk-head { display:flex; align-items:flex-end; justify-content:space-between; }
.wk-head .h1 { margin:0; }
.wk-lib { display:inline-flex; align-items:center; gap:6px; height:36px; padding:0 14px 0 10px; margin-bottom:4px; border-radius:18px; background:var(--surface-fill); color:var(--ink); font:600 14px/1 var(--font-text); }
.wk-lib .ic { width:18px; height:18px; }
.wk-nav { display:flex; align-items:center; justify-content:space-between; margin:12px 0 8px; }
.wk-nav p { margin:0; font:600 15px/1 var(--font-text); }
.wk-nav > button:not(.wk-month) { width:40px; height:40px; display:grid; place-items:center; color:var(--accent-text); }
.wk-strip { display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); gap:4px; padding:4px; border-radius:20px; background:var(--surface-raised); border:1px solid var(--line); }
.wk-day { display:grid; justify-items:center; gap:6px; padding:8px 0 10px; border-radius:16px; color:var(--ink); }
.wk-day__w { font:500 12px/1 var(--font-text); color:var(--ink-2); }
.wk-day__n { font:700 17px/1 var(--font-display); }
.wk-day--past { color:var(--ink-3); }
.wk-day--today { background:var(--accent); color:var(--on-accent); }
.wk-day--today .wk-day__w { color:var(--on-accent); }
.wk-dots { display:flex; gap:3px; }
.wk-dot { width:5px; height:5px; border-radius:50%; background:transparent; }
.wk-dot--done { background:var(--ok); }
.wk-dot--plan { background:var(--ink-3); }
.wk-dot--skip { background:var(--line-strong); }
.wk-day--today .wk-dot--plan { background:var(--on-accent); }
.wk-daysec { scroll-margin-top:70px; }
.wk-dh { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin:20px 4px 8px; }
.wk-dh__t { margin:0; font:600 15px/1.2 var(--font-text); white-space:nowrap; }
.wk-dh__n { font:500 13px/1.2 var(--font-text); color:var(--ink-2); text-align:right; }
.wk-dh__n--accent { color:var(--accent-text); }
.sheet.sheet--tall { max-height:calc(100dvh - var(--safe-t) - 40px); }
.sw-title { margin:0; }
.sw-label { margin:16px 4px 6px; }
.sw-opts { display:grid; gap:6px; }
.sw-opts--plan { margin-top:14px; }
.sw-opt { padding:8px 12px 8px 8px; }
.rc-hero { height:230px; border-radius:28px; background:var(--surface-fill); display:grid; place-items:center; }
.plate--168 { width:168px; height:168px; }
.rc-name { margin:16px 0 0; font-size:28px; }
.chip--ok { background:var(--ok-soft); color:var(--ok); }
.rc-step { display:flex; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
.rc-step:last-child { border-bottom:0; }
.rc-step p { margin:3px 0 0; font:400 15px/1.45 var(--font-text); }
.rc-step__n { width:28px; height:28px; border-radius:50%; background:var(--ink); color:var(--surface-page); display:grid; place-items:center; font:700 13px/1 var(--font-text); flex:none; }
.lib-title { margin:4px 0 0; }
.lib-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:14px 10px; }
.lib-card { display:grid; gap:6px; text-align:left; min-width:0; align-content:start; }
.lib-card__name { font:600 14.5px/1.25 var(--font-text); }
.idea-sum { margin-bottom:10px; }

/* fuller Now */

/* ---------- shared building blocks (ui.js) ---------- */
/* Picture: icon underneath, photo on top; a failed photo is removed and the icon shows. */
.mx { position:relative; flex:none; display:grid; place-items:center; overflow:hidden; background:var(--surface-fill); color:var(--ink); }
.mx > .ic { width:55%; height:55%; stroke-width:1.6; }
.mx > img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:#fff; }
.mx--sm { width:36px; height:36px; border-radius:11px; }
.mx--md { width:44px; height:44px; border-radius:13px; }
.mx--lg { width:56px; height:56px; border-radius:15px; }
.mx--round { border-radius:50%; }
.mx--done { background:var(--ok-soft); color:var(--ok); }
.mx--open { background:transparent; box-shadow:inset 0 0 0 1.5px var(--line); color:var(--ink-3); }
.mx--accent { background:var(--accent-soft); color:var(--accent-text); }
.mx--tile { width:100%; height:auto; aspect-ratio:4/3; border-radius:18px; }
.mx--tile > img { object-fit:cover; }
.mx--tile > .ic { width:30%; height:30%; stroke-width:1.4; }

/* The one list row. */
.mlist { background:var(--surface-raised); border:1px solid var(--line); border-radius:var(--radius-card); padding:0 14px; }
.mrow { display:flex; align-items:center; gap:12px; min-height:60px; border-bottom:1px solid var(--line); }
.mrow:last-child { border-bottom:0; }
.mrow__main { display:flex; align-items:center; gap:12px; flex:1; min-width:0; padding:10px 0; text-align:left; color:inherit; }
.mrow__text { flex:1; min-width:0; display:grid; gap:3px; }
.mrow__title { font:500 15.5px/1.3 var(--font-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mrow__title--muted { color:var(--ink-2); }
.mrow__meta { display:flex; flex-wrap:wrap; align-items:center; column-gap:8px; row-gap:2px; font:400 13px/1.35 var(--font-text); color:var(--ink-2); }
.mrow__end { flex:none; display:flex; align-items:center; gap:4px; padding-left:4px; font:400 14px/1 var(--font-text); color:var(--ink-2); font-variant-numeric:tabular-nums; }

/* Status: an icon and a few words. Never truncated; it wraps with the meta line. */
.mstat { display:inline-flex; align-items:center; gap:4px; font:500 13px/1.35 var(--font-text); white-space:nowrap; }
.mstat .ic { width:15px; height:15px; stroke-width:2; }
.mstat--quiet { color:var(--ink-2); }
.mstat--ok { color:var(--ok); }
.mstat--low { color:var(--low); }
.mstat--out { color:var(--out); }
.mstat--accent { color:var(--accent-text); }
.mstatp { min-width:0; } /* a status with references: one run of text that wraps */
.mstatp > .mstat { display:inline-flex; vertical-align:top; }

/* Entity reference: a recipe, item, day or delivery named inside copy. Inline, so it wraps with
   the sentence and is never cut off. Link refs open the thing; static refs only stand out. */
.mref { position:relative; display:inline; padding:.1em .38em .12em; margin:0 .03em; border-radius:7px; background:var(--surface-fill); color:var(--ink); font-weight:600; text-decoration:none; -webkit-box-decoration-break:clone; box-decoration-break:clone; cursor:pointer; transition:background .12s; }
.mref:active { background:var(--surface-strong); }
.mref::after { content:""; position:absolute; inset:-10px -2px; }
.mref > .ic { display:inline-block; width:1.08em; height:1.08em; margin-right:.3em; vertical-align:-.17em; color:var(--ink-2); stroke-width:2; }
.mref--accent { background:var(--accent-soft); color:var(--accent-text); }
.mref--accent > .ic { color:var(--accent-text); }
.mref--static { padding:0; margin:0; background:none; cursor:inherit; color:inherit; }
.mrow__meta .mref--static { color:var(--ink); }
.mref--static::after { content:none; }
.mline { display:block; min-width:0; }

/* Product row: the picture opens the item, the rest of the row changes the amount. */
.mpicbtn { position:relative; flex:none; padding:0; border-radius:13px; text-decoration:none; color:inherit; }
.mpicbtn__go { position:absolute; right:-5px; bottom:-5px; width:20px; height:20px; border-radius:50%; background:var(--surface-raised); box-shadow:0 0 0 1px var(--line-strong); color:var(--ink-2); display:grid; place-items:center; }
.mpicbtn__go .ic { width:12px; height:12px; stroke-width:2.6; }
.mqty { flex:none; display:inline-flex; align-items:center; gap:1px; height:30px; padding:0 6px 0 10px; border-radius:15px; background:var(--surface-fill); color:var(--ink); font:600 14px/1 var(--font-text); font-variant-numeric:tabular-nums; }
.mqty .ic { width:14px; height:14px; stroke-width:2.4; color:var(--ink-3); transition:transform .2s; }
.mqty--open { background:var(--ink); color:var(--surface-raised); }
.mqty--open .ic { color:var(--surface-raised); transform:rotate(180deg); }

/* Sheet stack: a page pushed inside a sheet. Back returns to the sheet as it was. */
.msheetnav { display:flex; align-items:center; height:44px; margin:-4px -12px 8px; }
.msheetnav__back { display:flex; align-items:center; gap:2px; height:44px; padding:0 8px 0 2px; color:var(--accent-text); font:400 17px/1 var(--font-text); }
.msheetnav__back .ic { width:24px; height:24px; }

/* Food groups as icons. */
.mgroups { display:flex; flex-wrap:wrap; gap:6px; }
.mgroup { display:inline-flex; align-items:center; gap:5px; height:32px; padding:0 10px 0 8px; border-radius:16px; background:var(--ok-soft); color:var(--ok); font:600 13px/1 var(--font-text); }
.mgroup .ic { width:18px; height:18px; }
.mgroup:not(:has(span)) { padding:0 7px; }

/* "i" explainers. */
.minfo { width:32px; height:32px; display:inline-grid; place-items:center; color:var(--ink-3); vertical-align:middle; flex:none; }
.minfo .ic { width:18px; height:18px; }
.minfo__title { margin:0; }
.minfo__text { margin:8px 0 18px; font:400 15px/1.45 var(--font-text); color:var(--ink-2); }
.minfo__ok { width:100%; }

/* A page's actions, pinned above the tab bar. Pages with one leave room for it. */
.mbar { position:fixed; left:0; right:0; top:calc(var(--app-h, 100dvh) - var(--tabbar) - 72px); height:72px; box-sizing:border-box; z-index:20; padding:12px 18px 10px; background:linear-gradient(to bottom, transparent, var(--surface-page) 30%); pointer-events:none; }
.mbar__inner { max-width:524px; margin:0 auto; display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); gap:8px; pointer-events:auto; }
.screen:has(.mbar) { padding-bottom:calc(var(--tabbar) + 96px); }

/* First-load placeholders. */
.msk { border-radius:14px; background:var(--surface-fill); animation:msk 1.4s ease-in-out infinite; }
.msk--hero { height:230px; border-radius:28px; margin-bottom:16px; }
.msk--title { height:28px; width:60%; margin:8px 0 12px; }
.msk--line { height:14px; width:40%; margin-bottom:22px; }
.msk--list { height:180px; border-radius:var(--radius-card); margin-bottom:14px; }
@keyframes msk { 50% { opacity:.55; } }
@media (prefers-reduced-motion: reduce) { .msk { animation:none; } }


/* Plan on the shared pieces */
.mrow__btn { width:40px; height:40px; border-radius:50%; display:grid; place-items:center; color:var(--ink-3); }
.mrow__btn .ic { width:20px; height:20px; }
.wk-month { display:inline-flex; align-items:center; gap:6px; height:40px; padding:0 12px; border-radius:20px; color:var(--ink); font:600 15px/1 var(--font-text); }
.wk-month .ic { width:18px; height:18px; color:var(--ink-2); }
.wk-month .wk-month__chev { width:16px; height:16px; }
.wk-dh__n { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:4px 10px; }
.wk-days { animation:none; }
.wk-days--in-right { animation:wk-in-right .28s cubic-bezier(.2,.8,.2,1); }
.wk-days--in-left { animation:wk-in-left .28s cubic-bezier(.2,.8,.2,1); }
@keyframes wk-in-right { from { opacity:0; transform:translateX(24px); } }
@keyframes wk-in-left { from { opacity:0; transform:translateX(-24px); } }
@media (prefers-reduced-motion: reduce) { .wk-days--in-right, .wk-days--in-left { animation:none; } }
.wk-daysec--past .mlist { opacity:.6; }
.mo-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.mo-head h2 { margin:0; }
.mo-head button { width:44px; height:44px; display:grid; place-items:center; color:var(--accent-text); }
.mo-grid { display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); gap:4px; }
.mo-w { text-align:center; font:500 12px/1 var(--font-text); color:var(--ink-3); padding:4px 0 8px; }
.mo-day { display:grid; justify-items:center; gap:4px; padding:8px 0 6px; border-radius:12px; font:600 16px/1 var(--font-text); color:var(--ink); }
.mo-day--past { color:var(--ink-3); }
.mo-day--week { background:var(--surface-fill); }
.mo-day--today { background:var(--accent); color:var(--on-accent); }
.mo-dots { height:5px; display:flex; }
.mo-dot { width:5px; height:5px; border-radius:50%; background:var(--ink-3); }
.mo-dot--done { background:var(--ok); }
.mo-day--today .mo-dot { background:var(--on-accent); }
.mo-today { width:100%; margin-top:14px; }
.rc-facts { display:flex; flex-wrap:wrap; align-items:center; gap:6px 14px; margin:10px 0 12px; font:500 13px/1.35 var(--font-text); color:var(--ink-2); }
.rc-kcal { display:inline-flex; align-items:center; gap:0; }
.rc-kcal .minfo { width:26px; height:26px; }
.mhero { margin-top:4px; }
.mhero .mx--tile { aspect-ratio:16/10; border-radius:24px; }
.lib-card__meta { display:flex; flex-wrap:wrap; gap:4px 10px; }
.lib-sk { aspect-ratio:4/3; border-radius:18px; }
.idea-sum { display:inline-flex; align-items:center; gap:10px; }
.sw-opt { align-items:center; }
.sw-opt .mrow__meta { margin-top:1px; }
.now-soon { margin-top:14px; }
.mstack { display:flex; align-items:center; padding-right:6px; }
.mstack .mx { margin-right:-8px; box-shadow:0 0 0 2px var(--surface-raised); }
.mx--round { border-radius:50%; }
.wk-daysec--folded { margin-top:8px; }
.wk-daysec--folded:first-of-type { margin-top:16px; }
.wk-fold { display:flex; align-items:center; gap:10px; width:100%; height:48px; padding:0 12px 0 14px; border-radius:var(--radius-tile); background:var(--surface-raised); border:1px solid var(--line); color:var(--ink-2); text-align:left; }
.wk-fold__t { font:600 15px/1 var(--font-text); }
.wk-fold__n { flex:1; text-align:right; font:400 13px/1 var(--font-text); color:var(--ink-3); }
.wk-fold .wk-fold__chev { width:18px; height:18px; color:var(--ink-3); }
.wk-dh__toggle { display:inline-flex; align-items:center; gap:6px; color:var(--ink); }
.wk-dh__toggle .ic { width:16px; height:16px; color:var(--ink-3); }
.pc-pic .mx { width:100%; height:100%; aspect-ratio:auto; border-radius:inherit; }
.turnon { margin:14px 0 4px; }
.prow-order { margin-bottom:14px; }
.mstat--busy { color:var(--accent-text); }
.mstat--busy .ic { animation:mspin 1s linear infinite; }
@keyframes mspin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mstat--busy .ic { animation:none; } }

/* ---------- Me ---------- */
.mx--out { background:var(--out-soft); color:var(--out); }
.mx--low { background:var(--low-soft); color:var(--low); }
.me-hero, .me-budget { display:grid; gap:14px; width:100%; padding:16px; box-sizing:border-box; text-align:left; background:var(--surface-raised); border:1px solid var(--line); border-radius:var(--radius-card); color:inherit; }
.me-budget { gap:12px; }
.me-hero--out { border-color:var(--out); }
.me-hero--low { border-color:var(--low); }
.me-hero__top { display:flex; align-items:center; gap:14px; width:100%; text-align:left; color:inherit; }
.me-hero__top .mrow__text { flex:1; min-width:0; }
.me-hero__title { font:700 20px/1.2 var(--font-display); letter-spacing:-.02em; }
.me-hero__title--muted { color:var(--ink-2); }
.me-hero .m-btn { margin:0; }
.me-amt { display:flex; align-items:baseline; gap:8px; }
.me-amt__v { font:700 34px/1.1 var(--font-display); letter-spacing:-.03em; }
.me-amt__of { font:400 15px/1 var(--font-text); color:var(--ink-2); }
.me-amt .pchev { margin-left:auto; align-self:center; }
.me-bar-wrap { position:relative; }
.me-bar { display:flex; height:10px; border-radius:5px; overflow:hidden; background:var(--surface-fill); }
.me-bar__seg { display:block; height:100%; width:0; flex:none; }
.me-bar__seg--ok { background:var(--ok); }
.me-bar__seg--low { background:var(--low); }
.me-bar__seg--out { background:var(--out); }
.me-bar__seg--wait { opacity:.45; }
.me-bar__line { position:absolute; top:-3px; bottom:-3px; width:2px; margin-left:-1px; border-radius:1px; background:var(--ink); }
.me-chart { padding-bottom:12px; }
.me-chart__plot { position:relative; height:120px; margin-top:16px; }
.me-weeks { display:flex; align-items:flex-end; gap:6px; height:100%; }
.me-weeks--labels { height:auto; margin-top:-4px; }
.me-week { flex:1; min-width:0; height:100%; display:flex; flex-direction:column; justify-content:flex-end; }
.me-week__l { flex:1; min-width:0; text-align:center; font:400 11px/1.2 var(--font-text); color:var(--ink-3); font-variant-numeric:tabular-nums; }
.me-week__bar { display:block; width:100%; height:0; border-radius:4px 4px 0 0; background:var(--surface-strong); }
.me-week__bar--under { border-radius:0; }
.me-week__bar--wait { opacity:.45; }
.me-wk--ok { background:var(--ok); }
.me-wk--low { background:var(--low); }
.me-wk--out { background:var(--out); }
.me-budgetline { position:absolute; left:0; right:0; height:0; border-top:1.5px dashed var(--ink-3); pointer-events:none; }
.me-budgetline span { position:absolute; right:0; bottom:2px; font:500 11px/1 var(--font-text); color:var(--ink-3); }
.me-stepper { display:inline-flex; align-items:center; gap:6px; }
.me-stepper button { width:36px; height:36px; border-radius:50%; display:grid; place-items:center; background:var(--surface-fill); color:var(--ink); }
.me-stepper button .ic { width:18px; height:18px; stroke-width:2.2; }
.me-stepper__v { min-width:62px; text-align:center; font:600 15px/1 var(--font-text); font-variant-numeric:tabular-nums; }
.me-chips { display:flex; gap:8px; }
.me-chip { flex:1; height:46px; border-radius:12px; background:var(--surface-fill); color:var(--ink-2); font:600 15px/1 var(--font-text); }
.me-chip[aria-pressed="true"] { background:var(--accent); color:var(--on-accent); }
.me-stack { display:grid; gap:8px; margin-top:14px; }
.me-fields { margin:14px 0 16px; }
.me-field { display:grid; gap:6px; }
.me-field label { font:600 13px/1.3 var(--font-text); color:var(--ink-2); }
.me-field input { width:100%; box-sizing:border-box; height:48px; padding:0 14px; border-radius:12px; background:var(--surface-fill); border:1px solid var(--line); color:var(--ink); font:16px/1.3 var(--font-text); }
.me-field input:focus { outline:none; border-color:var(--accent); }
.me-code { text-align:center; letter-spacing:.35em; font:600 24px/1.2 var(--font-text); }
.m-btn.me-danger { background:var(--out-soft); color:var(--out); box-shadow:none; }
.me-end { margin-top:24px; }
.me-value { font:400 15px/1 var(--font-text); color:var(--ink-2); font-variant-numeric:tabular-nums; }
.me-value--ink { color:var(--ink); font-weight:500; }
.me-small { margin:0; }
.me-install { margin-bottom:12px; }
.me-device-tag { font:600 12px/1.2 var(--font-text); padding:2px 8px; border-radius:6px; background:var(--accent-soft); color:var(--accent-text); }
.me-sheet-title { display:flex; align-items:center; justify-content:space-between; }
.me-sheet-list { margin:12px 0 16px; }
.me-big { display:flex; align-items:center; justify-content:center; gap:22px; margin:22px 0 20px; }
.me-big__v { min-width:110px; text-align:center; font:700 44px/1 var(--font-display); letter-spacing:-.03em; }
.me-big .me-stepper button { width:44px; height:44px; }
.me-tick { width:22px; height:22px; border-radius:50%; display:grid; place-items:center; flex:none; }
