Subsection (2) applies when—
a person is to be brought before a court in accordance with section 21(2), and
a constable believes the person is under 18 years of age.
The person must (unless released from custody under section 25) be kept in a place of safety until the person can be brought before the court.
The place of safety in which the person is kept must not be a police station unless an appropriate constable certifies that keeping the person in a place of safety other than a police station would be—
impracticable,
unsafe, or
inadvisable due to the person's state of health (physical or mental).
A certificate under subsection (3) must be produced to the court when the person is brought before it.
In this section—
“an appropriate constable” means a constable of the rank of inspector or above,
“place of safety” has the meaning given in section 202(1) of the Children's Hearings (Scotland) Act 2011.