calculate size
css for robustness
tentative layout logic for robustness