YOU can’t fault them for trying. Discussing trade at last week’s disastrous G7 summit in Quebec, Europe’s leaders met Donald Trump’s volley of insults and half-truths with a fusillade of facts. Emmanuel Macron explained how market access works. Angela Merkel brought up America’s procurement rules. Thrown off-guard, Mr Trump responded by suggesting that the G7 should transform itself into a tariff- and subsidy-free zone (see Finance section). The fact that this would involve submitting to the rules and institutions he has built his political identity opposing was not lost on the president’s European friends. A better illustration of the transatlantic gulf would be hard to find.

The past few months have been especially rough for Europe’s relations with America, as Mr Trump first withdrew from the nuclear deal with Iran and then slapped tariffs on aluminium and steel imports. But the confrontation in Canada had a scales-from-the-eyes feeling to it. The United States is “saying goodbye” to the West, lamented Germany’s ambassador. One European official says his colleagues returned from the summit looking as if they had stuck their hands in a toaster.

What to do? Several responses suggest themselves. Capitulation is one. When Mr Trump’s metals tariffs loomed, some tremulous Germans wanted the European Union to seek a deal with America that would cut duties on all industrial goods. But after the encounter in Canada Mrs Merkel seems to have toughened up, and the EU will now indeed apply countervailing tariffs on some American products: “We won’t let ourselves be ripped off again and again,” she said after the summit. Yet nastier battles are on the horizon. Obsessed by the luxury German vehicles he sees on the streets of Manhattan, Mr Trump has instructed his Commerce Department to investigate whether car imports are a threat to national security. That is preposterous. Yet the tariffs that might follow could force many European automotive firms to abandon the American market, given their tiny margins. “There is not a single German chancellor who could sit still if this happens,” says Hosuk Lee-Makiyama, a Brussels-based trade expert. Other transatlantic rows, on taxation, industrial policy and energy, are brewing. Europe’s industrialists are ever more fretful.

A second strategy is improving resilience. Mr Trump likes to link the miserly defence spending of most European countries, especially Germany, to what he considers their rapacious trade policies. (Officials in Berlin are braced for a catastrophic NATO summit in Brussels next month.) This is why Mr Macron’s calls for “European sovereignty” are starting to find a German audience. For now such fine words are rarely translated into deeds; few Germans accept that their huge trade surplus leaves them politically exposed, for example, and the defence debate remains difficult. But, says Luuk van Middelaar, a Dutch commentator, “it’s dawning on them that something needs to change.”

A third strand is containment. The EU is striking deals, and co-ordinating responses to American protectionism, with allies like Japan and Canada. It is battling to keep the Iran deal alive with guarantees to firms investing there. Europeans’ dependence on the dollar as the world’s reserve currency limits their options. But the containment strategy is growing in importance.

What is Europe fighting for? Donald Tusk, president of the European Council, made it clear in Canada: “The rules-based international order is being challenged, quite surprisingly…by its main architect and guarantor, the US.” But it is getting harder to stand up for rules. The West lost its bet that prosperity would turn China towards democratic capitalism; neighbours like Russia and Turkey are flexing their muscles; and the transatlantic ally has lost any interest it once had in submitting to external constraint. Europeans are left to hope that their economic and regulatory muscle is enough to shore up rules and institutions, even as much of the rest of the world reverts to the law of strength.

Closing markets for trade is like drinking for sobriety

This should mean playing two games, not one, says Mr van Middelaar. For decades Europe could support rules and order at home while outsourcing security to America. Many Europeans secretly yearn to return to that happy arrangement once (they assume) Mr Trump leaves office in 2021; or sooner, if he is hamstrung by a hostile Congress after the November mid-terms. But Europe needs a strategy that does not rely on the whim of American voters. As power shifts eastward it is anyway becoming harder to think of ways in which America needs Europe. Mr Trump is a symptom of these changes; he is not driving them.

This calls for a bit of creativity, a virtue not found in abundance in Europe. On trade there is a risk of succumbing to Mr Trump’s logic of escalation, for the president thinks tariff wars are easy to win. Brussels’s trade wallahs, burned by previous talks with American officials they say were conducted in bad faith, are now keen to rule out any bilateral deals with Mr Trump’s administration. One alternative, suggests Mr Lee-Makiyama, is to push for plurilateral talks, conducted via the WTO and including Japan and Korea, on the reduction or elimination of car tariffs.

A spot of flexibility could help in other areas, too. In the Brexit talks the EU’s insistence on treating all “third countries” as identical could jeopardise security co-operation with Britain, one of only two serious military powers in the EU, after it leaves. It would be perverse for Brussels to limit the scale of Europe’s defence ambitions just as the neighbourhood is getting rougher. Mr Macron understands this. Mrs Merkel may be getting there.

It is easy to see why rules matter to the EU. They allow for extraordinarily deep relations among governments and undergird prosperity and peace in the world beyond. But just as skyscrapers are built to sway with the wind, Europe must find ways to adjust to a world where the weather is growing stormier. If Mr Trump helps teach that lesson, so much the better.