:root{--bg:#F7F8F4;--surface:#fff;--primary:#557A65;--soft:#DCE8DD;--accent:#B8CBB7;--text:#26332C;--muted:#78847D}
*{box-sizing:border-box}
body{margin:0 auto;max-width:560px;padding:12px 14px 90px;background:var(--bg);color:var(--text);font:16px/1.4 system-ui,sans-serif}
header{display:flex;gap:8px;align-items:center}header strong{margin-right:auto;color:var(--primary)}header select{width:auto;max-width:45%}
h1{font-size:1.4rem;margin:12px 0}h2{font-size:1.1rem;margin:0}h3{font-size:.95rem;margin:12px 0 4px}
section,form{background:var(--surface);border-radius:14px;padding:14px;margin:0 0 12px;display:flex;flex-direction:column;gap:10px}
label{display:flex;flex-direction:column;gap:4px;font-size:.9rem}
input,select,button{font:inherit;min-height:44px;border-radius:10px;border:1px solid var(--accent);padding:8px 10px;background:var(--surface);color:var(--text);width:100%}
button{background:var(--primary);color:#fff;border:0}button.ghost{background:var(--soft);color:var(--text);width:44px;padding:0;margin-left:4px}
small,.muted{color:var(--muted);display:block}
.line,.entry{display:flex;justify-content:space-between;align-items:center;gap:8px}.entry span{white-space:nowrap}.entry form{flex-direction:row;padding:0;margin:0;width:150px}
.bar{height:8px;background:var(--soft);border-radius:9px;overflow:hidden;margin:4px 0}.bar i{display:block;height:100%}
.kcal i{background:#9CA3AF}.protein i{background:#4CAF78}.fat i{background:#EAB94F}.carbs i{background:#5799E5}.fiber i{background:#9B72CF}
nav{position:fixed;bottom:0;left:0;right:0;display:flex;gap:6px;padding:8px 8px calc(8px + env(safe-area-inset-bottom));background:var(--surface);max-width:560px;margin:auto}
nav button{background:transparent;color:var(--muted);font-size:.85rem}nav button[aria-current]{background:var(--soft);color:var(--text)}
#notice:empty{display:none}

/* v3: вигляд за UI_PROTOTYPE.html */
header strong{line-height:1.1}header strong small{font-weight:400;font-size:.7rem}
section{border:1px solid #e1e7df;border-radius:18px}form{border:1px solid #e1e7df;border-radius:18px}
.hero{align-items:center}
.ring{width:180px;height:180px;border-radius:50%;background:conic-gradient(var(--primary) calc(var(--p)*1%),var(--soft) 0);display:grid;place-items:center}
.ring>div{width:148px;height:148px;border-radius:50%;background:var(--surface);display:grid;place-content:center;text-align:center}.ring b{font-size:2rem}
.actions{display:flex;gap:8px;width:100%}button.soft{background:var(--soft);color:var(--text)}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
button.tile{background:var(--surface);color:var(--text);border:1px solid #e1e7df;border-radius:18px;min-height:104px;text-align:left;display:flex;flex-direction:column;gap:4px;padding:14px}
.tile span{font-size:1.6rem;color:var(--primary)}.tile em{font-size:.72rem;color:var(--muted);font-style:normal}
.soon{text-align:center;align-items:center;padding:32px 18px}.soon span{font-size:3rem;color:var(--primary)}
nav{border-top:1px solid var(--soft)}nav button{display:flex;flex-direction:column;align-items:center;font-size:.7rem;padding:6px 2px}nav button span{font-size:1.25rem}
aside{display:none}
@media(min-width:900px){body{max-width:760px;margin-left:calc(235px + max(20px,(100vw - 995px)/2));padding-bottom:30px}
aside{display:block;position:fixed;inset:0 auto 0 0;width:235px;background:var(--surface);padding:20px;overflow:auto}
aside button{background:transparent;color:var(--text);text-align:left;margin:2px 0;min-height:38px}aside button[aria-current]{background:var(--soft)}
nav{display:none}.grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* v4: меню, рецепти, покупки */
.slot{display:flex;flex-direction:column;gap:6px;padding-bottom:10px;border-bottom:1px solid #e1e7df}.slot:last-child{border:0}
button.link{background:none;color:var(--text);text-align:left;padding:0}
.chips{display:flex;flex-wrap:wrap;gap:4px}.chip{font-style:normal;font-size:.75rem;padding:2px 7px;border-radius:9px;border-left:4px solid #9CA3AF;background:var(--bg)}
.chip.protein{border-color:#4CAF78}.chip.fat{border-color:#EAB94F}.chip.carbs{border-color:#5799E5}.chip.fiber{border-color:#9B72CF}
.options{display:flex;flex-direction:column;gap:6px}
label.check{flex-direction:row;align-items:center;gap:10px;min-height:44px}label.check input{width:22px;min-height:22px;flex:none}
fieldset{border:1px solid var(--accent);border-radius:10px;min-width:0}summary{min-height:44px;cursor:pointer;font-weight:600}
.pair{display:flex;gap:8px}.pair input{min-width:0}.buy.done b{text-decoration:line-through;color:var(--muted)}
.warn{background:#fdf3dc;border-radius:12px;padding:10px}.total{font-size:.85rem;margin:0}.day{margin:14px 0 6px;text-transform:capitalize}
ul,ol{margin:0;padding-left:20px}button:disabled{opacity:.5}
body{padding-bottom:calc(90px + env(safe-area-inset-bottom));padding-top:calc(12px + env(safe-area-inset-top))}
#scan video{width:100%;max-height:320px;border-radius:12px;object-fit:cover}video[hidden]{display:none}
