/* Keep layout ownership explicit: a stationary app frame and a scrollable feed. */
@media(max-width:650px){
 html,body{height:100%;overflow:hidden;overscroll-behavior:none;transform:none!important;filter:none!important;perspective:none!important}
 #app{position:fixed;inset:0;height:100%;height:100dvh;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scroll-padding-block:20px 120px}
 #mobile-nav{position:fixed!important;inset:auto 10px calc(8px + env(safe-area-inset-bottom,0px))!important;margin:0!important;height:auto!important;transform:translateZ(0)!important;translate:none!important;animation:none!important;transition:none!important;z-index:45;box-shadow:0 -4px 30px #34432312,0 8px 24px #28351e24}
 #mobile-nav .nav-button{min-height:60px}
 .main{padding-bottom:calc(130px + env(safe-area-inset-bottom,0px))!important}
 body:has(dialog[open]) #app{overflow-y:hidden}
 .field input,.field select,.field textarea,.kb-search input{font-size:16px!important}
}
.illustrated-hero{display:grid;grid-template-columns:minmax(0,1fr) 176px;align-items:center;gap:20px;min-height:190px;position:relative;overflow:hidden}
.illustrated-hero .hero-copy{grid-column:1;grid-row:1;z-index:1}
.section-food-art{grid-column:2;grid-row:1 / span 2;width:190px;height:190px;object-fit:contain;pointer-events:none;justify-self:center;align-self:start;filter:drop-shadow(0 12px 12px #38492a18)}
.illustrated-hero>.btn,.illustrated-hero>.hero-actions,.illustrated-hero>.pill{grid-column:1;grid-row:2;justify-self:start;margin:0;max-width:100%}
.illustrated-hero>.hero-actions{flex-direction:row;flex-wrap:wrap;min-width:0}
.illustrated-hero .hero-emblem{width:34px;height:34px;margin-bottom:12px}
.routine-hero.illustrated-hero{grid-template-rows:auto auto auto auto;gap:12px}
.routine-hero.illustrated-hero>:not(img){grid-column:1;grid-row:auto;margin:0}
.routine-hero.illustrated-hero img{grid-row:1 / span 4}
.kb-hero.illustrated-hero{grid-template-columns:minmax(0,1fr) 190px}
.kb-hero.illustrated-hero .kb-hero-art{display:none}
.kb-hero.illustrated-hero .section-food-art{grid-row:1}
.routine-grid,.kb-grid,.columns,.stack{gap:24px}
.card,.quick-action,.routine-launch button,.kb-card,.rt-slot{min-width:0}
.action-card{cursor:pointer}
.action-card,.quick-action,.routine-launch button,.kb-card,.rt-slot,.pantry-chip{animation-fill-mode:backwards!important;transition:transform .25s var(--ease),box-shadow .25s var(--ease),border-color .25s ease}
@media(hover:hover) and (pointer:fine){
 .action-card:hover,.quick-action:hover,.routine-launch button:hover,.kb-card:hover,.rt-slot:hover{transform:scale(1.05);box-shadow:0 15px 35px #35462420;position:relative;z-index:2}
}
.action-card:active,.quick-action:active,.routine-launch button:active,.kb-card:active,.rt-slot:active,.pantry-chip:active{transform:scale(.95)}
dialog{overscroll-behavior:contain;scrollbar-width:thin}
dialog[open]{animation:polish-dialog .26s cubic-bezier(.2,.8,.2,1) both!important;translate:none!important}
dialog::backdrop{animation:polish-backdrop .2s ease both}
@keyframes polish-dialog{from{opacity:0;transform:translateY(16px) scale(.97)}to{opacity:1;transform:none}}
@keyframes polish-backdrop{from{opacity:0}to{opacity:1}}
.nutrient-symbol{background:linear-gradient(140deg,var(--nutrient-light,#e8f1dc),var(--nutrient-dark,#a8bf87))!important;color:#303d2b;box-shadow:inset 0 1px 1px #ffffffc0,0 3px 8px #34422514;border:1px solid #ffffff99;font-weight:700}
.nutrient-line{height:6px!important;border-radius:20px;background:#e4e9dd!important;box-shadow:inset 0 1px 3px #45533415;overflow:hidden}
.nutrient-line i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#a1be74 0%,#6b9750 55%,#3d7848 100%)!important;box-shadow:inset 0 1px #ffffff60;transition:width .65s var(--ease)}
.nutrient-row.unknown .nutrient-line{background:repeating-linear-gradient(90deg,#e4e8dc 0 5px,transparent 5px 8px)!important;box-shadow:none}
.nutrient-row{padding:9px 0!important}
.nutrient-note{margin-top:5px;display:block}
.nutrient-group>summary{min-height:48px}
.nutrient-group>summary:after{content:'⌄';margin-left:auto;color:#788361;transition:rotate .2s}
.nutrient-group[open]>summary:after{rotate:180deg}
@media(min-width:1101px){.routine-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.quick-actions{grid-template-columns:repeat(3,minmax(0,1fr));max-width:none}}
@media(max-width:650px){
 .illustrated-hero,.kb-hero.illustrated-hero{grid-template-columns:minmax(0,1fr) 90px;padding:23px 20px;gap:16px 8px;min-height:0}
 .section-food-art{width:116px;height:116px;align-self:start;margin-top:0}
 .illustrated-hero .hero-copy{display:contents}
 .illustrated-hero .hero-emblem{grid-column:1;grid-row:1;margin:0}
 .illustrated-hero h1{grid-column:1;grid-row:2;font-size:clamp(26px,7vw,32px);line-height:1.12;margin:0;text-wrap:balance}
 .illustrated-hero p{grid-column:1/-1;grid-row:3;max-width:none;margin:0;font-size:13px;line-height:1.65}
 .illustrated-hero>.section-food-art{grid-row:1 / span 2}
 .illustrated-hero>.btn,.illustrated-hero>.hero-actions,.illustrated-hero>.pill{grid-column:1/-1;grid-row:4;width:100%}
 .illustrated-hero>.pill{width:fit-content;display:block}
 .illustrated-hero .hero-actions{display:grid;grid-template-columns:1fr;gap:12px}
 .routine-hero.illustrated-hero>.eyebrow{grid-column:1;grid-row:1;font-size:9px;line-height:1.6}
 .routine-hero.illustrated-hero>.section-food-art{grid-column:2;grid-row:1 / span 2;width:108px;height:108px}
 .routine-hero.illustrated-hero>h1{grid-column:1;grid-row:2}
 .routine-hero.illustrated-hero>p{grid-column:1/-1;grid-row:3}
 .routine-hero.illustrated-hero>.btn{grid-column:1/-1;grid-row:4}
 .kb-hero.illustrated-hero{display:block;padding-top:25px}
 .kb-hero.illustrated-hero .section-food-art{position:absolute;right:8px;top:10px;width:105px;height:105px}
 .kb-hero.illustrated-hero .kb-kicker{max-width:calc(100% - 95px);min-height:76px}
 .kb-hero.illustrated-hero h1{font-size:28px!important;margin-top:10px!important}
 .routine-grid,.columns,.stack,.kb-grid{gap:20px}
}
@media(prefers-reduced-motion:reduce){dialog[open],dialog::backdrop{animation:none!important}.action-card,.quick-action,.routine-launch button,.kb-card,.rt-slot,.pantry-chip,.nutrient-line i{transition:none!important;transform:none!important}}
@media print{html,body{height:auto!important;overflow:visible!important}#app{position:static!important;height:auto!important;overflow:visible!important}#mobile-nav,.section-food-art{display:none!important}}

[data-nutrient="vitaminA"]{--nutrient-light:#ffe9ba;--nutrient-dark:#eab776}
[data-nutrient="vitaminC"]{--nutrient-light:#ffe4c5;--nutrient-dark:#f1ac87}
[data-nutrient="vitaminD"]{--nutrient-light:#fff1b9;--nutrient-dark:#dfc66b}
[data-nutrient="vitaminE"]{--nutrient-light:#f6ddeb;--nutrient-dark:#cc9dbc}
[data-nutrient="vitaminK"]{--nutrient-light:#dcf1d4;--nutrient-dark:#a5c38c}
[data-nutrient="b1"]{--nutrient-light:#e4e2fb;--nutrient-dark:#b0add8}
[data-nutrient="b2"]{--nutrient-light:#e0edf9;--nutrient-dark:#9cb9d5}
[data-nutrient="b3"]{--nutrient-light:#f8ded3;--nutrient-dark:#d9a792}
[data-nutrient="b5"]{--nutrient-light:#f2e4ca;--nutrient-dark:#c8b28a}
[data-nutrient="b6"]{--nutrient-light:#ded9f3;--nutrient-dark:#aca0d2}
[data-nutrient="b7"]{--nutrient-light:#f6d8e2;--nutrient-dark:#d5a0b3}
[data-nutrient="b9"]{--nutrient-light:#dcf0e6;--nutrient-dark:#99c5b0}
[data-nutrient="b12"]{--nutrient-light:#f4d4d3;--nutrient-dark:#d99897}
[data-nutrient="potassium"]{--nutrient-light:#e3ebd4;--nutrient-dark:#a5b98d}
[data-nutrient="magnesium"]{--nutrient-light:#e3ddf4;--nutrient-dark:#b2a6d2}
[data-nutrient="calcium"]{--nutrient-light:#d9ebf3;--nutrient-dark:#9cbdca}
[data-nutrient="iron"]{--nutrient-light:#f0d8cf;--nutrient-dark:#cfa28d}
[data-nutrient="zinc"]{--nutrient-light:#d9ece5;--nutrient-dark:#a2c5b6}
[data-nutrient="copper"]{--nutrient-light:#f6e1c8;--nutrient-dark:#d3ae80}
[data-nutrient="selenium"]{--nutrient-light:#e2e4f2;--nutrient-dark:#aeb5ce}
[data-nutrient="phosphorus"]{--nutrient-light:#eee7cd;--nutrient-dark:#c7bd8c}
[data-nutrient="manganese"]{--nutrient-light:#e2e9d8;--nutrient-dark:#adbf96}
[data-nutrient="sodium"]{--nutrient-light:#dceaf0;--nutrient-dark:#afc1ca}
