When Democrats think about their party’s problems on the political map, they tend to think of President Trump’s ability to win the White House despite losing the popular vote and Republicans’ potent efforts to gerrymander congressional districts. But their problems extend beyond the Electoral College and the House: The Senate hasn’t had such a strong pro-GOP bias since the ratification of direct Senate elections in 1913.

Even if Democrats were to win every single 2018 House and Senate race for seats representing places that Hillary Clinton won or that Trump won by less than 3 percentage points — a pretty good midterm by historical standards — they could still fall short of the House majority and lose five Senate seats.

This is partly attributable to the nature of House districts: GOP gerrymandering and Democratic voters’ clustering in urban districts has moved the median House seat well to the right of the nation. Part of it is bad timing. Democrats have been cursed by a terrible Senate map in 2018: They must defend 25 of their 48 seats while Republicans must defend just eight of their 52.

But there’s a larger, long-term trend at work too — one that should alarm Democrats preoccupied with the future of Congress and the Supreme Court.

In the last few decades, Democrats have expanded their advantages in California and New York — states with huge urban centers that combined to give Clinton a 6 million vote edge, more than twice her national margin. But those two states elect only 4 percent of the Senate. Meanwhile, Republicans have made huge advances in small rural states — think Arkansas, North and South Dakota, Iowa, Louisiana, Montana and West Virginia — that wield disproportionate power in the upper chamber compared to their populations.

We can quantify the partisan bias of Congress over time by measuring the distance between each national presidential result and each year’s presidential result in the median House and Senate seats. So in 2008, for example, Barack Obama won the popular vote by 7.3 percentage points, but Democrats won the median House seat by 4.4 points — a pro-GOP bias of 2.9 points.

Today, the pro-GOP biases in both chambers are at historic highs:

In 2016, Trump lost the national popular vote by 2.1 percentage points, but Republicans won the median House seat by 3.4 points and the median Senate seat by 3.6 points — that’s the widest Senate gap in at least a century and tied with 2012 for the widest House disparity in the last half-century. That doesn’t mean Democrats can’t win the House and Senate back — they won control of both chambers in 2006 despite a Republican-bias that year, for example — but they’re starting from a truly historic geographic disadvantage, even with the political wind at their back.

Consider: In 1980, there were 18 states where the presidential margin was at least 5 points more Democratic than the national result, 18 states where it was at least 5 points more Republican than the national result and 14 states in between. Hypothetically, over three successive election cycles, all either party needed to do to win a Senate majority was win all 36 of the seats in the friendly states plus at least 15 of the 28 swing-state seats.

Today, Republicans don’t even need to win any “swing states” to win a Senate majority: 52 seats are in states where the 2016 presidential margin was at least 5 percentage points more Republican than the national outcome. By contrast, there are just 28 seats in states where the margin was at least 5 points more Democratic, and only 20 seats in swing states.

The GOP’s current 52-seat majority makes the Senate look tantalizingly competitive. But a look at the map reveals that the Democrats hold far more seats on borrowed time than Republicans do. The GOP doesn’t hold a single Senate seat in those 14 states that are more Democratic-leaning than the country overall. Meanwhile, Democrats hold six seats in the 26 more-Republican-than-average states, and all six are at risk in 2018.

In 2010, when Democrats passed the health care law Republicans are now seeking to repeal, they needed “yes” votes from all 60 of their senators, including 13 from states that then-President Barack Obama had lost in 2008. What did it take for the party to be able to obtain 60 seats? The Iraq War, Hurricane Katrina and a stock market crash, which generated a huge backlash against President George W. Bush and Republicans in 2008.

Today, it would take even more cataclysmic events under GOP rule to propel Democrats to a supermajority over the next six years. (Of course, those events sometimes happen, particularly given a long enough time frame.) Meanwhile, all Republicans would need to obtain 60 seats would be to win every seat in the 30 states that Trump won — no Clinton states needed. That’s a plausible outcome over a few election cycles, thanks to today’s extraordinarily high rates of straight-ticket voting — if the basic contours of the nation’s political geography don’t drastically change in the next decade.

The implications beyond Congress, especially for the Supreme Court, should deeply worry Democrats. Even if there’s a Democrat in the White House in 2021, the Senate majority that is so critical to confirming his or her nominee could be much harder to come by than it has been in decades past.