Court strikes down "unlawful" cap on defence costs