A VISITOR to Germany this summer will find a country living well. Gentle chit-chat and the clink of glasses murmur from sun-dappled beer gardens. Barges laden with exports chug up the Rhine. Prosperous vacationers travel to lakes and seaside resorts in new cars and slick, reliable trains. Yet striking up a conversation with one of these seemingly contented locals, the traveller may well be told that the country is going to the dogs. The discussion might begin with disconsolate reflections on the national team’s dismal performance in the football World Cup, then find its way on to the storm clouds over German industry, political instability and perhaps the difficulties of integrating the many migrants who have arrived in recent years. Are they really talking about the same country?

Pessimism comes easily to Germans. Gloom stalked their literature even before the traumas of the 20th century. “Simplicius Simplicissimus,” the first great German novel, describes a peasant wandering the devastated Holy Roman Empire after the Thirty Years War; Goethe and his contemporaries imagined love-struck romantics killing themselves in dark forests; Wagner’s Ring Cycle ends with Valhalla in flames. Few Germans ever quite believe that calamity is not just around the corner, reckons John Kornblum, a former American ambassador. He relays a tale of a woman who came up to him in the street unbidden and warned him that he would trip over and die if he failed to tie his shoelace.

This also expresses itself in perfectionism. Board a train with a group of Germans and one will soon start grumbling about some minutia: the temperature, the disorderly storage of luggage, a brief delay. The same habits undergird Germany’s industrial success. Its factories are staffed by conscientious workers who treat each blemish as an abomination, honing and re-honing production processes until everything is in Ordnung (order).

Lately, however, this propensity to fear the worst has become more pronounced. Perhaps it began when the upbeat Wilkommenskultur (“welcome culture”) accompanying Angela Merkel’s decision to keep the borders open to refugees in 2015 curdled into a scepticism about how culturally compatible the newcomers really were—with several high-profile cases of migrant crime fuelling anxieties. Other factors include the rolling scandal over German carmakers’ cheating in emissions tests, and last September’s federal election. That saw the far-right Alternative for Germany (AfD) party enter the Bundestag for the first time, and prompted an unusually long and fractious process of negotiations, resulting in another uninspiring “grand coalition” under a weakened Mrs Merkel. Then in June the Christian Social Union, the chancellor’s conservative Bavarian allies, took her new administration to the brink of collapse over disagreements on asylum policy.

So when the German team, the reigning champions, crashed out of the World Cup during the group stages—under a coach, Joachim Löw, widely compared to Merkel for his unflashy longevity—it seemed to symbolise a land in trouble. “The Torn-Apart Country” bellowed the cover of Stern, a news magazine, in the week of the match. “Germany in Crisis: once upon a time there was a strong country” ran a headline in Der Spiegel. Inside, the weekly diagnosed timidity and complacency in both the team and the nation it represented.

The liberal hand-wringing intensified last month when Mesut Özil, the Turkish-German star midfielder, resigned from the team. Right-wing politicians and football bosses had questioned his loyalties after he allowed himself to be photographed with Recep Tayyip Erdogan, Turkey’s despotic president. “I’m German when we win and an immigrant when we lose,” wrote Mr Özil. Bild, the tabloid that led the criticism of him, increasingly portrays Germany in doom-laden terms: a poorly governed country plagued by criminals and barely tolerable Muslims.

Don’t fear the wurst

This is all getting out of hand. Pessimism, and the associated perfectionism, may be a German strength—but in moderation. And that moderation risks succumbing to the latest bout of hyperventilating self-denigration, along with basic facts about the state of the country. Germany’s economy, for example, is powering ahead. Unemployment is at a record low, and exports are booming. Its infrastructure is among the best in the world. Inequality remains lower than in most other rich countries and the quality of life higher (the fourth best in the world, according to the UN’s Human Development Index). German politics, it is true, is fragmenting, as in other European countries, but Mrs Merkel remains a sensible and decent leader, and moderate forces still dominate.

And the immigrants? By April this year 26% of refugees admitted to Germany since 2015 were in employment, more than expected. Crime fell to a 30-year low last year, with the largest long-term falls among immigrants. If rightists are becoming more vocal in their opposition to Germans of immigrant background, like Mr Özil, it is because their monocultural vision of Germany is losing the battle: the proportion of non-ethnic German residents is rising fast, with ever more reaching prominent roles in public life. The share of MPs with a migrant background rose from 3% to 9% over the two elections to 2017. Germany’s most popular politician, Cem Özdemir of the Greens, is of Turkish origin, too.

Germany overlooks such facts at its peril. Mainstream politicians will not halt the rise of the AfD by parroting its inaccurate portrayal of the country as an unruly shambles. The country does not invest enough—threatening its competitiveness and contributing to international economic imbalances—but pessimists do not invest. Cracks in the liberal international order threaten German interests, but introspective gloom will surely prevent the country from taking more responsibility for its preservation. For its own sake and that of others, it is time for Germany to lift its gaze from its navel, grasp the bigger picture—and cheer up.