scenarios() and scenario_results() both built the same WHERE clause and ran the same filtered query. Extracted into _query_scenarios(search, country, venue_type) -> (rows, total). Each handler is now ~10 lines of param parsing + render_template. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>