Despite a great night in House elections, Democrats have lost ground in the Senate. Depending on what happens in Florida and Arizona, the party will hold anywhere between 46 and 48 seats in the US Senate. Any of those options represents a net loss for the party, which currently holds 49 seats.

That’s bad enough for the party in the near term. But it’s worse in the medium run. This year’s losses mean that Democrats will have a very hard time retaking the Senate in 2020.

Before the election, FiveThirtyEight’s Nathaniel Rakich noted that with a 52-48 Senate in Republicans’ favor, Democrats in 2020 would need to hold on to Doug Jones’s seat in Alabama, defeat both Susan Collins in Maine and Cory Gardner in Colorado, and pick up a seat in a red state by ousting at least one of Thom Tillis in North Carolina, Joni Ernst in Iowa, Jon Kyl in Arizona (who’s not seeking reelection), or David Perdue in Georgia. (They’d need one less if they also take the presidency.)

In the worst-case scenario for Democrats, a 54-46 Senate, they’d need to flip five seats and hold on to Alabama. A likely path might involve flipping Maine, Colorado, North Carolina, Iowa, and Arizona, in a year that’s not likely to be as Democratic-leaning as 2018. And that’s assuming that Jones holds on in Alabama, as do New Hampshire’s Jeanne Shaheen, Virginia’s Mark Warner, and Michigan’s Gary Peters. Some of them are likely to hold on, but Jones at least is likely to fall, and Shaheen and Warner came close in 2014. Putting it all together, a Democratic flip sounds unlikely.

The upshot is clear: Democrats will probably remain in the minority in the Senate until at least 2022. That failure will have grave consequences not just for the prospects of future progressive legislation, like Medicare-for-all or action on climate change, but also for the next few decades of the federal judiciary.

What a failure to retake the Senate would mean for policy

The primary consequence of Democrats’ failure in the Senate, in the near term, is that they’ll be unable to stop President Trump’s judicial appointments. They’ll have fewer votes to resist with than they did for Brett Kavanaugh.

That could help Republicans solidify or expand their dominance on the Supreme Court. Clarence Thomas is relatively young (only 70), and he could time his retirement for next year or 2020 to ensure a Republican president and Senate determine his successor. And while Ruth Bader Ginsburg, 85 and a two-time cancer survivor, and Stephen Breyer, 80, are unlikely to retire under Trump, Democrats should pray for their continued good health, especially given news that Ginsburg fell, broke three ribs, and was admitted to George Washington University Hospital on Thursday morning.

Then there are the lower courts. There are currently 122 vacancies on district courts and circuit courts of appeals for Trump to fill, out of 856 total. As analysis from the team at Ballotpedia shows, the aging of the federal judiciary means that by the end of 2020, slightly more than half of district and appeals court judgeships will be a) vacant, b) filled by Trump, or c) held by a judge old enough to take senior status and semi-retire, opening up the seat for another judge.

Not all of those judges will take senior status, of course. But some will. And regardless of how many do, the core point remains that Trump will have considerable power to use his Republican Senate majority, and the 50-vote threshold that Democrats established for lower-court judgeships in 2013, to move the lower courts solidly to the right over the next two years.

That’s the situation for 2019 and 2020. With the Senate mostly out of contention in 2020, the picture only gets worse for Democrats.

If a Democrat defeats Trump for reelection in 2020 but Democrats also fail to retake the Senate — an outcome that’s especially likely if Democrats fall down to 46 seats this year after Arizona and Florida are counted — that Democratic president would not be able to enact much of any legislation of consequence in her first two years in office. Given her likely losses in the 2022 midterms, it’s unlikely she’d be able to pass major bills for her whole first term. Trump broke the trend due to a highly favorable map, but generally, it’s rare for the president’s party to gain seats in the Senate during a midterm. The last time it happened was 2002, in the wake of 9/11, and the last time before that was 1970.

So don’t expect President Kamala Harris or Elizabeth Warren or Bernie Sanders to pass a Medicare-for-all bill, or a job guarantee, or even DC statehood, automatic voter registration, or repairs to the Voting Rights Act. Without control of the Senate in 2021, all those initiatives would be dead in the water.

Trump’s hypothetical Democratic successor in 2021 could also be prevented from appointing and confirming any new members of the US Supreme Court. Before the 2016 election, Sens. Ted Cruz, Richard Burr, and John McCain promised that should Hillary Clinton win, they’d favor blocking any and all nominees she put forward for Antonin Scalia’s vacant Supreme Court seat. Unless political polarization and constitutional hardball somehow abates, rather than worsens, by 2021, the Republican caucus is quite likely to adopt a similar strategy then.

And if Trump is reelected in 2020, Democratic failure in the Senate would carry graver costs for Democrats. Ginsburg will turn 88 the first year of Trump’s second term, and 92 in 2025, if she decided to wait out Trump. Breyer, who has been in better health but as a man has a lower life expectancy, will be 86 and 90, respectively.

It’s also entirely possible that a Trump reelection in 2020 would coincide with a Republican retaking of the House of Representatives. That, combined with a Republican hold on the Senate and Trump’s reelection, would enable new rounds of tax cuts, Medicaid cuts, attempts at Obamacare repeal, and more.

Why retaking the Senate might be structurally difficult for Democrats

Democrats used to rely heavily on seats in red states — not just swing states like Ohio or Iowa, but deep-red states like the Dakotas and Arkansas — for their Senate majority. They don’t anymore, and the Senate map looks increasingly identical to the presidential map. 2016 was the first year in the history of direct Senate elections that every state’s Senate election outcome matched its presidential outcome. That can mean only bad things for Democrats’ viability in the Senate in the medium to long run.

Democrats’ losses in 2018 were concentrated overwhelmingly in deep-red states. Republicans flipped Missouri, Indiana, and North Dakota, none of which are normally competitive for Democrats in national elections (flukes like Obama’s 2008 win in Indiana aside), but where Democrats could compete because of popular incumbents from a less polarized age. Similar things happened in 2010 and 2014 in states like Arkansas, North Dakota, South Dakota, Louisiana, and Alaska, and the 2010 losses weren’t reversed in 2016; indeed, in most cases, like Arkansas and North Dakota, Democrats didn’t even really try to reverse the losses in 2016.

Here’s one way to think about what happened on Tuesday: In January 2005, Democrats had even fewer seats than they’re likely to have in 2019, with only 45. But they had 11 members from states that Mitt Romney would later win. Assuming Democratic losses in Florida and Arizona, Democrats will have only three members from Romney states: Jon Tester in Montana, Joe Manchin in West Virginia, and Doug Jones in Alabama. And Jones is likely to lose in 2020.

I’m using Romney states here because he and Obama split up the states pretty evenly (26 for Obama, 24 for Romney), but you can do a similar analysis using Bush/Kerry states, Obama/McCain states, or even Clinton/Trump states, though Senate Democrats’ continued strength in the Midwest changes the latter analysis a bit.

The point is, Democrats look increasingly uncompetitive for the Senate in states that aren’t at least purple-ish. That doesn’t necessarily have to doom them for Senate control in the long term. There are enough Republican senators from states that Obama won in 2012 — Marco Rubio, Pat Toomey, Chuck Grassley, Cory Gardner, Susan Collins, Ron Johnson, Rob Portman — such that replacing all of them would enable Democrats to retake the body.

But the fact that the Senate map is increasingly resembling the presidential map is bad news for Democrats long-term. The Senate has a profound small-state bias, and small states (and rural states) are likelier to be Republican-leaning than large states; that was even more true before Trump flipped some large Midwestern states like Wisconsin, Michigan, and Pennsylvania. Democrats can win a minority of states and win the presidential popular vote, or even the Electoral College, but they can’t win a minority of states and keep the Senate.

Moreover, Democrats would be forced to spend on more expensive races in large states rather than relatively cheap races in places like the Dakotas, where they used to be able to win.

It’s not obvious, to me, how Democrats get out of that bind.