Your comments

Thanks for the response, but I'm afraid this doesn't solve the problem. In fact, it makes things slightly worse as one set of primary/secondary buttons that was displaying well changed to become more crowded.

However, with some more trial and error I've managed to find a workaround.