/* Prep Pal — styles. Palette: #1B7D4F spring, #066839 Dartmouth, #0F5132 Castleton, #18392B dark green, #212224 eerie black. */
@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-latin.woff2") format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/figtree-latin.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --bg: #212224;
  --card: #18392B;
  --raised: #0F5132;
  --deep: #066839;
  --green: #1B7D4F;
  --paper: #F1F7F3;
  --muted: #A8BFB2;
  --mint: #6FD39F;
  --line: rgba(241, 247, 243, .12);
  --line2: rgba(241, 247, 243, .22);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --r: 18px;
  --head: "Bricolage", "Figtree", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabh: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; font: 400 16px/1.45 var(--body); color: var(--paper); background: var(--bg); min-height: 100vh; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
body.locked { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--mint); }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; border-radius: 10px; }

.app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(var(--tabh) + 28px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 0 10px; background: linear-gradient(var(--bg) 75%, rgba(33, 34, 36, 0)); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--paper); font: 800 22px/1 var(--head); }
.brand img { border-radius: 10px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 0; background: var(--card); color: var(--paper); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn .ic { width: 24px; height: 24px; }
#view { outline: none; }
.view-in { animation: viewIn .28s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(24, 57, 43, .96); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.tab { flex: 1; max-width: 130px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 14px; color: var(--muted); text-decoration: none; font-size: 12.5px; font-weight: 700; }
.tab .ic { width: 25px; height: 25px; }
.tab.active { color: var(--paper); background: var(--raised); --ic-fill: var(--green); }
body.onboarding .tabbar, body.onboarding .topbar { visibility: hidden; }

/* basics */
.card { background: var(--card); border-radius: var(--r); padding: 16px; margin: 12px 0; border: 1px solid var(--line); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card h2 { font-size: 20px; }
.sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.lead { font-size: 17px; margin: 10px 0; }
.lead-sub { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 14px; }
.tiny { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; display: flex; gap: 6px; align-items: flex-start; }
.tiny .ic { margin-top: 1px; color: var(--mint); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 2px 10px; }
.center { text-align: center; justify-content: center; }
.pad { padding: 14px; }
.err { color: var(--paper); background: var(--deep); border-left: 4px solid var(--mint); padding: 8px 12px; border-radius: 10px; font-weight: 700; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 4px; }
.section-title h2 { font-size: 22px; }
.grp-title { font: 700 13px/1 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 2px 8px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; background: var(--raised); font-weight: 700; font-size: 14px; white-space: nowrap; }
.pill .ic { color: var(--mint); }
.link-btn { border: 0; background: none; color: var(--mint); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; padding: 8px 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 0; background: var(--green); color: #fff; font-weight: 800; font-size: 16px; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--paper); border: 1.5px solid var(--line2); }
.btn.small { min-height: 40px; font-size: 14px; padding: 0 12px; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.danger { color: var(--muted); }
.btn .ic { width: 20px; height: 20px; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row > * { flex: 1; }

/* week switcher & stats */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px; }
.wk-label { text-align: center; display: flex; flex-direction: column; }
.wk-label b { font: 800 20px/1.1 var(--head); }
.wk-label span { color: var(--muted); font-size: 13.5px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 8px; text-decoration: none; color: var(--paper); display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.stat-ic { color: var(--mint); }
.stat b { font: 800 21px/1.15 var(--head); margin-top: 2px; white-space: nowrap; }
.stat small { color: var(--muted); font-size: 12px; }
.stat.warn { background: var(--raised); border-color: var(--mint); }

/* today */
.today { background: linear-gradient(160deg, var(--green), var(--raised)); border: 0; }
.today .muted { color: rgba(241, 247, 243, .8); }
.today-list { list-style: none; margin: 8px 0 0; padding: 0; }
.today-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 0; border: 0; background: none; text-align: left; border-bottom: 1px solid rgba(241, 247, 243, .15); }
.today-list li:last-child .today-row { border-bottom: 0; }
.tl-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(0, 0, 0, .18); flex: none; }
.tl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tl-main small { color: rgba(241, 247, 243, .78); font-size: 12.5px; font-weight: 700; }
.tl-main b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.today-cheat { font-size: 18px; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.src { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 4px 8px; border-radius: 99px; background: rgba(0, 0, 0, .2); white-space: nowrap; }
.src .ic { width: 15px; height: 15px; }
.src.frz { background: var(--paper); color: var(--card); }
.sheet .src, .card:not(.today) .src { background: var(--raised); }
.sheet .src.frz { background: var(--paper); color: var(--card); }
.tonight { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(241, 247, 243, .3); }
.tonight h3 { font-size: 15px; }
.jobs { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.jobs li { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; }
.jobs .ic { margin-top: 2px; color: var(--mint); }
.today .jobs .ic { color: var(--paper); }

/* prep card */
.prep-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.prep-list li { display: flex; gap: 12px; align-items: center; }
.pl-emoji, .mc-emoji, .pk-emoji, .rc-emoji { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--raised); font-size: 25px; flex: none; }
.pl-main { display: flex; flex-direction: column; min-width: 0; }
.pl-main small { color: var(--muted); font-size: 13px; }
.prep .jobs { margin-top: 12px; }

/* meal cards */
.meal-card, .rec-card, .pick { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px; margin: 0 0 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); text-align: left; }
.meal-card.empty { border-style: dashed; }
.mc-main, .rc-main, .pk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mc-main small { color: var(--mint); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.mc-main b, .rc-main b, .pk-main b { font-weight: 700; font-size: 16px; line-height: 1.25; }
.mc-meta, .rc-main small, .pk-main small { color: var(--muted); font-size: 13px; }
.rc-main small .ic, .pk-main small .ic { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.mc-lock { color: var(--mint); }
.nudge { display: flex; align-items: center; gap: 12px; border-color: var(--mint); }
.nudge p { margin: 0; flex: 1; display: flex; gap: 8px; font-size: 14.5px; }
.nudge p .ic { color: var(--mint); margin-top: 2px; }
.nudge .btn { flex: none; }
.mc-warn { margin-top: 4px; font-size: 12.5px; font-weight: 800; color: var(--card); background: var(--paper); border-radius: 8px; padding: 2px 8px; align-self: flex-start; }
.mc-chev { color: var(--muted); }

/* week at a glance */
.glance { display: grid; gap: 6px; }
.g-day { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-align: left; min-height: 48px; }
.g-day.now { border-color: var(--mint); }
.g-day.cheat { background: transparent; border-style: dashed; }
.g-day.away { background: transparent; opacity: .7; }
.g-name { width: 70px; font-weight: 800; display: flex; flex-direction: column; line-height: 1.1; }
.g-name i { font-style: normal; font-size: 11px; color: var(--mint); text-transform: uppercase; letter-spacing: .05em; }
.g-meals { display: flex; gap: 8px; }
.g-meal { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--raised); font-size: 19px; }
.g-meal.frz::after { content: ""; position: absolute; right: -3px; top: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--paper); border: 2px solid var(--card); }
.g-cheat { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-weight: 700; }
.dot-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); margin-right: 6px; vertical-align: 0; }

/* recipes */
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; margin: 10px 0; }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 800; padding: 0 6px; }
.seg button.on { background: var(--green); color: #fff; }
.seg.small button { min-height: 34px; font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1.5px solid var(--line2); background: none; color: var(--paper); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.chip.on { background: var(--deep); border-color: var(--mint); }
.chips.small .chip { min-height: 32px; font-size: 13px; padding: 0 10px; }
.chip .ic { width: 14px; height: 14px; }
.search { display: block; margin: 8px 0 12px; }
.search input, .field input { width: 100%; min-height: 46px; border-radius: 14px; border: 1.5px solid var(--line2); background: var(--raised); padding: 0 14px; color: var(--paper); }
.search input::placeholder, .field input::placeholder { color: rgba(168, 191, 178, .7); }
.rec-list, .pick-list, .shop-list, .goal-list { list-style: none; margin: 0; padding: 0; }
.rc-fav { color: var(--mint); --ic-fill: var(--mint); }

/* sheets */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); animation: fadeIn .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto; max-height: 88vh; overflow-y: auto; overscroll-behavior: contain; background: #1c2f26; border-radius: 24px 24px 0 0; padding: 6px 18px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); animation: sheetIn .26s cubic-bezier(.2, .9, .3, 1); outline: none; }
.sheet.tall { max-height: 94vh; }
.sheet.closing { animation: sheetOut .22s forwards; }
.backdrop.closing { animation: fadeOut .22s forwards; }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetOut { to { transform: translateY(100%); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line2); margin: 6px auto 10px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.sheet-head h2 { font-size: 22px; }
.sh-title { font-size: 17px; margin: 18px 0 8px; }
.hero { display: flex; gap: 14px; align-items: center; margin: 6px 0 10px; }
.hero h3 { font-size: 19px; }
.hero .sub .ic { width: 15px; height: 15px; margin-right: 3px; }
.hero-emoji { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: var(--raised); font-size: 32px; flex: none; }
.hero-emoji.big { width: 72px; height: 72px; font-size: 40px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 99px; background: var(--raised); font-size: 13px; font-weight: 700; }
.badge .ic { width: 15px; height: 15px; color: var(--mint); }
.badge.soft { background: none; border: 1px solid var(--line2); }
.store-box { background: var(--card); border-radius: 14px; padding: 10px 12px; margin: 8px 0; }
.sb-row { display: grid; grid-template-columns: 42px auto 1fr; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.sb-row span:last-child { color: var(--muted); }
.serve-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 4px; }
.serve-row > div:first-child { display: flex; flex-direction: column; }
.serve-row small { color: var(--muted); font-size: 13px; }
.nut-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; margin: 10px 0; }
.nut-grid div { background: var(--card); border-radius: 12px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.profile-card .nut-grid div { background: var(--raised); }
.nut-grid b { font: 800 17px/1.2 var(--head); }
.nut-grid small { color: var(--muted); font-size: 12px; }
.ing { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.ing li::marker { color: var(--mint); }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.steps li::marker { color: var(--mint); font-weight: 800; }
.tips { display: flex; gap: 10px; background: var(--card); border-left: 4px solid var(--mint); padding: 10px 12px; border-radius: 12px; margin: 12px 0; font-size: 14.5px; }
.tips .ic { color: var(--mint); margin-top: 2px; }
.nut-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.nut-table th, .nut-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.nut-table th:first-child { text-align: left; font-weight: 600; }
.nut-table thead th { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.nut-table .pct { color: var(--muted); width: 70px; }
.use-row { display: flex; flex-wrap: wrap; gap: 8px; }
.use-row .btn { flex: 1 1 auto; }
.pick-list li { position: relative; }
.pick.cur { border-color: var(--mint); background: var(--raised); }
.pk-fit { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.pk-fit b { font: 800 16px/1.1 var(--head); color: var(--mint); }
.pk-fit small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.cur-tag { position: absolute; top: -6px; left: 14px; background: var(--mint); color: var(--card); font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.prep-step { background: var(--card); border-radius: 16px; padding: 14px; margin: 10px 0; }
.prep-step h3 { font-size: 18px; }
.prep-step .ing { margin-top: 10px; }
.prep-step .steps { margin-top: 10px; }
.store-note { display: flex; gap: 6px; color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }
.store-note .ic { color: var(--mint); }

/* stepper & switch */
.stepper { display: inline-flex; align-items: center; background: var(--raised); border-radius: 14px; flex: none; }
.stepper button { width: 44px; height: 44px; border: 0; background: none; color: var(--paper); display: grid; place-items: center; }
.stepper output { min-width: 56px; text-align: center; font: 800 17px/1 var(--head); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 10px; cursor: pointer; }
.switch-row span:first-child { display: flex; flex-direction: column; }
.switch-row small { color: var(--muted); font-size: 13px; }
.switch { position: relative; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { display: block; width: 52px; height: 32px; border-radius: 99px; background: var(--raised); border: 1.5px solid var(--line2); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + span { background: var(--green); border-color: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + span { outline: 3px solid var(--mint); outline-offset: 2px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.field > span:first-child { font-weight: 700; font-size: 14.5px; }
.field > span small { color: var(--muted); font-weight: 400; }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.field-row .field { margin: 6px 0; }
.unit-in { position: relative; display: block; }
.unit-in input { padding-right: 38px; }
.unit-in span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }
.field-inline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
.field-inline > span { display: flex; flex-direction: column; }
.field-inline small { color: var(--muted); font-size: 13px; }
.radio-list { display: grid; gap: 6px; }
.radio { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line2); background: none; }
.radio small { color: var(--muted); font-size: 13px; }
.radio.on { border-color: var(--mint); background: var(--deep); }
.radio.on small { color: var(--paper); }
.price-list { display: grid; gap: 8px; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.money-in { display: inline-flex; align-items: center; gap: 4px; background: var(--raised); border-radius: 12px; padding: 0 10px; border: 1.5px solid var(--line2); }
.money-in input { width: 80px; min-height: 42px; border: 0; background: none; color: var(--paper); text-align: right; }
.file-btn { cursor: pointer; }
.about { color: var(--muted); font-size: 13px; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 6px; }
.about b { color: var(--paper); }

/* shop */
.shop-sum .ss-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.shop-sum small { color: var(--muted); font-size: 13px; display: block; }
.big-num { font: 800 34px/1.1 var(--head); }
.ss-bud { text-align: right; }
.ss-bud b { font: 800 20px/1.2 var(--head); }
.ss-bud.warn b { color: var(--paper); text-decoration: underline 3px var(--mint); }
.bar { height: 10px; border-radius: 99px; background: var(--raised); overflow: hidden; margin-top: 12px; }
.bar i { display: block; height: 100%; background: var(--mint); border-radius: 99px; transition: width .3s; }
.shop-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.shop-item.done .si-main b { text-decoration: line-through; color: var(--muted); }
.si-main { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 0; background: none; text-align: left; padding: 4px 0; }
.si-main b { font-weight: 700; }
.si-main small { color: var(--muted); font-size: 13px; }
.si-price { font-weight: 800; font-variant-numeric: tabular-nums; }
.chk { position: relative; flex: none; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }
.chk input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chk .box { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line2); display: grid; place-items: center; color: transparent; transition: background .15s; }
.chk input:checked + .box { background: var(--green); border-color: var(--green); color: #fff; }
.chk input:focus-visible + .box { outline: 3px solid var(--mint); outline-offset: 2px; }
.chk-ph { width: 44px; display: grid; place-items: center; color: var(--mint); flex: none; }
.shop-list.quiet .si-main b { font-weight: 600; }

/* goals */
.goal-head { display: flex; align-items: center; gap: 14px; position: relative; }
.ring { width: 86px; height: 86px; flex: none; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--raised); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--mint); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .6s; }
.gh-num { position: absolute; left: 16px; width: 86px; text-align: center; font: 800 24px/1 var(--head); }
.gh-num small { font-size: 14px; color: var(--muted); }
.gh-text h2 { font-size: 20px; }
.fix { padding: 6px 0 10px; border-bottom: 1px solid var(--line); }
.fix:last-child { border-bottom: 0; }
.fix p { margin: 4px 0 8px; font-size: 14.5px; }
.fix .btn { width: 100%; text-align: left; }
.goal { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; }
.gl-top { display: flex; justify-content: space-between; align-items: center; }
.gl-state { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; color: var(--mint); }
.goal:not(.ok) .gl-state { color: var(--paper); background: var(--deep); padding: 2px 8px; border-radius: 99px; }
.gbar { position: relative; height: 10px; border-radius: 99px; background: var(--raised); margin: 8px 0 6px; overflow: hidden; }
.gbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--mint); border-radius: 99px; }
.goal:not(.ok) .gbar i { background: repeating-linear-gradient(45deg, var(--paper) 0 6px, var(--muted) 6px 12px); }
.gbar .band { position: absolute; top: 0; bottom: 0; background: rgba(241, 247, 243, .14); }
.gl-nums { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.empty-state { text-align: center; padding: 26px 16px; }
.empty-state .btn { margin-top: 14px; }

/* onboarding */
#onboard-root { display: none; }
#onboard-root.on { display: block; position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: radial-gradient(circle at 50% -10%, var(--raised), var(--bg) 60%); }
.ob-card { max-width: 520px; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom)); }
.ob-card h2 { font-size: 28px; margin-top: 10px; }
.ob-hero { text-align: center; padding: 20px 0 6px; }
.ob-hero img { border-radius: 26px; box-shadow: var(--shadow); }
.ob-hero h1 { font-size: 44px; margin-top: 14px; }
.ob-hero .lead { color: var(--mint); font-weight: 700; font-size: 19px; margin-top: 4px; }
.ob-points { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 12px; }
.ob-points li { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 16px; padding: 12px 14px; }
.ob-points .ic { width: 26px; height: 26px; color: var(--mint); margin-top: 1px; }
.ob-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); }
.ob-dots i.on { width: 24px; border-radius: 99px; background: var(--mint); }

/* toast & confetti */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--tabh) + 22px + env(safe-area-inset-bottom)); z-index: 70; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.toast { pointer-events: auto; max-width: 520px; display: flex; align-items: center; gap: 12px; background: var(--paper); color: var(--card); padding: 12px 14px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 700; animation: toastIn .25s ease-out; }
.toast button { border: 0; background: var(--green); color: #fff; font-weight: 800; padding: 8px 12px; border-radius: 10px; }
.toast.out { animation: fadeOut .25s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }
#fx-root { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti { position: absolute; top: -20px; animation: fall var(--dur) var(--delay) ease-in forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); } }

@media (max-width: 370px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .stat b { font-size: 18px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row .field:first-child { grid-column: span 2; }
  .meal-card, .rec-card, .pick { padding: 10px; gap: 10px; }
  .pl-emoji, .mc-emoji, .pk-emoji, .rc-emoji { width: 40px; height: 40px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
