I feel like I almost grasp the fine differences between detail (countable), detail (uncountable) and details (plural only), but just almost. It's still a little difficult to spontaneously know which word to use.
Here are the definitions from the Oxford Advanced Learner's Dictionary:
[countable] a small individual fact or item; a less important fact or
[uncountable] the small facts or features of something, when you consider them all together
details [plural] information about something
[countable, uncountable] a small part of a picture or painting; the smaller or less important parts of a picture, pattern, etc. when you consider them all together
It seems to me that the countable and uncountable uses are about small, trivial facts, features, parts, etc. that make up something, while the plural use is simply about a collection of pieces of information that describes someone or something. But then when I'm actually trying to use these words, I'm not sure if the distinction I think I get even works at all.
The details of this plan were well prepared. (countable, the elements of the plan were not shoddy or cursory?)
The detail of this plan was well prepared. (uncountable, the plan has an adequate number of elements, not too few?)
The details of this plan were well prepared. (plural, the pieces of information that describe this plan, such as "name", "date", "costs", "funding", etc. were adequately provided with clarity and transparency?)
attention to details (countable, attention to how each parts are made?)
attention to detail (uncountable, attention to how many parts there are? too many or too few?)
attention to details (plural, attention to info such as "name", "date of birth", "age", "occupation", etc.?)
This document contains excessive details. (countable, this document has certain parts that are too elaborate, for example, a 300-word description about the person's hair color?)
This document contains excessive detail. (uncountable, this document has too many parts, for example 100 instead of just 10?)
This document contains excessive details. (plural, this document has much irrelevant info, for example a birth certificate with info about "hobbies"?)