One SVG path per group: the union of the participants' rects, corners rounded (convex and concave use the same arc emission). The popup opens by animating its input rect; the outline is recomputed each frame, so the border visibly grows around it.
Content beneath the popup, to show that the merged shape overlays it with a single unified fill, border and shadow. Aliquam erat volutpat: nulla facilisi, sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.
This panel and its trigger are two plain DOM elements. The enclosure you see is one SVG path.
Drag to move, shift-drag to resize. Same geometry function; every convex corner gets a normal arc, every concave corner an inverted one, radii clamp on short edges.