@font-face{font-family:"Jakarta";src:url("/static/fonts/jakarta.woff2") format("woff2");font-weight:200 800;font-display:swap}

:root{
  --bg:#F3F7F4; --card:#FFFFFF; --card2:#F3F7F4; --ink:#15261E; --muted:#4F6158; --line:#E3EEE7; --line2:#D5DED9;
  --accent:#13795B; --accent-strong:#0B5A43; --on-accent:#FFFFFF; --accent-soft:#E4F4EC; --ring-track:#E3EEE7;
  --nav:#15261E; --nav-ink:#CFE0D7;
  --carb-bg:#FFF4E0; --carb-ink:#7A4B00; --carb-bar:#D98A00; --carb-track:#F6DDB0;
  --prot-bg:#E4F4EC; --prot-ink:#0B5A43; --prot-bar:#13795B; --prot-track:#BFE3D1;
  --fat-bg:#EEEAFB; --fat-ink:#4A3699; --fat-bar:#6A52C9; --fat-track:#D6CDF5;
  --b-bg:#FFF4E0; --b-ink:#B26F00; --l-bg:#E4F4EC; --l-ink:#13795B; --d-bg:#EEEAFB; --d-ink:#5A43B8; --s-bg:#FDE8EC; --s-ink:#B3264A;
  --tl-low:#CDEBD9; --tl-low-ink:#0B4A33; --tl-med:#FDE2B8; --tl-med-ink:#5C3A00; --tl-high:#F8C9CF; --tl-high-ink:#6B0F1E;
  --over:#C2410C; --danger:#B42318; --scrim:rgba(10,20,15,.45); --shadow:0 10px 30px rgba(21,38,30,.12);
  --safe-b:env(safe-area-inset-bottom,0px); --safe-t:env(safe-area-inset-top,0px);
  color-scheme:light;
}
/* colour themes: light variants, then dark base, then dark variants (order matters) */
:root[data-accent="ocean"]{--accent:#1565C0;--accent-strong:#0D47A1;--accent-soft:#E3EEFB;--bg:#F2F5FA;--card2:#EEF2F8;--line:#E0E7F1;--line2:#D3DCE8;--ring-track:#DCE6F3;--nav:#0F1E33;--nav-ink:#C9D8EC;--l-bg:#E3EEFB;--l-ink:#1565C0}
:root[data-accent="berry"]{--accent:#B0306A;--accent-strong:#8A1F50;--accent-soft:#FBE7F0;--bg:#FAF3F6;--card2:#F8EEF3;--line:#F0E1E8;--line2:#E5D2DB;--ring-track:#F1DCE6;--nav:#2B0E1C;--nav-ink:#EBCAD9;--l-bg:#FBE7F0;--l-ink:#B0306A}
:root[data-accent="sunset"]{--accent:#C2410C;--accent-strong:#9A3412;--accent-soft:#FDEBDD;--bg:#FBF6F1;--card2:#F8F0E9;--line:#F0E3D8;--line2:#E6D5C7;--ring-track:#F3E1D2;--nav:#2A160B;--nav-ink:#F0D3BF;--l-bg:#FDEBDD;--l-ink:#C2410C}
:root[data-accent="lavender"]{--accent:#5B4BC4;--accent-strong:#43369B;--accent-soft:#ECE9FB;--bg:#F5F4FB;--card2:#F0EEF9;--line:#E6E3F3;--line2:#D9D5EC;--ring-track:#E2DEF5;--nav:#1A1536;--nav-ink:#D3CDF0;--l-bg:#ECE9FB;--l-ink:#5B4BC4}
:root[data-accent="graphite"]{--accent:#334155;--accent-strong:#1E293B;--accent-soft:#E6EAF0;--bg:#F3F4F6;--card2:#EFF1F4;--line:#E4E7EC;--line2:#D5DAE1;--ring-track:#E1E5EB;--nav:#111827;--nav-ink:#CBD5E1;--l-bg:#E6EAF0;--l-ink:#334155}
:root[data-theme="dark"]{
  --bg:#0E1512; --card:#17211C; --card2:#1E2A24; --ink:#E8F0EB; --muted:#A3B5AB; --line:#24322B; --line2:#33443B;
  --accent:#34B583; --accent-strong:#5FD0A2; --on-accent:#04150E; --accent-soft:#183A2C; --ring-track:#24322B;
  --nav:#1E2A24; --nav-ink:#B8CABF;
  --carb-bg:#33280F; --carb-ink:#F5C76A; --carb-bar:#E9A425; --carb-track:#4A3A16;
  --prot-bg:#153227; --prot-ink:#7FDDB4; --prot-bar:#34B583; --prot-track:#1F4A39;
  --fat-bg:#262046; --fat-ink:#C2B5FF; --fat-bar:#8E78F0; --fat-track:#372E66;
  --b-bg:#33280F; --b-ink:#F5C76A; --l-bg:#153227; --l-ink:#7FDDB4; --d-bg:#262046; --d-ink:#C2B5FF; --s-bg:#3A1720; --s-ink:#FF9DB2;
  --tl-low:#1C4733; --tl-low-ink:#BDF0D5; --tl-med:#4A3714; --tl-med-ink:#FFDDA1; --tl-high:#4E1C24; --tl-high-ink:#FFC2CB;
  --over:#FF8A5B; --danger:#FF7A6E; --scrim:rgba(0,0,0,.6); --shadow:0 10px 30px rgba(0,0,0,.4);
  color-scheme:dark;
}
:root[data-theme="dark"][data-accent="ocean"]{--accent:#5AA2F0;--accent-strong:#93C2F7;--on-accent:#03101F;--accent-soft:#15294A;--bg:#0B111B;--card:#141C29;--card2:#1B2536;--line:#223047;--line2:#2E3F5C;--ring-track:#223047;--nav:#1B2536;--nav-ink:#B7C8DE;--l-bg:#15294A;--l-ink:#5AA2F0}
:root[data-theme="dark"][data-accent="berry"]{--accent:#F07AAE;--accent-strong:#F7A8CB;--on-accent:#2A0716;--accent-soft:#3D1729;--bg:#150B10;--card:#1F1218;--card2:#2A1820;--line:#35202B;--line2:#482C3A;--ring-track:#35202B;--nav:#2A1820;--nav-ink:#E0C2D0;--l-bg:#3D1729;--l-ink:#F07AAE}
:root[data-theme="dark"][data-accent="sunset"]{--accent:#FF9A5C;--accent-strong:#FFBC90;--on-accent:#2A1003;--accent-soft:#3D2113;--bg:#140E0A;--card:#1F1610;--card2:#2A1E16;--line:#36271C;--line2:#4A3626;--ring-track:#36271C;--nav:#2A1E16;--nav-ink:#E8CDB9;--l-bg:#3D2113;--l-ink:#FF9A5C}
:root[data-theme="dark"][data-accent="lavender"]{--accent:#A99BFF;--accent-strong:#C8BFFF;--on-accent:#120B33;--accent-soft:#27214D;--bg:#0E0C18;--card:#181526;--card2:#211D33;--line:#2B2642;--line2:#3B3558;--ring-track:#2B2642;--nav:#211D33;--nav-ink:#CBC5EA;--l-bg:#27214D;--l-ink:#A99BFF}
:root[data-theme="dark"][data-accent="graphite"]{--accent:#A7B4C6;--accent-strong:#CBD5E1;--on-accent:#0E1420;--accent-soft:#232B38;--bg:#0D0F12;--card:#171A1F;--card2:#1F242B;--line:#282E37;--line2:#363E4A;--ring-track:#282E37;--nav:#1F242B;--nav-ink:#C3CBD6;--l-bg:#232B38;--l-ink:#A7B4C6}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;height:100%}
body{margin:0;min-height:100%;background:var(--bg);color:var(--ink);font-family:"Jakarta",system-ui,-apple-system,"Segoe UI",sans-serif;font-size:15px;line-height:1.4;-webkit-tap-highlight-color:transparent;overscroll-behavior-y:none}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
a{color:var(--accent)}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:6px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
svg{flex-shrink:0}
h1,h2,h3{margin:0}

/* boot */
.boot{min-height:100vh;display:flex;align-items:center;justify-content:center}
.boot-ring{width:56px;height:56px;border-radius:50%;border:6px solid var(--ring-track);border-top-color:var(--accent);animation:spin 0.9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){*{animation-duration:0s!important;transition-duration:0s!important}}

/* layout */
.shell{max-width:520px;margin:0 auto;min-height:100vh;display:flex;flex-direction:column;padding-top:var(--safe-t)}
.view{flex:1;padding:0 16px calc(110px + var(--safe-b))}
.top{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:18px 4px 10px}
.top .ttl{display:flex;flex-direction:column}
.top .eyebrow{font-size:13px;color:var(--muted);font-weight:500}
.top h1{font-size:24px;font-weight:800;letter-spacing:-.01em}
.daynav{display:flex;gap:6px}
.icon-btn{width:44px;height:44px;border-radius:22px;border:0;background:var(--card);color:var(--ink);display:inline-flex;align-items:center;justify-content:center;position:relative}
.icon-btn:active{transform:scale(.96)}
.icon-btn input[type=date]{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}

.card{background:var(--card);border-radius:24px;padding:18px}
.card + .card{margin-top:12px}
.section-h{display:flex;justify-content:space-between;align-items:center;font-size:16px;font-weight:700;padding:18px 4px 10px}
.section-h .link{font-size:13px;font-weight:600;background:none;border:0;color:var(--accent);min-height:44px;padding:0 4px}

/* summary */
.summary{display:flex;flex-direction:column;gap:16px}
.sum-row{display:flex;align-items:center;gap:18px}
.ring{position:relative;width:150px;height:150px;flex-shrink:0}
.ring svg{width:150px;height:150px;transform:rotate(-90deg)}
.ring .track{stroke:var(--ring-track)}
.ring .val{stroke:var(--accent);transition:stroke-dasharray .6s ease}
.ring.over .val{stroke:var(--over)}
.ring .mid{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.ring .big{font-size:30px;font-weight:800;letter-spacing:-.02em}
.ring .sm{font-size:12px;color:var(--muted)}
.ring.over .big{color:var(--over)}
.stats{display:flex;flex-direction:column;gap:10px;flex:1}
.stat{display:flex;flex-direction:column}
.stat span{font-size:12px;color:var(--muted)}
.stat b{font-size:17px;font-weight:700}
.macros{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.macro{border-radius:14px;padding:10px;display:flex;flex-direction:column;gap:6px}
.macro .lbl{font-size:12px;font-weight:600}
.macro .v{font-size:15px;font-weight:700}
.macro .v small{font-size:12px;font-weight:500;color:var(--muted)}
.bar{height:5px;border-radius:3px;overflow:hidden}
.bar i{display:block;height:100%;border-radius:3px;transition:width .5s ease}
.m-carb{background:var(--carb-bg)} .m-carb .lbl{color:var(--carb-ink)} .m-carb .bar{background:var(--carb-track)} .m-carb .bar i{background:var(--carb-bar)}
.m-prot{background:var(--prot-bg)} .m-prot .lbl{color:var(--prot-ink)} .m-prot .bar{background:var(--prot-track)} .m-prot .bar i{background:var(--prot-bar)}
.m-fat{background:var(--fat-bg)} .m-fat .lbl{color:var(--fat-ink)} .m-fat .bar{background:var(--fat-track)} .m-fat .bar i{background:var(--fat-bar)}

/* meals */
.meals{display:flex;flex-direction:column;gap:10px}
.meal{background:var(--card);border-radius:18px;overflow:hidden}
.meal-head{display:flex;align-items:center;gap:12px;padding:12px 12px 12px 14px}
.meal-toggle{flex:1;display:flex;align-items:center;gap:12px;background:none;border:0;padding:0;text-align:left;min-height:44px;min-width:0}
.meal-ico{width:42px;height:42px;border-radius:12px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.meal-txt{flex:1;display:flex;flex-direction:column;min-width:0}
.meal-txt b{font-size:15px}
.meal-txt span{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.meal-kcal{font-weight:700;font-size:14px}
.meal-kcal.zero{color:var(--muted)}
.add-btn{width:44px;height:44px;border-radius:22px;border:0;background:var(--accent);color:var(--on-accent);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.add-btn:active{transform:scale(.94)}
.meal-ico.breakfast{background:var(--b-bg);color:var(--b-ink)} .meal-ico.lunch{background:var(--l-bg);color:var(--l-ink)}
.meal-ico.dinner{background:var(--d-bg);color:var(--d-ink)} .meal-ico.snacks{background:var(--s-bg);color:var(--s-ink)}
.items{border-top:1px solid var(--line);display:flex;flex-direction:column}
.item{display:flex;align-items:center;gap:10px;padding:10px 14px;background:none;border:0;border-bottom:1px solid var(--line);text-align:left;width:100%;min-height:52px}
.item:last-child{border-bottom:0}
.item .t{flex:1;display:flex;flex-direction:column;min-width:0}
.item .t b{font-weight:600;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item .t span{font-size:12px;color:var(--muted)}
.item .k{font-weight:600;font-size:14px}
.items .empty{padding:12px 14px;font-size:13px;color:var(--muted);display:flex;justify-content:space-between;align-items:center;gap:8px}
.items .empty button{background:none;border:0;color:var(--accent);font-weight:600;min-height:44px}

/* banners */
.banner{display:flex;align-items:center;gap:12px;background:var(--accent-soft);border-radius:18px;padding:12px 12px 12px 14px;margin-bottom:12px}
.banner p{margin:0;flex:1;font-size:13px}
.banner p b{display:block;font-size:14px}
.banner .x{background:none;border:0;width:44px;height:44px;color:var(--muted)}

/* nav */
.nav-wrap{position:fixed;left:0;right:0;bottom:0;padding:10px 16px calc(14px + var(--safe-b));pointer-events:none;z-index:20}
.nav{pointer-events:auto;max-width:488px;margin:0 auto;background:var(--nav);border-radius:28px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:6px;align-items:center;box-shadow:var(--shadow)}
.nav button{border:0;border-radius:22px;background:transparent;color:var(--nav-ink);min-height:48px;display:flex;align-items:center;justify-content:center;gap:6px;font-weight:700;font-size:13px}
.nav button.on{background:var(--accent);color:var(--on-accent)}
.nav button .l{display:none}
.nav button.on .l{display:inline}

/* buttons & forms */
.btn{height:52px;padding:0 20px;border-radius:26px;border:0;background:var(--accent);color:var(--on-accent);font-weight:700;font-size:15px;display:inline-flex;align-items:center;justify-content:center;gap:8px;text-decoration:none}
.btn.ghost{background:transparent;border:1.5px solid var(--ink);color:var(--ink)}
.btn.soft{background:var(--card2);color:var(--ink)}
.btn.danger{background:transparent;border:1.5px solid var(--danger);color:var(--danger)}
.btn.block{width:100%}
.btn:disabled{opacity:.5}
.btn.sm{height:44px;font-size:14px;padding:0 16px}
.field{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:600;color:var(--muted)}
.field input,.field select{height:48px;border-radius:12px;border:1.5px solid var(--line2);background:var(--card);padding:0 14px;font-size:16px;font-weight:500;color:var(--ink);width:100%;min-width:0}
.field input:focus,.field select:focus{border-color:var(--accent);outline:none}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.stack{display:flex;flex-direction:column;gap:12px}
.row{display:flex;gap:10px;align-items:center}
.hint{font-size:12px;color:var(--muted);margin:0}
.err{color:var(--danger);font-size:13px;font-weight:600;margin:0;min-height:1em}
.switch{display:flex;align-items:center;justify-content:space-between;gap:12px;background:var(--card2);border-radius:14px;padding:6px 14px;min-height:56px;font-size:14px;font-weight:600}
.switch small{display:block;font-weight:500;color:var(--muted);font-size:12px}
.switch input{appearance:none;width:48px;height:28px;border-radius:14px;background:var(--line2);position:relative;flex-shrink:0;transition:background .2s}
.switch input::after{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;transition:transform .2s;box-shadow:0 1px 3px rgba(0,0,0,.2)}
.switch input:checked{background:var(--accent)}
.switch input:checked::after{transform:translateX(20px)}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{border:1.5px solid var(--line2);height:38px;padding:0 14px;border-radius:19px;background:var(--card);color:var(--ink);font-weight:600;font-size:13px;white-space:nowrap}
.chip.on{background:var(--ink);border-color:var(--ink);color:var(--card)}
.seg{display:flex;background:var(--card2);border-radius:22px;padding:4px;gap:2px}
.seg button{flex:1;border:0;border-radius:18px;background:transparent;height:38px;font-weight:600;font-size:13px;color:var(--muted)}
.seg button.on{background:var(--card);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.08)}

/* sheets */
.sheet-wrap{position:fixed;inset:0;z-index:40;display:flex;align-items:flex-end;justify-content:center}
.scrim{position:absolute;inset:0;background:var(--scrim);animation:fade .2s ease}
.sheet{position:relative;background:var(--card);width:100%;max-width:520px;max-height:94vh;max-height:94dvh;border-radius:28px 28px 0 0;display:flex;flex-direction:column;animation:up .25s ease;padding-bottom:var(--safe-b)}
.sheet.full{height:100vh;height:100dvh;max-height:none;border-radius:0;padding-top:var(--safe-t)}
@media (min-width:600px){.sheet.full{height:94vh;height:94dvh;border-radius:28px 28px 0 0}}
.sheet .grab{align-self:center;width:40px;height:5px;border-radius:3px;background:var(--line2);margin:10px 0 2px;flex-shrink:0}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;flex-shrink:0}
.sheet-head h2{font-size:17px;font-weight:700;text-align:center;flex:1}
.sheet-body{overflow-y:auto;padding:4px 20px 20px;flex:1;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.sheet-foot{padding:12px 20px 16px;display:flex;gap:10px;border-top:1px solid var(--line);flex-shrink:0}
@keyframes up{from{transform:translateY(40px);opacity:.4}}
@keyframes fade{from{opacity:0}}

/* scanner */
.scan{position:relative;border-radius:22px;overflow:hidden;background:#20302A;height:260px;display:flex;align-items:center;justify-content:center}
.scan video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.scan .frame{position:relative;width:72%;height:44%;border:3px solid #7FE0B5;border-radius:22px;box-shadow:0 0 0 999px rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center}
.scan .frame::after{content:"";position:absolute;left:8%;right:8%;height:2px;background:#7FE0B5;top:50%;animation:scanline 1.8s ease-in-out infinite alternate;opacity:.8}
@keyframes scanline{from{top:15%}to{top:85%}}
.scan .msg{position:absolute;bottom:12px;left:12px;right:12px;text-align:center;color:#fff;font-size:13px;font-weight:600;text-shadow:0 1px 3px rgba(0,0,0,.6)}
.scan .torch{position:absolute;top:12px;right:12px;background:rgba(255,255,255,.18);color:#fff}
.scan-off{flex-direction:column;gap:12px;padding:20px;text-align:center;color:#E8F0EB}
.scan-off p{margin:0;font-size:13px;max-width:300px}
.scan-alt{display:flex;gap:8px;margin-top:12px}
.scan-alt > *{flex:1}

/* lists */
.list{display:flex;flex-direction:column}
.list-h{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;padding:16px 2px 6px}
.fi{display:flex;align-items:center;gap:12px;padding:10px 2px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left;width:100%;min-height:60px}
.fi .thumb{width:44px;height:44px;border-radius:12px;background:var(--card2);flex-shrink:0;object-fit:cover;display:flex;align-items:center;justify-content:center;color:var(--muted)}
.fi .t{flex:1;display:flex;flex-direction:column;min-width:0}
.fi .t b{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.fi .t span{font-size:12px;color:var(--muted);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.fi .k{font-size:13px;font-weight:700;text-align:right;white-space:nowrap}
.fi .k small{display:block;font-weight:500;color:var(--muted);font-size:11px}
.tag{display:inline-block;font-size:10px;font-weight:700;padding:1px 6px;border-radius:4px;background:var(--accent-soft);color:var(--accent-strong);margin-right:4px;vertical-align:1px}
.searchbox{display:flex;align-items:center;gap:8px;height:48px;border-radius:24px;background:var(--card2);padding:0 6px 0 16px;color:var(--muted)}
.searchbox input{flex:1;border:0;background:transparent;font-size:16px;outline:none;color:var(--ink);min-width:0;height:100%}
.searchbox button{width:40px;height:40px;border:0;border-radius:20px;background:transparent;color:var(--muted)}
.loading{padding:16px 2px;color:var(--muted);font-size:13px;display:flex;align-items:center;gap:8px}
.loading::before{content:"";width:16px;height:16px;border-radius:50%;border:2.5px solid var(--line2);border-top-color:var(--accent);animation:spin .8s linear infinite}
.empty-state{text-align:center;color:var(--muted);font-size:14px;padding:28px 12px}

/* food detail */
.prod{display:flex;gap:14px;align-items:center}
.prod .ph{width:64px;height:64px;border-radius:16px;background:var(--card2);object-fit:contain;flex-shrink:0;display:flex;align-items:center;justify-content:center;color:var(--muted)}
.prod h3{font-size:18px;font-weight:800;line-height:1.25}
.prod p{margin:2px 0 0;font-size:13px;color:var(--muted)}
.amount{display:flex;align-items:center;justify-content:space-between;background:var(--card2);border-radius:18px;padding:10px 12px;gap:8px}
.amount .kc{display:flex;flex-direction:column}
.amount .kc b{font-size:30px;font-weight:800;color:var(--accent);line-height:1.1;letter-spacing:-.02em}
.amount .kc span{font-size:12px;color:var(--muted)}
.stepper{display:flex;align-items:center;gap:6px}
.stepper button{width:44px;height:44px;border-radius:22px;border:0;background:var(--card);font-size:22px;font-weight:600;color:var(--ink)}
.stepper input{width:64px;text-align:center;font-size:17px;font-weight:700;border:0;background:transparent;height:44px;color:var(--ink)}
.stepper input:focus{outline:2px solid var(--accent);border-radius:10px}
.tl{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;text-align:center}
.tl div{border-radius:12px;padding:8px 4px;display:flex;flex-direction:column;background:var(--card2)}
.tl span{font-size:11px}
.tl b{font-size:14px;font-weight:800}
.tl .low{background:var(--tl-low);color:var(--tl-low-ink)} .tl .med{background:var(--tl-med);color:var(--tl-med-ink)} .tl .high{background:var(--tl-high);color:var(--tl-high-ink)}
.nut{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:14px}
.nut div{display:flex;justify-content:space-between;padding:9px 12px;border-bottom:1px solid var(--line);font-size:14px}
.nut div:last-child{border-bottom:0}
.nut .sub{padding-left:24px;color:var(--muted)}
.nut .head{font-weight:700}
.src{font-size:11px;color:var(--muted);margin:0}
.src a{color:var(--muted)}

/* progress */
.chart{width:100%;height:auto;display:block}
.chart text{fill:var(--muted);font-size:10px;font-family:inherit}
.chart .grid{stroke:var(--line)}
.chart .goal{stroke:var(--ink);stroke-dasharray:4 4;opacity:.5}
.chart .bar{fill:var(--accent)}
.chart .bar.over{fill:var(--over)}
.chart .line{stroke:var(--accent);fill:none;stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.chart .dot{fill:var(--card);stroke:var(--accent);stroke-width:2}
.kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:14px}
.kpi{background:var(--card2);border-radius:14px;padding:10px}
.kpi span{display:block;font-size:12px;color:var(--muted)}
.kpi b{font-size:18px;font-weight:800}

/* settings */
.set-list{display:flex;flex-direction:column}
.set-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 2px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left;width:100%;min-height:56px;font-size:15px;font-weight:600;color:var(--ink);text-decoration:none}
.set-item:last-child{border-bottom:0}
.set-item span{color:var(--muted);font-weight:500;font-size:14px;text-align:right}
.person{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.person:last-child{border-bottom:0}
.avatar{width:40px;height:40px;border-radius:20px;background:var(--accent-soft);color:var(--accent-strong);display:flex;align-items:center;justify-content:center;font-weight:800;flex-shrink:0}
.person .t{flex:1;min-width:0;display:flex;flex-direction:column}
.person .t span{font-size:12px;color:var(--muted)}

/* auth */
.auth{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;justify-content:center;padding:32px 20px calc(32px + var(--safe-b));max-width:420px;margin:0 auto;gap:22px}
.auth .logo{width:64px;height:64px;border-radius:18px}
.auth h1{font-size:28px;font-weight:800;letter-spacing:-.02em}
.auth p.lead{margin:6px 0 0;color:var(--muted)}

/* toast */
#toast{position:fixed;left:50%;bottom:calc(96px + var(--safe-b));transform:translateX(-50%) translateY(20px);background:var(--nav);color:#fff;border-radius:16px;padding:0 6px 0 16px;min-height:48px;display:flex;align-items:center;gap:8px;font-size:14px;font-weight:600;opacity:0;pointer-events:none;transition:.2s;z-index:60;max-width:calc(100% - 32px);box-shadow:var(--shadow)}
#toast.show{opacity:1;transform:translateX(-50%);pointer-events:auto}
#toast button{background:none;border:0;color:#7FE0B5;font-weight:700;min-height:44px;padding:0 10px}
#toast:not(:has(button)){padding-right:16px}

input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none;display:none}

/* --- polish additions --- */
.link-btn{display:flex;align-items:center;justify-content:center;gap:4px;width:100%;background:none;border:0;color:var(--accent-strong);font-weight:600;font-size:13px;min-height:44px;margin-top:2px}
.meal-actions{display:flex;justify-content:space-between;gap:8px;padding:6px 8px 8px}
.meal-actions button{background:none;border:0;color:var(--accent-strong);font-weight:700;font-size:13px;min-height:44px;padding:0 8px;display:inline-flex;align-items:center;gap:4px}
.meal-actions svg{width:16px;height:16px}
.fi-row{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line)}
.fi-row .fi{border-bottom:0;flex:1;min-width:0}
.qa{width:40px;height:40px;border-radius:20px;border:0;background:var(--accent-soft);color:var(--accent-strong);display:flex;align-items:center;justify-content:center;flex-shrink:0;font-weight:800;transition:background .15s}
.qa svg{width:18px;height:18px}
.qa.done{background:var(--accent);color:var(--on-accent)}
.more-row{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.star{background:var(--card2);color:var(--muted)}
.star.on{color:#E0A100}
.nrow{display:flex;flex-direction:column;gap:6px}
.nrow span{font-size:13px}
.bar.big{height:8px;border-radius:4px;background:var(--ring-track)}
.bar.big i{background:var(--accent);border-radius:4px}
.bar.big.over i{background:var(--over)}
.swatches{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.swatch{display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px 4px;border-radius:14px;border:2px solid transparent;background:var(--card2);font-size:12px;font-weight:600;color:var(--ink);min-height:44px}
.swatch span{width:32px;height:32px;border-radius:16px;background:var(--sw);box-shadow:inset 0 0 0 3px rgba(255,255,255,.35)}
.swatch.on{border-color:var(--sw);background:var(--card)}
#view{touch-action:pan-y}
.card{animation:rise .25s ease both}
@keyframes rise{from{opacity:0;transform:translateY(6px)}}
.ring .val{transition:stroke-dasharray .7s cubic-bezier(.2,.8,.2,1)}
.seg button{transition:background .15s,color .15s}
.btn,.chip,.add-btn,.qa,.icon-btn{transition:transform .1s ease}
.btn:active,.chip:active{transform:scale(.97)}
