Task detail opens with taskDetailBusy=true, so the close button is disabled at the moment focusIntoPanel runs; focusing it silently failed and left focus on body (Esc then never reached the sheet). Skip targets that are disabled/hidden/inert without relying on layout metrics (keeps jsdom tests valid), falling back to first focusable or the panel itself.