SPA-aware wait_for_navigation with 3-layer detection