The night of last year's attempted coup in Turkey, Alaa Khaldi considered packing his bags.
The 31-year-old Syrian refugee from Damascus, who fled to Turkey in 2015, was worried that Turkish President Recep Tayyip Erdogan would fall. Erdogan's Islamist government has opened Turkey's doors to more than 3 million Syrians fleeing the civil war in their country, and Khaldi thought a new government might roll up the welcome mat.
"The main party is with us," Khaldi said, referring to Erdogan's Justice and Development Party. "What happens after them, we don't know."
Erdogan survived the attempted coup on July 15, 2016, and has amassed more power, imposing a seemingly indefinite state of emergency and deeply polarizing Turkish society. But Syrians living in Istanbul worry that the widening political divisions will put them at risk, particularly as their numbers continue to grow while Europe blocks refugees from entering through Turkey.
"If the regime changes, we would definitely be at risk," said Khaldi, who works at a software company in central Istanbul's Fatih district, a densely populated neighborhood with a large Syrian population.
Erdogan has cast Turkey's acceptance of the refugees as a benevolent project toward fellow Muslims — and particularly Syria, which shares a history with Turkey as both were under the rule of the Ottoman Empire until 1922.
While Europe has tried to stop the flow of refugees and some European countries have been openly hostile to arrivals, Turkey has absorbed the influx with relatively little unrest. The vast majority of Syrians who work do so under the table, but Erdogan has offered a limited number of work permits that could raise Syrians' wages, and even floated the idea last year of offering Syrians the chance to apply for Turkish citizenship.
That triggered a backlash among many Turks, even Erdogan's supporters. His announcement came amid a smattering of news reports alleging the involvement of Syrians in various crimes, and soon the hashtag, "I don't want Syrians in my country," was trending on Turkish social media.
Erdogan's political opponents — who castigate him as an increasingly authoritarian figure who has imprisoned tens of thousands since the failed coup — have also voiced concern about the large Syrian presence.
Kemal Kilicdaroglu, who has emerged as perhaps the most influential opposition figure after leading a massive antigovernment demonstration in July, has called for a national referendum on the Syrian citizenship question and said a growing Syrian population would make it difficult to identify suspected militants among them.
Erdogan has not changed his policy, saying in a speech in late July that anyone who brought up stories of Syrians causing unrest in Turkey was in effect a terrorist.
About 300,000 Syrian refugees live in 26 camps run by the Turkish government, with the vast majority of the overall population clustering in cities like Istanbul, Ankara, Izmir and Gaziantep, near the Syrian border.
Syrians account for 3.6% of Turkey's population, and their presence is obvious in areas like Fatih, where Syrian sweet shops and fast-food joints line the sidewalks and signs on storefronts are printed in Arabic script.
Such neighborhoods are undeniably signs of Istanbul's cosmopolitanism, but experts also say there are underlying tension and misunderstandings, particularly because most Syrians don't speak Turkish.
"In the beginning, the idea of a common civilization really smoothed things over, but in the long run we're seeing these Syrian ghettos develop, especially in major cities," said Selim Koru, an analyst at the Economic Policy Research Foundation of Turkey.
"People in Syrian ghettos are going to be resistant to learning Turkish, adjusting to Turkish culture and traditions. So in the medium to long run, that could present some problems," Koru said.
At a small grocery store in Fatih, a 37-year-old shopkeeper from Damascus, who gave his name only as Kinan, said recently that nearly all his customers were Syrian. Turks probably wouldn't patronize his store if they knew he was Syrian, he said.
"They accept us, but they don't really like us," he said.
Kinan, a medical engineer who fled Damascus in early 2016, lives in an apartment in Fatih with five other Syrian refugees. Since clashes broke out in May between Turks and South Asian migrants in another part of the city, Kinan said, he is careful when he rides public transit not to speak Arabic.
"Day after day it will become worse for us — this is my fear," said Kinan, who works to send money to his wife and son in Damascus. "On social media, you see stories of Syrians being attacked, even killed in Turkey. They feel we are taking their jobs. They will become less accepting of us."
At a Syrian chicken restaurant along Fatih's main drag, Hassan Sakka, 15, from the Syrian city of Aleppo showed a scar on his ear from a fight he'd had that week with a Turkish neighbor who he said had tried to shake him down for money. The neighbor's reasoning, Hassan said, was that he didn't have a job while Hassan and his cousin did.
"The relationship between Syrians and Turkish people is just about work. There is no friendly relationship," said Hassan's cousin, Haytham Mahmoud.
The 26-year-old works in a factory assembling boxes for about $350 a month alongside a dozen other men, all Syrians, to send money to his parents and two sisters in Aleppo.
"There is no friendly relationship," Mahmoud said. "Here we just eat, sleep and work. Any of us would love to go back to Syria."
Follow @SBengali on Twitter for more news