; (ii) all other options to de-escalate the situation have been exhausted, including less restrictive techniques such as— (I) penalizing the inmate through loss of privileges; (II) speaking with the inmate in an attempt to de-escalate the situation; and (III) a licensed mental health professional providing an appropriate level of care; (iii) such confinement is limited to— (I) 3 hours after the inmate is placed in solitary confinement, if the inmate poses a substantial and immediate threat to others; or (II) 30 minutes after the inmate is placed in solitary confinement, if the inmate poses a substantial and immediate threat only to himself or herself; and (iv) if, after the applicable maximum period of confinement under subclause (I) or (II) of clause (iii) has expired, the inmate continues to pose a substantial and immediate threat described in that subclause— (I) the inmate shall be transferred to another facility or internal location where services can be provided to the inmate without relying on solitary confinement; or (II) if a qualified mental health professional believes the level of crisis service needed is not currently available, a staff member of the facility shall initiate a referral to a location that can meet the needs of the inmate; (B) the inmate has a serious mental illness, has an intellectual disability, has a physical disability that a licensed medical professional finds is likely to be exacerbated by placement in solitary confinement, is pregnant or in the first 8 weeks of the postpartum recovery period after giving birth, or has been determined by a licensed mental health professional to likely be significantly adversely affected by placement in solitary confinement, unless— (i) the inmate poses a substantial and immediate threat; (ii) all other options to de-escalate the situation have been exhausted, including less restrictive techniques such as— (I) penalizing the inmate through loss of privileges; (II) speaking with the inmate in an attempt to de-escalate the situation