Last week’s election produced the widest gap between the Electoral College and the popular vote in a generation — a result of Hillary Clinton racking up huge margins in populous coastal states such as California and New York while narrowly losing several Midwestern battlegrounds to Donald Trump. Were this pattern to continue, Democrats could be at a significant Electoral College disadvantage.

Clinton, who’s currently leading in the popular vote by 0.6 percentage points and whose advantage should increase — probably to between 1.5 and 2.0 points — as additional ballots are counted, became the fourth candidate to lose the Electoral College while winning the popular vote. She joins Al Gore (2000), Grover Cleveland (1888) and Samuel Tilden (1876). But Tilden’s loss to Rutherford B. Hayes in 1876 was, in part, because Colorado — which had newly joined the union and said it didn’t have time to run an election — appointed its electors to Hayes via its state legislature. Thus, Clinton is likely to win the popular vote by the widest margin of any Electoral College loser in an election in which all states voted, surpassing Cleveland’s 0.8-percentage-point margin in 1888.

The good news for Democrats is that political coalitions change quickly, and even relatively minor changes can shift the Electoral College advantage from one party to the other. It’s possible to determine which party had the Electoral College edge even when it didn’t produce a different winner from the popular vote. For example, we can say that President Obama had the Electoral College advantage in 2012 and would have been favored to win it if the popular vote had been tied.

We can determine this by means of FiveThirtyEight’s tipping-point calculation. It works like this: Sort the states in order of the margin of victory or defeat for the Republican candidate, starting with the most Republican state (in Tuesday’s election, this was Wyoming, for example). Count up the cumulative number of electoral votes in these states, awarding zero votes for any state won by a third-party candidate. Whatever state puts the Republican over the top to an overall majority — which currently requires 270 electoral votes — is a tipping-point state. Next, do the same calculation in reverse, starting with the most Democratic state. Usually this produces the same result, but it can differ if there were states won by third parties or if there could have been an Electoral College tie. Thus, each election has one or two tipping-point states.

In 2012, for example, the tipping-point state was Colorado, which Obama won by 5.4 percentage points. If every state had moved toward Mitt Romney by 3.9 percentage points, yielding a tied national popular vote, Obama would still have won Colorado by 1.5 points — and every other state he originally won by more than 1.5 points — and thereby the Electoral College.

In Tuesday’s election, the tipping-point state will probably wind up being Pennsylvania, where Trump leads by 1.1 percentage points based on ballots counted so far — although it’s possible that it will be displaced by Florida (Trump +1.2) or Wisconsin (+0.9) before results are certified. This is an interesting trio of states in that Pennsylvania and Wisconsin were previously considered part of Democrats’ “blue wall,” while Florida has been slightly Republican-leaning relative to the national average in recent elections. It’s possible that in 2020 and beyond, Florida will be more of a necessity than a luxury for Democrats and part of their easiest path to 270 electoral votes.

There’s a relatively wide gap between Clinton’s losing margins in these states and her winning margin in the national popular vote. In 2012, Obama’s margin in the popular vote expanded from 2.7 percentage points on the Monday after the election to 3.9 points in the final count as additional mail ballots from California and Washington state — and provisional ballots from other states, mostly from cities that vote heavily Democratic — were counted and added to his tally. Clinton’s lead is likely to grow by a similar margin, which would eventually yield a popular-vote victory of 1.8 points. That would produce almost a 3-point gap — 2.9 percentage points, to be precise — between the tipping-point state and the popular vote, the largest in any election since 1948:

YEAR NATIONAL POPULAR VOTE TIPPING-POINT STATE(S) TIPPING-POINT MARGIN ELECTORAL COLLEGE EDGE 2016 D __ +1.8* Pennsylvania R __ +1.1 R _ +2.9 2012 D __ +3.9 _ Colorado D __ +5.4 D _ +1.5 2008 D __ +7.3 _ Colorado D __ +9.0 D _ +1.7 2004 R __ +2.5 _ Ohio R __ +2.1 D _ +0.4 2000 D __ +0.5 _ Florida R __ +0.0 R _ +0.5 1996 D __ +8.5 _ Pennsylvania D __ +9.2 D _ +0.7 1992 D __ +5.6 _ Tennessee D __ +4.7 R _ +0.9 1988 R __ +7.7 _ Michigan R __ +7.9 R _ +0.2 1984 R _ +18.2 _ Michigan R _ +19.0 R _ +0.8 1980 R __ +9.7 _ Illinois R __ +7.9 D _ +1.8 1976 D __ +2.1 _ Wisconsin D __ +1.7 R _ +0.4 1972 R _ +23.1 _ Maine _ and Ohio R _ +22.3 D _ +0.8 1968 R __ +0.7 _ Illinois _ and Ohio R __ +2.6 R _ +1.9 1964 D _ +22.6 _ Washington D _ +24.6 D _ +2.0 1960 D __ +0.2 _ New _ Mexico and Missouri D __ +0.6 D _ +0.4 1956 R _ +15.4 _ Florida R _ +14.5 D _ +0.9 1952 R _ +10.9 _ Michigan R _ +11.5 R _ +0.6 1948 D __ +4.5 _ California _ and Illinois D __ +0.8 R _ +3.7 1944 D __ +7.5 _ New _ York D __ +5.0 R _ +2.5 1940 D __ +9.9 _ Pennsylvania D __ +6.9 R _ +3.0 1936 D _ +24.3 _ Ohio D _ +20.6 R _ +3.7 1932 D _ +17.8 _ Iowa D _ +17.7 R _ +0.1 1928 R _ +17.4 _ Illinois R _ +14.7 D _ +2.7 1924 D _ +26.6 _ New _ York D _ +25.2 R _ +1.4 1920 D _ +31.2 _ Rhode _ Island D _ +26.2 R _ +5.0 1916 D __ +3.1 _ California D __ +0.4 R _ +2.7 1912 D _ +17.0 _ New _ Jersey and Iowa D _ +18.7 D _ +1.7 1908 R __ +8.5 _ West _ Virginia R _ +10.2 R _ +1.7 1904 R _ +18.8 _ New _ Jersey R _ +18.6 D _ +0.2 1900 R __ +6.2 _ Illinois R __ +8.4 R _ +2.2 1896 R __ +4.3 _ Ohio R __ +4.8 R _ +0.5 1892 D __ +3.0 _ Connecticut _ and Illinois D __ +3.2 D _ +0.2 1888 D __ +0.8 _ New _ York R __ +1.1 R _ +1.9 1884 D __ +0.6 _ New _ York D __ +0.1 R _ +0.5 1880 R __ +0.2 _ New _ York R __ +1.9 R _ +1.7 1876 D __ +3.0 _ South _ Carolina R __ +0.5 R _ +3.5 1872 R _ +11.8 _ Ohio R __ +7.1 D _ +4.7 1868 R __ +5.3 _ North _ Carolina R __ +6.8 R _ +1.5 1864 R _ +10.1 _ Illinois R __ +8.8 D _ +1.3 The Electoral College advantage ebbs and flows * 2016 popular vote margin is projected

The “Electoral College edge” is the margin in the tipping-point state minus the margin in the national popular vote. Where there are two tipping-point states, their margins are averaged together. Sources: Dave Leip’s Atlas of U.S. Presidential Elections, David Wasserman

In recent elections, with both parties generally being at least somewhat competitive in all four major regions of the country, there usually hasn’t been such a large gap between the tipping-point state and the popular vote. And small gaps have often reversed themselves. Gore, of course, lost the Electoral College in 2000 to George W. Bush despite winning the popular vote. But four years later, Democrats had a slight Electoral College advantage, as John Kerry came slightly closer to winning Ohio, the tipping-point state that year, than to the national popular vote. In general, in fact, there’s almost no correlation between which party has the Electoral College advantage in one election and which has it four years later. It can bounce back and forth based on relatively subtle changes in the electorate.

The major exception was in the first half of the 20th century, when Republicans persistently had an Electoral College advantage because Democrats racked up huge margins in the South, yielding a lot of wasted votes as far as the Electoral College is concerned. This nearly led to a massive Electoral College-popular vote split in 1948. That year, Democratic incumbent Harry Truman won the popular vote by 4.5 percentage points. But if California, Ohio and Illinois — which Truman won by less than 1 percentage point each and by less than 60,000 votes total — had flipped to Republican Thomas Dewey, Dewey would have won the Electoral College.

The question is whether Democrats are re-entering something akin to the “Solid South” era, except with their votes concentrated in more urban coastal states instead of the South. In this respect, California — where Clinton leads by 28 percentage points, more than Obama’s 23-point margin in 2012 — represents lots of wasted votes, at least in terms of the Electoral College.

At the same time, Arizona, Georgia and Texas — which together have 65 electoral votes — all became more Democratic this year. Winning Texas alone would have been enough for Clinton to just barely win the Electoral College with 270 electoral votes.

And it isn’t necessarily the case that states such as Pennsylvania and Michigan have permanently gone from blue-leaning to purple or even red-leaning. Sometimes, states behave unpredictably for one or two elections before reverting back to the mean — for instance, Obama won Indiana in 2008 before it returned to being strongly Republican. The dynamics of 2020 will also be different in that Democrats will be the challenging party instead of the incumbents.

The risk to Democrats is being caught in between, with the Midwest continuing to drift redder and Arizona and the like not yet ready to become true swing states. That’s what happened to Clinton this year, yielding about the most painful loss imaginable.