Kohli and Rana’s 99-run seventh-wicket stand threatened to spoil New Zealand’s party