In a medium bowl, whisk together the flour, baking powder, and salt. Set aside.
In a large bowl, using a handheld or stand mixer, beat the softened butter and granulated sugar together on high speed for about 3 minutes until super smooth and creamy.
Add the egg, vanilla, and optional almond extract. Beat on high speed for about 1 minute until everything is combined, scraping down the sides and bottom of your bowl.
Slowly add the dry ingredients to the wet mixture, mixing on low speed until just combined. If the dough feels too sticky, mix in one more tablespoon of flour.
Divide the dough into two equal portions. Place each portion on a piece of lightly floured parchment paper or a silicone baking mat. Using a lightly floured rolling pin, roll the dough out evenly to about 1/4-inch thickness.
Lightly dust one rolled-out dough with flour, then place another piece of parchment paper on top. Stack the second rolled-out dough on top. Cover tightly with plastic wrap or foil, and refrigerate for at least 2 hours (or up to 2 days). This chill time is crucial for perfect cookie shapes.
Once the dough is chilled, preheat your oven to 350°F (177°C). Line 2-3 large baking sheets with silicone baking mats or parchment paper.
Carefully remove one dough piece from the fridge. Use a heart-shaped cookie cutter (around 3.5 inches is great) to cut out cookies. Re-roll scraps and cut out more. Repeat with the second dough piece.
Arrange heart cookies about 3 inches apart on the prepared baking sheets. Bake for 11–12 minutes, or until the edges just start to turn a light golden-brown. Let them cool on the baking sheets for 5 minutes before moving them to a wire rack to cool completely. They must be fully cool before decorating!
For the icing: In a large bowl, combine sifted confectioners' sugar, meringue powder, and 9 tablespoons of room-temperature water. Using a hand or stand mixer with a whisk attachment, beat on high speed for 1.5–2 minutes. The icing should drizzle down and smooth out within 5–10 seconds. Adjust consistency with more water (if too thick) or more sifted sugar (if too thin).
Divide the icing into 5-6 different bowls for pastel colors (pink, violet, green, yellow, orange) using tiny drops of gel food coloring. For writing icing, use a separate bowl and mix in 2–3 drops of red gel food coloring. Cover the red icing with a damp paper towel to prevent hardening.
Spoon or pour pastel icings into piping bags fitted with a round tip #4. Outline the edges of each cookie, then fill in the centers. Let the icing-covered cookies sit uncovered for at least 2 hours to set properly.
Once the base icing is mostly set, spoon the red icing into a piping bag with a smaller round tip #2. Pipe Valentine's messages like "LOVE," "XOXO," "HUG," or "SWEET" onto the cookies. Let this writing icing set for another 2–3 hours.
Your beautiful Valentine's cookies are ready!