Then dragging A1 below C3 will place it into group B2 instead of into the topmost layer of the container. This happens because the container to drag into is found by taking the next control (and there isn't one) and stripping off the first four words of its ID.
To solve this will require (I think) keeping track of the base container of the last control, or some other way of knowing whether the main displayed container is a card or a group (and what group).
Meaning that if you have this layout:
A1 A2 ...B1 ...B2 ......C1 ......C2 ......C3
Then dragging A1 below C3 will place it into group B2 instead of into the topmost layer of the container. This happens because the container to drag into is found by taking the next control (and there isn't one) and stripping off the first four words of its ID.
To solve this will require (I think) keeping track of the base container of the last control, or some other way of knowing whether the main displayed container is a card or a group (and what group).