/* Only the PWA portion illustration scrolls vertically; photo/swipe controls remain. */
#mealDetailDialog .photo-stage:has(.meal-photo-slide:first-child[data-illustration="true"]){height:auto;aspect-ratio:var(--portion-aspect,1);max-height:65dvh;flex-shrink:0}
.photo-stage .meal-photo-gallery .meal-photo-slide[data-illustration="true"]{overflow-y:auto;overscroll-behavior-y:contain;scrollbar-width:thin}
.photo-stage .meal-photo-gallery .meal-photo-slide[data-illustration="true"] img{height:auto;min-height:100%;object-fit:contain;display:block}
.meal-photo-slide[data-illustration="true"] .ingredient-illustration-label{top:4px;bottom:auto;font-size:10px;padding:2px 6px}

/* Transparent motifs and native text share the current sheet surface. */
#mealDetailDialog .photo-stage:has(.meal-photo-slide[data-portions="true"]){background:var(--paper);aspect-ratio:auto;height:clamp(280px,55dvh,500px);max-height:65dvh}
.photo-stage .meal-photo-gallery .meal-photo-slide[data-portions="true"]{color:var(--ink);cursor:default;text-align:initial;padding:52px 16px 20px}
.photo-stage .meal-photo-gallery .meal-photo-slide[data-portions="true"]>img{display:none}
.portion-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 12px;align-content:start;width:100%}.portion-grid[data-count="1"]{grid-template-columns:minmax(0,1fr);max-width:260px;margin:auto}
.portion-item{min-width:0}.portion-motif{height:140px;display:flex;align-items:center;justify-content:center}
.photo-stage .meal-photo-gallery .meal-photo-slide[data-portions="true"] .portion-motif img{background:transparent;height:auto;min-height:0;max-width:100%;max-height:100%;object-fit:contain;filter:drop-shadow(0 3px 4px rgb(0 0 0 / .09))}
.portion-caption{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:5px 8px;font:500 12px/1.35 system-ui,sans-serif;text-align:center}.portion-name{color:var(--ink);font-weight:600}.portion-values{display:inline-flex;flex-wrap:wrap;justify-content:center;gap:7px;color:var(--muted);font-size:10px;font-variant-numeric:tabular-nums}.portion-value{display:inline-flex;align-items:center;gap:3px;white-space:nowrap}.portion-value svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}.portion-pending{font:11px system-ui;color:var(--muted)}
@media(min-width:430px){.portion-motif{height:165px}.portion-caption{font-size:13px}.portion-values{font-size:11px}}

#mealDetailDialog:has(.portion-grid) #mealName{color:var(--ink)}

/* Keep a pair together in the center, with complete frames at narrow widths. */
.portion-grid[data-count="2"]{max-width:340px;margin-inline:auto;column-gap:8px}
.portion-grid[data-count="2"] .portion-motif{height:clamp(112px,34vw,156px)}

#mealDetailDialog .photo-stage:has(.meal-photo-slide[data-portions="true"] .portion-grid[data-count="2"]){aspect-ratio:auto;height:clamp(260px,38dvh,340px)}
