The sunshade can be opened and closed by hand.
The sunshade opens automatically when the moonroof is opened, but must be closed by hand.

CAUTION
Jam-safe Moonroof
Security SystemMazda 6 Owners Manual: Electrical parts
Battery cable
Before disconnecting connectors or removing electrical parts, disconnect
the negative battery cable.
Wiring Harness
To remove the wiring harness from the clip in the
engine room, pry up the hook of the clip using a
flathead screwdriver.
...
Mazda 6 Owners Manual: Oil pressure switch inspection
Caution
Water or foreign objects entering the connector can cause poor
connection or corrosion. Be sure not to drop water or foreign objects on the
connector when disconnecting it.
On-vehicle Inspection (harness inspection)
1. Disconnect the negative battery cable.
2. Remove the under ...