When jittery members of her caucus met Thursday afternoon behind closed doors at the Democratic National Committee headquarters to discuss the possibility of a protracted convention fight, one lawmaker joked that the race was so fluid and tumultuous that the speaker herself might wind up as president.

“I like my job — you’re not getting rid of me that easily,” Ms. Pelosi replied teasingly, according to two people who were present. She urged Democrats to “keep our eye on the ball” and focus on winning their own seats and defeating the president. She mocked Mr. Trump’s skin color: “The ball has an orange face,” she said…

While Ms. Pelosi has repeatedly called for Democrats to remain unified, she is also pushing them to run on the three-pronged “For the People” agenda — creating good-paying jobs, rooting out corruption and lowering the cost of health care and prescription drugs — that delivered them the majority in 2018.