By Alastair Macdonald

BRUSSELS (Reuters) - When Theresa May met Jean-Claude Juncker in Brussels on Friday, she might just have heard the sounds of carpenters working on new offices for the European Union executive's Brexit negotiators.

Having briefed fellow national leaders over dinner at her debut EU summit late on Thursday, the British prime minister had a late lunch on Friday with Juncker, whose executive staff, with their counterparts in Whitehall, will do the heavy lifting in negotiations expected to start early next year.

After the glamour of sitting at the European Council top table for the first time, stepping across the road to Juncker's European Commission and its civil service may have seemed more prosaic.

But despite her efforts to resolve key conundrums of Brexit among fellow political captains, it is below decks in the office cubicles of the Commission's Berlaymont building and in similar mundane engine rooms in London and other EU capitals that the legal tangles of this most complex of divorces will be unwound.

"The great leaders tend to think that they can sort things out among their colleagues," said a senior EU diplomat who was in the room when May recently met one of her continental peers.

"But it does not always happen that way in Brussels."

The European Union is primarily a complex legal construct, British officials have been telling the new prime minister. Deft technocrats will be needed on both sides. Grand political gestures may accomplish little.

TASK FORCE BARNIER

Some of those brains are starting to assemble on the 5th floor of the Berlaymont, far below the panoramic dining rooms on the 13th where Juncker hosted May -- she laughingly told reporters after the summit that she was off to a "lunch date".

Workers are preparing rooms for Michel Barnier and his Brexit Task Force. The former French foreign minister and EU commissioner began work three weeks ago and has started, like May herself, by touring EU capitals and assembling a team to coordinate the work of hundreds of Commission officials once the Brexit process starts.

Security and secrecy around the Task Force is tight. Of 15 staff named so far on an EU website, none is British. That seems unlikely to change as the team grows.

In contrast to much of Brussels, team meetings tend to be in French not English, a tongue Barnier was known for avoiding when, as a commissioner until 2014 he was responsible for regulating a City of London finance industry wary of the EU.

A comment to Reuters from an official familiar with the Task Force that Barnier would like the Brexit negotiations conducted in French prompted intense summit speculation over signals to London. Barnier himself denied voicing a preference and stressed the language would be agreed only when talks start.

His appointment was greeted with dismay by those who fear Barnier retains a traditional Gaullist antipathy toward Britain. He insists he will play fair. And some EU officials stress that Barnier will be the smooth front-man for a negotiating operation grounded in deep technical knowledge and expertise.

Not only will Juncker, the former Luxembourg premier, and his ubiquitous German chief-of-staff Martin Selmayr retain lead roles on strategy, but Barnier's German deputy has a key role.

Sabine Weyand, a 22-year veteran of EU trade negotiations who once studied at Cambridge University, is travelling with Barnier and appears to have the confidence of German Chancellor Angela Merkel's government in Berlin, EU officials say.

COMMISSION UNDER SCRUTINY

The Commission is a bete noire of British eurosceptics, who see it as the unelected champion of centralising power in Brussels at the expense of sovereign states. Diplomats say May has told other EU leaders she wants them and their Council chairman, former Polish premier Donald Tusk, to keep it in check.

But May cannot expect the Commission, which prides itself on being the "guardian of the treaties", to stand back while EU law is bent out of shape by national leaders, who in any case also fear a sweet deal for London could start unravelling the union.

Once May gives formal notice that Britain is leaving -- by March, she says -- the Council will meet at 27, minus May, to set negotiating guidelines for the Commission. Tusk will be arbiter of what deal Britain is offered, but the Council has less than a tenth of the Commission's 33,000 staff to work on the details.

Belgian diplomat Didier Seeuws, the former chief-of-staff to Tusk's predecessor, will be his link to Barnier and Weyand. He can also provide a line to the lead negotiator appointed by the European Parliament, which must approve any deal. Seeuws was his spokesman when Guy Verhofstadt was prime minister of Belgium.

British and EU officials say that May is emulating her ill-fated predecessor David Cameron in touring European capitals and holding face-to-face meetings with fellow leaders, partly in the belief that high politics can bypass the "Brussels bureaucrats".

It was a strategy, they say, that did not work for Cameron.

"Everyone was smiling at him and saying they would help, but as soon as he left they called Brussels to say they would not go easy on him," one EU official said. "Now it will be the same."

May has been briefed by some of her officials not to read too much into "warm" bilateral talks -- no one, they say, will tell her to her face they won't help her, but will count on the collective Brussels machine to blunt her efforts to divide them.

National leaders will also keep a close eye on Juncker and Barnier, however: "This isn't just any old Commission negotiation," a second senior EU diplomat said. "The heads of state and government will be following this very closely."

But as with a deal to help Cameron win June's Brexit referendum, how Brexit turns out may be a product less of high-stakes summitry than of creative legal brains hidden away in the corridors of Whitehall and the Berlaymont.

May may have heard that herself over lunch with Juncker.

(Additional reporting by Jan Strupczewski, Francesco Guarascio and Elizabeth Pineau; editing by Ralph Boulton)