The devil is in the details, and here’s the one that means the new bill in Albany to renew mayoral control of schools will seriously weaken the system: The mayor, and others who appoint people to the Panel for Educational Policy, will no longer be able to replace them at will, but only for “good cause.”

That sounds democratic, but the PEP is not supposed to be that. It is supposed to be the tool by which mayoral control is exercised. Now, the PEP defiance that sprang up at the end of the de Blasio administration and has continued under Mayor Adams will spread. So much for control. Adams will be handcuffed.

The bill also will expand the PEP from 15 to 23 members, just adding more bureaucracy. And the panel will eat up more of our leaders’ time, as the terms will only be for one year.

The deal has the support of the United Federation of Teachers, and it’s no wonder why: It also will cut class sizes to 25. We support that element in principle, but how can it be achieved without building new schools? There’s no guaranteed state funding attached to the mandate, so it’s largely a jobs program for city teachers without a sure way of paying for it. The one thing that could make the goal easier to accomplish is the loss of students city schools have suffered since the virus came, but that’s no achievement. At least the city gets five years to lower class sizes. Mayoral control, meanwhile, is only renewed for two. It should have been extended for four or more.

Another problem is what’s missing from the bill. There will be no charter school expansion, something Albany had forced de Blasio to accept in 2017 in return for renewed control. Now the tables are turned: Adams backs charter schools, which overall are fantastic, but the UFT’s allies in Albany, such as state Sen. John Liu, a key player on education issues, do not.

Adams and Schools Chancellor David Banks are reformers but the regressives just dealt them a heavy blow. Kids will lose out.