:root{--bg:#faf7f1;--paper:#fffdf8;--ink:#30231f;--muted:#75645a;--line:#e9dfd3;--accent:#a84430;--accent-dark:#913827;--green:#596845;--soft:#fae7dc;--display:"Songti SC","Noto Serif CJK SC",STSong,SimSun,serif;color-scheme:light}
*{box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:24px}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.55 system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif}
button,input{font:inherit}
button{cursor:pointer}
button:disabled{cursor:default;opacity:.5}
button,a,input,summary{-webkit-tap-highlight-color:transparent}
button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid #c88165;outline-offset:3px}
a{color:inherit;text-decoration:none}
svg{width:19px;height:19px;vertical-align:middle}
svg use{fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
[hidden],.symbols{display:none!important}
.top{border-bottom:1px solid var(--line);background:var(--paper)}
.top-inner,.wrap{max-width:1180px;margin:auto;padding:0 30px}
.top-inner{height:76px;display:flex;align-items:center;justify-content:space-between;gap:18px}
.brand{display:flex;align-items:center;gap:11px;font-size:17px;font-weight:750;letter-spacing:.04em;line-height:1.3;white-space:nowrap}
.brand small{display:block;font:700 8px/1.4 system-ui;letter-spacing:.22em;color:var(--muted);margin-top:3px}
.brand-mark{display:grid;place-items:center;width:39px;height:39px;background:var(--accent);color:#fff;border-radius:13px}
.brand-mark svg{width:21px;height:21px}
nav{display:flex;gap:32px;color:var(--muted);font-size:14px}
nav a:hover,nav button:hover,.link-btn:hover{color:var(--accent-dark);text-decoration:underline;text-underline-offset:4px}
.plain,.link-btn{border:0;background:none;color:inherit;padding:0}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid transparent;border-radius:9px;padding:9px 15px;font-weight:650;white-space:nowrap;min-height:42px}
.primary{color:white;background:var(--accent)}
.primary:hover{background:var(--accent-dark)}
.outline,.icon-btn{background:var(--paper);color:var(--accent-dark);border:1px solid var(--line)}
.outline:hover,.icon-btn:hover{background:#f7eee5;border-color:#dbb6a4}
.danger{color:#a13326;background:#fbede7;margin-right:auto}
.wrap{padding-top:28px}
.hero{position:relative;isolation:isolate;min-height:267px;display:flex;align-items:center;overflow:hidden;border:1px solid #ead7c6;border-radius:22px;background:#f7e7d8;background-image:radial-gradient(circle at 77% 23%,#faede0,transparent 60%),radial-gradient(#a9634620 .65px,transparent .8px);background-size:auto,6px 6px}
.hero-copy{padding:31px 43px;z-index:1}
.eyebrow{font-size:10px;line-height:1.3;font-weight:800;letter-spacing:.19em;color:var(--accent-dark);display:block}
.eyebrow span{display:inline-block;width:7px;height:7px;background:#bf6247;border-radius:50%;margin-right:5px}
.eyebrow.muted{color:#89665a}
.hero h1{font:800 clamp(38px,5.2vw,66px)/1.08 var(--display);letter-spacing:.015em;margin:12px 0 12px}
.hero p{margin:0 0 20px;color:#64493d;letter-spacing:.06em}
.mobile-break{display:none}
.hero-art{position:absolute;width:414px;height:auto;right:4%;top:50%;transform:translateY(-50%);z-index:-1}
.hero-index{position:absolute;right:20px;bottom:14px;font-size:10px;color:#824b3b;letter-spacing:.15em}
.datebar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:23px 0 25px;padding-bottom:20px;border-bottom:1px solid var(--line)}
.date-control,.date-pick{display:flex;align-items:center;gap:10px}
.icon-btn{width:36px;height:36px;border-radius:8px;display:inline-grid;place-items:center;padding:0;color:var(--ink);flex-shrink:0}
.icon-btn svg{width:17px;height:17px}
.date-pick{position:relative;font-weight:720;padding:5px 4px;color:var(--ink);white-space:nowrap}
.date-pick svg{color:var(--accent)}
.date-pick input{position:absolute;inset:0;opacity:0;cursor:pointer;padding:0;width:100%;border:0;color:transparent;min-height:0}
.date-pick:focus-within{outline:2px solid var(--accent);border-radius:6px}
.date-pick input::-webkit-calendar-picker-indicator{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}
.today{border:0;background:#f3e6dc;color:#813d2d;border-radius:6px;padding:5px 10px;font-size:12px;font-weight:700;white-space:nowrap}
.saved{color:var(--muted);font-size:12px;white-space:nowrap}
.saved i{display:inline-block;width:6px;height:6px;background:#7b8964;border-radius:50%;margin-right:7px;vertical-align:2px}
.dashboard{display:grid;grid-template-columns:1.2fr 1fr;gap:26px;align-items:start}
.section-title{display:flex;align-items:flex-end;justify-content:space-between;gap:8px;margin-bottom:15px}
h2{font:750 27px/1.25 var(--display);margin:5px 0 0}
.badge{border:1px solid var(--line);color:var(--muted);background:var(--paper);padding:4px 9px;border-radius:20px;font-size:11px;font-weight:600;white-space:nowrap}
.meal-list,.macros{display:grid;gap:10px}
.meal,.macro,.detail-card{background:var(--paper);border:1px solid var(--line);border-radius:13px}
.meal{padding:13px 15px}
.meal-header{display:flex;align-items:center;gap:11px}
.meal-icon{width:43px;height:43px;flex:none;border-radius:12px;display:grid;place-items:center;color:#a45429;background:#f9e7ce}
.meal[data-tone="lunch"] .meal-icon{color:#626d45;background:#e9ecde}
.meal[data-tone="dinner"] .meal-icon{color:#90544e;background:#f4e3df}
.meal-icon svg{width:22px;height:22px}
.meal h3{font-size:16px;margin:0;font-weight:750}
.meal small{font-size:11px;color:var(--muted);display:block}
.meal .add{margin-left:auto;min-height:35px;padding:6px 11px;font-size:12px}
.meal .add svg{width:14px;height:14px}
.entries{display:grid;gap:5px;margin:10px 0 0;padding:0;list-style:none}
.entry{width:100%;display:flex;align-items:center;gap:10px;text-align:left;padding:8px 9px;border:0;border-radius:7px;background:#f8f3eb;color:var(--ink)}
.entry:hover{background:#f4e7dc}
.entry span:first-child{flex:1;overflow-wrap:anywhere}
.entry .entry-kcal{white-space:nowrap;color:var(--muted);font-size:12px}
.entry svg{width:14px;height:14px;color:var(--accent)}
.meal details{margin-top:8px}
.meal summary{cursor:pointer;color:var(--accent-dark);font-size:12px}
.meal-nutrients{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px}
.meal-nutrients span{border-radius:4px;background:#f7efe6;padding:3px 6px;font-size:11px}
.link-btn{display:inline-flex;align-items:center;gap:5px;color:var(--accent-dark);font-size:12px;font-weight:700;white-space:nowrap}
.link-btn svg{width:15px;height:15px}
.energy{display:flex;align-items:center;gap:14px;padding:14px 16px;border:1px solid #efd2c2;border-radius:14px;background:#fae9df;margin-bottom:10px;min-height:115px}
.ring{width:77px;height:77px;flex:none;position:relative;display:grid;place-items:center}
.ring svg{width:100%;height:100%;position:absolute;inset:0;transform:rotate(-90deg)}
.ring b{z-index:1;color:var(--accent-dark);font-size:15px}
.energy .eyebrow{letter-spacing:.11em;font-size:9px}
.energy strong{font-size:31px;line-height:1.1;font-variant-numeric:tabular-nums;display:inline-block;margin:3px 4px 3px 0}
.energy .target{color:#77584a;font-size:12px}
.energy p{color:#784431;font-size:12px;margin:3px 0 0}
.macros{grid-template-columns:repeat(2,minmax(0,1fr))}
.macro{padding:9px 11px}
.macro-head,.nutrient-head{display:flex;align-items:baseline;justify-content:space-between;gap:7px}
.macro-head strong,.nutrient-head strong{font-size:13px;font-variant-numeric:tabular-nums;text-align:right}
.macro-head span,.nutrient-head span{font-size:12px;font-weight:650}
.track{height:4px;margin:6px 0;background:#eee5db;border-radius:10px;overflow:hidden}
.track span{display:block;height:100%;background:var(--green);border-radius:10px}
.track .warm{background:#be694f}
.track .over{background:#a93828}
.macro p,.nutrient p{font-size:11px;color:var(--muted);margin:2px 0 0}
.nutrition{margin-top:30px}
.detail-groups{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;gap:12px}
.detail-card{padding:14px}
.detail-card h3{margin:0 0 5px;font-size:14px}
.nutrient{padding:8px 0;border-bottom:1px solid #eee6dd}
.nutrient:last-child{border-bottom:0;padding-bottom:0}
.nutrient .track{margin:4px 0}
footer{margin-top:25px;padding:18px 0;border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:12px;color:var(--muted);font-size:12px}
footer svg{width:15px;height:15px;color:var(--green)}
dialog{background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:18px;width:min(560px,calc(100% - 24px));max-height:min(89vh,850px);padding:21px;box-shadow:0 20px 80px #2c1b2140}
dialog::backdrop{background:#301b1d70}
.modal-title{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.modal-title h2{font-size:25px}
label{display:block;font-weight:700;font-size:13px;margin-bottom:5px}
input:not([type=file]){min-width:0;background:#fffcf7;color:var(--ink);border:1px solid #decfc1;border-radius:7px;padding:7px 10px;min-height:40px}
dialog input:not([type=file]){width:100%}
.searchbox{display:flex;align-items:center;border:1px solid #decfc1;background:#fffcf7;border-radius:7px;padding-left:10px;color:var(--accent-dark)}
.searchbox input{border:0;border-radius:0 7px 7px 0}
.segmented,.mode{display:flex;gap:6px;margin:0 0 11px}
.segmented button,.mode button{border:1px solid var(--line);background:var(--paper);color:var(--muted);padding:6px 10px;border-radius:7px;font-size:13px}
.segmented button[aria-pressed=true],.mode button[aria-pressed=true]{background:#fae6db;color:var(--accent-dark);border-color:#e4b9a5;font-weight:700}
.results{margin:7px 0 12px;max-height:172px;overflow:auto;display:grid;gap:4px}
.results button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:left;background:#f9f4ed;border:1px solid transparent;border-radius:7px;padding:6px 9px;color:var(--ink)}
.results button:hover,.results button[aria-pressed=true]{border-color:#ddb9a9;background:#fae8de}
.results button small{color:var(--muted);white-space:nowrap}
.results .hint{padding:3px}
#selectedInfo{margin:9px 0;color:var(--muted);font-size:12px}
#selectedInfo a{color:var(--accent-dark);text-decoration:underline}
#foodPreview{margin:9px 0}
.preview-numbers{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.preview-numbers span{background:#f7ede4;padding:5px 7px;border-radius:5px;font-size:11px}
.preview-numbers b{display:block;font-size:13px}
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 11px;margin:10px 0}
.hint,.sources{font-size:13px;color:var(--muted)}
.sources li{margin-bottom:9px}
.sources a{font-weight:700;color:var(--accent-dark);text-decoration:underline;margin-right:4px}
.actions{display:flex;justify-content:flex-end;gap:7px;margin-top:12px;flex-wrap:wrap}
.form-error{color:#9c3125;font-size:13px;margin:7px 0 0}
#portionPane{margin-top:9px}
@media(max-width:820px){.top-inner,.wrap{padding-left:20px;padding-right:20px}.hero-art{right:-2%;width:365px}.hero-copy{padding-left:30px}.dashboard{gap:16px}}
@media(max-width:650px){.top-inner,.wrap{padding-left:14px;padding-right:14px}.top-inner{height:62px}nav{display:none}.top-inner .btn{font-size:12px;padding:7px 10px;min-height:35px}.wrap{padding-top:15px}.hero{min-height:225px;border-radius:16px}.hero-copy{padding:24px 15px}.hero h1{font-size:clamp(31px,8vw,48px)}.hero p{font-size:12px;letter-spacing:.03em}.hero-art{width:clamp(215px,62vw,335px);right:-12%;top:50%}.hero-index{display:none}.mobile-break{display:block}.hero .btn{font-size:13px;min-height:36px;padding:6px 11px}.datebar{margin:14px 0 18px;padding-bottom:13px;flex-wrap:wrap;gap:8px}.date-control,.date-pick{gap:6px}.date-pick{font-size:13px}.date-control .icon-btn{width:31px;height:31px}.saved{font-size:11px}.dashboard{grid-template-columns:1fr;gap:20px}.section-title{margin-bottom:10px}h2{font-size:24px}.nutrition{margin-top:22px}.detail-groups{grid-template-columns:1fr}.meal{padding:11px 12px}footer{flex-wrap:wrap;margin-top:18px}.modal-title h2{font-size:22px}}
@media(max-width:350px){.hero-art{right:-23%}.brand{font-size:15px}.datebar .saved{display:none}.preview-numbers{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

.promise{font-weight:750;color:#8b3d2d!important}
.sync-bar,.history{display:flex;gap:7px;align-items:center;flex-wrap:wrap}
.history{justify-content:flex-end}
.history select{font:inherit;font-size:11px;color:var(--ink);background:var(--paper);border:1px solid var(--line);border-radius:7px;padding:4px 5px;max-width:135px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.entry.readonly{cursor:default}
.entry.readonly:hover{background:#f8f3eb}
@media(max-width:350px){.datebar .saved{display:inline}}

.share-note{margin:12px 0 0!important;font-size:12px;letter-spacing:0!important;max-width:265px}
.session-status{border:1px solid var(--line);padding:16px;border-radius:12px;background:var(--paper);color:var(--muted)}
body[data-role="viewer"]{--bg:#f2f5f0;--paper:#fcfdf9;--line:#dce4d8;--accent:#37644f;--accent-dark:#284f3d;--ink:#24372d;--muted:#52685d;--green:#447156}
body[data-role="viewer"] .eyebrow.muted{color:#587064}
body[data-role="viewer"] .energy{background:#e7f0e6;border-color:#d6e6d5}
body[data-role="viewer"] .energy :is(.target,p,.eyebrow){color:#385c48}
body[data-role="viewer"] .today{background:#e1ebe0;color:#284f3d}
body[data-role="viewer"] .entry.readonly{background:#eef3eb}
body[data-role="viewer"] .btn.outline:hover,body[data-role="viewer"] .icon-btn:hover{background:#e7efe6;border-color:#aebfae}
.admin-home{padding:26px;border:1px solid #ccdacf;border-radius:19px;background:#e6eee5}
.admin-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}
.admin-head h1{font:800 clamp(32px,5vw,54px)/1.13 var(--display);margin:7px 0 10px}
.admin-head p{color:var(--muted);margin:0}
.share-result{font-size:12px;color:var(--muted);margin:6px 0}
.share-result:empty{display:none}
.admin-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:20px 0 15px}
.admin-stats>div{border:1px solid #d8e3d6;background:#fafcf8;border-radius:10px;padding:11px 12px;min-width:0}
.admin-stats span,.admin-stats p,.admin-stats a{display:block;color:var(--muted);font-size:12px;margin:0}
.admin-stats a{color:var(--accent-dark);text-decoration:underline;text-underline-offset:3px}
.admin-stats strong{font-size:24px;line-height:1.25;display:block;margin:2px 0;overflow-wrap:anywhere}
#lastSaved{font-size:19px;line-height:1.55}
.week-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:7px}
.week-head h2{font:750 15px/1.2 system-ui;margin:0}
.week-head span{font-size:11px;color:var(--muted)}
.week-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.week-day{display:grid;place-items:center;gap:3px;min-width:0;padding:5px 1px;border:1px solid #d4e1d3;border-radius:7px;background:#fbfdf9;color:var(--ink);font-size:12px}
.week-day span:last-child{font-size:11px;color:var(--muted)}
.week-day[aria-pressed=true],.week-day:hover{background:#35614b;color:#fff;border-color:#35614b}
.week-day[aria-pressed=true] span:last-child,.week-day:hover span:last-child{color:#e9f5eb}
@media(max-width:650px){.admin-home{padding:14px}.admin-head{flex-wrap:wrap}.admin-head p{font-size:13px}.admin-head .btn{min-height:34px;font-size:12px}.admin-stats{margin:13px 0;gap:5px}.admin-stats>div{padding:7px 5px}.admin-stats strong{font-size:18px}.admin-stats p,.admin-stats span,.admin-stats a{font-size:10px}#lastSaved{font-size:14px}.week-days{gap:3px}.week-day,.week-day span:last-child{font-size:10px}.share-note{max-width:165px;font-size:10px}}

#signedOut{max-width:580px;margin:35px auto;padding:25px}
#signedOut h1{font:800 40px/1.15 var(--display);color:var(--ink);margin:8px 0 14px}
#generatedLinkPane{margin-top:16px}
#generatedLinkPane button{margin-top:8px}
#logOut{margin-left:auto}
@media(max-width:650px){.top-inner:has(#logOut:not([hidden])){gap:5px}.top-inner:has(#logOut:not([hidden])) .brand{gap:6px}}

.food-browse,.food-result-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px}
.food-browse label{margin:0}
.food-browse select{max-width:65%;font:inherit;font-size:13px;border:1px solid var(--line);background:var(--paper);color:var(--ink);border-radius:7px;padding:4px 6px}
.food-result-footer{margin:0 0 9px;min-height:20px}
.food-result-footer .hint{font-size:12px}
.results button span{min-width:0;overflow-wrap:anywhere}
