I would like to know what "searching the flats and offices, returning to interrogate the man and the woman and to take down their details" means in the following sentences:
There was a scratching on the door.
‘You can come out now,’ said the woman’s voice. I don’t know how long I had been in there, listening to the sound of the policemen thundering through the building, banging on doors, searching the flats and offices, returning to interrogate the man and the woman and to take down their details, and the commotion outside, the screams of the crowds, and then, gradually, the dying down of any sound except for the wailing of sirens. Finally I’d heard cars honking, and the buzzing of the trams, and then this scratching.
The door to my cell opened. They both stood there, a light bulb hanging above their heads, night in the street behind them. I forced my body out of its hiding place, dusted myself off, aware of their eyes on me. They had their coats on, and both wore a look of exhaustion and curiosity.
In this novel which is set in the 1980's in Poland under the socialist regime, where homosexuality was socially unacceptable, the protagonist Ludwik (a university graduate) left Poland in 1981 to live in the United States of America. And he remembers what it was like back then in Poland, where he was frustrated by the reality of this socialist regime that he couldn't even get the doctor's appointment when his dear landlady was sick (She was like a grandmother to him). That was why he decided to collect flyers he saw on the streets and scatter them on the street from a building when the strikers and the police were clashing. At the sight of him throwing the flyers through the window, the police climbed the stairs of the building and began searching for him. But luckily, Ludwik was admitted to one office of the building, where a man and a woman were working, and was able to hide. After the police officers retreated, the man and the woman told Ludwik that he could come out now.
In this part, I wonder whether "flats and offices" mean residential areas such as houses and offices in companies. I came to wonder this because the police officers were searching the single building, and it seemed less likely--personally--that residential areas and offices would be situated at the same building. So I wanted to ask you whether "flat" here has a different meaning.
Also, I would like to know what "details" mean here. Does it mean perhaps their personal details, including their names, occupations, addresses, telephone numbers and so on?
I am an English learner from South Korea, so thank you for your patience in advance as I may not know obvious things. I would very much appreciate your help. :)