"""WebUI element detection: YOLO-based open-vocabulary UI labeling + DOM mapping. Lets an LLM agent screenshot a website, get back labeled UI regions (buttons, headers, navs, inputs, etc.), and optionally map those regions to actual DOM elements so the agent can edit the correct component in source code. Two-step pipeline: 1. detect_ui_elements(image, yolo, classes) → runs YOLOv8-World with web-UI class vocabulary → returns labeled bboxes with confidence scores 2. map_to_dom(ui_elements, dom_bounds, iou_threshold) → IoU matches YOLO bboxes against pre-collected DOM element bounds → prefers semantically matching tags ("button" →