/* Avatar Badges — docked, overlapping SVG chips, hover popup */

.abBadges {
	display: flex;
	flex-wrap: nowrap;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	justify-content: center;
	align-items: center;
	line-height: 0;
}

.abBadges__item {
	position: relative;
	margin: 0 0 0 -6px;
	padding: 0;
	line-height: 0;
	cursor: default;
}

.abBadges__item[data-ab-url] {
	cursor: pointer;
}

.abBadges__item:first-child {
	margin-left: 0;
}

/* Right (higher sort) overlaps left; hover still rises above all */
.abBadges__item:hover,
.abBadges__item:focus-within {
	z-index: 100 !important;
}

.abBadges__chip {
	position: relative;
	display: inline-block;
	width: 22px;
	height: 22px;
	padding: 0;
	border-radius: 50%;
	box-sizing: border-box;
	overflow: hidden;
	flex: 0 0 22px;
	line-height: 0;
	vertical-align: middle;
	transform: scale(1);
	transform-origin: 50% 50%;
	transition: transform 0.12s ease;
}

.abBadges__chip--image {
	background: transparent;
	padding: 0;
}

.abBadges__img {
	position: absolute;
	left: 0;
	top: 0;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	margin: 0;
}

.abBadges__svg {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 14px;
	height: 14px;
	margin: 0;
	padding: 0;
	overflow: visible;
	pointer-events: none;
	transform: translate(-50%, -50%);
}

.abBadges__svg path {
	fill: currentColor;
	fill-rule: nonzero;
	fill-opacity: 1;
}

.abBadges__item:hover .abBadges__chip,
.abBadges__item:focus-within .abBadges__chip {
	transform: scale(1.12);
	transform-origin: 50% 50%;
}

/* Popup — fixed via JS preferred; CSS fallback relative to item */
.abBadges__popup {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 10px);
	transform: translateX(-50%);
	padding: 5px 9px;
	border-radius: 6px;
	background: rgba(20, 22, 28, 0.96);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.25;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.12s ease, visibility 0.12s;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
	z-index: 30;
	max-width: 200px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.abBadges__popup::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -5px;
	border: 5px solid transparent;
	border-top-color: rgba(20, 22, 28, 0.96);
}

.abBadges__popup.is-fixed {
	position: fixed;
	bottom: auto;
	left: auto;
	transform: none;
	z-index: 99999;
}

.abBadges__item:hover .abBadges__popup:not(.is-fixed),
.abBadges__item:focus-within .abBadges__popup:not(.is-fixed) {
	opacity: 1;
	visibility: visible;
}

.abBadges__popup.is-fixed.is-open {
	opacity: 1;
	visibility: visible;
}

/* Dock top-right on avatar — NO transform (breaks popup). */
.cAuthorPane_photoWrap,
a.ipsUserPhoto.ipsUserPhoto_large,
a.ipsUserPhoto,
.ipsUserPhoto {
	position: relative;
	overflow: visible !important;
}

.cAuthorPane_photoWrap > .abBadges,
a.ipsUserPhoto > .abBadges,
.ipsUserPhoto > .abBadges,
.cAuthorPane_photoWrap .abBadges--docked,
a.ipsUserPhoto .abBadges--docked {
	position: absolute;
	top: -7px;
	right: -5px;
	left: auto;
	bottom: auto;
	margin: 0;
	z-index: 6;
	width: max-content;
	max-width: 100%;
	justify-content: flex-end;
	pointer-events: auto;
	overflow: visible;
}

.cAuthorPane_photo > .abBadges,
.cAuthorPane_photoWrap + .abBadges,
li.cAuthorPane_photo > .abBadges {
	margin-top: 0;
}

.cAuthorPane_abBadges {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: right;
	overflow: visible;
}

/* HoverCard + Profile: fallback host when not inside photo */
.abBadgesHost {
	position: absolute;
	top: -7px;
	right: -5px;
	display: flex;
	justify-content: flex-end;
	width: auto;
	margin: 0;
	z-index: 6;
	pointer-events: none;
}

.abBadgesHost .abBadges {
	pointer-events: auto;
	position: relative;
	top: auto;
	right: auto;
	left: auto;
	bottom: auto;
	margin: 0;
}

.abBadgesHost--hovercard,
.abBadgesHost--profile {
	margin: 0;
}

/* If photo wrapper can host absolute dock */
.ipsHovercard .ipsUserPhoto,
.ipsPageHead .ipsUserPhoto,
.cProfileHeader_name .ipsUserPhoto {
	position: relative;
	overflow: visible !important;
}
