Working example of pn.FlexBox with two hv.Curves, sized using the flexbox mechanism

Have you tried using styles={"width": "fit-content"}?