/*
 * The text-alignment feature (register_text_alignment_feature in
 * src/common/wagtail_hooks.py) applies `display: block; text-align: ...`
 * to the aligned run of characters. When that run sits inside a link,
 * Draftail's link decorator renders the styled span as a child of
 * `<a class="TooltipEntity">` (icon + span), and a block-level child
 * inside an inline anchor forces the browser to break the icon into its
 * own anonymous inline box, detached from the label (ARKA-580).
 *
 * Hoisting the same display/alignment onto .TooltipEntity itself, and
 * demoting its child span back to inline, keeps the icon and label
 * together as a single aligned unit.
 */
.TooltipEntity:has(> [style*="text-align: left"]) {
  display: block;
  text-align: left;
}

.TooltipEntity:has(> [style*="text-align: center"]) {
  display: block;
  text-align: center;
}

.TooltipEntity:has(> [style*="text-align: right"]) {
  display: block;
  text-align: right;
}

.TooltipEntity > [style*="text-align"] {
  display: inline;
}
