Watching Sheridan Smith perform in Edinburgh earlier this year, Amy Wadge had a sudden burst of inspiration.
As soon as the interval started, the songwriter dashed into the ladies loo and started singing into her phone ("not for the acoustics, I just needed a wee!").
Returning to her seat, she played it back to record producer Jimmy Hogarth to see what he thought.
"And he was like, 'You're a freak! What have you just done?
"But every bit of it came from Sheridan. Just watching the level of honesty she performs with made me immediately go, 'I want to write something.'"
The demo became Are You Just Sleeping, a beautifully sad song about death and loss, which forms the centrepiece of Sheridan's second album.
"Are you just sleeping? Will you wake up?" she sings with a notable wobble in her voice. "We've still got plenty of things to talk about".
As she sings, the Bafta-winning actress is remembering her much-loved father, Colin, who died of cancer two years ago.
Smith was performing in the West End hit Funny Girl when he was first diagnosed; causing her long-standing problems with anxiety and depression to "snowball".
After a few shaky performances, she stepped away from the show for two months amid a flurry of tabloid stories about her health; and has kept a relatively low profile since.
Are You Just Sleeping is not just a tribute to her father, but an important part of her recovery. She recently sang it at Bentley Top Club in Doncaster, a venue where her parents' country and western band The Daltons used to gig in the 70s - and the response was overwhelming.
"There were all these people I've known and grown up with - like, all my dad's mates - and you could see them all in their own little worlds of grief because, you know, that song will hit everyone," says Sheridan.
"Everyone's been through it. And I have to say, since my dad died, people have just stopped me in the street and given me a cuddle and say, 'Oh God, I lost my dad too'.
"So out of all of that horrible stuff that happened in the press, people have actually been really lovely."
Amy, best known for co-writing Ed Sheeran's Thinking Out Loud, is full of praise for Sheridan's decision to release the song.
"For what it's worth, I think you're brave as hell," she tells the star.
"There are multiple people in Sheridan's position who'd have done another covers album and smashed it, and that would have been cool. But with this, now, you've opened up a whole new window and that's pretty badass."
It's certainly a bold step: Sheridan's self-titled debut album was crammed full of standards like Mad About The Boy and Anyone Who Had A Heart. It sold 140,000 copies, making it 2017's second-biggest debut by a British female artist after Dua Lipa.
Instead of copying the template for the follow-up, though, she decided to dig deeper.
"I was feeling ready to open up about a lot of things," she says. "I wanted to get away from the eyes and teeth."
Her record label brought in songwriters Amy Wadge and Eg White (Adele, James Blunt) to shape the songs, while Jimmy Hogarth (Amy Winehouse, Duffy, Suzanne Vega) helped Sheridan find a more confessional, Dusty-In-Memphis setting for her vocals.
But in a twist of logic that could only make sense in the music industry, the bulk of A Northern Soul was written behind Sheridan's back.
'Own worst enemy'
Unbeknownst to her, that gig in Edinburgh doubled up as a fact-finding mission, set up by record label executive Paul Samuels.
He sent Amy to the gig to get to know the actress; then invited her to write songs based on her observations.
"Paul didn't tell me it was happening," laughs Sheridan. "So I was in the bar afterwards giving it large and blabbing away about myself, not realising what was about to come!
"But actually it meant I was able to be myself and say things like 'I'm a disaster' and talk about hitting rock bottom and all those things that Amy's genius brain then took and turned into songs."
Sure enough, the album delves unflinchingly into the actress's fragility and insecurities: "I'm a disaster, a runaway train, my own worst enemy," she sings on Rock Bottom; while Ain't It Funny depicts a stage performer who crumbles when the curtain falls.
The lyrics are so close to the bone that Amy decided to stay away when Sheridan was presented with the music.
"This is her life and these songs are so intimate - so it was entirely up to Sheridan to decide which ones she wanted to keep," she explains.
The actress, however, was instantly bowled over.
"When Paul came to play me the songs, he was really nervous I might get offended," she says, "but it was the opposite: I was just crying my eyes out going, 'This is amazing'."
Turning to Amy, she says: "It was like you'd gone into my brain. You got me so much. These are my inner thoughts."
"But the thing is, it all came from you," replies Amy, "So when you say, 'you got into my head,' it's like, 'No, you actually told me that!'"
At this, the duo crease up in laughter - as they do throughout the interview, swapping anecdotes about Dolly Parton, Amy's kids and Sheridan's spanx.
That spirit is captured in the first single, Priceless. "One of a kind, I'm quite a find, I'm priceless," purrs the singer over a vamped-up Motown stomp.
"I feel a bit weird singing Priceless because it's meant to be quite empowering for women - but at the same time, I feel a bit of a twit going, 'I'm priceless!'" says the singer.
"It's just so not in my personality. I'm not Sasha Fierce or whatever Beyonce's alter ego is called."
For the record, she says her own alter ego would be "Nightmare Nancy" - the sort of character who ends up dancing on the tables and singing Dolly Parton's 9 to 5 at a late-night karaoke bar.
"That used to be me, she guffaws. "These days I like to keep Nightmare Nancy out of trouble."
Still, that infectious, life-affirming spirit is part of the star's appeal. It was undoubtedly a factor in her rise from the National Youth Music Theatre to National Treasure - a journey that she made without any formal acting training, it's worth noting.
It's also enabled her to make brave choices with her roles, sometimes in the face of criticism.
Take, for example, her hit musical Legally Blonde.
Sheridan was cast to play pampered Beverly Hills fashion student Elle Woods when the show transferred from Broadway - but her idiosyncratic take on the character mystified the American producers.
"I remember them going, 'Sheridan! Shut your legs!' 'cos I'd be sat like a bloke," she laughs. "They didn't get how I was being quite tongue in cheek and sending it all up.
"And I kept saying, 'Just wait til the audience gets in'. Because I know what British audiences are like - if I played it straight without giving it a bit of side-eye, a bit of shade, they wouldn't accept it."
Sheridan's instincts paid off. The show, which faltered in New York, was a major hit in the UK.
"What redeems this flamboyantly preposterous show is that its tongue stays permanently in its cheek," wrote The Times' Benedict Nightingale in his first-night review, unwittingly endorsing Sheridan's character choices.
The role won Sheridan the first of two Olivier Awards, while she received a Bafta for her portrayal of Charmian Biggs, wife of the Great Train Robber Ronnie, in 2012.
Since then, she's wowed audiences by playing Cilla Black (whose voice she studied for three months), won praise for her Hedda Gabler, and will soon be seen in Jimmy McGovern's Care, about a single mum whose life is turned upside down when her own mother develops dementia.
Throughout it all, the 37-year-old has worn her roles like psychological armour.
"The thing about playing characters is that you don't have to look at yourself, ever," she says. "I obsess over researching the person and their mannerisms. I lose myself in their psyche and I hide behind that all the time."
The album offers no such safety net.
"This is like holding a mirror up," she says, chewing on her nails. "I was scared of what I was going to see."
But as so often happens, the reality was more forgiving than the expectation.
"Inside, you're thinking, 'no-one will ever understand this madness.' Nightmare Nancy is going off in my head like a bomb.
"But hearing Amy's writing and sitting with these beautiful songs, it made me emotional in a lovely way… It made me realise, 'I'm actually just a normal girl who's been struggling.'"
A Northern Soul is out now.