WHEN Hind Al-Otaibi went to the Riyadh Personal Status Court to have her father struck out as her wali, or guardian, the judges seemed sympathetic. Her father had raped and bruised her, Ms Otaibi, who was a teenager at the time, told the court. He refused to let her travel abroad, even to her mother’s funeral, and when she escaped from home had persuaded social services to send her back. After consideration, the judges determined last year that her father, an imam from the Saudi interior of Nejd, remained her legal guardian; but that a guardian only had powers to approve his ward’s marriage. If upheld on appeal, the ruling could topple the legal edifice of male control, depriving walis of their power over whether their women can study, work, travel or open bank accounts. “Emancipation from slavery,” says Ms Otaibi.

In recent years, the lot of Saudi women has improved. An increasing number of malls, gated communities and even private beaches, where women swap burqinis (the all-enveloping swimwear Saudi women must wear) for bikinis, were put off-limits to the prying eyes of the religious police. The government sent tens of thousands of women abroad to study in Western universities, where they could experience the freedom of moving, dressing and driving as they pleased. Those left behind could gawp at the gap between their own world and the virtual one to which many Saudis escape for hours every day.

Armed with doctorates, many have returned to prize open the job market. In 2012 the courts licensed their first female lawyer. Last December women for the first time stood for election to local councils. Bayan al-Zahran, a lawyer in Jeddah, has set up the first female-led law firm, and law faculties in women’s colleges churn out fresh attorneys.

The numbers, though, remain paltry. Only 18% of working-age Saudi women work (against 65% of men), one of the world’s lowest rates. And for all the headlines, the kingdom has only 67 female lawyers (out of 3,400), and 21 female councillors (out of 3,150). Female lawyers say they have to contend with judges who tell them to sit down when they stand up to represent clients. But over time the taboos on women in public life seem to fraying. “Women are better at representing other women because women natter more than men, and women understand them better,” says Judge Faisal Orani, fresh from sentencing a whisky-drinker to 80 lashes. He opposes the introduction of female judges, he says, “but over time, anything can change. Maybe I’ll change too.”

The kingdom’s joyless gender segregation persists. Banks maintain separate entrances for men and women, Starbucks restricts women from its open-air balcony and McDonald’s makes men and women queue separately for its burgers. In Riyadh and in Jeddah, though not in a few more liberal places such as Qatif, the clerics—who always opposed female participation in the elections—have stopped the new female local councillors from sitting in the council chambers with men.

But to clerical consternation, (veiled) women now operate the tills in Ikea, a Swedish furniture outlet, in a poorer part of Riyadh, and men and women queue in mixed aisles. At the King Abdullah University of Science and Technology outside Jeddah, male and female students attend the same lectures and mingle freely. Architects of new office blocks locate male and female toilets on the same floor.

Most Saudi women have yet to take the liberties their Iranian counterparts do with the veil. “Parents would object if I didn’t cover my face,” says a primary school headmistress who longs to remove it. But growing numbers of high-school girls are donning headscarves only, no matter that their elders consider that scandalous. In Jeddah, a more liberal port city, seamstresses design abayas with bright colours and women smoke water-pipes out of doors.

But worryingly, King Abdullah’s incremental reforms seem to be stalling and even going to reverse under his successor, King Salman. His young son, Muhammad, who operates most of the levers of power, says he is anxious to increase Saudi productivity, and to lower birth-rates, by getting women out of the home and into the workplace. But even so he seems nervous of confronting the religious establishment, on whom the Al Saud rulers depend for legitimacy. Many of Abdullah’s reformers have been shifted; and a host of hardliners are back. The only female minister, in the education ministry, was dismissed soon after Salman took the throne.

Four women who publicly defied the still unreformed ban on female driving were barred from contesting local elections. Shoppers in Jeddah report that the religious police are back, demanding that department stores black out any glimpse of unveiled women on their packaging. One executive at an international financial-services firm says that the snoops carried out three spot-checks on her office last year to check for signs of the sexes mingling. She is once again being forced to enter through side-entrances when visiting clients, while her male counterparts go through the front door; and they have to travel to meetings in separate cars.

In the new, more conservative environment, perhaps the best hope for women is that the country might rediscover its own traditions. A senior official admires footage of the Saudi state’s founder, Abdulaziz, holding court in 1930s Mecca, while women riding on horseback bring their wares to market. At Jeddah’s annual festival, the organisers display the colourful costumes women used to wear before the puritans imposed the black abaya of the central desert on the whole country. Most striking of all is the Prophet Muhammad’s own requirement that women and men perform the pilgrimage to Mecca together; and that when women go round the Kaaba, Islam’s holiest place, they show their face. Saudi Arabia’s new rulers might take note.