CUSTOMERS arrive at a 24-hour supermarket in the centre of Riyadh, the Saudi capital, shortly before midnight, but little shopping takes place. Small groups of young men and women cruise the aisles eyeing each other. Interest in items on the shelves is cursory at best. In the car park outside they continue their flirtation until the police show up. Mingling between the sexes is discouraged in Saudi Arabia yet impossible to ban. “We chat online, but if we want to meet face-to-face we come here,” says a man in his early 20s.

The kingdom's larger cities are brimming with social friction and furtive action of this kind. Much of it is not explicitly political, but it hints at the strength of discontent bubbling below the surface. Growing wealth has raised the aspirations and political awareness of the country's 25m people. Some rail against corruption, echoing the complaints of demonstrators in Egypt and Tunisia, whereas others strain at social rules imposed half a century ago when the country was rural and poor.

So far Saudi Arabia's rulers have escaped the Arab spring largely unscathed. A “day of rage” in March last year fizzled out, and there has been no concerted effort by opposition groups to organise another. Nonetheless, the troubles afflicting the kingdom's Arab neighbours are a warning. Even some royals read events that way. “The Arab spring has changed people's expectations and the government needs to evolve,” says Prince Abdulaziz bin Sattam, a senior member of the ruling family. “The problem is well-understood but the solution is not yet defined. We have the resources, but we still have to perform in terms of services, education, health, employment and justice.” The royals mainly see discontent as an economic problem. Their subjects would like a larger share of the oil wealth, they believe. They are partly right, but rare opinion polls show that unemployment and inflation are the deepest public concerns. The official jobless rate is 10.6%, but informal estimates put that figure at 35% among young men in their 20s. With 60% of the population under the age of 21, urgent action is needed; yet the government has done little more than make grand promises. In January it announced plans to create 3m new jobs over the next three years, with a further 3m by 2030. This would be a mammoth task even for a country with a broad industrial base, which Saudi Arabia does not have.

Creating jobs is complicated by the failure of previous employment laws. To stem the widespread use of cheap foreign labour, the government forced companies to fill at least 30% of their positions with Saudis. But employers complained bitterly about the lack of skills among young locals; years of rote-learning and religious instruction fail to prepare them for the job market. The quota has now been dropped and replaced with a more flexible system.

At the same time the authorities try to minimise discussion of economic problems. Three young Saudi film-makers were arrested in October for making a short film about poverty in the kingdom and posting it online. Some news organisations were banned from reporting the recent case of a Saudi man attempting to sell his son on Facebook to raise money for the rest of his family. The authorities like to point out that incomes are rising. According to the Brookings Institution's annual MetroMonitor report, the Washington-based think-tank's ranking of global cities by economic performance, the only city worldwide to outperform the kingdom's two largest last year was Shanghai. Riyadh recorded a 7.8% rise in incomes.

But not all problems are economic. Public anger is mounting at the religious police poking their noses into private lives. Activists for women's rights are calling loudly for better treatment and internet scribes are testing the limits of free speech.

In some cases the authorities give a little ground. The head of the notoriously invasive Haia, the Commission for the Promotion of Virtue and the Prevention of Vice, was sacked following public protests. The new chief, Abdullatif al-Sheikh, is a known reformer and has pledged to overhaul the organisation. Women have also won marginally more freedom in the workplace. “Companies that started with two women in a separate office now employ 200 because they find them more productive and more loyal,” claims Mofarrej al-Hoqubani, the deputy labour minister.

Women are still not allowed to drive, though privately officials accept that the ban is untenable. The kingdom will never develop a dynamic economy if husbands spend hours every day ferrying wives to and from work. A royal order in February stipulated that women who drive should not be prosecuted by the courts.

But the general trend is toward a hardening of rules. Prince Nayef, the crown prince and power behind the throne, believes this is no time to show weakness. Dissidents are detained or given travel bans, a favourite tactic of the regime in Syria until it started to use harsher methods in the past year. Media rules have also become tighter.

No fly appears too small to warrant swatting. Hamza Kashgari, a young blogger, fled to Malaysia after posting provocative comments about the Prophet Muhammad. The government applied all available diplomatic pressure to have him returned. Emboldened senior clerics are asking for Mr Kashgari to be executed for blasphemy.

Religion is at the heart of many conflicts. The volatile but oil-rich Eastern Province, home to many of the Sunni kingdom's sizeable Shia minority, has witnessed frequent bouts of violent unrest in the past year. Two men were killed and several injured when police opened fire on a demonstration in February. In Qatif, the provincial capital, the walls of the main street are covered with graffiti insulting members of the royal family and asking, “Where is the oil money?”

The government accuses Iran of funding the protests. Shia leaders claim this is a convenient excuse to exclude them from politics. “The official story is always like this,” says Tawfiq al-Saif, a prominent Shia leader. “It just shows their failure to grasp the core problem.” The rhetoric on both sides is growing more poisonous. Hassan al-Saffar, a Shia cleric, denounced the royals for decrying the slaughter in Syria while repressing their own people and aiding a crackdown in neighbouring Bahrain. Meanwhile the interior ministry called protests a “new terrorism” and vowed to respond with an iron fist. It smells like springtime.