#alcr-chat-root {
	--alcr-primary: #10b0e6;
	--alcr-primary-dark: #0d94c4;
	--alcr-accent: #f27421;
	--alcr-accent-dark: #d9640f;
	--alcr-bg: #ffffff;
	--alcr-bg-soft: #f4f8fb;
	--alcr-text: #1f2937;
	--alcr-text-muted: #64748b;
	--alcr-border: #e5edf2;
	--alcr-radius: 18px;
	--alcr-z: 999999;
	--alcr-glass-blur: 20px;
	--alcr-glass-border: rgba(255, 255, 255, 0.45);
	font-family: 'Kanit', 'Noto Sans Thai', -apple-system, sans-serif;
}

#alcr-chat-root * {
	box-sizing: border-box;
	font-family: inherit;
}

/* Neutralize the host theme's global button/input/link styling (Elementor,
   page builders and many themes apply !important rules to bare <button>,
   <input> and <a> tags) so the widget always renders exactly as designed
   regardless of what site it is embedded in. Every rule below that styles
   a <button>, <input>/<textarea> or <a> therefore also uses !important -
   otherwise this reset would cancel those declarations out too. */
#alcr-chat-root button,
#alcr-chat-root input,
#alcr-chat-root textarea {
	all: unset !important;
	box-sizing: border-box !important;
	font-family: inherit !important;
}

#alcr-chat-root a {
	text-decoration: none !important;
	color: inherit !important;
	box-sizing: border-box !important;
}

#alcr-chat-root button {
	cursor: pointer !important;
}

#alcr-chat-root .alcr-fab {
	position: fixed !important;
	bottom: 24px !important;
	right: 24px !important;
	width: 62px !important;
	height: 62px !important;
	border-radius: 50% !important;
	background: linear-gradient(135deg, var(--alcr-primary), var(--alcr-primary-dark)) !important;
	color: #fff !important;
	border: 2px solid rgba(255, 255, 255, 0.5) !important;
	box-shadow: 0 8px 24px rgba(16, 176, 230, 0.4) !important;
	cursor: pointer !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	overflow: hidden !important;
	padding: 0 !important;
	margin: 0 !important;
	z-index: var(--alcr-z) !important;
	transition: transform 0.15s ease, background 0.15s ease !important;
}

#alcr-chat-root.alcr-pos-left .alcr-fab {
	right: auto !important;
	left: 24px !important;
}

#alcr-chat-root .alcr-fab:hover {
	transform: scale(1.06) !important;
}

#alcr-chat-root .alcr-fab svg {
	width: 28px !important;
	height: 28px !important;
}

#alcr-chat-root .alcr-fab-logo {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	display: block !important;
}

#alcr-chat-root .alcr-fab .alcr-fab-close-icon {
	display: none;
}

#alcr-chat-root.alcr-open .alcr-fab .alcr-fab-chat-icon {
	display: none;
}

#alcr-chat-root.alcr-open .alcr-fab .alcr-fab-close-icon {
	display: block;
}

#alcr-chat-root.alcr-open .alcr-fab {
	background: color-mix(in srgb, var(--alcr-primary) 65%, transparent) !important;
	backdrop-filter: blur(10px) saturate(160%);
	-webkit-backdrop-filter: blur(10px) saturate(160%);
}

/* Plain decorative <div> (not a button), so it is untouched by the
   button/input reset above and can animate freely without !important. */
#alcr-chat-root .alcr-fab-ring {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: var(--alcr-primary);
	pointer-events: none;
	z-index: calc(var(--alcr-z) - 1);
	animation: alcr-fab-ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

#alcr-chat-root.alcr-pos-left .alcr-fab-ring {
	right: auto;
	left: 24px;
}

#alcr-chat-root.alcr-open .alcr-fab-ring {
	display: none;
}

@keyframes alcr-fab-ping {
	0% { transform: scale(1); opacity: 0.55; }
	100% { transform: scale(1.7); opacity: 0; }
}

#alcr-chat-root .alcr-fab-label {
	position: fixed;
	bottom: 38px;
	right: 96px;
	max-width: 200px;
	background: #fff;
	color: var(--alcr-text);
	padding: 10px 26px 10px 14px;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
	cursor: pointer;
	z-index: var(--alcr-z);
	animation: alcr-fab-label-in 0.4s ease 1s both;
}

#alcr-chat-root.alcr-pos-left .alcr-fab-label {
	right: auto;
	left: 96px;
}

#alcr-chat-root.alcr-open .alcr-fab-label {
	display: none;
}

#alcr-chat-root .alcr-fab-label::after {
	content: '';
	position: absolute;
	top: 50%;
	right: -6px;
	width: 12px;
	height: 12px;
	background: #fff;
	transform: translateY(-50%) rotate(45deg);
	box-shadow: 2px -2px 4px rgba(15, 23, 42, 0.04);
}

#alcr-chat-root.alcr-pos-left .alcr-fab-label::after {
	right: auto;
	left: -6px;
}

@keyframes alcr-fab-label-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}

#alcr-chat-root .alcr-fab-label-close {
	position: absolute !important;
	top: 4px !important;
	right: 4px !important;
	width: 16px !important;
	height: 16px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	border-radius: 50% !important;
	color: var(--alcr-text-muted) !important;
	background: transparent !important;
	cursor: pointer !important;
	padding: 0 !important;
	margin: 0 !important;
}

#alcr-chat-root .alcr-fab-label-close svg {
	width: 9px !important;
	height: 9px !important;
}

#alcr-chat-root .alcr-fab-label-close:hover {
	background: #f1f5f9 !important;
}

@media (max-width: 480px) {
	#alcr-chat-root .alcr-fab-label {
		bottom: 92px;
		right: 18px;
		left: auto;
	}

	#alcr-chat-root.alcr-pos-left .alcr-fab-label {
		left: 18px;
		right: auto;
	}

	#alcr-chat-root .alcr-fab-label::after,
	#alcr-chat-root.alcr-pos-left .alcr-fab-label::after {
		top: 100%;
		right: 24px;
		left: auto;
		transform: rotate(45deg);
	}
}

#alcr-chat-root .alcr-panel {
	position: fixed;
	bottom: 100px;
	right: 24px;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 600px;
	max-height: calc(100vh - 140px);
	background: rgba(255, 255, 255, 0.55);
	backdrop-filter: blur(var(--alcr-glass-blur)) saturate(180%);
	-webkit-backdrop-filter: blur(var(--alcr-glass-blur)) saturate(180%);
	border: 1px solid var(--alcr-glass-border);
	border-radius: var(--alcr-radius);
	box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: var(--alcr-z);
	opacity: 0;
	transform: translateY(16px) scale(0.98);
	transition: opacity 0.18s ease, transform 0.18s ease;
}

#alcr-chat-root.alcr-pos-left .alcr-panel {
	right: auto;
	left: 24px;
}

#alcr-chat-root.alcr-open .alcr-panel {
	display: flex;
	opacity: 1;
	transform: translateY(0) scale(1);
}

#alcr-chat-root .alcr-header {
	background: color-mix(in srgb, var(--alcr-primary) 62%, transparent);
	backdrop-filter: blur(16px) saturate(160%);
	-webkit-backdrop-filter: blur(16px) saturate(160%);
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

#alcr-chat-root .alcr-header-logo {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.4);
}

#alcr-chat-root .alcr-header-logo svg {
	width: 20px;
	height: 20px;
	color: #fff;
}

#alcr-chat-root .alcr-header-logo-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

#alcr-chat-root .alcr-header-text {
	flex: 1;
	min-width: 0;
}

#alcr-chat-root .alcr-header-title {
	font-weight: 600;
	font-size: 15px;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #fff;
}

#alcr-chat-root .alcr-header-status {
	font-size: 12px;
	opacity: 0.9;
	display: flex;
	align-items: center;
	gap: 5px;
	color: #fff;
}

#alcr-chat-root .alcr-header-status .alcr-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #34d399;
	display: inline-block;
}

#alcr-chat-root .alcr-header-close {
	background: transparent !important;
	border: none !important;
	color: #fff !important;
	cursor: pointer !important;
	width: 30px !important;
	height: 30px !important;
	border-radius: 50% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex-shrink: 0 !important;
	opacity: 0.9 !important;
	padding: 0 !important;
	margin: 0 !important;
}

#alcr-chat-root .alcr-header-close:hover {
	background: rgba(255, 255, 255, 0.18) !important;
}

#alcr-chat-root .alcr-quick-actions {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	background: rgba(255, 255, 255, 0.3);
	backdrop-filter: blur(14px) saturate(160%);
	-webkit-backdrop-filter: blur(14px) saturate(160%);
	border-bottom: 1px solid rgba(255, 255, 255, 0.35);
	flex-shrink: 0;
}

#alcr-chat-root .alcr-quick-btn {
	flex: 1 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px !important;
	padding: 8px 10px !important;
	margin: 0 !important;
	border-radius: 10px !important;
	font-size: 12.5px !important;
	font-weight: 500 !important;
	line-height: 1.3 !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: background 0.15s ease, border-color 0.15s ease !important;
}

#alcr-chat-root .alcr-quick-call {
	color: var(--alcr-primary-dark) !important;
	border: 1px solid color-mix(in srgb, var(--alcr-primary) 45%, transparent) !important;
	background: color-mix(in srgb, var(--alcr-primary) 14%, transparent) !important;
}

#alcr-chat-root .alcr-quick-call:hover {
	background: color-mix(in srgb, var(--alcr-primary) 24%, transparent) !important;
}

#alcr-chat-root .alcr-quick-line {
	color: #06904a !important;
	border: 1px solid rgba(6, 199, 85, 0.5) !important;
	background: rgba(6, 199, 85, 0.14) !important;
}

#alcr-chat-root .alcr-quick-line:hover {
	background: rgba(6, 199, 85, 0.24) !important;
}

#alcr-chat-root .alcr-quick-line-icon {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #06c755;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

#alcr-chat-root .alcr-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: rgba(244, 248, 251, 0.35);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

#alcr-chat-root .alcr-msg-row {
	display: flex;
	flex-direction: column;
	max-width: 84%;
}

#alcr-chat-root .alcr-msg-row.alcr-user {
	align-self: flex-end;
	align-items: flex-end;
}

#alcr-chat-root .alcr-msg-row.alcr-ai {
	align-self: flex-start;
	align-items: flex-start;
}

#alcr-chat-root .alcr-bubble {
	padding: 10px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
	backdrop-filter: blur(10px) saturate(160%);
	-webkit-backdrop-filter: blur(10px) saturate(160%);
}

#alcr-chat-root .alcr-user .alcr-bubble {
	background: color-mix(in srgb, var(--alcr-primary) 72%, transparent);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-bottom-right-radius: 4px;
}

#alcr-chat-root .alcr-ai .alcr-bubble {
	background: rgba(255, 255, 255, 0.55);
	color: var(--alcr-text);
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-bottom-left-radius: 4px;
}

#alcr-chat-root .alcr-sources {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 84%;
	margin-top: -6px;
}

#alcr-chat-root .alcr-source-link {
	display: flex !important;
	align-items: center !important;
	gap: 6px !important;
	font-size: 12px !important;
	font-weight: 500 !important;
	line-height: 1.3 !important;
	color: var(--alcr-primary-dark) !important;
	background: color-mix(in srgb, var(--alcr-primary) 10%, transparent) !important;
	border: 1px solid color-mix(in srgb, var(--alcr-primary) 30%, transparent) !important;
	border-radius: 8px !important;
	padding: 6px 10px !important;
	margin: 0 !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#alcr-chat-root .alcr-source-link:hover {
	background: color-mix(in srgb, var(--alcr-primary) 18%, transparent) !important;
}

#alcr-chat-root .alcr-source-link svg {
	flex-shrink: 0;
}

#alcr-chat-root .alcr-timestamp {
	font-size: 11px;
	color: var(--alcr-text-muted);
	margin-top: 4px;
	padding: 0 4px;
}

#alcr-chat-root .alcr-typing .alcr-bubble {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 16px;
}

#alcr-chat-root .alcr-typing-text {
	font-size: 13px;
	color: var(--alcr-text-muted);
}

#alcr-chat-root .alcr-typing-dots span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--alcr-primary);
	display: inline-block;
	margin: 0 2px;
	animation: alcr-bounce 1.2s infinite ease-in-out;
}

#alcr-chat-root .alcr-typing-dots span:nth-child(2) {
	animation-delay: 0.15s;
}
#alcr-chat-root .alcr-typing-dots span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes alcr-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

#alcr-chat-root .alcr-line-card {
	background: rgba(255, 255, 255, 0.55);
	backdrop-filter: blur(14px) saturate(160%);
	-webkit-backdrop-filter: blur(14px) saturate(160%);
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 14px;
	padding: 14px;
	width: 100%;
	max-width: 260px;
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

#alcr-chat-root .alcr-line-card-head {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--alcr-text);
	margin-bottom: 10px;
}

#alcr-chat-root .alcr-line-card-head .alcr-line-icon {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #06c755;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	flex-shrink: 0;
}

#alcr-chat-root .alcr-line-btn {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	width: 100% !important;
	background: var(--alcr-accent) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 10px !important;
	padding: 10px 14px !important;
	margin: 0 !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	cursor: pointer !important;
	transition: background 0.15s ease !important;
}

#alcr-chat-root .alcr-line-btn:hover {
	background: var(--alcr-accent-dark) !important;
	color: #fff !important;
}

#alcr-chat-root .alcr-status-error .alcr-bubble {
	border-color: rgba(254, 202, 202, 0.7);
	background: rgba(255, 245, 245, 0.6);
}

#alcr-chat-root .alcr-input-area {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	background: rgba(255, 255, 255, 0.4);
	backdrop-filter: blur(16px) saturate(160%);
	-webkit-backdrop-filter: blur(16px) saturate(160%);
	border-top: 1px solid rgba(255, 255, 255, 0.4);
	flex-shrink: 0;
}

#alcr-chat-root .alcr-input {
	flex: 1 !important;
	display: block !important;
	width: 100% !important;
	border: 1px solid rgba(255, 255, 255, 0.5) !important;
	background: rgba(255, 255, 255, 0.45) !important;
	border-radius: 20px !important;
	padding: 10px 16px !important;
	margin: 0 !important;
	font-size: 14px !important;
	resize: none !important;
	max-height: 90px !important;
	line-height: 1.4 !important;
	color: var(--alcr-text) !important;
	outline: none !important;
}

#alcr-chat-root .alcr-input::placeholder {
	color: var(--alcr-text-muted) !important;
	opacity: 1 !important;
}

#alcr-chat-root .alcr-input:focus {
	border-color: var(--alcr-primary) !important;
	background: rgba(255, 255, 255, 0.65) !important;
}

#alcr-chat-root .alcr-send {
	width: 40px !important;
	height: 40px !important;
	border-radius: 50% !important;
	border: none !important;
	background: var(--alcr-accent) !important;
	color: #fff !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	flex-shrink: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	transition: background 0.15s ease, opacity 0.15s ease !important;
}

#alcr-chat-root .alcr-send:hover {
	background: var(--alcr-accent-dark) !important;
}

#alcr-chat-root .alcr-send:disabled {
	opacity: 0.5 !important;
	cursor: not-allowed !important;
}

#alcr-chat-root .alcr-send svg {
	width: 18px !important;
	height: 18px !important;
}

#alcr-chat-root .alcr-footer {
	padding: 6px 14px 10px;
	text-align: center;
	font-size: 11px;
	color: var(--alcr-text-muted);
	background: rgba(255, 255, 255, 0.3);
	backdrop-filter: blur(12px) saturate(160%);
	-webkit-backdrop-filter: blur(12px) saturate(160%);
	flex-shrink: 0;
}

#alcr-chat-root .alcr-footer a {
	color: var(--alcr-text-muted) !important;
	text-decoration: underline !important;
	margin-left: 6px !important;
}

@media (max-width: 480px) {
	#alcr-chat-root .alcr-panel {
		right: 0;
		left: 0;
		bottom: 0;
		top: 0;
		width: 100%;
		max-width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}

	#alcr-chat-root .alcr-fab {
		bottom: 18px !important;
		right: 18px !important;
	}
}

/* Browsers without backdrop-filter support (e.g. older Firefox) fall back
   to a solid-enough background so text stays readable without the blur. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	#alcr-chat-root .alcr-panel { background: #fdfefe; }
	#alcr-chat-root .alcr-header { background: linear-gradient(135deg, var(--alcr-primary), var(--alcr-primary-dark)); }
	#alcr-chat-root .alcr-messages { background: var(--alcr-bg-soft); }
	#alcr-chat-root .alcr-ai .alcr-bubble { background: #fff; }
	#alcr-chat-root .alcr-user .alcr-bubble { background: var(--alcr-primary); }
	#alcr-chat-root .alcr-line-card,
	#alcr-chat-root .alcr-input-area,
	#alcr-chat-root .alcr-footer,
	#alcr-chat-root .alcr-quick-actions { background: #fff; }
}
