Democrats flipped seven governorships, six state legislative chambers, and more than 300 state House and Senate seats on election night. The party went a long way to regaining control at the state level after suffering devastating losses throughout the Barack Obama years.

In some states, the consequences are obvious. Maine elected Democrat Janet Mills as its next governor and put Democrats in complete control of the Maine Legislature, which should bring a rapid end to a year-long fight over Medicaid expansion in the state. Tens of thousands of low-income Mainers should soon get health insurance, now that Republican Gov. Paul LePage’s obstruction of a voter-approved ballot referendum is coming to an end, and 70,000 people will gain health insurance.

Democrats even made some important gains in states where they didn’t win legislative control. In Pennsylvania, for example, they merely broke the GOP supermajority in the Senate. After Pennsylvania Republicans last year considered impeaching the state judges who ruled that the state’s congressional maps should be redrawn — which would have required a supermajority in the Senate — that is still a notable achievement for Democrats. Gretchen Whitmer will have to contend with a GOP legislature as Michigan governor, but she still broke full Republican control over the state.

The biggest changes will come in states where Democrats won legislative chambers and the governor’s office. Democrats secured trifectas — control of the governor’s mansion and both state legislative chambers — in Maine, Connecticut, Colorado, Illinois, Nevada, New Mexico, and New York on election night. They will now have total control of 13 states, versus 21 states under full Republican control.

Democrats didn’t win everywhere in the midterms. They had dreams of flipping the Michigan House and the Florida Senate and came up short. Minnesota, it was widely reported, is the only state that remains under divided party control of the legislature. But they did win a lot, and it’s going to matter.

Some Democratic priorities are likely to cross state lines: strengthening voting rights, reforming the process for drawing their state’s congressional and state legislative maps, countering the Trump administration on health care and the environment, and more.

But state governments have a strong influence on the core issues — health care, taxes, immigration, climate change — that dominate the national discourse too. This is how the big Democratic wins could change things.

Maine: Medicaid expansion is coming

Janet Mills beat Republican Shawn Moody decisively — 51 percent to 43 — and Democrats flipped the one Maine Senate Seat they needed to take over that chamber. They already controlled the House.

First and foremost, the Democratic takeover means the end of Maine’s Medicaid expansion drama. Maine voters overwhelmingly approved the expansion in a ballot initiative last year, but archconservative LePage used every legal and procedural quirk in the book to slow it down. A year after the ballot initiative passed, the 70,000 low-income people Medicaid expansion would cover in Maine still don’t have Medicaid.

The first item on the agenda for Mills will be ending the obstruction and expanding Medicaid. The governor-elect said as much the day after her election, explaining she would use existing state funds to cover Maine’s part of the expansion (under Obamacare, the feds covers 90 percent, the states are responsible for the other 10 after a phase-in period). The Democratic legislature could also pass a more permanent funding plan.

Carolyn Fiddler at the Daily Kos, who obsessively tracks state governments, also noted that the Democratic trifecta should have an easier time passing budgets — the venue for many big policy changes in any government — without LePage or Republicans in the Senate to slow things down. The Maine government actually shut down for four days in 2017 because of a dispute over raising taxes on hotel stays.

Colorado: Democrats could institute an ambitious environmental agenda

Democrat Jared Polis was the first openly gay man to be elected governor in US history, keeping the seat in Democratic hands, and Democrats also won the Colorado Senate to notch a new trifecta in the Rocky Mountains.

Polis ran on an ambitious policy platform, particularly on environmental issues. He wants more restrictions on fracking, and he has proposed making the state entirely dependent on renewable energy by 2040, the Denver Post reported.

Colorado is an idiosyncratic state on those issues, however, with voters rejecting a ballot initiative to restrict fracking on the very same night they elected Polis. Democrats in the legislature from the more rural parts of the state, where there is more skepticism about an overly green agenda, could complicate Polis’s plans for passing his preferred policies.

The governor-elect also campaigned on providing free preschool and full-day kindergarten to every Coloradan. That proposal has a price tag of $250 million (for starters); Polis has said he would convene a commission to figure out how to raise taxes to cover the cost, per the education news outlet Chalkbeat. Translating his campaign promise to reality will be yet another test for Polis; tax hikes are always harder to pass than they are to propose, even with united Democratic control.

Polis has also said he wants to overhaul the state’s health insurance market — this gets into the weeds, but the gist would be putting urban and rural patients into the same pool, to keep costs lower for the latter group, a proposal that previously stalled in the legislature, per the Post — and letting the state import prescription drugs. The Democrat has previously supported moving to a single-payer system, though earlier state-level plans for universal health care have foundered and may be simply impossible unless the Trump administration is willing to approve it.

Kansas: time for some centrism and some tax fights

One of the most satisfying wins of the night for Democrats was Laura Kelly toppling Republican Secretary of State Kris Kobach — an immigration hardliner and former leader of Trump’s voter fraud commission — to become Kansas’s next governor.

She’ll be working with a solidly Republican legislature, which means an aggressively progressive agenda is out of the question. But that wasn’t Kelly’s style anyway. The governor-elect instead ran on expanding Medicaid and fully funding the state’s schools after years of GOP control left the state budget in tatters.

Medicaid expansion, which would cover 150,000 poor Kansans, might actually be achievable. The GOP legislature approved Medicaid expansion in 2017, but then-Gov. Sam Brownback vetoed it and there weren’t enough votes to override his veto. With Kelly in the governor’s mansion, the Wichita Eagle reported this week that even some Republicans think expansion is likely.

School funding could be more of a minefield. Brownback’s regressive, tax-cut-happy economic agenda left a big hole in the state budget, one that Kansas began to repair last year with a set of limited tax increases. But another $50 to $100 million might be needed to get education funding back to what Kelly and the Kansas Supreme Court think it should be.

There is clearly an appetite for compromise in Kansas. But with Republican legislators already warning they’ll be a check on Kelly’s “liberal” spending inclinations, nothing is going to get done easily.

Wisconsin: a dog fight between a new Dem governor and GOP legislature

Wisconsin was another big Democratic win in the governor’s race, with Democratic state schools superintendent Tony Evers finally toppling Republican Gov. Scott Walker as he sought his third term. But the state legislature is still firmly in Republican hands.

It’ll be an adjustment in the Badger State, after nearly a decade of total GOP control. And despite Walker’s loss, the remaining Republican leaders don’t sound like they plan to play nice with Evers. House Speaker Robin Vos is already talking about trying to claw back power from the executive branch in the lame duck session, to limit Evers’s ability to implement his agenda on his own.

“If there are areas where we could look and say, ‘Geez — have we made mistakes where we granted too much power to the executive,’ I’d be open to taking a look to say what can we do to change that to try to re-balance it,” Vos said after the 2018 election, according to the Milwaukee Journal-Sentinel.

The GOP leader appeared to reject flatly one of Evers’s landmark campaign pledges, boosting education funding by $1.4 billion. Republicans also aren’t interested in Medicaid expansion, another plank in Evers’s platform.

But Evers’s veto pen is still a huge swing in power toward the Democrats. Wisconsin governors can veto individual items in the state’s budget, giving them significant influence over the state’s spending priorities.

New Mexico: Michelle Lugan Grisham targets a minimum wage hike and early education

Grisham won back the governor’s mansion for Democrats, after eight years of Republican Gov. Susana Martinez, and the party expanded its majorities in the state legislature.

During her campaign, Lujan Grisham said she wanted to raise the state’s minimum wage (just $7.50 currently) and pump more money into early childhood education. She has also expressed support for legalizing recreational marijuana, touting the tax revenue it could bring in.

Legislating had slowed to a crawl under Martinez and Democratic lawmakers. The outgoing Republican, for example, vetoed three different bills to expand solar energy in New Mexico. Once Lujan Grisham takes over in January, Democrats will finally have one of their own in the state’s highest office.

Nevada: Harry Reid’s machine gives Democrats free rein on their agenda

Democratic Clark County Commissioner Steve Sisolak defeated Republican Secretary of State — no doubt thanks in part to the political machine of Harry Reid — and Democrats held on to both chambers in the legislature to form another new trifecta.

The Democratic legislature has had a pretty willing partner in moderate Republican Gov. Brian Sandoval — cutting deals on taxes, spending, and a new Apple site — but Sisolak’s win will make it even easier for Democrats to implement their agenda.

Sisolak thinks of himself as a more moderate, business-friendly Democrat; he was instrumental to the deal that will soon bring the NFL’s Oakland Raiders to Las Vegas, per the Nevada Independent. He made education a focus on his campaign, promising to increase state school funding while also reducing class sizes.

The governor-elect supports gradually increasing Nevada’s minimum wage. He will also take over oversight of the state’s newly legal recreational marijuana market; he’s said one of his top priorities there is making it easier for marijuana companies to find banks that will accept their business, despite the federal constraints on marijuana-related financial transactions.

Connecticut: Democrats must focus on the economy with a new trifecta

Ned Lamont won in Connecticut to hold the governor’s mansion for Democrats, though it looked like they might lose it even in a good Democratic year. Lamont eked out his victory, but just barely, with outgoing Democratic Gov. Dannel Malloy deeply unpopular after years of economic stagnation in the state. Democrats also took over the Connecticut Senate, which had previously been evenly split between the parties.

The governor-elect’s priorities are raising the minimum wage to $15, free tuition for community college and new property tax credits that he says will help the middle class. He needs to address the state’s pension crisis, which is bad enough to warrant a recent credit downgrade for the state government. Lamont has also predicted the state could legalize recreational marijuana during the first legislative session of his term.

Malloy’s dismal approval ratings is a reminder that voters will turn on Democrats even in liberal states if they feel they aren’t good stewards of the government. Lamont’s top priority, beyond the policy specifics, will be restoring trust with the citizenry.

Illinois: a budget fix tops a billionaire governor’s agenda

J.B. Pritzker’s win over Republican Gov. Bruce Rauner has been a foregone conclusion for months, so the governor-elect and the Democratic legislature have had plenty of time to draw up their agenda for next year.

After his victory, Pritzker said his first step would be balancing the state budget, per the Journal Star. The budget is a mess: Even after some clever accounting, Illinois had, in effect, a $1.2 billion budget deficit last year. More unfunded pension liabilities — payments already promised to state workers that must be honored — has helped give it the worst credit rating of any state in the country.

The same week as his big win, Pritzker was assembling a team to fix the budget crisis. According to the St. Louis Post-Dispatch, the governor-elect thinks taxes on recreational pot, expanded casino gambling, and possibly legalized sports betting could provide much of the revenue needed to close the gap.

Pritzker also wants to move Illinois from a flat income tax to a progressive one, with wealthier residents paying a higher rate than the middle and working classes, though he hasn’t settled on any specific rates. But that would actually require a state constitutional amendment approved by the voters, which cannot be passed until 2020.

New Hampshire: divided government comes to the Granite State

Popular Republican Gov. Chris Sununu won an unexpectedly close reelection, but Democrats took over both chambers of the state legislature, bringing divided government to one of the nation’s most politically engaged states.

Family leave is one possible area for compromise. Democrats campaigned on six weeks of paid leave for new parents or family members who need to care for a loved one; Sununu threatened to veto a previous family leave bill, but indicated he would be open to another proposal, per the Salem Patch. The opioid crisis is also likely to be a focus, and Democrats in the state legislature have pushed a $10 million funding increase to address the epidemic, which has hit New Hampshire hard.

A big fight could be brewing over marijuana legalization, however. A state commission has been studying the issue and released a report on possible ways for New Hampshire to join the handful of other states that have legalized recreational weed. Democrats are generally in favor, but Sununu has been ardently opposed.