X-rays record structural changes inside lithium batteries