CHICAGO — Even as national organizations rallied this week to end solitary confinement for incarcerated juveniles across the country, the local branch of American Civil Liberties Union is working with prison officials and the federal court to focus on the issue here. The goal: settle a lawsuit on behalf of 2,217 incarcerated youth with the Illinois Department of Juvenile Corrections over the system’s inadequate services and often-hostile environment. A preliminary agreement calls for curbing the growing practice of solitary confinement in youth centers, which activists say constitutes “torture,” given its potential for causing long-lasting psychological harm. The proposed settlement, which is due for a fairness hearing in federal court in Chicago on December 6, would be the latest victory in a larger movement to end the punitive isolation of youth in custody. In June, Congress held its first hearing on the issue of solitary confinement within U.S. prisons, where roughly 80,000 inmates are in “restricted housing“ at any given time nationwide, according to a 2005 census of adult inmates by the federal Bureau of Justice Statistics.