*{box-sizing:border-box}body{margin:0;background:#f6f5ef;color:#203c32;font-family:system-ui,-apple-system,sans-serif}main{max-width:850px;margin:auto;padding:30px 24px 50px}header,.toolbar,.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.brand{font-size:23px;font-weight:750;color:inherit;text-decoration:none}.badge,.eyebrow{font-size:10px;letter-spacing:1.8px;font-weight:700}.badge{color:#758379}.intro{padding:44px 0 24px}.intro h1{font-size:clamp(32px,5vw,46px);letter-spacing:-1.5px;margin:8px 0}.intro p{color:#6d7d73}.toolbar{justify-content:flex-start;margin-bottom:18px}.toolbar label{display:flex;align-items:center;gap:10px}.toolbar input{width:155px}.summary{background:#173e32;color:#fff;border-radius:24px;padding:28px;display:grid;grid-template-columns:1fr auto;gap:20px}.summary h2{font-size:52px;letter-spacing:-2px;margin:6px 0}.summary small{font-size:14px;font-weight:400;letter-spacing:0}.summary p{margin:4px 0;color:#bbd2c6}.ring{width:115px;height:115px;border:8px solid #a5c982;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-direction:column}.ring span{font-size:24px;font-weight:700}.ring small{font-size:11px}progress{grid-column:1/-1;width:100%;height:8px;accent-color:#b7d593}.macros{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr);gap:10px;border-top:1px solid #486153;padding-top:20px}.macros div{font-size:11px;color:#bdd0c5}.macros span{display:block;color:white;font-size:21px;margin-bottom:4px}.section-head{margin:30px 0 18px}h2{font-size:22px;margin:5px 0}button,.photo,.import{border:0;border-radius:12px;background:#234f3d;color:#fff;padding:13px 17px;font-size:14px;font-weight:600;cursor:pointer}button:hover{filter:brightness(1.12)}button:disabled{opacity:.55;cursor:wait}.quiet{background:#e8ece4;color:#254f3d}.secondary{background:#e1ebdc;color:#254f3d;width:100%}.meal{display:flex;justify-content:space-between;gap:15px;background:#fff;border:1px solid #e4e8df;border-radius:16px;padding:18px;margin-bottom:10px}.meal h3{font-size:16px;margin:5px 0}.meal p,.hint{font-size:12px;color:#758277;line-height:1.6}.meal .actions{text-align:right;min-width:105px}.meal .actions button{font-size:11px;padding:7px;margin:6px 2px}.empty{border:1px dashed #cdd6c9;border-radius:18px;padding:35px;text-align:center;color:#748070}.history{margin-top:32px}.history-row{display:flex;justify-content:space-between;padding:13px 0;border-bottom:1px solid #dde4d8}.history-row button{padding:0;background:none;color:#36523e}.history-row span{font-size:13px}footer{margin-top:28px;color:#788477;font-size:12px;line-height:1.6}footer button,.import{display:inline-block;font-size:12px;margin:5px}dialog{border:0;border-radius:22px;padding:24px;width:min(94vw,480px);max-height:90dvh;color:#203c32}dialog::backdrop{background:#10281db3}dialog .section-head{margin:0 0 20px}form>label{display:block;margin:14px 0}input,select,textarea{font:inherit;color:inherit;border:1px solid #cfd7cc;border-radius:10px;padding:12px;background:#fcfdfb;width:100%;margin-top:6px}textarea{min-height:85px;resize:vertical}label{font-size:13px;font-weight:600}.fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.photo{display:inline-block;background:#ecf0e7;color:#35513e}#preview{width:100%;max-height:210px;object-fit:contain;border-radius:12px}#notice{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#173e32;color:white;padding:14px 20px;border-radius:12px;max-width:90%;display:none;z-index:10}:focus-visible{outline:3px solid #97ae61;outline-offset:3px}@media(max-width:500px){main{padding:22px 18px 40px}.badge{display:none}.summary{padding:23px;gap:15px}.summary h2{font-size:43px}.ring{width:95px;height:95px}.intro{padding-top:32px}.toolbar{flex-wrap:wrap}.meal{padding:15px}.macros span{font-size:19px}}@media(prefers-reduced-motion:no-preference){dialog[open]{animation:appear .15s ease-out}@keyframes appear{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}}
/* Compact daily workflow and device themes. */
:root{color-scheme:light;--page:#f4f5ef;--surface:#fff;--ink:#1b3c31;--muted:#687d70;--line:#dce5d9;--soft:#e8eee2;--accent:#173e32;--lime:#d9edae}
:root[data-theme=dark]{color-scheme:dark;--page:#101b17;--surface:#1b2a23;--ink:#e3efe5;--muted:#a1b7a7;--line:#35473b;--soft:#293e30;--accent:#b7d493;--lime:#bddf95}
body{background:var(--page);color:var(--ink)}main{max-width:880px;padding-bottom:calc(38px + env(safe-area-inset-bottom))}header{padding-bottom:16px;border-bottom:1px solid var(--line)}.brand{letter-spacing:-.7px}.badge{background:var(--soft);border-radius:30px;padding:8px 10px;color:var(--muted);font-size:9px}.badge.offline{background:#f3dfaf;color:#6d4b00}.intro{padding:26px 0 16px}.intro h1{font-size:clamp(29px,4.5vw,38px);letter-spacing:-1.3px}.intro p{margin:6px 0;color:var(--muted)}.view-tabs{display:flex;gap:5px;background:var(--soft);border-radius:14px;padding:4px;margin-bottom:16px}.view-tabs button{flex:1;background:transparent;color:var(--muted);min-height:44px}.view-tabs .active{background:var(--surface);color:var(--ink);box-shadow:0 2px 5px #0000000d}.toolbar{gap:8px}.toolbar label{flex:1}.toolbar input{width:100%;max-width:175px;font-size:15px;margin:0}.toolbar .quiet{padding:10px 12px;min-width:44px;min-height:44px}.summary{box-shadow:0 12px 30px #173e3214;background:#173e32}.ring{border-width:6px}.summary h2{font-variant-numeric:tabular-nums}.macros span{font-variant-numeric:tabular-nums}.section-head{margin:24px 0 12px}.meals-heading h2{font-size:25px}.meals-heading .eyebrow{margin:0 0 5px}.quick-section{margin-top:24px}.quick-section h2{font-size:16px}.quick-section .hint{margin:4px 0 10px}#quick-meals{display:flex;gap:8px;overflow-x:auto;padding-bottom:6px;scrollbar-width:thin}.quick-meal{flex-shrink:0;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:25px;padding:11px 15px}.search-label{display:block;color:var(--muted);font-size:11px;margin-bottom:12px}.search-label input{font-size:14px;padding:10px 13px;margin-top:5px}.meal{background:var(--surface);border-color:var(--line);border-radius:18px}.meal small{color:var(--muted);font-size:11px;letter-spacing:.3px}.meal p{margin:6px 0;color:var(--muted)}.meal .actions{max-width:155px;min-width:130px}.meal .actions strong{font-size:19px;letter-spacing:-.5px}.meal .actions button{background:var(--soft);color:var(--ink);min-height:35px;margin-top:8px}.empty{background:var(--surface);border-color:var(--line);color:var(--muted)}.history{border-top:1px solid var(--line);padding-top:8px}.history .section-head select{width:110px;margin:0;font-size:13px}.history-row{display:grid;grid-template-columns:90px 1fr 85px;align-items:center;gap:16px;border-color:var(--line)}.history-row progress{grid-column:auto;height:7px;accent-color:#91b26a}.history-row button{color:var(--ink);text-align:left;min-height:34px;font-size:12px}.history-row span{text-align:right;font-variant-numeric:tabular-nums}footer{color:var(--muted)}.quiet,.import{background:var(--soft);color:var(--ink)}.hint{color:var(--muted)}dialog{background:var(--surface);color:var(--ink);padding:24px;border:1px solid var(--line);max-height:calc(100dvh - 32px);overscroll-behavior:contain}dialog .section-head{position:sticky;top:-24px;background:var(--surface);padding:12px 0;z-index:1;border-bottom:1px solid var(--line)}input,select,textarea{background:var(--page);color:var(--ink);border-color:var(--line);font-size:16px}textarea{min-height:94px;line-height:1.5}.photo-actions{display:flex;gap:8px;align-items:center;margin:12px 0}.photo{margin:0;display:inline-flex;align-items:center;min-height:44px;background:var(--soft);color:var(--ink)}.secondary{background:var(--soft);color:var(--ink);min-height:48px}#analysis-note:not(:empty){padding:12px 14px;background:var(--soft);color:var(--ink);border-radius:12px;font-size:13px}#meal-form>button[type=submit]{width:100%;margin-top:8px;min-height:48px}#notice{align-items:center;gap:14px;width:max-content;max-width:92vw;box-shadow:0 8px 28px #0003}#notice-message{flex:1}#undo{flex-shrink:0;padding:9px 11px}body[data-view=history] .summary,body[data-view=history] .quick-section,body[data-view=history] .meals-heading,body[data-view=history] .search-label,body[data-view=history] #meals{display:none}body:not([data-view=history]) .history{display:none}[hidden]{display:none!important}
@media(max-width:500px){main{padding:18px 16px calc(30px + env(safe-area-inset-bottom))}.badge{display:block;font-size:8px;letter-spacing:1px}.intro{padding-top:21px}.toolbar{flex-wrap:nowrap;gap:5px}.toolbar .quiet{padding:8px;min-width:37px;font-size:12px}.toolbar label{font-size:0}.toolbar input{font-size:13px;width:125px;max-width:100%;padding:9px 7px}.summary{padding:23px 21px;border-radius:23px}.summary h2{font-size:47px}.summary .eyebrow{font-size:9px}.ring{width:90px;height:90px}.macros div{font-size:10px}.meal{gap:10px}.meal .actions{min-width:116px;max-width:135px}.meal h3{font-size:15px;line-height:1.4}.meal .actions button{font-size:10px;padding:7px}.history-row{gap:10px;grid-template-columns:80px 1fr 75px}dialog{width:100%;max-width:none;max-height:94dvh;margin:auto 0 0;border-radius:24px 24px 0 0;padding:24px 20px calc(24px + env(safe-area-inset-bottom))}.fields{gap:12px}.fields label{font-size:12px}}

.food-library{margin:24px 0}.saved-food{display:flex;gap:8px;align-items:center;margin:8px 0}.saved-food .quick-meal{flex:1;text-align:left}.save-food{display:flex;align-items:center;gap:10px}.save-food input{width:auto}

/* Bright, clear NutriTrack palette. */
:root{--page:#f2f7ff;--surface:#ffffff;--ink:#142c52;--muted:#536c8d;--line:#dbe7f7;--soft:#e7f0ff;--accent:#2463eb;--lime:#7cf1da;color-scheme:light}
:root[data-theme=dark]{--page:#0b1429;--surface:#142440;--ink:#edf5ff;--muted:#a9bfdc;--line:#2a4164;--soft:#20385b;--accent:#75a7ff;--lime:#7cf1da;color-scheme:dark}
body{background:radial-gradient(ellipse at 90% 0%,#64baff18,transparent 45%),var(--page)}
.brand{color:var(--accent);font-weight:800}.intro .eyebrow{color:var(--accent)}.intro h1{font-weight:800;letter-spacing:-1.4px}.intro>p:last-child{font-size:15px}
.summary{position:relative;overflow:hidden;background:linear-gradient(125deg,#2463eb 0%,#217fe8 55%,#0c9cb1 100%);box-shadow:0 14px 34px #2463eb26;border:1px solid #ffffff35}.summary p{color:#e0f0ff}.summary h2{color:white}.ring{border-color:#7cf1da;background:#ffffff12;box-shadow:0 0 0 7px #ffffff0a}.summary progress{accent-color:#7cf1da}.macros{border-color:#ffffff40}.macros div{color:#deefff;background:#ffffff10;padding:10px 12px;border-radius:13px}.macros span{color:white;font-weight:750}.macros div:nth-child(1){border-top:3px solid #7cf1da}.macros div:nth-child(2){border-top:3px solid #ffdb86}.macros div:nth-child(3){border-top:3px solid #ffb4cc}
button{background:#2463eb;color:white;transition:background .15s,box-shadow .15s}.quiet,.import{background:var(--soft);color:var(--ink)}.view-tabs{border:1px solid var(--line)}.view-tabs .active{background:#2463eb;color:#fff;box-shadow:0 3px 10px #2463eb26}.secondary{background:linear-gradient(115deg,#2463eb,#0c91b4);color:#fff}.photo{background:var(--soft);color:var(--ink)}
.meal{box-shadow:0 3px 14px #18396906}.meal .actions strong{color:var(--accent)}.meal small{display:inline-block;background:var(--soft);color:var(--accent);padding:4px 8px;border-radius:7px;font-weight:650}.meal .actions button{border:1px solid var(--line)}
.food-library{padding:20px;background:var(--surface);border:1px solid var(--line);border-radius:21px;border-top:4px solid #23c6ae}.food-library h2{font-size:20px}.food-library>p{margin:5px 0 12px}.food-library #food-library>p{font-size:13px;color:var(--muted);line-height:1.6;margin-bottom:0}.saved-food .quick-meal{max-width:none;min-width:0;background:var(--soft);border-color:transparent;border-radius:12px;white-space:normal;line-height:1.4}.quick-meal{border-color:var(--line);box-shadow:0 2px 7px #18396905}.history-row progress{accent-color:#3983ff}#notice{background:#2059ca}dialog::backdrop{background:#071735b8;backdrop-filter:blur(4px)}:focus-visible{outline-color:#4198ff}input:focus,textarea:focus,select:focus{border-color:#4198ff}#analysis-note:not(:empty){border-left:3px solid #23c6ae}.badge{color:var(--accent)}
body[data-view=history] .food-library{display:none}
@media(max-width:500px){.macros div{padding:9px 8px}.food-library{padding:16px}.summary{box-shadow:0 10px 25px #2463eb22}.intro h1{font-size:34px}}
@media(prefers-reduced-motion:reduce){button{transition:none}dialog::backdrop{backdrop-filter:none}}

.feature-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.feature-actions button{flex:1;min-height:44px}.ingredient-row{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);font-size:13px}.ingredient-row button{padding:8px;font-size:12px}.insight{padding:14px;background:var(--soft);border-radius:12px;font-size:13px;line-height:1.6}.weight-section{margin-top:24px}.weight-section summary,.food-picker summary{cursor:pointer;font-size:14px;font-weight:650;min-height:44px;padding:12px;background:var(--soft);border-radius:10px}.weight-section form{display:flex;flex-wrap:wrap;gap:10px;align-items:end}.weight-section form label{flex:1;min-width:110px}#food-pick-results{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}#barcode-camera{width:100%;max-height:250px;border-radius:12px}#account label,#privacy label{display:block;margin:14px 0}#account button{margin:5px 0}#account-open{padding:9px 12px;font-size:12px;margin-left:auto}dialog p{font-size:13px;line-height:1.65}header{gap:8px}#sync-conflict{background:var(--soft);padding:14px;border-radius:12px}#food-library{max-height:340px;overflow:auto}.food-library label{font-size:12px}.photo-actions .photo{flex:1;justify-content:center}

/* Keep native modal hit testing stable on Safari, including standalone iPhone. */
dialog[open]{animation:none;transform:none;overflow-y:auto;-webkit-overflow-scrolling:touch}dialog::backdrop{backdrop-filter:none;-webkit-backdrop-filter:none}#account-actions{display:flex;flex-direction:column;gap:8px}#account-actions>button{width:100%;margin:0;text-align:left}#account-dismiss{flex-shrink:0;min-width:44px;min-height:44px}#account-close{width:100%;min-height:48px;margin-top:16px!important}#sync-status{min-height:42px;overflow-wrap:anywhere}

.migration-help{margin-top:18px;padding:14px;background:var(--soft);border-radius:12px}.migration-help summary{cursor:pointer;font-weight:650;font-size:14px}.migration-help a{color:var(--accent);font-weight:650}

#barcode-result:not(:empty){padding:12px;background:var(--soft);border-left:3px solid var(--accent);border-radius:10px;color:var(--ink)}#barcode-camera{margin-top:12px;min-height:180px;object-fit:contain;background:#071735}

.nutrition-panel{margin-top:20px;padding:22px;border:1px solid var(--line);border-radius:24px;background:var(--surface)}.nutrition-panel .section-head{margin:0 0 14px}.macro-goals{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.macro-goal{padding:14px;background:var(--soft);border-radius:16px;min-width:0}.macro-goal h3{font-size:13px;margin:0 0 12px}.macro-goal strong{display:block;font-size:20px;font-variant-numeric:tabular-nums}.macro-goal progress{height:9px;margin:12px 0;accent-color:#20c7b0}.macro-f progress{accent-color:#f7b957}.macro-c progress{accent-color:#5794ff}.macro-goal small{display:block;font-size:11px;line-height:1.5;color:var(--muted)}#nutrition-profile label{display:block;margin:16px 0}#profile-weight{font-size:38px;text-align:center;font-weight:750;padding:16px;font-variant-numeric:tabular-nums}#profile-weight-slider{accent-color:var(--accent);padding:0;height:36px;border:0;background:none}#profile-step-progress{accent-color:var(--accent);height:7px}.target-fields{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.target-fields input{font-size:20px;font-weight:700}#profile-error{color:#de8059}#recipe-feedback:empty{display:none}.nutrition-panel,.food-library,.meal,.summary,.quiet{position:relative}.surface-lit{background-image:radial-gradient(160px circle at var(--light-x) var(--light-y),#67b5ff25,transparent 75%)}header{margin-bottom:20px}body[data-view=history] .nutrition-panel{display:none}@media(max-width:500px){.nutrition-panel{padding:18px}.macro-goals{gap:7px}.macro-goal{padding:12px 9px}.macro-goal strong{font-size:16px}.macro-goal h3{font-size:11px}.target-fields{grid-template-columns:1fr}.target-fields label{margin:6px 0!important}}@media(prefers-reduced-motion:no-preference){button{transition:background-color .18s,box-shadow .18s,filter .18s}button:active{filter:brightness(.92)}.wizard-step:not([hidden]){animation:step-reveal .24s ease-out}.macro-goal{animation:step-reveal .3s ease-out}.macro-goal:nth-child(2){animation-delay:.04s}.macro-goal:nth-child(3){animation-delay:.08s}@keyframes step-reveal{from{opacity:0;translate:0 7px}to{opacity:1;translate:0 0}}}@media(prefers-reduced-motion:reduce){.surface-lit{background-image:none}.wizard-step,.macro-goal{animation:none!important}}

.accessible-progress{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.animated-track{height:10px;width:100%;border-radius:30px;background:#91a7c52b;overflow:hidden;grid-column:1/-1}.animated-fill{display:block;height:100%;width:0;border-radius:inherit;background:linear-gradient(90deg,#3983ff,#67baff);transition:width .85s cubic-bezier(.16,1,.3,1),background .35s;box-shadow:0 0 12px #3983ff45}.animated-track[data-zone=near] .animated-fill{background:linear-gradient(90deg,#e6a126,#ffd16a)}.animated-track[data-zone=reached] .animated-fill{background:linear-gradient(90deg,#0eb38a,#4de3b5)}.animated-track[data-zone=over] .animated-fill{background:linear-gradient(90deg,#ea6c62,#ffa18b)}.macro-goal .animated-track{margin:12px 0}.macro-goal{transition:border-color .3s,background .3s;border:1px solid transparent}.macro-goal[data-zone=near]{border-color:#e6a12655}.macro-goal[data-zone=reached]{border-color:#0eb38a88;background:#0eb38a12}.macro-goal[data-zone=over]{border-color:#ea6c6288;background:#ea6c6212}#nutrition-profile>.animated-track{height:7px;margin:14px 0}html.keyboard-open dialog[open]{position:fixed;top:calc(var(--viewport-top,0px) + 10px);bottom:auto;margin:0 auto;max-height:calc(var(--visual-height,100dvh) - 20px);overflow-y:auto;scroll-padding:20px;border-radius:20px}html.keyboard-open dialog input,html.keyboard-open dialog textarea{scroll-margin:18px}@media(max-width:500px){html.keyboard-open dialog[open]{left:0;right:0;width:100%;padding-bottom:18px}#profile-weight{font-size:32px;padding:12px}#nutrition-profile .section-head h2{font-size:21px;line-height:1.25}}@media(prefers-reduced-motion:reduce){.animated-fill{transition:none}.macro-goal{transition:none}}
