If you want to understand why the debates over the Confederate flag and Donald Trump’s immigration outbursts have so many senior Republicans reaching for their acid reflux pills, take a look at this bracing new demographic analysis from Charlie Cook and David Wasserman.

Cook and Wasserman note that historical patterns should favor the GOP in the 2016 presidential election, because the same party rarely keeps the White House after previously holding it for two terms. But that advantage will be swimming upstream against these demographics:

The modern GOP’s increasing reliance on a shrinking pool of older, white, and working-class voters — and its failure to attract nonwhite voters — would seem to present an enormous obstacle to the eventual Republican nominee. In 1980, when nonwhite voters were just 12 percent of the electorate, Ronald Reagan won 56 percent of white voters and was elected in a landslide. But in 2012, when nonwhite voters accounted for 28 percent of the electorate, Mitt Romney took 59 percent of white voters — and lost the presidential race by 4 percentage points. Without a total brand makeover, how can Republicans expect to prevail with an even more diverse electorate in 2016?…

If the electorate evolves in sync with the Census Bureau’s estimates of the adult citizen population (admittedly, a big if), the white share of the electorate would drop from 72 percent in 2012 to 70 percent in 2016; the African-American share would remain stable at 13 percent; the Latino portion would grow from 10 percent to 11 percent; and the Asian/other segment would increase from 5 percent to 6 percent. If the 2012 election had been held with that breakdown (keeping all other variables stable), President Obama would have won by 5.4 percentage points rather than by his actual 3.85-point margin.

In addition, the group with which the GOP does best — whites without college degrees — is the only one poised to shrink in 2016. President Obama won just 36 percent of these voters in 2012, while 42 percent of white voters with college degrees pulled the lever for him. But if the electorate changes in line with census estimates, the slice of college-educated whites will grow by 1 point, to 37 percent of all voters, while the portion of whites without degrees will shrink 3 points, to just 33 percent of the total.

In other words, the GOP doesn’t just have a growing problem with nonwhites; it has a shrinkage problem as well, as conservative white seniors are supplanted by college-educated millennials with different cultural attitudes.

Political scientist Michael McDonald,  who analyzes voting and demographic patterns for the U.S. Elections Project, has been taking a hard look at the demographics of 2014 and 2016, and he agrees with Cook and Wasserman about the declining white vote share.

“The ongoing changes in the demography of the U.S. as a whole, and within key battleground states, are not favorable towards the Republican Party,” McDonald emails. “From the mid-1990s up to the present, the non-Hispanic white share of the electorate dropped ten percentage points. Preliminary analysis of the 2014 elections indicates the slide is not abating, confirming Census Bureau projections of the country’s changing face.”

There are plenty of caveats. There is the aforementioned historical pattern favoring the non-incumbent party. As Ed Kilgore notes, it is hardly certain that Hillary Clinton will be able to pump up turnout among core Dem voter groups to Obama levels. And as Cook and Wasserman also note, if the 2016 GOP nominee can manage just marginal improvements over Mitt Romney across the demographic groups, he can win. As they note, demographics are “no guarantee” of a Dem victory.

Still, even these caveats suggest what a gamble it might be for Republicans to count on winning the White House without a serious effort to improve the GOP’s appeal among non-whites. After all, it’s possible Clinton could improve on Obama’s performance among whites, even if blue collar white voters continue to back Republicans at high levels. As Ron Brownstein has noted, polls are already showing her outperforming among a key subset, white college-educated women. What’s more, a contrast is developing between Clinton and the Republicans on a number of issues — gay rights, health care,  climate change, even possibly a negotiated settlement with Iran — that could help her among college educated whites in general. (The Clinton camp reportedly thinks she can also make a play for blue collar white women, which seems at least possible.)

It would be absolute folly for Democrats to get complacent about their seeming demographic edge. Still, for the above reasons, I wouldn’t be all that surprised if GOP establishment types make a huge push for Jeb Bush in the not too distant future. As I’ve noted, Bush, with his Mexican wife, Latino-American kids, and fluency in Spanish, can plausibly argue that only he combines leadership heft with a genuine opportunity to improve the GOP’s cultural appeal to nonwhites. And imagine the panic that could set in among GOP elites if Donald Trump keeps it up, and garners cheers at a GOP debate when he calls for an alligator-stocked moat along the Mexican border?

Of course, whether GOP primary voters will share in that panic is another question entirely.