Text fit and hug with max width

I am trying to achieve a responsive layout with a label (text + background color) that:

- fits the length of the text

- sizes the text down if a max width is reached


I have made several attempts at this tweaking layout and text fits options, but I can't quite get what I'm looking for. See in the examples attached (where the bright pink area on the right represents the empty space):

1: the empty space scales perfectly, the text object correctly uses up all the size available in the layout/artboard. However instead of sizing down when there isn't enough space, it wraps.

2: the text sizes up and down correctly as the artboard width changes, however, it doesn't use the available space efficiently. The ratio of empty/used space is always 50%. (I tried changing fill values, but couldn't manage to find a good solution).


Screen Recording 2025-10-20 at 14.19.31.mov

Is it possible to achieve what I want, and if so, how? Is the text Fit option missing this feature, or am I misusing layout settings?

Any help or ideas, either technical or design wise, much welcome.