Democrats have been given a gift in 2016. Party officials are increasingly optimistic that Donald Trump's flailing presidential campaign will damage fellow Republicans and give them control of the Senate — and perhaps even the House.

Yet neither scenario is assured, even if Hillary Clinton wins the presidency in a blowout."Both houses are doable for Democrats. But the Senate is obviously much easier for them, and even that isn't a slam-dunk," said Larry Sabato, an election analyst at the University of Virginia. "In both cases, the prerequisite is a large Clinton victory margin."

If Clinton wins, taking the Senate requires a net gain of four seats. It will probably come down to six races rated "tossup" by Sabato's "Crystal Ball" forecast: five Republican-held seats (New Hampshire, Pennsylvania, North Carolina, Missouri and Indiana), and one Democratic-held seat (Nevada).

Some Republicans such as New Hampshire's Kelly Ayotte and Pennsylvania's Pat Toomey are running ahead of Trump and polling competitively against their Democratic rivals. Ohio's Rob Portman enjoys a double digit lead over Democrat Ted Strickland, and Wisconsin's Ron Johnson, long thought to be a lost cause, is within striking distance of Democrat Russ Feingold in two recent polls.

"I continue to be impressed by the ability of Republican Senate candidates to hang in there," said Ken Goldstein, a professor of politics at the University of San Francisco and polling analyst for Bloomberg Politics. With numerous Republicans separating themselves from Trump so far, it is "too early to say" who will win the Senate, he said.

There's no sign of a 2008-style wave yet, Goldstein said, but he noted they typically materialize in the final week or two before Election Day.The House will be much tougher to flip. Democrats need to gain 30 seats, and the deck is stacked against them given the GOP's geographical advantages.

Democrats are on track for double-digit gains in the chamber but remain "a long way off from winning the House majority," said David Wasserman, the House editor for the Cook Political Report.

Their path to the majority means winning the 190 races they're favored in under Cook's forecast, along with 17 tossups and 11 of 12 contests that lean Republican. The latter would require something akin to a miracle."In most of those races Republican are up by 10 to 15 points," Wasserman said. Gerrymandering helps "enormously," he said, but "the larger Republican advantage is that Democrats tend to live in urban districts where they're wasting a lot of votes."

In 2012, House Democrats came nowhere near the majority even as their candidates won an aggregate of 1.36 million more votes than their House Republican counterparts, according to an analysis by Wasserman.So far, Trump's woes are helping House Democrats extend their leads in already safe races, he said, without allowing them to make significant progress in the ones they need to flip to win control of the House.

If Democrats are to regain control, they'll need to win uphill battles against Republicans like California's Jeff Denham and Darrell Issa, New York's Lee Zeldin, Virginia's Barbara Comstock and Utah's Mia Love. All of those races are rated "lean GOP" by Cook.

Realistically, said a Democratic strategist, a net pickup of 12 to 16 House seats may be the extent of what is possible, even if Clinton soundly defeats Trump. Their prospects are diminished by redistricting and the costly media markets in many of the 50 districts that Democrats have publicly said they're targeting _ those held by Republicans but carried by President Barack Obama in 2012.

Party officials are awaiting specific, district-by-district polling on the impact of the Trump's lewd video comments and allegations of groping this week, said one strategist who requested anonymity to discuss internal deliberations.

One factor buoying congressional Republicans is a cash advantage. In a reversal from four years ago, more money is being directed to GOP down-ballot races than their presidential nominee, an analysis of Federal Election Commission data shows.So far in 2016, party committees, super-PACs and other outside groups have spent $223 million to aid Republican legislative candidates, up from $145 million through the same period four years ago. But Democrats have also upped their outside game, spending $163 million on House and Senate races and $312 million overall.

In 2012, Republican presidential nominee Mitt Romney was supported by $165 million in independent expenditures by super-PACs Restore Our Future, American Crossroads and others through the first ten days of October. This year, outside groups have spent just $77 million backing Trump.

But with each new damaging Trump revelation, Democrats grow more eager to tie him to other Republicans.Democratic Congressional Campaign Committee spokeswoman Meredith Kelly said Republicans haven't stood up to Trump's "hateful campaign" and it's "too late to push the panic button and try to separate from him now."

Democratic Senatorial Campaign Committee spokeswoman Sadie Weiner said GOP candidates' "support for Trump is a major judgement issue on their parts."

National Republican Senatorial Committee spokeswoman Andrea Bozek said Democrats have a "fatal and fundamental" flaw in their Senate strategy, in that they're relying on "political gravity from the presidential race to carry them across the finish line," rather than having superior candidates and campaigns.As far as the House goes, Sabato said a 9 to 10 point victory margin for Clinton could win it for Democrats.Wasserman argued that there's no "magic number" in the presidential race as it pertains to House control, noting the prospect of ticket-splitters like college-educated Republicans rejecting Trump but voting for other GOP candidates. He said winning the majority would require Democrats would need to extend their advantage in the generic congressional ballot to about 10 points.

House Democratic Leader Nancy Pelosi said last month that Democrats could win back the majority, but Republicans remain confident.

"Nancy Pelosi tries to project every cycle that the House may be in play," said Katie Martin, a spokeswoman for the National Republican Congressional Committee. She said Pelosi does that even if the details show something else.