Can Theresa May fix Brexit border problem?

Arlene Foster and other DUP MPs speaking in Belfast Image copyright PA
Image caption It is not clear if the DUP saw the final wording of the agreement on the Irish border

It is pretty clear how it all went wrong yesterday.

But as we left Brussels in the pitch black this morning we're still in the dark about what happens next, and how Theresa May can get this whole process back on track, and smartish.

While it's not the end of the potential overall deal if the two sides can't move on to the next phase of talks at the summit next week, it is what both sides desperately want.

The longer it takes, the more risk there is of course of other parts of yesterday's draft being unpicked. The idea was, remember, to lock in the agreement so far, then get on with the rest. It isn't clear what happens next though.

There are some big political and practical questions to ask. (If you are not very interested in the minutiae of all of this, look away now.... but guess what, it's not just about a fight with her allies in Northern Ireland, but her friends and rivals around the cabinet table too).

1. How can Theresa May get the DUP back on board quickly?

There is a dispute over whether or not they had seen the full text of the draft agreement yesterday.

Some sources say they hadn't seen the whole thing, therefore they hadn't seen the full context of what was being said, and flew off the handle over the initial leaks from Brussels over what had been agreed, the UK government "conceding" on the border as MEPs outside the Commission building told us before May even arrived.

While it's clear the DUP was in close contact with the government it is possible to believe they hadn't seen the whole text complete with the caveats, because even senior officials involved in the talks weren't allowed to have electronic copies of the document, only hard copies.

And as there had been lots and lots of changes to the text over the weekend, it's not impossible to imagine that the final, final, final version that then emerged had not been shown in full to the DUP.

Others in government suggest the DUP had seen it all, and as we reported last night, the Tory chief whip told the PM it was all signed off. If that's the case, it is a much bigger political problem of trust for the PM, if the DUP had been kept in the loop and given their approval, but then threw their toys out of the pram.

It's not clear whether the PM and Arlene Foster will meet in the next couple of days in person, but from late last night talks between the two sides were under way.

But with such strong objections on the record now, it is very difficult to see how the DUP can just say, ok then prime minister, when we said we couldn't back it, we really meant that we could, unless there is a change in the language in the text that has already taken weeks of painful negotiation to agree. It's said there are three different policy options that could provide a fix, but this feels more like a battle of wills.

And don't forget, there are a number of Tory MPs who agree with them. The idea of close "alignment", is anathema to some Conservative Brexiteers too.

There is however a very big difference between allowing Northern Ireland to choose to keep cooperating in some sectors and write that into the deal, and imposing a much bigger change where it essentially stands alone from the rest of the UK, and is pushed much closer to the EU.

2. This morning it feels pretty much impossible for the other side, Dublin, to back down in any way.

Irish leader Leo Varadkar, who is in the middle of a political whirlwind of his own, went public yesterday to make it clear that there was indeed an agreed text, and that there was no way that it could be unpicked.

Beyond the reassurances on policy that the Irish so desired, to change tack politically and suddenly give back the concessions that appear to have been so hard won seems extremely unlikely to happen.

3. It's worth pondering too whether the EU pushed the Republic of Ireland, or the Republic of Ireland pushed the EU, too hard?

The last week or so have been the moment of maximum leverage for the Republic of Ireland and they have squeezed every drop out of it. But if, with the EU's backing, they have pushed May into an impossible trap, no one will win. Several weeks ago a senior government official suggested to me that we should be worried about France and Germany underestimating the PM's political difficulties.

If the calculus became impossible for her to stay at the table, there was, they feared, no guaranteed way of her being being able to "get back in the harness". Because we are leaving the EU, the old expectations that the UK will always be able to keep talking, to keep going, don't apply any more.

4. Is the only way out then for the prime minister to face down her allies?

Perhaps, indeed, but why didn't she do that yesterday? There was not due to be a vote in Parliament on the suggested deal at the end of phase one. There was no moment on this specific issue when she required the DUP's backing. Northern Ireland is yet to receive the bulk of the billion that was promised to them after the DUP did a deal with the government.

One insider wondered aloud yesterday why she just hadn't dared them to take her on. The DUP will try to max out its influence at every stage and won't give up easily. The government knows how hard they can negotiate, after they spun out their confidence and supply agreement with No 10 over many days in the summer.

But when the stakes are high, the one thing the Northern Ireland contingent truly don't want is a Jeremy Corbyn government. And if Brexit is completely derailed, arguably that risk for the DUP and the Tories moves into view. And above all, if all the PM has really promised is voluntary alignment in some sectors that shouldn't be hypothetically impossible to agree, if she really demands it.

5. The amount of trouble the prime minister is in also depends what the cabinet demands to know this morning, and what the promises over "alignment" really amounted to.

While the crucial paragraphs over the Irish border did emerge into the public, the text of the whole document is still a secret.

The suspicion in some circles is that Theresa May and Olly Robbins, her top EU official, might have been suggesting that "regulatory alignment", where the rules in the UK mirror very closely those in the EU, was an option, not just for Northern Ireland, but for the rest of the country, or at least some sectors of the economy.

That had not been scoped out by the Brexit department, it's suggested, let alone signed off by the cabinet.

Round that table, be in no doubt, there are very different views over how close the UK's "alignment" should be. If Brexiteers Michael Gove, Boris Johnson and others feel this morning that the prime minister somehow tried to bounce them into agreeing to a future outside the EU where the UK was permanently bound tightly to Brussels, expect fireworks at home.

That could end up being much more troublesome for Theresa May than the behaviour of the Northern Ireland party whose votes she needs.

No 10 sources say the suggestions that the PM wants alignment for the whole of the UK are wide of the mark. But Brexiteers are likely to demand reassurance.