Rank-and-file Democrats are, reasonably, disappointed with a loss in what seemed to be a winnable special election in Georgia. Even my colleague Andrew Prokop warns that Democrats shouldn’t “sugarcoat” the result, which is “bad news” for the party.

But step back from the specifics of the race and look at all four special elections in red districts held since Donald Trump’s election, and a more optimistic story emerges. Democrats have successfully transferred Hillary Clinton’s gains in well-educated districts to their down-ballot candidates, even while succeeding in making up some of the ground she lost in white working-class ones.

The Democratic Party’s leaders seem to have believed they could improve on her margins in a place like the Georgia Sixth District while being unreasonably pessimistic about the party’s chances in situations like the South Carolina and Kansas races. That speaks somewhat poorly of their judgment and strategic acumen, but the underlying reality revealed by the four elections taken as a whole is actually more bullish for Democrats than the one the party’s leaders thought they were in. If the basic pattern holds up — with Democrats pocketing Clinton’s gains and the GOP not consolidating Trump’s — they are well positioned for the future.

The switcheroo

The 2016 presidential election featured a substantial reworking of the underlying demographic map of American politics. Clinton did about 10 percentage points better with white college graduates than Barack Obama had done four years before, offset by doing about 14 percentage points worse among whites without college degrees. Since college graduates vote at a higher rate than non-graduates, this is a decent swap in popular vote terms but was deadly to Democratic fortunes in the Electoral College.

An important question going forward was how much that vote swapping would stick. And the answer of the special elections thus far seems to be fairly optimistic for Democrats. We see in the Georgia race that Democrats have successfully transferred Clinton’s gains with white college graduates into down-ballot races. But we see in the other three races that Democrats have partially made up ground in white working-class areas where Clinton underperformed. That wasn’t good enough to win any of the four seats that have been on the ballot, but those were all seats the GOP won comfortably in 2016.

Democrats are overperforming everywhere

David Wasserman of the Cook Political Report has a table comparing the results of each election to the district’s Partisan Voting Index, essentially a synthetic measure of where each district would be expected to land in the case of a national 50-50 race.

As you can see, Democrats are doing better than expected across the board. That’s what you would expect with Donald Trump being unpopular, and Democrats did especially well in Kansas, where the Republican governor is also unpopular.

In the wake of the Georgia outcome, there is a lot of grousing about “moral victories” and “Democrats have to win somewhere,” but this is fundamentally misguided.

These are all races for open seats that Trump deliberately created by appointing incumbent House Republicans to his Cabinet. He didn’t create any vacancies in swing states. It’s true, obviously, that to win a House majority, Democrats need to win somewhere. And the way to do it would be to generate a national swing of 4 or 5 points that nets them lots of seats that have a 2- or 3- or 4-point pro-GOP lean (due to gerrymandering, Democrats need to win Republican-leaning states) rather than an 8- or 15-point one.

How Democrats misread the trends

What is true is that these results show the party’s leadership having misread the larger electoral trends somewhat. The Georgia race was for a seat that Republicans have traditionally won overwhelmingly but that Trump only carried narrowly. The Montana race was in a district where down-ballot Democrats have often succeeded but Trump was dominant. The South Carolina race was for a seat that Democrats actually held until the 2010 midterms but where Trump did very well.

The calculation behind the “all in on Ossoff” theory was that these trends would continue and Atlanta’s northern suburbs would go from R-leaning to D-leaning, while Montana and the South Carolina seat would continue to slip out of grasp.

The results show that neither of these things seems to be true. Ossoff did about as well as Hillary Clinton, which means he did better than any House Democrat in forever, but he didn’t improve on her performance. But Democrats in places where Trump was very strong have managed to improve on her results. This actually paints a fairly positive portrait of Democrats’ overall fortunes. The party seems to be consolidating Clinton’s gains with white college graduates to a much greater extent than the GOP is consolidating Trump’s gains with non-college whites.

Mentally setting the baseline as the results of the Trump-Clinton election seems to have led Democrats to overrate their odds in Georgia and underrate their odds everywhere else. Based on the Cook PVI, which takes a longer view of the situation, their odds were really no better in Georgia than in South Carolina but their overall performance is very strong.

The “Panera Democrats” plan had fatal flaws anyway

Democrats would feel better today if their baselining theory had been correct. Winning Georgia narrowly — even while losing South Carolina in a landslide — would have been perceived as a huge blow to the GOP and a rebuke of the Trump agenda.

But an electoral strategy based on accentuating the demographic trends unleashed by the 2016 election — former Hillary Clinton spokesperson Brian Fallon’s “Panera Democrats” — was fatally flawed in a number of ways.

For starters, these demographic trends are exactly how Clinton wound up losing the Electoral College despite a healthy popular vote lead in the first place. And the state-based math is even more punitive in the Senate. California, Texas, New York, Florida, and Illinois all have below-average white populations, which means that the vast majority of states have above-average ones. Even in the best-educated states, most white voters don’t have college degrees.

Simply put, there is no possible route toward a Democratic Senate majority that doesn’t involve a stronger-than-Clinton performance with white voters who don’t have college degrees. Democrats don’t need a majority of those voters, but they do need to do better than Clinton did, because no number of Latinos in San Antonio or college graduates in the Dallas suburbs can make up for the Senate seats in the Midwest and the Plains.

Consequently, the actual outcome of these special elections — showing that Democrats are not doomed to Clinton-level performances in white working-class areas — is good news for the party. And while Republicans are rightly happy to have held on in Georgia, they should consider it sobering that they didn’t manage to win back the white college graduates that Trump lost there.

Republicans are on thin ice but have fundamental strengths

All of which is to say that the fundamental political conditions in the United States continue to be unfavorable for Republicans. Donald Trump’s approval rating is bad, and the generic congressional ballot favors Democrats. Incumbent parties almost always lose seats in midterm elections, and there is absolutely nothing about the current state of public opinion to in any way suggest that 2018 will be an exception.

But Republicans also have considerable strengths. The shape of House Districts means that even if a few more people vote for Democratic House candidates, the GOP can easily maintain its majority. To win, the Democrats need a lot more votes than the Republicans. To do that, Democrats need to appeal to some right-of-center voters without watering down their message so much that they annoy and demobilize their base. It’s objectively difficult to pull off, especially in the face of what’s likely to be an entrenched Republican advantage in outside spending and a more ideologically coherent message.

All that said, the basic message of these special elections is entirely consistent with a polling outlook that looks bad for the GOP. Trump pulled many new voters into the GOP coalition, but many of them are willing to drift back to the Democrats — at least with Trump not on the ballot. But he also repulsed many traditional Republican voters, and they don’t seem to be coming back home.