export function classifyMapsFailure(errorText = "", lastLogLines = "") {
  const text = `${errorText || ""}\n${lastLogLines || ""}`;
  if (/(EPIPE|ERR_CONNECTION_CLOSED|errno\s*-32|PipeTransport|page\.goto.*google\.com\/maps)/i.test(text)) return "scraper_unhealthy";
  if (/timed out after \d+ms|timeout\s+\d+ms exceeded/i.test(text)) return "render_timeout";
  if (/returned no rows|total found:\s*0|no rows/i.test(text)) return "empty_results";
  return "unknown";
}
