Image caption The EU and Union flags fly alongside the Saltire at Holyrood - but for how long?

The Scottish government is to start work towards a second independence referendum in the wake of the UK voting to leave the EU, with the SNP launching a nationwide "listening exercise" to gauge views. Political reporter Philip Sim looks at the questions the party will seek to answer before taking Scotland back to the polls.

A second Scottish independence referendum is "on the table"; in fact Nicola Sturgeon says it's "highly likely". Her ministers have been set to work to draw up legislation to make this "option" a "deliverable" one.

Note, for a start, that the language is all still hypothetical. So is it really going to happen? Before we find out the answer to that question, a whole host of others need to be addressed.

The SNP leader is, obviously, dedicated to Scottish independence. But she has been hesitant to call for a second vote on the matter straight away, despite some members (and MPs) straining at the leash.

This is because Ms Sturgeon doesn't just want to hold a second indyref - she wants to win one. The next poll will be a zero-sum game; lose, and it really is over for a generation.

The first minister won't fire the starting gun on the race until she's absolutely sure she can win. And amidst the shockwaves of the UK's vote to leave the EU, how sure can a politician be about anything at the moment?

Ms Sturgeon will be hoping that her 120,000 party members can bring back some answers about the mood of the nation from the doorsteps.

Here are a selection of the other questions the first minister will be pondering before she starts down the road to indyref2.

Image copyright PA Image caption Would Theresa May give permission for a binding referendum?

Legality

Perhaps the biggest hurdle first - can Scotland even hold a referendum which would bring about independence?

Winning the approval of Holyrood would not be the issue. The SNP may have lost their majority in May, but the cohort of pro-indy Greens mean there would be no issue gathering the support of enough MSPs - despite Labour, the Tories and the Lib Dems all lining up in opposition.

The problem is, the power to call a referendum is reserved to Westminster. The 2014 plebiscite was only held with the blessing of David Cameron; would Theresa May sign off on another constitutional wrangle?

She initially made Scotland a high priority, visiting Ms Sturgeon in Edinburgh shortly after taking office, and has said she is "willing to listen to options". However, she warned that some of those mooted may be "impracticable".

With a Brexit to negotiate while settling in at Number 10, it might seem unlikely that Ms May would want to add a further complication to her crowded plate. But blocking a referendum would look distinctly undemocratic - and even a Yes vote in an unauthorised referendum would make life uncomfortable for the new PM.

Image copyright Getty Images Image caption Ms Sturgeon had hoped to have more time to win over No voters from 2014

Timing

If there is to be a second independence referendum, when could or should it be held?

Ms Sturgeon had hoped to have more time on her hands to build the case for independence anew. She wanted time to draw up a plan to win over No voters; on that front, Brexit might create an opportunity, but it also presents challenges.

Once Westminster sets the wheels of leaving the EU in motion, the clock is ticking on a two-year window. Former first minister Alex Salmond has suggested that Scotland would need to win its independence before the Brexit negotiations are complete, so that Scotland could effectively just stay put in the EU while the UK leaves.

Beyond the practical issues of setting up a referendum, when would the best time for the vote be? There are council elections scheduled for 2017 already, and it's still not entirely inconceivable that there could end up being a UK general election ahead of schedule too.

Scottish voters have spent a relatively large amount of time in polling stations of late - they've had five trips there in the span of just over two years.

The fatigue not just of the electorate but of the party activists who go out knocking on doors to "get out the vote" has been cited as a possible reason for referendum turnout shrinking from 85% in 2014 to 67% in 2016. Holding yet another vote too soon could be a risk.

Alex Neil, a member of Ms Sturgeon's cabinet up until May, has warned against being "stampeded" into holding a "premature and unnecessarily risky" referendum.

He says the SNP must wait until there has been a "decisive and evident shift in support for independence over a sustained period of time".

Image copyright PA Image caption Would a new Yes campaign be able to build support in the way it did in 2014?

The electorate

Social media is already awash with anecdotes about avowed No voters casting off their unionist roots and pledging themselves for Yes.

But as the frantic tangle of polls in advance of the EU referendum showed, gauging what the electorate really think on any issue is increasingly difficult.

And in Scotland, the political picture is like an MC Escher painting. There are Remain vs Leave allegiances, reflected through the original indyref Yes vs No prism, and all of that on top of party loyalties.

There are endless layers of nuance; for example, what of SNP members who voted Leave out of concern for trade deals like TTIP? Will they now abandon their Eurosceptic leanings for the overarching goal of independence? (Probably, yes).

The same could be said for all Leave voters - there were a million of them, after all, and they need to be considered (and indeed represented) too. A million votes is not to be sniffed at, and could lock off a significant proportion of the electorate if the contest is characterised as one about EU membership.

As SNP deputy leadership candidate Angus Robertson has pointed out, winning over No voters will be the key task going forward.

The collapse in the price of oil, reflected in the GERS figures released in August, may have served to entrench some who voted No primarily to protect their bank balance. Even former SNP aides have gone so far as to say that the 2014 case for independence is "dead".

And, again on turnout, what about voters who don't turn up to vote at all? When it came down to it, only 43,000 more people voted Remain in the EU referendum than voted Yes in 2014.

Voter engagement appears to be shrinking; would the people come back the ballot box for indyref2?

Image copyright Getty Images Image caption Would an independent Scotland end up using the pound or the Euro - or its own currency?

Practical issues

Ms Sturgeon has a puzzle to solve over currency; it was an issue in 2014, and it's another of those problems she'd hoped to have more time to mull over.

Nobel prize-winning economist Joseph Stiglitz, a member of both Mr Salmond and Ms Sturgeon's economic advisory teams, has conceded that the proposal to share the pound with the UK "may have been a mistake". Mr Salmond similarly says the Yes side were "gazumped" on the matter.

The first minister has has insisted that "the pound is Scotland's currency", but Mr Robertson has cautiously welcomed the idea of discussing a "Scottish pound", while fellow MP Joanna Cherry has suggested that Scotland might not want to be tied to the pound if it sinks post-Brexit.

There could be an upside to this; Mr Stiglitz reckons a floating Scottish currency could boost the economy and potentially smooth Scotland's entry to the EU, by cutting its deficit - which is currently far higher than that required of new members.

But would the EU let Scotland "join" (or Remain) without taking the Euro as its currency, another common rule for new members? On the flip side of the coin, would the UK allow independent Scotland to keep the pound?

Furthermore, what of borders? This was a simpler matter in 2014, but would Brexit Britain want an open land border to an EU member state? Ms May has pledged that there will not be one in Northern Ireland, but she might well strike a less conciliatory note in the heat of a referendum battle.

Would Scots vote to leave the UK if it meant embracing a new currency and putting up passport checkpoints at Gretna?

And more fundamentally, would an independent Scotland even be allowed to stay in the EU? Some influential member states have already voiced opposition the idea - including France and significantly Spain, which would be loathe to see Catalonia follow a similar path.

This is unprecedented territory, so it's hard to know what would be allowed, or who might have a veto - hence Ms Sturgeon's talks with EU leaders.

Image copyright Getty Images Image caption What happens at Westminster will have a big bearing on what happens next in Scotland

The wider picture

Despite the impression that Scotland and England are becoming two rather different places, what happens at Westminster is still going to have an enormous impact on Ms Sturgeon's decision-making.

First and foremost, what is the Brexit deal going to look like?

Beyond Theresa May's circular mantra of "Brexit means Brexit", we don't really know. We're yet to find out what the UK will look for at the negotiating table, far less what the likely settlement will be.

This again is both bad and good for Ms Sturgeon - she can (and has) point out that the UK that Scotland voted to remain in in 2014 will be fundamentally changed. But at the same time, she can't really know what she's campaigning to leave until it is clearer what the post-Brexit UK is going to look like.

Beyond these shores, what does Brexit mean for the European Union?

The UK is far from the only country unhappy with the role of Brussels. Indeed, it's been suggested that the EU's leaders could be harsh in their negotiations with Britain primarily to discourage other states from eyeing exits of their own.

Before you even consider the economic impact, other European leaders will surely be eyeing up special concessions in the vein of David Cameron's (failed) deal.

Who can say for sure what the EU will look like in a few years' time? In effect, can Ms Sturgeon even be sure what Scotland would be leaving the UK to remain part of?