As a 16-year-old transgender youth remains languishing in solitary confinement at an adult prison, legal questions have been raised about a rarely-used law that has allowed her to be held without being convicted of a criminal offense.

The balance between the youth’s rights under federal law, and the state law intended to protect her from causing harm to herself or others, is at the center of a discussion her lawyers are having as they try to reach a compromise with the Department of Children and Families.