.pemm-chat {
	--pc-primary: #ec313b;
	--pc-dark: #1b2a6b;
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	color: #222;
}
/* While the chat is open it sits above the cookie-consent banner (z-index 9999999); when closed it stays beneath it so consent is never hidden. */
.pemm-chat.is-open { z-index: 10000000; }
.pemm-chat--right { right: 20px; }
.pemm-chat--left { left: 20px; }
.pemm-chat *,
.pemm-chat *::before,
.pemm-chat *::after { box-sizing: border-box; }
.pemm-chat button { font-family: inherit; }

.pc-launcher {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 56px;
	height: 56px;
	padding: 0 16px;
	border: 0;
	border-radius: 28px;
	background: var(--pc-primary);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pc-launcher:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
.pc-launcher:focus-visible,
.pc-close:focus-visible,
.pc-chip:focus-visible,
.pc-send:focus-visible,
.pc-submit:focus-visible { outline: 3px solid #fff; outline-offset: -4px; box-shadow: 0 0 0 3px var(--pc-dark); }
.pc-launcher svg { flex: none; }
.pemm-chat.is-open .pc-launcher { display: none; }

.pc-panel {
	position: absolute;
	bottom: 0;
	width: 360px;
	max-width: calc(100vw - 24px);
	height: 540px;
	max-height: calc(100vh - 40px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 12px 40px rgba(10, 20, 60, 0.3);
}
.pc-panel[hidden] { display: none; }
.pemm-chat--right .pc-panel { right: 0; }
.pemm-chat--left .pc-panel { left: 0; }

.pc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--pc-dark);
	color: #fff;
}
.pc-head__title { display: flex; flex-direction: column; }
.pc-head__title strong { font-size: 16px; }
.pc-head__sub { font-size: 12px; opacity: 0.8; }
.pc-close {
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.pc-log {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f4f6fb;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.pc-msg { display: flex; flex-direction: column; max-width: 88%; }
.pc-msg--bot { align-self: flex-start; align-items: flex-start; }
.pc-msg--user { align-self: flex-end; align-items: flex-end; }
.pc-msg--form { align-self: stretch; max-width: 100%; }
.pc-bubble {
	padding: 9px 13px;
	border-radius: 14px;
	white-space: pre-line;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.pc-msg--bot .pc-bubble { background: #fff; color: #222; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.pc-msg--user .pc-bubble { background: var(--pc-primary); color: #fff; border-bottom-right-radius: 4px; }
.pc-bubble--contact { font-size: 14px; }

.pc-link {
	display: inline-block;
	margin: 6px 6px 0 0;
	padding: 5px 12px;
	border: 1px solid var(--pc-dark);
	border-radius: 16px;
	color: var(--pc-dark);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}
.pc-link:hover { background: var(--pc-dark); color: #fff; }
.pc-actions { display: flex; flex-wrap: wrap; }

.pc-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.pc-chip {
	padding: 7px 12px;
	border: 1px solid var(--pc-dark);
	border-radius: 18px;
	background: #fff;
	color: var(--pc-dark);
	font-size: 13.5px;
	text-align: left;
	cursor: pointer;
}
.pc-chip:hover { background: var(--pc-dark); color: #fff; }
.pc-chip--primary { background: var(--pc-primary); border-color: var(--pc-primary); color: #fff; }
.pc-chip--primary:hover { background: var(--pc-dark); border-color: var(--pc-dark); }

.pc-typing { display: flex; gap: 4px; padding: 12px 14px; }
.pc-typing i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9aa3bd;
	animation: pc-bounce 1s infinite ease-in-out;
}
.pc-typing i:nth-child(2) { animation-delay: 0.15s; }
.pc-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-5px); opacity: 1; } }

.pc-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e3e7f1; background: #fff; }
.pc-input input {
	flex: 1;
	min-width: 0;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #ccd3e3;
	border-radius: 20px;
	font-size: 16px;
	background: #fff;
	color: #222;
}
.pc-input input:focus { outline: 2px solid var(--pc-dark); outline-offset: 0; }
.pc-send {
	height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: 20px;
	background: var(--pc-dark);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

.pc-form { padding: 12px; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.pc-field { margin-bottom: 9px; }
.pc-field label { display: block; margin-bottom: 3px; font-size: 13px; font-weight: 600; color: var(--pc-dark); }
.pc-field input,
.pc-field textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid #ccd3e3;
	border-radius: 6px;
	font-size: 16px;
	background: #fff;
	color: #222;
	font-family: inherit;
}
.pc-field input:focus,
.pc-field textarea:focus { outline: 2px solid var(--pc-dark); outline-offset: 0; }
.pc-field [aria-invalid="true"] { border-color: #c62828; }
.pc-field__err { min-height: 0; color: #c62828; font-size: 12.5px; }
.pc-form__status { min-height: 18px; margin-bottom: 6px; font-size: 13px; color: #c62828; }
.pc-submit {
	width: 100%;
	height: 40px;
	border: 0;
	border-radius: 20px;
	background: var(--pc-primary);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}
.pc-submit:disabled { opacity: 0.6; cursor: default; }
.pc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 599px) {
	.pemm-chat { bottom: 14px; }
	.pemm-chat--right { right: 14px; }
	.pemm-chat--left { left: 14px; }
	.pc-launcher__label { display: none; }
	.pc-launcher { width: 56px; padding: 0; justify-content: center; }
	.pc-panel {
		position: fixed;
		inset: auto 0 0 0;
		width: 100%;
		max-width: none;
		height: 85vh;
		height: 85dvh;
		max-height: none;
		border-radius: 14px 14px 0 0;
	}
	.pemm-chat--no-mobile { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.pc-launcher { transition: none; }
	.pc-typing i { animation: none; }
}
