#epikaboot-root {
	--eb-ink: #14201c;
	--eb-accent: #0f766e;
	--eb-accent-2: #115e59;
	--eb-header-from: #115e59;
	--eb-header-to: #0f766e;
	--eb-surface: #f7faf8;
	--eb-line: #d7e3de;
	--eb-muted: #5b6b66;
	--eb-white: #ffffff;
	--eb-shadow: 0 18px 40px rgba(20, 32, 28, 0.18);
	font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
	position: fixed;
	inset: 0;
	z-index: 2147483646;
	pointer-events: none;
}

#epikaboot-root button {
	margin: 0;
}

.eb-bubble-wrap {
	position: fixed;
	bottom: 22px;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	z-index: 2147483646;
	pointer-events: auto;
}

.eb-bubble-wrap.is-left {
	left: 22px;
	align-items: flex-start;
}

.eb-bubble-wrap.is-right {
	right: 22px;
}

.eb-bubble-wrap.is-docked {
	right: auto;
	bottom: auto;
	transition: left 0.18s ease, top 0.18s ease;
}

.eb-bubble-wrap.is-dragging {
	transition: none;
}

.eb-bubble-wrap.is-dragging .eb-attention {
	display: none;
}

.eb-bubble-wrap.is-edge-top {
	flex-direction: column-reverse;
}

.eb-bubble-wrap.is-edge-top .eb-attention {
	border-radius: 4px 14px 14px 14px;
}

.eb-attention {
	max-width: 220px;
	background: var(--eb-ink);
	color: var(--eb-white);
	padding: 10px 12px;
	border-radius: 14px 14px 4px 14px;
	font-size: 13px;
	line-height: 1.35;
	box-shadow: var(--eb-shadow);
	animation: eb-pop 0.45s ease;
}

.eb-bubble-wrap.is-left .eb-attention {
	border-radius: 14px 14px 14px 4px;
}

.eb-bubble {
	width: 60px;
	height: 60px;
	min-width: 60px;
	min-height: 60px;
	flex: 0 0 60px;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(145deg, var(--eb-accent), var(--eb-accent-2));
	color: var(--eb-white);
	cursor: grab;
	touch-action: none;
	box-shadow: var(--eb-shadow);
	display: grid;
	place-items: center;
	padding: 0;
	overflow: hidden;
	transition: transform 0.2s ease;
}

.eb-bubble:hover {
	transform: scale(1.05);
}

.eb-bubble img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.eb-bubble svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

.eb-panel {
	position: fixed;
	bottom: 96px;
	width: min(380px, calc(100vw - 28px));
	height: min(560px, calc(100vh - 120px));
	background: var(--eb-white);
	border: 1px solid var(--eb-line);
	border-radius: 18px;
	box-shadow: var(--eb-shadow);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 2147483646;
	pointer-events: auto;
}

.eb-panel.is-open {
	display: flex;
	animation: eb-pop 0.28s ease;
}

.eb-panel.is-right {
	right: 22px;
}

.eb-panel.is-left {
	left: 22px;
}

.eb-top {
	position: relative;
	flex-shrink: 0;
	overflow: hidden;
}

/* Sin banner: barra compacta */
.eb-top:not(.has-banner) .eb-header {
	background: linear-gradient(135deg, var(--eb-header-from), var(--eb-header-to));
	padding: 10px 12px;
}

.eb-banner {
	width: 100%;
	height: 108px;
	overflow: hidden;
	background: #0b2e2a;
}

.eb-banner img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.eb-header {
	color: var(--eb-white);
	padding: 12px 14px;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

/* Con banner: título/X encima de la foto + degradado para legibilidad */
.eb-top.has-banner .eb-header {
	position: absolute;
	inset: 0;
	z-index: 2;
	padding: 10px 12px 14px;
	align-items: flex-start;
	background: linear-gradient(
		180deg,
		rgba(10, 28, 26, 0.82) 0%,
		rgba(10, 28, 26, 0.45) 48%,
		rgba(10, 28, 26, 0.12) 100%
	);
}

.eb-header-text {
	min-width: 0;
	padding-top: 1px;
}

.eb-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #ffffff;
	letter-spacing: 0.01em;
	line-height: 1.2;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.35);
}

.eb-header small {
	display: block;
	color: rgba(255, 255, 255, 0.92);
	font-size: 12px;
	margin-top: 3px;
	line-height: 1.25;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.eb-close {
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: rgba(0, 0, 0, 0.28);
	backdrop-filter: blur(4px);
	color: #fff;
	width: 32px;
	height: 32px;
	border-radius: 10px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	transition: background 0.15s ease, transform 0.15s ease;
}

.eb-close:hover {
	background: rgba(0, 0, 0, 0.42);
	transform: scale(1.04);
}

.eb-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.eb-close svg {
	display: block;
}

.eb-messages {
	flex: 1 1 auto;
	min-height: 120px;
	min-width: 0;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 14px;
	background:
		radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 40%),
		var(--eb-surface);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.eb-msg {
	max-width: 88%;
	padding: 10px 12px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
	min-width: 0;
	box-sizing: border-box;
}

.eb-msg.assistant {
	align-self: flex-start;
	background: var(--eb-white);
	border: 1px solid var(--eb-line);
	color: var(--eb-ink);
	border-bottom-left-radius: 4px;
}

.eb-msg.user {
	align-self: flex-end;
	background: var(--eb-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.eb-msg strong {
	font-weight: 700;
}

.eb-msg em {
	font-style: italic;
}

.eb-msg a {
	color: var(--eb-accent-2);
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-word;
}

.eb-msg.user a {
	color: #fff;
	text-decoration-color: rgba(255, 255, 255, 0.75);
}

.eb-msg a:hover {
	opacity: 0.9;
}

.eb-faq-bar {
	flex-shrink: 0;
	border-top: 1px solid var(--eb-line);
	background: #fff;
	max-height: 42%;
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	overflow-x: hidden;
}

.eb-faq-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	border: 0;
	background: #fff;
	color: var(--eb-ink);
	padding: 10px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-align: left;
}

.eb-faq-toggle:hover {
	background: rgba(15, 118, 110, 0.06);
	color: var(--eb-accent-2);
}

.eb-faq-toggle-label {
	min-width: 0;
	overflow-wrap: anywhere;
}

.eb-faq-toggle-label em {
	font-style: normal;
	font-weight: 500;
	color: var(--eb-muted);
}

.eb-faq-chevron {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.18s ease;
	flex-shrink: 0;
	margin-top: -4px;
}

.eb-faq-toggle.is-open .eb-faq-chevron {
	transform: rotate(-135deg);
	margin-top: 4px;
}

.eb-faqs {
	padding: 0 0 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	max-height: 180px;
	min-width: 0;
	min-height: 0;
	overscroll-behavior: contain;
}

.eb-faq-btn {
	border: 1px solid var(--eb-line);
	background: #fff;
	color: var(--eb-ink);
	border-radius: 12px;
	padding: 9px 12px;
	font-size: 12px;
	line-height: 1.35;
	cursor: pointer;
	text-align: left;
	width: auto;
	max-width: 100%;
	margin: 0 10px;
	min-width: 0;
	box-sizing: border-box;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: break-word;
}

#epikaboot-root .eb-faq-btn {
	margin: 0 10px;
}

.eb-faq-btn:hover {
	border-color: var(--eb-accent);
	color: var(--eb-accent-2);
	background: rgba(15, 118, 110, 0.04);
}

.eb-wa-wrap {
	padding: 0 14px 10px;
	background: var(--eb-surface);
}

.eb-wa-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 10px 12px;
	border-radius: 12px;
	background: #128c7e;
	color: #fff !important;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 14px;
}

.eb-wa-btn + .eb-wa-btn {
	margin-top: 8px;
}

.eb-msg .eb-wa-btn {
	margin-top: 10px;
	white-space: normal;
	text-decoration: none !important;
}


.eb-composer {
	border-top: 0;
	padding: 10px;
	display: flex;
	gap: 8px;
	align-items: flex-start;
	background: #fff;
}

.eb-field {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.eb-composer input,
.eb-composer textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--eb-line);
	border-radius: 12px;
	padding: 10px 12px;
	font-size: 14px;
	resize: none;
	min-height: 42px;
	max-height: 90px;
	font-family: inherit;
}

.eb-char-count {
	align-self: flex-end;
	font-size: 11px;
	line-height: 1;
	color: var(--eb-muted);
	font-variant-numeric: tabular-nums;
	padding-right: 2px;
}

.eb-char-count.is-low {
	color: #b45309;
}

.eb-char-count.is-max {
	color: #b42318;
	font-weight: 700;
}

.eb-composer button {
	border: 0;
	border-radius: 12px;
	background: var(--eb-accent);
	color: #fff;
	height: 42px;
	padding: 0 14px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.eb-composer button:hover:not(:disabled),
.eb-composer button:focus-visible:not(:disabled) {
	background: var(--eb-accent-2);
	transform: translateY(-2px);
	box-shadow: 0 8px 16px rgba(15, 118, 110, 0.32);
}

.eb-composer button:active:not(:disabled) {
	transform: translateY(0);
	box-shadow: 0 2px 6px rgba(15, 118, 110, 0.22);
}

.eb-composer button:disabled {
	opacity: 0.55;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

.eb-typing {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	border: 1px solid var(--eb-line);
	color: var(--eb-muted);
	font-size: 13px;
	line-height: 1;
	padding: 10px 14px;
	border-radius: 14px;
	border-bottom-left-radius: 4px;
	box-shadow: 0 8px 18px rgba(20, 32, 28, 0.06);
	animation: eb-typing-in 0.35s ease;
}

.eb-typing-dots {
	display: inline-flex;
	align-items: flex-end;
	gap: 4px;
	height: 12px;
}

.eb-typing-dots i {
	display: block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--eb-accent);
	animation: eb-dot 1.05s infinite ease-in-out;
}

.eb-typing-dots i:nth-child(2) {
	animation-delay: 0.15s;
}

.eb-typing-dots i:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes eb-dot {
	0%,
	80%,
	100% {
		transform: translateY(0);
		opacity: 0.35;
	}
	40% {
		transform: translateY(-5px);
		opacity: 1;
	}
}

@keyframes eb-typing-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.eb-typing,
	.eb-typing-dots i,
	.eb-composer button {
		animation: none;
		transition: none;
	}
}

@keyframes eb-pop {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (max-width: 480px) {
	.eb-panel {
		bottom: 0;
		left: 0 !important;
		right: 0 !important;
		width: 100vw;
		height: min(85vh, 640px);
		border-radius: 18px 18px 0 0;
	}
}
