.gdv-chat-root {
	font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.gdv-chat-root:not(.is-ready) .gdv-chat-form,
.gdv-chat-root:not(.is-ready) .gdv-chat-thread {
	display: none !important;
}

.gdv-chat-fab {
	position: fixed;
	left: 20px;
	right: auto;
	bottom: 20px;
	z-index: 99990;
	display: flex;
	align-items: center;
	gap: 8px;
	border: 0;
	border-radius: 999px;
	background: #0f7b4a;
	color: #fff;
	padding: 12px 18px 12px 14px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(15, 123, 74, 0.35);
}

.gdv-chat-fab:hover {
	background: #0c6a3f;
}

.gdv-chat-fab-icon {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.gdv-chat-panel {
	position: fixed;
	left: 20px;
	right: auto;
	bottom: 20px;
	z-index: 99991;
	width: 320px;
	max-width: calc(100vw - 24px);
	height: auto;
	max-height: calc(100vh - 40px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.gdv-chat-panel.is-live {
	height: 520px;
	max-height: calc(100vh - 40px);
}

.gdv-chat-head {
	background: #0f7b4a;
	color: #fff;
	padding: 12px 14px;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
}

.gdv-chat-head strong {
	display: block;
	font-size: 15px;
}

.gdv-chat-sub {
	display: block;
	font-size: 12px;
	opacity: 0.9;
	margin-top: 2px;
}

.gdv-chat-close {
	border: 0;
	background: transparent;
	color: #fff;
	width: 32px;
	height: 32px;
	padding: 0;
	margin: -4px -4px 0 0;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 8px;
	flex: 0 0 auto;
}

.gdv-chat-close:hover {
	background: rgba(255, 255, 255, 0.16);
}

.gdv-chat-close svg {
	display: block;
}

.gdv-chat-form {
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.gdv-chat-form input,
.gdv-chat-send input,
.gdv-chat-pane-send input {
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	width: 100%;
	box-sizing: border-box;
}

.gdv-chat-compose {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.gdv-chat-compose input {
	flex: 1;
	width: auto;
	min-width: 0;
}

.gdv-chat-submit,
.gdv-chat-send button {
	border: 0;
	border-radius: 50%;
	background: #0f7b4a;
	color: #fff;
	padding: 0;
	width: 44px;
	min-width: 44px;
	height: 44px;
	font-weight: 600;
	cursor: pointer;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 44px;
}

.gdv-chat-submit svg,
.gdv-chat-send button svg {
	display: block;
	width: 22px;
	height: 22px;
}

.gdv-chat-submit:hover,
.gdv-chat-send button:hover {
	background: #0c6a3f;
}

.gdv-chat-submit:disabled,
.gdv-chat-send button:disabled {
	cursor: wait;
}

.gdv-chat-submit:disabled:not(.is-loading) {
	background: #9bb8a8;
	cursor: not-allowed;
	box-shadow: none;
}

.gdv-chat-topics {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.gdv-chat-topics-label {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: #3c434a;
}

.gdv-chat-topic-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.gdv-chat-topic {
	border: 1px solid #c3c4c7;
	background: #fff;
	color: #1d2327;
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 13px;
	line-height: 1.3;
	cursor: pointer;
}

.gdv-chat-topic:hover {
	border-color: #0f7b4a;
	color: #0f7b4a;
}

.gdv-chat-topic.is-on {
	background: #0f7b4a;
	border-color: #0f7b4a;
	color: #fff;
}

.gdv-chat-submit.is-loading,
.gdv-chat-send button.is-loading {
	color: transparent;
}

.gdv-chat-submit.is-loading svg,
.gdv-chat-send button.is-loading svg {
	opacity: 0;
}

.gdv-chat-submit.is-loading::after,
.gdv-chat-send button.is-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: gdv-chat-spin 0.6s linear infinite;
}

@keyframes gdv-chat-spin {
	to {
		transform: rotate(360deg);
	}
}

.gdv-chat-error {
	color: #b32d2e;
	font-size: 13px;
	margin: 0;
}

.gdv-chat-thread {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.gdv-chat-msgs,
.gdv-chat-pane-msgs {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	background: #f6f7f7;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.gdv-chat-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	max-width: 92%;
}

.gdv-chat-row.is-staff {
	align-self: flex-start;
}

.gdv-chat-row.is-guest {
	align-self: flex-end;
}

.gdv-chat-row-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
	max-width: 100%;
}

.gdv-chat-row.is-guest .gdv-chat-row-body {
	align-items: flex-end;
}

.gdv-chat-row.is-staff .gdv-chat-row-body {
	align-items: flex-start;
}

.gdv-chat-msg {
	max-width: 100%;
	padding: 8px 10px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.4;
	word-wrap: break-word;
	white-space: pre-wrap;
}

.gdv-chat-msg.is-guest {
	background: #0f7b4a;
	color: #fff;
}

.gdv-chat-msg.is-staff {
	background: #fff;
	border: 1px solid #dcdcde;
}

.gdv-chat-msg.is-system {
	align-self: center;
	background: transparent;
	color: #646970;
	font-size: 12px;
	text-align: center;
	max-width: 95%;
	padding: 0;
}

.gdv-chat-avatar {
	flex: 0 0 auto;
	border-radius: 50%;
	overflow: hidden;
	display: block;
	line-height: 0;
}

.gdv-chat-avatar.is-sm {
	width: 28px;
	height: 28px;
	margin-top: 2px;
}

.gdv-chat-avatar.is-lg {
	width: 56px;
	height: 56px;
}

.gdv-chat-avatar svg {
	width: 100%;
	height: 100%;
	display: block;
}

.gdv-chat-event {
	align-self: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 6px;
	padding: 10px 8px 4px;
	max-width: 95%;
}

.gdv-chat-event-text {
	margin: 0;
	font-size: 13px;
	color: #787c82;
}

.gdv-chat-event-text strong {
	color: #3c434a;
	font-weight: 700;
}

.gdv-chat-meta {
	display: flex;
	align-items: center;
	gap: 5px;
}

.gdv-chat-row.is-guest .gdv-chat-meta {
	justify-content: flex-end;
}

.gdv-chat-receipt {
	font-size: 11px;
	line-height: 1;
	letter-spacing: -1px;
	color: #b4b7bb;
	user-select: none;
}

.gdv-chat-receipt.is-delivered {
	color: #8c8f94;
}

.gdv-chat-receipt.is-seen {
	color: #1a73e8;
}

.gdv-chat-time {
	display: block;
	font-size: 11px;
	line-height: 1.3;
	color: #8c8f94;
	font-style: normal;
}

.gdv-chat-waiting {
	align-self: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 10px;
	max-width: 95%;
	padding: 4px 8px 8px;
}

.gdv-chat-waiting-text {
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: #646970;
}

.gdv-chat-waiting-anim {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 28px;
}

.gdv-chat-waiting-gif {
	max-height: 48px;
	width: auto;
}

.gdv-chat-waiting.has-gif .gdv-chat-dots {
	display: none;
}

.gdv-chat-dots {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.gdv-chat-dots i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #8c8f94;
	display: block;
	animation: gdv-chat-wait-dot 1.1s infinite ease-in-out;
}

.gdv-chat-dots i:nth-child(2) {
	animation-delay: 0.15s;
}

.gdv-chat-dots i:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes gdv-chat-wait-dot {
	0%,
	80%,
	100% {
		opacity: 0.3;
		transform: translateY(0);
	}
	40% {
		opacity: 1;
		transform: translateY(-4px);
	}
}

.gdv-chat-row.is-typing .gdv-chat-msg {
	min-width: 52px;
	padding: 10px 14px;
}

.gdv-chat-typing-label {
	font-size: 11px;
	line-height: 1.3;
	color: #8c8f94;
}

.gdv-chat-send {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #dcdcde;
	background: #fff;
}

.gdv-chat-send input {
	flex: 1;
	width: auto;
}

.gdv-chat-panel[hidden],
.gdv-chat-fab[hidden],
.gdv-chat-form[hidden],
.gdv-chat-thread[hidden],
.gdv-chat-error[hidden] {
	display: none !important;
}

@media (max-width: 480px) {
	.gdv-chat-fab {
		left: 12px;
		right: auto;
	}

	.gdv-chat-panel {
		left: 8px;
		right: 8px;
		width: auto;
		bottom: 12px;
	}
}
