Behind closed doors, the Senate is drawing closer to passing a health care bill that looks a lot like the widely disliked version that cleared the House.

Any agreement currently on the table would almost certainly result in millions fewer Americans having health coverage, including low-income workers on Medicaid. It could roll back some Obamacare protections for people with preexisting health conditions.

The votes still aren’t there, but a path has opened to get them. Republicans have negotiated for a month inside back rooms of the Senate. They plan no public hearings on the legislation. Some of their members are eager to vote soon, acknowledging that public pressure against the bill is only likely to grow as the summer wears on.

The speed and secrecy have pushed GOP senators toward compromise on policy disagreements that once appeared too great to bridge. They are discussing how to end the ACA’s Medicaid expansion over a number of years. They are coalescing around cuts to the entire Medicaid program — the big question being how large those cuts might be.

Senate leaders are pushing a compromise on how much to unwind Obamacare’s protections for people with preexisting medical conditions — though it could still leave those patients vulnerable to losing the comprehensive coverage they receive now.

There’s broad agreement to increase the money the House bill would spend subsidizing Americans who buy insurance on the individual market. That increase would probably improve, at least somewhat, the Congressional Budget Office’s projection that the House bill would cause 23 million fewer Americans to have health insurance a decade from now.

The effort could easily fail. Any trio of conservative or moderate senators could sink the bill. The “budget reconciliation” procedure Republicans are using to pass their plan without any Senate Democrats restricts what policies they can include, which makes negotiations a little more difficult. Disagreements over provisions covering abortion and funding for Planned Parenthood could prove too much to overcome.

Still, Senate leaders appear more optimistic that a deal is in sight.

“Slowly but surely, I think we’re gonna get there,” Sen. John Cornyn (R-TX), the No. 2 Republican, told reporters on Thursday. “We’re coming together.”

The Senate negotiations are picking up and taking shape

No public hearings are expected on the bill, as the Senate is undertaking a deliberately more secretive process after the House’s raucous, though abbreviated, debate.

Senate Majority Leader Mitch McConnell (R-KY) presented GOP senators with some concrete policy choices this week. They are the result of weeks of closed-door discussions by a working group of a dozen or senators, plus daily talks with the entire GOP conference.

McConnell’s offers, and the accompanying counteroffers from different segments of his conference, have helped to accelerate the health care talks.

“I think we’re closer because there’s a proposal out there, so that gives everybody an opportunity to weigh in,” Sen. Rob Portman (R-OH), who will be one of the weathervanes on the bill’s chances, told me on Thursday. “Whereas when it was just a wide open discussion, it was hard to come up with any consensus.”

Portman has been lobbying to soften the House bill’s cuts to Medicaid. If he comes around to support the bill, then other senators focused on Medicaid would likely join him, bringing the bill that much closer to the bare majority it needs.

“We’re not there yet,” he said.

Twenty Republican senators represent states that expanded Medicaid under Obamacare, covering millions of their poorest citizens. Many have expressed concerns over the House bill, which will abruptly cut off Medicaid expansion funding in 2020.

McConnell has offered instead to phase out the cutoff over three years, and to eventually lower the federal share of spending for those enrollees to the usual Medicaid rate, down from the more robust expansion rate. More moderate senators, led by Portman, countered with a seven-year phaseout.

You see how they could resolve that disparity: Meet in the middle and roll back the expansion over five years.

Portman demurred when I asked him about what seems like a logical compromise. “Who knows?”

For what it’s worth, left-leaning experts say it doesn’t make much of a difference: The cuts are coming either way, as Vox’s Sarah Kliff notes.

If you delay ending the Medicaid expansion the ultimate result is — surprise! - ending the Medicaid expansion. pic.twitter.com/MaLuzS90iC — Sarah Kliff (@sarahkliff) June 8, 2017

But the point is, Senate Republicans are now at the stage where they can have this kind of specific negotiation and try to find a middle ground. Portman has been saying for months that he wanted this “glidepath” for Medicaid expansion. Now they are haggling over the details.

But plenty of policy fights still haven’t been resolved

Republicans don’t only want to roll back the Medicaid expansion; they are planning to completely overhaul the program’s financing, instituting a cap on federal spending for the first time. If conservatives acquiesce to this slower rollback of Medicaid expansion, they might want steeper cuts through the spending caps. But moderates are going to be reluctant to support deeper Medicaid cuts of any kind.

Several important technical details that will shape the spending caps haven’t been agreed on, Cornyn said on Thursday.

Then there are Obamacare’s insurance regulations. McConnell again sought to find a compromise in his offer to his members. The House bill allowed states to waive the rule that prohibits insurers from charging sick people more than healthy people, as well as the requirement that plans cover certain essential health benefits.

Some senators opposed the first kind, saying they didn’t want to roll back the explicit protections for people with preexisting medical conditions. “No waivers,” Sen. Dan Sullivan said last month.

McConnell proposed allowing only waivers from the essential health benefits requirement, per Axios. That could still allow insurance companies to craft plans that omit certain services, putting sicker people at risk of being unable to find coverage that includes what they need.

But McConnell’s proposal would allow his members to say that, by the letter of the law, they weren’t allowing discrimination against people with preexisting conditions. That presents a potential breakthrough on the other issue — insurance reforms — that has bedeviled Republicans.

But conservatives still might balk. They want both kinds of waivers, a concession that House conservatives fought hard to get.

Sen. Ted Cruz (R-TX) has been mostly upbeat during the last month’s health care discussions, but sounded notably pessimistic on Thursday. He described “considerable work” that needs to be done and emphasized repeatedly the importance of lowering premiums. Conservatives think the waivers will do that.

The Senate is heading for a resolution, one way or the other

Plenty of skepticism remains among health care lobbyists that Senate Republicans will get their majority.

McConnell has decided that he’s pressing ahead one way or the other. Leadership is preparing the Senate for a vote in the next month or so — Cornyn said on Thursday that a pre-July Fourth vote was “a reasonable goal,” though he allowed it could come after.

The Senate leader’s calculus is simple: He wants to move past health care and onto other issues, like a tax overhaul, where Republicans think they’ll be more comfortable. The House bill is devastatingly unpopular — 20 percent approval, per the latest poll by Quinnipiac University — and lawmakers’ trips home this year have been marked by protests and rowdy town halls over the lower chamber’s plan.

“I don’t think this gets better over time,” Sen. Roy Blunt (R-MO) told Politico, describing the need to move quickly toward a vote. “So my personal view is we’ve got until now and the Fourth of July to decide if the votes are there or not. And I hope they are.”

The pressure that senators will feel as a vote approaches could compel them to back the bill despite misgivings and allow it to pass, a big win for Republicans. These steps toward compromise suggest that McConnell might actually be able to pull it off.

But the leader knows how difficult this issue is, given the wide differences within his conference; he’s compared it to a Rubik’s cube, one Republican lobbyist told me. There just might not be a plan that gets 50 votes.

In that case, he is ready to let the bill fail, bring the health care debate to a definitive end, and get over it.

“They’re gonna have a vote, I believe that,” a health care lobbyist said recently. “I don’t know if it’s gonna pass or fail. If it fails, they just move on. If it passes, hooray.”