Apple hits $5 trillion market cap as restrained AI strategy wins favor