Parents of Katie Allan say she seemed "petrified" days before taking her own life at West Lothian Prison.
The FAI into the deaths of Katie Allan and William Lindsay began hearing evidence today at Falkirk Sheriff Court.
The mother of a 21-year-old who took her own life behind bars has told an inquiry how she seemed "petrified" of other prisoners the day before her body was discovered.
Linda Allan, 56, told Falkirk Sheriff Court her daughter Katie also appeared "exhausted" after reporting being kept awake at night by other prisoners shouting abuse at her from neighbouring cells.
Mrs Allan was giving evidence on the second day of a fatal accident inquiry (FAI) examining the circumstances of her daughter's death and the death of 16-year-old William Brown, also known as William Lindsay, at Polmont young offenders institution in 2018.
Ms Allan, a student at Glasgow University, was found dead in her cell on June 4 as she was serving a 16-month sentence for drink-driving and causing serious injury by dangerous driving.
Mr Lindsay, who had been in care repeatedly, was found dead in his cell on October 7 - three days after being admitted as there was no space in a children's secure unit.
He was remanded at Polmont despite having a history of making attempts on his life.
Mrs Allan told the inquiry she and her son Scott visited her daughter at Polmont on June 3, during which Ms Allan broke down in tears as she recounted her days in prison.
"She didn't feel safe. She was terrified of the unpredictability of the environment she was in."
She said there had been a fight in the area where her daughter was being held and that other prisoners had been shouting derogatory comments at Ms Allan from their cells since then.
"She was petrified and exhausted as she hadn't slept," Mrs Allan said.
"She told me she had asked to be moved to another cell.
"She didn't feel safe. She was terrified of the unpredictability of the environment she was in."
Mrs Allan went on to recall how her daughter also appeared to be "frightened" of certain prison officers who were supervising her.
"She spoke highly of a number of prison officers but she was clearly frightened of other prison officers," she told the inquiry.
Mrs Allan also told the inquiry she was concerned to discover her daughter had been self-harming in Polmont, something she believed the 21-year-old had only done once four years earlier.
She said there was evidence Ms Allan had been cutting her arms while in prison, adding: "Katie stayed with us the night before her sentencing. I saw her arms and there were no marks."
Mrs Allan raised further concerns her daughter was strip-searched by prison officers several times during her time at Polmont, particularly on one occasion when she was made to strip in front of a number of trainees.
"She spoke about feeling violated," she told the inquiry. "She was shocked. She was really embarrassed. I think anyone in that position would feel the same."
Ms Allan had alopecia, a condition her mother said became significantly worse while she was in custody.
"Katie's hair loss was horrific," she said. "She was losing her hair on her eyebrows and her head and she was incredibly distressed by it."
Estimating Katie lost about 60% of her hair, Mrs Allan added: "She lost so much hair she didn't have enough left to cover the bald patches on her head."
The court was shown an email Mrs Allan sent to her daughter after her visit on June 3, 2018, in which she pleaded with her to ignore derogatory comments being made by other inmates and reminded her she was due to be released in four weeks.
It read: "You are loved, you have a home and a life to start rebuilding in a few weeks, Katie, please hold on to that.
"Read your books and try really hard to zone out the noise. I know that won't be easy but try.
"When you don't react, they will get fed up, Katie. Love you."
Mrs Allan asked for a break in proceedings after she grew visibly upset reading the email aloud to the court.
In the afternoon Ms Allan's father Stuart gave further evidence and returned to the subject of the strip searches she was subjected to.
The 59-year-old questioned why bodily searches were being carried out and whether new technology could be used as an alternative to seek out prohibited items.
He also suggested Katie was repeatedly picked for strip searches because she put up less resistance than other prisoners who would lash out at officers.
"That was a really hard experience for her," he said.
Katie was last seen alive by a prison officer as she watched TV, the inquiry heard on Monday, and said "Hi", just after 8pm, before taking her own life.
She was found by a prison officer just before 6am on June 4.
Ms Allan had lost seven kilos (15lb) while in custody over a period of four months after being imprisoned.
The inquiry continues.