.food-page{max-width:1020px;margin:auto}
.food-tabs{display:inline-flex;max-width:100%;gap:4px;background:var(--paper);padding:4px;border-radius:12px}
.food-tabs a{display:block;padding:10px 20px;text-align:center;text-decoration:none;color:var(--muted);border-radius:9px;font-weight:600}
.food-tabs a[aria-current]{color:#fff;background:var(--accent)}
.food-date{display:flex;align-items:center;gap:12px;margin:22px 0}
.food-date label{position:relative;display:flex;align-items:center;justify-content:center;min-width:145px;min-height:40px;margin:0;font-weight:600}
.food-date input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.food-date label:focus-within{outline:2px solid var(--light-blue);border-radius:8px}
.food-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(270px,1fr);align-items:start;gap:clamp(18px,4vw,44px)}
.food-layout>*{min-width:0}.food-column{max-width:660px}
.food-section-title{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:0 0 12px}
.food-section-title small,.food-muted,.food-limit{color:var(--muted);font-size:.85rem}.food-muted{line-height:1.5;margin:7px 0 12px}
.recipe-list{display:grid;gap:10px}.recipe{overflow:hidden;border:1px solid var(--edge);background:var(--paper);border-radius:14px}
.recipe summary{display:flex;align-items:center;gap:15px;padding:10px;min-height:85px}.recipe summary>img{width:88px;height:78px;object-fit:cover;border-radius:8px}
.recipe summary span{display:grid;gap:4px;min-width:0}.recipe summary small,.recipe summary em{color:var(--muted);font-size:.78rem;font-style:normal}
.recipe summary strong{font-size:1.06rem;line-height:1.2;color:var(--text);font-weight:630}.recipe summary::after{content:"⌄";color:var(--light-blue);margin:0 5px}
.recipe[open] summary::after{content:"⌃"}.recipe-detail{padding:6px 18px 18px;border-top:1px solid var(--edge)}.recipe-detail h3{margin:15px 0 6px}
.recipe .ingredient-list li{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:5px 0;color:var(--text)}
.recipe .recipe-steps{list-style:decimal;padding-left:20px}.recipe .recipe-steps li{display:list-item;line-height:1.5;margin:6px 0;color:var(--text)}
.food-score,.food-plan,.food-history,.shopping-group{border-radius:14px;border:1px solid var(--edge);background:var(--paper);padding:18px}
.food-score{display:grid;grid-template-columns:1fr auto;align-items:end;column-gap:12px}.food-energy,.food-total{font-weight:670;font-size:2.1rem;letter-spacing:-.04em}
.food-energy small{font-size:.92rem;letter-spacing:0;color:var(--muted)}.food-limit{display:grid;text-align:right}.food-limit b{color:var(--text);font-size:1rem}
.food-score progress{grid-column:1/-1;width:100%;height:7px;border:0;border-radius:8px;margin-top:12px;appearance:none;background:var(--edge)}
.food-score progress::-webkit-progress-bar{border-radius:8px;background:var(--edge)}.food-score progress::-webkit-progress-value{background:var(--accent);border-radius:8px}
.food-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0 20px}.food-actions button{flex:1 1 auto;min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:7px}
.food-plan h2,.food-history h2{font-size:1.18rem}.food-plan .macro-readout{margin:12px 0 8px}.food-calc summary{cursor:pointer;color:var(--light-blue);padding:10px 0}.food-calc p{font-size:.86rem;margin:6px 0 11px;line-height:1.55}
.food-period{max-width:300px}.shopping-group{margin:12px 0}.shopping-group h3{margin:0 0 6px}.shopping-group label{display:flex;align-items:center;gap:10px;min-height:44px;border-top:1px solid var(--line);cursor:pointer}
.shopping-group input{width:19px;height:19px;margin:0}.shopping-group label span{flex:1}.shopping-group b{font-size:.87rem}.shopping-group label:has(:checked) span{text-decoration:line-through;color:var(--quiet)}
.food-history a{display:grid;grid-template-columns:minmax(70px,1fr) 1fr auto;align-items:center;gap:10px;padding:9px 0;text-decoration:none;color:var(--muted);font-size:.82rem}
.food-history a[aria-current]{color:var(--light-blue)}.food-history i,.food-history em{display:block;height:6px;border-radius:6px;background:var(--line)}.food-history em{background:var(--accent)}.food-history b{min-width:72px;text-align:right}
.food-entry{width:100%;display:flex;align-items:center;gap:12px;text-align:left;border-bottom:1px solid var(--edge);border-radius:0;padding:12px 2px}
.food-entry span{flex:1;min-width:0}.food-entry span>*{display:block}.food-entry small{color:var(--muted);margin-top:3px}.food-entry b{white-space:nowrap;font-size:.9rem}.food-entry .ic{width:16px;color:var(--light-blue)}
.photo-choices{display:flex;gap:10px}.photo-choices label{flex:1;position:relative;min-height:48px;display:flex;align-items:center;justify-content:center;gap:6px;background:var(--band);border:1px solid var(--edge);border-radius:10px;cursor:pointer}
.photo-choices input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}.photo-choices label:focus-within{outline:2px solid var(--light-blue)}
.photo-preview:not([hidden]){display:block;width:100%;max-height:220px;object-fit:contain;border-radius:10px}.photo-component{padding:10px 0;border-bottom:1px solid var(--edge)}
.photo-component .fields{grid-template-columns:minmax(0,2fr) minmax(78px,1fr)}.food-macros-input{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.food-total{font-size:1.45rem;color:var(--light-blue)}
@media(max-width:760px){
 #bottomnav:not(:empty){grid-template-columns:repeat(5,minmax(0,1fr))}#bottomnav .nav-btn{min-width:0;padding-inline:1px}
 .food-layout{grid-template-columns:minmax(0,1fr);gap:20px}.food-tabs{display:flex}.food-tabs a{flex:1;padding:9px 8px}
 .food-date{margin:14px 0;justify-content:space-between}.recipe summary{gap:11px}.recipe summary>img{width:74px;height:70px}
 .food-section-title h2{font-size:1.28rem}.food-score,.food-plan,.food-history,.shopping-group{padding:15px}
}
@media(max-width:360px){#bottomnav .nav-btn{font-size:.62rem}.recipe summary>img{width:61px;height:63px}}

.recipe-search{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:10px;align-items:end;margin-bottom:10px}.recipe-search label{min-width:0}
.catalog-row{display:flex;align-items:center;gap:12px;width:100%;min-height:70px;text-align:left;border-bottom:1px solid var(--edge);border-radius:0;padding:8px 0}
.catalog-row img{width:58px;height:54px;object-fit:cover;border-radius:7px}.catalog-row span{flex:1;min-width:0}.catalog-row span>*{display:block}.catalog-row small{color:var(--muted);margin-top:2px}.catalog-row .ic{width:16px;color:var(--light-blue)}
.recipe-cover{display:block;width:100%;max-height:245px;object-fit:cover;border-radius:12px}.catalog-detail .ingredient-list{list-style:none;padding:0}
.catalog-detail .ingredient-list li{display:flex;justify-content:space-between;gap:12px;padding:4px 0}.catalog-detail .recipe-steps{padding-left:22px}.catalog-detail .recipe-steps li{margin:6px 0;line-height:1.5}
#back-recipes{display:block;margin:9px auto}
@media(max-width:430px){.recipe-search{grid-template-columns:1fr}}
