.edai-chat,
.edai-chat * {
	box-sizing: border-box;
}

.edai-chat {
	--edai-red: #e43f3f;
	--edai-red-dark: #c93131;
	--edai-charcoal: #333;
	--edai-text: #242424;
	--edai-muted: #727272;
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 2147482000;
	font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--edai-text);
}

.edai-chat button,
.edai-chat input,
.edai-chat textarea {
	font: inherit;
}

.edai-chat__launcher {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 118px;
	height: 52px;
	padding: 0 18px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: 3px;
	background: var(--edai-red);
	box-shadow: 0 14px 32px rgba(0, 0, 0, .24);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.edai-chat__launcher:hover,
.edai-chat__launcher:focus-visible {
	background: var(--edai-red-dark);
	box-shadow: 0 17px 38px rgba(0, 0, 0, .3);
	transform: translateY(-2px);
}

.edai-chat__launcher svg {
	width: 23px;
	height: 23px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.edai-chat__unread {
	position: absolute;
	top: -7px;
	right: -7px;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #222;
	color: #fff;
	font-size: 11px;
}

.edai-chat__panel {
	position: absolute;
	right: 0;
	bottom: 66px;
	display: flex;
	flex-direction: column;
	width: min(390px, calc(100vw - 32px));
	height: min(640px, calc(100vh - 120px));
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, .1);
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
	opacity: 0;
	pointer-events: none;
	transform: translateY(16px) scale(.98);
	transform-origin: bottom right;
	transition: opacity .18s ease, transform .18s ease;
}

.edai-chat.is-open .edai-chat__panel {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.edai-chat.is-open .edai-chat__launcher {
	opacity: 0;
	pointer-events: none;
}

.edai-chat__header {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 72px;
	padding: 12px 14px;
	background: var(--edai-charcoal);
	color: #fff;
}

.edai-chat__avatar {
	display: grid;
	flex: 0 0 42px;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 1px solid rgba(255, 255, 255, .3);
	border-radius: 50%;
	background: var(--edai-red);
	font-family: Georgia, serif;
	font-size: 22px;
	font-weight: 700;
}

.edai-chat__heading {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.edai-chat__heading strong {
	overflow: hidden;
	font-size: 16px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.edai-chat__heading span {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 3px;
	color: rgba(255, 255, 255, .72);
	font-size: 12px;
}

.edai-chat__heading i {
	display: block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #68c776;
	box-shadow: 0 0 0 3px rgba(104, 199, 118, .15);
}

.edai-chat__heading i[data-mode="waiting"] {
	background: #ffb64d;
	box-shadow: 0 0 0 3px rgba(255, 182, 77, .16);
}

.edai-chat__heading i[data-mode="operator"] {
	background: #66a9ff;
	box-shadow: 0 0 0 3px rgba(102, 169, 255, .16);
}

.edai-chat__heading i[data-mode="closed"] {
	background: #aaa;
	box-shadow: none;
}

.edai-chat__heading em {
	overflow: hidden;
	font-style: normal;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.edai-chat__close {
	display: grid;
	flex: 0 0 34px;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 27px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
}

.edai-chat__close:hover,
.edai-chat__close:focus-visible {
	background: rgba(255, 255, 255, .1);
}

.edai-chat__messages {
	flex: 1;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 18px 15px 8px;
	background: #f7f7f7;
	scroll-behavior: smooth;
}

.edai-chat__message {
	display: flex;
	margin: 0 0 11px;
}

.edai-chat__message.is-visitor {
	justify-content: flex-end;
}

.edai-chat__bubble {
	max-width: 82%;
	padding: 10px 12px;
	border: 1px solid #e4e4e4;
	border-radius: 4px 13px 13px;
	background: #fff;
	box-shadow: 0 2px 7px rgba(0, 0, 0, .04);
	color: var(--edai-text);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.edai-chat__message.is-visitor .edai-chat__bubble {
	border-color: var(--edai-red);
	border-radius: 13px 4px 13px 13px;
	background: var(--edai-red);
	color: #fff;
}

.edai-chat__message.is-operator .edai-chat__bubble {
	border-color: #d7e8fb;
	background: #eaf4ff;
}

.edai-chat__message.is-system {
	justify-content: center;
}

.edai-chat__message.is-system .edai-chat__bubble {
	max-width: 95%;
	padding: 7px 10px;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: var(--edai-muted);
	font-size: 12px;
	text-align: center;
}

.edai-chat__message.is-error .edai-chat__bubble {
	color: #a22929;
}

.edai-chat__message.is-pending {
	opacity: .65;
}

.edai-chat__bubble a {
	color: var(--edai-red-dark);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.edai-chat__message.is-visitor .edai-chat__bubble a {
	color: #fff;
}

.edai-chat__typing .edai-chat__bubble {
	display: flex;
	gap: 4px;
	padding: 13px 15px;
}

.edai-chat__typing i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #999;
	animation: edai-dot 1s infinite ease-in-out;
}

.edai-chat__typing i:nth-child(2) {
	animation-delay: .14s;
}

.edai-chat__typing i:nth-child(3) {
	animation-delay: .28s;
}

@keyframes edai-dot {
	0%, 60%, 100% { transform: translateY(0); opacity: .45; }
	30% { transform: translateY(-4px); opacity: 1; }
}

.edai-chat__faq {
	display: flex;
	flex-wrap: nowrap;
	gap: 7px;
	overflow-x: auto;
	padding: 8px 14px 4px;
	background: #f7f7f7;
	scrollbar-width: none;
}

.edai-chat__faq::-webkit-scrollbar {
	display: none;
}

.edai-chat__faq button {
	flex: 0 0 auto;
	max-width: 260px;
	padding: 7px 10px;
	border: 1px solid #d9d9d9;
	border-radius: 999px;
	background: #fff;
	color: #444;
	font-size: 12px;
	line-height: 1.25;
	cursor: pointer;
}

.edai-chat__faq button:hover {
	border-color: var(--edai-red);
	color: var(--edai-red-dark);
}

.edai-chat__handoff-wrap {
	padding: 8px 14px 5px;
	background: #fff;
	text-align: center;
}

.edai-chat__handoff {
	padding: 4px 8px;
	border: 0;
	background: transparent;
	color: #666;
	font-size: 12px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.edai-chat__handoff:hover {
	color: var(--edai-red-dark);
}

.edai-chat__contact {
	margin: 8px 14px;
	padding: 14px;
	border: 1px solid #ddd;
	border-radius: 5px;
	background: #fff;
	box-shadow: 0 8px 22px rgba(0, 0, 0, .08);
}

.edai-chat__contact strong {
	display: block;
	margin-bottom: 3px;
}

.edai-chat__contact > p {
	margin: 0 0 10px;
	color: var(--edai-muted);
	font-size: 12px;
}

.edai-chat__contact label {
	display: block;
	margin: 7px 0;
	color: #555;
	font-size: 12px;
}

.edai-chat__contact input {
	width: 100%;
	height: 36px;
	margin-top: 3px;
	padding: 6px 8px;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #fff;
	color: #222;
	outline: none;
}

.edai-chat__contact input:focus {
	border-color: var(--edai-red);
	box-shadow: 0 0 0 2px rgba(228, 63, 63, .12);
}

.edai-chat__contact-actions {
	display: flex;
	justify-content: flex-end;
	gap: 7px;
	margin-top: 11px;
}

.edai-chat__contact-actions button {
	padding: 7px 11px;
	border: 1px solid #ccc;
	border-radius: 3px;
	background: #fff;
	cursor: pointer;
}

.edai-chat__contact-actions button[type="submit"] {
	border-color: var(--edai-red);
	background: var(--edai-red);
	color: #fff;
}

.edai-chat__form-error {
	margin: 7px 0 0 !important;
	color: #b02e2e !important;
}

.edai-chat__composer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #e8e8e8;
	background: #fff;
}

.edai-chat__composer textarea {
	flex: 1;
	min-height: 42px;
	max-height: 110px;
	resize: none;
	padding: 10px 11px;
	border: 1px solid #d6d6d6;
	border-radius: 4px;
	background: #fff;
	color: #222;
	line-height: 1.35;
	outline: none;
}

.edai-chat__composer textarea:focus {
	border-color: var(--edai-red);
	box-shadow: 0 0 0 2px rgba(228, 63, 63, .1);
}

.edai-chat__composer button {
	display: grid;
	flex: 0 0 42px;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: var(--edai-red);
	color: #fff;
	cursor: pointer;
}

.edai-chat__composer button:hover {
	background: var(--edai-red-dark);
}

.edai-chat__composer button:disabled,
.edai-chat__handoff:disabled {
	opacity: .55;
	cursor: wait;
}

.edai-chat__composer svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.edai-chat__privacy {
	padding: 0 12px 7px;
	background: #fff;
	color: #9a9a9a;
	font-size: 10px;
	text-align: center;
}

.edai-chat [hidden] {
	display: none !important;
}

@media (max-width: 600px) {
	.edai-chat {
		right: 14px;
		bottom: 14px;
	}

	.edai-chat__panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		max-height: none;
		border: 0;
		border-radius: 0;
		transform: translateY(20px);
	}

	.edai-chat.is-open .edai-chat__panel {
		transform: translateY(0);
	}

	.edai-chat__header {
		padding-top: max(12px, env(safe-area-inset-top));
	}

	.edai-chat__composer {
		padding-bottom: max(10px, env(safe-area-inset-bottom));
	}
}

@media (prefers-reduced-motion: reduce) {
	.edai-chat__launcher,
	.edai-chat__panel,
	.edai-chat__messages {
		transition: none;
		scroll-behavior: auto;
	}
}
