SAN FRANCISCO — A decade of heated litigation. Five judges, one appeal, dozens of briefs and three million pages of internal documents.

In the end, it all came down to the last seconds before trial.