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: Clutch master cylinder disassembly/assembly
1. Disassemble in the order indicated in the table.
2. Assemble in the reverse order of disassembly.
Snap Ring Disassembly/Assembly Note
Hold the piston down using a cloth-wrapped pin punch.
If disassembling, remove the snap ring; if assembling, install it.
...
Mazda 6 Owners Manual: A/c unit removal/installation
1. Disconnect the negative battery cable.
2. Discharge the refrigerant from the system. (See RECOVERY.) (See CHARGING.)
3. Drain the engine coolant. (See ENGINE COOLANT REPLACEMENT.)
4. Remove the dashboard. (See DASHBOARD REMOVAL/INSTALLATION.)
5. Remove the theft-deterrent control module. (See ...