+ # 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
+ }
+
+ # 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 / featurescore({ # yes for every possible version
+ map { $_ => { map {$_ => 'y'} @{$versions{$_}} } } keys %versions
+});