/* EPC AI Agent — chat widget styles (v1.1: contact rail + theme-bleed hardening) */
:root {
	--epcai-primary: #0b5394;
	--epcai-dark: #073763;
	--epcai-accent: #3cb54a;
	--epcai-radius: 16px;
	--epcai-whatsapp: #25d366;
}

.epcai-hidden { display: none !important; }

/* --- Hard reset so theme/Elementor button & input styles can't bleed in --- */
.epcai-panel button,
.epcai-launcher {
	-webkit-appearance: none !important;
	appearance: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	line-height: 1 !important;
	font-family: inherit !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	border-radius: 50%;
}
.epcai-panel button svg { display: block; }

/* Floating launcher: wrap anchors the bubble, satellite fan and label pill */
.epcai-launcher-wrap {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 999990;
	width: 280px;
	height: 230px;
	pointer-events: none; /* only children are clickable */
}
.epcai-launcher-wrap > * { pointer-events: auto; }

.epcai-launcher {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 84px !important;
	height: 84px !important;
	border-radius: 50% !important;
	border: none !important;
	cursor: pointer;
	background: linear-gradient(135deg, var(--epcai-primary), var(--epcai-dark)) !important;
	box-shadow: 0 6px 24px rgba(7, 55, 99, 0.35) !important;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease;
	padding: 0 !important;
}
.epcai-launcher:hover { transform: scale(1.06); background: linear-gradient(135deg, var(--epcai-primary), var(--epcai-dark)) !important; }
.epcai-launcher svg { width: 38px; height: 38px; fill: #fff !important; }

/* Satellite contact icons hugging the bubble (closed state) */
.epcai-launcher-wrap .epcai-sat {
	position: absolute !important;
	width: 36px !important;
	height: 36px !important;
	transition: opacity .2s ease, transform .2s ease, box-shadow .15s ease !important;
}
.epcai-launcher-wrap .epcai-sat svg { width: 17px; height: 17px; }
/* Tight ring around the bubble's top: whatsapp (left) → book → email (top) → call (top-right) */
.epcai-launcher-wrap .epcai-sat-1 { right: 86px;  bottom: 52px; }
.epcai-launcher-wrap .epcai-sat-2 { right: -13px; bottom: 81px; }
.epcai-launcher-wrap .epcai-sat-3 { right: 24px;  bottom: 92px; }
.epcai-launcher-wrap .epcai-sat-4 { right: 61px;  bottom: 81px; }
.epcai-launcher-wrap .epcai-sat { z-index: 2; }
.epcai-launcher-wrap .epcai-sat:hover { z-index: 4; }
.epcai-launcher { z-index: 3; }

/* Satellite tooltips open to the LEFT (they sit at the screen edge) */
.epcai-launcher-wrap .epcai-sat::after {
	left: auto;
	right: calc(100% + 10px);
	transform: translateY(-50%) translateX(6px);
}
.epcai-launcher-wrap .epcai-sat::before {
	left: auto;
	right: calc(100% + 4px);
	border-right-color: transparent;
	border-left-color: var(--epcai-dark);
}
.epcai-launcher-wrap .epcai-sat:hover::after,
.epcai-launcher-wrap .epcai-sat:focus-visible::after { transform: translateY(-50%) translateX(0); }

/* "Quick Help" pill — styled like a chat teaser bubble (no border, soft shadow, tail) */
.epcai-launcher-label {
	position: absolute !important;
	right: 96px;
	bottom: 12px;
	z-index: 1;
	background: #fff !important;
	color: #14202e !important;
	border: none !important;
	border-radius: 22px !important;
	border-bottom-right-radius: 6px !important; /* speech-bubble tail corner toward the chat bubble */
	padding: 11px 17px !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	letter-spacing: normal !important;
	word-spacing: normal !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
	line-height: 1 !important;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 6px 24px rgba(23, 39, 59, 0.18), 0 2px 6px rgba(23, 39, 59, 0.10) !important;
	transition: opacity .2s ease, transform .15s ease !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	width: auto !important;
	height: auto !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	text-transform: none !important;
}
.epcai-launcher-label:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(23, 39, 59, 0.24), 0 2px 6px rgba(23, 39, 59, 0.10) !important; }

/* Chat open: hide satellites + label (the panel has its own contact sidebar) */
.epcai-launcher-wrap.epcai-open .epcai-sat,
.epcai-launcher-wrap.epcai-open .epcai-launcher-label {
	opacity: 0 !important;
	transform: scale(.4) !important;
	pointer-events: none !important;
}

@media (max-width: 480px) {
	.epcai-launcher-wrap { width: 260px; height: 200px; }
	/* Satellite positions are computed at runtime (layoutSats) from real rendered sizes. */
	.epcai-launcher-label { font-size: 13.5px !important; padding: 10px 14px !important; }
}

/* Chat panel */
.epcai-panel {
	position: fixed;
	right: 22px;
	bottom: 118px;
	z-index: 999991;
	width: 396px;
	max-width: calc(100vw - 24px);
	height: 580px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: var(--epcai-radius);
	box-shadow: 0 12px 48px rgba(7, 55, 99, 0.28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
}

/* Inline (shortcode) variant */
.epcai-inline .epcai-panel {
	position: static;
	width: 100%;
	max-width: 760px;
	height: 620px;
	margin: 0 auto;
	box-shadow: 0 4px 24px rgba(7, 55, 99, 0.15);
}

.epcai-header {
	background: linear-gradient(135deg, var(--epcai-primary), var(--epcai-dark));
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.epcai-header-avatar {
	width: 38px; height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	display: flex; align-items: center; justify-content: center;
	flex: 0 0 auto;
}
.epcai-header-avatar svg { width: 22px; height: 22px; fill: #fff; }
.epcai-header-title { font-weight: 700; font-size: 15px; margin: 0; color: #fff; }
.epcai-header-sub { font-size: 12px; opacity: .85; margin: 0; display: flex; align-items: center; gap: 5px; color: #fff; }
.epcai-online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--epcai-accent); display: inline-block; }
.epcai-close {
	margin-left: auto !important;
	background: rgba(255, 255, 255, 0.28) !important;
	border: 1.5px solid rgba(255, 255, 255, 0.55) !important;
	color: #fff !important;
	font-size: 19px !important;
	font-weight: 700 !important;
	cursor: pointer;
	padding: 0 !important;
	opacity: 1 !important;
	border-radius: 50% !important;
	width: 34px !important;
	height: 34px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: 1 !important;
	transition: background .15s ease, transform .1s ease;
	flex: 0 0 auto;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
}
.epcai-close:hover { background: rgba(255, 255, 255, 0.45) !important; transform: scale(1.1); }

/* --- Body row: contact rail (left) + chat column (right) --- */
.epcai-body {
	flex: 1;
	display: flex;
	flex-direction: row;
	min-height: 0;
	background: #f4f7fb;
}

/* Contact channels rail */
.epcai-rail {
	flex: 0 0 58px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 16px 0;
	background: #eaf1f8;
	border-right: 1px solid #dbe6f1;
}
.epcai-rail-label {
	font-size: 9px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #7d93aa;
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	margin-top: auto;
	user-select: none;
}
.epcai-chan {
	position: relative;
	width: 42px !important;
	height: 42px !important;
	border-radius: 50% !important;
	border: none !important;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff !important;
	text-decoration: none !important;
	padding: 0 !important;
	transition: transform .15s ease, box-shadow .15s ease;
	box-shadow: 0 3px 10px rgba(7, 55, 99, 0.18) !important;
	flex: 0 0 auto;
}
.epcai-chan:hover { transform: scale(1.12); box-shadow: 0 5px 16px rgba(7, 55, 99, 0.3) !important; }
.epcai-chan svg { width: 21px; height: 21px; fill: #fff !important; }
.epcai-chan-whatsapp { background: var(--epcai-whatsapp) !important; }
.epcai-chan-call     { background: var(--epcai-primary) !important; }
.epcai-chan-email    { background: #e8763a !important; }
.epcai-chan-book     { background: var(--epcai-accent) !important; }

/* Hover tooltip: channel name appears to the right of the icon */
.epcai-chan::after {
	content: attr(data-label);
	position: absolute;
	left: calc(100% + 10px);
	top: 50%;
	transform: translateY(-50%) translateX(-6px);
	background: var(--epcai-dark);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	padding: 6px 10px;
	border-radius: 7px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s ease, transform .15s ease;
	z-index: 5;
	box-shadow: 0 4px 14px rgba(7, 55, 99, 0.25);
}
.epcai-chan::before {
	content: "";
	position: absolute;
	left: calc(100% + 4px);
	top: 50%;
	transform: translateY(-50%);
	border: 6px solid transparent;
	border-right-color: var(--epcai-dark);
	opacity: 0;
	transition: opacity .15s ease;
	z-index: 5;
}
.epcai-chan:hover::after,
.epcai-chan:focus-visible::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.epcai-chan:hover::before,
.epcai-chan:focus-visible::before { opacity: 1; }

/* Chat column */
.epcai-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.epcai-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.epcai-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: break-word;
}
.epcai-msg a { color: var(--epcai-primary); text-decoration: underline; }
.epcai-msg strong { font-weight: 700; }

/* Bullet lists in bot replies */
.epcai-msg ul.epcai-ul {
	margin: 6px 0 6px 4px !important;
	padding: 0 0 0 16px !important;
	list-style: disc outside !important;
	white-space: normal;
}
.epcai-msg ul.epcai-ul li {
	margin: 3px 0 !important;
	padding: 0 !important;
	line-height: 1.45;
	list-style: disc outside !important;
}
.epcai-msg ul.epcai-ul li::marker { color: var(--epcai-primary); }

/* Divider line (--- / ___) in bot replies */
.epcai-msg hr.epcai-hr {
	border: none !important;
	border-top: 1.5px solid #dbe6f1 !important;
	margin: 10px 0 !important;
	height: 0;
}

/* EPC data tables inside bot bubbles */
.epcai-msg-bot.epcai-has-table { max-width: 100%; }
.epcai-row-bot .epcai-msg-bot.epcai-has-table { max-width: calc(100% - 40px); }
.epcai-table {
	border-collapse: collapse !important;
	width: 100%;
	margin: 6px 0 !important;
	font-size: 13px;
	line-height: 1.35;
	background: #fff;
	border: 1px solid #dbe6f1 !important;
	border-radius: 8px;
	overflow: hidden;
	white-space: normal;
	table-layout: auto;
}
.epcai-table th,
.epcai-table td {
	border: 1px solid #e2e9f2 !important;
	padding: 6px 9px !important;
	text-align: left !important;
	vertical-align: top;
	color: #17273b;
	background: transparent;
	word-break: break-word;
}
.epcai-table th {
	background: var(--epcai-primary) !important;
	color: #fff !important;
	font-weight: 700;
	font-size: 12.5px;
}
.epcai-table tr:nth-child(even) td { background: #f4f8fc; }
.epcai-table td:first-child { font-weight: 600; color: #34495e; }
.epcai-table a { word-break: break-all; }

/* Bot reply row: small avatar + bubble */
.epcai-row-bot {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 100%;
}
.epcai-msg-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--epcai-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 26px;
	overflow: hidden;
}
.epcai-msg-avatar svg { width: 14px; height: 14px; fill: #fff !important; }
.epcai-avatar-img {
	width: 100% !important;
	height: 100% !important;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	margin: 0 !important;
	max-width: none !important;
}
.epcai-row-bot .epcai-msg-bot { max-width: calc(100% - 40px); }
.epcai-msg-bot {
	align-self: flex-start;
	background: #fff;
	color: #17273b;
	border: 1px solid #e2e9f2;
	border-bottom-left-radius: 4px;
}
.epcai-msg-user {
	align-self: flex-end;
	background: var(--epcai-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}
/* Quick-reply chips */
.epcai-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 2px 0 4px 34px; /* aligned with bot bubbles (past the mini avatar) */
	align-self: flex-start;
	max-width: 100%;
}
.epcai-chip {
	background: #fff !important;
	color: var(--epcai-primary) !important;
	border: 1.5px solid var(--epcai-primary) !important;
	border-radius: 18px !important;
	padding: 8px 14px !important;
	font-size: 13.5px !important;
	font-weight: 600 !important;
	font-family: inherit !important;
	line-height: 1.2 !important;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, transform .1s ease;
	box-shadow: 0 1px 4px rgba(7, 55, 99, 0.1) !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	text-transform: none !important;
	width: auto !important;
	height: auto !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}
.epcai-chip:hover {
	background: var(--epcai-primary) !important;
	color: #fff !important;
	transform: translateY(-1px);
}
.epcai-chip:active { transform: translateY(0); }

.epcai-typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.epcai-typing span {
	width: 7px; height: 7px; border-radius: 50%; background: #9db4cc;
	animation: epcai-blink 1.2s infinite both;
}
.epcai-typing span:nth-child(2) { animation-delay: .2s; }
.epcai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes epcai-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.epcai-inputbar {
	display: flex;
	gap: 8px;
	padding: 12px;
	background: #fff;
	border-top: 1px solid #e2e9f2;
	align-items: flex-end;
}
.epcai-input {
	flex: 1;
	resize: none;
	border: 1px solid #cdd9e6 !important;
	border-radius: 22px !important;
	padding: 10px 14px !important;
	font: inherit !important;
	font-size: 15px !important;
	max-height: 110px;
	outline: none;
	background: #fff !important;
	color: #17273b !important;
	box-shadow: none !important;
	margin: 0 !important;
	width: auto;
	min-height: 0 !important;
}
.epcai-input:focus { border-color: var(--epcai-primary) !important; box-shadow: 0 0 0 2px rgba(11, 83, 148, 0.15) !important; }
.epcai-send {
	border: none !important;
	background: var(--epcai-primary) !important;
	color: #fff !important;
	width: 42px !important;
	height: 42px !important;
	border-radius: 50% !important;
	cursor: pointer;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex: 0 0 42px;
	transition: background .15s ease;
	padding: 0 !important;
	position: relative;
}
.epcai-send:hover { background: var(--epcai-dark) !important; }
.epcai-send:disabled { background: #b9c9d9 !important; cursor: default; }
.epcai-send svg {
	width: 18px !important;
	height: 18px !important;
	fill: #fff !important;
	margin: 0 !important;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-52%, -50%); /* optical centering for the paper-plane */
}

.epcai-footer {
	text-align: center;
	font-size: 11px;
	color: #8296ab;
	padding: 0 10px 8px;
	background: #fff;
}

/* Honeypot */
.epcai-hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

@media (max-width: 480px) {
	.epcai-panel {
		right: 8px;
		left: 8px;
		width: auto;
		bottom: 88px;
		height: 72vh;
	}
	.epcai-rail { flex-basis: 52px; }
}
