/* VOICE   calm, premium, kitchen-honest: few hues, fine detail, air
   IDEA    the day is a brass thali; each macro is a katori beside it
   PICTURE the thali ring on Today fills as food is logged
   COLOUR  stone ground, banana-leaf green, brass edge; muted macro tones
   TYPE    Fraunces for numbers and titles, Manrope for everything else */

@font-face { font-family: 'Manrope'; src: url(fonts/manrope.woff2) format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url(fonts/fraunces.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #ECEAE4; --surface: #F7F6F2; --surface-2: #E3E0D8; --line: #D6D2C8;
  --ink: #1D221F; --ink-2: #5B615C; --ink-3: #8A8F89;
  --leaf: #3D5A4A; --leaf-ink: #F4F3EE; --leaf-soft: #D9E0D7;
  --brass: #A8834E; --brass-soft: #E8DCC6;
  --protein: #5D7690; --carbs: #BE9858; --fat: #AE775F; --fibre: #7E9877;
  --over: #A0564A; --veg: #4C7754; --nonveg: #965244; --egg: #B0863A;
  --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 8px 24px -14px rgba(40,36,28,.35);
  --r: 20px; --r-sm: 14px;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tab-h: 68px;
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
  --safe-t: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --bg: #121513; --surface: #1A1E1B; --surface-2: #242924; --line: #2E3430;
    --ink: #ECEAE3; --ink-2: #A3A8A1; --ink-3: #737872;
    --leaf: #8DB49C; --leaf-ink: #102018; --leaf-soft: #22302A;
    --brass: #C7A26B; --brass-soft: #3A3226;
    --protein: #8EA5BE; --carbs: #D1AF78; --fat: #C99179; --fibre: #9DB793;
    --over: #D2826F; --veg: #7FB287; --nonveg: #CF8A78; --egg: #D6AE5E;
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 28px -16px rgba(0,0,0,.8);
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #121513; --surface: #1A1E1B; --surface-2: #242924; --line: #2E3430;
  --ink: #ECEAE3; --ink-2: #A3A8A1; --ink-3: #737872;
  --leaf: #8DB49C; --leaf-ink: #102018; --leaf-soft: #22302A;
  --brass: #C7A26B; --brass-soft: #3A3226;
  --protein: #8EA5BE; --carbs: #D1AF78; --fat: #C99179; --fibre: #9DB793;
  --over: #D2826F; --veg: #7FB287; --nonveg: #CF8A78; --egg: #D6AE5E;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 28px -16px rgba(0,0,0,.8);
}

* { box-sizing: border-box; min-width: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); overflow-x: clip; }
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
p { margin: 0; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

.app { max-width: 520px; margin: 0 auto; }
.view { padding: calc(14px + var(--safe-t)) 18px calc(var(--tab-h) + var(--safe-b) + 36px); min-height: 100vh; }
.boot { padding: 40vh 0; text-align: center; color: var(--ink-3); }

/* ---------- headers ---------- */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 16px; }
.kicker { font-size: 13px; color: var(--ink-2); letter-spacing: .01em; }
.top h1 { font: 500 29px/1.1 var(--serif); letter-spacing: -.01em; text-wrap: balance; margin-top: 2px; }
.top .icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 10px; }
.section-h h2 { font: 500 20px/1.2 var(--serif); }
.section-h .link { font-size: 13px; color: var(--leaf); font-weight: 600; }

/* ---------- cards & controls ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; font-weight: 650; font-size: 15px; white-space: nowrap; background: var(--surface-2); color: var(--ink); transition: transform .12s, background .2s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--leaf); color: var(--leaf-ink); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.quiet { background: transparent; color: var(--leaf); padding: 0 8px; }
.btn.danger { background: transparent; color: var(--over); border: 1px solid var(--line); border-color: color-mix(in srgb, var(--over) 40%, transparent); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .ic { width: 19px; height: 19px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.stack-sm > * + * { margin-top: 8px; }

.field { display: block; margin-top: 14px; }
.field > span { display: block; font-size: 13px; color: var(--ink-2); margin: 0 2px 6px; font-weight: 600; }
.input, .select, textarea.input { width: 100%; min-height: 46px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg); padding: 10px 14px; font-size: 16px; outline: none; transition: border-color .2s; }
textarea.input { resize: none; line-height: 1.45; }
.input:focus, .select:focus { border-color: var(--leaf); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.grid2 .field, .grid3 .field { margin-top: 14px; }
.unit { position: relative; }
.unit .input { padding-right: 46px; }
.unit em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--ink-3); font-size: 14px; pointer-events: none; }

.seg { display: flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { flex: 1; min-height: 38px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); padding: 0 8px; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--ink-2); background: transparent; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip small { font-weight: 500; opacity: .7; margin-left: 4px; }
.pick { display: grid; gap: 8px; }
.pick button { text-align: left; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.pick button b { font-weight: 650; display: block; font-size: 14.5px; }
.pick button span { font-size: 12.5px; color: var(--ink-2); }
.pick button.on { border-color: var(--leaf); background: var(--leaf-soft); }
.pick button .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; }
.pick button.on .tick { border: 6px solid var(--leaf); }

/* ---------- Today ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; margin-bottom: 8px; }
.day { display: grid; justify-items: center; gap: 4px; padding: 8px 0 9px; border-radius: 16px; color: var(--ink-2); }
.day b { font: 500 16px/1 var(--serif); color: var(--ink); }
.day span { font-size: 11.5px; font-weight: 600; }
.day i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.day i.some { background: var(--brass); }
.day i.full { background: var(--leaf); }
.day.on { background: var(--surface); box-shadow: var(--shadow); }

.thali-wrap { display: grid; place-items: center; padding: 8px 0 4px; }
.thali { position: relative; width: min(78vw, 290px); aspect-ratio: 1; }
.thali svg { width: 100%; height: 100%; display: block; }
.thali .rim { fill: var(--surface-2); stroke: var(--brass); stroke-width: 1.2; }
.thali .bead { fill: var(--brass); opacity: .55; }
.thali .track { fill: none; stroke: var(--surface); stroke-width: 15; }
.thali .prog { fill: none; stroke: var(--leaf); stroke-width: 15; stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1), stroke .3s; }
.thali.over .prog { stroke: var(--over); }
.thali .plate { fill: var(--surface); }
.thali .plate-in { fill: none; stroke: var(--line); stroke-width: 1; }
.thali-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.thali-c .big { font: 500 clamp(40px, 13vw, 54px)/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.thali-c .lbl { font-size: 13.5px; font-weight: 650; color: var(--ink-2); }
.thali.over .thali-c .lbl { color: var(--over); }
.thali-c .sub { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

.katoris { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin: 10px 0 4px; }
.katori { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 10px 4px 10px; display: grid; justify-items: center; text-align: center; }
.katori svg { width: 46px; height: 46px; }
.katori .k-track { fill: none; stroke: var(--surface-2); stroke-width: 5; }
.katori .k-prog { fill: none; stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.2,.8,.2,1); }
.katori.protein .k-prog { stroke: var(--protein); } .katori.carbs .k-prog { stroke: var(--carbs); }
.katori.fat .k-prog { stroke: var(--fat); } .katori.fibre .k-prog { stroke: var(--fibre); }
.k-val { font: 500 17px/1.1 var(--serif); margin-top: 6px; font-variant-numeric: tabular-nums; }
.k-val small { font: 500 11px var(--sans); color: var(--ink-3); }
.k-name { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }

.setup { display: flex; gap: 14px; align-items: center; background: var(--leaf); color: var(--leaf-ink); border-radius: var(--r); padding: 16px; margin-bottom: 8px; }
.setup h3 { font: 500 18px/1.2 var(--serif); }
.setup p { font-size: 13px; opacity: .85; margin-top: 2px; }
.setup .btn { background: var(--leaf-ink); color: var(--leaf); flex: none; }

.meals { margin-top: 18px; }
.meal { padding: 14px 14px 10px 16px; }
.meal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meal-h h3 { font: 500 18px/1.2 var(--serif); }
.meal-h p { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.add-mini { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--leaf-soft); color: var(--leaf); flex: none; }
.items { list-style: none; margin: 8px 0 0; padding: 0; }
.items li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.it-main { display: grid; }
.it-name { font-weight: 650; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it-sub { font-size: 12px; color: var(--ink-2); }
.it-k { font: 500 16px var(--serif); font-variant-numeric: tabular-nums; white-space: nowrap; }
.it-k small { font: 500 11px var(--sans); color: var(--ink-3); margin-left: 2px; }

.water { margin-top: 12px; display: flex; align-items: center; gap: 14px; }
.water .drop { width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); background: color-mix(in srgb, var(--protein) 16%, transparent); color: var(--protein); display: grid; place-items: center; flex: none; }
.water .bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.water .bar i { display: block; height: 100%; background: var(--protein); border-radius: 6px; transition: width .5s; }
.water .wbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.foot-note { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 22px; }

/* ---------- Tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tab-h) + var(--safe-b)); padding: 0 max(8px, calc((100vw - 520px) / 2 + 8px)) var(--safe-b); display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); align-items: center; background: var(--surface); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); border-top: 1px solid var(--line); }
.tabbar button { display: grid; justify-items: center; gap: 3px; color: var(--ink-3); font-size: 11px; font-weight: 650; padding: 8px 0; min-height: 52px; }
.tabbar button.on { color: var(--leaf); }
.tabbar .scan-fab { width: 62px; height: 62px; margin: -26px auto 0; border-radius: 50%; background: var(--leaf); color: var(--leaf-ink); display: grid; place-items: center; box-shadow: 0 0 0 6px var(--bg), 0 10px 24px -8px rgba(30,50,40,.55); padding: 0; justify-self: center; }
.tabbar .scan-fab .ic { width: 28px; height: 28px; stroke-width: 1.7; }

/* ---------- Sheets ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 50; display: none; }
.sheet-root.open { display: block; }
.scrim { position: absolute; inset: 0; background: rgba(12,14,12,.42); opacity: 0; transition: opacity .25s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 26px 26px 0 0; transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -10px 40px -20px rgba(0,0,0,.5); }
.sheet.full { height: 100%; max-height: 100%; border-radius: 0; }
.sheet-root.show .scrim { opacity: 1; }
.sheet-root.show .sheet { transform: none; }
.grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 9px auto 0; flex: none; }
.sheet.full .grab { display: none; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px calc(24px + var(--safe-b)); flex: 1; }
.sheet-h { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 0 6px; position: sticky; top: -8px; background: var(--surface); z-index: 2; }
.sheet-h h2 { font: 500 23px/1.15 var(--serif); }
.sheet-h p { font-size: 13px; color: var(--ink-2); }
.x { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.sheet-foot { position: sticky; bottom: calc(-24px - var(--safe-b)); background: var(--surface); box-shadow: 0 -14px 14px -6px var(--surface); padding: 12px 0 calc(16px + var(--safe-b)); margin-top: 14px; z-index: 2; }
.sheet.tall { min-height: 78vh; }

/* ---------- Quick add ---------- */
.qa { display: grid; justify-items: center; gap: 6px; padding: 14px 6px 12px; border-radius: 16px; background: var(--bg); font-size: 13px; font-weight: 650; color: var(--ink); }
.qa .ic { color: var(--leaf); width: 24px; height: 24px; }

/* ---------- Library ---------- */
.search { position: relative; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); width: 20px; height: 20px; }
.search .input { padding-left: 42px; background: var(--surface); border-color: transparent; box-shadow: var(--shadow); }
.chart-cta { margin-top: 14px; display: grid; gap: 12px; background: linear-gradient(140deg, var(--leaf), color-mix(in srgb, var(--leaf) 75%, #000)); color: var(--leaf-ink); }
.chart-cta h3 { font: 500 21px/1.2 var(--serif); }
.chart-cta p { font-size: 13.5px; opacity: .85; margin-top: 3px; }
.chart-cta .btn { background: var(--leaf-ink); color: var(--leaf); justify-self: start; }
.regions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; margin-top: 12px; }
.region { text-align: left; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 14px; display: grid; gap: 6px; align-content: start; min-height: 108px; position: relative; overflow: hidden; }
.region h3 { font: 500 17px/1.2 var(--serif); padding-right: 18px; }
.region p { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.region .count { font-size: 11.5px; font-weight: 700; color: var(--brass); margin-top: auto; }
.region::after { content: ''; position: absolute; right: -30px; top: -30px; width: 58px; height: 58px; border-radius: 50%; border: 1.5px solid var(--brass-soft); box-shadow: 0 0 0 8px color-mix(in srgb, var(--brass-soft) 35%, transparent); }
.foods { list-style: none; padding: 0; margin: 6px 0 0; }
.food { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.food:last-child { border-bottom: 0; }
.food .f-main { flex: 1; display: grid; gap: 1px; }
.food b { font-weight: 650; font-size: 14.5px; }
.food .f-sub { font-size: 12.5px; color: var(--ink-2); }
.food .f-k { text-align: right; font: 500 17px var(--serif); white-space: nowrap; font-variant-numeric: tabular-nums; }
.food .f-k small { display: block; font: 600 11px var(--sans); color: var(--ink-3); }
.vm { width: 14px; height: 14px; border: 1.5px solid var(--veg); border-radius: 3px; display: inline-grid; place-items: center; flex: none; vertical-align: -2px; }
.vm::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--veg); }
.vm.n { border-color: var(--nonveg); }
.vm.n::after { width: 0; height: 0; border-radius: 0; background: none; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-bottom: 6px solid var(--nonveg); }
.vm.e { border-color: var(--egg); } .vm.e::after { background: var(--egg); }
.region-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.region-head h2 { font: 500 25px/1.15 var(--serif); }
.region-head p { font-size: 13px; color: var(--ink-2); }
.back { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow); flex: none; }
.empty { text-align: center; padding: 30px 16px; color: var(--ink-2); }
.empty h3 { font: 500 19px var(--serif); color: var(--ink); margin-bottom: 4px; }

.macro-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.macro-grid div { background: var(--bg); border-radius: 14px; padding: 10px 8px; text-align: center; }
.macro-grid b { display: block; font: 500 19px/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.macro-grid span { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.macro-grid .p b { color: var(--protein); } .macro-grid .c b { color: var(--carbs); } .macro-grid .f b { color: var(--fat); }
.hero-k { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.hero-k b { font: 500 44px/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-k span { color: var(--ink-2); font-weight: 600; }
.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 999px; padding: 3px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.stepper button:active { background: var(--surface); }
.stepper span { min-width: 54px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper .ic { width: 18px; height: 18px; }
.tagline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Diet chart ---------- */
.chart-meal { padding: 14px 0; border-top: 1px solid var(--line); }
.chart-meal:first-of-type { border-top: 0; }
.chart-meal header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.chart-meal h3 { font: 500 18px var(--serif); }
.chart-meal header p { font-size: 12.5px; color: var(--ink-2); }
.chart-meal ul { list-style: none; margin: 0; padding: 0; }
.chart-meal li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 14px; }
.chart-meal li .q { color: var(--ink-2); font-size: 12.5px; display: block; }
.chart-meal li .k { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.totals { display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; border-radius: 16px; background: var(--bg); margin: 12px 0 4px; font-size: 13px; }
.totals b { display: block; font: 500 18px var(--serif); font-variant-numeric: tabular-nums; }
.totals div { text-align: center; }

/* ---------- Scan ---------- */
.sheet.full .sheet-body { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.scan { flex: 1; display: flex; flex-direction: column; background: #0E100E; color: #EEECE6; min-height: 0; }
.scan-top { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + var(--safe-t)) 16px 10px; }
.scan-top .x { background: rgba(255,255,255,.12); color: #fff; }
.scan-top p { font-size: 13px; opacity: .8; }
.viewfinder { position: relative; flex: 1; margin: 0 12px; border-radius: 26px; overflow: hidden; background: radial-gradient(circle at 50% 45%, #2A302B, #121512 70%); display: grid; place-items: center; }
.viewfinder video, .viewfinder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder .brackets { position: absolute; inset: 14% 10%; pointer-events: none; }
.brackets i { position: absolute; width: 34px; height: 34px; border: 2.5px solid rgba(255,255,255,.9); }
.brackets i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 16px; }
.brackets i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 16px; }
.brackets i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 16px; }
.brackets i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 16px; }
.vf-msg { position: relative; text-align: center; padding: 24px; max-width: 290px; }
.vf-msg h3 { font: 500 21px/1.25 var(--serif); margin-bottom: 6px; }
.vf-msg p { font-size: 13.5px; opacity: .75; }
.viewfinder.live .vf-msg { display: none; }
.scanline { position: absolute; left: 8%; right: 8%; height: 2px; top: 14%; background: linear-gradient(90deg, transparent, #CFE3D5, transparent); box-shadow: 0 0 18px 4px rgba(190,230,205,.45); animation: sweep 1.6s ease-in-out infinite alternate; }
@keyframes sweep { to { top: 86%; } }
.scan-status { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: rgba(14,16,14,.72); backdrop-filter: blur(10px); padding: 8px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.scan-ctrl { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 18px 26px calc(22px + var(--safe-b)); }
.scan-ctrl .side { display: grid; justify-items: center; gap: 4px; font-size: 11.5px; opacity: .85; color: #EEECE6; }
.scan-ctrl .side span.ico { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.1); display: grid; place-items: center; }
.shutter { width: 78px; height: 78px; border-radius: 50%; border: 4px solid #EEECE6; padding: 5px; }
.shutter i { display: block; width: 100%; height: 100%; border-radius: 50%; background: #EEECE6; transition: transform .1s; }
.shutter:active i { transform: scale(.9); }

/* ---------- Results ---------- */
.res-photo { height: 190px; border-radius: 20px; overflow: hidden; margin: 6px 0 14px; background: var(--surface-2); }
.res-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg); border-radius: 18px; padding: 12px 16px; margin-top: 12px; }
.res-sum .k b { font: 500 32px/1 var(--serif); font-variant-numeric: tabular-nums; }
.res-sum .k span { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-left: 4px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--surface); font-variant-numeric: tabular-nums; }
.pill.p { color: var(--protein); } .pill.c { color: var(--carbs); } .pill.f { color: var(--fat); }
.ri { border: 1px solid var(--line); border-radius: 18px; padding: 12px 12px 12px 14px; margin-top: 10px; }
.ri-top { display: flex; gap: 8px; align-items: center; }
.ri-name { flex: 1; font-weight: 700; font-size: 16px; border: 0; background: transparent; padding: 6px 0; outline: none; border-bottom: 1px dashed transparent; border-radius: 0; }
.ri-name:focus { border-bottom-color: var(--leaf); }
.ri-del { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.ri-meta { font-size: 12.5px; color: var(--ink-2); }
.ri-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.ri-k { font: 500 21px var(--serif); font-variant-numeric: tabular-nums; }
.ri-k small { font: 600 12px var(--sans); color: var(--ink-3); }
.ri-mac { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.ri-edit { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.ri-edit label { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.ri-edit .input { min-height: 40px; padding: 6px 10px; margin-top: 3px; }
.match { margin-top: 10px; width: 100%; text-align: left; display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 12px; background: var(--brass-soft); color: var(--ink); font-size: 12.5px; }
.match b { font-weight: 700; }
.match .ic { width: 18px; height: 18px; color: var(--brass); }
.ri-links { display: flex; gap: 14px; margin-top: 8px; }
.ri-links button { font-size: 12.5px; font-weight: 650; color: var(--leaf); padding: 4px 0; }
.conf { display: inline-flex; align-items: center; gap: 6px; }
.conf i { width: 34px; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; display: inline-block; }
.conf i b { display: block; height: 100%; background: var(--leaf); }
.note { font-size: 13px; color: var(--ink-2); background: var(--bg); border-radius: 14px; padding: 10px 12px; margin-top: 10px; }
.note.warn { background: var(--brass-soft); background: color-mix(in srgb, var(--over) 12%, transparent); color: var(--ink); }
.fix { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- Coach ---------- */
.chat { display: grid; gap: 10px; padding-bottom: 90px; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.user { justify-self: end; background: var(--leaf); color: var(--leaf-ink); border-bottom-right-radius: 6px; }
.msg.assistant { justify-self: start; background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.msg.err { background: var(--brass-soft); background: color-mix(in srgb, var(--over) 12%, var(--surface)); }
.msg p + p, .msg ul + p, .msg p + ul { margin-top: 8px; }
.msg ul, .msg ol { margin: 6px 0 0; padding-left: 20px; }
.msg li + li { margin-top: 3px; }
.msg strong { font-weight: 700; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.coach-empty { text-align: center; padding: 18px 8px 8px; }
.coach-empty .seal { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow), 0 0 0 8px var(--surface-2); color: var(--leaf); }
.coach-empty .seal .ic { width: 32px; height: 32px; }
.coach-empty h2 { font: 500 23px var(--serif); }
.coach-empty p { color: var(--ink-2); font-size: 14px; margin: 6px auto 0; max-width: 320px; }
.prompts { display: grid; gap: 8px; margin-top: 18px; text-align: left; }
.prompts button { padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; text-align: left; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 15; padding: 10px max(14px, calc((100vw - 520px) / 2 + 14px)); background: linear-gradient(transparent, var(--bg) 35%); }
.composer form { display: flex; gap: 8px; align-items: flex-end; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 6px 6px 6px 16px; border: 1px solid var(--line); }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; outline: none; font-size: 16px; padding: 9px 0; max-height: 120px; line-height: 1.4; }
.composer .send { width: 42px; height: 42px; border-radius: 50%; background: var(--leaf); color: var(--leaf-ink); display: grid; place-items: center; flex: none; }
.composer .send[disabled] { opacity: .4; }
.coach-tools { display: flex; justify-content: flex-end; margin: -6px 0 10px; }

/* ---------- Me ---------- */
.profile-card { display: flex; gap: 14px; align-items: center; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--leaf-soft); color: var(--leaf); display: grid; place-items: center; font: 500 24px var(--serif); flex: none; }
.profile-card h2 { font: 500 21px/1.2 var(--serif); }
.profile-card p { font-size: 13px; color: var(--ink-2); }
.plan-big { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 2px; }
.plan-big b { font: 500 50px/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan-big span { color: var(--ink-2); font-weight: 650; }
.split { display: flex; height: 10px; border-radius: 10px; overflow: hidden; margin: 14px 0 8px; gap: 2px; }
.split i { display: block; height: 100%; }
.split .p { background: var(--protein); } .split .c { background: var(--carbs); } .split .f { background: var(--fat); }
.legend { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.legend b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.stats { margin: 14px 0 0; display: grid; }
.stats div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.stats dt { color: var(--ink-2); }
.stats dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.stats dd small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
.bars { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 8px; height: 140px; align-items: end; margin-top: 14px; padding-bottom: 22px; }
.bars .b { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bars .b i { display: block; width: 100%; max-width: 28px; border-radius: 8px 8px 4px 4px; background: var(--leaf); min-height: 3px; transition: height .6s; }
.bars .b i.over { background: var(--over); }
.bars .b i.zero { background: var(--surface-2); }
.bars .b span { position: absolute; bottom: -20px; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.bars .goal-line { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--brass); pointer-events: none; }
.bars .goal-line em { position: absolute; right: 0; top: -18px; font-size: 11px; font-style: normal; color: var(--brass); font-weight: 700; }
.spark { width: 100%; height: 70px; display: block; margin-top: 10px; overflow: visible; }
.spark polyline { fill: none; stroke: var(--leaf); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark circle { fill: var(--leaf); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); margin-right: 6px; }
.status-dot.ok { background: var(--veg); }
.code-box { width: 100%; height: 120px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
a { color: var(--leaf); font-weight: 650; }


/* ---------- Supplements ---------- */
.supp .sp { cursor: default; gap: 12px; }
.sp-check { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; flex: none; transition: background .2s, border-color .2s, color .2s; }
.sp-check .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.sp.on .sp-check { background: var(--leaf); border-color: var(--leaf); color: var(--leaf-ink); }
.sp .it-main { cursor: pointer; }
.sp.on .it-name { color: var(--ink-2); }

/* ---------- Live scanning ---------- */
.scan-top .live-toggle { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.12); color: #EEECE6; font-size: 13px; font-weight: 700; }
.live-toggle i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); }
.live-toggle.on i { background: #7FD49A; box-shadow: 0 0 0 4px rgba(127,212,154,.2); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(127,212,154,0); } }
.live-status { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: rgba(14,16,14,.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: #EEECE6; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; z-index: 2; }
.live-panel { position: absolute; left: 10px; right: 10px; bottom: 10px; max-height: 58%; overflow-y: auto; background: rgba(18,21,19,.84); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: #EEECE6; border-radius: 20px; padding: 12px 12px 10px; z-index: 3; border: 1px solid rgba(255,255,255,.08); }
.lp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.lp-head b { display: block; font: 500 18px/1.2 var(--serif); }
.lp-head span { font-size: 12px; opacity: .7; }
.lp-chip { flex: none; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.12); color: #EEECE6; display: inline-flex; align-items: center; gap: 6px; }
.lp-chip.live i { width: 7px; height: 7px; border-radius: 50%; background: #7FD49A; }
.lp-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,.08); }
.lp-name { flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 1px dashed rgba(255,255,255,.25); color: inherit; font-size: 14.5px; font-weight: 650; padding: 6px 2px; outline: none; border-radius: 0; }
.lp-name:focus, .lp-kcal:focus { border-bottom-color: #9FD3B0; }
.lp-step { display: inline-flex; align-items: center; background: rgba(255,255,255,.1); border-radius: 999px; flex: none; }
.lp-step button { width: 30px; height: 30px; display: grid; place-items: center; color: inherit; }
.lp-step .ic { width: 15px; height: 15px; }
.lp-step span { min-width: 34px; text-align: center; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lp-kcal { width: 52px; flex: none; background: transparent; border: 0; border-bottom: 1px dashed rgba(255,255,255,.25); color: inherit; text-align: right; font: 500 16px var(--serif); padding: 4px 0; outline: none; border-radius: 0; -moz-appearance: textfield; }
.lp-kcal::-webkit-outer-spin-button, .lp-kcal::-webkit-inner-spin-button { -webkit-appearance: none; }
.lp-u { font-size: 11px; opacity: .6; flex: none; }
.lp-x { width: 28px; height: 28px; display: grid; place-items: center; color: inherit; opacity: .6; flex: none; }
.lp-x .ic { width: 15px; height: 15px; }
.lp-fix { display: flex; gap: 6px; margin-top: 8px; }
.lp-fix input { flex: 1; min-width: 0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: inherit; border-radius: 12px; padding: 9px 12px; font-size: 16px; outline: none; }
.lp-fix input::placeholder { color: rgba(238,236,230,.55); }
.lp-fix button { width: 42px; border-radius: 12px; background: rgba(255,255,255,.12); color: inherit; display: grid; place-items: center; flex: none; }
.lp-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.lp-mac { flex: 1; font-size: 12px; opacity: .75; font-variant-numeric: tabular-nums; }
.lp-more { height: 40px; padding: 0 12px; border-radius: 999px; color: inherit; background: rgba(255,255,255,.1); font-size: 13px; font-weight: 650; }
.lp-add { height: 40px; padding: 0 16px; border-radius: 999px; background: #CFE3D5; color: #102018; font-size: 14px; font-weight: 750; white-space: nowrap; }
.lp-add[disabled] { opacity: .5; }

/* ---------- Account ---------- */
.acct { margin-bottom: 12px; }
.acct h3 { font: 500 19px/1.2 var(--serif); overflow-wrap: anywhere; }
.acct p.small + .acct-btns, .acct .acct-btns { margin-top: 12px; display: grid; gap: 8px; }
.acct.signed .row { align-items: center; }
.acct #acct-status { margin-top: 2px; }
.linkbtn { color: var(--leaf); font-weight: 700; font-size: 14px; padding: 6px 2px; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12.5px; margin: 14px 0 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.have-acct { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--leaf-soft); border-radius: 14px; padding: 8px 12px; margin: 6px 0 2px; font-size: 13.5px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; top: calc(12px + var(--safe-t)); width: max-content; transform: translate(-50%, -20px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 80; max-width: calc(100vw - 40px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .view { padding-left: 14px; padding-right: 14px; }
  .katoris { gap: 6px; }
  .k-val { font-size: 15px; }
  .regions { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.btn.danger-fill { background: var(--over); color: #fff; }
.danger-link { color: var(--over); font-size: 13px; margin-top: 10px; display: inline-block; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.grid4 .qa { padding: 12px 4px 10px; font-size: 12.5px; }
.acct .status-dot:not(.ok) { background: var(--over); }

/* ---------- Food details ---------- */
.portion-now { display: grid; line-height: 1.25; }
.portion-now b { font-size: 15px; font-weight: 700; }
.portion-now span { font-size: 12.5px; color: var(--ink-2); }
.facts { display: none; background: var(--bg); border-radius: 14px; padding: 12px 14px; margin-top: 8px; }
.facts.open, .ci.open .facts { display: block; }
.fact-mac { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.fact-mac b { display: block; font: 500 15px var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.facts ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; }
.facts li { font-size: 13px; color: var(--ink); padding-left: 14px; position: relative; line-height: 1.4; }
.facts li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--brass); }
.facts .tagline { margin-top: 10px; }
.chart-meal li.ci { display: block; padding: 8px 0; cursor: pointer; }
.ci-row { display: flex; align-items: center; gap: 10px; }
.ci-name { font-size: 14.5px; font-weight: 600; display: block; }
.ci-chev { color: var(--ink-3); display: grid; transition: transform .2s; }
.ci-chev .ic { width: 16px; height: 16px; }
.ci.open .ci-chev { transform: rotate(90deg); }

/* ---------- Notices & notification settings ---------- */
.notice { position: fixed; left: 50%; top: calc(12px + var(--safe-t)); transform: translate(-50%, -24px); width: min(92vw, 420px); display: flex; gap: 12px; align-items: center; background: var(--surface); color: var(--ink); border-radius: 18px; padding: 12px 16px; box-shadow: 0 14px 34px -14px rgba(0,0,0,.45), 0 0 0 1px var(--line); opacity: 0; transition: opacity .3s, transform .3s; z-index: 90; pointer-events: none; }
.notice.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.notice .n-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--leaf); color: var(--leaf-ink); flex: none; }
.notice.warn .n-ic { background: var(--brass); color: #fff; }
.notice .n-ic .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.notice b { display: block; font-size: 14.5px; }
.notice .n-tx span { display: block; font-size: 12.5px; color: var(--ink-2); }
.nt-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.nt-row:first-child { border-top: 0; padding-top: 0; }
.nt-row b { display: block; font-size: 14.5px; }
.nt-row span { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.nt-time { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 12px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.nt-time .input { width: 140px; min-height: 40px; }
.switch { width: 50px; height: 30px; border-radius: 999px; background: var(--surface-2); position: relative; flex: none; transition: background .2s; border: 1px solid var(--line); }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch.on { background: var(--leaf); border-color: var(--leaf); }
.switch.on i { transform: translateX(20px); }

/* ---------- Describe your food ---------- */
.describe-bar { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; padding: 6px 6px 6px 14px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); border: 1px solid transparent; transition: border-color .2s; }
.describe-bar:focus-within { border-color: color-mix(in srgb, var(--leaf) 45%, transparent); }
.describe-bar .db-ic { color: var(--leaf); display: grid; place-items: center; }
.describe-bar .db-ic .ic { width: 20px; height: 20px; }
.describe-bar input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); padding: 10px 0; outline: none; }
.describe-bar input::placeholder { color: var(--ink-3); }
.describe-bar .db-go { width: 40px; height: 40px; border-radius: 13px; border: 0; background: var(--leaf); color: var(--leaf-ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.describe-bar .db-go .ic { width: 18px; height: 18px; }
.desc-chips { margin-top: 10px; }
.desc-chips .chip { font-size: 13px; padding: 6px 11px; }
.desc-tip { margin-top: 10px; line-height: 1.45; }
.keep-row { margin-top: 14px; gap: 10px; align-items: center; font-size: 14px; }
.keep-row input { width: 20px; height: 20px; accent-color: var(--leaf); flex: none; }

/* ---------- People ---------- */
.tabbar button { position: relative; }
.tabbar button.dot::after { content: ''; position: absolute; top: 7px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--over); box-shadow: 0 0 0 2px var(--surface); }
.section-h .linkbtn { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; }
.section-h .linkbtn .ic { width: 16px; height: 16px; }
.people .pp-h { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: 14px 0 4px; }
.people .pp-h:first-child { margin-top: 0; }
.pp-list { list-style: none; margin: 0; padding: 0; }
.pp-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pp-list .pp-row:first-child { border-top: 0; }
.pp-row.tap { cursor: pointer; }
.pp-row b { font-size: 15px; margin-right: 6px; }
.pp-row .tag.sm { font-size: 10.5px; padding: 2px 7px; vertical-align: 2px; }
.pp-row p { margin-top: 2px; }
.pp-chev { color: var(--ink-3); display: grid; }
.pp-chev .ic { width: 18px; height: 18px; }
.pp-av { width: 40px; height: 40px; border-radius: 50%; background: var(--leaf-soft); color: var(--leaf); display: grid; place-items: center; font: 600 17px/1 var(--serif); flex: none; }
.pp-req { display: flex; gap: 12px; padding: 12px; margin-bottom: 10px; border-radius: 16px; background: color-mix(in srgb, var(--leaf-soft) 60%, var(--surface)); }
.pp-req p { margin-top: 4px; line-height: 1.4; }
.pp-empty { display: flex; gap: 12px; align-items: flex-start; }
.pp-empty p { margin-top: 3px; line-height: 1.45; }
.pp-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--leaf-soft); color: var(--leaf); display: grid; place-items: center; flex: none; }
.pp-ic .ic { width: 22px; height: 22px; }
.pp-day { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; text-align: center; }
.pp-day b { display: block; font-size: 16px; }
.pp-day span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.pp-day .x[disabled] { opacity: .3; }
.thali-wrap.sm .thali { transform: scale(.82); margin: -18px auto -22px; }
.pp-water { display: flex; align-items: center; gap: 12px; margin: 16px 0 12px; }
.pp-water > .ic { width: 22px; height: 22px; color: var(--protein); flex: none; }
.pp-water .bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.pp-water .bar i { display: block; height: 100%; background: var(--protein); border-radius: 6px; }
.meal.card.ro { margin-top: 10px; }
.meal.card.ro .items li { cursor: default; }
.pp-none { margin: 16px 0 4px; padding: 18px; text-align: center; color: var(--ink-2); background: var(--surface-2); border-radius: 16px; font-size: 14px; }
.bars .b[data-act] { cursor: pointer; }
.bars .b.sel span { color: var(--leaf); }
.bars .b.sel i { outline: 2px solid color-mix(in srgb, var(--leaf) 40%, transparent); outline-offset: 2px; }

/* ---------- Food memory ---------- */
.remembered { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 650; color: var(--leaf); }
.remembered .ic { width: 15px; height: 15px; }
.keep-row span { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.keep-row small { color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.msg .msg-retry { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 7px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.msg .msg-retry .ic { width: 15px; height: 15px; }

/* ---------- Repeat meals & combos ---------- */
.meal-f { display: flex; justify-content: flex-end; padding-top: 8px; border-top: 1px solid var(--line); }
.meal-f .linkbtn { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); }
.meal-f .linkbtn .ic { width: 15px; height: 15px; }
.repeat { display: grid; gap: 8px; margin-top: 10px; }
.rp-chip { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--leaf) 45%, var(--line)); background: color-mix(in srgb, var(--leaf-soft) 45%, transparent); color: var(--ink); font: inherit; cursor: pointer; }
.rp-chip > .ic { width: 18px; height: 18px; color: var(--leaf); flex: none; }
.rp-chip span { display: grid; font-size: 12.5px; color: var(--ink-2); }
.rp-chip b { font-size: 14px; color: var(--ink); font-weight: 650; }
.combos .combo-row { cursor: default; }
.combo-row > button.grow { all: unset; flex: 1; display: grid; gap: 1px; cursor: pointer; min-width: 0; }
.combo-row > button.grow b { font-weight: 650; font-size: 14.5px; }
.combo-row > button.grow span { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-row .k { font: 500 17px var(--serif); white-space: nowrap; text-align: right; }
.combo-row .k small { display: block; font: 600 11px var(--sans); color: var(--ink-3); }
.combo-row .cb-x { border: 0; background: transparent; color: var(--ink-3); font: 600 12px var(--sans); padding: 6px; cursor: pointer; min-width: 30px; }
.combo-row .cb-x .ic { width: 16px; height: 16px; }
.combo-items { list-style: none; margin: 12px 0 8px; padding: 0; }
.combo-items li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.combo-items small { display: block; color: var(--ink-3); font-size: 12px; }

/* ---------- Coach notes ---------- */
.notes { display: grid; gap: 10px; margin: 16px 0 4px; }
.note-card { display: flex; gap: 12px; padding: 14px; border-radius: 18px; background: color-mix(in srgb, var(--leaf-soft) 70%, var(--surface)); box-shadow: var(--shadow); }
.note-card.read { background: var(--surface); box-shadow: none; border: 1px solid var(--line); opacity: .85; }
.note-card .nc-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 13px; }
.note-card .nc-h b { font-size: 14px; }
.note-card .nc-h span { color: var(--ink-3); font-size: 12px; }
.note-card .nc-t { margin-top: 4px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-card .btn { margin-top: 10px; }
.note-card .btn .ic { width: 15px; height: 15px; }
.pp-notes .pn { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pp-notes .pn p { font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.pp-notes .pn span { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.pp-notes .pn span .ic { width: 13px; height: 13px; color: var(--leaf); }
.pp-notes .pn .linkbtn { font-size: 12px; color: var(--ink-3); }
.pn-form { display: flex; gap: 8px; align-items: flex-end; margin: 12px 0 8px; }
.pn-form textarea { flex: 1; min-height: 44px; resize: none; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14.5px; }

/* ---------- Weekly report ---------- */
.report-card { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; padding: 14px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--leaf) 30%, transparent); }
.report-card .rc-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--leaf-soft); color: var(--leaf); display: grid; place-items: center; flex: none; }
.report-card .rc-ic .ic { width: 21px; height: 21px; }
.report-card .grow { cursor: pointer; min-width: 0; }
.report-card b { display: block; font-size: 15px; }
.report-card span { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.report-card .rc-x { border: 0; background: transparent; color: var(--ink-3); padding: 4px; cursor: pointer; display: grid; }
.report-card .rc-x .ic { width: 16px; height: 16px; }
.wk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 12px; }
.wk-stats > div { background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.wk-stats b { display: block; font: 500 24px/1.1 var(--serif); }
.wk-stats b small { font: 600 12px var(--sans); color: var(--ink-3); }
.wk-stats span { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.3; }
.wk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.wk-grid .card { padding: 12px 14px; margin: 0; }
.wk-grid span { display: block; font-size: 12px; color: var(--ink-2); }
.wk-grid b { display: block; font: 500 20px/1.2 var(--serif); margin-top: 2px; }
.wk-grid small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.wk-best { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; }
.wk-best .ic { width: 16px; height: 16px; color: var(--leaf); }
.wk-list { margin: 4px 0 0; padding-left: 20px; }
.wk-list li { font-size: 14.5px; line-height: 1.45; margin-top: 6px; }
.wk-list.good li::marker { color: var(--leaf); }
.pdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--protein); margin-left: 3px; vertical-align: middle; }
.bars .b.fut i { opacity: .35; }
.section-h .linkbtn .ic { width: 15px; height: 15px; }

/* ---------- Barcode ---------- */
.grid6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.scan-modes { display: flex; justify-content: center; gap: 4px; margin: 0 auto 10px; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.1); }
.scan-modes button { border: 0; background: transparent; color: rgba(238,236,230,.75); font: 650 13px var(--sans); padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.scan-modes button.on { background: #EEECE6; color: #121512; }
.viewfinder.bc .bc-guide { position: absolute; left: 10%; right: 10%; top: 34%; height: 26%; border: 2.5px solid rgba(255,255,255,.9); border-radius: 18px; pointer-events: none; box-shadow: 0 0 0 999px rgba(0,0,0,.28); }
.viewfinder.bc .bc-guide i { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #E06A52; box-shadow: 0 0 10px #E06A52; animation: bcline 1.6s ease-in-out infinite alternate; }
@keyframes bcline { from { transform: translateY(-38px); } to { transform: translateY(38px); } }
.live-status.warn { white-space: normal; text-align: center; border-radius: 16px; width: 86%; line-height: 1.4; }
.bc-panel { position: absolute; left: 10px; right: 10px; bottom: 10px; background: rgba(18,21,19,.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: #EEECE6; border-radius: 20px; padding: 14px; z-index: 3; border: 1px solid rgba(255,255,255,.08); }
.bc-panel p b { display: block; font-size: 15px; }
.bc-panel p span { display: block; font-size: 13px; opacity: .8; margin: 4px 0 12px; line-height: 1.4; }
.bc-panel .btn.ghost { color: #EEECE6; border-color: rgba(255,255,255,.25); }
.bc-manual { display: flex; gap: 8px; margin: 12px 12px 0; }
.bc-manual .input { flex: 1; background: rgba(255,255,255,.08); color: #EEECE6; border-color: rgba(255,255,255,.14); letter-spacing: .04em; }
.bc-manual .input::placeholder { color: rgba(238,236,230,.55); letter-spacing: 0; }
.bc-alt { text-align: center; padding: 12px 12px calc(14px + var(--safe-b, 0px)); }
.bc-alt .linkbtn { color: rgba(238,236,230,.85); display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.bc-alt .linkbtn .ic { width: 16px; height: 16px; }

/* ---------- Recipe builder ---------- */
.recipe-cta { background: var(--surface); color: var(--ink); grid-template-columns: minmax(0,1fr) auto; align-items: center; }
.recipe-cta h3 { font-size: 18px; }
.recipe-cta p { color: var(--ink-2); opacity: 1; }
.recipe-cta .btn { background: var(--surface-2); color: var(--ink); justify-self: end; }
.rc-list { list-style: none; margin: 0 0 10px; padding: 0; }
.rc-row { display: grid; grid-template-columns: minmax(0,1fr) 72px 92px 30px; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rc-row:first-child { padding-top: 2px; }
.rc-n { min-width: 0; display: grid; gap: 1px; }
.rc-n b { font-weight: 650; font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rc-n span { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rc-row .input { min-height: 40px; padding: 8px 10px; font-size: 15px; }
.rc-row .rc-amt { text-align: right; font-variant-numeric: tabular-nums; }
.rc-row .select { padding-right: 28px; background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; }
.rc-x { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.rc-x .ic { width: 16px; height: 16px; }
.rc-x:active { background: var(--surface-2); }
.rc-search .input { background: var(--bg); box-shadow: none; border-color: var(--line); }
.rc-picks { list-style: none; margin: 6px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); }
.rc-pick { width: 100%; display: flex; align-items: center; gap: 10px; justify-content: space-between; text-align: left; padding: 9px 10px; border-radius: 10px; }
.rc-pick:active { background: var(--surface-2); }
.rc-pick span { display: grid; gap: 1px; min-width: 0; }
.rc-pick b { font-weight: 650; font-size: 14px; }
.rc-pick small { font-size: 12px; color: var(--ink-2); }
.rc-pick i { color: var(--leaf); display: grid; place-items: center; flex: none; }
.rc-pick i .ic { width: 18px; height: 18px; }
.rc-none, .rc-empty { margin: 8px 2px 0; }
.rc-grid .stepper span { min-width: 34px; }
.rc-sum { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 10px; margin-top: 14px; }
.rc-sum > div { background: var(--bg); border-radius: 18px; padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.rc-sum span { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.rc-sum b { font: 500 26px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.rc-sum b small { font: 600 12px var(--sans); color: var(--ink-2); }
.rc-sum .rc-all b { font-size: 19px; }
.rc-sum em { font-style: normal; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rc-sum .pills { justify-content: flex-start; margin: 2px 0; }
.rc-sum .pill { background: var(--surface); }
.rc-foot { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: 8px; }
.rc-foot .btn { padding: 0 12px; }
.rc-ings { font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.rc-ings small { color: var(--ink-3); font-size: 12px; }
.myf-acts { margin-top: 16px; justify-content: space-between; }
.myf-del { color: var(--ink-3); font-weight: 600; font-size: 13px; }
.myf-del.armed { color: var(--over); }
@media (max-width: 360px) { .rc-row { grid-template-columns: minmax(0,1fr) 62px 80px 26px; gap: 6px; } .rc-foot { grid-template-columns: 1fr; } }
