Dialog element, focusing content, form method="dialog" behavior

The first focusable element (or the dialog itself) should be focused when the dialog is opened, and focus should move inside the dialog with the tab key.

Clicking the "close" button should close the dialog (due to method="dialog").

Everything in light DOM:

Dialog in light DOM, content in shadow DOM:

Everything in shadow DOM:

Dialog in shadow DOM, content slotted from light DOM: