I use the CSS edit feature of Calibre conversions to completely delete
line-height as that should only be done, if at all, on web sites. The font metrics set relative line heights correctly.
you can add
margin-bottom: 0.5em; to figure text etc to increase spacing.
I'm suspicious of the
position: relative;
https://www.w3schools.com/Css/css_positioning.asp
I never see the
position property in any ebooks I've ever edited or created, but I never ever have fixed layout (epub3) ebooks.
However I've never seen the
counter-reset property either
https://www.w3schools.com/cssref/pr_...nter-reset.php
Note: epub uses HTML5 and CSS3, but only a subset. Not everything that works on a webpage works in an ebook. The Calibre viewer is actually more "forgiving" than actual ereaders, so if it's bad on the Calibre viewer it's bad!
The W3C is a useful reference as long as you understand it's less true for ebooks.