@@ -81,15 +81,22 @@ export function FoodSearchSheet({
8181 role = "dialog"
8282 aria-modal = "true"
8383 aria-label = { `Add food to ${ mealName } ` }
84- className = "fixed inset-0 z-[60] flex flex-col bg-background pt-safe"
84+ // Full-screen on mobile (the guided flow this was built for). On desktop
85+ // (sm+) a full-bleed layout is a small list floating in a black void, so
86+ // it becomes a centered, bounded modal over a dimmed backdrop — matching
87+ // the meal hub it's launched from. The inner panel sizes to its content
88+ // (short for the portion step, up to 85vh + scroll for the results).
89+ className = "fixed inset-0 z-[60] flex flex-col bg-background pt-safe sm:items-center sm:justify-center sm:bg-black/70 sm:p-6"
8590 >
86- < FoodSearchBody
87- mealId = { mealId }
88- mealName = { mealName }
89- customFoodsRev = { customFoodsRev }
90- onLogFood = { onLogFood }
91- onBack = { onBack }
92- />
91+ < div className = "flex min-h-0 flex-1 flex-col sm:max-h-[85vh] sm:w-full sm:max-w-2xl sm:flex-none sm:overflow-hidden sm:rounded-2xl sm:border sm:border-border/60 sm:bg-background sm:shadow-2xl" >
92+ < FoodSearchBody
93+ mealId = { mealId }
94+ mealName = { mealName }
95+ customFoodsRev = { customFoodsRev }
96+ onLogFood = { onLogFood }
97+ onBack = { onBack }
98+ />
99+ </ div >
93100 </ div > ,
94101 document . body ,
95102 ) ;
@@ -168,7 +175,7 @@ function FoodSearchBody({
168175 </ div >
169176 </ header >
170177
171- < div className = "flex flex-1 flex-col gap-5 overflow-y-auto px-4 py-5" >
178+ < div className = "flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-4 py-5" >
172179 < p className = "flex flex-wrap items-center gap-x-2 font-mono text-sm tabular-nums" >
173180 < span className = "text-foreground" > { pickedKcal } kcal</ span >
174181 < span className = "text-muted-foreground/50" > ·</ span >
@@ -280,7 +287,7 @@ function FoodSearchBody({
280287 </ div >
281288 </ div >
282289
283- < div className = "flex-1 space-y-1.5 overflow-y-auto px-3 py-3" >
290+ < div className = "min-h-0 flex-1 space-y-1.5 overflow-y-auto px-3 py-3" >
284291 { search . results . map ( ( food ) => (
285292 < button
286293 key = { food . id ?? food . name }
0 commit comments