Nancy Pelosi looked like a malfunctioning Stepford wife as she sat behind President Trump during his State of the Union address last week. Her lower face twitched, she muttered to herself, shook her head, smiled inappropriately, gazed around, chewed her lip or remained glued to her seat during standing ovations in honor of special guests.

It was a bizarre enough performance before she rose to her feet and dramatically ripped up her copy of the president’s speech in what will go down in history as the most unseemly display of partisanship in this partisan era.

That moment was when the myth of the “master political strategist” was busted, and we saw Pelosi, 79, for what she is. Pretending to be classy and prayerful when she is full of petty hatreds and is incapable of holding her party together, a woman who parades her Catholicism while advocating no-holds-barred abortions, feigning to pray for the president while deriding him as “sedated.”

As the leader of the Democrats until they select a presidential candidate, Pelosi is everything that is wrong with the party.

She told reporters that ripping up the speech was “a very dignified act … the courteous thing to do, considering some of the other exuberances within me.”

But her petulant vandalism was the opposite of courteous, quite obviously.

It only underscored the desperation of a party that has lurched to the left in pursuit of Bernie Sanders’ supporters, as the president reaps the reward of a booming economy and his opponents’ continual miscalculations.

Pelosi showed no contrition for ripping up the speech, nor for the political catastrophe of her failed impeachment drive.

That failure is the albatross around the neck of her party’s presidential candidates as they flail their way through icy New Hampshire.

Bereft of economic ideas, they are reduced to espousing electorally unpalatable policy positions: radical abortion, gender quotas in the cabinet, wholesale drug legalization and the kind of criminal justice reform that has turbo-charged crime in New York.

If Pelosi meant to delay handing over the impeachment articles to the Senate as a strategic masterstroke to tie up ascendant socialist Sanders in the Senate and give Joe Biden three weeks on his own in Iowa, that, too, backfired big-time.

The more Iowa saw of Biden, the less they wanted him, and the candidate who benefited most from those moderate votes was Pete Buttigieg, who has done a good job of disguising his radical views on the campaign trail.

The former South Bend, Ind., mayor said last month that there’s no place for pro-lifers in the Democratic Party, and claimed the Bible says a baby’s life begins with “breath.”

In Concord, NH, Saturday, he was vaguer when asked about the comment.

“We’re a big tent … What I’m not going to do is get someone’s vote by tricking them.”

But Sanders was less coy: “Being pro-choice is an absolutely essential part of being a Democrat.”

Like Biden, Buttigieg, Elizabeth Warren and Andrew Yang, Sanders wants to enact a “litmus test” for judicial appointments:

“I will never nominate anybody who is not 100 percent pro-Roe v. Wade.”

But most Democrats don’t share these intolerant views. As Kristen Day, executive director of Democrats for Life of America, who challenged Buttigieg in a live Fox News town hall last month over his pro-abortion stance, points out, 59 percent of Democrats support restrictions on abortion.

With Mike Bloomberg waiting in the wings, maybe the candidates in New Hampshire have thrown caution to the wind in the hope of stopping Sanders.

But there’s one metric that tells you why Democrats are so morose: the president’s job approval ratings among nonwhites, according to Gallup.

That group, thought to be a lock for Democrats, is coming loose. Approval of Trump by all voters is at 49 percent, the highest of his presidency and higher than for Barack Obama (45 percent) at the same point in his presidency.

Trump has gained 10 points since impeachment began in October. Nice one, Nancy.

But nonwhites’ approval of Trump also is at a high: 28 percent, up 10 points in a year.

When it comes to Trump’s handling of the economy, he gets 67 percent overall job approval and a resounding 49 percent among nonwhites, the beneficiaries of lower unemployment and higher wages.

So almost half of all black and Hispanic voters think Trump is doing a good job with the economy. That makes him hard to beat.

As well, 23 percent of nonwhites say Trump deserves to be re-elected, 13 percent say they will vote for him regardless of who the Democratic nominee is and 36 percent will decide once they see whom the Democrats choose.

The Democrats’ counteroffer is unpalatable social policy and tantrums from Pelosi.

Hating Trump is not enough, as you can tell from the subdued applause in New Hampshire when candidates rip into the president.

Yang knows real reason Don is prez

Andrew Yang may be lagging behind the field of Democratic presidential candidates in New Hampshire, but he is the only one with a clear-eyed view of his ultimate potential opponent.

“Why is Donald Trump our president?” he asked 7,000 Democrats on Saturday night at the McIntyre-Shaheen 100 Club gala dinner in Manchester.

“It’s not Russia. He is our president because we lost 4 million manufacturing jobs in Ohio, Iowa, Michigan, Missouri, Pennsylvania [and] New Hampshire. Those towns have never recovered.

“We make a mistake when we say Donald Trump is the source of all our problems. He’s not. He is the symptom of a disease.”

Liz blames ‘racism’ on racism

Elizabeth Warren, who launched her academic career by falsely posing as a Native American to get favorable treatment at Harvard, would make Martin Luther King roll over in his grave with her push for “race-conscious laws.”

No surprise, then, that she is in denial about race problems in her own campaign. Asked about why six “women of color” quit her Nevada campaign, complaining of tokenism and a “toxic work environment,” Warren told MSNBC it was the fault of America’s “long legacy” of “racism and oppression [which] creates the kinds of toxicity where … people take advantage of other people.” Huh?