“The emergency motion for a stay pending appeal is DENIED.” So ends the judgment from the US Court of Appeals for the Ninth Circuit, which hears cases involving government agencies. On Thursday evening President Trump lost his appeal against an order made by a lower court that halted Trump’s executive order temporarily banning travel to the US from seven predominantly Muslim countries.

Some of Trump’s supporters instantly denounced the ruling, with one Senator describing the court as the most “left-wing” court. This is somewhat unlikely. Even if it has a liberal reputation, one of the three judges that ruled unanimously against Trump was appointed by George W. Bush.

Trump himself vented on Twitter, of course:

“SEE YOU IN COURT, THE SECURITY OF OUR NATION IS AT STAKE!”

That might sound ridiculous, coming from someone just defeated in court. But Trump is referring to taking it next to the highest court in the land, the Supreme Court.

All of this is positive, no matter what you think of the travel ban. The legal process is evidence of the US system working and doing what it was designed to do, constraining executive authority and a President pushing the limits. The US is a country of laws and lawyers. Claims that it embodies constitutional perfection are pure exaggeration, but it is pretty durable. And less than a month into the Trump Presidency he is finding out that while he might have won the Presidency with a reality TV campaign, governing is more complicated and best done with care and attention to detail.

Where the system will really be tested is if there is a security emergency, when the President has enormous power and it might be more difficult to constrain him because of public pressure and a climate of anger. Still, the latest decision suggests the lawyers and constitutionalists are on the case, or on Trump’s case, which is healthy.