.x3-notifications {
	--x3n-border: #e5e7eb;
	--x3n-ink: #111827;
	--x3n-muted: #64748b;
	--x3n-panel: #ffffff;
	--x3n-soft: #f8fafc;
	width: 100%;
	color: var(--x3n-ink);
}

.x3-notifications__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin: 0 0 14px;
}

.x3-notifications__title {
	margin: 0;
	font-size: 22px;
	line-height: 1.2;
}

.x3-notifications__count {
	display: inline-block;
	margin-top: 4px;
	color: var(--x3n-muted);
	font-size: 13px;
	line-height: 1.3;
}

.x3-notifications__mark-all {
	flex: 0 0 auto;
	border: 1px solid var(--x3n-border);
	border-radius: 6px;
	background: #fff;
	color: var(--x3n-ink);
	padding: 8px 11px;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	transition: opacity .18s ease, background-color .18s ease, border-color .18s ease;
}

.x3-notifications__mark-all:hover {
	background: var(--x3n-soft);
}

.x3-notifications__mark-all.is-loading,
.x3-notifications__mark-all:disabled {
	opacity: .55;
	cursor: wait;
}

.x3-notifications__list {
	display: grid;
	gap: 8px;
}

.x3-notifications__empty,
.x3-notifications--empty p {
	margin: 0;
	padding: 14px 0;
	color: var(--x3n-muted);
}

.x3-notification-item {
	position: relative;
	display: grid;
	grid-template-columns: 10px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
	min-height: 74px;
	padding: 14px;
	border: 1px solid var(--x3n-border);
	border-radius: 8px;
	background: var(--x3n-panel);
	color: inherit;
	text-decoration: none;
	transition: border-color .18s ease, background-color .18s ease, opacity .18s ease, transform .18s ease;
}

.x3-notification-item.is-deleting {
	border-color: #d1d5db;
	background: #f3f4f6;
	color: #94a3b8;
	pointer-events: none;
}

.x3-notification-item.is-deleting .x3-notification-item__dot,
.x3-notification-item.is-deleting .x3-notification-item__body,
.x3-notification-item.is-deleting .x3-notification-item__trash {
	opacity: .24;
}

.x3-notification-item.is-deleting::after {
	content: "Deleting";
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #111827;
	font-family: "Libre Bodoni", serif;
	font-size: 22px;
	font-style: italic;
	font-weight: 600;
	letter-spacing: 0;
	text-align: center;
	pointer-events: none;
}

.x3-notification-item.is-removing {
	opacity: 0;
	transform: translateY(-6px) scale(.985);
	transition: height .34s ease, padding .34s ease, border-width .34s ease, opacity .24s ease, transform .34s ease;
}

.x3-notification-item.is-arriving {
	opacity: 0;
	transform: translateY(8px);
}

.x3-notification-item:not(.is-trashed):hover {
	border-color: #94a3b8;
	background: var(--x3n-soft);
	transform: translateY(-1px);
	color: inherit;
}

.x3-notification-item:not(.is-trashed) {
	padding-right: 42px;
	padding-bottom: 30px;
}

.x3-notification-item__dot {
	width: 8px;
	height: 8px;
	margin-top: 6px;
	border-radius: 999px;
	background: #cbd5e1;
}

.x3-notification-item.is-unread {
	border-color: #bfdbfe;
	background: #f8fbff;
}

.x3-notification-item.is-unread .x3-notification-item__dot {
	background: #2563eb;
}

.x3-notification-item--success.is-unread .x3-notification-item__dot {
	background: #059669;
}

.x3-notification-item--warning.is-unread .x3-notification-item__dot {
	background: #d97706;
}

.x3-notification-item--error.is-unread .x3-notification-item__dot {
	background: #dc2626;
}

.x3-notification-item--priority-high,
.x3-notification-item--priority-urgent {
	border-color: #fed7aa;
}

.x3-notification-item--priority-urgent.is-unread {
	background: #fff7ed;
}

.x3-notification-item__body {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.x3-notification-item__body-link {
	color: inherit;
	text-decoration: none;
}

.x3-notification-item__body-link:hover {
	color: inherit;
	text-decoration: none;
}

.x3-notification-item__title {
	font-weight: 700;
	line-height: 1.25;
}

.x3-notification-item__message {
	color: #334155;
	font-size: 14px;
	line-height: 1.45;
}

.x3-notification-item__group {
	color: #7c2d12;
	font-size: 12px;
	font-weight: 700;
}

.x3-notification-item__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	color: var(--x3n-muted);
	font-size: 12px;
	line-height: 1.3;
}

.x3-notification-item__trash,
.x3-notification-item__restore {
	position: absolute;
	right: 10px;
	bottom: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	color: #64748b;
	cursor: pointer;
	transition: color .18s ease, background-color .18s ease, border-color .18s ease, opacity .18s ease;
}

.x3-notification-item__trash svg,
.x3-notification-item__restore svg {
	width: 18px;
	height: 18px;
	display: block;
	flex: 0 0 auto;
	fill: none !important;
	stroke: currentColor !important;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	overflow: visible;
	pointer-events: none;
}

.x3-notification-item__trash svg path,
.x3-notification-item__restore svg path {
	fill: none !important;
	stroke: currentColor !important;
}

.x3-notification-item__trash:hover,
.x3-notification-item__trash:focus {
	border-color: transparent;
	background: transparent;
	color: #dc2626;
}

.x3-notification-item__restore:hover,
.x3-notification-item__restore:focus {
	border-color: transparent;
	background: transparent;
	color: #2563eb;
}

.x3-notification-item__trash:disabled,
.x3-notification-item__trash.is-loading,
.x3-notification-item__restore:disabled,
.x3-notification-item__restore.is-loading {
	opacity: .55;
	cursor: wait;
}

.x3-notification-item.is-trashed {
	opacity: .72;
	background: #f8fafc;
	padding-right: 42px;
	padding-bottom: 30px;
}

.x3-notifications__trash {
	margin-top: 22px;
	padding-top: 16px;
	border-top: 1px solid var(--x3n-border);
}

.x3-notifications__trash-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.x3-notifications__trash-head h4 {
	margin: 0;
	font-size: 15px;
	line-height: 1.2;
}

.x3-notifications__trash-head span {
	color: var(--x3n-muted);
	font-size: 12px;
	line-height: 1.35;
}

.x3-notifications__trash-list {
	display: grid;
	gap: 8px;
}

.x3-notifications--compact .x3-notifications__title {
	font-size: 18px;
}

.x3-notifications--compact .x3-notification-item {
	min-height: 58px;
	padding: 11px 12px;
}

.x3-notification-item.is-compact {
	min-height: 54px;
	padding: 11px 12px;
}

.x3-notification-item.is-compact:not(.is-trashed),
.x3-notifications--compact .x3-notification-item:not(.is-trashed) {
	padding-right: 38px;
	padding-bottom: 28px;
}

.x3-notification-bell {
	position: relative;
	display: inline-flex;
}

.x3-notification-bell__button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--x3n-border, #e5e7eb);
	border-radius: 999px;
	background: #fff;
	color: #111827;
	cursor: pointer;
	transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.x3-notification-bell__button:hover {
	background: #f8fafc;
	border-color: #94a3b8;
	transform: translateY(-1px);
}

.x3-notification-bell__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	line-height: 1;
	flex: 0 0 auto;
}

.x3-notification-bell__icon svg {
	display: block;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	filter: drop-shadow(
		var(--x3n-icon-shadow-x, 0px)
		var(--x3n-icon-shadow-y, 0px)
		var(--x3n-icon-shadow-blur, 0px)
		var(--x3n-icon-shadow-color, transparent)
	);
}

.x3-notification-bell__badge {
	position: absolute;
	right: -4px;
	top: -5px;
	min-width: 19px;
	height: 19px;
	padding: 0 5px;
	border-radius: 999px;
	background: #dc2626;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 19px;
	text-align: center;
}

.x3-notification-bell__badge:empty,
.x3-notification-bell__badge[hidden] {
	display: none;
}

.x3-notification-bell__panel {
	position: absolute;
	right: 0;
	top: calc(100% + 10px);
	z-index: 10000;
	width: min(92vw, 380px);
	padding: 12px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 22px 60px rgba(15,23,42,.18);
}

.x3-notification-bell__head,
.x3-notification-bell__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 2px 10px;
}

.x3-notification-bell__items {
	display: grid;
	gap: 8px;
	max-height: 440px;
	overflow: auto;
}

.x3-notification-bell__more {
	font-weight: 700;
	text-decoration: none;
}

@media (max-width: 768px) {
	.x3-notification-bell__panel {
		width: min(calc(100vw - 24px), 380px);
		max-width: calc(100vw - 24px);
	}
}

.x3-notification-preferences-wrap {
	margin-top: 28px;
	padding-top: 22px;
	border-top: 1px solid #e5e7eb;
}

.x3-notification-preferences__open {
	border: 1px solid #111827;
	border-radius: 6px;
	background: #111827 !important;
	color: #fff !important;
	padding: 10px 14px;
	cursor: pointer;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	box-shadow: none;
	transition: opacity .18s ease, background-color .18s ease, border-color .18s ease;
}

.x3-notification-preferences__open:hover,
.x3-notification-preferences__open:focus,
.x3-notification-preferences__open:active {
	background: #020617 !important;
	color: #fff !important;
	border-color: #020617 !important;
	text-decoration: none;
	box-shadow: none;
	outline: none;
}

.x3-notification-preferences-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(15,23,42,.38);
	opacity: 0;
	transition: opacity .18s ease;
}

.x3-notification-preferences-modal[hidden] {
	display: none;
}

.x3-notification-preferences-modal.is-open {
	opacity: 1;
}

.x3-notification-preferences-modal__panel {
	position: relative;
	width: min(92vw, 560px);
	max-height: min(78vh, 680px);
	overflow: auto;
	border-radius: 8px;
	background: #fff;
	padding: 22px;
	box-shadow: 0 24px 70px rgba(15,23,42,.25);
	transform: translateY(8px);
	transition: transform .18s ease;
}

.x3-notification-preferences-modal.is-open .x3-notification-preferences-modal__panel {
	transform: translateY(0);
}

.x3-notification-preferences__close {
	position: absolute;
	right: 12px;
	top: 12px;
	width: 30px;
	height: 30px;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	background: #fff;
	color: #111827;
	cursor: pointer;
	line-height: 1;
}

.x3-notification-preferences h3 {
	margin: 0 40px 14px 0;
}

.x3-notification-preferences__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 10px;
	margin: 14px 0;
}

.x3-notification-preferences label {
	display: flex;
	align-items: center;
	gap: 8px;
}

.x3-notification-preferences__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 16px;
}

.x3-notification-preferences__save {
	border: 0;
	border-radius: 6px;
	background: #111827 !important;
	color: #fff !important;
	padding: 10px 14px;
	cursor: pointer;
	text-decoration: none;
	box-shadow: none;
	transition: opacity .18s ease, background-color .18s ease, border-color .18s ease;
}

.x3-notification-preferences__save:hover,
.x3-notification-preferences__save:focus,
.x3-notification-preferences__save:active {
	background: #020617 !important;
	color: #fff !important;
	border-color: #020617 !important;
	text-decoration: none;
	box-shadow: none;
	outline: none;
}

.x3-notification-preferences__save:disabled,
.x3-notification-preferences__save.is-loading {
	background: #111827 !important;
	color: #fff !important;
	opacity: .6;
	cursor: wait;
}

.x3-notification-preferences__status {
	margin-left: 10px;
	color: #64748b;
}

.x3-notification-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(15,23,42,.38);
	opacity: 0;
	transition: opacity .18s ease;
}

.x3-notification-modal.is-open {
	opacity: 1;
}

.x3-notification-modal__panel {
	position: relative;
	width: min(92vw, 520px);
	border-radius: 8px;
	background: #fff;
	padding: 22px;
	box-shadow: 0 24px 70px rgba(15,23,42,.25);
	transform: translateY(8px);
	transition: transform .18s ease;
}

.x3-notification-modal.is-open .x3-notification-modal__panel {
	transform: translateY(0);
}

.x3-notification-modal__close {
	position: absolute;
	right: 12px;
	top: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #111827;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: color .18s ease;
}

.x3-notification-modal__close:hover,
.x3-notification-modal__close:focus {
	background: transparent;
	color: #111827;
	outline: none;
}

@media (max-width: 520px) {
	.x3-notification-bell {
		position: static;
	}

	.x3-notification-bell__panel {
		position: fixed;
		left: 12px;
		right: 12px;
		top: var(--x3n-mobile-panel-top, 72px);
		width: auto;
		max-width: none;
		max-height: calc(100vh - var(--x3n-mobile-panel-top, 72px) - 12px);
		box-sizing: border-box;
		overflow: hidden;
	}

	.x3-notification-bell__items {
		max-height: calc(100vh - var(--x3n-mobile-panel-top, 72px) - 106px);
		overscroll-behavior: contain;
	}

	.x3-notifications__head {
		align-items: flex-start;
		flex-direction: column;
	}

	.x3-notifications__mark-all {
		width: 100%;
	}

	.x3-notification-preferences-modal {
		padding: 12px;
	}

	.x3-notification-preferences-modal__panel {
		width: 100%;
		max-height: calc(100vh - 24px);
		box-sizing: border-box;
	}

	.x3-notification-preferences__open,
	.x3-notification-preferences__save {
		width: 100%;
	}
}
