The UK will leave the EU on Friday night. What are the implications for Northern Ireland?
What happens on Friday?
At 23:00 GMT the UK, including Northern Ireland, will legally leave the EU.
The UK will no longer be represented in EU institutions and Northern Ireland's three MEPs will no longer sit in the European Parliament.
In that sense Brexit will be "done" but there will be little practical impact because a transition period will immediately begin.
What is the transition?
It is a standstill period in which all parts of the UK will continue to follow EU rules and contribute to the EU budget.
Its purpose is to provide a breathing space in which the long-term relationship, including a trade deal, can be negotiated.
It will only last until the end of 2020 and the prime minister has promised it will not be extended.
The trading relationship between the EU and UK will be unchanged during the transition period.
Northern Ireland's trading relationship with the rest of the UK will also stay as it is now during the transition.
Much of the focus has been on what sort of trade deal the two sides can achieve in the next 11 months, but they will also have to negotiate the details of their broad agreement on Northern Ireland.
What has been agreed on Northern Ireland?
After Brexit, Northern Ireland will be outside the EU while the Republic of Ireland will remain inside.
The UK and EU agreed this should not lead to new checks or controls on goods crossing the border between the two parts of Ireland.
To achieve this, Northern Ireland will continue to follow EU rules on agricultural and manufactured goods, while the rest of the UK will not.
Additionally, the whole of the UK will leave the EU's customs union but Northern Ireland will continue to enforce the EU's customs code at its ports.
This will mean some new checks and processes for goods moving between Northern Ireland and other parts of the UK.
The UK and EU now have to negotiate the nature and extent of those checks.
During the election campaign, the prime minister insisted that for goods moving from NI to GB, there would be ""no forms, no checks, no barriers of any kind".
The EU is equally clear the deal means NI to GB goods trade will face a new administrative process known as an exit declaration.
The prime minister has also told MPs that goods moving from GB to NI will remain "unfettered".
But the EU has said there will have to be new checks, particularly on food products.
Clearly, this is all going to have to be negotiated.
Who will be doing the negotiating?
The operation of the whole withdrawal deal will be overseen by a joint committee of the EU and UK.
It will be led on the EU side by a member of the European Commission and on the UK side by a government minister.
There will also be a specialised committee focussing solely on the Northern Ireland part of the deal.
It will be able to receive proposals from the north-south bodies set up under the Good Friday Agreement.
As part of the recent deal to restore devolution in Northern Ireland, the UK government committed to having Stormont ministers in their delegation at meetings of these committees.
However, that will only apply in certain circumstances.
Stormont ministers will be invited when the committees are discussing Northern Ireland-specific matters and the meetings are also attended by the Irish government as part of the EU's delegation.
There will also be a joint consultative working group which seems like it will be the main way for business groups and other stakeholders to have an input.
What are the trickiest Northern Ireland issues?
Customs raise lots of potential problems.
Northern Ireland will remain part of the UK's customs territory under the deal.
But goods entering Northern Ireland from Great Britain and deemed "at risk" of being moved to the Republic of Ireland would be subject to EU tariffs.
The tariff payment could be claimed back if it can be shown the goods were consumed in Northern Ireland.
There will have to be agreement on what goods are "at risk".
Northern Ireland businesses will be pushing to have as few products as possible at risk, but the EU may take a more cautious line.
The tariff rebate system will also have to be designed and be ready for implementation.
Would a trade deal solve the customs issue?
A large part of the tariff issue could be eliminated if, in the wider negotiation, the UK and the EU can agree a zero-tariff trade deal covering all goods.
Zero tariffs means no GB-made goods entering Northern Ireland would be at risk.
However, the issue would not be eliminated entirely if the UK and the EU have different tariff policies with third countries.
It's also important to remember that a trade deal will not replicate the EU customs union of which the UK is currently a member.
Customs declarations will, in future, have to be made for shipments of commercial goods from Great Britain to Northern Ireland.
The negotiations will focus on how to make those customs processes as frictionless as possible.
What if there is no trade deal at the end of the transition?
A no-trade-deal Brexit would affect Northern Ireland and the rest of the UK in very different ways.
England, Scotland and Wales would face tariffs and other trade barriers with the EU.
Northern Ireland would not.
That's because the withdrawal deal guarantees frictionless trade with the Republic of Ireland and by extension the EU.
There would not be a hard land border, however, it would mean significant trade barriers between Northern Ireland and the rest of the UK.