.lexum-chat-widget {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: inherit;
}

.lexum-chat-widget__launcher {
	width: 56px;
	height: 56px;
	border: 1px solid #e2e2e2;
	border-radius: 50%;
	background: #fff;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
	display: grid;
	place-items: center;
}

.lexum-chat-widget__launcher .lexum-chat-widget__glyph {
	width: 32px;
	height: 32px;
}

/* Assistant glyph: a rainbow ring (conic gradient with a hollow center mask). */
.lexum-chat-widget__glyph {
	display: inline-block;
	flex: none;
	border-radius: 50%;
	background: conic-gradient(from 215deg, #1e9bff, #6a3df0, #ff3df0, #ff7a3d, #ffe23d, #4dff7a, #3de2ff, #1e9bff);
	-webkit-mask: radial-gradient(circle closest-side, transparent 50%, #000 51%);
	mask: radial-gradient(circle closest-side, transparent 50%, #000 51%);
}

.lexum-chat-widget__header .lexum-chat-widget__glyph {
	width: 22px;
	height: 22px;
}

/* When open, hide the launcher; the panel header's close button takes over. */
.lexum-chat-widget[data-state="open"] .lexum-chat-widget__launcher {
	display: none;
}

.lexum-chat-widget__panel {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 380px;
	height: 600px;
	max-height: calc(100vh - 40px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.lexum-chat-widget__panel[hidden] {
	display: none;
}

.lexum-chat-widget__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	background: var(--lexum-brand, #2C0885);
	color: #fff;
}

.lexum-chat-widget__title {
	font-weight: 600;
	font-size: 15px;
	flex: 1;
}

.lexum-chat-widget__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.lexum-chat-widget__newchat {
	background: rgba(255, 255, 255, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.5);
	color: #fff;
	font-size: 12px;
	line-height: 1;
	padding: 5px 10px;
	border-radius: 6px;
	cursor: pointer;
}

.lexum-chat-widget__newchat:hover {
	background: rgba(255, 255, 255, 0.3);
}

.lexum-chat-widget__close {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

.lexum-chat-widget__body {
	flex: 1;
	min-height: 0;
}

/* Over-length warning, toggled by the input validator. */
.lexum-chat-widget__limit {
	padding: 6px 14px;
	font-size: 12px;
	line-height: 1.3;
	color: #b00020;
	background: #fff4f6;
	border-top: 1px solid #f3c2cd;
}

.lexum-chat-widget__limit[hidden] {
	display: none;
}

.lexum-chat-widget__body deep-chat {
	display: block;
	width: 100%;
	height: 100%;
}

/* "Was this conversation helpful?" strip, revealed by the inline script. */
.lexum-chat-widget__feedback {
	padding: 8px 14px;
	border-top: 1px solid #e2e2e2;
	background: #fafafa;
	font-size: 13px;
	animation: lexum-chat-feedback-in 260ms ease-out;
}

@keyframes lexum-chat-feedback-in {
	from {
		transform: translateY(100%);
		opacity: 0;
	}

	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* Slide back down + fade out after the feedback is submitted or skipped. */
.lexum-chat-widget__feedback--out {
	animation: lexum-chat-feedback-out 240ms ease-in forwards;
}

@keyframes lexum-chat-feedback-out {
	from {
		transform: translateY(0);
		opacity: 1;
	}

	to {
		transform: translateY(100%);
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lexum-chat-widget__feedback,
	.lexum-chat-widget__feedback--out {
		animation: none;
	}
}

.lexum-chat-widget__feedback[hidden],
.lexum-chat-widget__feedback [hidden] {
	display: none;
}

.lexum-chat-widget__feedback-ask {
	display: flex;
	align-items: center;
	gap: 8px;
}

.lexum-chat-widget__feedback-ask span {
	flex: 1;
}

.lexum-chat-widget__feedback-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	min-height: 30px;
	border: 1px solid #d0d0d0;
	background: #fff;
	border-radius: 6px;
	cursor: pointer;
	padding: 3px 9px;
	font-size: 16px;
	line-height: 1;
}

/* WordPress swaps the emoji glyph for a child <img class="emoji">; keep clicks
   on the button, not the image. */
.lexum-chat-widget__feedback-btn img {
	pointer-events: none;
	width: 1.1em;
	height: 1.1em;
	margin: 0;
	vertical-align: middle;
}

.lexum-chat-widget__feedback-btn[aria-pressed="true"] {
	border-color: var(--lexum-brand, #2C0885);
	background: #f0ecff;
}

.lexum-chat-widget__feedback-text {
	width: 100%;
	box-sizing: border-box;
	margin-top: 8px;
	font: inherit;
	border: 1px solid #ccc;
	border-radius: 6px;
	padding: 6px;
	resize: vertical;
}

.lexum-chat-widget__feedback-actions {
	margin-top: 6px;
	display: flex;
	gap: 6px;
}

.lexum-chat-widget__feedback-actions button {
	font: inherit;
	padding: 4px 10px;
	border-radius: 6px;
	cursor: pointer;
}

.lexum-chat-widget__feedback-send {
	background: var(--lexum-brand, #2C0885);
	color: #fff;
	border: 0;
}

.lexum-chat-widget__feedback-skip {
	background: #fff;
	border: 1px solid #ccc;
}

.lexum-chat-widget__feedback-done {
	color: #4a4a4a;
}

/* Dismissible "hey, a chat exists here" callout, pointing at the launcher. */
.lexum-chat-widget__nudge {
	position: absolute;
	right: 0;
	bottom: 70px;
	max-width: 240px;
	background: #fff;
	color: #212529;
	border-radius: 12px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
	padding: 12px 30px 12px 14px;
	font-size: 14px;
	line-height: 1.4;
}

.lexum-chat-widget__nudge[hidden] {
	display: none;
}

/* Little arrow pointing down at the launcher button. */
.lexum-chat-widget__nudge::after {
	content: "";
	position: absolute;
	right: 22px;
	bottom: -7px;
	width: 14px;
	height: 14px;
	background: #fff;
	transform: rotate(45deg);
	box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.08);
}

.lexum-chat-widget__nudge-close {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 22px;
	height: 22px;
	border: 0;
	background: transparent;
	color: #888;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

/* Mobile: panel goes full-screen. */
@media (max-width: 480px) {
	.lexum-chat-widget__launcher {
		position: fixed;
		right: 16px;
		bottom: 16px;
	}

	.lexum-chat-widget__nudge {
		right: 16px;
		max-width: calc(100vw - 32px);
	}

	.lexum-chat-widget__panel {
		position: fixed;
		inset: 0;
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		max-height: none;
		border-radius: 0;
	}
}
