/* Thali · Warm Thali v2 (+ mobile concept: member pill tabs, thumb-zone action bars)
   Spice palette on cream paper. Young Serif for headings, Mukta for body and Devanagari.
   Family colours (indigo, peacock, beetroot, plum, kajal slate, kattha brown) are for people only, never for
   status; people 7 and 8 reuse a colour with a dashed ring (.alt).
   Status is always an icon plus a word: "Enough" (cardamom, tick) or "A little short" (turmeric, half circle). */

:root {
  --table: #F6EEDD;
  --paper: #FFFAF0;
  --paper-2: #FBF1DE;
  --ink: #2B1E15;
  --muted: #6E5847;
  --line: #E8D9BF;
  --line-strong: #CDB797;
  --haldi: #D99A12;
  --haldi-ink: #8A5E00;
  --haldi-soft: #F8E4AE;
  --terra: #B4532E;
  --terra-hover: #9C4524;
  --terra-ink: #FFF6EC;
  --terra-soft: #F4D7C7;
  --elaichi: #56784A;
  --elaichi-ink: #3F5C35;
  --elaichi-soft: #DDE7CF;
  --err: #9C2F1C;
  --err-soft: #F7DCD3;
  --p1: #3B5B9A; --p1-soft: #DCE3F2;
  --p2: #1E6E7E; --p2-soft: #D2E8EC;
  --p3: #8A2F55; --p3-soft: #F1D6E1;
  --p4: #6A4C9C; --p4-soft: #E5DDF2;
  --p5: #46566A; --p5-soft: #DEE3EA;
  --p6: #7A4E2D; --p6-soft: #EEDFD1;
  --skel: #EFE3CC;
  --nav-h: 68px;
  --steel-hi: #F7F6F2; --steel-lo: #C8C3B8; --steel-rim: #A59F93;
  --dal: #E9B42E; --sabzi: #7E9A4A; --roti: #E6C28A; --roti-spot: #C08E4E; --rice: #FFFDF6; --rice-grain: #E5DCC3; --salad: #C7452F; --chaas: #F3EEDF;
  --wa: #1A7F4B; --wa-ink: #FFFFFF; --wa-bubble: #E1F5D2; --wa-chat: #EDE5D8;
  --shadow: 0 1px 0 rgba(43,30,21,.04), 0 18px 40px -18px rgba(90,55,25,.35);
  --shadow-sm: 0 1px 3px rgba(60,35,15,.15);
  --display: "Young Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Mukta", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 16px;
  --tap: 48px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --table: #18110C; --paper: #221912; --paper-2: #2C2118; --ink: #F4E8D4; --muted: #BBA58D; --line: #3D2F23; --line-strong: #5A4634;
    --haldi: #F0B53C; --haldi-ink: #F0B53C; --haldi-soft: #433214; --terra: #E0774E; --terra-hover: #EA8A63; --terra-ink: #1E120B; --terra-soft: #45261A;
    --elaichi: #9BBE84; --elaichi-ink: #9BBE84; --elaichi-soft: #263322; --err: #F08A74; --err-soft: #47201A;
    --p1: #93AAE2; --p1-soft: #232E48; --p2: #6FC3D2; --p2-soft: #16343A; --p3: #E58BAE; --p3-soft: #45222F; --p4: #BCA3EA; --p4-soft: #2E2543;
    --p5: #AEBBCB; --p5-soft: #2A313B; --p6: #D7AE8A; --p6-soft: #3A2A1E; --skel: #33271D;
    --steel-hi: #6F6A62; --steel-lo: #3E3A35; --steel-rim: #2A2724;
    --dal: #D9A223; --sabzi: #6E8B3E; --roti: #C9A26B; --roti-spot: #8E6534; --rice: #E9E3D3; --rice-grain: #BDB39A; --salad: #B23E2A; --chaas: #D9D2BF;
    --wa: #3FBF7A; --wa-ink: #0E1F15; --wa-bubble: #1F3A2A; --wa-chat: #1A1510;
    --shadow: 0 18px 40px -18px rgba(0,0,0,.7); --shadow-sm: 0 1px 3px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --table: #18110C; --paper: #221912; --paper-2: #2C2118; --ink: #F4E8D4; --muted: #BBA58D; --line: #3D2F23; --line-strong: #5A4634;
  --haldi: #F0B53C; --haldi-ink: #F0B53C; --haldi-soft: #433214; --terra: #E0774E; --terra-hover: #EA8A63; --terra-ink: #1E120B; --terra-soft: #45261A;
  --elaichi: #9BBE84; --elaichi-ink: #9BBE84; --elaichi-soft: #263322; --err: #F08A74; --err-soft: #47201A;
  --p1: #93AAE2; --p1-soft: #232E48; --p2: #6FC3D2; --p2-soft: #16343A; --p3: #E58BAE; --p3-soft: #45222F; --p4: #BCA3EA; --p4-soft: #2E2543;
    --p5: #AEBBCB; --p5-soft: #2A313B; --p6: #D7AE8A; --p6-soft: #3A2A1E; --skel: #33271D;
  --steel-hi: #6F6A62; --steel-lo: #3E3A35; --steel-rim: #2A2724;
  --dal: #D9A223; --sabzi: #6E8B3E; --roti: #C9A26B; --roti-spot: #8E6534; --rice: #E9E3D3; --rice-grain: #BDB39A; --salad: #B23E2A; --chaas: #D9D2BF;
  --wa: #3FBF7A; --wa-ink: #0E1F15; --wa-bubble: #1F3A2A; --wa-chat: #1A1510;
  --shadow: 0 18px 40px -18px rgba(0,0,0,.7); --shadow-sm: 0 1px 3px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: page-exit .18s cubic-bezier(.22,.61,.36,1) both; }
::view-transition-new(root) { animation: page-enter .32s cubic-bezier(.22,.61,.36,1) both; }
@keyframes page-exit { to { opacity: 0; transform: translateY(-4px); } }
@keyframes page-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* Fill "backwards", never "both": a transform kept on <body> after the animation makes body the
   containing block of the fixed .tabbar, which then sits at the end of a long page (Week) instead of
   the bottom of the screen. */
@supports not (view-transition-name: root) {
  body { animation: page-enter .28s cubic-bezier(.22,.61,.36,1) backwards; }
}
body {
  margin: 0; background: var(--table); color: var(--ink);
  font-family: var(--body); font-size: 1.125rem; line-height: 1.5;
  overflow-wrap: break-word; min-height: 100vh;
}
h1, h2, h3, h4, h5 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -.005em; }
h1 { font-size: clamp(1.9rem, 6vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 4.5vw, 1.9rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
a { color: var(--terra); text-underline-offset: 3px; }
a:hover { color: var(--terra-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--terra); outline-offset: 2px; border-radius: 8px; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[lang="hi"] { font-family: var(--body); }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; z-index: 50; }
.skip:focus { top: 12px; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .85em; background: var(--paper-2); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding-inline: 16px; }
.wrap.wide { max-width: 1040px; }
.paper { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 20px 16px; box-shadow: var(--shadow); }
@media (min-width: 600px) { .paper { padding: 28px; } }

.eyebrow { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--terra); }
.kicker { font-size: .95rem; color: var(--muted); font-weight: 500; }
.hint { font-size: .95rem; color: var(--muted); }
.note { font-size: .95rem; color: var(--muted); background: var(--paper-2); border-radius: 14px; padding: 10px 14px; }

/* ---------------------------------------------------------------- app bar */
.appbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.35rem; color: var(--ink); text-decoration: none; min-height: var(--tap); }
.brand:hover { color: var(--ink); }
.brand svg { width: 32px; height: 32px; flex: none; }
.appbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* account menu */
.acct { position: relative; }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 14px 4px 5px; cursor: pointer; max-width: 220px; }
.acct-btn .av { width: 36px; height: 36px; font-size: 1rem; }
.acct-btn span.lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; font-weight: 500; }
@media (max-width: 479px) { .acct-btn { padding-right: 5px; } .acct-btn span.lbl { display: none; } }
.acct-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); min-width: 240px; padding: 6px; z-index: 30; display: grid; }
.acct-menu .who-line { padding: 8px 12px 10px; font-size: .9rem; color: var(--muted); border-bottom: 1px dotted var(--line); margin-bottom: 4px; overflow-wrap: anywhere; }
.acct-menu a, .acct-menu button, .acct-menu form { display: flex; align-items: center; min-height: var(--tap); padding: 0 12px; border-radius: 10px; border: 0; background: none; text-align: left; color: var(--ink); text-decoration: none; cursor: pointer; font-size: 1rem; width: 100%; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--paper-2); color: var(--ink); }

/* ---------------------------------------------------------------- buttons */
.btn, .cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: var(--tap); border: 1px solid transparent; border-radius: var(--radius);
  padding: 10px 20px; font-weight: 600; font-size: 1.05rem; line-height: 1.2; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .05s;
}
.btn:active, .cta:active { transform: translateY(1px); }
.btn-primary, .cta { background: var(--terra); color: var(--terra-ink); }
.btn-primary:hover, .cta:hover { background: var(--terra-hover); color: var(--terra-ink); }
.btn-ghost, .cta.ghost { background: var(--paper); color: var(--ink); border-color: var(--line-strong); font-weight: 500; }
.btn-ghost:hover, .cta.ghost:hover { background: var(--paper-2); color: var(--ink); }
.btn-wa { background: var(--wa); color: var(--wa-ink); }
.btn-wa:hover { color: var(--wa-ink); filter: brightness(1.06); }
.btn-danger { background: var(--paper); color: var(--err); border-color: var(--err); font-weight: 500; }
.btn-danger:hover { background: var(--err-soft); color: var(--err); }
.btn-sm { min-height: 44px; padding: 6px 14px; font-size: .95rem; border-radius: 999px; }
.btn-block, .cta { width: 100%; }
.btn[disabled], .cta[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg, .cta svg { width: 20px; height: 20px; flex: none; }
.stack { display: grid; gap: 10px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.linkbtn { background: none; border: 0; color: var(--terra); font-weight: 600; cursor: pointer; padding: 4px 2px; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; min-height: 44px; }
.linkbtn:hover { color: var(--terra-hover); }

/* ---------------------------------------------------------------- avatars & status */
.av { --c: var(--p1); --s: var(--p1-soft); width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--s); color: var(--c); font-family: var(--display); font-size: 1.1rem; flex: none; box-shadow: inset 0 0 0 2px var(--c); line-height: 1; }
.av.p1 { --c: var(--p1); --s: var(--p1-soft); }
.av.p2 { --c: var(--p2); --s: var(--p2-soft); }
.av.p3 { --c: var(--p3); --s: var(--p3-soft); }
.av.p4 { --c: var(--p4); --s: var(--p4-soft); }
.av.p5 { --c: var(--p5); --s: var(--p5-soft); }
.av.p6 { --c: var(--p6); --s: var(--p6-soft); }
.av.alt { box-shadow: none; outline: 2px dashed var(--c); outline-offset: -2px; }
.av.lg { width: 48px; height: 48px; font-size: 1.25rem; }
.av.fam { --c: var(--terra); --s: var(--terra-soft); }
.av.sm { width: 30px; height: 30px; font-size: .85rem; }

.st { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 2px 10px 2px 6px; font-size: .85rem; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.st svg { width: 14px; height: 14px; flex: none; }
.st.ok { background: var(--elaichi-soft); color: var(--elaichi-ink); }
.st.gap { background: var(--haldi-soft); color: var(--haldi-ink); }

/* ---------------------------------------------------------------- messages / banners */
.msg { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; border-radius: 14px; padding: 12px 14px; font-size: 1rem; line-height: 1.45; }
.msg .ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; margin-top: 1px; }
.msg.err { background: var(--err-soft); }
.msg.err .ic { background: var(--err); color: var(--paper); }
.msg.ok { background: var(--elaichi-soft); }
.msg.ok .ic { background: var(--elaichi); color: var(--paper); }
.msg.info { background: var(--paper-2); border: 1px solid var(--line); }
.msg.info .ic { background: var(--haldi); color: var(--ink); }
.msg ul { margin: 6px 0 0; padding-left: 1.1em; }
.msg .act { margin-top: 10px; }
.msg .err-code { display: block; margin-top: 4px; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }

.banner { display: grid; gap: 10px; background: var(--haldi-soft); border-radius: 18px; padding: 14px 16px; margin: 0 0 16px; }
.banner b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.banner p { font-size: 1rem; }
@media (min-width: 600px) { .banner { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; margin: 0 0 18px; min-width: 0; }
.field > label, legend, .lbl { font-size: 1rem; font-weight: 600; }
.field .opt { color: var(--muted); font-weight: 400; }
input[type=text], input[type=email], input[type=number], input[type=tel], select, textarea {
  width: 100%; min-height: 52px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--paper);
  padding: 10px 14px; font-size: 1.1rem; color: var(--ink); outline: none;
}
select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-soft); }
input::placeholder { color: var(--muted); opacity: .8; }
.invalid input, .invalid select, input[aria-invalid="true"] { border-color: var(--err); }
span.err { color: var(--err); font-size: .95rem; font-weight: 500; }
span.err:empty { display: none; }
span.err::before { content: "! "; font-weight: 700; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; }

/* segmented radio choice */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--paper-2); border-radius: 16px; padding: 4px; gap: 4px; }
.seg.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg label, .seg button, .seg a { position: relative; display: grid; justify-items: center; align-content: center; text-align: center; min-height: 56px; border: 0; background: transparent; border-radius: 12px; padding: 6px 4px; font-size: 1rem; font-weight: 500; cursor: pointer; line-height: 1.2; color: var(--ink); }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg small { font-size: .8rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.seg label:has(input:checked), .seg button[aria-pressed="true"], .seg a[aria-pressed="true"] { background: var(--paper); box-shadow: var(--shadow-sm); color: var(--terra); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--terra); outline-offset: 1px; }
/* Send: every kind (incl. Groceries) on one line - one equal column per kind, never wraps */
.seg.seg-send { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.seg.seg-send a { min-height: 48px; min-width: 0; padding: 6px 2px; font-size: clamp(.8rem, 3.6vw, 1rem); overflow-wrap: normal; white-space: nowrap; }
.seg.seg-send a > span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.seg.seg-send small { font-size: clamp(.7rem, 3vw, .8rem); }
.seg.seg-send a:focus-visible { outline: 3px solid var(--terra); outline-offset: 1px; }
.seg-send .sk-short { display: none; }
@media (max-width: 359px) { .seg-send .sk-full { display: none; } .seg-send .sk-short { display: inline; } }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 16px; font-size: 1rem; background: var(--paper); }
.chip input:checked + span { background: var(--terra-soft); border-color: var(--terra); }
.chip input:checked + span::before { content: "✓ "; white-space: pre; color: var(--terra); font-weight: 700; }
.chip input:focus-visible + span { outline: 3px solid var(--terra); outline-offset: 2px; }

/* checkbox row */
.check { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; cursor: pointer; font-weight: 400; padding: 6px 0; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--terra); }
.check .hint { display: block; }
.check.keep { min-height: 48px; align-items: center; margin-bottom: 8px; }
.check.keep input { margin: 0; }

.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }

/* ---------------------------------------------------------------- in-flow notes, flash, inline confirm
   No floating layers: status lines and confirmations sit where the action happened and push content down. */
.note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--elaichi-soft); font-size: 1rem; }
.note > span { flex: 1 1 12em; min-width: 0; }
.note-x { min-width: 40px; min-height: 40px; border: 0; background: none; color: var(--muted); font-size: 1.3rem; cursor: pointer; border-radius: 10px; }
.note-x:hover { background: var(--paper-2); color: var(--ink); }
.flash { margin-bottom: 16px; }
.flash-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.confirm-row { display: grid; gap: 10px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--err-soft); }
.confirm-row p { margin: 0; }
.confirm-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.acct-menu .confirm-row { padding: 10px; }
.acct-menu .confirm-btns button { justify-content: center; }
/* Today's ⋯ menu opens in place (in the day bar), not as a floating popover. */
.daybar-top { flex-wrap: wrap; }
.more-menu > summary { list-style: none; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu[open] { flex: 1 0 100%; margin-top: -44px; display: grid; justify-items: end; }
.more-menu .acct-menu { position: static; justify-self: stretch; margin-top: 6px; box-shadow: none; min-width: 0; }

.loading { text-align: center; padding: 64px 16px; color: var(--muted); display: grid; gap: 14px; justify-items: center; }
.loading .spin { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--terra); border-radius: 50%; animation: spin .8s linear infinite; }
.auth-loading { padding: 32px 16px; font-size: .95rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { padding-block: 28px 40px; font-size: .9rem; color: var(--muted); display: grid; gap: 10px; }

/* ================================================================ LOGIN */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-card { max-width: 460px; width: 100%; margin: 8px auto 40px; }
.lang { display: inline-flex; background: var(--paper-2); border-radius: 999px; padding: 4px; gap: 2px; border: 1px solid var(--line); }
.lang button { border: 0; background: none; border-radius: 999px; padding: 4px 14px; min-height: 40px; font-size: .95rem; font-weight: 500; cursor: pointer; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--paper); color: var(--terra); box-shadow: var(--shadow-sm); }
.hello-mark { width: 64px; height: 64px; }
html:lang(hi) h1, html:lang(hi) h2, .hello h1:lang(hi) { font-family: var(--body); font-weight: 700; line-height: 1.3; }
.authstack { display: grid; gap: 14px; }
.scr-title { font-size: clamp(1.7rem, 6vw, 2rem); line-height: 1.12; }
.scr-sub { color: var(--muted); font-size: 1.02rem; }
.timer { font-size: 1rem; color: var(--muted); text-align: center; }
.timer b { font-variant-numeric: tabular-nums; color: var(--ink); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px dotted var(--line-strong); }
.email-show { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
/* ---- login page v3 (login.html): no card, content straight on the warm page, minimal text */
.lg-page { --gsi-bg: #FFFFFF; --gsi-ink: #1F1F1F; --gsi-line: #747775; --gsi-hover: #F2F2F2;
  width: 100%; max-width: 400px; margin: 0 auto; padding: 0 16px max(32px, env(safe-area-inset-bottom)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lg-page { --gsi-bg: #131314; --gsi-ink: #E3E3E3; --gsi-line: #8E918F; --gsi-hover: #1F1F20; } }
:root[data-theme="dark"] .lg-page { --gsi-bg: #131314; --gsi-ink: #E3E3E3; --gsi-line: #8E918F; --gsi-hover: #1F1F20; }
.lg-top { display: flex; justify-content: flex-end; padding-top: 10px; }
.lg-page .lang { padding: 2px; }
.lg-page .lang button { position: relative; min-height: 36px; padding: 2px 12px; font-size: .88rem; }
.lg-page .lang button::after { content: ""; position: absolute; inset: -6px -2px; } /* 48px tap area */
.lg-brand { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px auto 18px; width: max-content;
  font-family: var(--display); font-size: 1.6rem; color: var(--ink); text-decoration: none; border-radius: 12px; }
.lg-brand:hover { color: var(--ink); }
.lg-brand svg { width: 64px; height: 64px; }
.lg section { display: grid; gap: 14px; text-align: center; }
.lg .lg-h { font-size: clamp(1.45rem, 5.6vw, 1.75rem); line-height: 1.2; outline: none; }
.lg-sub { color: var(--muted); font-size: 1.02rem; margin: -6px 0 0; overflow-wrap: anywhere; }
.lg-join { justify-self: center; background: var(--haldi-soft); color: var(--haldi-ink); border-radius: 999px; padding: 4px 14px; font-size: .95rem; font-weight: 600; }
.lg-form { display: grid; gap: 8px; text-align: left; }
.lg-label { font-weight: 600; font-size: 1rem; }
.lg-form .btn { margin-top: 4px; }
.lg .check.keep { text-align: left; margin: 0; }
.lg .check .hint { font-size: .85rem; }
.lg .msg { text-align: left; }
.lg .or { margin: 0; }
.lg-fine { font-size: .85rem; color: var(--muted); margin: 0; }
.lg .linkbtn { justify-self: center; min-height: var(--tap); padding-inline: 12px; }
.btn-google { background: var(--gsi-bg); color: var(--gsi-ink); border-color: var(--gsi-line); font-family: Roboto, var(--body); font-weight: 500; gap: 12px; }
.btn-google:hover { background: var(--gsi-hover); color: var(--gsi-ink); }
.btn-google svg { width: 20px; height: 20px; flex: none; }
.lg .mailmark { width: 88px; height: 66px; justify-self: center; }
.lg .timer { margin: 0; }
@media (prefers-reduced-motion: no-preference) { .lg section:not([hidden]) { animation: lgin .25s ease-out both; } @keyframes lgin { from { opacity: 0; } } }
@media (min-width: 600px) { .lg-brand { margin: 32px auto 28px; } }
/* ---- end login page v3 */

/* ================================================================ HOME / ONBOARDING */
.hero { display: grid; gap: 22px; padding: 12px 0 32px; }
.hero h1 em { font-style: normal; color: var(--terra); }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.hero .cta-row { display: grid; gap: 10px; justify-items: start; }
.hero .cta-row .btn { min-width: 240px; }
.hero-art { display: none; }
.gets { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 14px; }
.gets li { border-top: 1px solid var(--line); padding-top: 12px; }
.gets b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.2rem; margin-bottom: 2px; }
.gets span { color: var(--muted); font-size: 1rem; }
@media (min-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 48px; padding: 32px 0 48px; }
  .hero-art { display: block; width: 100%; max-width: 360px; justify-self: center; }
  .gets { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-column: 1 / -1; gap: 24px; }
}

.steps { display: flex; gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
/* Signed-out landing: kicker (no more 'aaj kya banega?') + one promise (goal-based meals), one CTA, a preview card. 8/16/24/32 rhythm. */
.land { display: grid; gap: 24px; padding-top: 8px; }
.lhero { display: grid; gap: 24px; }
.lcopy { display: grid; gap: 16px; justify-items: start; align-content: center; }
.lcopy .kicker { margin: 0 0 -8px; font-size: 1.15rem; font-weight: 600; line-height: 1.3; color: var(--terra); }
.lcopy h1 em { font-style: normal; color: var(--terra); }
.btn-xl { min-height: 56px; font-size: 1.15rem; padding: 12px 28px; width: 100%; max-width: 360px; }
.trust { margin: 0; font-size: .9rem; color: var(--elaichi-ink); font-weight: 500; }
.gcard { justify-self: center; width: 100%; max-width: 420px; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 16px; }
.ghead { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.ghead span { margin-left: auto; font-family: var(--display); font-size: 1.1rem; }
.mlogo { width: 28px; height: 28px; }
.grows { list-style: none; margin: 0; padding: 0; display: grid; }
.grows li { border-top: 1px solid var(--line); padding: 8px 0 8px 12px; box-shadow: inset 3px 0 0 var(--c); }
.grows li > div { display: grid; gap: 2px; font-size: .92rem; line-height: 1.35; }
.grows .p1 { --c: var(--p1); --s: var(--p1-soft); } .grows .p2 { --c: var(--p2); --s: var(--p2-soft); } .grows .p3 { --c: var(--p3); --s: var(--p3-soft); }
.grows p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.goal { background: var(--s); color: var(--c); border-radius: 999px; padding: 0 8px; font-size: .8rem; font-weight: 600; }
.gport { color: var(--muted); }
.gmac { font-variant-numeric: tabular-nums; font-size: .85rem; }
.gmac span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; background: var(--m); }
.mp { --m: var(--elaichi); } .mc { --m: var(--haldi); } .mf { --m: var(--terra); }
.gbar { display: flex; height: 6px; border-radius: 6px; overflow: hidden; margin-top: 4px; background: linear-gradient(90deg, var(--elaichi) calc(var(--p) * 1%), var(--haldi) 0 calc((var(--p) + var(--c)) * 1%), var(--terra) 0); }
.lchips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lchips li { border: 1px solid var(--line-strong); background: var(--paper); border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.lchips li::before { content: "✓ "; color: var(--elaichi); font-weight: 700; }
.lfoot { padding-block: 24px 32px; }
.faq { display: grid; gap: 2px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.faq p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }
@media (min-width: 760px) {
  .lhero { grid-template-columns: minmax(0, 1fr) minmax(0, 400px); align-items: center; gap: 32px; padding-top: 16px; }
  .gcard { justify-self: end; }
}
@media (min-width: 1100px) { .land { gap: 32px; padding-top: 32px; } .lhero { gap: 48px; } }
@media (prefers-reduced-motion: no-preference) { .gcard { animation: fadein .5s ease-out both; } @keyframes fadein { from { opacity: 0; } } }
.steps li { flex: 1; height: 5px; border-radius: 5px; background: var(--line); }
.steps li.done, .steps li[aria-current="step"] { background: var(--terra); }
.step-head { margin-bottom: 18px; display: grid; gap: 4px; }
.step-head .scr-sub { margin-top: 2px; }

.seats { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-start; background: var(--paper-2); border: 1.5px dashed var(--line-strong); border-radius: 22px; padding: 14px; margin: 0 0 16px; min-height: 84px; }
.seat { display: grid; justify-items: center; gap: 2px; font-size: .85rem; color: var(--muted); font-weight: 500; max-width: 72px; text-align: center; }
.seat .av { width: 48px; height: 48px; font-size: 1.25rem; }
.seat span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 72px; }

.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.pcard { border: 1px solid var(--line); border-radius: 20px; padding: 16px; background: var(--paper); display: grid; gap: 4px; margin-bottom: 14px; }
.pcard > header { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.pcard > header .t { flex: 1; min-width: 0; }
.pcard > header b { font-family: var(--display); font-weight: 400; font-size: 1.25rem; display: block; line-height: 1.15; }
.pcard > header small { color: var(--muted); font-size: .9rem; }
.pcard .field { margin-bottom: 12px; }

.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.nav .btn { flex: 1 1 160px; }
.nav .btn-primary { flex: 2 1 200px; }

/* ================================================================ PLAN */
.plan-head { display: grid; gap: 4px; margin: 4px 0 14px; }
.plan-head h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
/* Room for the fixed bottom tab bar (its measured height, see bars.js). */
.plan-body { padding-bottom: calc(var(--tabbar-h, calc(var(--nav-h) + env(safe-area-inset-bottom))) + 24px); }

/* tab bar: bottom on phones, top on wide screens */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); background: var(--paper); padding: 4px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -18px rgba(60,35,15,.4); }
.tabbar a { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 56px; font-size: .8rem; color: var(--muted); font-weight: 500; text-decoration: none; border-radius: 12px; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--terra); font-weight: 600; }
.tabbar a[aria-current="page"] svg { stroke-width: 2; }
@media (min-width: 760px) {
  .tabbar { position: sticky; top: 0; bottom: auto; display: flex; gap: 22px; padding: 0; margin: 0 0 18px; border-top: 0; border-bottom: 1px solid var(--line); background: var(--table); box-shadow: none; }
  .tabbar a { display: inline-flex; gap: 8px; font-size: 1.05rem; padding: 0 2px; border-radius: 0; }
  .tabbar a svg { width: 20px; height: 20px; }
  .tabbar a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--terra); }
  .plan-body { padding-bottom: 40px; }
}

.panel-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.panel-title h2 { font-size: clamp(1.6rem, 5vw, 2rem); }

/* Today */
.daynav { display: flex; align-items: center; gap: 6px; }
.daynav button, .daynav a { width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); cursor: pointer; font-size: 1.3rem; line-height: 1; display: grid; place-items: center; }
.daynav button[disabled] { opacity: .4; cursor: not-allowed; }
.mealtabs { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.mealtabs button, .mealtabs a { min-height: 44px; border: 1px solid var(--line-strong); background: var(--paper); border-radius: 999px; padding: 4px 18px; font-size: 1rem; cursor: pointer; }
.mealtabs button[aria-selected="true"], .mealtabs a[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.person-picker { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; margin: 0 0 14px; max-width: 440px; }
.person-picker label { color: var(--muted); font-size: .95rem; }
.person-select { width: 100%; min-width: 0; min-height: 44px; padding: 6px 36px 6px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); }

.mealnum { background: var(--paper-2); border-radius: 20px; padding: 14px; display: grid; gap: 10px; }
.mealnum header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mealnum header b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.mealnum header small { font-size: .85rem; color: var(--muted); }
.macros { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; text-align: center; margin: 0; }
.macros div { background: var(--paper); border-radius: 12px; padding: 8px 2px 6px; line-height: 1.1; min-width: 0; display: flex; flex-direction: column-reverse; align-items: center; }
.macros dd { margin: 0; display: block; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.macros dd small { font-weight: 500; font-size: .75rem; color: var(--muted); }
.macros dt { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin-top: 2px; }
.dayline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .95rem; color: var(--muted); }

.sect { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 400; font-size: 1.2rem; margin: 22px 0 4px; }
.sect svg { width: 22px; height: 22px; flex: none; }
.sect small { font-family: var(--body); font-size: .85rem; color: var(--muted); margin-left: auto; text-align: right; }
.dishes { list-style: none; margin: 0; padding: 0; }
.dishes li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dotted var(--line-strong); }
.kat { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--steel-hi), var(--steel-lo)); position: relative; flex: none; }
.kat::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--k, var(--dal)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.dishes .nm { min-width: 0; font-size: 1.05rem; line-height: 1.25; }
.dishes .nm small { display: block; font-size: .85rem; color: var(--muted); }
.dishes .nm a { font-size: .9rem; font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.meal .mtxt small.recipes a { display: inline-flex; align-items: center; min-height: 44px; }
.dishes .qty { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.05rem; text-align: right; white-space: nowrap; }
.dishes .qty small { font-weight: 400; color: var(--muted); font-size: .9rem; }
.dishes li.extra .nm small { color: var(--haldi-ink); font-weight: 600; }

.bead { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 4px 10px; align-items: center; font-size: 1rem; padding: 7px 0; }
.bead .nm { grid-row: span 2; font-weight: 500; }
.bead .top { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.bead .val { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.bead .trk { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.bead .trk i { display: block; height: 100%; border-radius: 8px; background: var(--haldi); transition: width .3s; }
.bead.ok .trk i { background: var(--elaichi); }

.addon { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 4px 12px; align-items: start; margin-top: 14px; border: 1.5px dashed var(--haldi); border-radius: 16px; padding: 12px 14px; font-size: 1rem; background: var(--paper); }
.addon.done { border-color: var(--elaichi); border-style: solid; }
.addon b { font-weight: 600; }
.addon ul { margin: 4px 0 0; padding-left: 1.1em; }
.bowl { width: 34px; height: 34px; flex: none; border-radius: 50%; background: radial-gradient(circle at 40% 35%, var(--steel-hi), var(--steel-lo)); display: grid; place-items: center; }
.bowl i { width: 20px; height: 20px; border-radius: 50%; background: var(--roti-spot); }
.addon.done .bowl i { background: var(--elaichi); }
.notes { margin: 10px 0 0; padding-left: 1.1em; color: var(--muted); font-size: .95rem; display: grid; gap: 4px; }

/* Week */
.weeklist { border-top: 1px dashed var(--line-strong); }
.day { border-bottom: 1px dashed var(--line-strong); }
.day > button, .day > summary { width: 100%; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: none; border: 0; padding: 12px 0; text-align: left; cursor: pointer; min-height: 64px; }
.date { display: grid; justify-items: center; line-height: 1; gap: 3px; }
.date b { font-family: var(--display); font-weight: 400; font-size: 1.6rem; }
.date small { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.day.today .date b { color: var(--terra); }
.day .sum { font-size: 1.05rem; line-height: 1.3; min-width: 0; }
.day .sum > span:not(.todaypill) { display: block; color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minis { display: flex; gap: 3px; }
.mini { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--steel-hi), var(--steel-lo)); position: relative; }
.mini::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--k, var(--dal)); }
.chev { display: inline-block; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 6px 4px 8px; transition: transform .15s; }
.day.open .chev, .day[open] .chev { transform: rotate(-135deg); margin-bottom: -2px; }
.day .meals { display: none; padding: 0 0 14px 64px; gap: 8px; }
.day.open .meals, .day[open] .meals { display: grid; }
.meals .m { display: grid; grid-template-columns: 92px minmax(0, 1fr); font-size: 1rem; gap: 8px; }
.meals .m small { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; padding-top: 3px; }
.meals .btn { justify-self: start; margin-top: 4px; }
.todaypill { font-size: .7rem; background: var(--terra); color: var(--terra-ink); border-radius: 999px; padding: 1px 8px; font-weight: 600; margin-left: 6px; vertical-align: 3px; text-transform: uppercase; letter-spacing: .06em; }
.weeknote { margin-top: 16px; display: flex; gap: 12px; align-items: center; background: var(--paper-2); border-radius: 16px; padding: 12px 14px; font-size: 1rem; }
.weeknote .dots { display: flex; flex: none; }
.weeknote .dots .av { margin-left: -8px; width: 30px; height: 30px; font-size: .8rem; }
.weeknote .dots .av:first-child { margin-left: 0; }
@media (max-width: 420px) { .day .meals { padding-left: 0; } .meals .m { grid-template-columns: 84px minmax(0, 1fr); } }

/* Grocery */
.gro-top { display: flex; align-items: center; gap: 14px; background: var(--paper-2); border-radius: 18px; padding: 14px; margin-bottom: 14px; }
.ring { width: 56px; height: 56px; flex: none; }
.ring circle { fill: none; stroke-width: 6; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--elaichi); stroke-linecap: round; transition: stroke-dashoffset .3s; }
.gro-top b { font-family: var(--display); font-weight: 400; font-size: 1.2rem; display: block; }
.gro-top small { color: var(--muted); font-size: .9rem; }
.gro { display: grid; gap: 4px 28px; }
@media (min-width: 760px) { .gro { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.cat { margin-bottom: 14px; min-width: 0; }
.cat h3 { font-size: 1.15rem; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.cat h3 i { width: 12px; height: 12px; border-radius: 50%; background: var(--k); flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.cat h3 small { font-family: var(--body); color: var(--muted); font-size: .85rem; margin-left: auto; }
.cat ul { list-style: none; margin: 0; padding: 0; }
.cat li label { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 2px; min-height: 52px; border-bottom: 1px dotted var(--line-strong); font-size: 1.05rem; cursor: pointer; }
.cat input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--muted); margin: 0; display: grid; place-items: center; background: var(--paper); cursor: pointer; }
.cat input:checked { background: var(--elaichi); border-color: var(--elaichi); }
.cat input:checked::after { content: ""; width: 6px; height: 12px; border: solid var(--paper); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }
.cat input:checked ~ span { text-decoration: line-through; text-decoration-color: var(--terra); color: var(--muted); }
.cat .amt { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .95rem; white-space: nowrap; }

/* Share */
.chat { background: var(--wa-chat); border-radius: 22px; padding: 14px; margin: 14px 0; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 14px 14px; }
.chathead { display: flex; align-items: center; gap: 10px; font-size: .95rem; font-weight: 600; margin-bottom: 10px; }
.bubble { background: var(--wa-bubble); border-radius: 14px 14px 14px 4px; padding: 12px 14px; font-size: .98rem; line-height: 1.5; white-space: pre-line; max-width: 100%; box-shadow: 0 1px 1px rgba(0,0,0,.08); max-height: 420px; overflow-y: auto; overflow-wrap: anywhere; }
.bubble pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.4; white-space: pre; overflow-x: auto; margin: 2px 0; }
.card { margin-top: 16px; border: 1px solid var(--line); border-radius: 20px; padding: 14px 16px; display: grid; gap: 10px; background: var(--paper); }
.card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.card header b, .card h3 { font-family: var(--display); font-weight: 400; font-size: 1.2rem; }
.card p { font-size: 1rem; color: var(--muted); }
.invite-url { display: flex; gap: 8px; flex-wrap: wrap; }
.invite-url input { flex: 1 1 220px; font-size: 1rem; }

/* Family */
.people { display: grid; gap: 14px; }
@media (min-width: 760px) { .people { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.people .pcard { margin: 0; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 1rem; }
.stats b { font-variant-numeric: tabular-nums; }
.danger-zone { border-color: var(--err-soft); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after, ::view-transition-old(root), ::view-transition-new(root) { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ================================================================ FIREBASE LOGIN EXTRAS */
.devbox { border: 2px dashed var(--haldi); background: var(--haldi-soft); border-radius: 16px; padding: 14px; display: grid; gap: 8px; }
.devbox .hint { color: var(--ink); }
.devtag { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; color: var(--haldi-ink); }
.devlink { border-style: dashed; border-color: var(--haldi); }
.mailmark { width: 64px; height: 48px; }
.acct-menu button.danger { color: var(--err); border-top: 1px dotted var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; }
.acct-menu button.danger:hover { background: var(--err-soft); color: var(--err); }
.btn-danger-solid { background: var(--err); color: var(--paper); border-color: var(--err); }
.btn-danger-solid:hover { filter: brightness(1.08); color: var(--paper); }

/* ---- server-rendered pages: links and <details> that stand in for script-driven buttons ---- */
.daynav a, .mealtabs a, .who a, .seg a { text-decoration: none; color: inherit; }
.mealtabs a { display: inline-flex; align-items: center; }
.who a { color: var(--muted); }
.seg a small { display: block; }
.day > summary { list-style: none; }
.day > summary::-webkit-details-marker { display: none; }
.acct > summary { list-style: none; }
.acct > summary::-webkit-details-marker { display: none; }
.acct-menu form { padding: 0; display: block; min-height: 0; }
.acct-menu form button { width: 100%; }
.row-btns form, .panel-title form { display: inline; margin: 0; }
.meals .m { align-items: baseline; }
.meals .m:has(form) { grid-template-columns: 92px minmax(0, 1fr) auto; }
.swap-inline { margin: 0; }
.swap-inline .linkbtn { font-size: .9rem; min-height: 44px; }
.swap-form { margin: 12px 0 0; }
.cat .gnote { display: block; font-size: .82rem; color: var(--muted); }
.panel[hidden] { display: none; }

/* ================================================================ MOBILE CONCEPT: member pill tabs (Pattern 1)
   + Pattern 3's progress ring around the avatar on Today and Family. */
.pill.p1, .ringwrap.p1, [data-person-panel].p1, .fpanel.p1 { --c: var(--p1); --s: var(--p1-soft); }
.pill.p2, .ringwrap.p2, [data-person-panel].p2, .fpanel.p2 { --c: var(--p2); --s: var(--p2-soft); }
.pill.p3, .ringwrap.p3, [data-person-panel].p3, .fpanel.p3 { --c: var(--p3); --s: var(--p3-soft); }
.pill.p4, .ringwrap.p4, [data-person-panel].p4, .fpanel.p4 { --c: var(--p4); --s: var(--p4-soft); }
.pill.p5, .ringwrap.p5, [data-person-panel].p5, .fpanel.p5 { --c: var(--p5); --s: var(--p5-soft); }
.pill.p6, .ringwrap.p6, [data-person-panel].p6, .fpanel.p6 { --c: var(--p6); --s: var(--p6-soft); }
.mt { display: grid; gap: 12px; min-width: 0; }
.mt-row { display: flex; align-items: stretch; gap: 6px; min-width: 0; margin: 0 0 12px; }
.mt .mt-row { margin: 0; }
.mt-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1 1 auto; padding: 4px 2px 6px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); overscroll-behavior-x: contain; }
.mt-list::-webkit-scrollbar { display: none; }
.mt-list:has(.pill:last-child:focus-visible), .mt-list.at-end { -webkit-mask-image: none; mask-image: none; }
.pill { --c: var(--p1); --s: var(--p1-soft); flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 14px 4px 6px; background: var(--paper); cursor: pointer; text-align: left; line-height: 1.15; color: var(--ink); text-decoration: none; }
.pill:hover { color: var(--ink); border-color: var(--c); }
.pill .pl b { display: block; font-weight: 600; font-size: .98rem; white-space: nowrap; max-width: 12ch; overflow: hidden; text-overflow: ellipsis; }
.pill .pl small { display: block; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.pill .pl small.iss { color: var(--err); font-weight: 700; }
.pill[aria-selected="true"] { background: var(--s); border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.pill .av { width: 36px; height: 36px; font-size: 1rem; position: relative; }
.ringwrap { position: relative; display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; }
.ringwrap .av { width: 32px; height: 32px; font-size: .92rem; box-shadow: none; }
.ringwrap .av.alt { outline-offset: -1px; }
.pring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pring circle { fill: none; stroke-width: 3.5; }
.pring .bg { stroke: var(--line); }
.pring .fg { stroke: var(--c); stroke-linecap: round; }
.flag-dot { position: absolute; top: -3px; right: -3px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--paper); background: var(--err); color: var(--paper); font-size: 10px; font-weight: 800; display: grid; place-items: center; font-family: var(--body); line-height: 1; }
.flag-dot.edited { background: var(--ink); }
.addtab { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 52px; border: 1.5px dashed var(--line-strong); border-radius: 999px; padding: 0 14px 0 12px; background: none; cursor: pointer; font-weight: 600; color: var(--terra); font-size: .95rem; text-decoration: none; align-self: center; margin-bottom: 2px; }
.addtab.disabled, .addtab[aria-disabled="true"] { color: var(--muted); cursor: not-allowed; }
.mt-panels { touch-action: pan-y; min-width: 0; }
.mt-panels > [role="tabpanel"] { display: grid; gap: 12px; min-width: 0; }
.mt-panels > [role="tabpanel"]:focus-visible { outline-offset: 4px; }
@media (prefers-reduced-motion: no-preference) { .mt-panels > [role="tabpanel"].enter { animation: tabin .18s ease-out; } }
@keyframes tabin { from { opacity: .3; transform: translateX(var(--dx, 0)); } to { opacity: 1; transform: none; } }
.who-h { display: flex; align-items: center; gap: 12px; }
.who-h .t { line-height: 1.2; min-width: 0; flex: 1; }
.who-h .t b { font-family: var(--display); font-weight: 400; font-size: 1.25rem; display: block; }
.who-h .t small { display: block; color: var(--muted); font-size: .9rem; }

/* bars, key-value rows, stat tiles, disclosure */
.bar { display: grid; gap: 4px; }
.bar .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .98rem; flex-wrap: wrap; }
.bar .top b { font-weight: 600; }
.bar .top .tnum { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .92rem; flex-wrap: wrap; }
.bar .trk { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar .trk i { display: block; height: 100%; border-radius: 4px; background: var(--c, var(--ink)); }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .98rem; border-bottom: 1px dotted var(--line); padding: 6px 0; min-height: 44px; }
.kv:last-child { border-bottom: 0; }
.kv > span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.kv small { display: block; color: var(--muted); font-size: .85rem; font-weight: 400; overflow-wrap: anywhere; }
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; display: grid; min-width: 0; }
.stat b { font-family: var(--display); font-weight: 400; font-size: 1.4rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: .8rem; }
details.more { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
details.more > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; gap: 8px; padding: 0 14px; font-weight: 600; font-size: .98rem; color: var(--terra); list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary small { color: var(--muted); font-weight: 400; font-size: .82rem; }
details.more > summary::after { content: "+"; margin-left: auto; font-size: 1.2rem; }
details.more[open] > summary::after { content: "−"; }
details.more > div { padding: 0 14px 14px; display: grid; gap: 10px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 0 10px; font-size: .8rem; font-weight: 600; line-height: 1.8; white-space: nowrap; border: 1px solid var(--line-strong); color: var(--muted); background: var(--paper); }
.badge.owner { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.badge.editor { color: var(--ink); border-color: var(--ink); }
.badge.viewer { border-style: dashed; }
.h4 { font-size: 1.05rem; margin-top: 4px; }

/* thumb-zone action bar: sticks above the bottom navigation on phones */
.actbar { position: sticky; bottom: var(--tabbar-h, calc(var(--nav-h) + env(safe-area-inset-bottom))); z-index: 15; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; margin-top: 12px; background: linear-gradient(to top, var(--table) 78%, transparent); }
.actbar .btn { padding-inline: 16px; }
.actbar .grow { flex: 1 1 auto; }
@media (min-width: 760px) { .actbar { bottom: 0; padding-bottom: max(10px, env(safe-area-inset-bottom)); } }
.iconbtn { width: var(--tap); height: var(--tap); border-radius: 14px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; flex: none; list-style: none; }
.iconbtn::-webkit-details-marker { display: none; }
.iconbtn:hover { border-color: var(--line-strong); color: var(--ink); }
.iconbtn svg { width: 20px; height: 20px; }
.acct-menu a small, .acct-menu button small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.1; }
.acct-menu a:has(small), .acct-menu button:has(small) { display: grid; align-content: center; padding-block: 6px; }
.more-menu .acct-menu form button { font-weight: 400; border-radius: 10px; }

/* Today */
.daybar { display: grid; grid-template-columns: var(--tap) minmax(0, 1fr) var(--tap) var(--tap); gap: 8px; align-items: center; margin: 0 0 12px; }
.daybar-t { min-width: 0; text-align: center; }
.daybar-t h2 { font-size: clamp(1.5rem, 5vw, 1.9rem); }
.btn-day { width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); cursor: pointer; font-size: 1.3rem; line-height: 1; display: grid; place-items: center; text-decoration: none; color: var(--ink); }
.btn-day[disabled] { opacity: .4; cursor: not-allowed; }
.mealtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.mealtabs::-webkit-scrollbar { display: none; }
.mealtabs a { gap: 6px; min-height: var(--tap); white-space: nowrap; flex: none; }
.slot-ic { width: 20px; height: 20px; flex: none; }
.hero { border-radius: 20px; padding: 14px; background: var(--paper); border: 1px solid var(--line); display: grid; gap: 10px; margin: 0 0 14px; box-shadow: var(--shadow-sm); }
.hero .when { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.nowpill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 0 10px; font-size: .8rem; font-weight: 700; line-height: 1.9; background: var(--ink); color: var(--paper); margin-left: auto; }
.nowpill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--haldi); }
.hero-dishes { font-family: var(--display); font-size: 1.45rem; line-height: 1.2; text-wrap: balance; }
.thali { display: flex; gap: 6px; flex-wrap: wrap; }
.nextup { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .95rem; color: var(--muted); border-top: 1px dotted var(--line-strong); padding-top: 6px; flex-wrap: wrap; }
.nextup > span { min-width: 0; flex: 1 1 180px; }
.nextup .swap-form { margin: 0; }
.nextup .linkbtn { min-height: var(--tap); }
[data-person-panel] .pm { display: grid; gap: 12px; }
[data-person-panel] .dishes li { min-height: 52px; }
.more .macros div { background: var(--paper-2); }

/* Week: scroll-snap day strip + one day card */
.days { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 2px 2px 8px; margin: 0 0 6px; min-width: 0; }
.days::-webkit-scrollbar { display: none; }
.daychip { flex: none; scroll-snap-align: start; display: grid; justify-items: center; align-content: center; width: 56px; min-height: 68px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--paper); padding: 6px 0; line-height: 1.1; text-decoration: none; color: var(--ink); }
.daychip:hover { color: var(--ink); border-color: var(--ink); }
.daychip small { font-size: .76rem; color: var(--muted); }
.daychip b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.daychip.today b { color: var(--terra); }
.daychip.past { opacity: .75; }
.daychip .dd { width: 8px; height: 8px; border-radius: 50%; background: var(--elaichi); margin-top: 4px; }
.daychip .dd.gap { background: linear-gradient(90deg, var(--haldi-ink) 50%, transparent 50%); border: 1.5px solid var(--haldi-ink); }
.daychip[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); opacity: 1; }
.daychip[aria-current="true"] small, .daychip[aria-current="true"] b { color: var(--paper); }
.daychip[aria-current="true"] .dd { box-shadow: 0 0 0 2px var(--paper); }
.daycard { margin-top: 4px; }
.daycard header h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.meal { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 56px; border-bottom: 1px dotted var(--line); padding: 4px 0; }
.meal .slot-ic { color: var(--muted); }
.meal .mtxt small { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.meal .dn { font-weight: 500; line-height: 1.3; }
.meal .mtxt small.recipes { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .85rem; margin-top: 2px; }
.meal .linkbtn { min-height: var(--tap); }
.skel { border-radius: 8px; background: var(--skel); height: 14px; }
@media (prefers-reduced-motion: no-preference) { .skel { animation: pulse 1.2s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .5; } }

/* Groceries: sticky progress, big rows, "Have it" */
.gro-top { position: sticky; top: 0; z-index: 10; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow-sm); }
@media (min-width: 760px) { .gro-top { top: 58px; } }
.aisle h3 { flex-wrap: wrap; }
.aisle .ahint { font-family: var(--body); font-size: .8rem; color: var(--muted); font-weight: 500; }
.gl { list-style: none; margin: 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.gl li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-bottom: 1px dotted var(--line); }
.gl li:last-child { border-bottom: 0; }
.cat .gl li label { border-bottom: 0; padding: 6px 8px 6px 12px; min-height: 56px; }
.gl .gn { min-width: 0; }
.gl .gn small { display: block; }
.gl .amt { font-weight: 600; color: var(--ink); }
.gl li:has(input:checked) .amt { color: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .gl li.pop label { animation: pop .25s ease-out; } }
@keyframes pop { 40% { transform: scale(.97); background: var(--elaichi-soft); } }
.have { min-height: 56px; min-width: 68px; border: 0; border-left: 1px dotted var(--line); background: none; color: var(--muted); font-size: .85rem; cursor: pointer; padding: 0 10px; }
.have:hover { color: var(--terra); }
.gl .home-row { padding: 8px 12px; color: var(--muted); }
.offline { display: flex; gap: 8px; align-items: center; background: var(--paper-2); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 8px 12px; font-size: .92rem; margin: 0 0 12px; }
.offline::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }

/* Send */
.send-kind .hint { margin-bottom: 10px; }
.bubble { justify-self: end; }

/* Family */
.fpanel { gap: 12px; }
.access .kv > span:first-child { min-width: 0; }


/* Onboarding / edit family */
.setup { padding-bottom: 8px; }
.prog { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 0 0 14px; }
.prog i { display: block; height: 100%; background: var(--terra); border-radius: 3px; }
@media (prefers-reduced-motion: no-preference) { .prog i { transition: width .3s ease; } }
.choices { display: grid; gap: 8px; }
.choice { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 22px; gap: 12px; align-items: center; min-height: 64px; border: 1.5px solid var(--line-strong); border-radius: 16px; background: var(--paper); padding: 8px 12px; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice b { display: block; font-weight: 600; }
.choice small { display: block; color: var(--muted); font-size: .88rem; line-height: 1.2; }
.choice .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); }
.choice:has(input:checked) { border-color: var(--terra); background: var(--terra-soft); }
.choice:has(input:checked) .tick { border-color: var(--terra); background: radial-gradient(circle, var(--terra) 45%, transparent 50%); }
.choice:has(input:focus-visible) { outline: 3px solid var(--terra); outline-offset: 2px; }
.choice .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--paper-2); display: grid; place-items: center; font-family: var(--display); font-size: 1.1rem; color: var(--terra); }
.kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.kinds button { display: grid; gap: 1px; text-align: left; min-height: 64px; border: 1.5px dashed var(--line-strong); border-radius: 14px; background: var(--paper); padding: 8px 12px; cursor: pointer; font-weight: 600; color: var(--terra); }
.kinds button small { font-weight: 400; color: var(--muted); font-size: .82rem; }
.kinds button:hover { border-color: var(--terra); }
.kinds button[disabled] { opacity: .5; cursor: not-allowed; }
.pcard.person { margin: 0; }
.pcard.person .who-h { margin-bottom: 6px; }
.tools { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border-top: 1px dotted var(--line-strong); padding-top: 4px; }
.tools .grow { flex: 1; }
.tools .rm { color: var(--err); }
.tools .linkbtn[disabled] { color: var(--muted); cursor: not-allowed; text-decoration: none; }
/* ---- Sticky bars (setup wizard: a slim top header only; .actbar on Week / Groceries / Send).
   Bars are position: sticky inside the page flow, never fixed over it, so the page can always scroll
   far enough for the last field to sit above the bar. bars.js measures the bars really on screen and
   sets --head-h / --foot-h; scroll-padding on <html> then keeps focus, #anchors and scrollIntoView()
   clear of them. No guessed heights, no per-field scroll margins. */
html { scroll-padding-top: calc(var(--head-h, 0px) + 12px); scroll-padding-bottom: calc(var(--foot-h, 0px) + 16px); }
/* Wizard Back / Save / Next: plain flow at the end of each step (never pinned). Without JavaScript the
   steps are stacked and only the submit row shows (no .setup-body). */
.setup .nav { align-items: center; }
.setup-body .setup .nav { justify-content: flex-end; gap: 10px 12px; margin: 28px 0 0; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.setup-body .nav .btn { flex: 0 0 auto; min-height: 52px; }
/* Phones: Next is full width on its own row in the thumb zone; quiet Back on the left above it, Save
   (edit page) secondary on the right. Wider screens: one row, Back left, Save + Next right. */
.setup-body .nav .btn-back { margin-right: auto; padding-inline: 12px; border-color: transparent; background: transparent; color: var(--muted); }
.setup-body .nav .btn-back:hover { background: var(--paper-2); color: var(--ink); }
.setup-body .nav .btn-save { padding-inline: 18px; }
.setup-body .nav .btn-next { flex: 1 1 100%; order: 1; min-width: 0; display: grid; justify-items: center; align-content: center; gap: 0; padding: 6px 16px; line-height: 1.15; }
@media (min-width: 600px) { .setup-body .nav .btn-next { flex: 0 1 auto; order: 0; min-width: 240px; } }
.btn-next small { max-width: 100%; font-size: .8rem; font-weight: 500; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fam-head { margin: 0 0 14px; }
.fam-head .field { margin-bottom: 0; }
/* Slim sticky header: progress bar + "Family: <name>" chip. The tall full field (step 1) stays in the flow. */
.setup-body .fam-head.pinned { position: sticky; top: 0; z-index: 6; margin-inline: -16px; padding: 6px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.setup-body .fam-head.pinned .prog { height: 4px; margin-bottom: 6px; }
.setup-body .fam-chip { min-height: 44px; }
@media (min-width: 600px) { .setup-body .fam-head.pinned { margin-inline: -28px; padding-inline: 28px; } }
/* While content scrolls beneath the header (bars.js adds .is-stuck): a soft shadow and a frosted edge. */
.setup-body .fam-head.is-stuck { border-bottom-color: transparent; box-shadow: 0 10px 22px -14px rgba(60,35,15,.45); background: color-mix(in srgb, var(--paper) 86%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3); }
@media (prefers-reduced-motion: no-preference) { .setup-body .fam-head { transition: box-shadow .2s ease, background-color .2s ease, border-color .2s ease; } }
/* On-screen keyboard open on plan pages (html.kbd, bars.js): the bars drop back into the flow, so nothing
   covers the field being typed in; they stick again when the keyboard closes. */
html.kbd .actbar, html.kbd .gro-top { position: relative; top: auto; bottom: auto; }
@media (max-width: 759px) { html.kbd .tabbar { display: none; } }
.fam-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: var(--tap); border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper-2); color: var(--ink); padding: 4px 6px 4px 14px; font: inherit; font-size: 1rem; cursor: pointer; }
.fam-chip b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fam-chip-k { color: var(--muted); }
.fam-chip-e { color: var(--terra); font-weight: 600; font-size: .9rem; border-radius: 999px; padding: 4px 10px; background: var(--paper); flex: none; }
.fam-chip:hover { border-color: var(--terra); }
.navmsg { flex: 1 1 100%; order: -1; font-size: .9rem; line-height: 1.3; color: var(--err); font-weight: 600; text-align: center; }
.navmsg:empty { display: none; }
.planning { display: grid; gap: 12px; padding: 12px 0; }
.planning .card { gap: 12px; }
@media (max-width: 380px) { .kinds { grid-template-columns: minmax(0, 1fr); } .stat b { font-size: 1.2rem; } }

/* Login: Google first, then the email link; the send button stays in the thumb zone */
#email-form #send-btn { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 5; }
#email-form input { scroll-margin-bottom: calc(var(--tap) + 24px + env(safe-area-inset-bottom)); }
.auth-card .or { margin: 2px 0; }

/* ================================================================ Today header v3
   One quiet date row, a week strip instead of prev/next arrows, and an even meal switch.
   The meal name is already in the switch, so the big "Lunch" title is now screen-reader only. */
.plan-head { gap: 2px; margin: 0 0 6px; }
.plan-head h1 { font-size: clamp(1.5rem, 5.2vw, 2rem); line-height: 1.1; }
.plan-head .kicker { font-size: .9rem; }
.daybar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0 0 12px; }
.daybar-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.daybar-date { margin: 0; font-family: var(--display); font-size: 1.2rem; line-height: 1.2; color: var(--ink); min-width: 0; }
.daybar-date .todaypill { font-family: var(--body); margin-left: 8px; }
.daybar-top .iconbtn { width: 44px; height: 44px; margin-right: -6px; background: transparent; border-color: transparent; }
.daybar-top .iconbtn:hover, .daybar-top .more-menu[open] > .iconbtn { background: var(--paper-2); border-color: var(--line); }
.daystrip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(44px, 1fr); gap: 6px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; padding: 2px; margin: -2px; }
.daystrip::-webkit-scrollbar { display: none; }
.daystrip .dchip { width: auto; height: auto; min-height: 60px; display: grid; justify-items: center; align-content: center; gap: 2px; padding: 6px 0; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; line-height: 1.1; }
.daystrip .dchip:hover { border-color: var(--line-strong); }
.daystrip .dchip small { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.daystrip .dchip b { font-family: var(--display); font-weight: 400; font-size: 1.3rem; }
.daystrip .dchip.today b { color: var(--terra); }
.daystrip .dchip.today:not([aria-current="true"]) { border-color: var(--terra); }
.daystrip .dchip.past { opacity: .7; }
.daystrip .dchip[aria-current="true"] { background: var(--ink); border-color: var(--ink); opacity: 1; }
.daystrip .dchip[aria-current="true"] small, .daystrip .dchip[aria-current="true"] b { color: var(--paper); }

.mealtabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; margin: 0 0 14px; overflow: visible; background: var(--paper-2); border: 1px solid var(--line); border-radius: 18px; }
.mealtabs a { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 56px; padding: 6px 2px; border: 0; border-radius: 14px; background: transparent; color: var(--muted); font-size: .9rem; font-weight: 500; line-height: 1.1; white-space: nowrap; }
.mealtabs a .slot-ic { width: 22px; height: 22px; }
.mealtabs a[aria-selected="true"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line-strong); }
.mealtabs a[aria-selected="true"] .slot-ic { color: var(--terra); }
/* The meal card shares the .hero class with the landing page; keep it one column on wide screens. */
#today .hero { grid-template-columns: minmax(0, 1fr); align-items: stretch; }

/* Per-dish macros (Today: under each dish; Week: a small table per meal). Phones: a quiet one-line
   summary ("320 kcal · P 12 g"), tap for all five. Wide screens: all five inline, no tapping. */
.famtot { font-size: .95rem; color: var(--muted); margin: 2px 0 0; line-height: 1.35; }
.famtot b { color: var(--ink); font-weight: 600; }
.dishes li > .dmac { grid-column: 2 / -1; margin-top: -6px; }
details.dmac > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: .9rem; color: var(--muted); }
details.dmac > summary::-webkit-details-marker { display: none; }
details.dmac > summary::after { content: "+"; font-size: 1rem; color: var(--terra); font-weight: 600; }
details.dmac[open] > summary::after { content: "−"; }
.dmac-full { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 0 0 6px; text-align: center; }
.dmac-full div { display: flex; flex-direction: column-reverse; background: var(--paper-2); border-radius: 10px; padding: 6px 2px; line-height: 1.1; min-width: 0; }
.dmac-full dd { margin: 0; font-weight: 700; font-size: .98rem; }
.dmac-full dd small { font-weight: 500; font-size: .72rem; color: var(--muted); }
.dmac-full dt { font-size: .7rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.dishtot { display: grid; gap: 0; padding: 4px 0 0; }
.dishtot > b { font-size: .95rem; }
.wk-who { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.wk-who .linkbtn { min-height: 44px; display: inline-flex; align-items: center; }
details.wkmac > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: .9rem; color: var(--muted); }
details.wkmac > summary::-webkit-details-marker { display: none; }
details.wkmac > summary::after { content: "+"; color: var(--terra); font-weight: 600; }
details.wkmac[open] > summary::after { content: "−"; }
.mactbl { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 0 0 6px; }
.mactbl th, .mactbl td { padding: 6px 4px; border-bottom: 1px dotted var(--line); text-align: left; font-weight: 400; }
.mactbl thead th { font-size: .75rem; color: var(--muted); font-weight: 600; }
.mactbl .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mactbl tfoot th, .mactbl tfoot td { font-weight: 700; border-bottom: 0; }
.mactbl small { color: var(--muted); }
@media (max-width: 599px) { .mactbl .c, .mactbl .fib, .mactbl .f { display: none; } }
@media (min-width: 760px) {
  .mac-wide details.dmac > summary { display: none; }
  .mac-wide details.wkmac > summary { pointer-events: none; }
  .mac-wide details.wkmac > summary::after { content: none; }
  @supports selector(::details-content) {
    details.dmac::details-content, details.wkmac::details-content { content-visibility: visible; display: block; }
    details.dmac > summary { display: none; }
    details.wkmac > summary { pointer-events: none; }
    details.wkmac > summary::after { content: none; }
  }
  .dishes li > .dmac { margin-top: -4px; }
  .dmac-full { grid-template-columns: repeat(5, minmax(0, 76px)); justify-content: start; text-align: left; }
  .dmac-full div { flex-direction: row-reverse; justify-content: flex-end; gap: 4px; align-items: baseline; background: none; padding: 0; }
  .dmac-full dt { margin: 0; }
}

/* ================================================================ Narrow phones (< 420px)
   No sideways page scroll; long names and pack notes wrap; grocery rows put the amount under the name. */
.plan-body { overflow-x: clip; }
.gl .gn, .gl .gnote, .aisle h3, .aisle .ahint, .meal .dn, .hero-dishes, .nextup > span, .seg a, .daybar-date { overflow-wrap: anywhere; }
.aisle h3 { min-width: 0; }
.gro-top > div { min-width: 0; }
@media (max-width: 419px) {
  .cat .gl li label { grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; row-gap: 0; padding: 8px 6px 8px 10px; font-size: 1rem; }
  .cat .gl li label input { grid-row: 1 / span 2; align-self: center; }
  .gl .amt { grid-column: 2; white-space: normal; overflow-wrap: anywhere; font-size: .9rem; }
  .have { min-width: 56px; padding: 0 6px; font-size: .8rem; line-height: 1.15; }
  .gro-top { gap: 10px; padding: 10px 12px; border-radius: 14px; }
  .gro-top .ring { width: 40px; height: 40px; }
  .gro-top b { font-size: 1.05rem; }
  .gro-top small { font-size: .8rem; line-height: 1.3; display: block; }
  .aisle .ahint { flex-basis: 100%; order: 3; }
  .actbar .btn { flex: 1 1 auto; padding-inline: 12px; }
  .mealtabs a { font-size: .82rem; }
  .seg a { padding-inline: 2px; font-size: .95rem; }
  .send-kind > .btn-sm { white-space: normal; text-align: left; height: auto; }
}
@media (max-width: 359px) {
  .tabbar { padding-inline: 2px; }
  .tabbar a { font-size: .7rem; letter-spacing: -.01em; }
  .gro-top small { display: none; }
}
