/* JAC WPBot — chat widget styles */
.jacw-root {
	--jacw-accent: #2563eb;
	--jacw-bg: #ffffff;
	--jacw-text: #1f2430;
	--jacw-muted: #6b7280;
	--jacw-bot-bubble: #f1f4f9;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--jacw-text);
	z-index: 99990;
}

/* Floating launcher */
.jacw-launcher {
	position: fixed;
	bottom: 22px;
	inset-inline-end: 22px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background: var(--jacw-accent);
	color: #fff;
	font-size: 26px;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease;
}
.jacw-launcher:hover { transform: scale(1.06); }
.jacw-launcher-avatar {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
	justify-content: center;
}
/* Server-rendered avatar image (v1.1) fills the round launcher. */
.jacw-launcher-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
	display: block;
}
.jacw-launcher-dot {
	position: absolute;
	top: 4px;
	inset-inline-end: 4px;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: #34d399;
	border: 2px solid #fff;
}

/* Panel */
.jacw-panel {
	position: fixed;
	bottom: 96px;
	inset-inline-end: 22px;
	width: min(380px, calc(100vw - 24px));
	height: min(560px, calc(100dvh - 120px));
	background: var(--jacw-bg);
	border-radius: 18px;
	box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.jacw-inline .jacw-panel {
	position: static;
	width: 100%;
	max-width: 460px;
	height: 560px;
	box-shadow: 0 4px 18px rgba(15, 23, 42, .15);
	border: 1px solid #e5e7eb;
}

/* Header */
.jacw-header {
	background: var(--jacw-accent);
	color: #fff;
	padding: 12px 14px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.jacw-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .2);
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	flex: 0 0 auto;
}
.jacw-header-text { flex: 1 1 auto; min-width: 0; }
.jacw-header-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
.jacw-header-status { font-size: 12px; opacity: .85; }
.jacw-lang {
	background: rgba(255, 255, 255, .15);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 8px;
	font-size: 12px;
	padding: 3px 4px;
}
.jacw-lang option { color: #111; }
.jacw-icon-btn {
	background: transparent;
	border: none;
	color: inherit;
	cursor: pointer;
	font-size: 16px;
	padding: 4px;
	border-radius: 8px;
	line-height: 1;
}
.jacw-header .jacw-icon-btn { color: #fff; }
.jacw-icon-btn:hover { background: rgba(127, 127, 127, .18); }

/* Messages */
.jacw-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: linear-gradient(180deg, #fbfcfe, #f4f6fa);
}
.jacw-msg { display: flex; }
.jacw-msg-user { justify-content: flex-end; }
.jacw-bubble {
	max-width: 82%;
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-break: break-word;
}
.jacw-msg-bot .jacw-bubble {
	background: var(--jacw-bot-bubble);
	border-start-start-radius: 4px;
}
.jacw-msg-user .jacw-bubble {
	background: var(--jacw-accent);
	color: #fff;
	border-start-end-radius: 4px;
}
.jacw-typing .jacw-bubble { color: var(--jacw-muted); letter-spacing: 2px; }

/* Chips */
.jacw-chips {
	padding: 6px 12px 2px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}
.jacw-chips-title { font-size: 12px; color: var(--jacw-muted); width: 100%; }
.jacw-chip {
	border: 1px solid var(--jacw-accent);
	color: var(--jacw-accent);
	background: #fff;
	border-radius: 999px;
	padding: 5px 11px;
	font-size: 12.5px;
	cursor: pointer;
}
.jacw-chip:hover { background: var(--jacw-accent); color: #fff; }

/* Lead form */
.jacw-lead {
	margin: 8px 12px;
	padding: 12px;
	border: 1px dashed var(--jacw-accent);
	border-radius: 12px;
	background: #f8faff;
	display: flex;
	flex-direction: column;
	gap: 7px;
}
.jacw-lead-title { font-size: 13px; font-weight: 600; }
.jacw-lead input {
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13.5px;
	width: 100%;
	box-sizing: border-box;
}
.jacw-lead-submit {
	background: var(--jacw-accent);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 9px;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
}

/* Input row */
.jacw-input-row {
	display: flex;
	gap: 6px;
	align-items: flex-end;
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
	border-top: 1px solid #e5e7eb;
	background: #fff;
}
.jacw-input {
	flex: 1 1 auto;
	border: 1px solid #d1d5db;
	border-radius: 12px;
	padding: 9px 11px;
	font-size: 14px;
	resize: none;
	max-height: 90px;
	font-family: inherit;
}
.jacw-input:focus { outline: 2px solid var(--jacw-accent); outline-offset: 0; border-color: transparent; }
.jacw-mic { color: #4b5563; font-size: 18px; }
.jacw-mic.jacw-listening { color: #dc2626; animation: jacw-pulse 1s infinite; }
@keyframes jacw-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .35; }
}
.jacw-send {
	background: var(--jacw-accent);
	color: #fff;
	border: none;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	font-size: 15px;
	cursor: pointer;
	flex: 0 0 auto;
}
.jacw-send:hover { filter: brightness(1.1); }

@media (max-width: 480px) {
	.jacw-panel {
		bottom: 0;
		inset-inline-end: 0;
		width: 100vw;
		height: 100dvh;
		border-radius: 0;
	}
	.jacw-launcher { bottom: 16px; inset-inline-end: 16px; }
}
