The Edinburgh trams contract represented an "extremely poor deal", an inquiry into the project has heard.

A lawyer representing several former employees of Transport Initiatives Edinburgh (Tie), which handled the scheme, said the contract "tended to encourage disputes", and that the pricing information within it was confusing.

The probe, chaired by Lord Hardie, is examining why the trams were delivered late, over-budget, and with a truncated route.

The final cost of the project, at £776m, was more than double the sum earmarked at the outset. Trams finally began running in Edinburgh in May 2014 - six years after construction began.

The inquiry also heard claims from the main contractor that work dealing with utilities in the ground was the "critical delaying factor" throughout the project.

However, Tie employees lawyer Douglas Fairley QC, accepted that some of those he represents "may on occasion have made errors of judgement".

He insisted that was against a backdrop of "extreme difficulty created by others who either preceded them or in some cases were senior to them within the organisation".

The QC described one aspect of the document as "clunky", "cumbersome" and "at best, productive of extensive delays".

Fairley also described pricing details in the contract as being "confusing and opaque".

He said: "It would be fair to say that any contract which left the door open to an argument by the contractor that something as basic and fundamental as the employer's requirements for the construction of the tram network was an extra over and above that which had been priced was an extremely poor deal for the council."

Mr Fairley also claimed that the decision to withdraw Transport Scotland from the governance structure of the project was "particularly ill-judged".

Garry Borland QC, for contractor Bilfinger Construction UK Ltd, said that the utility works (known as Mudfa works) - over which they had no control - were "very far from complete" in the run-up to the contract between Tie and the infrastructure consortium (Infraco) being concluded.

He argued that the utility work should have been completed before the summer of 2008 and the start of construction work, but was actually finished "years late".

"Bilfinger's position is that the Mudfa issue was the critical delaying factor throughout the project up to the mediation at Mar Hall and indeed it continued to have effect thereafter," he said.

Mr Borland also said the design of the project, which they had no control over, was "to a very significant degree incomplete" in the run-up to the execution of the contract.

By December 2007 around 40% of the detailed design was lacking, he argued.

The inquiry continues on Thursday.