Britain and the European Union have a Brexit deal. Sort of.

As you surely know, back in June 2016, the British populace shocked the world by narrowly voting to leave the European Union. This was seen as potentially catastrophic for England's economy, as leaving the EU would drastically curtail the free movement of people, goods, and services that has been so critical to the U.K.'s economic growth. Since the vote, Prime Minister Theresa May and her fellow lawmakers in the U.K. and EU have been trying to figure out how to actually deliver on the referendum while avoiding disaster.

On Wednesday, the core members of May's Cabinet endorsed her draft plan for "Brexit." But within a day, several secretaries and junior ministers had quit May's Cabinet in protest.

Why? And what's next? Here's what you need to know:

What does May's new deal do?

A whole lot. May's draft is a beast that runs to at least 585 pages. It's also more of a framework for carrying out the divorce than an agreement on the final settlement.

Come hell or high water, Britain is legally out of the EU on March 29, 2019. But May's deal would create a transition period lasting until December 2020 to give Britain and the EU time to hash out a final agreement on trade and other matters. Then there's a looser statement of principles on what that final settlement will hopefully look like.

Within that framework, May's deal covers just about everything under the sun.

Trade between Britain and the EU would maintain its status quo for the transition period. After that, the goal is continued trade without tariffs and with minimal restrictions, though that's dependent on further negotiations.

Britain would still be able to participate in the EU criminal justice system and its policing operations during the transition. And it would still have access to EU databases for missing persons, fingerprints, criminal records, vehicle plates, and the like. How smoothly that database access would function is an open question, though. And Britain gets locked out of all of it come March 29, barring further arrangements.

EU funding for research and universities would remain available for Britain until December 2020; after that it's anyone’s guess. May's deal sketches out a process by which control over environmental regulations, energy and power utilities, nuclear fuel, and more would revert to Britain, but in a way that maintains continuity with the current EU standards. Arrangements for things like drug trials and fisheries still have to be worked out.

Britain would also pay $50 billion to cover staff pensions and other previous commitments to the EU.

What about immigration?

This was a major fixation of the Brexit debate. The pro-Brexit side was happy to use blatantly racist arguments and imagery to whip up a frenzy around its anti-immigrant case. But once again, May's draft is more about processes than finalizing the new relationship.

The pretty uninhibited movement across EU borders would stay the same during the transition. After that, EU citizens who come to Britain, or who are still in Britain, would have to apply for new documentation. The same goes for British citizens still in the EU. The draft says this new process will involve a skills-based immigration system, but will also be "short, simple, user-friendly." Beyond that, the deal commits Britain and the EU to figure out temporary documentation for "business purposes," for short visits, and cooperation on dealing with illegal immigration.

Are there other sticking points?

Yes, at the Irish border. Northern Ireland is part of the United Kingdom, and will leave the EU on March 29. The Republic of Ireland will remain in the EU. That means Brexit could split the island in two. Preventing the return to a "hard" border — with physical stops and customs checks — has been one of the most contentious points in negotiations.

As it stands, Britain and the EU will have to sort that out in the transition phase as well. But to make sure they do, May's draft includes an insurance policy. If no finalized agreement is reached by December 2020, Northern Ireland would automatically be subject to the EU customs rules: no tariffs on trade with other EU members, and the same tariffs as the rest of the EU on trade from outside. It would also have to keep abiding by a lot of other EU trade regulations. The rest of the United Kingdom would be subject to those same EU tariff rules for goods specifically, but not other forms of trade.

What happens next?

European Union member nations will assess May's draft over the next week or so. After that, they'll need to issue their own declaration for how they'd like to structure the future relationship between Britain and the EU. Everyone will then get a few more days to assess that document. Then the European Union Council will need to finalize the agreement on Nov. 25, and the EU member states will have to approve it. Finally, the British Parliament will also have to vote on May's deal, probably in early December.

Can May's deal pass the British Parliament?

It's unclear, but right now its chances don’t look great. Almost no one loves this thing — it's just a question of whether they love the alternatives even less. May's own Conservative party is internally split. And the Conservatives don't even have a majority in Parliament, meaning May will have to rely on a fractious coalition of parties to push the deal through. She could very easily fail. Some observers wonder if there will be a vote of no confidence in May's government.

Why does everyone hate May's deal?

A big chunk of the country never wanted Brexit and still doesn't. Among those who do support Brexit, many see May's draft as a capitulation to the European Union.

In a sense, the draft delivers the worst of both worlds: During the transition, Britain would remain subject to EU rules and regulations, but it wouldn't be an EU member anymore, and thus wouldn't have a say in designing those rules. If May's Irish "backstop" kicks in, that situation would continue on a lot of issues indefinitely. (Really, the idea of the backstop is to force everyone to figure things out by threatening an outcome no one wants.)

What if the deal doesn't pass?

In that case, things get ugly.

The British government could go back to the drawing board and come up with another plan. But May would only have a very short time to come up with it.

Failing that, Brexit would arrive with no deal at all. That's the maximum chaos scenario: Britain leaves the EU on March 29 with no agreed upon rules for how borders, customs, trade, and everything else should work from then on.

There's one other possibility, albeit an unlikely one: The government squeezes another referendum in before March 29, and gives British voters one last chance to admit their mistake and call the whole thing off.