For some years I've been working at making a better e-pub that comes out how I want it. I've learned it's hard not to mess up the code and end up with a sub-optimal result. This is mostly due to the lack of instructional material on how to get the best out of the various software programs and options. However, I've also learned much by trial an error.
If you create an e-pub direct from the word processing file you usually end up with a very bloated e-pub in the end due to excessive format coding and the way the convertor programs create css sheets for each chapter in the book.
For the last few years I've been working on including the css stylesheet code in the html file I create the e-pub from, and found that this gives a better finish and a smaller e-pub file. I've also found there are a number of tweaks that helps this along. So here's some for you to use to help with your next use of Calibre to make an e-pub based on my experiences with the program.
1. Create the e-pub from a clean html file with all of the unneeded format code removed.
2. Never include any in-line format code other than what is in your stylesheet code so that the in-line code is either a paragraph class command or a span command.
3. Include your stylesheet code in the head section of the html file just after the metadata.
4. Have the stylesheet code start with the character format code definitions then the paragraph code definitions. For some reason it works better to have things like the italics, bold, and similar character span definitions at the head of the code than at the bottom. I found this out by trial an error, and it can make a serious difference in the finished file size due to how Calibre handles the code - I don't why, but it does.
Having learned some of this recently I'm now reconverting all my e-pubs to use the latest format and I'm seeing the file sizes drop significantly. Just the moving the bold and italics code to the top of the list cuts the finished file size by about 20% or more. In some cases the new files are only 25% of the old one made a year ago.
Have fun.