How do I make sure that the entire UI always fits in the frame?

I have a panel with a button and text that I want to put in a scrollview. I have uploaded the prefab of the desired panel to content, but if I switch to freeaspect (screen resolution), then part of the image becomes invisible. I want everything to scale so that the entire panel is visible in the frame and doesn’t go anywhere. How to do it?

Photo 1. It can be seen that the resolution is 1920 by 1080. Everything is displayed well (almost, for some reason the panel is attached to the left, and not in the center)

Photo2. I change the resolution to freeaspect, and as you can see, part of it becomes invisible.

here are the object settings


How the UI scales with screen resolution and aspect ratios is determined by the Canvas Scaler.

With UI Toolkit this is trivial since it’s the default, you get all flex style options to align items and children and instantly see how this affects the layout since within UI Builder UI layouting is interactive.