Write it in plaintext, any editor.
Do your layout / formatting using Calibre software
, can then export to Kindle, epub, PDF, html+css and more.
Do the chapters one at a time, trial export as you go to all the target formats, in case you find a glitch or two.
Can also send to print-on-demand fulfillment if anyone wants a dead trees version.