Nested CssLayout does not resize

Hi I’m building a Proof with some nested CSSLayouts (It will be nested collapsible panels as discussed in other threads).
I am not a CSS expert so I hope someone will help me out with this. I created a CustomComponent that’s realized out of two CssLayouts, one of them can be toggled in terms of visiblity. If I do nest the component in the toggle-enabled css layout, it does not resize horizontally. Any ideas what I might do about this?

Any help will be appreciated.