WHAT to do when the party you have been backing loses sway? That is the question facing Western supporters of the Syrian National Coalition, the umbrella group that claims to represent the main political opposition, and its armed wing of loosely allied rebel militias, known as the Free Syrian Army. Especially on the ground in Syria, these relatively moderate groups have been losing out to other factions, particularly jihadist ones. As a result, the American administration and European governments are in a bind.

As the jihadists grow in strength, some Western officials are starting quietly to advocate re-engagement with Bashar Assad, Syria’s president, while others think the only course left is to work with devout Islamists who reject the extremists but who nonetheless refuse to be part of the coalition hitherto backed by the West. With negotiations supposed to start in Geneva on January 22nd, Western governments are still puzzling over which military factions to back on the ground. “I’m not sure where we are,” says a Western diplomat involved in preparing for the conference.

The immediate cause of this mess is the growth of al-Qaeda affiliates in Syria. The Islamic State of Iraq and al-Sham (Greater Syria), known as ISIS, the most ruthless of the groups, has spread across northern and eastern Syria, while another al-Qaeda bunch, Jabhat al-Nusra, still thrives, too.

This has caused alarm in Western capitals and among Syrians who mutter that the extremists may be even worse than a regime that has used fighter jets, barrel-bombs and chemical warfare against civilians. With Russia and Iran doggedly behind him, Mr Assad has stood firm.

That leaves only one non-al-Qaeda opposition lot with real power: a newish clutch of seven beefy Islamist groups called the Islamic Front. This includes Ahrar al-Sham, a large Salafist outfit, and the Army of Islam, a collection of groups around the capital, Damascus. The front has distanced itself from the military wing of the coalition, headed by Selim Idriss, a defected brigadier, but also from ISIS.

But Western policymakers are unsure how to relate to the front. Coalition members have denounced it as too conservative and undemocratic yet have tried to foster links to it. American diplomats have been in touch with it, but the West is generally wary of becoming too close to it because its fighters have been guilty of brutal sectarian attacks on Alawite civilians in Syria’s coastal area, home to the Assads’ sect.

The West signalled its unease on December 11th when American and British officials confirmed that non-lethal aid to Syria’s rebels in the north had been frozen after the Islamic Front seized several rebel bases and warehouses belonging to the coalition close to the Turkish border. Two days before, Razan Zeitouneh, a secular lawyer who was prominent in peaceful protests against the regime two years ago, was kidnapped from her office, possibly by a group within the front.

Now Western governments seem more preoccupied with the jihadist threat than with forcing out Mr Assad and his regime. Hence the notion, aired recently by veteran American diplomats such as Ryan Crocker, that the least bad course would now be to talk to Mr Assad, with whom the West has already been co-operating over the removal of his chemical weapons.

It is not yet clear who, in any event, will represent Syria’s opposition at Geneva. The Russians suggest groups outside the coalition. While they and the Americans will sit at the table, it is unclear whether Iran and Saudi Arabia, which has funded the Islamic Front, will be there. Without them, it will be harder to make a deal stick.

In a reminder of the wider peril generated by Syria’s agony, a big car-bomb exploded near Lebanon’s border with Syria on December 17th, probably aimed at Hizbullah, Lebanon’s Shia militia that has thrown its weight behind Mr Assad, widening Lebanon’s own stark sectarian rifts. A massive influx of at least 1m Syrian refugees, most of them destitute, is making Lebanon, with its mixed populace of 4m, increasingly tense. Many are crammed into flats, some sleep under bridges, others are packed into already crowded Palestinian refugee camps or are scattered in tents across the bitterly cold Bekaa valley close to the Syrian border. The UN reckons that the flood of Syrian refugees across the region could exceed 4m by the end of next year. Already 2.3m have fled abroad and 6.5m have been internally displaced. This week the UN began raising $6.5 billion in aid for Syria, its biggest-ever appeal.