@php
// Normalise: accept both the new $sheets shape (array of sheets) and
// the legacy $labels shape (single flat array) for any callers that
// haven't migrated yet.
$sheetList = isset($sheets)
? $sheets
: (isset($labels) ? [$labels] : []);
$totalLabels = array_sum(array_map('count', $sheetList));
@endphp