// Resolve a CSS custom property on an element via getComputedStyle.
// Returns the trimmed value, or `fallback` if undefined / empty.
export function readCssVar(el: Element, name: string, fallback = ''): string {
  if (typeof window === 'undefined') return fallback;
  const value = getComputedStyle(el).getPropertyValue(name).trim();
  return value || fallback;
}
