.kw-message-popup {
	display: none;
	position: fixed;
	right: 1.25rem;
	bottom: 1.25rem;
	z-index: 10060;
	max-width: 360px;
	width: calc(100% - 2.5rem);
	pointer-events: none;
}

.kw-message-popup.kw-message-popup--visible {
	display: block;
	pointer-events: auto;
	animation: kw-message-popup-in 0.35s ease-out;
}

body.kw-message-popup-open .kw-site-announcement.kw-site-announcement--visible {
	bottom: calc(1.25rem + min(340px, 55vh));
}

@keyframes kw-message-popup-in {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.kw-message-popup__panel {
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
	border: 2px solid #212529;
	overflow: hidden;
	font-size: 1.35rem;
}

.kw-message-popup__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	background: #dc3545;
	border-bottom: 2px solid #212529;
}

.kw-message-popup__title-wrap {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
}

.kw-message-popup__icon {
	color: #fff;
	font-size: 1.1rem;
}

.kw-message-popup__title {
	margin: 0;
	font-family: 'Playfair Display', serif;
	font-size: 1.15rem;
	font-weight: 700;
	color: #fff;
	line-height: 1.2;
}

.kw-message-popup__count {
	font-size: 0.8rem;
	font-weight: 700;
}

.kw-message-popup__close {
	flex-shrink: 0;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: none;
	background: rgba(255, 255, 255, 0.92);
	color: #212529;
	border-radius: 50%;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
}

.kw-message-popup__close:hover {
	background: #fff;
	color: #dc3545;
}

.kw-message-popup__list {
	max-height: 320px;
	overflow-y: auto;
	background: #f8f9fa;
}

.kw-message-popup__item {
	display: block;
	width: 100%;
	padding: 0.85rem 1rem;
	border: none;
	border-bottom: 2px solid rgba(0, 0, 0, 0.06);
	text-align: left;
	cursor: pointer;
	transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.kw-message-popup__item:hover,
.kw-message-popup__item:focus {
	filter: brightness(0.97);
	outline: none;
	box-shadow: inset 0 0 0 2px rgba(220, 53, 69, 0.35);
}

.kw-message-popup__item--shade-0 {
	background: #fff0f3;
}

.kw-message-popup__item--shade-1 {
	background: #eef6ff;
}

.kw-message-popup__item--shade-2 {
	background: #eefbf1;
}

.kw-message-popup__item--shade-3 {
	background: #fff8ec;
}

.kw-message-popup__item--shade-4 {
	background: #f3efff;
}

.kw-message-popup__item-type {
	font-size: 0.72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #dc3545;
	margin-bottom: 0.2rem;
}

.kw-message-popup__item-ref {
	font-size: 0.92em;
	font-weight: 600;
	color: #212529;
	margin-bottom: 0.25rem;
}

.kw-message-popup__item-preview {
	font-size: 1em;
	line-height: 1.45;
	color: #495057;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.kw-message-popup__item-time {
	font-size: 0.72em;
	color: #868e96;
	margin-top: 0.35rem;
}

.kw-message-popup__empty {
	padding: 1.25rem 1rem;
	text-align: center;
	color: #6c757d;
	font-size: 1em;
}

.kw-message-popup__footer {
	padding: 0.75rem 1rem 1rem;
	background: #fff;
	border-top: 1px solid #eee;
}

.kw-message-popup__inbox-btn {
	display: block;
	width: 100%;
	text-align: center;
	padding: 0.55rem 1rem;
	border-radius: 999px;
	background: #dc3545;
	color: #fff !important;
	font-weight: 600;
	text-decoration: none;
	font-size: 1em;
}

.kw-message-popup__inbox-btn:hover {
	background: #bb2d3b;
	color: #fff !important;
}

@media (max-width: 575.98px) {
	.kw-message-popup {
		right: 0.75rem;
		bottom: 0.75rem;
		width: calc(100% - 1.5rem);
	}

	body.kw-message-popup-open .kw-site-announcement.kw-site-announcement--visible {
		bottom: calc(0.75rem + min(320px, 50vh));
	}
}
