After ‘tense negotiations’ with OpenAI, California enacts law named for teen who consulted ChatGPT before suicide. It could become a national standard