The legal battles over mail-in votes in the 2020 election continue apace, and many of them have been good for Democrats in their quest to expand access — and particularly as Democratic voters say they’re much more likely to vote by mail than Republicans.

But one ruling last week wasn’t nearly so good for Democrats, and their allies in Pennsylvania argue it could be a significant problem for Joe Biden in November’s election.

The state Supreme Court ruled last week that absentee ballots returned without secrecy envelopes — also known as “naked ballots” — won’t be counted in November. That’s a change from how such ballots have been handled in much of the state, including in this year’s primaries.

And some are warning that many tens of thousands — and possibly even more than 100,000 ballots — could be thrown out.

“While everyone is talking about the significance of extending the mail-ballot deadline, it is the naked ballot ruling that is going to cause electoral chaos,” Lisa Deeley, chairwoman of the Philadelphia city commissioners, wrote in a letter to state legislators this week. She urged them to pass a law making sure such ballots are counted, while floating the prospect of more than 100,000 votes being invalidated.

So how much might that matter? Plenty. First, the number Deeley floated would be significant, especially given that it would account for about 1.6 percent of all the ballots cast in the 2016 election. It would also be more than double President Trump’s decisive margin from that election: about 45,000 votes.

It’s also a plausible number. Naked ballots weren’t tallied everywhere during the 2020 primaries, because counties were advised to count them just like any other ballot. But anecdotal reports from some counties indicate that it’s a sizable portion of absentee ballots. In the 2019 municipal elections in Philadelphia, for instance, 6.4 percent of absentee ballots were naked, according to the Philadelphia Inquirer. In this year’s primary in Mercer County near Pittsburgh, 5 percent were naked.

Extrapolating that to expected vote totals is speculative but instructive. Pennsylvania has not been a heavily vote-by-mail state in the past, with only about 5 percent of ballots generally cast absentee, according to the Inquirer. But it has expanded access to absentee ballots, and many more Americans are expected to vote by mail this year than in prior years because of the coronavirus pandemic.

Democrats are much more likely to take advantage. A Quinnipiac University poll this month showed 47 percent of Democrats planned to vote by mail in the November election, compared with 13 percent of Republicans. Other data suggest an even bigger gap, with more than 6 in 10 Democrats and only 1 in 10 Trump supporters planning to vote by mail.

About 2.7 million currently registered Pennsylvania Democrats voted in 2016, compared with 2.4 million currently registered Republicans, according to data from L2 Political. If you overlay the Quinnipiac numbers on that, it would mean nearly 1.3 million Democratic mail-in votes, compared with more than 300,000 Republican ones.

If 5 percent of those ballots come back naked and are thrown out, across the board, it would cost Democrats more than 60,000 votes and Republicans about 15,000 — a net Democratic loss of more than 45,000 votes, which would notably be bigger than Trump’s margin of victory in 2016, when Pennsylvania was one of three decisive states.

If 6 percent of ballots were naked, Democrats would lose a net of about 57,000 votes. If the wider mail-in ballot disparity were realized, with 5 percent thrown out, it would cost Democrats a net of about 75,000 votes.

There is plenty of guesswork in this, and the numbers notably don’t include independents. About 600,000 currently registered independents voted in 2016, and it would stand to reason that Democratic-leaning ones would be more likely to vote by mail, possibly costing Democrats even more votes.

It’s also possible that the number of “naked ballots” we see could be higher than it has historically been, given that so many people will be casting ballots by mail for the first time in this election and might be more prone to such errors. When you go from 5 percent of all ballots being cast by mail to as much as half, as some estimates suggest is possible, those first-timers will be legion.

But there are caveats. One is that the gap in mail-in voting in the 2020 primaries wasn’t quite as big as the latest polls suggest it could be in the general election, with Democrats casting more than 1 million mail-in votes to Republicans’ 400,000. It’s possible that many Democrats who plan to vote by mail won’t follow through on it, and it’s also possible that the politicization of this issue by Trump, who has baselessly warned of massive potential fraud, has led to partisan responses on this poll question.

It’s also possible that, short of a new law declaring that naked ballots must be counted (which seems unlikely, given that Republicans control the state legislature), voters could be educated to make sure to use secrecy envelopes. But that process would need to begin immediately, given that ballots are now cleared to be sent out and voting is beginning.

The ruling also came alongside more favorable ones for Democrats, including extending the deadline for absentee ballots, permitting the use of drop boxes and removing the Green Party nominee from the ballot. So it’s hardly a disaster for Biden’s campaign. But if Pennsylvania is as close in 2020 as it was in 2016, “naked ballots” could be the new “hanging chads.”

Philip Bump contributed to this report.