+ # cascade unknown versions
+ $row->{$_} //= undef for @$verlist; # ensure stable keys during iteration
+ while (my ($version, $usage) = each %$row) {
+ next if defined $supported{$version};
+ my $next = first { paddedver($_) ge paddedver($version) } @$verlist
+ or warn("No fallback found for $browser v$version; $usage% ignored"), next;
+ $row->{$next} += $usage;
+ $row->{$version} = 0; # balance browser total
+ }
+
+ # build row list for each version
+ if ($minusage = $get{threshold} // .2) {
+ my @vershown; # $verlist replacement
+ my ($rowusage, @verrow) = (0); # replacement row tracking
+ for (@$verlist) {
+ push @verrow, $_; # queue each version
+ if (($rowusage += $row->{$_}) >= $minusage) {
+ push @vershown, [@verrow]; # add row
+ ($rowusage, @verrow) = (0); # reset row tracking
+ }
+ }
+ push @vershown, \@verrow if @verrow; # always add latest
+ @$verlist = @vershown;
+ }
+ else {
+ @$verlist = map { [$_] } @$verlist;
+ }
+
+ # reusable aggregates (grouped by prefix (engine) and browser)
+ $engineuse{ $caniuse->{agents}->{$browser}->{prefix} } +=
+ $row->{-total} = sum(values %$row);
+ }
+
+ # order browser columns by usage grouped by engine
+ @browsers = sort {
+ $engineuse{ $caniuse->{agents}->{$b}->{prefix} } <=>
+ $engineuse{ $caniuse->{agents}->{$a}->{prefix} }
+ ||
+ $canihas->{$b}->{-total} <=> $canihas->{$a}->{-total}
+ } @browsers;
+}
+else {
+ # order browser columns by name grouped by engine
+ @browsers = sort {
+ $caniuse->{agents}->{$b}->{prefix} cmp
+ $caniuse->{agents}->{$a}->{prefix}
+ ||
+ $a cmp $b
+ } @browsers;
+}
+:>.
+</p>
+
+<:
+$canihas ||= {
+ map {
+ $_ => +{
+ map {
+ my $zero = $#$_ - 2; # baseline index
+ ($_->[$zero - 2] => .5), # past
+ ($_->[$zero - 1] => 10 ), # previous
+ ($_->[$zero + 2] => 0 ), # future
+ ($_->[$zero + 1] => .5), # next
+ ($_->[$zero ] => 30 ), # current
+ } $caniuse->{agents}->{$_}->{versions}
+ }
+ } @browsers
+}; # fallback hash based on release semantics
+my $usagemax = (max(map { ref $_ eq 'HASH' && sum(values %$_) } values %$canihas) // 1) / 100;
+
+my $usagepct = 1; # score multiplier for 0..100 result
+# normalise usage percentage to only include shown browsers
+$usagepct = 100.01 / featurescore({ # yes for every possible version
+ map { $_ => { map {$_ => 'y'} map { @{$_} } @{$versions{$_}} } } keys %versions
+});