The ultraviolet landscape of two-Higgs doublet models