:root {
  --green: #1F5E3A;
  --green-2: #2E7D4A;
  --green-3: #3f8f5f;
  --gold: #E8B931;
  --terra: #B45A1F;
  --cream: #F7F5F0;
  --card: #ffffff;
  --ink: #1c2b22;
  --muted: #7a8a80;
  --line: #ece8df;
  --p: #2E7D4A;   /* protein */
  --cc: #E8B931;  /* carbs */
  --ff: #B45A1F;  /* fat */
  --fb: #3f8f5f;  /* fiber */
  --water: #3b82c4;
  --shadow: 0 8px 28px rgba(31, 94, 58, 0.10);
  --radius: 18px;
  --maxw: 480px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #e9e6dd;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
b { font-weight: 800; }
button { font-family: inherit; }

/* ---------- splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(120% 80% at 50% 20%, #256a41 0%, #17462c 70%);
  transition: opacity .5s ease, visibility .5s;
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash-inner { text-align: center; padding: 24px; }
.splash-logo { width: 132px; height: 132px; margin: 0 auto 8px; }
.wordmark {
  margin: 6px 0 0; font-weight: 800; font-size: 30px; letter-spacing: 0.04em; color: #fff;
}
.wordmark span { color: var(--gold); }
.splash .wordmark { color: #fff; }
.splash-tag { margin: 8px 0 0; color: #bfe3cd; font-style: italic; font-size: 14px; }

/* ---------- app shell ---------- */
.app {
  position: relative; max-width: var(--maxw); margin: 0 auto; min-height: 100vh;
  background: var(--cream); padding-bottom: 78px;
  box-shadow: 0 0 60px rgba(0,0,0,0.12);
}
.screen { display: block; }
.scroll { padding: 4px 18px 24px; }
/* When a full-screen sheet is open, hide the app behind it (keeps layout, avoids bleed-through). */
.app.behind-sheet { visibility: hidden; }

.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--cream);
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; padding-top: max(16px, env(safe-area-inset-top));
}
.topbar.center { justify-content: center; position: relative; }
.topbar-title { font-weight: 800; font-size: 19px; }
.topbar.center .icon-btn.right { position: absolute; right: 14px; top: 50%; transform: translateY(-30%); }
.greet { font-size: 17px; font-weight: 700; }
.greet .wave { font-weight: 400; }
.icon-btn {
  border: none; background: transparent; color: var(--green); cursor: pointer;
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px;
}
.icon-btn .ico { width: 22px; height: 22px; }
.icon-btn .plus { font-size: 26px; color: var(--green); line-height: 1; }
.icon-btn.back { font-size: 30px; color: var(--green); }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card-title { font-weight: 800; font-size: 15px; margin-bottom: 12px; }
.section-label { font-weight: 800; font-size: 13px; color: var(--muted); text-transform: none; margin: 6px 2px 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 14px 2px 10px; font-weight: 800; }
.link { border: none; background: none; color: var(--green-2); font-weight: 700; font-size: 13px; cursor: pointer; }
.muted { color: var(--muted); }
.note { font-size: 12px; color: var(--muted); margin: 4px 2px 12px; }
.note.center { text-align: center; }
.lead { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.accent b { color: var(--green-2); }

/* ---------- summary ring ---------- */
.summary-row { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 128px; height: 128px; flex: none; }
.ring-svg { width: 128px; height: 128px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #eef0ec; stroke-width: 11; }
.ring-value {
  fill: none; stroke: var(--green-2); stroke-width: 11; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .5s ease;
}
.ring-value.over { stroke: var(--terra); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-center b { font-size: 30px; letter-spacing: -0.02em; }
.ring-center span { display: block; font-size: 11px; color: var(--muted); margin-top: -2px; }
.summary-stats { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.summary-stats .stat-label { display: block; font-size: 13px; color: var(--muted); }
.summary-stats .stat-num { font-size: 20px; }
.summary-stats .stat-num b { font-size: 22px; }

/* macro chips */
.macro-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.macro { text-align: center; }
.macro .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; vertical-align: middle; }
.macro .m-name { font-size: 12px; color: var(--muted); font-weight: 700; }
.macro .m-val { font-size: 12.5px; margin-top: 3px; }
.macro .m-val b { font-size: 13px; }

/* ---------- water / hydration ---------- */
.water-row { display: flex; align-items: center; gap: 14px; }
.wring { position: relative; width: 96px; height: 96px; flex: none; }
.wring-svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.wring-track { fill: none; stroke: #e7eef5; stroke-width: 9; }
.wring-value {
  fill: none; stroke: var(--water); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 251.3; stroke-dashoffset: 251.3; transition: stroke-dashoffset .45s ease;
}
.wring-value.full { stroke: var(--green-2); }
.wring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.15; }
.wring-drop { font-size: 13px; }
.wring-center b { font-size: 17px; display: block; }
.wring-goal { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.wring.pop .wring-drop { animation: dropPop .5s ease; }
@keyframes dropPop { 0% { transform: scale(1); } 40% { transform: scale(1.5) translateY(-3px); } 100% { transform: scale(1); } }
.water-main { flex: 1; min-width: 0; }
.water-left { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.water-left .wl-lbl { color: var(--muted); font-weight: 700; }
.water-left b { font-size: 17px; }
.water-left .wl-done { font-weight: 800; color: var(--green-2); font-size: 14px; }
.water-btns { display: flex; gap: 7px; margin-top: 9px; }
.wbtn {
  flex: 1; border: 1px solid #d6e4f0; background: #f2f7fc; color: #2c6a9e; border-radius: 11px;
  padding: 9px 4px; font-size: 12.5px; font-weight: 800; cursor: pointer;
}
.wbtn:active { transform: translateY(1px); }
.wbtn.undo { flex: none; width: 40px; font-size: 15px; color: var(--muted); background: #fff; border-color: var(--line); }
.wbtn.undo[disabled] { opacity: .4; cursor: default; }
.water-glasses { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.wglass {
  width: 14px; height: 18px; padding: 0; cursor: pointer;
  border: 1.5px solid #cddfee; border-radius: 3px 3px 6px 6px; background: #fff; transition: background .2s ease, transform .15s ease;
}
.wglass.on { background: var(--water); border-color: var(--water); }
.wglass:active { transform: scale(.88); }
.water-note:empty { display: none; }
.water-note { margin: 10px 2px 0; }

/* ---------- quick log ---------- */
.quick-log { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }
.ql {
  border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 14px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: var(--ink); box-shadow: var(--shadow);
}
.ql .ql-ico { font-size: 20px; }
.ql:active { transform: translateY(1px); }
.ql-primary { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- home meals summary ---------- */
.home-meals { display: flex; flex-direction: column; gap: 10px; }
.home-meal {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow);
}
.home-meal .hm-emoji { width: 42px; height: 42px; border-radius: 12px; background: var(--cream); display: grid; place-items: center; font-size: 20px; flex: none; }
.home-meal .hm-main { flex: 1; min-width: 0; }
.home-meal .hm-name { font-weight: 800; font-size: 14px; }
.home-meal .hm-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.home-meal .hm-kcal { font-weight: 800; font-size: 14px; white-space: nowrap; }

/* ---------- meals screen ---------- */
.date-strip { text-align: center; font-weight: 700; color: var(--muted); font-size: 13px; padding: 2px 0 10px; }
.meal-section { margin-bottom: 14px; }
.meal-head { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 8px; }
.meal-head .meal-name { font-weight: 800; font-size: 15px; }
.meal-head .meal-kcal { font-weight: 700; color: var(--muted); font-size: 13px; }
.meal-items { display: flex; flex-direction: column; gap: 8px; }
.log-item { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; box-shadow: var(--shadow); }
/* the item body is a button: tapping it opens the edit sheet */
.log-item .li-main {
  flex: 1; min-width: 0; border: none; background: transparent; padding: 2px 0; margin: -2px 0;
  text-align: left; color: inherit; font-family: inherit; cursor: pointer;
}
.log-item .li-main:active { opacity: .6; }
.li-name { font-weight: 700; font-size: 14px; }
.li-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.li-kcal { font-weight: 800; font-size: 13px; }
.btn-remove { border: none; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; padding: 0 2px; }
.add-to-meal {
  width: 100%; margin-top: 8px; border: 1px dashed var(--green-2); background: transparent; color: var(--green-2);
  border-radius: 12px; padding: 10px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.empty-meal { font-size: 12.5px; color: var(--muted); padding: 2px 2px 4px; }

/* ---------- insights ---------- */
.seg { display: flex; background: #eceae2; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.seg-btn { flex: 1; border: none; background: transparent; padding: 8px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg-btn.active { background: var(--green); color: #fff; }
.ins-row { margin-bottom: 14px; }
.ins-row:last-child { margin-bottom: 0; }
.ins-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.ins-head .ins-name { font-weight: 700; }
.ins-head .ins-val { color: var(--muted); }
.ins-track { height: 9px; background: #eef0ec; border-radius: 999px; overflow: hidden; }
.ins-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.ins-pct { font-size: 12px; color: var(--muted); margin-left: 8px; }
.cal-big { text-align: center; padding: 6px 0 10px; }
.cal-big b { font-size: 34px; }
.cal-big span { color: var(--muted); font-size: 13px; }
.hist-note { margin-top: 14px; margin-bottom: 0; }

/* history chart (weekly / monthly) */
.hist { margin: 2px 0 4px; }
.hist-plot { position: relative; height: 128px; }
.hist-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 6px; }
.hist.dense .hist-bars { gap: 2px; }
.hcol { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; padding: 0; border: none; background: transparent; cursor: pointer; }
.hcol i { display: block; width: 100%; border-radius: 4px 4px 2px 2px; background: linear-gradient(var(--green-3), var(--green-2)); transition: height .35s ease; }
.hcol.over i { background: linear-gradient(#d0803a, var(--terra)); }
.hcol.empty i { height: 3px !important; background: #e2e6df; }
.hcol.sel i { outline: 2px solid var(--ink); outline-offset: 1px; }
.hist-goal { position: absolute; left: 0; right: 0; border-top: 1.5px dashed #c3cdc6; pointer-events: none; }
.hist-goal span { position: absolute; right: 0; top: -8px; font-size: 9.5px; font-weight: 800; color: var(--muted); background: var(--card); padding: 0 3px; }
.hist-labels { display: flex; gap: 6px; margin-top: 6px; }
.hist.dense .hist-labels { gap: 2px; }
.hist-labels span { flex: 1; min-width: 0; text-align: center; font-size: 9.5px; font-weight: 700; color: var(--muted); }
.hist-cap { min-height: 16px; margin: 8px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.hstats { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.hstat { flex: 1; text-align: center; }
.hstat b { display: block; font-size: 15px; }
.hstat span { display: block; font-size: 10.5px; color: var(--muted); font-weight: 700; margin-top: 2px; }

/* ---------- coach ---------- */
.coach-hero { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.coach-avatar { width: 54px; height: 54px; border-radius: 16px; background: var(--green); display: grid; place-items: center; font-size: 26px; flex: none; }
.coach-hero b { font-size: 17px; }
.focus { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.focus li { display: flex; gap: 10px; font-size: 14px; align-items: flex-start; }
.focus .f-ico { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #fff; }
.focus .f-ico.ok { background: var(--green-2); }
.focus .f-ico.warn { background: var(--gold); }
.focus .f-val { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ---------- profile ---------- */
.profile-hero {
  background: var(--green); color: #fff; text-align: center; padding: 30px 18px 24px;
  padding-top: max(30px, calc(env(safe-area-inset-top) + 14px));
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.profile-hero .avatar { width: 74px; height: 74px; border-radius: 50%; background: var(--gold); color: var(--green); display: grid; place-items: center; font-size: 30px; font-weight: 800; margin-bottom: 8px; }
.profile-hero b { font-size: 20px; }
.profile-hero .muted { color: #bfe3cd; }
.list { padding: 4px 4px; }
.row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px; border: none; background: transparent; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; border-bottom: 1px solid var(--line); text-align: left; }
.list .row:last-child { border-bottom: none; }
.row.static { cursor: default; }
.row-val { color: var(--muted); font-weight: 600; font-size: 13px; }
.row-val.soon { font-size: 11px; }

/* ---------- forms / inputs ---------- */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input {
  width: 100%; padding: 13px 14px; font-size: 16px; font-family: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 13px; background: #fff;
}
.input:focus { outline: 2px solid var(--green-2); border-color: transparent; }
.toggle2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.t2 { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 700; color: var(--ink); cursor: pointer; }
.t2.active { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary { width: 100%; margin-top: 6px; padding: 15px; border: none; border-radius: 14px; background: var(--green); color: #fff; font-size: 16px; font-weight: 800; cursor: pointer; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { opacity: .6; }
.btn-ghost { width: 100%; margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--green-2); font-weight: 700; font-size: 14px; cursor: pointer; }
.btn-danger { width: 100%; margin-top: 10px; padding: 13px; border: 1px solid #e7ccc4; border-radius: 13px; background: #fff; color: #b4381f; font-weight: 700; font-size: 14px; cursor: pointer; }

/* iOS-style switch */
.switch { position: relative; display: inline-block; width: 46px; height: 27px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: #d7d2c6; transition: background .2s ease; }
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22); transition: transform .2s ease;
}
.switch input:checked + .switch-track { background: var(--green-2); }
.switch input:checked + .switch-track::after { transform: translateX(19px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--green-2); outline-offset: 2px; }

/* ---------- account ---------- */
.acc-card { display: flex; align-items: center; gap: 12px; }
.acc-card .acc-ico { width: 44px; height: 44px; border-radius: 12px; background: rgba(46,125,74,.12); display: grid; place-items: center; font-size: 21px; flex: none; }
.acc-card .acc-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-card .acc-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.acc-card b { font-size: 15px; overflow-wrap: anywhere; }
#acc-toggle { margin-top: 10px; }
#acc-error { margin-top: 2px; }

/* ---------- reminders ---------- */
.rem-perm { margin: 0 0 14px; padding: 12px 14px; border-radius: 13px; background: #fff7e6; border: 1px solid var(--gold); color: #8a6a12; font-size: 13px; line-height: 1.45; }
#rem-body.off { opacity: .45; pointer-events: none; }
.rem-row { display: flex; align-items: center; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.rem-row:last-child { border-bottom: none; }
.rem-lbl { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; }
.rem-time { border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; font-family: inherit; font-size: 14px; color: var(--ink); background: #fff; }
.rem-fields { display: flex; gap: 8px; padding: 0 2px 12px; }
.rem-fields.off { display: none; }
.rem-fields label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 700; }
.rem-fields select, .rem-fields input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-family: inherit; font-size: 13.5px; color: var(--ink); background: #fff; }

/* ---------- dishes / search ---------- */
.dish-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.dish { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.dish-main { flex: 1; min-width: 0; }
.dish-name { font-weight: 700; font-size: 14.5px; }
.dish-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dish-macros { font-size: 12.5px; margin-top: 6px; }
.dish-macros b { color: var(--terra); }
.dish-note { font-size: 12px; color: var(--muted); margin-top: 6px; font-style: italic; }
.btn-add { flex: none; width: 40px; height: 40px; border-radius: 12px; border: none; background: var(--green-2); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.btn-add:active { transform: scale(.94); }
.ai-estimate { margin: 2px 0 14px; }
.btn-ai { width: 100%; padding: 13px; border: 1px dashed var(--gold); border-radius: 13px; background: #fff7e6; color: #a9821a; font-weight: 800; font-size: 14px; cursor: pointer; }
.est-card { border-color: var(--gold); }
.badge { display: inline-block; vertical-align: middle; font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--gold); padding: 2px 6px; border-radius: 6px; margin-left: 4px; }

/* ---------- sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; background: var(--cream); max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column; animation: slideup .25s ease; }
@keyframes slideup { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; gap: 6px; padding: 14px 12px; padding-top: max(14px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--cream); }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 18px 28px; }
.sheet-body.chat { display: flex; flex-direction: column; padding: 0; }

/* chat */
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 15px; font-size: 14px; line-height: 1.45; }
.msg.user { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 5px; }
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.chat-bar { display: flex; gap: 8px; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--cream); }
.chat-bar .input { flex: 1; }
.btn-send { flex: none; border: none; background: var(--green); color: #fff; border-radius: 12px; padding: 0 18px; font-weight: 800; cursor: pointer; }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 40; width: 100%; max-width: var(--maxw); display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; border: none; background: transparent; padding: 9px 2px 11px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tab .tab-ico { width: 23px; height: 23px; }
.tab.active { color: var(--green); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(12px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 80; max-width: 88%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- onboarding ---------- */
.onboarding {
  position: fixed; inset: 0; z-index: 90; max-width: var(--maxw); margin: 0 auto;
  background: var(--cream); display: flex; flex-direction: column;
  padding-top: max(14px, env(safe-area-inset-top));
}
.onb-skip {
  align-self: flex-end; border: none; background: transparent; color: var(--muted);
  font-weight: 700; font-size: 14px; padding: 12px 18px; cursor: pointer;
}
.onb-track { flex: 1; position: relative; overflow: hidden; }
.onb-slide {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 10px 30px 20px; gap: 14px;
  opacity: 0; visibility: hidden; transform: translateX(24px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s;
}
.onb-slide.active { opacity: 1; visibility: visible; transform: none; }
.onb-art {
  width: 168px; height: 168px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 50% 20%, #2a744a 0%, #184a2e 100%);
  box-shadow: var(--shadow); margin-bottom: 6px;
}
.onb-logo { width: 108px; height: 108px; }
.onb-art-glyph { font-size: 74px; position: relative; }
.onb-art-glyph .onb-spark { position: absolute; top: 30px; right: 34px; font-size: 30px; }

/* floating cutout character (with pointer parallax on the whole group) */
.onb-hero {
  position: relative; width: 100%; max-width: 300px; height: 252px; margin: 0 auto 4px;
  display: grid; place-items: center;
  transform: translate(var(--onb-px, 0px), var(--onb-py, 0px)); transition: transform .25s ease-out;
}
.onb-hero-glow {
  position: absolute; inset: 0; margin: auto; width: 212px; height: 212px; border-radius: 50%;
  background: radial-gradient(circle, rgba(46,125,74,.20), rgba(46,125,74,0) 70%);
}
.onb-char {
  position: relative; z-index: 1; max-height: 248px; max-width: 92%; object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(23,70,44,.24));
  -webkit-mask-image: linear-gradient(to bottom, #000 84%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 84%, transparent 100%);
  will-change: transform;
}
.onb-orb { position: absolute; border-radius: 50%; opacity: .9; }
.orb1 { width: 14px; height: 14px; background: var(--gold); top: 8%; left: 12%; }
.orb2 { width: 10px; height: 10px; background: var(--green-3); top: 22%; right: 9%; z-index: 2; }
.orb3 { width: 9px; height: 9px; background: var(--terra); bottom: 20%; left: 17%; z-index: 2; }

/* entrance + idle motion, only on the active slide */
.onb-slide.active .onb-hero-glow { animation: heroPulse 6s ease-in-out infinite; }
.onb-slide.active .onb-char { animation: charIn .6s cubic-bezier(.2,.7,.2,1) both, charFloat 4.4s ease-in-out .6s infinite; }
.onb-slide.active .onb-orb { animation: orbFloat 5s ease-in-out infinite; }
.onb-slide.active .orb2 { animation-duration: 6.5s; animation-delay: .4s; }
.onb-slide.active .orb3 { animation-duration: 4s; animation-delay: .7s; }
@keyframes heroPulse { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes charIn { from { opacity: 0; transform: translateY(26px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes charFloat { 0%,100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-10px) rotate(.6deg); } }
@keyframes orbFloat { 0%,100% { transform: translate(0,0); } 50% { transform: translate(4px,-12px); } }
@media (prefers-reduced-motion: reduce) {
  .onb-slide.active .onb-char, .onb-slide.active .onb-orb, .onb-slide.active .onb-hero-glow,
  .onb-slide.active .onb-scene, .onb-slide.active .onb-badge, .onb-slide.active .fcard,
  .onb-slide.active .fcard-coral .fcard-food, .onb-slide.active .fring-flame,
  .onb-slide.active .fcard-green .fcard-food, .onb-slide.active .fcard-green .fcard-media::after { animation: none; }
  .onb-slide.active .fcard-green .fcard-media::after { display: none; }
  .onb-slide.active .fring-prog { animation: none; stroke-dashoffset: 60; }
  .onb-slide.active .prog-fill { animation: none; }
}

/* ===== rebuilt onboarding screens (from the uploaded designs) ===== */
.onb-h1 { margin: 6px 0 0; font-size: 30px; font-weight: 800; line-height: 1.06; letter-spacing: -.02em; color: var(--green); }
.onb-h1.left { font-size: 26px; text-align: left; color: var(--ink); }
.onb-sub { margin: 8px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink); max-width: 340px; }
.onb-sub.left { text-align: left; font-size: 13px; max-width: none; margin-top: 10px; color: var(--muted); }
.onb-sprig svg { width: 46px; height: 26px; display: block; margin: 0 auto; }
.onb-accent { display: inline-block; position: relative; font-size: 26px; font-weight: 800; line-height: 1.06; color: var(--green-2); }
.onb-underline { position: absolute; left: 0; bottom: -7px; width: 100%; height: 10px; }

/* welcome slide: top-aligned + scroll-safe so the focus list always fits */
.onb-welcome { justify-content: flex-start; overflow-y: auto; overflow-x: hidden; padding-top: 44px; gap: 8px; }
.onb-welcome .onb-foot { margin-top: auto; }
/* "what we focus on" list */
.onb-focus { list-style: none; margin: 8px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 11px; width: 100%; max-width: 322px; text-align: left; }
.onb-focus li { display: flex; align-items: center; gap: 12px; }
.onb-focus .of-ico { width: 40px; height: 40px; border-radius: 12px; background: #e4efe0; display: grid; place-items: center; flex: none; }
.onb-focus .of-ico svg { width: 22px; height: 22px; }
.onb-focus b { display: block; font-size: 14px; font-weight: 800; }
.onb-focus span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }

/* welcome hero scene */
.onb-hero-scene { max-width: 320px; height: 236px; }
.onb-hero-scene .onb-hero-glow { width: 232px; height: 232px; background: radial-gradient(circle, rgba(232,199,140,.28), rgba(232,199,140,0) 70%); }
.onb-scene { position: relative; z-index: 1; max-height: 236px; max-width: 100%; object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(23,70,44,.22));
  -webkit-mask-image: linear-gradient(to bottom, #000 90%, transparent 100%); mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
  will-change: transform; }
.onb-slide.active .onb-scene { animation: charIn .6s cubic-bezier(.2,.7,.2,1) both, charFloat 5s ease-in-out .6s infinite; }
.onb-badge { position: absolute; width: 50px; height: 50px; border-radius: 50%; background: #dcebdd; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(31,94,58,.14); z-index: 2; }
.onb-badge svg { width: 26px; height: 26px; }
.onb-badge.b-leaf { width: 40px; height: 40px; background: #e4efe0; }
.onb-badge.b-leaf svg { width: 20px; height: 20px; }
.b1 { top: 2%; right: 4%; } .b2 { top: 33%; right: -2%; } .b3 { top: 20%; left: 0; } .b4 { bottom: 14%; right: 6%; }
.onb-diamond { position: absolute; width: 11px; height: 11px; border: 2px solid var(--gold); transform: rotate(45deg); z-index: 2; }
.dm1 { top: 44%; left: 6%; } .dm2 { top: 54%; right: 2%; border-color: var(--green-3); }
.onb-hero-scene .orb1 { top: 12%; left: 16%; background: var(--green-3); } .onb-hero-scene .orb2 { bottom: 30%; left: 8%; background: var(--gold); }
.onb-slide.active .onb-badge { animation: badgeFloat 5s ease-in-out infinite; }
.onb-slide.active .b2 { animation-duration: 6.4s; animation-delay: .3s; }
.onb-slide.active .b3 { animation-duration: 4.4s; animation-delay: .6s; }
.onb-slide.active .b4 { animation-duration: 5.6s; animation-delay: .2s; }
@keyframes badgeFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* footer (dots + cta) */
.onb-foot { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 14px; }
.onb-goals .onb-foot { flex-direction: column; gap: 12px; margin-top: 18px; }
.onb-cta { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--green); color: #fff;
  border: none; border-radius: 16px; padding: 15px 24px; font-size: 16px; font-weight: 800; cursor: pointer; }
.onb-cta:active { transform: translateY(1px); }
.onb-cta.full { width: 100%; }
.cta-ico { display: grid; place-items: center; } .cta-ico svg { width: 20px; height: 20px; }
.cta-ico.round { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.18); }

/* goals slide layout */
.onb-slide.scrollable { justify-content: flex-start; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; gap: 0; padding: 40px 16px 0; text-align: left; }
.onb-goals-top { display: flex; gap: 10px; align-items: flex-start; width: 100%; }
.onb-goals-head { flex: 1; min-width: 0; }
.onb-leafmark { display: inline-block; width: 22px; height: 10px; border-radius: 0 0 12px 12px; background: var(--green-3); opacity: .55; margin-bottom: 4px; }
.onb-goals-fig { position: relative; width: 40%; flex: none; }
.onb-goals-fig .onb-char { width: 100%; max-height: 200px; object-fit: contain; filter: drop-shadow(0 12px 18px rgba(23,70,44,.22)); will-change: transform; }
.onb-star { position: absolute; } .onb-star svg { width: 18px; height: 18px; }
.st1 { top: 2%; left: -4%; } .st2 { top: 26%; right: -2%; }
.onb-slide.active .onb-star { animation: badgeFloat 4.6s ease-in-out infinite; }

/* feature cards */
.onb-cards { display: flex; gap: 8px; width: 100%; margin-top: 18px; align-items: stretch; }
.fcard { flex: 1; min-width: 0; border-radius: 16px; padding: 12px 9px 14px; display: flex; flex-direction: column; align-items: center;
  text-align: center; position: relative; overflow: hidden; box-shadow: var(--shadow); color: #fff; }
.fcard-green { background: #45964f; } .fcard-dark { background: #26271f; } .fcard-coral { background: #e0563c; }
.onb-slide.active .fcard { animation: cardIn .5s cubic-bezier(.2,.7,.2,1) both; }
.onb-slide.active .fcard-dark { animation-delay: .08s; } .onb-slide.active .fcard-coral { animation-delay: .16s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.fcard-media { width: 100%; height: 84px; border-radius: 12px; background: rgba(255,255,255,.16); display: grid; place-items: center; position: relative; margin-bottom: 8px; padding: 5px; }
.fcard-emoji { font-size: 38px; line-height: 1; }
.fcard-food { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0,0,0,.28)); }
/* the smiley bowl bounces like it's alive */
.onb-slide.active .fcard-coral .fcard-food { transform-origin: center bottom; animation: bowlBounce 2.2s ease-in-out .5s infinite; }
@keyframes bowlBounce {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  28% { transform: translateY(-9px) scale(.98, 1.03); }
  48% { transform: translateY(0) scale(1.05, .95); }
  68% { transform: translateY(-3px) scale(1, 1); }
}
/* calorie counter: ring fills, flame flickers */
.onb-slide.active .fring-prog { animation: ringFill 1.2s cubic-bezier(.3,.7,.3,1) both; }
@keyframes ringFill { from { stroke-dashoffset: 213.6; } to { stroke-dashoffset: 60; } }
.onb-slide.active .fring-flame { display: inline-block; transform-origin: center bottom; animation: flameFlicker 1.3s ease-in-out infinite; }
@keyframes flameFlicker { 0%, 100% { transform: scale(1) rotate(-4deg); } 50% { transform: scale(1.18) rotate(4deg); } }

/* "Scanne ton repas": a scanner beam sweeps the plate, camera pulses, food breathes */
.onb-slide.active .fcard-green .fcard-food { animation: foodBreathe 3s ease-in-out infinite; }
@keyframes foodBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.onb-slide.active .fcard-green .fcard-media::after {
  content: ""; position: absolute; left: 7px; right: 7px; top: 0; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent);
  box-shadow: 0 0 10px 2px rgba(255,255,255,.65);
  animation: scanSweep 2.6s ease-in-out infinite;
}
@keyframes scanSweep {
  0% { transform: translateY(3px); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateY(78px); opacity: 0; }
}
.fcard-cam { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 30px; height: 30px; border-radius: 50%; background: var(--green); border: 2px solid #fff; display: grid; place-items: center; }
.fcard-cam svg { width: 16px; height: 16px; }
.fcard-heart { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: var(--shadow); }
.fcard-heart svg { width: 14px; height: 14px; }
.fcard-title { font-weight: 800; font-size: 12.5px; margin-top: 2px; }
.fcard-body { font-size: 10px; line-height: 1.35; margin-top: 4px; opacity: .9; }
.fcard-dots { display: flex; gap: 4px; margin-top: 9px; }
.fcard-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.4); }
.fcard-dots i.on { width: 12px; border-radius: 3px; background: #fff; }
.fcard-kente { position: absolute; left: 0; right: 0; bottom: 0; height: 13px; background: repeating-linear-gradient(45deg, #1F5E3A 0 6px, #E8B931 6px 12px, #B45A1F 12px 18px); }
/* track card ring + chart */
.fcard-ring { position: relative; width: 74px; height: 74px; margin: 0 auto 4px; }
.fring { width: 74px; height: 74px; }
.fring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.fring-flame { font-size: 12px; line-height: 1; } .fring-c b { font-size: 17px; line-height: 1.05; } .fring-u { font-size: 8px; font-weight: 800; letter-spacing: .06em; color: var(--gold); }
.fbars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 32px; margin-top: 6px; }
.fbars i { width: 7px; border-radius: 3px; }
.fbars i:nth-child(1) { background: #2E7D4A; } .fbars i:nth-child(2) { background: #3f8f5f; } .fbars i:nth-child(3) { background: #7fae3f; }
.fbars i:nth-child(4) { background: #E8B931; } .fbars i:nth-child(5) { background: #e9a72c; } .fbars i:nth-child(6) { background: #e07b2c; } .fbars i:nth-child(7) { background: #e0563c; }
.fbar-days { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.fbar-days span { width: 7px; font-size: 7.5px; color: rgba(255,255,255,.6); text-align: center; }

/* benefit chips bar */
.onb-benefits { display: flex; width: 100%; background: rgba(31,94,58,.06); border-radius: 16px; padding: 12px 4px; margin-top: 18px; }
.obc { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 9.5px; font-weight: 700; color: var(--ink); position: relative; padding: 0 3px; }
.obc + .obc::before { content: ""; position: absolute; left: 0; top: 14%; height: 72%; width: 1px; background: var(--line); }
.obc-ico svg { width: 24px; height: 24px; display: block; }

/* full-bleed kente strip at the bottom of the goals slide */
.onb-kente { width: calc(100% + 32px); margin: 18px -16px 0; height: 20px; flex: none;
  background: repeating-linear-gradient(45deg, #1F5E3A 0 8px, #E8B931 8px 16px, #B45A1F 16px 24px); }

/* ===== Track-your-progress slide ===== */
.prog-wrap { display: flex; gap: 12px; align-items: center; width: 100%; margin-top: 14px; }
.prog-fig { position: relative; width: 38%; flex: none; }
.prog-fig .onb-char { width: 100%; max-height: 250px; object-fit: contain; filter: drop-shadow(0 12px 18px rgba(23,70,44,.22)); will-change: transform; }
.prog-card { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 13px; }
.prog-card-title { font-weight: 800; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.prog-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.prog-row:first-of-type { border-top: none; padding-top: 0; }
.prog-row.col { flex-direction: column; align-items: stretch; gap: 6px; }
.prog-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.prog-row.col .prog-info { flex-direction: row; align-items: baseline; justify-content: space-between; }
.prog-lbl { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.prog-val { font-size: 14px; font-weight: 800; }
.prog-viz { width: 78px; height: 26px; flex: none; }
.prog-bars { display: flex; align-items: flex-end; gap: 4px; }
.prog-bars i { flex: 1; border-radius: 2px; background: linear-gradient(var(--green-3), var(--green-2)); }
.prog-track { height: 8px; border-radius: 999px; background: #eef0ec; overflow: hidden; }
.prog-fill { height: 100%; width: var(--w); border-radius: 999px; background: linear-gradient(90deg, var(--green-2), var(--green-3)); }
.onb-slide.active .prog-fill { animation: progGrow 1s ease-out both; }
@keyframes progGrow { from { width: 0; } to { width: var(--w); } }
.onb-slide.active .prog-fig .onb-char { animation: charIn .5s cubic-bezier(.2,.7,.2,1) both, charFloat 4.6s ease-in-out .5s infinite; }

/* ===== Fuel-your-body slide ===== */
.onb-fuel { justify-content: flex-start; }
.fuel-fig { position: relative; width: 100%; display: grid; place-items: center; margin-top: 12px; }
.fuel-fig .onb-char { max-height: 210px; max-width: 88%; object-fit: contain; filter: drop-shadow(0 14px 20px rgba(23,70,44,.22)); will-change: transform; }
.onb-slide.active .fuel-fig .onb-char { animation: charIn .55s cubic-bezier(.2,.7,.2,1) both, charFloat 5s ease-in-out .55s infinite; }
.fuel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 340px; margin-top: 16px; }
.fuel-item { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; box-shadow: var(--shadow); font-weight: 700; font-size: 13.5px; }
.fuel-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.fuel-ico svg { width: 19px; height: 19px; }
.fuel-ico.i-p { background: rgba(180,90,31,.14); color: var(--terra); }
.fuel-ico.i-e { background: rgba(232,185,49,.18); color: #b78a17; }
.fuel-ico.i-r { background: rgba(46,125,74,.14); color: var(--green-2); }
.fuel-ico.i-h { background: rgba(59,130,196,.16); color: #3b82c4; }
.onb-title { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.onb-body { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 320px; }
.onb-demo {
  margin-top: 8px; width: 100%; max-width: 320px; background: var(--card); border: 1px solid var(--gold);
  border-radius: 14px; padding: 12px 14px; text-align: left; box-shadow: var(--shadow);
}
.onb-demo-name { font-weight: 700; font-size: 14.5px; }
.onb-demo-macros { font-size: 12.5px; margin-top: 6px; }
.onb-demo-macros b { color: var(--terra); }
.onb-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.onb-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; box-shadow: var(--shadow);
}
.onb-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.onb-footer {
  padding: 16px 24px; padding-bottom: max(20px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.onb-dots { display: flex; gap: 8px; }
.onb-dots i { width: 8px; height: 8px; border-radius: 50%; background: #d7d2c6; transition: all .3s ease; }
.onb-dots i.active { width: 22px; border-radius: 999px; background: var(--green); }
.onb-footer .btn-primary { margin-top: 0; }

/* ---------- personalized plan ---------- */
.plan-target { text-align: center; background: var(--green); color: #fff; border-color: var(--green); }
.plan-target-label { font-size: 13px; font-weight: 700; color: #bfe3cd; }
.plan-target-num { margin: 6px 0 4px; }
.plan-target-num b { font-size: 42px; letter-spacing: -0.02em; }
.plan-target-num span { font-size: 14px; color: #d7ecdf; }
.plan-target-goal { font-size: 12.5px; color: #bfe3cd; }
.plan-energy { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.plan-energy-cell {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 10px;
  text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 3px;
}
.plan-e-val { font-size: 22px; font-weight: 800; }
.plan-e-lbl { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.plan-macro { margin-bottom: 14px; }
.plan-macro:last-child { margin-bottom: 0; }
.plan-macro-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.plan-macro-name { font-weight: 700; display: flex; align-items: center; gap: 7px; }
.plan-macro-name .dot { width: 9px; height: 9px; border-radius: 50%; }
.plan-macro-val { color: var(--muted); }
.plan-macro-val b { color: var(--ink); }
.plan-macro-track { height: 9px; background: #eef0ec; border-radius: 999px; overflow: hidden; }
.plan-macro-fill { height: 100%; border-radius: 999px; }
.plan-hydration { display: flex; align-items: center; gap: 12px; }
.plan-hydration .ph-ico { width: 44px; height: 44px; border-radius: 12px; background: rgba(59,130,196,.14); display: grid; place-items: center; font-size: 22px; flex: none; }
.plan-hydration .ph-main { display: flex; flex-direction: column; gap: 1px; }
.plan-hydration .ph-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.plan-hydration b { font-size: 18px; }
.plan-ai { border-color: var(--gold); background: #fff9ec; }
.plan-ai-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.plan-ai-ico { font-size: 18px; }
.plan-ai-body { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink); }
.plan-ai-body.loading { color: var(--muted); font-style: italic; }

/* ---------- scan meal ---------- */
.scan-capture { text-align: center; padding: 24px 6px 8px; }
.scan-illus {
  width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  font-size: 46px; background: radial-gradient(120% 120% at 50% 20%, #2a744a 0%, #184a2e 100%); box-shadow: var(--shadow);
}
.scan-lead { font-size: 14.5px; color: var(--muted); margin: 0 auto 22px; max-width: 300px; line-height: 1.5; }
.scan-btn { display: flex; align-items: center; justify-content: center; margin-top: 10px; cursor: pointer; }
.scan-capture .note { margin-top: 18px; }
.scan-photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 14px; background: #000; }
.scan-photo img { width: 100%; display: block; max-height: 320px; object-fit: cover; }
.scan-status { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin-bottom: 12px; min-height: 22px; }
.scan-status .scan-note { color: var(--muted); }
.scan-status:empty { display: none; }
.scan-estimate-wrap { margin-bottom: 4px; }
#scan-estimate .btn-primary { margin-top: 4px; }
#scan-retake { margin-top: 10px; }
.spin {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2.5px solid #d9e5dd; border-top-color: var(--green-2); animation: spin .7s linear infinite;
}
.spin.light { width: 26px; height: 26px; border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- camera viewfinder ---------- */
.cam-stage { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 3 / 4; margin-bottom: 16px; }
.cam-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-msg {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 26px; background: rgba(23, 70, 44, .94); color: #fff;
}
.cam-msg b { font-size: 17px; }
.cam-msg-body { margin: 0; font-size: 13.5px; line-height: 1.5; color: #d7ecdf; max-width: 260px; }
.cam-msg .btn-primary { background: var(--gold); color: var(--green); max-width: 240px; }
.cam-msg .btn-ghost.light { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; max-width: 240px; }
.cam-controls { display: flex; align-items: center; justify-content: center; gap: 40px; padding: 2px 0 8px; }
.cam-controls[hidden] { display: none; }
.cam-shutter { width: 68px; height: 68px; border-radius: 50%; background: #fff; border: 4px solid var(--green); cursor: pointer; box-shadow: var(--shadow); }
.cam-shutter:active { transform: scale(.94); }
.cam-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 20px; color: var(--green); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); }
.cam-btn:active { transform: scale(.94); }
.scan-privacy { margin-top: 16px; }
