Sorry to hear about your kitty - it's heartbreaking when they're not well.
We took our ancient guy to the vet in tears on several occasions expecting the pts conversation, but in the end, we didn't have to.
That cat fought tooth and nail to live. He came to us as a stray aged around 8, and he was living his best life with us and he wasn't relinquishing it easy!
Our guy had weak back legs for a few years - can't remember how long - and it was sad when he couldn't get upstairs any more. Though he did surprise us one day by making it! He was blind in one eye (blame a stupid vet for that!), had several episodes of vestibular disease, epileptic, arthritic and eventually diabetic and still he fought on.
He'd only been able to groom his face, bib and front paws for a very long time. We had to cut tats out for him. I think what kept him going for so long (he was at least 20 when he died!) was that he loved his food, and only stopped eating the day before he passed away. He had his first episode of vestibular disease one Christmas and though he could barely stand, he scoffed turkey like it was going out of fashion!!
He actually put weight on in the last few weeks of his life!
I tried to get him a litter tray that he could access more easily but the only one I could find was on Amazon US! Had to get it sent to a contact in NY but it was too late to help him by the time I got it. I've since noticed seed trays in a garden centre that I think might have made it easier for him. That might be an option, given the arthritis?
Our boy was doubly incontinent at the end, and omg it was hard going! But he still didn't want to go, and the vet agreed. (I had him at the vet two days before he died, and he agreed it wasn't time yet).
Hopefully your boy will perk up x