/* DVN Nexi — prominent, modern agent widget */

#dvn-nexi-root {
	--nexi-accent: #1E5FBF;
	--nexi-accent-dark: #164a96;
	--nexi-orange: #F2793A;
	--nexi-yellow: #F4B400;
	--nexi-ink: #1c2430;
	--nexi-bubble-user: #1E5FBF;
	--nexi-bubble-bot: #f0f4f9;
	all: initial;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	position: fixed;
	z-index: 999999;
	bottom: 28px;
}

#dvn-nexi-root, #dvn-nexi-root * { box-sizing: border-box; }

#dvn-nexi-root.dvn-pos-right { right: 28px; }
#dvn-nexi-root.dvn-pos-left  { left: 28px; }

/* ===== LAUNCHER — more prominent ===== */
.dvn-nexi-launcher-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-direction: row-reverse;
}
#dvn-nexi-root.dvn-pos-left .dvn-nexi-launcher-wrap {
	flex-direction: row;
}

.dvn-nexi-launcher {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(145deg, var(--nexi-accent) 0%, #2a7de1 40%, var(--nexi-orange) 75%, var(--nexi-yellow) 100%);
	box-shadow:
		0 0 0 0 rgba(30, 95, 191, 0.45),
		0 10px 32px rgba(20, 40, 80, 0.35),
		0 4px 12px rgba(242, 121, 58, 0.25);
	transition: transform 0.22s cubic-bezier(.2,.8,.2,1), box-shadow 0.22s ease;
	position: relative;
	animation: nexiGlow 2.8s ease-in-out infinite;
}
.dvn-nexi-launcher.size-xl {
	width: 80px;
	height: 80px;
}
.dvn-nexi-launcher:hover {
	transform: translateY(-4px) scale(1.06);
	box-shadow:
		0 0 0 6px rgba(30, 95, 191, 0.18),
		0 16px 40px rgba(20, 40, 80, 0.4),
		0 6px 16px rgba(242, 121, 58, 0.3);
}
.dvn-nexi-launcher svg { width: 36px; height: 36px; }

@keyframes nexiGlow {
	0%, 100% { box-shadow: 0 0 0 0 rgba(30,95,191,0.5), 0 10px 32px rgba(20,40,80,0.35); }
	50%      { box-shadow: 0 0 0 12px rgba(30,95,191,0), 0 10px 32px rgba(20,40,80,0.35); }
}

.dvn-nexi-launcher .dvn-nexi-pulse {
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2.5px solid rgba(255,255,255,0.65);
	animation: nexiPulse 2.2s ease-out infinite;
	pointer-events: none;
}
@keyframes nexiPulse {
	0%   { transform: scale(0.85); opacity: 0.9; }
	100% { transform: scale(1.45); opacity: 0; }
}

.dvn-nexi-badge-dot {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #22c55e;
	border: 2.5px solid #fff;
	box-shadow: 0 0 0 2px rgba(34,197,94,0.35);
	animation: nexiDotPulse 1.8s ease-in-out infinite;
}
@keyframes nexiDotPulse {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.15); }
}

.dvn-nexi-launcher-label {
	background: #fff;
	color: var(--nexi-ink);
	font-size: 14px;
	font-weight: 600;
	padding: 10px 16px;
	border-radius: 999px;
	box-shadow: 0 6px 20px rgba(20,40,80,0.18);
	white-space: nowrap;
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
	animation: nexiLabelIn 0.4s ease 0.3s both;
}
@keyframes nexiLabelIn {
	from { opacity: 0; transform: translateX(12px); }
	to   { opacity: 1; transform: translateX(0); }
}
#dvn-nexi-root.dvn-pos-left .dvn-nexi-launcher-label {
	animation-name: nexiLabelInLeft;
}
@keyframes nexiLabelInLeft {
	from { opacity: 0; transform: translateX(-12px); }
	to   { opacity: 1; transform: translateX(0); }
}
#dvn-nexi-root.dvn-open .dvn-nexi-launcher-label {
	display: none;
}

/* ===== PANEL ===== */
.dvn-nexi-panel {
	position: absolute;
	bottom: 90px;
	width: 380px;
	max-width: calc(100vw - 24px);
	height: 560px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 24px 64px rgba(15, 25, 50, 0.32), 0 0 0 1px rgba(0,0,0,0.04);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(20px) scale(0.96);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.22s cubic-bezier(.2,.8,.2,1);
}
#dvn-nexi-root.dvn-pos-right .dvn-nexi-panel { right: 0; }
#dvn-nexi-root.dvn-pos-left  .dvn-nexi-panel { left: 0; }
#dvn-nexi-root.dvn-open .dvn-nexi-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: all;
}

.dvn-nexi-header {
	background: linear-gradient(125deg, var(--nexi-accent), var(--nexi-accent-dark) 60%, #0f3a7a);
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
	position: relative;
}
.dvn-nexi-header::after {
	content: '';
	position: absolute;
	bottom: 0; left: 0; right: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
}
.dvn-nexi-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255,255,255,0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border: 2px solid rgba(255,255,255,0.35);
	overflow: hidden;
}
.dvn-nexi-avatar svg { width: 28px; height: 28px; }
.dvn-nexi-header-text { flex: 1; min-width: 0; }
.dvn-nexi-header-name {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.2;
}
.dvn-nexi-header-status {
	font-size: 12px;
	opacity: 0.9;
	margin-top: 2px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.dvn-nexi-header-status::before {
	content: '';
	width: 7px; height: 7px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 2px rgba(74,222,128,0.35);
}
.dvn-nexi-close {
	background: rgba(255,255,255,0.12);
	border: none;
	width: 32px; height: 32px;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s;
}
.dvn-nexi-close:hover { background: rgba(255,255,255,0.22); }
.dvn-nexi-close svg { width: 16px; height: 16px; }

/* Messages */
.dvn-nexi-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #f8fafc;
}
.dvn-nexi-msg { display: flex; max-width: 88%; }
.dvn-nexi-msg-user { align-self: flex-end; }
.dvn-nexi-msg-bot  { align-self: flex-start; }
.dvn-nexi-bubble {
	padding: 11px 14px;
	border-radius: 16px;
	font-size: 14.5px;
	line-height: 1.45;
	color: var(--nexi-ink);
	word-break: break-word;
	white-space: pre-wrap;
}
.dvn-nexi-msg-user .dvn-nexi-bubble {
	background: var(--nexi-bubble-user);
	color: #fff;
	border-bottom-right-radius: 5px;
}
.dvn-nexi-msg-bot .dvn-nexi-bubble {
	background: #fff;
	border: 1px solid #e8eef5;
	border-bottom-left-radius: 5px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Typing */
.dvn-nexi-typing {
	display: inline-flex;
	gap: 4px;
	padding: 4px 2px;
}
.dvn-nexi-typing span {
	width: 7px; height: 7px;
	border-radius: 50%;
	background: #94a3b8;
	animation: nexiTyping 1.2s ease-in-out infinite;
}
.dvn-nexi-typing span:nth-child(2) { animation-delay: 0.15s; }
.dvn-nexi-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes nexiTyping {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* Quick replies */
.dvn-nexi-quick-replies {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 12px 10px;
	background: #f8fafc;
}
.dvn-nexi-quick-btn {
	background: #fff;
	border: 1px solid #dbe4f0;
	color: var(--nexi-accent);
	font-size: 12.5px;
	font-weight: 550;
	padding: 7px 12px;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}
.dvn-nexi-quick-btn:hover {
	background: #eef4ff;
	border-color: var(--nexi-accent);
}

/* Contact / handoff buttons */
.dvn-nexi-contact-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}
.dvn-nexi-contact-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	color: #fff !important;
	border: none;
	cursor: pointer;
}
.dvn-nexi-contact-btn.whatsapp { background: #25D366; }
.dvn-nexi-contact-btn.email    { background: #4b6bfb; }
.dvn-nexi-contact-btn.human    { background: linear-gradient(135deg, #1E5FBF, #F2793A); }
.dvn-nexi-contact-btn svg { width: 16px; height: 16px; }

/* Input */
.dvn-nexi-inputbar {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px 14px;
	background: #fff;
	border-top: 1px solid #e8eef5;
}
.dvn-nexi-input {
	flex: 1;
	border: 1.5px solid #dce4f0;
	border-radius: 14px;
	padding: 11px 14px;
	font-size: 14.5px;
	font-family: inherit;
	resize: none;
	max-height: 90px;
	outline: none;
	transition: border-color 0.15s;
	line-height: 1.4;
}
.dvn-nexi-input:focus { border-color: var(--nexi-accent); }
.dvn-nexi-send {
	width: 44px; height: 44px;
	border-radius: 12px;
	border: none;
	background: linear-gradient(135deg, var(--nexi-accent), var(--nexi-accent-dark));
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: transform 0.15s, opacity 0.15s;
}
.dvn-nexi-send:hover { transform: scale(1.05); }
.dvn-nexi-send:disabled { opacity: 0.5; cursor: default; }
.dvn-nexi-send svg { width: 18px; height: 18px; }

.dvn-nexi-footer-note {
	font-size: 11px;
	color: #94a3b8;
	text-align: center;
	padding: 6px 12px 10px;
	background: #fff;
}

/* Human mode banner */
.dvn-nexi-human-banner {
	background: linear-gradient(90deg, #ecfdf5, #f0f9ff);
	border-bottom: 1px solid #bbf7d0;
	padding: 8px 14px;
	font-size: 12.5px;
	color: #166534;
	text-align: center;
	font-weight: 550;
}

@media (max-width: 420px) {
	.dvn-nexi-panel {
		width: calc(100vw - 16px);
		height: calc(100vh - 100px);
		bottom: 86px;
		border-radius: 16px;
	}
	.dvn-nexi-launcher { width: 64px; height: 64px; }
	.dvn-nexi-launcher-label { display: none; }
}
