; and (ii) the court may not issue a second or subsequent order described in clause (i) relating to a juvenile, unless the juvenile violates a valid court order after the date on which the court issues an order described in clause (i); (D) there are procedures in place to ensure that any juvenile held in a secure detention facility or correctional facility pursuant to a court order described in this paragraph does not remain in custody longer than 3 days (with the exception of weekends and holidays) or the length of time authorized by the court, or authorized under applicable State law, whichever is shorter; (E) juvenile status offenders detained or confined in a secure detention facility or correctional facility pursuant to a court order as described in this paragraph may only be detained in secure custody one time in any six-month period, provided that all conditions set forth in subparagraph (D) are satisfied; and (F) not later than one year after the date of enactment of this subparagraph, with a single one-year extension if the State can demonstrate hardship as determined by the Administrator, the State will eliminate the use of valid court orders as described in subparagraph (A)(ii) to provide secure lockup of status offenders; ; and (2) by adding at the end the following: (g) Applications for extension for compliance States may apply for a single one-year extension to comply with subsection (a)(11). To apply, a State must submit an application to the Administrator describing— (1) the State’s measurable progress and good faith effort to reduce the number of status offenders who are placed in a secure detention facility or correctional facility pursuant to a court order as described in this paragraph; and (2) the State’s plan to come into compliance not later than 1 year after the date of extension. .