Image copyright Getty Images

It was a battle between the lawyer and the salesman, and for the most part the lawyer came out on top.

It may be hard to remember, but before Mrs Clinton was a secretary of state, or a senator or a first lady, she was a lawyer - and, by all regards, a talented one.

And after all these years, she still campaigns like one. Meticulous, cautious, controlled. What works in the courtroom, with its rules and customs, often doesn't fly in free-wheeling political debates, however.

Mr Trump, on the other hand, is the consummate salesman. Rules, tradition, even the truth are only relevant in so much as they help seal the deal.

The weakness of this approach is the perception that the salesman is all talk and no substance - a problem that can be exacerbated by 90 minutes under the debate spotlights.

In the end, the lawyerly preparations paid off for Mrs Clinton, as she controlled the evening with forensic precision.

While Mr Trump had a strategy - and pursued it on occasion - he was often blown off course by the former secretary of state and torpedoed by his own sometimes badgering performance.

While Mrs Clinton was occasionally prone to know-it-all-ness - particularly in her repeated appeals to outside fact-checkers - she largely maintained the upper hand.

Here are three ways she scored points, two times Mr Trump gained an edge and one very important wildcard.

Tax dodge

Media playback is unsupported on your device Media caption Clinton: 'There is something he is hiding'

After a give-and-take on economic plans, the topic turned to one specific set of tax returns - Mr Trump's - and why he won't follow longstanding presidential candidate precedent and release his own.

After the Republican repeated an old, since debunked excuse that he can't release them while he's being audited by the Internal Revenue Service (which, he says, has been auditing him for 15 years, by the way), Mrs Clinton went on the attack.

Her key line: "I think probably he's not all that enthusiastic about having the rest of our country see what the real reasons are, because it must be something really important, even terrible, that he's trying to hide."

Takeaway: The lawyer did her homework.

What's in Donald Trump's tax returns?

Trading blows

Media playback is unsupported on your device Media caption Trump: Nafta is 'Single worse deal ever approved'

Before Mr Trump got derailed on his taxes - and after Mrs Clinton's jab, he spent much too long trying to explain himself - the debate was actually going pretty well for him.

The economic discussion featured the kind of give-and-take on trade deals, including Mrs Clinton's past support for the North American Free Trade Agreement and the Trans-Pacific Partnership, that will work to Mr Trump's advantage in industrial states hollowed out by manufacturing jobs moving overseas.

His key line: "You go to New England, you go to Ohio, Pennsylvania, you go anywhere you want, Secretary Clinton, and you will see devastation where manufacture is down 30, 40, sometimes 50%. Nafta is the worst trade deal maybe ever signed anywhere, but certainly ever signed in this country."

Takeaway: A salesman knows a bad deal when he sees it.

Birther blues

If Mrs Clinton had the upper hand in the first round of the debate by putting Mr Trump on his heels when it came to tax returns, the second round proved to be equally inhospitable terrain for the Republican.

The issue was race relations in the US, and it was at that point that Mr Trump had to answer for being the leading voice questioning the authenticity of President Barack Obama's US citizenship.

Mr Trump once again tried to blame Mrs Clinton's 2008 campaign for starting the rumours - an assertion roundly dismissed by fact-checkers - and said he deserves credit from Mr Obama and black voters for settling the issue.

Mrs Clinton would have none of it, using the moment to turn up the heat on her opponent.

Her key line: "He has really started his political activity based on this racist lie that our first black president was not an American citizen. There was absolutely no evidence for it, but he persisted, year after year, because some of his supporters, people that he was trying to bring into his fold, apparently believed it or wanted to believe it."

Takeaway: The lawyer had the chance to come to the defence of Mr Obama, whose popularity is currently higher than either of the two candidates on the stage.

Inside-out

Throughout the debate, when he wasn't being goaded into responding to Mrs Clinton's carefully planned barbs, Mr Trump played up that he is the outsider and Mrs Clinton is too closely tied to the unpopular establishment and the status quo.

With polls showing upwards of 70% of the American public unhappy with the direction of the country, being the agent of change is in the political sweet spot. Add to that the natural inclination of the American public to switch direction after one party has been in the White House for eight years, and it is clear this is a potentially winning way for Mr Trump to frame the ballot-box choice for Americans.

Mr Trump's key line: "You've been doing this for 30 years. Why are you just thinking about these solutions right now?"

Takeaway: A good salesman knows when the customer wants a new product.

Temper, temper

Toward the end of the debate, discussion turned to the question of presidential temperament and stamina. Who had it, and who didn't? Mr Trump, who seemed increasingly frazzled as the evening stretched on, saw this as a moment to attack. He questioned Mrs Clinton's judgement, her "look" and her stamina.

Mrs Clinton, after saying that her international travels as secretary of state, her efforts in diplomatic negotiations and her marathon congressional testimony showed she had the endurance to be president, asserted that Mr Trump's attacks were evidence of his sexist behaviour.

Mrs Clinton's key line: "You know, he tried to switch from looks to stamina. But this is a man who has called women pigs, slobs and dogs, and someone who has said pregnancy is an inconvenience to employers, who has said women don't deserve equal pay unless they do as good a job as men."

Takeaway: The lawyer had the salesman sputtering, complaining about her negative advertising, how she wasn't being nice and how was still doing well in the polls. It wasn't a good look for him.

The Holt factor

Media playback is unsupported on your device Media caption Stop and frisk: 'Form of racial profile'

And for the final X factor. The Lester Holt factor. Much had been made of how the NBC presenter would handle the debate and whether he would serve as a real-time fact-checker or take a more hands-off approach. One NBC staffer said Holt wouldn't be a "potted plant" - and that was definitely the case.

In all the above points, the opening for Mrs Clinton's advantage was set by the moderator. He first brought up Mr Trump's taxes. He asked about the Obama "birther" controversy. He pushed Mr Trump on the Iraq War and brought up his comment about her "look", which led to the extended discussion of presidential temperament and judgement.

Mrs Clinton's weaknesses - particularly her use of a private email server and potential conflicts of interest in her charitable foundation - were barely discussed.

If the winner of political conflict is dictated by the ground on which it is fought, then most of the debate was contested on terrain that was favourable to the Democrat.

Some of that was her own effective strategy and preparation; the lawyer's advantage. Some of it was Mr Trump's missteps and meandering; the salesman's failure to move his product.

A lot of it, however, was Holt's doing. That will have Democrats smiling and Trump supporters howling.

Who is moderator Lester Holt?