Sometimes Kate Beschen lies awake at night, thinking about what she’d do if the health insurance she buys through the Affordable Care Act marketplace disappeared.

The 45-year-old Philadelphian has a chronic form of leukemia that she’d never be able to afford to treat on an adjunct professor’s income without insurance.

The occasional sleepless nights began after President Trump, who vowed during his campaign to repeal the health law, won the 2016 election.

But what was once a hypothetical monster under her bed is starting to feel more real.

In early December, a Texas judge issued a judgment that the Affordable Care Act is unconstitutional and should be eliminated, a move that would have a seismic effect extending to all kinds of insured consumers.

Millions of people who gained insurance through the ACA marketplaces and expanded Medicaid eligibility would lose coverage. Rules that require insurance plans, including those offered by employers, to guarantee coverage of pre-existing conditions would go away. Adult children would no longer be able to stay on their parents’ health plans until age 26.

“This would affect nearly every American in some shape or form,” said Katie Keith, an adjunct law professor at Georgetown University.

The Texas-based lawsuit, brought by 20 Republican attorneys general or governors, faces certain appeal, possibly all the way to the U.S. Supreme Court.

In the meantime, the ACA remains intact. The federal government has said it will continue to enforce the law — including health coverage for the millions of people who bought insurance through the ACA marketplace for 2019 — until a final ruling.

That’s good news for people like Daisy Fried, 51, of Philadelphia, who was able to sign up for health insurance for the first time in years when the ACA marketplaces opened in 2013.

A poet and part-time professor, Fried occasionally had access to health insurance through an employer, but mostly she just counted on staying healthy.

“I hit my 40s and was like, you know, this is getting a little scary,” said Fried, who expects to pay $270 a month for an ACA marketplace plan in 2019.

She never worried too much about being uninsured, but getting covered “made me feel more secure,” she said, especially as unanticipated health needs become more likely with age.

Whether Fried continues to have access to her health plan will depend on what happens ultimately with the Texas lawsuit.

The lawsuit arose after Congress decided to stop penalizing people who don’t buy health insurance, beginning in 2019. Under the ACA, most people were required to buy insurance or pay a tax penalty, a rule that, though unpopular, ensured enough healthy people were buying insurance to allow insurers to cover unhealthy members.

In an earlier lawsuit against the ACA, the Supreme Court ruled that the law was constitutional because it wasn’t forcing people to buy insurance. Rather, it was taxing those who didn’t, which Congress is allowed to do.

The Texas lawsuit alleges that with the tax reduced to zero, the individual mandate is unconstitutional and the law should be eliminated.

The Justice Department agreed that without the individual mandate, new rules for private insurers — such as requiring coverage for pre-existing conditions — should be revoked, but said the rest of the law should remain.

The case could take years to work through the legal system, and though ACA insurance remains available, uncertainty about the law’s future could do its own damage.

“It could have a very serious effect, even if it has no real legal effect at this point,” said Timothy Jost, a law professor at Washington and Lee University School of Law, during a call with reporters organized by the Commonwealth Fund.

Insurers will need to decide in the spring, before the lawsuit is resolved, whether to continue selling ACA plans in 2020 and how much to charge.

People confused over the status of their plans could fail to pay their first month’s premium, which is required for coverage to take effect.

Analysts speculated whether the judge’s order, which came out the night before the final day of the ACA marketplace’s open enrollment period, would deter people from signing up at the last minute.

Federal health officials announced Wednesday that enrollment is stronger than expected but still down from the same point last year. The data are preliminary.

“There’s this shroud of uncertainty that’s going to hang over everything,” Keith said. “We sort of just got to this place where the marketplace was stable.”

Legal scholars are skeptical that a higher court would uphold the Texas judge’s broad decision, but for people like Beschen, who are counting on insurance coverage made possible by the law, the threat is terrifying.

“There’s always the worst-case scenario and getting carried away. I’m not the person who thinks that way about life — full of fear about what’s going to happen. But this is an actual, real, practical fear,” she said.

Every three months Beschen pays $60 for blood testing to monitor her slow-growing blood cancer. Her monthly premium next year will be $70 because she qualifies for an income-based tax subsidy.

Without the ACA, Beschen could be denied coverage because of her pre-existing condition or charged an exorbitant — and out-of-reach — amount.

Eventually she’ll need chemotherapy, which would be unaffordable without insurance, she said.

She has looked into whether she could move to Canada or another country with universal health care.

Beschen thought she always would live in the country where she raised her own family, but she said she may not have a choice. She can’t afford to live without health insurance.