:root{--bg:#f6f8f6;--card:#fff;--ink:#162522;--muted:#72807b;--line:#e7eeea;--forest:#147965;--forest-dark:#106754;--forest-soft:#eaf5f0;--fat:#ac7dcc;--protein:#6184e9;--carb:#e8a754;--shadow:0 6px 25px rgba(22,58,45,.04);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;font-synthesis:none;-webkit-tap-highlight-color:transparent;color-scheme:light}
*{box-sizing:border-box}html{height:100%;overscroll-behavior-y:none}body{margin:0;min-height:100%;background:var(--bg);color:var(--ink);font-size:15px;line-height:1.45}button,input,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.52}button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid rgba(33,144,115,.28);outline-offset:3px}a{color:var(--forest)}h1,h2,h3,p{margin:0}h2{font-size:18px;font-weight:760;letter-spacing:-.35px}h1{font-size:32px;letter-spacing:-1px;line-height:1.14}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.85;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.svg-defs{display:none}.hidden{display:none!important}.app-shell{max-width:560px;margin:0 auto;min-height:100vh;padding-bottom:calc(94px + env(safe-area-inset-bottom))}.app-header{height:94px;display:flex;align-items:center;justify-content:space-between;padding:calc(18px + env(safe-area-inset-top)) 21px 12px;height:calc(84px + env(safe-area-inset-top))}.brand-line{display:flex;align-items:center;gap:10px}.brand-icon{width:40px;height:40px;background:var(--forest);border-radius:14px;color:#fff;display:grid;place-items:center;box-shadow:0 6px 13px rgba(15,100,76,.18)}.brand-heart{font-size:23px;transform:translateY(-1px)}.brand-name{font-weight:850;letter-spacing:-1.4px;line-height:25px;font-size:26px}.brand-dot{color:#1cac8c}.brand-subtitle{font-size:11px;color:var(--muted);font-weight:500;margin-top:1px}.offline-pill{background:#fcf0dd;color:#8a5b18;padding:4px 9px;border-radius:99px;font-size:12px;font-weight:650}.main-content{padding:0 16px 24px}.view{animation:fadein .16s ease}@keyframes fadein{from{opacity:.65}to{opacity:1}}.surface{background:var(--card);border:1px solid var(--line);border-radius:22px;padding:19px 19px;box-shadow:var(--shadow)}.day-bar{display:flex;align-items:center;justify-content:space-between;margin:0 0 12px;gap:8px}.day-center{position:relative;display:flex;align-items:center;justify-content:center;flex:1}.day-arrow{width:44px;height:48px;border:none;background:transparent;color:#596b65}.icon-button{display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:12px;background:#f4f8f5;color:var(--ink);width:36px;height:36px}.icon-button:active,.button:active{transform:scale(.985)}.date-button{border:0;background:transparent;display:flex;align-items:center;flex-direction:column;gap:1px;color:var(--ink)}.date-button>span:first-child{font-size:17px;font-weight:760;letter-spacing:-.3px}.day-sub{display:flex;align-items:center;gap:5px;font-size:12px;color:var(--muted)}.day-sub svg{width:13px;height:13px}.date-native{position:absolute;width:1px;height:1px;opacity:0;bottom:0;left:50%;pointer-events:none}.swipe-zone{touch-action:pan-y}.calorie-card{background:linear-gradient(142deg,#fff 12%,#f5faf7 100%);margin-bottom:12px}.section-top{display:flex;justify-content:space-between;align-items:center}.eyebrow{font-size:11px;letter-spacing:1.4px;font-weight:770;color:#6b7974}.subtle-icon{font-size:26px;color:#aac8ba;line-height:1}.calorie-values{margin:11px 0 17px;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}.calorie-values strong{font-size:47px;line-height:1;letter-spacing:-2px;font-weight:820;font-variant-numeric:tabular-nums}.kcal-unit{color:var(--muted);font-size:15px;font-weight:550}.progress-track{height:9px;overflow:hidden;background:#e8eee9;border-radius:20px}.progress-track.big{height:14px}.progress-fill{height:100%;border-radius:20px;transition:width .25s ease;background:var(--forest);max-width:100%}.progress-fill.over{background:#dd8c5c}.calorie-bottom{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-top:13px;font-size:12px;color:var(--muted)}.calorie-bottom strong{font-size:12px;color:var(--forest);font-weight:730}.calorie-bottom strong.negative{color:#ba654b}.macro-card{margin-bottom:14px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.section-heading.spaced{margin:22px 4px 13px}.small-muted{color:var(--muted);font-size:12px}.macro-container{display:grid;gap:19px;margin-top:19px}.macro-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;gap:10px}.macro-name{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:640}.macro-dot{width:9px;height:9px;border-radius:4px;background:var(--protein)}.macro-values{font-size:13px;color:#64746e;font-variant-numeric:tabular-nums}.macro-row .progress-track{height:8px}.meal-compose{margin-top:0}.tiny-tag,.count-tag{font-size:11px;border-radius:50px;color:var(--forest);background:var(--forest-soft);padding:5px 9px;font-weight:680;white-space:nowrap}.input-label{display:block;font-size:13px;font-weight:640;margin:16px 0 8px}textarea,input[type=text],input[type=number],input[type=time],input[type=date],input[type=search]{border:1px solid #dae4dd;border-radius:13px;background:#fcfefd;color:var(--ink);width:100%;min-height:44px;padding:10px 12px;font-size:16px;outline:none}textarea:focus,input:focus{border-color:#45ab92;box-shadow:0 0 0 3px rgba(25,134,103,.08)}textarea{min-height:92px;resize:vertical}.field-help{font-size:12px;color:var(--muted);line-height:1.55;margin:9px 1px 14px}.button{border-radius:13px;padding:12px 15px;border:1px solid transparent;min-height:45px;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-size:13px;font-weight:760;line-height:1.2;text-decoration:none;white-space:normal;text-align:center;transition:transform .12s ease,background .12s}.button svg{width:17px;height:17px}.button.primary{background:var(--forest);color:white}.button.primary:hover{background:var(--forest-dark)}.button.soft{background:#edf6f0;color:var(--forest);border-color:#e5eee7}.button.outline{background:white;color:var(--forest);border-color:#b9d6c9}.button.danger{background:#fff0ed;color:#b04c35}.button:disabled{opacity:.55}.button.full{width:100%}.quick-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:11px}.quick-actions .button{padding:10px 4px;font-size:11.5px;gap:5px}.quick-actions svg{width:16px;height:16px}.meal-list{display:grid;gap:10px}.meal-item{display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:18px;background:white;padding:13px 13px;text-align:left;width:100%;color:var(--ink)}.meal-item:hover{border-color:#bdd8ce}.meal-time{display:grid;place-items:center;background:#eef5f0;border-radius:12px;color:var(--forest);font-weight:720;font-size:12px;min-width:55px;height:44px;font-variant-numeric:tabular-nums}.meal-info{flex:1;min-width:0}.meal-title{font-size:13.5px;font-weight:740;line-height:1.4;overflow-wrap:anywhere}.meal-sub{font-size:11.5px;color:var(--muted);margin-top:4px}.meal-cal{font-weight:760;font-size:13px;white-space:nowrap}.meal-item>svg{width:15px;height:15px;color:#9aaca2}.empty-state{border:1px dashed #cedbd1;border-radius:17px;text-align:center;padding:26px 18px;color:var(--muted);font-size:13px;background:rgba(255,255,255,.5)}.empty-state strong{display:block;color:var(--ink);font-size:15px;margin-bottom:5px}.page-head{padding:18px 6px 22px}.page-head h1{margin:7px 0 9px}.page-head p{color:var(--muted);font-size:13px;line-height:1.65}.history-summary{display:flex;flex-direction:column;gap:10px;margin-bottom:20px}.history-big{font-size:37px;font-weight:820;letter-spacing:-1.2px}.history-list{display:grid;gap:10px}.history-day{background:#fff;border-radius:17px;border:1px solid var(--line);padding:13px 15px;text-align:left;color:var(--ink);width:100%}.history-day-top{display:flex;justify-content:space-between;gap:10px;align-items:center}.history-day-title{font-weight:690;font-size:14px}.history-day-amount{font-size:13px;font-weight:790}.history-day-foot{display:flex;justify-content:space-between;font-size:11px;color:var(--muted);margin-top:8px}.history-day .progress-track{height:6px;margin-top:9px}.segmented{display:grid;grid-template-columns:1fr 1fr;background:#eaf0eb;border-radius:14px;padding:4px;margin-bottom:16px}.segment{border:0;border-radius:11px;background:transparent;padding:10px;font-weight:710;color:var(--muted)}.segment.active{background:white;box-shadow:0 2px 7px rgba(32,62,44,.07);color:var(--forest)}.library-actions{display:flex;gap:8px;margin-bottom:14px}.library-actions>*{flex:1}.library-entry{background:white;border:1px solid var(--line);border-radius:16px;padding:14px;margin-bottom:9px}.library-entry-top{display:flex;justify-content:space-between;align-items:start;gap:10px}.library-entry h3{font-size:14px;font-weight:750;line-height:1.4;overflow-wrap:anywhere}.library-entry p{font-size:12px;color:var(--muted);margin-top:5px}.library-entry-buttons{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.library-entry-buttons .button{padding:8px 11px;min-height:36px;font-size:12px}.form-card{margin-bottom:13px}.form-card h2{margin-bottom:14px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px;margin-bottom:17px}.field{font-size:13px;color:var(--ink);font-weight:650;display:block}.field>span{float:right;font-size:12px;color:var(--muted)}.field input{margin-top:6px;font-weight:700}.form-card p{font-size:12.5px;color:var(--muted);line-height:1.65;margin-bottom:13px}.form-card .button+.button{margin-top:8px}.form-card .fine-print{font-size:11.5px;line-height:1.6;margin-top:13px;margin-bottom:0}.upload-label{position:relative;margin-top:10px}.version-label{color:#9aaba3!important;margin-top:16px!important}.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:560px;display:grid;grid-template-columns:repeat(4,1fr);background:rgba(255,255,255,.97);backdrop-filter:blur(18px);border-top:1px solid var(--line);padding:10px 6px calc(9px + env(safe-area-inset-bottom));z-index:10;box-shadow:0 -5px 25px rgba(22,50,33,.02)}.nav-button{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;background:none;border:0;color:#9aa8a1;min-height:49px;font-size:10.5px;font-weight:680}.nav-button.active{color:var(--forest)}.nav-button svg{width:21px;height:21px;stroke-width:2}.nav-button.active svg{stroke-width:2.35}.sheet-overlay{position:fixed;inset:0;z-index:40;display:flex;align-items:flex-end;justify-content:center}.sheet-backdrop{position:absolute;inset:0;background:rgba(18,34,27,.45)}.bottom-sheet{position:relative;width:100%;max-width:560px;background:#fff;border-radius:24px 24px 0 0;box-shadow:0 -6px 48px rgba(0,0,0,.12);max-height:calc(100dvh - env(safe-area-inset-top) - 15px);overflow:hidden;padding-bottom:env(safe-area-inset-bottom)}.sheet-handle{height:5px;width:38px;background:#dce5df;border-radius:20px;margin:10px auto 4px}.sheet-content{padding:11px 17px 20px;max-height:calc(100dvh - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 40px);overflow-y:auto;overscroll-behavior:contain}.sheet-titlebar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.sheet-titlebar h2{font-size:21px}.sheet-intro{font-size:12.5px;color:var(--muted);line-height:1.55;margin-bottom:16px}.form-row{display:grid;grid-template-columns:1fr 116px;gap:10px}.sheet-field{display:block;color:#566960;font-size:12px;font-weight:730;margin:12px 0 6px}.sheet-field input{margin-top:5px}.review-item{border:1px solid var(--line);border-radius:16px;padding:12px;margin:12px 0;background:#fcfefd}.review-top{display:flex;justify-content:space-between;align-items:center;gap:8px}.review-num{font-size:11px;color:var(--forest);font-weight:750;letter-spacing:.7px}.review-item .field-help{margin:4px 0}.review-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.review-grid label{font-size:11px;color:var(--muted);font-weight:650}.review-grid input{padding:7px 5px;text-align:center;min-height:40px;font-size:15px;margin-top:5px}.review-nutrition{font-size:12px;color:#527064;padding:9px 0 2px;display:flex;justify-content:space-between;gap:10px}.source-tag{display:inline-flex;align-items:center;gap:5px;margin:7px 0 0;padding:4px 7px;border-radius:7px;background:#edf3f0;color:#597b69;font-size:10.5px;line-height:1.35}.source-tag.warn{color:#915e28;background:#fff4e5}.source-tag.good{background:#e6f5ef;color:#237a5f}.review-actions{display:flex;align-items:center;gap:6px;margin-top:9px}.review-actions .button{font-size:12px;min-height:34px;padding:7px 11px}.review-total{background:#edf6f0;border-radius:14px;padding:13px;margin:15px 0;display:flex;align-items:center;justify-content:space-between;gap:10px}.review-total>span{color:#4d695e;font-size:12px;font-weight:700}.review-total strong{font-size:21px;color:var(--forest)}.sheet-footer{display:grid;gap:8px;margin-top:15px}.sheet-two-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px}.mini-toolbar{display:flex;gap:8px;margin:10px 0}.search-results{display:grid;gap:9px;margin-top:16px}.result-item{border:1px solid var(--line);background:#fff;border-radius:15px;padding:13px;text-align:left;width:100%;color:var(--ink)}.result-item h3{font-size:13px;overflow-wrap:anywhere}.result-item p{font-size:11.5px;color:var(--muted);margin:4px 0}.result-source{color:var(--forest)!important}.result-item:active{background:var(--forest-soft)}.loading-state{display:flex;gap:9px;align-items:center;justify-content:center;color:var(--muted);font-size:12.5px;padding:22px 6px}.spinner{border:2px solid #d3e4da;border-top:2px solid var(--forest);border-radius:50%;width:18px;height:18px;animation:spin .7s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.helper-notice{background:#fff6e8;color:#875c24;border-radius:12px;padding:10px 11px;font-size:12px;line-height:1.55;margin:10px 0}.helper-notice.green{background:var(--forest-soft);color:#2f715d}.scanner-view{border-radius:12px;overflow:hidden;background:#182821;min-height:155px;margin:10px 0}#barcode-reader video{width:100%!important;object-fit:cover}#barcode-reader{min-height:140px}.scanner-view *{max-width:100%}.photo-preview{width:100%;max-height:180px;object-fit:contain;border-radius:12px;background:#eef2ee;margin:8px 0}.photo-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.photo-fields .sheet-field{margin:5px 0}.sheet-content details{font-size:12px;color:var(--muted);margin:10px 0}.sheet-content pre{white-space:pre-wrap;word-break:break-word;font-size:11px}.toast{position:fixed;left:50%;bottom:calc(95px + env(safe-area-inset-bottom));transform:translateX(-50%);width:calc(100% - 34px);max-width:510px;z-index:100;background:#20362c;color:#fff;border-radius:15px;padding:13px 16px;font-size:13px;text-align:center;box-shadow:0 12px 32px #14241d4d}.toast.error{background:#8d493c}.photo-btn{position:relative;overflow:hidden}.photo-btn input{opacity:0;position:absolute;inset:0;cursor:pointer}.counter{font-variant-numeric:tabular-nums}.search-status{padding:8px 0;font-size:12px;color:var(--muted)}
@media(min-width:560px){.main-content{padding:0 20px 34px}.app-shell{box-shadow:0 0 80px #8dab9a19}.app-header{padding-left:26px;padding-right:26px}.sheet-overlay{align-items:center}.bottom-sheet{border-radius:24px;max-height:92dvh}.sheet-content{max-height:calc(92dvh - 26px)}body{background:#eff3f0}}
@media(max-width:350px){.quick-actions{gap:4px}.quick-actions .button{font-size:10px}.quick-actions svg{width:14px;height:14px}.calorie-values strong{font-size:42px}.surface{padding:16px}.sheet-content{padding-left:13px;padding-right:13px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
.meal-title,.meal-sub{display:block}

/* The transparent native date input is tapped directly on iPhone. */
.date-native{position:absolute;inset:0;width:100%;height:100%;opacity:0;pointer-events:auto;cursor:pointer;z-index:2}
