By Madeline Halpert
BBC News, at the court in New York
For nearly four weeks, Donald Trump has sat quietly in a New York courtroom while state prosecutors laid out the first-ever criminal case against a former president.
Lawyers from the Manhattan District Attorney's called on a cast of blockbuster witnesses to corroborate their allegation that Mr Trump directed a hush-money payment to an adult-film star and authorised an illegal reimbursement scheme to avoid a sex scandal he feared would derail his 2016 presidential campaign.
They also produced dozens of surreptitiously recorded conversations and documents, trying to prove 34 counts of falsifying business records against Mr Trump.
As the prosecution prepares to rest it case - the final witness, Michael Cohen, will face further cross-examination on Monday before Trump's lawyers present his defence - some legal experts say it has done an efficient job. But even with solid evidence and testimony, they acknowledge that a conviction in the complex felony case is far from guaranteed.
"The pieces are all there. But is it there beyond a reasonable doubt?" said former Brooklyn prosecutor Julie Rendelman. "I don't know."
"It only takes one juror," she added.
Laying out the story
Though Mr Trump's case centres on a reimbursement he made to Cohen, his former fixer, prosecutors spent the first weeks of the trial walking the court through what led up to the $130,000 (£102,000) hush-money payment Cohen made to adult-film star Stormy Daniels.
They started with David Pecker, the former publisher of the National Enquirer.
He described a series of meetings in Trump Tower where he, Cohen and Mr Trump hatched a plan to suppress negative stories about Mr Trump - including alleged sexual encounters - as he ran for president.
His testimony proved influential, said former Manhattan prosecutor Lance Fletcher.
"He doesn't have a reputation that's been blown apart by this. And he came into it really seeming to be Trump's friend," Mr Fletcher said. "So I think he comes off as almost an impartial witness."
From there, prosecutors called a host of others, including former Trump aide Hope Hicks and Daniels' former attorney Keith Davidson, to corroborate the story.
"They sort of connected a fascinating novel … about how all of these characters interacted," said Columbia Law School professor John Coffee. "And that was wise."
They also interspersed evidence such as meeting logs, recordings and receipts of hush-money payments made to a Trump Tower doorman and Playboy model Karen McDougal to bolster witnesses' stories.
Star witnesses air secrets
Prosecutors used weeks of storytelling and evidence to build up to the most highly anticipated witnesses, including Ms Daniels.
Mr Trump's attorneys worked hard to limit Ms Daniels' testimony.
While prosecutors pledged to tread lightly when quizzing her about the alleged sexual encounter at a hotel suite in Nevada in 2006, she still proved at times an uncontrollable witness, Judge Juan Merchan told the court. Mr Trump has denied having sex with her.
Her explicit testimony led to several unsuccessful mistrial motions from Mr Trump's legal team and may have opened the door for an appeal, some legal experts said.
But others said that context helped prosecutors show why Mr Trump would be desperate to pay for her silence in order to protect his campaign.
"She got into some salacious details, which I thought went too far," said Ms Rendelman. "But at the same time, the argument for the prosecution is the more salacious it is, the more Trump would want it to be shut down."
BBC News reporters are in the Manhattan courtroom covering the historic first criminal trial of a former US president. You'll find their updates and analysis on the BBC news website and app, and across TV, radio and podcasts.
Ultimately, Ms Daniels could only testify to what led up to the hush-money payment.
For the behind-the-scenes reimbursement, they had to rely on a problematic witness: a convicted felon who recently has made a living off attacking Mr Trump.
A calm and collected Cohen takes the stand
Members of the public held their breath earlier this week as Mr Trump's former fixer-turned foe, Cohen, was called to the stand.
Many anticipated the same character who authored fiery social media posts attacking Mr Trump, for whom he once pledged to take a bullet.
But the man speaking in a blue suit and tie took them by surprise. Cohen appeared composed as he detailed his decades with Mr Trump.
"He is measured. He is reflective," said Diane Kiesel, a former New York Supreme Court Justice and Manhattan prosecutor. "He has not let any bias or animus for Mr Trump show through."
Cohen told the court of his initial admiration, working as Mr Trump's personal attorney for 10 years. He acknowledged the lows as well, including lying on Mr Trump's behalf, leading to regrets.
His composure boosted the prosecutors' case, and his testimony was bolstered by a weak cross-examination from Mr Trump's legal team on day one, experts said.
Mr Trump's attorney, Todd Blanche, appeared disorganised at first, stumbling sometimes in his questioning, experts told the BBC.
But he appeared to make strides on the second day, Thursday, casting doubt on details of Cohen's testimony, including an October 2016 phone call Cohen made to Mr Trump's bodyguard in which he claimed to have to talked to Mr Trump about details of the hush-money payment.
It was a reminder of what experts said was one of prosecutors' largest problems: Cohen's credibility. The defence hammered home the point that Cohen is a convicted criminal, who spent time in prison after being convicted on several charges including lying to Congress.
Cohen was able to testify to a key part of prosecutors' case - Mr Trump's direct knowledge of the hush-money payment reimbursement scheme.
Cohen said former Trump Chief Financial Officer Allen Weisselberg - currently serving a perjury sentence at Rikers Island prison - decided to classify reimbursements from Mr Trump's account as legal expenses. Cohen testified that he heard Weisselberg get the OK from Mr Trump himself.
As Cohen spoke, prosecutors also displayed the dozens of cheques, ledgers and invoices at the heart of the 34-count indictment.
But Cohen's story may not sway all jurors.
"You are relying on a witness who in many respects … comes with a larger load of baggage than others," Ms Rendelman said. "It makes it a bit more difficult to prove the case beyond a reasonable doubt."
Connecting the dots
Other challenges remain for the prosecution.
In a relatively novel approach, the Manhattan District Attorney's Office elevated falsifying business records charges to a felony by claiming Mr Trump did so with the goal of concealing another crime.
To prove their case, prosecutors must show intent - that Mr Trump illegally classified records for the purpose of aiding his campaign.
Several witnesses seemed to corroborate this.
"He wasn't thinking at all about [his wife] Melania," Cohen told the court. "This was all about the campaign."
But prosecutors must make this connection clear to the jury.
"Essentially they have to connect these payments to a motive that links them to a campaign," said Ms Kiesel. "This requires a summation of a lifetime, because you really have to connect these dots."
Mr Fletcher said prosecutors succeeded in doing so, with witnesses arguing the hush-money payment and reimbursement was not made to protect Mr Trump's family.
"This was all about the election," Mr Fletcher said. "If I was going to bet, I would bet on a conviction. But I don't think it's a slam dunk."
In the end, the verdict could come down to jury selection, experts said.
The 12 members and six alternates were picked from hundreds who expressed a range of political views and familiarity with Mr Trump and this case.
Jury members are often unpredictable, Ms Kiesel said.
"It only takes one person to decide that the people have not met their burden," she said. "The people have 12 [jurors] to convince."