RIVIERA BEACH — With election workers in most of Florida's 67 counties wrapping up their recounts on Sunday, Palm Beach was preparing to continue counting votes past Thanksgiving — and possibly Christmas.

Even by Florida standards, where the mid-terms have dragged on for nearly two weeks after Election Day, Palm Beach has distinguished itself by drawing out the drama even longer. Decade-old ballot-counting machines only capable of recounting one race at a time have malfunctioned, lawsuits have flown, the canvassing board has struggled to keep up with court orders, and an employee reportedly jammed a paper clip into a high-speed scanner, possibly causing a short circuit that cut off the power. At one point during the chaos, Supervisor of Elections Susan Bucher told reporters she was "in prayer mode" to finish by the state deadline.

At times, said volunteer election observer Karyn Macy, it was hard to tell if the recount had stopped because of a problem with the equipment or because of a court order. "Stop, stop, machines. Stop, stop, stop, we have to wait for a court order, we're waiting for an appeal," she said, describing the rapid-fire instructions given to observers and election workers. "It's like the planets were aligned to make sure this recount was not possible in time."

On Saturday night, Bucher finally accepted defeat.

"What we're asked to do is recreate two to three weeks of work in a couple of days," said Bucher, who had spent several nights over the past week sleeping on a cot in a corner of the county's tabulation center, a windowless warehouse in Riviera Beach. "I've been trying to change the deadlines for about 10 years."

Florida Secretary of State Ken Detzner ordered machine recounts of votes cast in the races for U.S. Senate, governor, and agriculture commissioner on Nov. 10 because vote totals were separated by less than half a percentage point. Palm Beach also had to recount votes for a state House seat in which the leading candidate was ahead by just 37 votes.

On Thursday, after most counties submitted the results of their machine recounts, Detzner ordered a hand recount of votes cast in the U.S. Senate and agriculture commissioner races because they were still within a quarter of a percentage point.

But Palm Beach only managed to complete a full recount for the U.S. Senate and state House races before the deadline. In lieu of new vote tallies in the other races, the county re-submitted its results from last week — numbers based on the initial count of the county's nearly 600,000 ballots.

That doesn't mean the county's weary election workers get to go home any time soon, however. State statute requires counties to keep counting votes until the recount is complete, according to Bucher, even though the state has to certify election results on Nov. 20. Unless, that is, the losing candidate concedes, in which case Bucher said she could call off the recount.

After the final statewide vote counts came in on Sunday for the agriculture commissioner race, Democrat Nicole "Nikki" Fried had 6,753 more votes than Republican Rep. Matt Caldwell. When asked whether Caldwell intended to concede, however, campaign spokeswoman Danielle Alvarez said no.

"Palm Beach hasn't even begun the hand recount of the race," she said.

First Palm Beach will have to finish a machine recount for the agriculture commissioner race, then move on to a hand recount. At a federal court hearing on Thursday for one of the many recount-related lawsuits, Bucher said that finishing the full recount could "optimistically" take until Dec. 15 or possibly until "the later part of December, very close to Christmas." (That was before Andrew Gillum conceded to Ron DeSantis in the race for governor, which means Palm Beach likely won't have to recount those votes.)

All of this is assuming U.S. Sen. Bill Nelson's campaign doesn't win a lawsuit against Palm Beach County, filed on Thursday, that demands a hand recount of all ballots. The suit argues that because Palm Beach's ballot-counting machines have suffered mechanical problems, a machine recount "is no longer a viable or reliable alternative".

The suit could force election workers to examine every single ballot by hand. During a typical hand recount, they only review ballots with overvotes and undervotes — ballots in which the voter's intent isn't immediately clear because he or she marked two candidates in a race or left a race blank.

For the U.S. Senate race between Nelson and Gov. Rick Scott, that amounted to roughly 6,000 ballots in Palm Beach.

Marc Elias, a Democratic election lawyer representing the campaign, explained on a call with reporters that given the problems with Palm Beach's ballot-counting machines, "it seems to us that the simplest and neatest remedy" is a full hand recount.

The suit was still pending on Sunday afternoon when Nelson conceded to Scott, and it wasn't immediately clear if his campaign planned to drop the lawsuit. But regardless of the outcome, no one could argue with the fact that Palm Beach's recount has been neither simple nor neat.

The county had to restart its recount of about 175,000 early votes on Tuesday night after losing more than a day's work — a delay Bucher attributed to overheated machines, which she said had given incorrect vote totals.

The company that maintains those machines, Dominion Voting, disputes Bucher's explanation for the delays, however. Kay Stimson, the company's vice president of government affairs, told the Miami Herald that based on a preliminary analysis of information from the company's technicians, the machines do not appear to have overheated.

At some point on the day before the machines malfunctioned, one of the company's technicians saw an election worker jam a paper clip into the machine's "enter" key to hold it down, Stimson said. The worker was reportedly hoping to slow down the equipment. The alleged incident, which was first reported by The New York Times, may have caused a short circuit that cut off the power, Stimson said. She stressed that the company needs more information before drawing any final conclusions.

"Based on what our technicians witnessed on site and reported to the company thus far, there is a strong indication that nonstandard operation of the equipment and human error did more to contribute to the issues than the equipment itself," Stimson said.

Dominion Voting purchased the company that manufactured the machines nearly a decade ago and has a contract with Palm Beach's elections department to support and maintain their equipment. If the machines had overheated, Stimson said, the county would have needed Dominion Voting technicians to replace the motors, but that never happened. While technicians were called over multiple times during the past week, the service calls were for other problems not related to overheating, she said.

Bucher denied the company's allegations that an employee jammed a paper clip into one of the ballot-counting machines. "That's ridiculous," she said on Saturday night. "I think they're trying to save their reputation. We don't know anything about that."

Whatever happened Tuesday night — whether machine or human error — caused several boxes of ballots not to be counted in the vote tallies. But election workers didn't know which boxes contained the ballots whose tallies hadn't been recorded and spent most of Wednesday evening and Thursday hunting for boxes with the exact number of missing ballots.

As the Sunday deadline approached, Bucher said election workers wouldn't even be able to start the recount for the agriculture commissioner race before the deadline.

Perhaps seeking to avoid more snafus, Bucher said that while workers would keep counting votes after Sunday, she would no longer try to operate around the clock. The new schedule wouldn't just give employees a break, she said, it would also put less strain on the machines.

"I just think that we can't operate them 24-7 because it doesn't work out well," she said on Friday night, when she first announced the new schedule.

That means that the army of volunteer observers, recruited by both Republicans and Democrats to keep a watchful eye on the recount, won't have to keep pulling all-nighters, fighting over folding chairs and surviving on sandwiches and vats of coffee provided by the parties.

"It's a big time commitment but you know what? This is Democracy. This is our checks and balances at work," said Ramona Barbagallo, a West Palm Beach resident and volunteer observer recruited by the Democrats. On one overnight shift, Barbagallo watched election workers duplicate damaged ballots from 9:30 p.m. to 6 a.m. the next morning.

"It was pretty amazing that at 4 a.m. they were still functioning," she said. "I had my share of caffeine."

The Palm Beach County Sheriff's Office also provided around-the-clock security at the tabulation center, the result of a court case filed by Scott's campaign. Scott had previously asked state police to investigate unsubstantiated allegations of election fraud.

After protesters swarmed the warehouse Thursday afternoon, deputies set up ring of orange cones around the entrance. One evening, with no credible fraud allegations to investigate, a deputy tried to help a pizza deliveryman find a customer named "Dan" who had apparently placed an order from the warehouse.

Barbagallo said that while she hadn't expected the election to drag on for this long, she would make "every attempt" to continue volunteering for as long as Palm Beach's recount continued.

But no one seems to know whether the final vote tallies, whenever Palm Beach gets around to finishing the recount, will mean anything. More than likely, they'll only provide election lawyers with more ammunition for their ongoing lawsuits.

A spokeswoman for Secretary of State Detzner didn't answer a question, sent via text message on Saturday, about the significance of those vote totals.

"I don't think anyone knows what's going to happen to those numbers," said Frances Hill, a University of Miami professor and expert on constitutional and election law.

After the contested 2000 presidential recount, in which Palm Beach County also played a central role, Florida failed to put sufficient measures in place to prevent similar confusion in the future, Hill said.

"I don't think we quite know when our elections end to tell you the truth," she said. "Maybe we've been spared the absolute Armageddon scenario this time, but we cannot count on being spared the absolute worst case going forward," she added. Hill said the Florida Legislature should "step in and come to some determination about counting votes" before the next election.

On Saturday evening, as Republican Mike Caruso waited at the Palm Beach tabulation center for the recount to finish in a Florida House race in which he was leading his opponent by just 37 votes, the aspiring lawmaker vowed that if he won, coming up with new election rules and regulations would be one of his top priorities.

Caruso, who said he had spent the day watching machines jam, mangling ballots, also questioned why Palm Beach County — which is home to one of the wealthiest ZIP codes in the country — had such outdated equipment.

"Why don't we have the best equipment?" he said. "How does anybody think it could be adequate at this point?"

Election workers labored overnight until 5 a.m., taking a short break before finishing the state House recount less than an hour ahead of the deadline.

But after all of that, Caruso officially won by 32 votes. Not included in the total was a small number of ballots with signature problems that hadn't yet been certified, but wouldn't have changed the outcome of the race.

Palm Beach has set aside $11 million to buy new equipment, but Bucher hasn't yet purchased it because she said the machines on the market don't comply with state laws requiring them to provide certain features for people with disabilities by 2020. Bucher said the Florida Legislature needs to resolve a question about Americans with Disabilities Act compliance first before she can buy new machines.

"It's not responsible to spend $11 million on machines that I can't ensure that I can use in the next real election, in the presidential," Bucher explained earlier in the week.

In the meantime, recount volunteer Macy, a Democrat, said that after spending days at the tabulation center, she has serious doubts about the integrity of Palm Beach's elections.

"I don't think we have the physical capabilities to count every vote. I don't think we have the equipment or the time or the staff or the knowledge," she said. In Palm Beach, at least, she added, "I don't think anyone can go to sleep at night and feel confident that the election outcome was accurate either way."

Miami Herald staff writers Elizabeth Koh and Samantha Gross contributed to this report.