01 Focus order
Focus escapes the plan dialog
What breaks: Open “Change plan,” then Tab past its last control. Enter can now activate the background instead of continuing the plan flow.
Proposed fix: Open a named native dialog with showModal(), set the initial focus, and verify that it returns to the opener when the dialog closes.
− <div role="dialog" class="pricing-modal">
+ <dialog class="pricing-modal"
+ aria-labelledby="plan-title">
+ <h3 id="plan-title">Change plan</h3>
…
− </div>
+ </dialog>
− dialog.hidden = false;
+ dialog.showModal();
