It's all about the Constitution now. Republicans will control the White House and both chambers of Congress. They will be able to pass — or repeal — their preferred laws, because that's democracy. But to the Donald Trump opponents worried about what his presidency will bring, know this: There will still be limits to congressional or executive action, limits dictated by the Constitution and enforceable by the courts. The Constitution is designed to resist the tyranny of the majority. James Madison's machine of constitutional protection is about to kick into gear.

The Bill of Rights and the principle of equal protection give the main limits on government action, but the list of enumerated rights alone doesn't capture the purpose of the system. Most crucially, free speech and equal protection are supposed to preserve the capacity of electoral losers — Democrats this time around — to continue to participate in government.

That means Trump and the Republican Party can't stop their political opponents from expressing their views. They can't jail opponents in violation of habeas corpus. And they can't adopt laws that discriminate on the basis of race or sex or religion or national origin.

The good news is that the courts as presently configured are overwhelmingly likely to enforce these restrictions. Start with the First Amendment jurisprudence. Today's judicial conservatives are more likely to be free-speech absolutists than judicial liberals. I have great confidence that Supreme Court Justice Clarence Thomas, for example, would continue to apply his strongly speech-protectionist reading of the free-speech clause against laws passed by a Republican Congress, and that he would have no trouble getting a majority for his approach.

As for equal protection, the deepest judicial divisions for several decades have been over affirmative action, which conservatives say amounts to prohibited discrimination. There's been much less disagreement about whether laws that facially discriminate on the basis of race are permitted: The consensus is that they are not unless justified by a compelling interest and narrowly tailored to it. A Republican-passed law that discriminated overtly would almost certainly be struck down.

True, the justices have sometimes divided about whether laws that are facially race-neutral are actually discriminatory. It might be hard to get consensus about such laws. But once the Supreme Court is back to full strength with the appointment and confirmation of a conservative to fill Antonin Scalia's seat, the swing vote is going to be Justice Anthony Kennedy once again. And as the gay-rights cases demonstrated, Kennedy is acutely attuned to the value of human dignity. He's also made it extremely clear that he has no interest in reversing Roe v. Wade.

If Trump gets to replace a liberal justice — Ruth Bader Ginsburg (age 83) or Stephen Breyer (78) — then the court would have an outright conservative majority. Conceivably, that could lead to revisiting decisions like Roe v. Wade or the gay-marriage decision, Obergefell v. Hodges.

But it's extremely unlikely that the court would fundamentally roll back either of these rights. Despite its unpopularity, Roe has proved stunningly durable over the 43 (!) years since it was decided. Reversing it at this point would mark the court as wildly disrespectful of precedent. Chief Justice John Roberts has repeatedly signaled that he considers such extreme activism to be distasteful. And as a practical political matter, a reversal of Roe would fuel backlash against Republican candidates.

Gay marriage is, of course, a much newer right, and it would be easier for a conservative majority to overturn Obergefell, which has not yet acquired the patina of precedent. Yet the small-c conservative aspect of the Obergefell decision, with its celebration of the bourgeois institution of marriage, renders it much safer than might otherwise be thought. There would also be the tremendous practical problem of what to do about thousands of gay people who are already married — not to mention the further practical difficulties associated with gay marriage being recognized in some states but not others.

This is not to deny that a conservative Supreme Court could render strongly conservative decisions on a wide range of issues. It could, and it would.

Rather, the point is that even a conservative court would police the boundaries of legislation to preserve the basic structures of fundamental democratic rights. It might not do so aggressively, but it would still impose limits on Congress and the president.

Why am I so confident the courts would play their designated role of protecting the minority from the tyranny of the majority? The answer lies in the power of the institutional culture of the judiciary and of the rule of law.

There are many controversial issues in American legal thought, and there exist strongly conservative views on all of them. But even the most conservative judges and lawyers believe today that one purpose of the Constitution is to protect against majority oppression and that it's the job of judges to make it do so.

There is good reason for legal conservatives to celebrate the election results and for legal liberals to deplore them. And if the court goes conservative, there will be plenty of opportunities for conservative justices to push their agenda.

The crucial takeaway, however, is that the basic rights and the rule of law aren't going to disappear because Donald Trump was elected. The Constitution was built for our situation. It will endure, whatever challenges it may face.

Feldman is a professor of constitutional and international law at Harvard.