Solution (source code)

= Solution

The independence fails. Conditioning on $S$, a descendant of $M$, opens the collider path $C\to M\leftarrow A$ even after conditioning on $D$.