The root
app/layout.tsx, which renders html and bodyThe root app/layout.tsx is correct. It is required and wraps every page. So it takes over the global wrappers from _app and the html and body markup from _document. The Metadata API handles head tags. The tempting app/template.tsx is wrong: a template remounts on every navigation and is optional, so it can't replace the document shell.