Getting a close button to hang off of a dialog

Have you ever had to implement a modal dialog with a close button designed to hang off of the corner? While not a huge lift for most developers, there’s a few steps involved. It also requires extra care to avoid accessibility gotchas. I did this recently and wondered if there was a simpler approach using modern CSS.