.esp-ai-chat, .esp-ai-chat * { box-sizing: border-box; }
.esp-ai-chat[hidden] { display: none; }

.esp-ai-launcher {
	position: fixed; z-index: 99998; right: 18px; bottom: 82px;
	display: inline-flex; align-items: center; gap: 10px;
	padding: 13px 18px 13px 15px; border: 0; border-radius: 999px;
	background: var(--orange-action, #e8722a); color: #fff;
	font-family: var(--sans, system-ui, sans-serif); font-size: .84rem; font-weight: 800;
	box-shadow: 0 14px 34px rgba(24, 16, 8, .28); cursor: pointer;
	transition: transform .2s ease, box-shadow .2s ease;
}
.esp-ai-launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(24, 16, 8, .32); }
.esp-ai-launcher svg { width: 20px; height: 20px; }
.esp-ai-launcher.is-open { display: none; }

.esp-ai-panel {
	position: fixed; z-index: 99999; right: 22px; bottom: 22px;
	display: flex; flex-direction: column; overflow: hidden;
	width: min(390px, calc(100vw - 32px)); height: min(620px, calc(100vh - 40px));
	border: 1px solid #e2e5e2; border-radius: 20px; background: #fff;
	box-shadow: 0 26px 60px rgba(20, 30, 24, .28);
	font-family: var(--sans, system-ui, sans-serif);
	opacity: 0; transform: translateY(14px) scale(.98); pointer-events: none;
	transition: opacity .18s ease, transform .18s ease;
}
.esp-ai-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }

.esp-ai-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 15px; background: linear-gradient(135deg, #1f3d31, #2c5a46); color: #fff; }
.esp-ai-head__avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 50%; background: rgba(255,255,255,.16); font-size: 1.15rem; }
.esp-ai-head__text { min-width: 0; flex: 1; }
.esp-ai-head__text strong { display: block; font-size: .86rem; font-weight: 800; line-height: 1.2; }
.esp-ai-head__text span { display: block; overflow: hidden; color: rgba(255,255,255,.82); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.esp-ai-head__close { border: 0; background: transparent; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; opacity: .85; }
.esp-ai-head__close:hover { opacity: 1; }

.esp-ai-log { flex: 1; overflow-y: auto; padding: 16px; background: #f6f8f6; scrollbar-width: thin; }
.esp-ai-msg { max-width: 86%; margin-bottom: 12px; padding: 11px 14px; border-radius: 15px; font-size: .82rem; line-height: 1.5; word-wrap: break-word; }
.esp-ai-msg a { color: inherit; font-weight: 700; text-underline-offset: 2px; }
.esp-ai-msg--bot { margin-right: auto; border-bottom-left-radius: 5px; background: #fff; border: 1px solid #e6e9e6; color: #223028; }
.esp-ai-msg--user { margin-left: auto; border-bottom-right-radius: 5px; background: var(--orange-dark, #c85a1c); color: #fff; }
.esp-ai-msg--typing { color: #6a726c; font-style: italic; }

.esp-ai-cards { display: flex; flex-direction: column; gap: 9px; margin: 2px 0 14px; }
.esp-ai-card { display: flex; gap: 11px; padding: 9px; border: 1px solid #e3e6e3; border-radius: 13px; background: #fff; }
.esp-ai-card img { width: 66px; height: 54px; flex: 0 0 auto; border-radius: 9px; object-fit: cover; background: #e6e8e6; }
.esp-ai-card__body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.esp-ai-card__body strong { overflow: hidden; color: #223028; font-size: .76rem; font-weight: 750; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.esp-ai-card__price { color: var(--orange-dark, #c85a1c); font-size: .72rem; font-weight: 800; }
.esp-ai-card__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.esp-ai-card__actions a { padding: 5px 10px; border-radius: 8px; font-size: .66rem; font-weight: 800; text-decoration: none; }
.esp-ai-card__actions .is-view { border: 1px solid #cfd6d0; color: #33493d; }
.esp-ai-card__actions .is-add { background: var(--orange-action, #e8722a); color: #fff; }

.esp-ai-handoff {
	display: inline-flex; align-items: center; gap: 7px; margin: 0 0 12px;
	padding: 8px 14px; border: 1px solid #cfe6d3; border-radius: 999px;
	background: #eafaef; color: #1c7a3d; font-family: inherit; font-size: .74rem; font-weight: 750; cursor: pointer;
	transition: background .15s ease;
}
.esp-ai-handoff:hover { background: #dcf5e4; }
.esp-ai-handoff svg { flex: 0 0 auto; }
.esp-ai-lead { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; padding: 12px; border: 1px solid #cfe6d3; border-radius: 13px; background: #f4fbf6; }
.esp-ai-lead input { padding: 10px 12px; border: 1px solid #cdd6cf; border-radius: 9px; font-family: inherit; font-size: .8rem; }
.esp-ai-lead input:focus { outline: none; border-color: #1c7a3d; }
.esp-ai-lead button { padding: 10px; border: 0; border-radius: 9px; background: #1c7a3d; color: #fff; font-size: .78rem; font-weight: 800; cursor: pointer; }
.esp-ai-lead button:disabled { opacity: .6; cursor: default; }

.esp-ai-foot { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #e6e9e6; background: #fff; }
.esp-ai-foot textarea { flex: 1; max-height: 96px; min-height: 42px; padding: 11px 13px; border: 1px solid #d3d9d4; border-radius: 12px; font-family: inherit; font-size: .82rem; line-height: 1.4; resize: none; }
.esp-ai-foot textarea:focus { outline: none; border-color: var(--orange-dark, #c85a1c); }
.esp-ai-foot button { flex: 0 0 auto; width: 44px; border: 0; border-radius: 12px; background: var(--orange-action, #e8722a); color: #fff; font-size: 1.1rem; cursor: pointer; }
.esp-ai-foot button:disabled { opacity: .5; cursor: default; }

@media (max-width: 600px) {
	.esp-ai-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
	.esp-ai-launcher { right: 16px; bottom: 78px; padding: 14px; }
	.esp-ai-launcher span { display: none; }
}
/* Tour pages show a fixed booking bar at the very bottom on mobile: lift the launcher above it. */
@media (max-width: 620px) {
	body.single-ttbm_tour .esp-ai-launcher { bottom: 138px; }
}
