Brazil court largely upholds law that some fear hurts Amazon