Client died by suicide and I am devastated

My client died by suicide the day after our session this week. I had only been meeting with them for a few months but felt really connected to them, and the case was on my mind a lot due to many other risk factors and complications. They repeatedly said that our sessions were a safe space for them. I knew they were really struggling and a past attempt actually came up in that last session (which I am now realizing may have been something they brought up because they were considering this)- I made a safety assessment and based on their assurance that they wanted to live I really didn’t see this coming. Now I am playing that session over and over in my mind, thinking of all the things I could have done differently, hints that I missed. I am an experienced clinician but this is the first time this has happened to me and I don’t know how it will ever stop haunting me.