Combining css and inline styles is something which hasn't been 'the done thing' in more than ten years
At first I took this on face-value as I accept that in theory, CSS and in-line styles are best kept separate. But then I wondered how true this is in the real world so looked at a few big name sites. The first I looked at have dynamical created content: Google, BBC. So I looked at Booking.com as I've seen this held up in a number of places as being (one of) the top sites written in Perl.
Look what I found within moments of examining the source HTML...
<input
style="display: none"
type="number"
class="bui-stepper__input"
data-bui-ref="input-stepper-field"
id="group_children"
name="group_children"
min="0"
max="10"
value="0"
data-group-children-count
/>
This is just one of many examples on the site today.
I'm not suggesting that bad practice in one place is justification for not trying to adopt best practice. However, it does show that I am hardly alone in this approach regardless of how much it isn't the 'done thing'.
I'm not sure debating one bit of sample HTML which was shared to demonstrate something completely different helps with the original question about heredocs or with the subsequent divergence into templates.