AFTER weeks of squabbling, California's politicians managed to get a budget approved this week. Their dispute had followed a familiar pattern. One side, spooked by yawning budget deficits, wanted to make deeper cuts to welfare payments. The other, fearful of the effects on California's army of unemployed, sought to find savings elsewhere. It sounds like a classic Republican-Democrat ding-dong. In fact, the row pitted one Democratic force (the governor, Jerry Brown) against another (the state legislature). Shut out of the talks, the state's opposition Republican legislators were reduced to boycotting budget hearings and issuing sulky statements.

In several of these they accused the Democrats of resorting to gimmickry in order to secure the constitutionally necessary balanced budget. The charge is fair: the budget makes heroic assumptions about revenues in the fiscal year that begins on July 1st, and features the kind of dodgy accounting tricks to which California's voters have become wearily accustomed. But although the message may be reasonable, the messenger is ignored. Some newspaper accounts of the budget debate did not even bother to report the Republican view.

California gave America two of its five most recent Republican presidents. But the state party has fallen on hard times since the days of Nixon and Reagan. After having fallen for decades, the number of registered Republican voters in California now stands at just 30% (see chart). With the number of voters expressing no party preference rising fast, the party is in danger of slipping into third place in the state. No Republican holds statewide office in California, and the Democrats enjoy wide majorities in both chambers. The picture is no prettier when it comes to elections for national offices. Republicans have not won a Senate election in California since 1988. The party now accounts for just 19 of the state's 53 congressmen. The last Republican presidential candidate to take California was George Bush senior. As the most populous state, California holds over one in ten electoral-college votes. But neither Mitt Romney, the presumptive Republican nominee, nor Barack Obama will bother to campaign here—although both regularly drop by to raise funds. The rot set in in the mid-1990s, says Allan Hoffenblum, a former Republican consultant. In 1994 Pete Wilson, the Republican governor, pushed aggressively for a law to deny public services and benefits to California's growing number of illegal immigrants. This tarnished the Republican brand among Latino voters, many of whom might otherwise have been well disposed to a party with a pro-business, pro-family message. Two years later the Republicans lost their majority in the state assembly. “It's been a downward spiral ever since,” says Mr Hoffenblum. Still, for years afterwards the Republicans were able to wield great influence as a minority party thanks to a rule that required a two-thirds supermajority in both chambers to pass a budget. But since 2011 a simple majority has sufficed (a supermajority is still needed to approve any tax rises), which is why the Republicans were reduced to impotent grouches during the recent debate.

California's notorious gerrymandering has compounded the problem. Both parties have been pushed towards their respective extremes, but one party must rule and so the effects on the Republicans, as the minority party, have been worse. To win primaries, candidates in safe Republican districts (largely in inland areas) have had to please the conservative base, pledging tough lines on immigration and a stout refusal to compromise with Democrats.

This has left the party with a cadre of representatives several notches to the right of the median voter, and a serious reputational problem. These will be hard to erase even if new primary rules, which came into effect in time for votes on June 5th, succeed in making races more competitive (the jury is still out on this). All this in a state that is already “majority-minority”, and where Latinos are expected to outnumber non-Hispanic whites by 2016. Little wonder many reckon California's Republicans are doomed to permanent irrelevance outside their inland fiefs.

Fearing this, some insiders have sought to soften the Republicans' image. But an attempt to give the party a moderate makeover last year failed. One hardliner said his opponents were “castrating conservative ideas”. Now a few have decided that jumping ship is the only option. Several Republicans abandoned the party to run as independents in the recent primaries. This, of course, further weakens the moderates who remain on board.

Do the Republicans have a future in California? Joel Fox, a former strategist for the party in the state, thinks so. He acknowledges that there is a “branding problem”. But, he argues, a strong libertarian streak persists in many Californians which the party should be able to tap. Senior state Republicans understand the party's urgent need to expand its appeal beyond its base, he says. Eventually the new electoral rules—a “top-two” or “jungle” system that opens primaries to all voters, and electoral districts redrawn by independents—may reward politicians who can reach across party lines (or to independent voters), thus strengthening the hand of moderates.

Some, though, think the new rules will make little difference in the long run. What seems clearer is that the array of fiscal problems California faces is forcing at least some Democratic officials to tilt in a Republican direction. Voters in San Jose, California's third city, recently approved cuts to pension benefits for city workers by 70% to 30% after an energetic campaign by the Democratic mayor, Chuck Reed. Last year liberal eyebrows were raised when Gavin Newsom, the Democratic lieutenant-governor, journeyed to deeply Republican Texas, along with several Republicans, to uncover the secret of the Lone Star state's job-creation record.

Eyeing an opportunity, the Republicans have lined up behind a plan of Mr Brown's to rein in state pensions. They had sought a vote in the state assembly to get a measure placed on to the ballot in November. But Democratic legislators decided that more pressing matters were at hand.