ct();
  
  // Calculate available space on the right
  const viewportWidth = window.innerWidth;
  const rightSpace = viewportWidth - rect.left - window.scrollX;
  
  // Check if there's enough space to the right
  if (rightSpace < 250) { // 250px is approximate popover width
    // Not enough space on right, position to the left of target
    valuePopover.style.left = `${Math.max(rect.left + window.scrollX - 200, 10)}px`;
  } else {
    // Enough space on right, position at target left
    valuePopover.styl