Donald Trump appears to have won two key battlegrounds in the contest to become the next US president, edging towards victory and narrowing Kamala Harris’s path to the White House.