Height pairings on orthogonal Shimura varieties