The post-Brexit trade talks may be inching towards an agreement – but it is still possible the two sides will run out of time.
The current transition period, during which the UK continues to follow EU rules, began when the UK left the EU, on 31 January, and it ends on New Year’s Eve.
If there is no agreement by then, the UK would have no deal with the EU on trade, or on other issues such as security cooperation and fishing.
But could there be a legal fix to allow both sides to keep talking if necessary?
And what would happen if a deal was agreed only at the very last minute?
The transition period was designed to preserve current arrangements temporarily and avoid disruption, to allow for negotiations.
But there is no legal basis for extending it.
It’s part of an international treaty, the Brexit withdrawal agreement, that said any extension would have to be agreed before 1 July 2020.
And the UK decided not to ask for an extension.
If they wanted to, EU governments and the UK could, in theory, come up with an international agreement outside EU law to give them a temporary extension.
Some international lawyers have also suggested it might be possible to reuse Article 50, the legal basis for the UK’s exit from the EU.
But EU lawyers have rejected that.
Any plan for a further brief extension would probably be challenged in the courts.
But it could buy a few extra weeks before that challenge was heard.
Again in theory, that could allow the two sides to complete negotiations not quite finished or give more time for parliaments on both sides to examine a deal properly.
The UK has said in the past it will not consider any kind of extension.
But it wouldn’t be the first time the impossible suddenly becomes possible in negotiations involving the EU, once creative lawyers sit down at the table.
“It’s legally tricky,” Catherine Barnard, professor of EU law, at the University of Cambridge, says.
“But you should never underestimate the ingenuity of lawyers, particularly when their backs are up against the wall.”
Any agreement would need to be vetted by lawyers on both sides – they call it “legal scrubbing” – and translated.
Most of that has probably already been done – there are only a few areas of disagreement left.
But the deal would still have to be scrutinised and approved – or ratified – by parliamentarians.
And the time to go through hundreds of pages of dense legal text with any degree of thoroughness is fast running out.
If there were to be awkward compromises hidden within the text – and there would be – there are politicians who would like to find them.
An agreement would, after all, form the basis of EU-UK relations for years to come.
In the UK, that scrutiny would happen at Westminster, where the government has a big majority in the House of Commons.
The devolved parliaments and assemblies would not have a separate vote.
Normally, a treaty can be ratified only at least 21 sitting – or working – days after it has first been presented to Parliament.
But in exceptional circumstances, the government has the power to push ratification through in a single day.
The process on the EU side would be more complicated because 27 countries are involved.
Agreements are described as either “EU only”, which means they involve changing things which are the exclusive responsibility of the EU as a whole, or “mixed”, which means they also include things which are the exclusive responsibility of individual member states.
Mixed agreements usually need to be ratified by national and in some cases regional parliaments – but not always.
The recent EU-Japan free trade agreement, for example, contained some mixed provisions but it was decided ratification was necessary at EU level only.
And it is widely assumed the same thing would happen with an EU-UK deal.
In those circumstances a deal would need the written agreement of the Council of the European Union, which could be signed off by government ministers or even ambassadors from each of the member states, and the consent of members of the European Parliament (MEPs).
“Both could give their approval as late as 31 December,” Georgina Wright, an associate at the Institute for Government, says.
“Though ideally MEPs would schedule their vote a few days before then.
The second option would be to provisionally apply the agreement, either in part or in full.”
EU law (Article 218 paragraph 5 of the EU treaty) allows the council to give the go-ahead for an agreement to be signed and applied provisionally, without formally consulting the European Parliament.
That means things such as tariff-free trade – with no taxes to pay on imports – could continue without parliamentary consent.
But that’s never happened with an EU trade deal before.
And it would be very controversial with some MEPs.
But plenty of MEPs say they need more time to examine an agreement properly.
And this would be another way to give them that time.
The alternative would be to have a brief no-deal period in January before a delayed agreement came into force.
But that would mean added disruption.
A provisional arrangement would also be in line with Article XXIV of the General Agreement on Tariffs and Trade (Gatt), a piece of international trade law that allows countries to reach “interim” agreements, so they can offer preferential trade terms to each other before they have signed off a full trade deal.
We’ve talked about Article XXIV before.
Earlier in the Brexit process, it was incorrectly put forward as a solution to allow free trade even if no agreement was in place.
For now, everything rests on intense negotiations behind the scenes.
“The clock puts us all in a very difficult situation,” European Commission President Ursula von der Leyen told MEPs on 16 December, “not least this parliament and its right to exercise democratic scrutiny and ratification.”
The process is unlikely to be straightforward over the next few weeks, partly because this is all uncharted territory.
But if no-deal is the end result, it won’t be the process that is responsible.
It will be politics.
What claims do you want BBC Reality Check to investigate? Get in touch
Read more from Reality Check
Follow us on Twitter