So now that the UK has voted to leave the European Union, what will happen next in Britain's relations with the bloc:
1. WHAT DOES IT ALL MEAN?
The EU is in shock and entering uncharted territory. No member state has ever left and Article 50 of the EU treaty, which sets out how a state can exit the bloc, offers little detail.
Although it provides a sketchy legal framework for a two-year period of withdrawal (see below), many believe it will take longer to establish a new trading relationship between Britain and the EU and some fear the process will become bitter, disrupting the economy and European affairs across the board.
David Cameron has said he will resign as British Prime minister by October and leave it to his successor as leader of the Conservative party to notify the Union that Britain is leaving by invoking Article 50.
That will set that two-year clock ticking and the EU itself cannot, officials believe, trigger the process itself.
Some in the EU want the process to start more quickly, even as soon as Mr Cameron briefs EU leaders at a summit on Tuesday, and are concerned about suggestions from Brexit campaigners that they might prefer to open new negotiations before triggering Article 50.
Mr Cameron's potential successor Boris Johnson said he saw no reason to start the process and that nothing need change in the short term.
A deal Mr Cameron struck with EU leaders in February to curb immigration, protect London finance interests from the euro zone and opt out of "ever closer union" has been killed by the referendum result and EU leaders have ruled out new talks on a different form of British EU membership - "Leave means leave".
Many want a quick, two-year divorce while negotiating terms for a future, arms-length relationship may take much longer. However, Germany in particular is keen to see as orderly a transition as possible to a new relationship.
That might involve Article 50 negotiations, which the treaty says should "take account" of the new EU-UK relationship, being extended beyond two years to allow time for a broader deal. Such an extension requires the consent of all EU member states, and reaching that unanimity could be problematic.
Nonetheless, EU lawyers and politicians are renowned for their ingenuity. One EU official said that a divorce treaty requiring only a majority vote might be agreed within two years but to take effect only once a second treaty establishing a new relationship was finally concluded.
There are a number of options open to Britain, including to maintain its access to EU markets in the manner of Switzerland and Norway - although EU leaders have said the price for that could be allowing free EU migration and accepting other EU rules that voters have just rejected in the referendum.
If no treaty is agreed, EU law simply ceases to apply to Britain two years after it gives formal notice it is leaving.
Until a departure treaty is signed - which requires assent from Britain and a majority of the remaining 27 states weighted by population - Britain remains, in principle, a full member of the EU but will be excluded from discussions affecting its exit terms. In practice, many expect British ministers and politicians to be rapidly frozen out of much of the Union's affairs.
Some Brexit campaigners have also said Britain should act more quickly, for example to stop funding the EU budget or curb immigration from EU states. That could provoke EU reprisals.
"The Article 50 process is a divorce: who gets the house, who gets the kids, who gets the bank accounts," a senior EU official said, referring to priorities such as settling the EU budget and the status of Britons living in other EU states and of EU citizens in Britain - several million people in total.
Failing to stick to Article 50 would be "messy divorce territory", the official said: "It is spouses, instead of working through lawyers, throwing dishes at each other."
An array of laws and EU entitlements will cease to apply to British business and citizens, creating what Brexit campaigners say will be opportunities for more growth and more selective immigration but which Mr Cameron has said will do long-term damage to the economy and Britain's global influence.
New trade barriers would hurt both sides' economies. But many EU leaders fear that a political "domino effect" of other countries voting to quit the bloc would cost more long-term.
2. WHAT'S HAPPENING RIGHT NOW?
EU leaders and the heads of EU institutions in Brussels have delivered statements that broadly stress a mantra of Three Rs: Regret - at losing nearly a fifth of the EU economy and more of its military and global clout; Respect - for the will of the British people; and Resolve - to keep the other 27 together.
They also reminded Britain that it remains a full member for the time being, with all the rights and obligations that entails.
Foreign ministers are meeting all day in Luxembourg.
Foreign ministers of the bloc's six founders, Germany, France, Italy and the Benelux trio, meet in Berlin tomorrow.
EU "sherpa" advisers to the leaders meet in Brussels at 1.30pm on Sunday, when a Spanish general election will also affect EU business.
On Monday, EU summit chair Donald Tusk and French President Francois Hollande will meet in Paris and then travel to Berlin to meet German Chancellor Angela Merkel and Italian Prime Minister Matteo Renzi.
Jean-Claude Juncker, who leads the EU's executive Commission which will negotiate the details of a deal with Britain, plans a meeting of its college of 28 national commissioners for Monday.
Britain's commissioner, close Cameron ally Jonathan Hill, faces being stripped of his sensitive portfolio overseeing banks and financial services. He may choose to resign. That would allow a new British prime minister to appoint someone else to the Commission, albeit for a limited period until Britain leaves.
EU leaders will meet in Brussels for a 24-hour summit starting at 5pm on Tuesday. EU officials expect Mr Cameron to report on the vote and what Britain will do next, then go home that evening. Mr Tusk will then chair a meeting of the remaining 27, a format that will become familiar in the coming years of divorce talks.
Leaders may agree to meet again in July.
3. WHAT IS ARTICLE 50?
This 261-word section of the Lisbon Treaty has the following key phrases:
- A Member State which decides to withdraw shall notify the European Council of its intention ... The Union shall negotiate and conclude an agreement with that State, setting out the arrangements for its withdrawal, taking account of the framework for its future relationship with the Union.
- It shall be concluded ... by the Council, acting by a qualified majority.
- The Treaties shall cease to apply to the State in question from the date of entry into force of the withdrawal agreement or, failing that, two years after the notification ... unless the European Council, in agreement with the Member State concerned, unanimously decides to extend this period.
- The member of the European Council or of the Council representing the withdrawing Member State shall not participate in the discussions ... or in decisions concerning it.
4. WHERE DOES THE EU GO FROM HERE?
The Union needs quickly to fill a €7bn hole in its €145bn annual budget, which is currently fixed out to 2020, as it loses Britain's contributions while saving on what Britons receive from EU accounts.
The EU will also want to clarify as quickly as possible the status of firms and individuals currently using their EU rights to trade, work and live on either side of a new UK-EU frontier.
Britain is expected to give up its six-month presidency of EU ministerial councils, due to start in July next year.
Its place may be filled by Estonia or, possibly, Malta or Croatia.
EU leaders may push for a quick show of unity on holding the bloc together in the face of eurosceptics inspired by the result in Britain - including National Front leader Marine Le Pen, who leads polls for next April's French presidential election. But there is little prospect of major new projects.
Divisions between Berlin and Paris on managing the eurozone probably rule out a big move on that front before both hold elections in 2017. A major EU security and foreign policy review is already on the summit agenda as is a new push to tighten control on irregular immigration from Africa.
Many leaders caution against alienating voters by moving too fast on integration. Summit chair Donald Tusk wants to launch a formal process of reflection on where the Union has failed to connect with people.
5. SO WHAT CHANGES?
In principle, nothing changes immediately. Britons remain EU citizens and business continues as before. In practice, many believe trade, investment and political decisions will quickly anticipate British departure from the bloc.
The EU could also face a Britain breaking apart as europhile Scots plan another push for independence and seek to join the EU on their own.
There is a "Brussels consensus" that Britain must be made an example of for leaving to discourage others and will face a chilly future, cast out to perhaps talk its way back later into some kind of trade access in return for concessions such as free migration from inside the bloc and contributions to the EU budget - things which Brexit voters want to end but which the likes of Norway and Switzerland have accepted in varying forms.
However, cautious diplomats do not rule out surprise turns.