.chbhgs-root {
	--chbhgs-accent: #1e6fd9;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.4;
	color: #1d2327;
}

.chbhgs-root *,
.chbhgs-root *::before,
.chbhgs-root *::after {
	box-sizing: border-box;
}

.chbhgs-root [hidden] {
	display: none !important;
}

.chbhgs-launcher {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	margin-left: auto;
	border: 0;
	border-radius: 50%;
	background: var(--chbhgs-accent);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.chbhgs-panel {
	display: flex;
	flex-direction: column;
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 520px;
	max-height: calc(100vh - 110px);
	margin-bottom: 12px;
	overflow: hidden;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.chbhgs-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: var(--chbhgs-accent);
	color: #fff;
}

.chbhgs-title {
	font-weight: 600;
}

.chbhgs-close {
	border: 0;
	background: none;
	color: inherit;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.chbhgs-log {
	position: relative;
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f6f7f9;
}

.chbhgs-msg {
	max-width: 85%;
	margin-bottom: 10px;
	padding: 9px 12px;
	border-radius: 12px;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.chbhgs-bot {
	background: #fff;
	border: 1px solid #e2e4e7;
	border-bottom-left-radius: 4px;
}

.chbhgs-user {
	margin-left: auto;
	background: var(--chbhgs-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.chbhgs-typing {
	color: #888;
}

.chbhgs-offer {
	margin-bottom: 10px;
}

.chbhgs-compose {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e2e4e7;
}

.chbhgs-input,
.chbhgs-field input,
.chbhgs-field textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	font: inherit;
	color: inherit;
	background: #fff;
}

.chbhgs-btn {
	padding: 8px 14px;
	border: 0;
	border-radius: 6px;
	background: var(--chbhgs-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.chbhgs-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.chbhgs-link {
	border: 0;
	background: none;
	padding: 0;
	color: var(--chbhgs-accent);
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

.chbhgs-footer {
	padding: 6px 10px 10px;
	text-align: center;
	font-size: 13px;
}

.chbhgs-ticket {
	margin: 4px 0 10px;
	padding: 14px;
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 12px;
}

.chbhgs-ticket-intro {
	margin: 0 0 10px;
}

.chbhgs-field {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
}

.chbhgs-field span {
	display: block;
	margin-bottom: 3px;
}

.chbhgs-field textarea {
	min-height: 70px;
	resize: vertical;
}

.chbhgs-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.chbhgs-error {
	margin: 4px 0 8px;
	color: #b32d2e;
	font-size: 13px;
}

.chbhgs-error:empty {
	display: none;
}

.chbhgs-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.chbhgs-bot a {
	color: var(--chbhgs-accent);
	text-decoration: underline;
	overflow-wrap: anywhere;
}

.chbhgs-typing {
	display: inline-flex;
	gap: 4px;
	padding: 12px 14px;
}

.chbhgs-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9aa0a6;
	animation: chbhgs-blink 1.2s infinite ease-in-out both;
}

.chbhgs-typing span:nth-child(2) {
	animation-delay: 0.2s;
}

.chbhgs-typing span:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes chbhgs-blink {
	0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
	40% { opacity: 1; transform: scale(1); }
}

/*
 * Theme-proofing. Themes often style p, label, input, and button globally (pale text, dark fields).
 * The #id prefix plus !important outranks those rules so the widget looks the same on every site.
 */
#chbhgs-root .chbhgs-panel,
#chbhgs-root .chbhgs-msg,
#chbhgs-root .chbhgs-panel p,
#chbhgs-root .chbhgs-panel label,
#chbhgs-root .chbhgs-field span {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
	font-size: 15px !important;
	line-height: 1.45 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	opacity: 1 !important;
}

#chbhgs-root .chbhgs-panel p,
#chbhgs-root .chbhgs-panel label,
#chbhgs-root .chbhgs-field span,
#chbhgs-root .chbhgs-bot {
	color: #1d2327 !important;
}

#chbhgs-root .chbhgs-user,
#chbhgs-root .chbhgs-header,
#chbhgs-root .chbhgs-title {
	color: #fff !important;
}

#chbhgs-root .chbhgs-ticket-intro {
	margin: 0 0 12px !important;
	font-weight: 600 !important;
}

#chbhgs-root .chbhgs-field {
	display: block !important;
	margin: 0 0 10px !important;
}

#chbhgs-root .chbhgs-field span {
	display: block !important;
	margin: 0 0 4px !important;
	font-size: 13px !important;
	font-weight: 600 !important;
}

#chbhgs-root .chbhgs-error {
	color: #b32d2e !important;
	font-size: 13px !important;
}

#chbhgs-root .chbhgs-panel input:not(.chbhgs-hp),
#chbhgs-root .chbhgs-panel textarea {
	display: block !important;
	width: 100% !important;
	max-width: none !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 9px 11px !important;
	background: #fff !important;
	color: #1d2327 !important;
	border: 1px solid #8c8f94 !important;
	border-radius: 8px !important;
	box-shadow: none !important;
	font-family: inherit !important;
	font-size: 15px !important;
	line-height: 1.4 !important;
}

#chbhgs-root .chbhgs-panel textarea {
	min-height: 80px !important;
	resize: vertical !important;
}

#chbhgs-root .chbhgs-compose .chbhgs-input {
	flex: 1 !important;
	width: auto !important;
}

#chbhgs-root .chbhgs-panel input::placeholder,
#chbhgs-root .chbhgs-panel textarea::placeholder {
	color: #646970 !important;
	opacity: 1 !important;
}

#chbhgs-root .chbhgs-panel input:focus,
#chbhgs-root .chbhgs-panel textarea:focus {
	border-color: var(--chbhgs-accent) !important;
	outline: 2px solid var(--chbhgs-accent) !important;
	outline-offset: -1px !important;
}

#chbhgs-root .chbhgs-btn {
	font-family: inherit !important;
	letter-spacing: normal !important;
	width: auto !important;
	margin: 0 !important;
	padding: 9px 16px !important;
	background: var(--chbhgs-accent) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 8px !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-transform: none !important;
	box-shadow: none !important;
}

#chbhgs-root .chbhgs-link {
	text-transform: none !important;
	letter-spacing: normal !important;
	font-family: inherit !important;
	font-weight: 400 !important;
	padding: 0 !important;
	background: none !important;
	border: 0 !important;
	color: var(--chbhgs-accent) !important;
	font-size: 14px !important;
	text-decoration: underline !important;
	box-shadow: none !important;
}

#chbhgs-root .chbhgs-contact-summary {
	margin: 0 0 10px !important;
	font-size: 14px !important;
	color: #50575e !important;
}

/* Compact contact card */
#chbhgs-root .chbhgs-ticket {
	padding: 12px !important;
}

#chbhgs-root .chbhgs-ticket-intro {
	margin: 0 0 8px !important;
	font-size: 14px !important;
}

#chbhgs-root .chbhgs-row {
	display: flex !important;
	gap: 8px !important;
}

#chbhgs-root .chbhgs-row > .chbhgs-field {
	flex: 1 1 0 !important;
	min-width: 0 !important;
}

#chbhgs-root .chbhgs-field {
	margin: 0 0 8px !important;
}

#chbhgs-root .chbhgs-field span {
	font-size: 12px !important;
	margin: 0 0 3px !important;
}

#chbhgs-root .chbhgs-panel input:not(.chbhgs-hp),
#chbhgs-root .chbhgs-panel textarea {
	padding: 7px 9px !important;
	font-size: 14px !important;
}

#chbhgs-root .chbhgs-compose .chbhgs-input {
	padding: 9px 11px !important;
	font-size: 15px !important;
}

#chbhgs-root .chbhgs-panel textarea {
	min-height: 56px !important;
}

#chbhgs-root .chbhgs-btn {
	padding: 7px 14px !important;
	font-size: 14px !important;
}

#chbhgs-root .chbhgs-compose .chbhgs-btn {
	padding: 9px 16px !important;
	font-size: 15px !important;
}

/* "Click here to ask a question" bubble next to the chat button */
#chbhgs-root .chbhgs-teaser {
	position: absolute !important;
	right: 0 !important;
	bottom: 74px !important;
	display: flex !important;
	align-items: flex-start !important;
	gap: 6px !important;
	width: max-content !important;
	max-width: min(280px, calc(100vw - 40px)) !important;
	padding: 10px 10px 10px 14px !important;
	background: #fff !important;
	border-radius: 12px !important;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18) !important;
	animation: chbhgs-pop 0.25s ease-out;
}

#chbhgs-root .chbhgs-teaser[hidden] {
	display: none !important;
}

#chbhgs-root .chbhgs-teaser::after {
	content: "";
	position: absolute;
	right: 22px;
	bottom: -7px;
	width: 14px;
	height: 14px;
	background: #fff;
	transform: rotate(45deg);
}

#chbhgs-root .chbhgs-teaser-text {
	padding: 0 !important;
	margin: 0 !important;
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	color: #1d2327 !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	text-align: left !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	cursor: pointer !important;
}

#chbhgs-root .chbhgs-teaser-close {
	flex: none !important;
	width: 22px !important;
	height: 22px !important;
	padding: 0 !important;
	margin: -2px 0 0 !important;
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	color: #646970 !important;
	font-size: 18px !important;
	line-height: 1 !important;
	cursor: pointer !important;
}

@keyframes chbhgs-pop {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

#chbhgs-root .chbhgs-cf:empty {
	display: none;
}

#chbhgs-root .chbhgs-cf {
	display: flex;
	justify-content: center;
	padding: 8px 0 0;
}

/* Chat button and header close button: keep theme button styles from reshaping them or hiding the icon. */
#chbhgs-root .chbhgs-launcher {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-sizing: border-box !important;
	width: 60px !important;
	min-width: 60px !important;
	max-width: 60px !important;
	height: 60px !important;
	min-height: 60px !important;
	margin: 0 0 0 auto !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--chbhgs-accent) !important;
	color: #fff !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
	line-height: 1 !important;
	text-indent: 0 !important;
	cursor: pointer !important;
}

#chbhgs-root .chbhgs-launcher svg {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	width: 28px !important;
	height: 28px !important;
	max-width: none !important;
	margin: 0 !important;
	fill: #fff !important;
	color: #fff !important;
}

#chbhgs-root .chbhgs-launcher svg path {
	fill: #fff !important;
}

#chbhgs-root .chbhgs-close {
	width: auto !important;
	min-width: 0 !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 4px !important;
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	color: #fff !important;
	font-family: Arial, sans-serif !important;
	font-size: 26px !important;
	line-height: 1 !important;
	cursor: pointer !important;
}

/* Themes that give every button a minimum width would otherwise squeeze the question box. */
#chbhgs-root .chbhgs-btn,
#chbhgs-root .chbhgs-link,
#chbhgs-root .chbhgs-teaser-text,
#chbhgs-root .chbhgs-teaser-close {
	min-width: 0 !important;
	min-height: 0 !important;
}

#chbhgs-root .chbhgs-compose .chbhgs-btn {
	flex: none !important;
}
