I just solved it:
I used a custom CSS plugin and added the code displayed in the question here. That works.
I have no idea why it does not work in the “custom CSS” section in the WordPress customizer.
But anyway, thanks for the link! Might be useful next time.