Minutes before a 16-year-old from Dunedin was stabbed to death, she messaged her older sister: "I'm so angry."
Amber-Rose Rush's sister, Shantelle, only noticed the message on the morning of February 3, 2018.
She replied "why?"; but by that time, the teenager was lying dead in her blood-soaked bed after sustaining six wounds to her neck and throat.
The man on trial in the High Court at Dunedin accused of the murder of Amber-Rose is Venod Skantha, 32, a junior doctor at Dunedin Hospital at the time.
He, too, was messaging the victim on the night of her death.
Amber-Rose had accused him of indecently assaulting her and "touching up" others. She would go to the police and to Skantha's bosses at the hospital, she told him.
The Crown case is that the defendant then enlisted the help of a teenage friend to take him to Amber-Rose's Corstorphine home, where he killed her in her bedroom.
Her disclosures would have effectively ended Skantha's medical career, prosecutor Richard Smith said, since the doctor was on a final warning for misconduct.
Skantha had escaped dismissal, the court heard, only by falsely telling his superiors his mother had died.
It was revealed at trial yesterday that Amber-Rose had earlier communicated with her sister online about potentially moving into Skantha's home.
She said he had offered rent-free accommodation, provided she cook and clean. When the older sister asked how old Skantha was, Amber-Rose tried to reassure her, describing him as "like a dad to us."
Amber-Rose's sister, though, suggested Skantha was positioning himself as a "sugar daddy".
In a later conversation, Amber-Rose said she was planning to go to the defendant's house with her mother to try to get money out of him.
She did not elaborate further on the circumstances.
Amber-Rose's boyfriend, Kristin Clark, was also communicating with her on the night she died.
She sent screenshots of her heated exchange with Skantha and Clark said he was concerned she would confront the man.
At 11.53pm, Clark sent her: "I'm willing to do anything for you. I can pick you up."
"I won't be allowed," Amber-Rose replied. It was her last message.
Clark continued to articulate his worry, and when he received no response, he left his Dunedin North home to see her.
He told the court he knocked on Amber-Rose's window in the early hours of February 3.
There was no response.
When Amber-Rose's brother, Jayden Rush, arrived home from work with his then-partner Alicia Tothill, Clark retreated to his car and left the address after sending his girlfriend another message.
The Crown case is that Skantha had used a spare key — hidden under an ornamental Buddha on the doorstep — to get into the home.
Rush found that key in the door when he got home some time after 12.10am. He said he went to quiz Amber-Rose about why it was there but her light was off and there was no noise coming from her room.
Rush spent the rest of the night playing video games unaware she lay dead in the next room.
Much of yesterday's evidence came from police who detailed the painstaking investigation that subsequently took place.
The teen who allegedly drove Skantha to the house told police the defendant had dumped the victim's phone at Blackhead Quarry after killing her.
Over two days, specialist search teams combed the area and drained swampy sections.
They found the white Huawei cell phone in two parts using a metal detector, the court heard.
A search of the defendant's Fairfield home also turned up various areas of blood staining and a samurai sword, the court heard.
Defence counsel Jonathan Eaton, QC, told the jury at the trial's outset there was no doubt Amber-Rose was killed by an intruder, but it was not his client.
The trial before Justice Gerald Nation and a jury of 10 men and two women continues.