If the CSS file referred to by TTMSWEBStyles.CSSStyleFileName contains import rules, the class function FindCSSStyleRule will fail.
I therefore suggest to add
if (classes[x].selectorText !== undefined) {
before
if (classes[x].selectorText.startsWith(s))
FNC Core's TTMSFNCStyles and VCL UI Pack's AdvGraphicsStyles have the same issue.