Congressional Democrats confront an unusual problem in trying to pass large investments in the nation’s economy, its environment and its social well-being: Just about everything they want to do is popular, yet when you add everything up, it costs a politically eye-popping pot of money.

Think of it as an especially challenging version of the Goldilocks problem: What’s not too small, not too big, but just right?

If the final bill is too small, popular priorities fall by the wayside. Do you cut climate spending or the duration of the child tax credit or health-care expansions? Or housing or home care for the aged, or early-childhood education? Trimming any of these would create legitimate howls of protest not only from progressives but also from more middle-of-the-road advocates of the programs involved.

But doing everything that Democrats would like to do could mean doubling or tripling the overall spending number that more cautious Democrats might find comfortable. The range runs from the $2 trillion that Sen. Joe Manchin III (D-W.Va.) has mentioned to Sen. Bernie Sanders’s (I-Vt.) proposed $5 trillion to $6 trillion, with President Biden weighing in initially around $4.5 trillion. (Yes, he does have a knack for finding his party’s center ground.)

And Democrats have no room for error with a 50-50 Senate and a narrow majority in the House. There’s not a lot of time. Most senators figure that if they want to keep the process on track, they have only about three weeks to pass a budget resolution. Then there’s the matter of paying for some share of it with the corporate and high-income tax increases that Biden and other Democrats have proposed. “The pay-fors,” House Budget Committee Chairman John Yarmuth (D-Ky.) told me on Wednesday, “are actually harder than the investments.”

The practical challenge is far more significant than the ideological arguments that get so much attention. Nothing that Democrats are talking about amounts to left-wing adventurism. None of it implicates the culture wars that Republicans keep trying to move front and center.

And Democrats are broadly united on core priorities. They collectively believe that everyone should have access to affordable health insurance, child care and higher education; they would like a permanent child tax credit to help poor and middle-class families; they know that climate change is an urgent challenge.

“Everybody understands that this is probably a once-in-a-lifetime opportunity to pass transformative legislation,” said Yarmuth, who has talked with House members across the party’s spectrum. Yet that, he added, can work both ways. It creates solidarity to take advantage of the opening but also builds pressure to get as much done as possible before the window of possibility closes.

Republicans, it should be said, had a similar problem with their 2017 corporate tax cut. They, too, wanted to stuff a lot into one bill. They tried to reduce its long-term cost on paper by making some of the cuts temporary and by raising some revenue (notably to the disadvantage of Americans living in high-tax, mostly Democratic states). The big difference is that while the 2021 Democrats are pushing ideas with broad public support, the GOP corporate tax cut was never popular.

The lesson, Yarmuth argues, is that the net cost of the forthcoming bill should be judged not just by its spending but also by his party’s willingness to offset its expenditures with new revenue. Sen. Chris Van Hollen (D-Md.), a member of the Senate Budget Committee, suggested that while Democrats will need to find ways of paying for the programs that have recurring costs, one-time capital investments (for example, on various climate initiatives) need not face the same burden.

Beyond the specific budget issues, said Sen. Sherrod Brown (D-Ohio), Democrats need to keep the debate focused on the benefits their programs will deliver. As an example, he argued that families will immediately understand the value of the temporary child tax credit passed as part of the economic rescue bill this spring “when the checks arrive in the mail or in their accounts” this month and in months to come. This will create an impetus to extend the credit or make it permanent.

The party’s political task, Brown said, is to “show people what we have done because of their vote.”

Yes, Biden and his party will be judged — in the 2022 elections and after — by how they respond to two big challenges. One, which goes beyond any spending program, is whether they legislate to defend democracy itself from attacks in Republican-led states across the country. The other is whether they manage to hold their fragile majorities together to keep the big promises they have made. They have no choice but to summon their inner Goldilocks.