/* Macro & Meals shared tool-page redesign — restaurant and calculator templates */
body:has(#rest-layout-wrapper),body:has(.calc-wrap){background:#f4f7fb}
body:has(#rest-layout-wrapper) .hero,body:has(.calc-wrap) .hero{padding:3.25rem 1rem;background:radial-gradient(circle at 15% 20%,rgba(16,185,129,.16),transparent 28%),linear-gradient(135deg,#0b1220 0%,#111c31 58%,#0d1729 100%)}
body:has(#rest-layout-wrapper) .hero h1,body:has(.calc-wrap) .hero h1{font-size:clamp(2rem,1.55rem + 1.8vw,3.2rem);max-width:1050px;margin-inline:auto;line-height:1.08}
body:has(#rest-layout-wrapper) .hero p,body:has(.calc-wrap) .hero p{max-width:720px;margin:.85rem auto 0;color:#cbd5e1;font-size:1.05rem}
body:has(#rest-layout-wrapper) .breadcrumbs,body:has(.calc-wrap) .breadcrumbs{background:#fff;border-bottom:1px solid #e2e8f0}
#rest-layout-wrapper{display:grid!important;grid-template-columns:minmax(0,1fr) 370px!important;align-items:start!important;gap:1.5rem!important;width:min(100% - 2rem,1400px)!important;max-width:1400px!important;margin:2.25rem auto 3rem!important;padding:0!important}
.rest-left-col,.rest-right-col{min-width:0!important;width:100%!important}.rest-right-col{position:sticky!important;top:92px!important;display:grid!important;gap:1rem!important;max-height:calc(100vh - 110px);overflow-y:auto;padding-right:.25rem;scrollbar-width:thin}.rest-left-col>.calc-card{padding:1.35rem!important;border:1px solid #dfe7ef!important;border-top:3px solid #10b981!important;border-radius:18px!important;background:#fff!important;box-shadow:0 12px 34px rgba(15,23,42,.07)!important;overflow:visible!important;margin:0!important}.rest-right-col .calc-card,.meal-summary{margin:0!important;border:1px solid #dfe7ef!important;border-top:3px solid #10b981!important;border-radius:16px!important;padding:1.1rem!important;box-shadow:0 10px 28px rgba(15,23,42,.07)!important;background:#fff!important}.protips-box{border:1px solid #bfdbfe!important;background:linear-gradient(135deg,#eff6ff,#f8fbff)!important;color:#1e3a5f!important;border-radius:12px!important;padding:.8rem .9rem!important;margin-bottom:.85rem!important;font-size:.84rem!important;line-height:1.5!important}.macro-solver-panel{border:1px solid #dbe4ee!important;border-radius:12px!important;background:#f8fafc!important;margin-bottom:1rem!important;overflow:hidden}.macro-solver-title-row{padding:.85rem 1rem!important;min-height:48px;cursor:pointer}.macro-solver-title-row h3{font-size:.88rem!important;margin:0!important;border:0!important;padding:0!important;letter-spacing:-.01em!important}.macro-solver-content{padding:0 1rem 1rem!important}.cat-tabs{margin:0 0 .9rem!important}.cat-tabs-scroll{display:flex!important;flex-wrap:nowrap!important;gap:.45rem!important;overflow-x:auto!important;padding:.1rem .1rem .45rem!important;max-height:none!important;scrollbar-width:thin}.cat-tab,.diet-filter-btn,.shield-btn{min-height:38px!important;border:1px solid #dbe4ee!important;background:#fff!important;color:#475569!important;border-radius:999px!important;padding:.45rem .75rem!important;font-size:.76rem!important;font-weight:750!important;white-space:nowrap!important;box-shadow:none!important}.cat-tab.active,.diet-filter-btn.active,.shield-btn.active{background:#0f766e!important;color:#fff!important;border-color:#0f766e!important;box-shadow:0 3px 10px rgba(15,118,110,.2)!important}.search-sort-row{display:grid!important;grid-template-columns:minmax(0,1fr) 190px!important;gap:.65rem!important;margin-bottom:.75rem!important}.rest-search{margin:0!important}.rest-search-input,.rest-sort-select{height:46px!important;border:1px solid #cbd5e1!important;border-radius:10px!important;background:#fff!important;padding:.65rem .85rem!important;font-size:.86rem!important;color:#0f172a!important}.rest-search-input:focus,.rest-sort-select:focus{border-color:#2563eb!important;box-shadow:0 0 0 3px rgba(37,99,235,.14)!important;outline:0!important}.diet-filters{display:flex!important;gap:.45rem!important;flex-wrap:wrap!important;margin:.2rem 0 .65rem!important}.allergen-shields{display:flex!important;align-items:center!important;gap:.4rem!important;flex-wrap:wrap!important;background:#fff7f7!important;border:1px solid #fee2e2!important;border-radius:10px!important;padding:.6rem .7rem!important;margin-bottom:1rem!important}.allergen-label-desc{width:100%;font-size:.68rem!important;color:#991b1b!important;font-weight:800!important;text-transform:uppercase!important;letter-spacing:.04em!important}.allergen-shields::after{content:'Filters are informational and are not an allergen-safety guarantee.';display:block;width:100%;font-size:.66rem;color:#9f1239;margin-top:.15rem}.menu-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:.75rem!important;max-height:720px!important;overflow-y:auto!important;padding:.15rem .35rem .25rem .15rem!important;margin:0!important;scrollbar-color:#cbd5e1 transparent}.menu-item{position:relative!important;display:flex!important;flex-direction:column!important;min-height:142px!important;padding:1rem!important;border:1px solid #dbe4ee!important;border-radius:13px!important;background:#fff!important;box-shadow:0 2px 7px rgba(15,23,42,.04)!important;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease!important}.menu-item::after{content:'View details';position:absolute;right:.8rem;bottom:.65rem;font-size:.67rem;font-weight:750;color:#64748b;opacity:0;transform:translateY(3px);transition:.16s ease}.menu-item:hover{transform:translateY(-2px)!important;border-color:#5eead4!important;background:#fff!important;box-shadow:0 10px 24px rgba(15,118,110,.1)!important}.menu-item:hover::after{opacity:1;transform:none}.menu-item.selected{border-color:#0f766e!important;background:#f0fdfa!important;box-shadow:0 0 0 2px rgba(15,118,110,.16)!important}.menu-item-header h4{font-size:.88rem!important;line-height:1.35!important;color:#172033!important;min-height:2.4em;margin:0!important}.menu-item-cal{font-size:1.28rem!important;line-height:1.1!important;color:#4338ca!important;margin:.65rem 0!important;font-weight:850!important}.menu-item .macros{display:flex!important;gap:.3rem!important;flex-wrap:wrap!important;margin-top:auto!important;padding-top:.1rem!important}.menu-macro-pill{font-size:.67rem!important;font-weight:800!important;padding:.25rem .4rem!important;border-radius:6px!important}.menu-macro-pill.pro{background:#ecfdf5!important;color:#047857!important}.menu-macro-pill.carb{background:#eff6ff!important;color:#1d4ed8!important}.menu-macro-pill.fat{background:#fff1f2!important;color:#be123c!important}.safe-badges{position:absolute!important;top:.55rem!important;right:.55rem!important;display:flex!important;gap:.2rem!important}.safe-badge{font-size:.56rem!important;padding:.12rem .25rem!important;border-radius:4px!important;background:#f1f5f9!important;color:#64748b!important}.meal-header{display:flex!important;align-items:center!important;justify-content:space-between!important;border-bottom:1px solid #e2e8f0!important;padding-bottom:.75rem!important;margin-bottom:.85rem!important}.meal-header h3{font-size:1rem!important;margin:0!important}.meal-progress{height:8px!important;border-radius:999px!important;background:#e2e8f0!important}.meal-totals{display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:.45rem!important;margin:.8rem 0!important}.meal-total{min-width:0!important;padding:.65rem .25rem!important;border-radius:9px!important}.meal-total .num{font-size:1.05rem!important}.share-buttons-row{gap:.5rem!important}.btn-share-meal{min-height:42px!important;border-radius:9px!important;font-size:.74rem!important;font-weight:800!important}.tracker-goal-row-grid{grid-template-columns:repeat(3,1fr)!important;gap:.5rem!important}.goal-custom-box{padding:.65rem .35rem!important;border-radius:10px!important}.rest-right-col .dietitian-grade-card{padding:0!important}.detail-card{border-radius:16px!important;box-shadow:0 24px 70px rgba(15,23,42,.18)!important}.guide-body,.content-section{width:min(100% - 2rem,920px)!important;max-width:920px!important;margin:2rem auto!important;border-radius:18px!important;padding:2rem!important;box-shadow:0 10px 35px rgba(15,23,42,.06)!important}.guide-meta{border-radius:10px!important}.related-section,.author-bio-section{width:min(100% - 2rem,920px)!important;max-width:920px!important;margin:2rem auto!important}
/* Standard non-restaurant calculators */
.calc-wrap{width:min(100% - 2rem,1100px)!important;max-width:1100px!important;margin:2.25rem auto 3rem!important}.calc-wrap>.calc-grid,.calculator-layout{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(320px,.78fr)!important;gap:1.25rem!important;align-items:start!important}.calc-wrap .calc-card{border:1px solid #dfe7ef!important;border-top:3px solid #10b981!important;border-radius:18px!important;padding:1.5rem!important;box-shadow:0 12px 34px rgba(15,23,42,.07)!important;background:#fff!important}.calc-wrap .result-card{border:1px solid #bbf7d0!important;border-radius:18px!important;background:linear-gradient(180deg,#fff,#f8fffb)!important;box-shadow:0 12px 34px rgba(15,23,42,.07)!important;padding:1.75rem!important}.calc-wrap .field-group{margin-bottom:1rem!important}.calc-wrap .field-group label{font-size:.78rem!important;text-transform:none!important;letter-spacing:0!important;color:#334155!important}.calc-wrap .field-group input,.calc-wrap .field-group select{min-height:48px!important;border:1px solid #cbd5e1!important;border-radius:10px!important;background:#fff!important}.calc-wrap .calc-btn{min-height:50px!important;border-radius:10px!important;background:#0f766e!important;box-shadow:0 6px 18px rgba(15,118,110,.2)!important}.calc-wrap .calc-btn:hover{background:#115e59!important}.calc-wrap .result-value{color:#0f766e!important;letter-spacing:-.04em!important}
@media(max-width:1180px){#rest-layout-wrapper{grid-template-columns:minmax(0,1fr) 330px!important}.menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:900px){body:has(#rest-layout-wrapper) .hero,body:has(.calc-wrap) .hero{padding:2.5rem .75rem}#rest-layout-wrapper{display:block!important;width:min(100% - 1rem,760px)!important;margin:1rem auto 5.5rem!important}.rest-right-col{position:static!important;max-height:none!important;overflow:visible!important;margin-top:1rem!important}.menu-grid{max-height:none!important}.calc-wrap>.calc-grid,.calculator-layout{display:block!important}.calc-wrap{width:min(100% - 1rem,720px)!important}.calc-wrap .result-card{margin-top:1rem!important}}
@media(max-width:600px){.rest-left-col>.calc-card{padding:.85rem!important;border-radius:14px!important}.search-sort-row{grid-template-columns:1fr!important}.menu-grid{grid-template-columns:1fr!important;gap:.55rem!important}.menu-item{min-height:118px!important;padding:.85rem!important}.menu-item-header h4{min-height:auto!important;font-size:.9rem!important}.menu-item-cal{margin:.45rem 0!important}.rest-right-col{margin-top:.75rem!important}.guide-body,.content-section{width:calc(100% - 1rem)!important;padding:1.1rem!important;border-radius:14px!important}.tracker-goal-row-grid{grid-template-columns:1fr!important}.cat-tab,.diet-filter-btn,.shield-btn{min-height:42px!important}}

/* Responsive correction: release template containers and scale every tool cleanly. */
body:has(#rest-layout-wrapper) .section>.container:has(>#rest-layout-wrapper),
body:has(.calc-wrap) .section>.container:has(>.calc-wrap){width:100%!important;max-width:1480px!important;padding-inline:clamp(.25rem,1.2vw,1.25rem)!important}
#rest-layout-wrapper{width:100%!important;max-width:1400px!important}
.rest-right-col{max-height:none!important;overflow:visible!important;padding-right:0!important}
#rest-layout-wrapper *,.calc-wrap *{min-width:0}
.menu-grid{scrollbar-gutter:stable}
.rest-right-col .calc-card,.rest-right-col .meal-summary{overflow:hidden!important}
@media (min-width:1480px){#rest-layout-wrapper{grid-template-columns:minmax(0,1fr) 390px!important;gap:1.75rem!important}.menu-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media (min-width:1081px) and (max-width:1479px){#rest-layout-wrapper{grid-template-columns:minmax(0,1fr) clamp(320px,27vw,370px)!important}.menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media (max-width:1080px){body:has(#rest-layout-wrapper) .section,body:has(.calc-wrap) .section{padding-inline:clamp(.5rem,2vw,1rem)!important}#rest-layout-wrapper{display:block!important;width:min(100%,820px)!important;margin:1.25rem auto 4rem!important}.rest-right-col{position:static!important;margin-top:1rem!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:start!important}.rest-right-col>.meal-summary,.rest-right-col>.calc-card:first-child{grid-column:1/-1}.menu-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-height:none!important}.calc-wrap>.calc-grid,.calculator-layout{grid-template-columns:1fr!important}}
@media (max-width:720px){body:has(#rest-layout-wrapper) .section,body:has(.calc-wrap) .section{padding-top:1rem!important;padding-bottom:2.5rem!important}#rest-layout-wrapper,.calc-wrap{width:100%!important;margin-top:0!important}.rest-right-col{grid-template-columns:1fr!important}.rest-right-col>*{grid-column:1!important}.search-sort-row{grid-template-columns:1fr!important}.guide-body,.content-section,.related-section,.author-bio-section{width:calc(100% - 1rem)!important;margin:1rem auto!important}}
@media (max-width:520px){body:has(#rest-layout-wrapper) .hero,body:has(.calc-wrap) .hero{padding:2rem .75rem!important}body:has(#rest-layout-wrapper) .hero h1,body:has(.calc-wrap) .hero h1{font-size:clamp(1.65rem,8vw,2.1rem)!important}.menu-grid{grid-template-columns:1fr!important;padding-inline:0!important}.rest-left-col>.calc-card,.calc-wrap .calc-card,.calc-wrap .result-card{padding:.8rem!important}.meal-totals{grid-template-columns:repeat(2,minmax(0,1fr))!important}.share-buttons-row{display:grid!important;grid-template-columns:1fr!important}.cat-tabs-scroll{margin-inline:-.15rem!important}.guide-body,.content-section{padding:1rem!important}}
@media (max-width:360px){body:has(#rest-layout-wrapper) .section,body:has(.calc-wrap) .section{padding-inline:.35rem!important}.rest-left-col>.calc-card{padding:.65rem!important}.cat-tab,.diet-filter-btn,.shield-btn{padding-inline:.6rem!important;font-size:.72rem!important}.meal-total{padding-inline:.15rem!important}}

.menu-item,
.restaurant-menu-item,
.guide-body section {
  content-visibility: auto;
  contain-intrinsic-size: auto 160px;
}

