Court ruling adds red ink to state books