IT WAS no great surprise when Democrats held Virginia's governorship in November. The state had been comfortably carried by Hillary Clinton in 2016, auguring a Democratic victory for governor that was probably clinched by voters’ deep distaste for Donald Trump.

What was a surprise, however, was Democrats’ huge success in legislative elections. These are typically friends-and-neighbours affairs in which party affiliation can mean little and hyper-partisan gerrymandering all but snuffs out competition. But this time round Democrats, who had been outnumbered two-to-one in the House of Delegates before the election (many seats had been drawn to help the election of Republicans) surged to within two seats of a takeover. Except for a smattering of delegates in the Northern Virginia suburbs of Washington, DC, the Richmond area and in the defence-rich south-eastern corner of the state, Republicans are now largely confined to heavily rural, thinly populated, Trump-friendly House districts.

Indeed, nearly a month after voting a Democratic takeover of the House remains a possibility: several disputed contests could be decided by recount or even court-ordered do-over elections.

It is also conceivable that the House, for the second time in 20 years, could be evenly divided between the parties: 50 Republicans, 50 Democrats. This would force power-sharing, an awkward arrangement that would complicate efforts by Ralph Northam, the new governor, to see his first-year agenda through a General Assembly that represents the last redoubt of power for Republicans.

The formerly lopsided Republican majority in the House and the party’s one-seat edge in the Virginia Senate were steep obstacles for Terry McAuliffe, the state’s departing Democratic governor. Republicans defied him repeatedly on a state-level expansion of Obamacare. They defeated modest restrictions on firearms. And Republicans, whose legislative majorities gave them a lock on the selection of judges, used the courts to thwart Mr McAuliffe’s attempt to restore the voting and civil rights of more than 200,000 felons who had completed their penalties.

Mr McAuliffe was anything but humbled by Republican obduracy. Rather, over the course of his non-renewable four-year term, this stirred a Democratic base that would be properly riled by Mr Trump, who carried every state in the Old Confederacy except its least Southern: suburban-dominated Virginia.

As the election enters overtime, tying up the Virginia elections agency and state and federal courts in the usually quiet Christmas season, the political parties are focusing on at least two Republican-held seats.

One, in the shadow of a giant shipyard in Newport News that builds submarines and aircraft carriers, could be decided by as few as 10 votes. The other—which includes farmland on which the boyhood home of George Washington stood—is the seat of the retiring speaker credited with building what Republicans were convinced was an indomitable majority.

In that district, where the Republican candidate is ahead by about 80 votes, lawyers are quarrelling over military ballots that may not have been counted. They are also trying to determine whether some voters were given incorrect ballots, choosing between candidates in whose district they didn’t reside.

Should an evenly divided House convene in January, it is unclear who would become speaker, a historically all-powerful post. It is also uncertain whether the speakership would even include its perquisites and prerogatives. Perhaps such gritty arcana as committee assignments and setting the legislative calendar would be turned over to a committee, with the speaker no more than a ceremonial presiding officer.

When the House last split in 1998, Democrats maneuvered to install one of their own as speaker, successfully preserving the office’s authority before consenting to power-sharing with Republicans.

If, however, Republicans do hold on to their tenuous two-seat margin in the House, they are expected to use it to full effect. They will install as speaker a stoutly conservative retired government teacher; tighten their grip on key committees that must accommodate more Democrats and steer lawyers with rigid views on law and order to judgeships. After Danica Roem (pictured), a Democratic newcomer and Virginia’s first openly transgender official, was elected to the House, Republicans said they would dispense with the tradition of addressing lawmakers by male and female pronouns.