Yep, I think the priorities should be <html> and <body>. Here's mine, which centers the content both horizontally and vertically via flexbox:
html {
display: flex;
align-items: center;
justify-content: center;
min-height: 100%;
}
@media screen {
body {
max-width: 40rem;
margin: 1rem;
}
}
It's not perfect, but it works well for simple websites (e.g. https://colorclock.hashbase.io/).