5.  The applicant was born in 1986 and lives in Moscow. 6.  The background facts relating to the planning, conduct and dispersal of the public event at Bolotnaya Square are set out in more detail in Frumkin v. Russia (no. 74568/12, §§ 7-65, 5 January 2016) and Yaroslav Belousov v. Russia (nos. 2653/13 and 60980/14, §§ 7-33, 4 October 2016). The parties’ submissions on the circumstances directly relevant to the present case are set out below. 7.  On 6 May 2012 a public event entitled the “March of Millions” was held in central Moscow to protest against the allegedly rigged presidential elections. The event had been approved by the city authorities in the form of a march followed by a meeting at Bolotnaya Square which was supposed to end at 7.30 p.m. The march was peaceful and held without any disruptions, but when the marchers arrived at Bolotnaya Square it turned out that barriers installed by the police had narrowed the entrance to the meeting venue allegedly restricting the space allocated for the meeting. To control the crowd the police cordon forced the protestors to remain within the barriers. There were numerous clashes between the police and protesters. At 5.30 p.m. the police ordered that the meeting finish early and began to disperse the participants. It took them about two hours to clear the protestors from the square. 8.  On the same day the Moscow city department of the Investigative Committee of the Russian Federation opened criminal proceedings to investigate suspected acts of mass disorder and violence against the police (Articles 212 § 2 and 318 § 1 of the Criminal Code). On 18 May 2012 the file was transferred to the headquarters of the Investigative Committee for further investigation. On 28 May 2012 an investigation was also launched into the criminal offence of organising acts of mass disorder (Article 212 § 1 of the Criminal Code). The two criminal cases were joined on the same day. 9.  The applicant is a human rights activist and a lawyer of an NGO, the Committee for Civil Rights (Комитет за гражданские права). On 6 May 2012 he arrived at Bolotnaya Square to participate in the demonstration and during its dispersal kicked an unidentified police officer in the arm. After these events the applicant continued to live at his usual address and to pursue his normal activities, including taking part in authorised public events. 10.  On 25 July 2012 the applicant’s flat was searched; the police seized the applicant’s clothes, domestic and international passports, other documents and his computer. On the same day the applicant was arrested on suspicion of having participated in acts of mass disorder on 6 May 2012. 11.  On 26 July 2012 the Basmannyy District Court ordered the applicant’s pre-trial detention until 25 September 2012 on the following grounds:
“The prosecution bodies suspect [the applicant] of having committed a serious offence punishable with imprisonment of over two years.
... the court concludes that there are grounds to consider that [the applicant], if at liberty, is likely to abscond from the investigation and trial, to act in person or through proxy with the aim of avoiding criminal liability, to continue [his] criminal activity, to destroy evidence and otherwise obstruct the investigation, which is at its initial phase.
Operational-search activities are now underway, aimed at establishing [the applicant’s] possible connections with other active participants of the mass disorders which took place at Bolotnaya Square in Moscow and its environs, therefore, if at liberty, [he] might co-ordinate his position with unidentified accomplices.
... No factual information excluding the detention of [the applicant] on health grounds has been submitted to the court. The court takes into account that [the applicant] may request medical assistance in the detention facility, if necessary ...” 12.  The District Court dismissed an application by the applicant for an alternative preventive measure, such as house arrest, and stated that his state of health did not preclude him from detention. On 5 September 2012 the Moscow City Court upheld the detention order. 13.  On 2 August 2012 the applicant was charged with the offence laid down in Article 212 § 2 of the Criminal Code (participation in mass disorder accompanied by violence) and accused, in particular, of having kicked a police officer. 14.  On 24 September 2012 the Basmannyy District Court extended the applicant’s detention until 6 November 2012, having found that the circumstances that had justified the detention order had not changed. The District Court dismissed the applicant’s allegations of lack of medical assistance in the remand prison as unsubstantiated. It stated that the applicant’s state of health was satisfactory and did not warrant his release. On 15 October 2012 the Moscow City Court upheld the extension order. 15.  On 31 October 2012 the Basmannyy District extended the applicant’s detention until 6 March 2013 on essentially the same grounds as earlier. On 26 November 2012 the Moscow City Court upheld the extension order. 16.  On 4 March 2013 the Basmannyy District Court examined a new application for an extension of the applicant’s pre-trial detention. The applicant complained of exacerbation of chronic diseases in detention. He asked to be released on bail and presented personal guarantees from two prominent public figures, including a human-rights activist, who vouched for him. On the same day the District Court extended the applicant’s detention until 6 July 2013. It considered that a milder preventive measure, including release on bail, would not prevent the applicant from obstructing the proper administration of justice. The applicant’s allegations in respect of the deterioration of his health were dismissed; the court relied on the medical statement from the remand prison, according to which his health was satisfactory. On 17 April 2013 the Moscow City Court upheld the extension order. 17.  On 24 May 2013 the applicant’s criminal case was transferred to the Zamoskvoretskiy District Court of Moscow for the determination of criminal charges. 18.  On 6 June 2013 that court granted another extension of the applicant’s detention, until 24 November 2013. The decision concerned eleven defendants. Along with the seriousness of the charges, the court based its decision on the findings that “the reasons which had initially warranted the detention have not changed” and that “no other measures of restraint would secure the aims and goals of the judicial proceedings”. The Moscow City Court upheld this extension order on 2 July 2013. 19.  On 2 August 2013 the Presidium of the Moscow City Court examined the supervisory appeal lodged by the Ombudsman of the Russian Federation. It rectified the extension orders of 24 September and 31 October 2012, and 4 March and 6 June 2013 as well as the Moscow City Court’s decision of 15 October 2012. The Presidium found that the applicant’s detention had been unjustified and that the detention orders had not been supported by relevant facts; it also took account of his worsening health. The Presidium lifted the detention order and placed the applicant under the house arrest until 2 October 2013 under the following conditions: prohibition from leaving his house or changing his place of residence; prohibition from communicating with co-defendants and witnesses; prohibition from sending and receiving correspondence; prohibition from using any means of communication. On the same day the applicant was released from pre-trial detention. 20.  On 26 September 2013 the Zamoskvoretskiy District Court extended the applicant’s house arrest until 2 January 2014. It referred to the seriousness of the charges and considered that as a human-rights activist the applicant could communicate with different authorities and persons and thus obstruct the course of criminal proceedings. On 28 October 2013 the Moscow City Court upheld this decision on appeal. 21.  On 18 December 2013 the State Duma passed the Amnesty Act, which exempted people suspected and accused of criminal offences under Article 212 §§ 2 and 3 of the Criminal Code from criminal liability. 22.  On 19 December 2013 the applicant applied for the termination of the criminal proceedings against him under the Amnesty Act. On the same day the Zamoskvoretsky District Court granted his application and lifted the house arrest. 23.  Prior to his detention, the applicant was diagnosed with an organic lesion of the central nervous system, hypertensive syndrome, tonsillitis, chronic gastritis, atopic dermatitis, osteochondrosis and dorsopathy (back pain). According to the applicant, these diseases required regular medical supervision, diet and lifestyle adjustments. 24.  From 27 July 2012 to 2 August 2013 the applicant was held in remand prison IZ-77/2 in Moscow. Upon his admission to the prison he underwent a health check which revealed no health issues except atopic dermatitis and scoliosis. The applicant provided the detention facility with his medical records which stated his chronic ailments. 25.  On 31 August 2012 the applicant underwent a medical examination by a general practitioner (“GP”). He was diagnosed with vegetative-vascular dystonia, dorsopathy, osteochondrosis, kyphoscoliosis, and first- or second‑degree obesity. He received a prescription for a special diet limiting intake of fats and quickly-absorbed carbohydrates. 26.  The applicant was subsequently examined by a GP on 25 September, 19 October and 26 November 2012, and 24 January, 15 and 25 February, and 15 March 2013. The examinations revealed no negative dynamics in the state of the applicant’s health; the prescriptions for the special diet were renewed each time. 27.  By letter of 2 November 2012 the head of the IZ-77/2 informed the applicant’s father that chronic gastritis was not on the list of diseases which allow patients to receive additional nutrition. 28.  On 30 November 2012 the applicant’s lawyer complained to the prison chief of the deterioration of his client’s health, in particular, of his regular headaches, back pain and weight-gain. He alleged that the applicant had put on 20 kg over the five months in detention and requested an inpatient medical examination. 29.  On 31 January 2013 the applicant was examined by a neurologist and received a prescription for treatment in relation to vegetative-vascular dystonia. At the regular check-up by a GP on 15 February 2013 the applicant stated that his condition had improved; he was recommended to continue the prescribed treatment. 30.  On 14 February 2013 the applicant’s lawyer reiterated his application for a medical examination and asked to give the applicant access to a gym. 31.  On 4 April 2013 a medical commission composed of a GP, an infection specialist, a surgeon and two administrators examined the applicant and his medical history. In addition to the previous diagnoses, they established chronic liver disorder and recommended that he continue the special diet. 32.  On 14 April 2013 the applicant was temporarily transferred to the medical wing of IZ-77/1. Upon his admission he was found to be suffering from second- or third-degree obesity (at this stage he weighed 109 kg and was 178 cm in height) and was prescribed the same diet as before. 33.  In IZ-77/1 the applicant underwent series of medical examinations and tests, including an abdominal ultrasound, a thyroid echography, an electrocardiogram, roentgenofluorography, X-ray examinations of his skull and spine, and blood tests. He was regularly examined by a GP who adjusted the treatment according to the results of the tests. The applicant also had a consultation with a dermatologist. 34.  The public commission for the monitoring of detention facilities visited the applicant on 17 and 24 April and 2 May 2013. According to the journal of their visits, the applicant did not complain of inadequate medical assistance in IZ-77/1. 35.  The discharge summary (выписной эпикриз) from the medical wing of IZ-77/1, issued on 17 May 2013, contained the results of the applicant’s medical examinations. He was diagnosed with osteochondrosis, dorsopathy, fatty liver, hypercholesterolemia, vegetative-vascular dystonia, acne and first-degree obesity. The applicant received a prescription for physiotherapy and a special diet; he was also recommended to undergo a magnetic resonance imaging procedure in relation to a suspected cerebral condition, which had to be carried out in a different hospital equipped with the appropriate scanning device. On the same day the applicant was transferred back to IZ‑77/2. 36.  On 6 July 2013 the applicant lodged a complaint about the authorities’ failure to carry out his medical examination to the Tverskoy District Court of Moscow. On 4 September 2013 the Tverskoy District Court refused to examine this complaint. 37.  The magnetic resonance imaging procedure had not been carried out before the applicant’s release from the detention facility on 2 August 2013. 38.  After release the applicant had a medical examination at the town hospital and a consultation with a prominent gastroenterologist. The doctor confirmed the applicant’s previous diagnoses related to the digestive system and prescribed him medical treatment, a special diet and physical exercise. 39.  The applicant’s description of the conditions of detention during his transfer from the remand prison to court and back was identical to that in the case of Yaroslav Belousov (cited above, §§ 69-73). 40.  On 6 June 2013 court proceedings began in hearing room no. 338 and at the end of July moved to hearing room no. 635 of the Moscow City Court. The defendants, including the applicant, were held in glass cabins in both hearing rooms, as described in Yaroslav Belousov (cited above, §§ 74‑76). From 2 August 2013 the applicant was no longer placed in the glass cabin owing to a change in the measure of restraint for him.