Social media companies discussed the big business — and risks — of young users in documents released ahead of a major trial.