If Donald Trump’s win were the Democratic Party’s only problem, the party’s leaders would be justified in affecting a certain amount of complacency. After all, in a year when fundamentals-based models predicted a narrow Republican victory, Clinton actually pulled out a majority of the popular vote. That makes the Democrats from 1992 to 2016 the only political party in American history to win the popular vote in six elections out of seven. It’s actually kind of impressive.

What’s less impressive is that at the sub-presidential level, the Obama years have created a Democratic Party that’s essentially a smoking pile of rubble.

Republicans control the House, and they control the Senate. District lines are drawn in such a way that the median House district is far more conservative than the median American voter — resulting in situations like 2012 where House Democrats secured more votes than House Republicans but the GOP retained a healthy majority. The Senate, too, is in effect naturally gerrymandered to favor Republicans. Two years from now the Democratic Party will need to fight to retain seats in very difficult states like North Dakota, Montana, West Virginia, Indiana, and Missouri along with merely contestable ones in places like Florida, Ohio, Michigan, and Pennsylvania.

In state government things are worse, if anything. The GOP now controls historical record number of governors’ mansions, including a majority of New England governorships. Tuesday’s election swapped around a few state legislative houses but left Democrats controlling a distinct minority. The same story applies further down ballot, where most elected attorneys general, insurance commissioners, secretaries of state, and so forth are Republicans.

One could perhaps overlook all of this if the Obama years had bequeathed the nation an enduring legacy along the lines of the New Deal or the Great Society. But to a striking extent, even as President Obama prepares to leave office with strong approval ratings, his policy legacy is extraordinarily vulnerable. And the odds that it will be essentially extinguished are high.

Due to a combination of bad luck and poor decisions, the story of the 21st-century Democratic Party looks to be overwhelmingly the story of failure.

Obama’s vulnerable policy legacy

We don’t know for sure what policymaking in the Donald Trump era will look like. But dismantling core pillars of the Obama legacy is going to be high on the list, and the odds are extremely good that he and his Republican colleagues in Congress will have an extremely high success rate.

That starts, naturally, with Obama’s executive actions designed to shelter otherwise law-abiding unauthorized residents of the United States from deportation. Always somewhat legally tenuous, these will be cast to the wind at the soonest possible opportunity.

Obama’s climate change legacy is multifaceted, and some of it will endure. But an extremely large share of Obama’s most consequential actions have taken the form of Environmental Protection Agency regulation of greenhouse gas emissions under the Clean Air Act. A Trump administration will roll these measures back as soon as possible. But more fundamentally, congressional Republicans will move legislation amending the Clean Air Act to permanently eliminate the regulatory authority — ensuring that even if Trump loses in 2020, an Obama-style framework can’t simply be recreated.

Congressional Republicans have already laid the groundwork to repeal the Affordable Care Act with a budget reconciliation measure that only requires 51 votes to pass.

When Obamacare first passed, Democrats were optimistic that the program would eventually create its own constituency and become politically difficult to assault — the way that Medicare and Medicaid did. At the time, I thought they were right. But it hasn’t proven to be true. What is true is that people (typically lower-income people who receive generous subsidies) who do buy plans on the Obamacare exchanges rate the plans very highly. But this is actually not very many people, as signing up — particularly for those eligible only for small subsidies — has proven far less popular than the law’s authors imagined. What has done a lot to reduce the ranks of the uninsured is the expansion of Medicaid.

But Medicaid is stigmatized as a program for the poor. And, worse, as a joint state-federal program, it’s vulnerable to stealth cuts via block-granting, which is exactly what Republicans will do.

Last but by no means least, Obama’s decision to opt for an elaborate financial regulatory scheme rather than simply smashing up the largest banks and throwing some CEOs in jail was technically sound but politically vulnerable. Once Trump is inaugurated, he and House Republicans will engage in large-scale financial deregulation. But beyond that, Trump will be appointing the regulators and appears to be exclusively considering industry-friendly candidates.

Weakness down ballot begets further weakness

Meanwhile, Democrats’ very weakness down ballot threatens to breed more weakness. The 2010 midterm elections went very poorly for Democrats, pushing the blue-to-purple states of Wisconsin, Michigan, and Ohio into total Republican control. In all three states, the new GOP regimes used their newfound clout to enact anti-union measures. Those measures, by weakening the progressive infrastructure in the states, helped contribute to an ongoing reddening trend that reached its fruition in Trump seizing those states’ electoral votes.

This same basic pattern threatens to reassert itself across large swaths of the country.

In states where Democratic Party politics can’t be anchored in a large cosmopolitan city or a burgeoning nonwhite population, a heavy labor union presence seems necessary. (In Nevada, the one state whose local Democratic Party has been getting stronger lately, there’s both.) But Republican strength in state politics eats away at union strength, begetting further Republican strength.

More prosaically, an attorney general or an insurance commissioner is someone who could be a good future candidate for a Senate seat or a governorship. When you don’t hold the lower offices, it’s hard to move up to the higher ones. And when you don’t hold a majority in the state legislature, it’s hard for a legislator to author bills that pass and become a track record of accomplishment that can boost you in a race for House or an insurance commissioner gig.

The donkey will rise again

The point here is not that the Democratic Party has suffered some kind of knockout blow from which it will never return. Every bad electoral defeat is overinterpreted by some circle of pundits as signaling the death knell for one party or the other, and the loser always comes back.

Indeed, given the existing down-ballot weakness of the Democratic Party after the 2010 and 2014 midterms, Hillary Clinton’s loss does more to hasten Democrats’ resurrection than to delay it. A Republican president in office will tarnish the brand of blue-state Republican parties, making it easier for Democrats to regain ground in their own turf. At the same time, the absence of a high-profile national Democratic leader will make it easier for state parties in more conservative regions to build up independent identities.

But while Democrats shouldn’t be left for dead, it’s also the case that resurrection takes work and specific action. Party leaders who a week ago were confident they were leading the blue team to yet another presidential victory are going to look around and realize they didn’t just lose, they got essentially annihilated — even though the presidential election itself was close. They’re going to have to start doing something different. In particular, something that takes note of the fact that whether you think the constitutional system is fair or not (I don’t, personally), the existing setup simply doesn’t allow you to run up the score in California to compensate for weakness in the Midwest.

More broadly, the Obama-Clinton style of liberal incrementalism promised that while it wouldn’t deliver utopia, it would deliver wins and concrete results. And for a while, it did. But no strategy can guarantee an uninterrupted series of presidential election wins. And the withering of the down-ballot party paired with the failure to create entrenched policy accomplishments means much of Obama-era policymaking will have vanished without a trace within six months.

To make its comeback, what’s left of the Democratic Party establishment — not just its elected officials but the leaders of its aligned institutions and its major donors — need to recognize that a strategy they believed was working as recently as Tuesday afternoon has in fact failed quite badly.

Watch: Trump meets with Obama in the Oval Office