:root{--bg:#f7f8f4;--card:#fff;--ink:#19332c;--muted:#77877f;--green:#145f4e;--green2:#2b8a70;--mint:#e7f3eb;--line:#e6eae4;--shadow:0 8px 30px rgba(21,55,42,.045);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;color:var(--ink);font-size:15px}*{box-sizing:border-box}body{margin:0;background:var(--bg);min-height:100vh}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}.app-shell{max-width:1050px;margin:0 auto;min-height:100vh;padding:0 26px 120px}.topbar{height:94px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:12px}.brand-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:15px;background:var(--green);color:#fff;font-size:30px}.brand strong{font-size:27px;letter-spacing:-1.4px;line-height:1.1;display:block}.brand-dot{color:var(--green2)}.brand small{font-size:11px;color:var(--muted);letter-spacing:.2px}.header-actions{display:flex;gap:12px;align-items:center}.privacy-pill{font-size:12px;border:1px solid #dbe8df;border-radius:25px;padding:7px 12px;color:var(--green);background:#f0f8f0}.live-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#3f9d7e;margin-right:5px}.icon-button,.date-arrow{border:1px solid var(--line);background:white;border-radius:13px;color:var(--ink)}.icon-button{width:39px;height:39px;font-size:22px}.page{display:none}.page.active{display:block;animation:rise .22s ease-out}@keyframes rise{from{opacity:.65;transform:translateY(5px)}to{opacity:1;transform:none}}.datebar{display:flex;align-items:center;justify-content:space-between;margin:29px auto 15px;max-width:440px}.date-arrow{height:36px;width:36px;font-size:25px;line-height:1}.date-center{text-align:center}.eyebrow{font-size:10px;font-weight:800;letter-spacing:1.8px;color:var(--green2)}.date-button{border:0;background:transparent;font-size:19px;font-weight:750;color:var(--ink);padding:7px 5px;letter-spacing:-.5px}.date-button span{color:var(--muted);font-size:14px}.visually-hidden{position:absolute;opacity:0;pointer-events:none;width:1px;height:1px}.day-tags{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin:0 0 23px}.day-tag{background:#fff;border:1px solid var(--line);color:#526b60;border-radius:22px;padding:8px 13px;font-size:12px;font-weight:700}.day-tag.active{background:var(--green);color:white;border-color:var(--green)}.day-tag.night.active{background:#303d5b}.hero-card{border-radius:24px;padding:29px 34px;background:linear-gradient(115deg,#eaf4e9,#f1f6ee 75%);display:flex;justify-content:space-between;align-items:center;gap:20px;min-height:228px}.hero-number{display:flex;align-items:baseline;gap:9px;margin:14px 0 1px}.hero-number>span:first-child{font-size:55px;font-weight:800;letter-spacing:-2.8px;line-height:1}.hero-unit{font-size:17px;font-weight:700}.hero-copy p{color:#658176;font-size:14px;margin:8px 0 18px}.hero-left{font-size:12px;background:#d8ebdc;border-radius:8px;padding:8px 11px;font-weight:700;color:var(--green)}.ring{width:152px;height:152px;border-radius:50%;background:conic-gradient(var(--green2) var(--progress),#d3e6d7 0);display:grid;place-items:center;flex-shrink:0}.ring-inner{height:124px;width:124px;background:#edf5ec;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center}.ring-inner span{font-size:30px;font-weight:800;letter-spacing:-1px}.ring-inner small{font-size:11px;color:var(--muted)}.macro-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:16px 0}.macro-card,.hydration-card,.entry-card,.history-chart-card,.settings-card{background:var(--card);border:1px solid #ebeeea;border-radius:20px;box-shadow:var(--shadow)}.macro-card{padding:19px 18px 16px}.macro-head{display:flex;align-items:center;gap:9px;color:#5b6d65;font-size:12px;font-weight:700}.macro-icon{width:26px;height:26px;display:grid;place-items:center;border-radius:9px;font-size:16px}.macro-icon.protein{background:#e2f3eb;color:#3e9a78}.macro-icon.carbs{background:#fff0e2;color:#df9559}.macro-icon.fat{background:#eeecf9;color:#9b89ca}.macro-value{margin:15px 0 11px}.macro-value strong{font-size:29px;letter-spacing:-1px}.macro-value small{font-size:13px;color:var(--muted)}.progress,.hydration-progress{background:#eff1ed;height:7px;border-radius:9px;overflow:hidden}.progress-fill{height:100%;width:0;border-radius:9px;transition:width .25s}.protein-fill{background:#49a886}.carbs-fill{background:#ecae74}.fat-fill{background:#9e91c6}.macro-card p{margin:9px 0 0;font-size:11px;color:var(--muted)}.hydration-card{padding:22px 23px 20px;margin:0 0 19px}.hydration-main{display:flex;align-items:center;gap:15px}.hydration-symbol{height:46px;width:46px;display:grid;place-items:center;border-radius:15px;background:#e5f1fa;color:#468bb3;font-size:29px}.hydration-label{font-size:13px;font-weight:750}.hydration-value{margin:5px 0 0}.hydration-value strong{font-size:28px;letter-spacing:-1px}.hydration-value span{font-size:14px;color:#74867d}.hydration-main p{font-size:11px;color:var(--muted);margin:4px 0 0}.hydration-progress{margin:19px 0 8px;height:8px;background:#eaf1f6}.hydration-progress>div{height:100%;width:0;background:#5a9cc4;border-radius:10px;transition:width .25s}.hydration-bottom{display:flex;justify-content:space-between;font-size:11px;color:var(--muted)}.quick-drinks{display:flex;gap:8px;flex-wrap:wrap;margin-top:19px}.quick-drinks button{background:#f0f6f8;color:#367ca0;border:1px solid #e4eef1;border-radius:11px;padding:10px 12px;font-size:12px;font-weight:750}.quick-drinks button:hover{background:#deeff6}.entry-card{padding:24px;margin-bottom:17px}.section-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px}.section-title h2{font-size:20px;letter-spacing:-.6px;margin:6px 0 0}.ai-status{font-size:11px;background:#edf7ef;border-radius:9px;padding:8px 10px;color:var(--green);font-weight:700;white-space:nowrap}.meal-selector{display:flex;gap:7px;margin:0 0 14px;flex-wrap:wrap}.meal-selector button{border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 13px;font-size:12px;font-weight:700;color:#6c7d75}.meal-selector button.selected{background:var(--green);color:white;border-color:var(--green)}.composer{border:1px solid #dce4dc;border-radius:15px;overflow:hidden;background:#fff}.composer textarea{display:block;width:100%;min-height:76px;resize:vertical;border:0;outline:0;padding:16px 17px;font-size:15px;color:var(--ink);line-height:1.5}.composer textarea::placeholder{color:#9aa7a0}.composer-tools{display:flex;justify-content:space-between;align-items:center;padding:9px 10px;border-top:1px solid #edf0ec}.composer-tools>div{display:flex;gap:5px}.tool-button{border:0;background:transparent;padding:9px 10px;font-size:13px;color:#63796e;font-weight:700}.primary-button{background:var(--green);border:1px solid var(--green);color:white;border-radius:11px;padding:11px 16px;font-size:13px;font-weight:750;white-space:nowrap}.primary-button:hover{background:#0c4d3e}.helper-text{font-size:11px;line-height:1.55;color:#87958c;margin:12px 0 0}.favorite-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:14px}.favorite-button{border:1px solid #e6ebe4;border-radius:10px;background:#f9faf7;color:#557568;padding:10px 13px;font-size:12px;font-weight:700}
.review-panel{background:#f0f7ee;border:1px solid #d8e8d9;padding:18px;border-radius:18px;margin:0 0 18px}.hidden{display:none!important}.review-title{font-size:17px;font-weight:800;margin:0 0 8px}.review-item{background:white;border:1px solid #e3eae2;padding:12px;border-radius:12px;margin:9px 0}.review-row{display:grid;grid-template-columns:1.6fr .55fr .65fr .65fr .65fr .65fr;gap:6px;align-items:end}.review-item label{font-size:10px;color:var(--muted);display:block}.review-item input{width:100%;padding:8px;border:1px solid var(--line);border-radius:8px;margin-top:4px;font-size:13px}.review-item .review-hint{font-size:11px;color:var(--muted);margin-top:7px}.review-buttons{display:flex;justify-content:flex-end;gap:10px;margin-top:13px}.timeline-section{margin:25px 0}.count-chip{background:#eaf0e9;color:#6c7d70;padding:8px 11px;border-radius:15px;font-size:11px;font-weight:700}.timeline{display:grid;gap:10px}.empty-state{padding:35px 20px;text-align:center;background:#fff;border:1px dashed #dce5dc;border-radius:17px;color:#7a8c80}.empty-state strong{display:block;color:var(--ink);margin-bottom:7px}.entry-row{display:flex;align-items:center;gap:12px;padding:14px 15px;border:1px solid var(--line);border-radius:14px;background:#fff}.entry-emoji{width:41px;height:41px;background:#f1f5ee;border-radius:13px;display:grid;place-items:center;font-size:22px;flex-shrink:0}.entry-detail{min-width:0;flex:1}.entry-detail strong{font-size:13px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entry-detail span{font-size:11px;color:var(--muted);display:block;margin-top:5px}.entry-kcal{text-align:right;white-space:nowrap}.entry-kcal strong{display:block;font-size:14px}.entry-kcal span{display:block;color:var(--muted);font-size:10px;margin-top:4px}.edit-entry{border:0;background:transparent;color:#9caaa1;font-size:20px;padding:5px}.historic-banner{background:#fff6e8;border:1px solid #f4e4c7;border-radius:12px;padding:14px;color:#9d6b2b;font-size:12px;margin:14px 0}.page-heading{padding:35px 0 22px}.page-heading h1{font-size:32px;letter-spacing:-1.2px;margin:7px 0}.page-heading p{margin:0;color:var(--muted);font-size:14px}.history-toolbar{display:flex;justify-content:space-between;align-items:center;margin:0 0 17px}.history-toolbar label{font-size:13px;font-weight:700}.history-toolbar select{border:1px solid var(--line);border-radius:10px;padding:10px;background:white}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:11px;margin-bottom:15px}.stat-box{background:white;border:1px solid var(--line);border-radius:15px;padding:17px}.stat-box small{color:var(--muted);display:block;font-size:11px}.stat-box strong{font-size:24px;display:block;margin:9px 0 2px}.stat-box span{font-size:10px;color:var(--muted)}.history-chart-card{padding:20px;margin-bottom:15px}.history-chart{min-height:190px;display:flex;align-items:flex-end;gap:7px;overflow-x:auto;padding:15px 0 3px}.chart-col{flex:1;min-width:22px;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:180px;gap:6px}.chart-bar-wrap{width:100%;height:140px;display:flex;align-items:flex-end;justify-content:center}.chart-bar{width:min(100%,31px);background:#b3d7c4;border-radius:6px 6px 2px 2px;min-height:2px}.chart-col.current .chart-bar{background:var(--green2)}.chart-col small{font-size:10px;color:var(--muted)}.chart-col em{font-size:9px;font-style:normal;color:#5e786b}.chart-legend{display:flex;gap:20px;font-size:11px;color:var(--muted)}.mini-chart{min-height:120px}.mini-chart .chart-col{height:115px}.mini-chart .chart-bar-wrap{height:80px}.chart-bar.fluid{background:#8dc2e0}.history-day{display:flex;justify-content:space-between;align-items:center;padding:13px 4px;border-bottom:1px solid var(--line);gap:10px}.history-day button{background:transparent;border:0;text-align:left;color:var(--ink);font-weight:700}.history-day small{color:var(--muted);display:block;font-size:11px;margin-top:4px}.history-day strong{font-size:13px}.outline-button{background:white;color:var(--green);border:1px solid #cfdfd2;border-radius:11px;padding:11px 15px;font-weight:750;font-size:12px}.full{width:100%;margin-top:17px}.products-search{display:flex;gap:10px;margin-bottom:17px}.products-search input{flex:1;min-width:0;border:1px solid var(--line);border-radius:12px;padding:13px;background:white}.product-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.product-card{display:flex;justify-content:space-between;align-items:center;gap:10px;background:white;border:1px solid var(--line);border-radius:15px;padding:16px}.product-card strong{display:block;font-size:14px}.product-card span{display:block;color:var(--muted);font-size:11px;margin-top:5px}.product-card button{border:0;background:#eaf4eb;border-radius:10px;color:var(--green);font-size:22px;height:36px;width:36px;flex-shrink:0}.settings-card{padding:24px;margin:0 0 17px}.settings-card h2{font-size:18px;letter-spacing:-.4px;margin:0 0 9px}.muted{font-size:13px;color:var(--muted);line-height:1.65;margin:0 0 15px}.optional{font-size:10px;color:#6d917f;background:#eaf5ec;border-radius:7px;padding:5px}.settings-card label{display:block;font-size:12px;font-weight:700;margin:15px 0 0}.settings-card input{display:block;width:100%;border:1px solid var(--line);border-radius:10px;padding:11px;margin-top:7px}.settings-target-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;margin-bottom:19px}.target-group{background:#f8faf6;border:1px solid var(--line);border-radius:12px;padding:14px}.target-group h3{font-size:13px;margin:0 0 10px}.target-fields{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.target-fields label{font-size:10px;margin:0}.target-fields input{font-size:12px;padding:8px}.button-row{display:flex;gap:9px;margin-top:16px}.button-row.wrap{flex-wrap:wrap}.privacy-note{font-size:11px;line-height:1.6;color:#7c8c82;margin-top:15px}.settings-card.subtle{background:#f3f6f1}.bottom-nav{position:fixed;bottom:0;left:0;right:0;height:calc(72px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);display:flex;justify-content:center;background:rgba(255,255,255,.96);backdrop-filter:blur(14px);border-top:1px solid #e7ece7;z-index:20}.nav-item{border:0;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:105px;color:#94a399;font-size:10px;font-weight:700}.nav-icon{font-size:23px;line-height:1}.nav-item.active{color:var(--green)}dialog{width:min(540px,calc(100% - 26px));border:1px solid #e2e9df;border-radius:19px;box-shadow:0 18px 70px #143a2c3b;padding:22px;max-height:88vh;overflow:auto}dialog::backdrop{background:#152c24a8}dialog h2{margin:0 0 10px}dialog p{font-size:13px;color:var(--muted);line-height:1.5}dialog label{display:block;font-size:12px;font-weight:700;margin:11px 0}dialog input,dialog select{display:block;width:100%;padding:11px;border:1px solid var(--line);border-radius:9px;margin-top:5px}dialog .form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px}dialog .form-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:18px}.toast{position:fixed;left:50%;bottom:calc(90px + env(safe-area-inset-bottom));transform:translateX(-50%) translateY(30px);opacity:0;pointer-events:none;background:#1d4b3c;color:white;border-radius:12px;padding:12px 17px;box-shadow:0 10px 30px #143a2c30;font-size:12px;z-index:40;transition:.2s;max-width:90%;text-align:center}.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
@media(max-width:640px){.app-shell{padding:0 15px 108px}.topbar{height:75px}.brand-icon{width:38px;height:38px;border-radius:12px;font-size:25px}.brand strong{font-size:24px}.privacy-pill{font-size:10px;padding:6px 9px}.datebar{margin-top:22px}.hero-card{padding:22px;min-height:196px;border-radius:20px}.hero-number>span:first-child{font-size:43px}.hero-unit{font-size:14px}.ring{width:118px;height:118px}.ring-inner{width:96px;height:96px}.ring-inner span{font-size:25px}.macro-grid{gap:8px}.macro-card{padding:13px 11px}.macro-head{gap:5px;font-size:10px}.macro-icon{height:22px;width:22px;font-size:12px}.macro-value{margin:12px 0 10px}.macro-value strong{font-size:23px}.macro-value small{font-size:10px}.macro-card p{font-size:10px}.hydration-card,.entry-card{padding:18px}.quick-drinks{gap:6px}.quick-drinks button{padding:10px 9px;font-size:11px}.section-title h2{font-size:19px}.review-row{grid-template-columns:repeat(5,minmax(0,1fr))}.review-row label:first-child{grid-column:span 5}.review-item input{font-size:12px}.stats-grid{grid-template-columns:repeat(2,1fr)}.product-list{grid-template-columns:1fr}.settings-target-grid{grid-template-columns:1fr}.nav-item{min-width:0;flex:1}.date-button{font-size:17px}}@media(max-width:360px){.hero-card{padding:18px}.hero-number>span:first-child{font-size:37px}.ring{width:105px;height:105px}.ring-inner{width:85px;height:85px}.macro-head span:last-child{font-size:9px}.quick-drinks button{font-size:10px}.tool-button span{display:none}}
.product-actions{display:flex;gap:5px}.product-actions button{font-size:19px}
.context-note{max-width:680px;margin:-9px auto 18px;border:1px solid #e2e8d7;background:#f0f5e9;border-radius:12px;padding:12px 15px;font-size:12px;line-height:1.5;color:#617a62;white-space:pre-wrap}

/* v0.2: comfortable touch targets, readable forms and safe areas. */
button,input,select,textarea{-webkit-tap-highlight-color:transparent}
button{touch-action:manipulation;min-height:44px}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #247f69;outline-offset:3px}
.favorite-actions{flex-wrap:wrap;gap:8px}.favorite-row{display:flex;gap:8px;margin-top:8px}.favorite-row>.favorite-button{flex:1;text-align:left;overflow-wrap:anywhere}
.entry-detail{min-width:0;overflow-wrap:anywhere}.entry-detail span{line-height:1.6}.entry-kcal{flex-shrink:0}.edit-entry{min-width:44px}
.history-chart{overflow-x:auto;justify-content:flex-start}.chart-col{min-width:32px;flex:1}.history-day button{text-align:left;min-width:0;overflow-wrap:anywhere}.history-day strong{white-space:nowrap}
.review-row input{min-width:0;width:100%}.review-buttons,.form-actions{flex-wrap:wrap}.review-buttons button{flex:1}
@media(max-width:640px){input,select,textarea,dialog input,dialog select,.review-item input,.target-fields input{font-size:16px!important}.app-shell{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right));padding-bottom:calc(100px + env(safe-area-inset-bottom))}.review-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.review-row label:first-child{grid-column:1/-1}.meal-selector{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.quick-drinks{display:flex;flex-wrap:wrap}.quick-drinks button{flex:1 1 28%;font-size:13px}.composer-tools{flex-wrap:wrap;gap:8px}.composer-tools>.primary-button{flex:1}.entry-row{gap:8px}.entry-emoji{width:30px;flex-shrink:0}.entry-kcal strong{font-size:13px}.entry-detail strong{font-size:14px}.history-day{gap:10px}.date-button{white-space:normal}dialog{max-height:85dvh}.macro-value{display:flex;flex-wrap:wrap;gap:3px}.hydration-bottom{flex-wrap:wrap;gap:6px}}
@media(min-width:768px) and (max-width:1100px){.app-shell{max-width:900px;padding-left:28px;padding-right:28px}.review-row{grid-template-columns:repeat(3,minmax(0,1fr))}.review-row label:first-child{grid-column:1/-1}.favorite-actions button{flex:1}.bottom-nav .nav-item{min-width:140px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
@media(pointer:coarse){input,select,textarea,dialog input,dialog select,.review-item input,.target-fields input{font-size:16px!important}}
.entry-detail strong{white-space:normal;overflow-wrap:anywhere}.history-toolbar{flex-wrap:wrap}

/* v0.3: maaltijdtemplates en controlelijst */
.my-meals{margin-top:24px;border-top:1px solid var(--line);padding-top:20px}.my-meals h2{margin:0 0 8px}.template-list{display:grid;gap:12px;margin-top:14px}.template-card{padding:16px;background:#fff;border:1px solid var(--line);border-radius:14px;min-width:0}.template-card h3{margin:0 0 8px;overflow-wrap:anywhere}.template-card p{font-size:13px;line-height:1.6;overflow-wrap:anywhere}.template-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.template-actions button{flex:1;font-size:13px}.template-review-heading{margin-bottom:16px}.template-review-heading input{display:block;width:100%;padding:12px;margin-top:6px;border:1px solid var(--line);border-radius:8px;font-size:16px}.template-add-ingredient{display:grid;gap:8px;margin-top:16px}.template-add-ingredient select{width:100%;min-width:0;min-height:44px;border:1px solid var(--line);border-radius:8px;padding:10px;font-size:16px}.review-totals{font-weight:700;line-height:1.7;background:#fff;padding:12px;border-radius:10px}#mealFeedback{line-height:1.7;margin-top:14px}#mealFeedback:empty{display:none}
@media(min-width:768px){.template-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
