Okay, good to know.
So as I said -- calibre, by design, will flatten CSS. Considering most books are not coded with your high standards (and trust me, I know where you are coming from)
this is a good thing! There are valid reasons for calibre to do so.
The one problem with calibre's flatten-the-CSS approach is that it spits out a hard-to-edit book. This issue has been brought up numerous times, and Kovid is
adamant that his approach is correct.
This will not change.
As far as code maintenance and editing goes -- keep your original, master copy. Perform all modifications there. Then use calibre to recompile an end-use AZW3. Do not perform modifications directly in the AZW3 -- because then you will end up with differences between the AZW3 and the EPUB!
Always edit your master format.
Keep your master format safe. calibre doesn't touch that, and doesn't want to.
Might I ask
why you want to convert an EPUB to AZW3, in order to edit the AZW3, just so you can convert it back to EPUB???