/* Must beat #headerAppsLinks li { flex-shrink: 0 }: the ticker is the only thing allowed to give up width */
#headerAppsLinks #birthday-celebration {
	gap: 0;
	flex-shrink: 1;
	cursor: pointer;
}

/* Aligned with the cake icon (not the whole icon+label column) so the bubble tail points at it */
.birthday-ticker {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: center;
	align-self: flex-start;
	min-width: 0;
	margin-top: 6px;
	margin-left: -6px;
}

.birthday-person {
	position: relative;
	grid-area: 1 / 1;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 3px 12px 3px 3px;
	border-radius: 999px;
	background: #FFF1F6;
	border: 1px solid rgba(194, 24, 91, 0.18);
	white-space: nowrap;
	opacity: 0;
	transform: translateY(4px) scale(0.98);
	transition: opacity 0.45s ease, transform 0.45s ease;
	pointer-events: none;
}

.birthday-person::before {
	content: '';
	position: absolute;
	left: -5px;
	top: 50%;
	width: 8px;
	height: 8px;
	background: inherit;
	border-left: inherit;
	border-bottom: inherit;
	transform: translateY(-50%) rotate(45deg);
}

.birthday-person.is-active {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

.birthday-person-name {
	font-size: 13px;
	font-weight: 600;
	color: #333;
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.birthday-avatar {
	flex-shrink: 0;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	background: #fff;
}

/* ID selector needed to beat the generic #headerAppsLinks img sizing */
#birthday-celebration .birthday-avatar {
	width: 28px;
	height: 28px;
}

.birthday-avatar-initials {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #F48FB1, #C2185B);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.5px;
}

.birthday-panel {
	position: absolute;
	z-index: 1000;
	width: min(320px, 90vw);
	max-height: 440px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	font-family: Arial, Helvetica, sans-serif;
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.birthday-panel-open {
	opacity: 1;
	transform: translateY(0);
}

.birthday-panel-title {
	padding: 14px 16px 10px;
	font-size: 15px;
	font-weight: 700;
	color: #1a1a1a;
	border-bottom: 1px solid #eee;
}

.birthday-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 8px;
}

.birthday-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 8px;
	border-radius: 8px;
	color: inherit;
	text-decoration: none;
	transition: background-color 0.12s ease;
}

.birthday-row:hover {
	background: rgba(194, 24, 91, 0.07);
}

.birthday-row .birthday-avatar {
	width: 36px;
	height: 36px;
	font-size: 13px;
}

.birthday-row-name {
	flex: 1;
	min-width: 0;
	font-size: 13px;
	font-weight: 600;
	color: #222;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.birthday-row-steve {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	opacity: 0.45;
	transition: opacity 0.12s ease;
}

.birthday-row:hover .birthday-row-steve {
	opacity: 1;
}

/* #headerAppsLinks is the container; degrade the ticker before it could overlap the header's right part */
@container (max-width: 460px) {
	.birthday-person-name {
		display: none;
	}

	.birthday-person {
		padding-right: 3px;
	}
}

@container (max-width: 370px) {
	.birthday-ticker {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.birthday-person,
	.birthday-panel {
		transition: none;
	}
}

@media print {
	.birthday-panel {
		display: none !important;
	}
}
