Line your square pan with parchment paper, leaving overhang on the sides for easy removal.
Chop the dark chocolate into small pieces and set aside.
Gently melt the dark chocolate and butter together using a double boiler or microwave in short bursts, stirring until smooth and glossy. The aroma will be rich, and the mixture will be velvety to the touch.
In a large bowl, combine the toasted nuts and optional dried fruit or coconut, along with a pinch of sea salt. Mix to distribute evenly.
Pour the melted chocolate mixture over the nuts, then add the sweetened condensed milk and vanilla extract. Stir thoroughly with a spatula until everything is well coated and evenly combined. The mixture will be thick and sticky, with a glossy sheen.
Transfer the mixture into the prepared pan. Use the back of a spatula or a spoon to press it firmly into the corners and create an even surface—listen for a slight crunch as it compacts.
Place the pan in the refrigerator or freezer and chill for at least 2 hours, or until the slice is firm and set. For quicker results, 1 hour in the freezer works, but cover it to prevent freezer burn.
Once fully chilled and firm, lift the slice out of the pan using the parchment overhang. Transfer to a cutting board.
Use a sharp knife warmed with hot water to cut clean squares or bars. Wipe the blade between cuts to keep edges neat and prevent sticking.
Arrange the slices on a plate and enjoy immediately, or store in an airtight container in the fridge for up to a week. For longer storage, wrap tightly and freeze, then thaw in the fridge before serving.