; and (II) inform the covered juvenile that release from room confinement will occur— (aa) immediately when the covered juvenile regains self-control, as described in subparagraph (B)(i); or (bb) not later than after the expiration of the time period described in subclause (I) or (II) of subparagraph (B)(ii), as applicable. (B) Maximum period of confinement If a covered juvenile is placed in room confinement because the covered juvenile poses a serious and immediate risk of physical harm to himself or herself, or to others, the covered juvenile shall be released— (i) immediately when the covered juvenile has sufficiently gained control so as to no longer engage in behavior that threatens serious and immediate risk of physical harm to himself or herself, or to others; or (ii) if a covered juvenile does not sufficiently gain control as described in clause (i), not later than— (I) 3 hours after being placed in room confinement, in the case of a covered juvenile who poses a serious and immediate risk of physical harm to others; or (II) 30 minutes after being placed in room confinement, in the case of a covered juvenile who poses a serious and immediate risk of physical harm only to himself or herself. (C) Risk of harm after maximum period of confinement If, after the applicable maximum period of confinement under subclause (I) or (II) of subparagraph (B)(ii) has expired, a covered juvenile continues to pose a serious and immediate risk of physical harm described in that subclause— (i) the covered juvenile shall be transferred to another juvenile facility or internal location where services can be provided to the covered juvenile without relying on room confinement