Found while rebuilding the website on its own engine.
- "Later wins" did not hold between stylesheets. Every sheet numbers its
rules from 0 and the engine sorted by (layer, order) comparing those raw
numbers across sheets, so a later sheet lost to an earlier one whenever
the earlier one had more rules above the rule in question. Reproduced with
a 30 rule sheet followed by a 1 rule sheet: the earlier colour won.
rebuild() now renumbers every rule into one global sequence in load order
(assignGlobalOrder, idempotent via order0). Layers still outrank order.
- Consequence: a tokens { } block in a later sheet now overrides a token an
earlier sheet set inside @media or @signal.
- fluid works on padding-top/right/bottom/left/inline/block, margin-*,
letter-spacing and border-radius, not only the four-sided shorthands.
- scripts/test-v082.mjs (27 assertions) runs the engine's own sort on rules
from real compiled sheets; the first check in each group reproduces the
old bug.
…