.pcmat-chat {
	--pcmat-chat-primary: #1e73be;
	--pcmat-chat-accent: #1cc9d8;
	--pcmat-chat-bottom: 90px;
	--pcmat-chat-right: 24px;
	--pcmat-chat-text: #1f2937;
	--pcmat-chat-muted: #6b7280;
	--pcmat-chat-bg: #f4f7fb;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
}

/* ---------- Launcher ---------- */
.pcmat-chat__launcher {
	position: fixed;
	right: var(--pcmat-chat-right);
	bottom: var(--pcmat-chat-bottom);
	z-index: 9990; /* abaixo dos popups do Elementor (ex.: aviso de cookies) */
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.pcmat-chat__bubble {
	position: relative;
	display: grid;
	place-items: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	color: #fff;
	background: linear-gradient(135deg, var(--pcmat-chat-primary), var(--pcmat-chat-accent));
	box-shadow: 0 10px 25px rgba(15, 40, 80, .28);
	transition: transform .2s ease, box-shadow .2s ease;
}
.pcmat-chat__bubble::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 0 var(--pcmat-chat-accent);
	animation: pcmat-chat-pulse 2.4s infinite;
}
.pcmat-chat__launcher:hover .pcmat-chat__bubble,
.pcmat-chat__launcher:focus-visible .pcmat-chat__bubble { transform: scale(1.07); }
.pcmat-chat__launcher:focus-visible { outline: none; }
.pcmat-chat__launcher:focus-visible .pcmat-chat__bubble { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--pcmat-chat-primary); }
.pcmat-chat__icon-close { display: none; }
.pcmat-chat.is-open .pcmat-chat__icon-open { display: none; }
.pcmat-chat.is-open .pcmat-chat__icon-close { display: block; }
.pcmat-chat.is-open .pcmat-chat__bubble::after { animation: none; }

.pcmat-chat__label {
	padding: 9px 14px;
	border-radius: 20px;
	background: #fff;
	color: var(--pcmat-chat-text);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	box-shadow: 0 6px 20px rgba(15, 40, 80, .16);
	transition: opacity .2s ease, transform .2s ease;
}
.pcmat-chat.is-open .pcmat-chat__label,
.pcmat-chat.is-seen .pcmat-chat__label { opacity: 0; transform: translateX(8px); pointer-events: none; }

@keyframes pcmat-chat-pulse {
	0% { box-shadow: 0 0 0 0 rgba(28, 201, 216, .55); }
	70% { box-shadow: 0 0 0 16px rgba(28, 201, 216, 0); }
	100% { box-shadow: 0 0 0 0 rgba(28, 201, 216, 0); }
}

/* ---------- Window ---------- */
.pcmat-chat__window {
	position: fixed;
	right: var(--pcmat-chat-right);
	bottom: calc(var(--pcmat-chat-bottom) + 76px);
	z-index: 9991;
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - var(--pcmat-chat-bottom) - 110px);
	overflow: hidden;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 20px 60px rgba(15, 40, 80, .28);
	transform-origin: bottom right;
	animation: pcmat-chat-in .22s ease-out;
}
.pcmat-chat__window[hidden] { display: none; }
@keyframes pcmat-chat-in {
	from { opacity: 0; transform: translateY(12px) scale(.96); }
	to { opacity: 1; transform: none; }
}

.pcmat-chat__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	color: #fff;
	background: linear-gradient(135deg, var(--pcmat-chat-primary), var(--pcmat-chat-accent));
}
.pcmat-chat__avatar {
	display: grid;
	flex: 0 0 42px;
	place-items: center;
	width: 42px;
	height: 42px;
	overflow: hidden;
	border-radius: 50%;
	background: rgba(255, 255, 255, .22);
}
.pcmat-chat__avatar img { width: 100%; height: 100%; object-fit: cover; }
.pcmat-chat__heading { flex: 1; min-width: 0; }
.pcmat-chat__title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.pcmat-chat__subtitle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .92; }
.pcmat-chat__dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.pcmat-chat__close {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	color: #fff;
	background: rgba(255, 255, 255, .15);
	cursor: pointer;
}
.pcmat-chat__close:hover, .pcmat-chat__close:focus-visible { background: rgba(255, 255, 255, .3); }

.pcmat-chat__messages {
	flex: 1;
	padding: 18px 16px 8px;
	overflow-y: auto;
	background: var(--pcmat-chat-bg);
	scroll-behavior: smooth;
}

.pcmat-chat__msg {
	max-width: 88%;
	margin: 0 0 10px;
	padding: 10px 14px;
	border-radius: 16px;
	color: var(--pcmat-chat-text);
	word-wrap: break-word;
	animation: pcmat-chat-msg .25s ease-out;
}
@keyframes pcmat-chat-msg {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}
.pcmat-chat__msg--bot { border-bottom-left-radius: 4px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.pcmat-chat__msg--user { margin-left: auto; border-bottom-right-radius: 4px; color: #fff; background: var(--pcmat-chat-primary); }
.pcmat-chat__msg p { margin: 0 0 .5em; }
.pcmat-chat__msg p:last-child, .pcmat-chat__msg ul:last-child { margin-bottom: 0; }
.pcmat-chat__msg ul { margin: .25em 0 .5em; padding-left: 1.1em; }
.pcmat-chat__msg li { margin: 0 0 .25em; }
.pcmat-chat__msg a { color: var(--pcmat-chat-primary); text-decoration: underline; }
.pcmat-chat__msg small { color: var(--pcmat-chat-muted); }

.pcmat-chat__cta {
	display: inline-block;
	margin-top: 8px;
	padding: 7px 14px;
	border-radius: 20px;
	color: #fff !important;
	background: var(--pcmat-chat-primary);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none !important;
}
.pcmat-chat__cta:hover, .pcmat-chat__cta:focus-visible { filter: brightness(1.1); }

.pcmat-chat__options { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.pcmat-chat__option {
	padding: 7px 13px;
	border: 1.5px solid var(--pcmat-chat-primary);
	border-radius: 18px;
	color: var(--pcmat-chat-primary);
	background: #fff;
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.pcmat-chat__option:hover, .pcmat-chat__option:focus-visible { color: #fff; background: var(--pcmat-chat-primary); outline: none; }
.pcmat-chat__options--muted .pcmat-chat__option { border-color: #cbd5e1; color: var(--pcmat-chat-muted); }

.pcmat-chat__typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.pcmat-chat__typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9ca3af;
	animation: pcmat-chat-typing 1s infinite ease-in-out;
}
.pcmat-chat__typing span:nth-child(2) { animation-delay: .15s; }
.pcmat-chat__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes pcmat-chat-typing {
	0%, 60%, 100% { transform: translateY(0); opacity: .5; }
	30% { transform: translateY(-5px); opacity: 1; }
}

.pcmat-chat__form {
	display: flex;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
}
.pcmat-chat__input {
	flex: 1;
	min-width: 0;
	height: 42px !important;
	margin: 0 !important;
	padding: 0 14px !important;
	border: 1px solid #d1d5db !important;
	border-radius: 21px !important;
	color: var(--pcmat-chat-text) !important;
	background: #fff !important;
	font: inherit;
	font-size: 14px !important;
}
.pcmat-chat__input::placeholder { color: #9ca3af !important; opacity: 1 !important; }
.pcmat-chat__input:focus { border-color: var(--pcmat-chat-primary) !important; outline: none; box-shadow: 0 0 0 3px rgba(30, 115, 190, .15); }
.pcmat-chat__send {
	display: grid;
	flex: 0 0 42px;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0 !important;
	border: 0;
	border-radius: 50%;
	color: #fff;
	background: var(--pcmat-chat-primary);
	cursor: pointer;
}
.pcmat-chat__send:hover, .pcmat-chat__send:focus-visible { filter: brightness(1.1); }

/* ---------- Editor preview ---------- */
.pcmat-chat--editor { position: relative; padding: 12px; }
.pcmat-chat--editor .pcmat-chat__editor-note {
	margin-bottom: 12px;
	padding: 10px 14px;
	border: 1px dashed #93c5fd;
	border-radius: 8px;
	color: #1e3a8a;
	background: #eff6ff;
	font-size: 13px;
}
.pcmat-chat--editor .pcmat-chat__window { position: relative; right: auto; bottom: auto; height: 460px; max-height: none; margin-left: auto; animation: none; }
.pcmat-chat--editor .pcmat-chat__launcher { position: relative; right: auto; bottom: auto; margin: 12px 0 0 auto; }

@media (max-width: 480px) {
	.pcmat-chat__label { display: none; }
	.pcmat-chat__window {
		right: 8px;
		bottom: calc(var(--pcmat-chat-bottom) + 70px);
		width: calc(100vw - 16px);
		max-width: none;
		height: calc(100vh - var(--pcmat-chat-bottom) - 90px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.pcmat-chat *, .pcmat-chat *::after { animation: none !important; transition: none !important; }
}
