The Alliance Defending Freedom, the conservative legal group that argued the Masterpiece case, is currently litigating cases where free speech, religious freedom and public accommodation laws collide. Earlier this year, it filed a brief with the Kentucky Supreme Court on behalf of a printer who refused to make shirts for a Pride festival. The group is working on similar cases in Arizona and Minnesota.

Concern among gay rights groups

Advocates for same-sex marriage won a long-sought victory with Obergefell v. Hodges, but it sparked a backlash that complicated efforts to achieve other legal and policy goals. Among those goals: nondiscrimination in housing, employment and public accommodation, like locker rooms and public restrooms, and a robust response to the escalating number of bias-motivated killings, especially of transgender women of color.

The Trump administration has taken steps that run counter to many of these goals. It has appointed lower court judges that advocacy groups say have poor L.G.B.T. rights records, issued sweeping “religious liberty” guidelines to federal agencies and contractors, and argued in a 2016 federal lawsuit that the Civil Rights Act of 1964 does not protect gay people.

“I don’t think it’s too much of a leap to anticipate that a justice who is confirmed to the court to replace Justice Kennedy actually could result in a situation where we have a 5-4 decision on some very key issues, whether it’s marriage protections or the tensions between religious beliefs and L.G.B.T. nondiscrimination protections or reproductive rights,” said Ms. Long Simmons of the National L.G.B.T.Q. Task Force.

Activists pointed to state-level restrictions on abortion as a model for how already-established rights, like same-sex marriage, could be undermined. Measures in states like Arkansas and Texas have limited the availability of abortion services despite Roe v. Wade.

“What we’ve seen is you don’t have to go overturn the marquee case in order to make the rights inaccessible to real people,” said Rachel Tiven, the president of Lambda Legal, an L.G.B.T. legal advocacy group. “The question isn’t whether or not the marriage equality decision will be overturned — the threat is they will be hollowed out from underneath by a combination of religious exemptions and state rejection of equal treatment.”

Trying to read the next court

Religious conservatives had been cautious about what cases involving marriage to bring to the court as long as Justice Kennedy was on the bench, concerned that it could establish precedent with a ruling unfavorable to them. Now that Justice Kennedy has retired, the dynamic has shifted, said Mr. Staver, and it is gay rights groups who should proceed with caution.