@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:200 800;src:url(/fonts/manrope-cyrillic-wght-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Manrope';font-style:normal;font-display:swap;font-weight:200 800;src:url(/fonts/manrope-latin-wght-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Nunito';font-style:normal;font-display:swap;font-weight:200 1000;src:url(/fonts/nunito-cyrillic-wght-normal.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Nunito';font-style:normal;font-display:swap;font-weight:200 1000;src:url(/fonts/nunito-latin-wght-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root{
  --bg:#F7F3EA; --bg2:#EEF0E2; --card:#FFFDF8; --card2:#F3F4EA; --line:#E0E3D2;
  --ink:#26301F; --muted:#6C7560; --soft:#8F987F;
  --accent:#6B8A4E; --accent-ink:#4E6B36; --on-accent:#FFFFFF;
  --hill1:#3F5530; --hill2:#7F9C66; --hill3:#AFC49A;
  --peach:#F2C6A6; --sun:#F4C862; --rose:#EFD3C4;
  --good:#5E8C4A; --warn:#C98A1E; --bad:#C0543B;
  --good-bg:#E6EFDC; --warn-bg:#FBEFD2; --bad-bg:#F8E0D8;
  --night:#26301F; --night-ink:#F7F3EA; --night-muted:#B9C2A8; --night-line:rgba(247,243,234,.14);
  --shadow:0 16px 40px rgba(52,70,30,.08); --shadow-strong:0 16px 40px rgba(38,48,31,.18);
  --hdr:rgba(238,240,226,.92);
  --fh:'Nunito',system-ui,sans-serif; --fb:'Manrope',system-ui,sans-serif;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --bg:#141A11; --bg2:#1A2116; --card:#1E261A; --card2:#252F20; --line:#33402C;
    --ink:#EEF0E2; --muted:#AEB8A0; --soft:#8D9780;
    --accent:#A7C48A; --accent-ink:#B9D39E; --on-accent:#18200F;
    --hill1:#C3D8AE; --hill2:#8FAE74; --hill3:#5E7A48;
    --peach:#E3AE8A; --sun:#E9BD55; --rose:#4A3A30;
    --good:#93C27A; --warn:#E3B04E; --bad:#E7866C;
    --good-bg:#26351E; --warn-bg:#3A3019; --bad-bg:#3E251E;
    --night:#0E130C; --night-ink:#EEF0E2; --night-muted:#A9B39C; --night-line:rgba(238,240,226,.12);
    --shadow:0 16px 40px rgba(0,0,0,.25); --shadow-strong:0 16px 40px rgba(0,0,0,.4);
    --hdr:rgba(20,26,17,.9);
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#141A11; --bg2:#1A2116; --card:#1E261A; --card2:#252F20; --line:#33402C;
  --ink:#EEF0E2; --muted:#AEB8A0; --soft:#8D9780;
  --accent:#A7C48A; --accent-ink:#B9D39E; --on-accent:#18200F;
  --hill1:#C3D8AE; --hill2:#8FAE74; --hill3:#5E7A48;
  --peach:#E3AE8A; --sun:#E9BD55; --rose:#4A3A30;
  --good:#93C27A; --warn:#E3B04E; --bad:#E7866C;
  --good-bg:#26351E; --warn-bg:#3A3019; --bad-bg:#3E251E;
  --night:#0E130C; --night-ink:#EEF0E2; --night-muted:#A9B39C; --night-line:rgba(238,240,226,.12);
  --shadow:0 16px 40px rgba(0,0,0,.25); --shadow-strong:0 16px 40px rgba(0,0,0,.4);
  --hdr:rgba(20,26,17,.9);
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{background:var(--bg);color:var(--ink);font-family:var(--fb);font-size:15px;line-height:1.5;-webkit-font-smoothing:antialiased}
h1,h2,h3,h4{font-family:var(--fh);margin:0;line-height:1.15;text-wrap:balance;letter-spacing:-.01em}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.num{font-variant-numeric:tabular-nums}
svg.i{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
svg.i.sm{width:18px;height:18px}

/* header */
.hdr{position:sticky;top:env(safe-area-inset-top,0px);z-index:30;background:var(--hdr);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border-bottom:1px solid var(--line)}
.hdr-in{max-width:1180px;margin:0 auto;height:68px;padding:0 20px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.logo{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink)}
.logo b{font-family:var(--fh);font-weight:900;font-size:23px;letter-spacing:-.01em}
.logo small{display:block;font-size:11px;font-weight:600;color:var(--muted);letter-spacing:.06em;text-transform:uppercase;margin-top:-3px}
.topnav{display:flex;gap:4px;font-weight:600;font-size:15px}
.topnav button{border:none;background:none;padding:10px 16px;border-radius:999px;color:var(--ink)}
.topnav button[aria-current="page"]{background:var(--card);box-shadow:var(--shadow)}
.topnav button:hover{color:var(--accent-ink)}

/* layout */
main{max-width:1180px;margin:0 auto;padding:24px 20px 120px}
.pagehead{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:20px}
.eyebrow{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-ink)}
.pagehead h1{font-size:clamp(28px,4vw,40px);font-weight:900;margin-top:4px}
.grid2{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:20px;align-items:start}
.col{display:grid;gap:20px}
.card{background:var(--card);border-radius:26px;padding:22px;box-shadow:var(--shadow)}
.card h2{font-size:20px;font-weight:800}
.card-h{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.card-h .t{display:flex;align-items:center;gap:10px}
.ico{width:40px;height:40px;border-radius:14px;display:grid;place-items:center;background:var(--bg2);color:var(--accent-ink);flex:none}
.muted{color:var(--muted)}
.small{font-size:13px}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:44px;padding:0 20px;border-radius:999px;border:none;font-weight:700;font-size:15px;background:var(--ink);color:var(--bg);text-decoration:none;white-space:nowrap}
.btn:hover{filter:brightness(1.12)}
.btn.acc{background:var(--accent);color:var(--on-accent)}
.btn.ghost{background:var(--bg2);color:var(--ink)}
.btn.line{background:transparent;border:1.5px solid var(--line);color:var(--ink)}
.btn.sm{height:36px;padding:0 14px;font-size:14px}
.btn:disabled{opacity:.5;cursor:default;filter:none}
.iconbtn{width:40px;height:40px;border-radius:999px;border:none;background:var(--bg2);color:var(--ink);display:grid;place-items:center}
.iconbtn.sm{width:32px;height:32px}
.iconbtn:hover{color:var(--accent-ink)}
.chip{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 14px;border-radius:999px;border:1.5px solid var(--line);background:var(--card);font-weight:600;font-size:14px}
.chip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--bg)}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.pill{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:700;background:var(--bg2);color:var(--muted);white-space:nowrap}
.pill.good{background:var(--good-bg);color:var(--good)}
.pill.warn{background:var(--warn-bg);color:var(--warn)}
.pill.bad{background:var(--bad-bg);color:var(--bad)}
.pill.ai{background:var(--rose);color:var(--ink)}

/* banner */
.banner{display:flex;align-items:center;gap:14px;flex-wrap:wrap;justify-content:space-between;background:var(--rose);border-radius:22px;padding:14px 18px;margin-bottom:20px}
.banner p{margin:0;font-weight:600}

/* date nav */
.datenav{display:flex;align-items:center;gap:8px}
.datenav span{font-weight:700;min-width:170px;text-align:center}

/* hero (night) */
.hero{background:var(--night);color:var(--night-ink);position:relative;overflow:hidden}
.hero .muted{color:var(--night-muted)}
.hero-top{display:flex;align-items:center;gap:22px}
.ring{position:relative;width:148px;height:148px;flex:none}
.ring svg{width:148px;height:148px;transform:rotate(-90deg)}
.ring .c{position:absolute;inset:0;display:grid;place-content:center;text-align:center}
.ring .c b{font-family:var(--fh);font-size:32px;font-weight:900;line-height:1}
.ring .c span{font-size:12px;color:var(--night-muted)}
.stats{display:grid;gap:10px;flex:1;min-width:0}
.stat{display:flex;justify-content:space-between;gap:10px;border-bottom:1px solid var(--night-line);padding-bottom:8px}
.stat:last-child{border:none;padding:0}
.stat b{font-family:var(--fh);font-size:18px}
.macros{display:grid;gap:12px;margin-top:20px}
.macro .row{display:flex;justify-content:space-between;font-size:14px;margin-bottom:6px}
.bar{height:8px;border-radius:999px;background:var(--night-line);overflow:hidden}
.bar i{display:block;height:100%;border-radius:999px}
.hero-deco{position:absolute;right:-50px;bottom:-60px;width:140px;height:140px;border-radius:50%;background:var(--sun);opacity:.14;pointer-events:none}

/* water */
.glasses{display:flex;flex-wrap:wrap;gap:6px}
.glass{width:30px;height:38px;border-radius:8px 8px 12px 12px;border:1.5px solid var(--line);background:var(--card2);padding:0;position:relative;overflow:hidden}
.glass.on{border-color:var(--hill2)}
.glass.on::after{content:"";position:absolute;left:0;right:0;bottom:0;height:72%;background:var(--hill3);opacity:.8}

/* rows */
.rows{display:grid}
.item{display:flex;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--line)}
.item:first-child{border-top:none}
.item .nm{flex:1;min-width:0}
.item .nm b{font-weight:600;display:block;overflow-wrap:anywhere}
.item .nm span{font-size:13px;color:var(--muted)}
.item .kc{font-weight:700;white-space:nowrap}
.empty{padding:12px 16px;border-radius:16px;background:var(--card2);color:var(--muted);font-size:14px}
.meal-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.progress{height:6px;border-radius:999px;background:var(--bg2);overflow:hidden;margin-top:4px}
.progress i{display:block;height:100%;background:var(--accent);border-radius:999px}

/* bottom tabbar */
.tabbar{display:none;position:fixed;left:0;right:0;bottom:0;z-index:40;background:var(--hdr);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-top:1px solid var(--line);padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px))}
.tabbar-in{display:grid;grid-template-columns:repeat(5,1fr);max-width:520px;margin:0 auto;align-items:end}
.tab{border:none;background:none;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:11px;font-weight:700;color:var(--muted);padding:6px 0}
.tab[aria-current="page"]{color:var(--accent-ink)}
.tab.cam{position:relative}
.tab.cam span.b{width:56px;height:56px;border-radius:999px;background:var(--ink);color:var(--bg);display:grid;place-items:center;margin-top:-26px;box-shadow:var(--shadow-strong)}

/* forms */
label.f{display:grid;gap:6px;font-size:13px;font-weight:600;color:var(--muted)}
.inp,select.inp,textarea.inp{width:100%;height:46px;border-radius:14px;border:1.5px solid var(--line);background:var(--card);padding:0 14px;font-size:16px;color:var(--ink)}
textarea.inp{height:auto;min-height:84px;padding:12px 14px;resize:vertical}
.inp:focus{border-color:var(--accent);outline:none}
.frow{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px}
.seg{display:flex;background:var(--bg2);border-radius:999px;padding:4px;gap:4px}
.seg button{flex:1;border:none;background:none;height:38px;border-radius:999px;font-weight:700;font-size:14px;color:var(--muted)}
.seg button[aria-pressed="true"]{background:var(--card);color:var(--ink);box-shadow:var(--shadow)}

/* sheet */
.sheet-wrap{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-end;justify-content:center}
.scrim{position:absolute;inset:0;background:rgba(20,26,15,.45)}
.sheet{position:relative;width:100%;max-width:560px;max-height:92vh;overflow:auto;background:var(--bg);border-radius:28px 28px 0 0;padding:20px 20px calc(24px + env(safe-area-inset-bottom,0px));box-shadow:var(--shadow-strong)}
@media (min-width:760px){.sheet-wrap{align-items:center}.sheet{border-radius:28px;max-height:86vh}}
.sheet-h{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
.sheet-h h3{font-size:22px;font-weight:900}
.results{display:grid;gap:6px;max-height:300px;overflow:auto;margin-top:12px}
.res{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 14px;border-radius:16px;border:none;background:var(--card);text-align:left;width:100%}
.res:hover,.res[aria-pressed="true"]{background:var(--bg2)}
.res small{color:var(--muted);white-space:nowrap}
.kbju{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:12px 0}
.kbju div{background:var(--card);border-radius:16px;padding:10px;text-align:center}
.kbju b{display:block;font-family:var(--fh);font-size:18px}
.kbju span{font-size:12px;color:var(--muted)}
.drop{display:grid;place-items:center;gap:8px;text-align:center;padding:28px 16px;border:2px dashed var(--line);border-radius:22px;background:var(--card);color:var(--muted);cursor:pointer}
.drop:hover{border-color:var(--accent)}
.photo-prev{width:100%;max-height:260px;object-fit:cover;border-radius:22px;display:block}
.status{display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:16px;background:var(--bg2);font-weight:600;margin-top:12px}
.spin{width:18px;height:18px;border-radius:50%;border:2.5px solid var(--line);border-top-color:var(--accent);animation:sp 0.9s linear infinite;flex:none}
@keyframes sp{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spin{animation-duration:3s}}
.err{background:var(--bad-bg);color:var(--bad)}

/* plan */
.days{display:flex;gap:6px;overflow-x:auto;padding-bottom:4px}
.day{flex:none;border:none;border-radius:18px;padding:10px 14px;background:var(--card);font-weight:700;display:grid;justify-items:center;gap:2px;min-width:56px}
.day small{font-weight:600;font-size:11px;color:var(--muted)}
.day[aria-pressed="true"]{background:var(--ink);color:var(--bg)}
.day[aria-pressed="true"] small{color:var(--bg);opacity:.7}
.plan-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.recipe li{display:flex;justify-content:space-between;gap:10px;padding:6px 0;border-top:1px dashed var(--line);font-size:14px}
.recipe li:first-child{border:none}
.recipe ul{list-style:none;margin:10px 0 0;padding:0}
.totals{display:flex;gap:10px;flex-wrap:wrap;font-size:13px;color:var(--muted);margin-top:10px}
.totals b{color:var(--ink)}

/* blood */
.mk{display:grid;grid-template-columns:minmax(0,1.4fr) 120px minmax(0,1fr);gap:12px;align-items:center;padding:10px 0;border-top:1px solid var(--line)}
.mk:first-of-type{border-top:none}
.mk .nm b{display:block;font-weight:600}
.mk .nm span{font-size:12px;color:var(--muted)}
.mk .inp{height:40px;font-size:15px}
.mk .note{grid-column:1/-1;font-size:13px;color:var(--muted);margin-top:-4px}
.grp{font-family:var(--fh);font-weight:800;font-size:15px;margin:18px 0 4px;color:var(--accent-ink)}
.grp:first-child{margin-top:0}
.summary{display:flex;gap:10px;flex-wrap:wrap}
.summary div{flex:1;min-width:90px;border-radius:18px;padding:12px 14px;background:var(--card2)}
.summary b{display:block;font-family:var(--fh);font-size:26px}
.ai-out{font-size:15px;line-height:1.6}
.ai-out h4{font-size:17px;margin:16px 0 6px}
.ai-out h4:first-child{margin-top:0}
.ai-out ul{margin:6px 0;padding-left:20px}
.ai-out p{margin:6px 0}
.disc{font-size:13px;color:var(--muted);border-left:3px solid var(--sun);padding:8px 0 8px 12px;margin-top:14px}

/* profile */
.bmi-scale{position:relative;height:12px;border-radius:999px;background:linear-gradient(90deg,var(--hill3) 0 18%,var(--good) 18% 50%,var(--sun) 50% 75%,var(--peach) 75% 100%);margin:18px 0 6px}
.bmi-scale i{position:absolute;top:-6px;width:4px;height:24px;border-radius:4px;background:var(--ink);transform:translateX(-2px)}
.bmi-lbl{display:flex;justify-content:space-between;font-size:11px;color:var(--muted)}
.kv{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.kv div{background:var(--card2);border-radius:18px;padding:12px 14px}
.kv span{font-size:12px;color:var(--muted);display:block}
.kv b{font-family:var(--fh);font-size:22px}
.tips{display:grid;gap:10px;margin:0;padding:0;list-style:none}
.tips li{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;background:var(--card2);border-radius:18px;font-size:14px}
.spark{width:100%;height:90px;display:block}

/* quiz */
.quiz{position:fixed;inset:0;z-index:70;background:var(--bg);overflow:auto}
.quiz-in{max-width:560px;margin:0 auto;padding:calc(20px + env(safe-area-inset-top,0px)) 20px calc(32px + env(safe-area-inset-bottom,0px));min-height:100%;display:flex;flex-direction:column;gap:20px}
.steps{display:flex;gap:4px}
.steps i{flex:1;height:5px;border-radius:999px;background:var(--line)}
.steps i.on{background:var(--accent)}
.quiz h2{font-size:30px;font-weight:900}
.opt{display:flex;align-items:flex-start;gap:12px;width:100%;text-align:left;padding:14px 16px;border-radius:20px;border:1.5px solid var(--line);background:var(--card)}
.opt[aria-pressed="true"]{border-color:var(--accent);background:var(--bg2)}
.opt b{display:block}
.opt span{font-size:13px;color:var(--muted)}
.quiz-foot{margin-top:auto;display:flex;gap:10px}
.quiz-foot .btn{flex:1;height:52px}

@media (max-width:1000px){.grid2{grid-template-columns:minmax(0,1fr)}.plan-grid{grid-template-columns:minmax(0,1fr)}}
@media (max-width:759px){
  .topnav,.hdr .desk{display:none}
  .tabbar{display:block}
  main{padding:16px 16px 120px}
  .hdr-in{height:60px;padding:0 16px}
  .card{padding:18px;border-radius:24px}
  .hero-top{flex-direction:column;align-items:stretch}
  .ring{margin:0 auto}
  .datenav span{min-width:0;font-size:14px}
  .mk{grid-template-columns:minmax(0,1fr) 104px}
  .mk .st{grid-column:1/-1}
  .kbju b{font-size:16px}
}

/* ---- web app additions ---- */
html,body{margin:0}
body{min-height:100vh}
a{color:var(--accent-ink)}
.sync{font-size:12px;font-weight:600;color:var(--muted);white-space:nowrap}
.sync[data-st="offline"]{color:var(--bad)}
.hdr-right{display:flex;align-items:center;gap:12px}
body.auth-mode .topnav,body.auth-mode .tabbar,body.auth-mode .hdr .desk,body.auth-mode .sync{display:none!important}
body.auth-mode main{padding-bottom:40px}
.auth{display:grid;justify-items:center;gap:16px;padding-top:6vh}
.auth-card{width:100%;max-width:440px;background:var(--card);border-radius:28px;padding:28px;box-shadow:var(--shadow);display:grid;gap:14px}
.auth-card h1{font-size:30px;font-weight:900}
.auth-card p{margin:0}
.auth-form{display:grid;gap:14px}
.auth-form .btn{height:50px;font-size:16px}
.code-inp{font-size:26px;letter-spacing:.35em;text-align:center;font-weight:800;height:58px}
.auth-links{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}
.linkbtn{border:none;background:none;padding:6px 0;color:var(--accent-ink);font-weight:700;font-size:14px}
.linkbtn:disabled{color:var(--soft);cursor:default}
.check{display:flex;gap:12px;align-items:flex-start;font-size:14px;line-height:1.45;padding:12px 14px;border-radius:16px;background:var(--card2);cursor:pointer}
.check input{width:20px;height:20px;margin:1px 0 0;accent-color:var(--accent);flex:none}
.auth-foot a{color:var(--muted)}
