I’m the same height as you. I have a few bikes and broadly, depending on geometry, they are all medium. The adage that it’s easier to make a small frame bigger than a big frame smaller stands good.
Your logic about the relaxed position is a bit flawed. If the top tube is too long, you start having to compensate with a short stem which can bring its own problems around steering.
Really though the best option is to go to a good dealer and get a bike fit.