/* ══════════════════════════════════════════════════════════════
   Tabi FAQ Bot — front-end widget

   Everything is scoped under #tabi-faq-bot. WordPress themes and
   the Elementor Kit ship high-specificity global rules for
   button / input / heading typography, so every visible text and
   button declaration here is guarded with !important — the same
   pattern the site's own carousels use.
   ══════════════════════════════════════════════════════════════ */

#tabi-faq-bot {
	--tfb-accent: #0724D0;
	--tfb-accent-soft: #4162E1;
	--tfb-navy: #1B1537;
	--tfb-ink: #1B1537;
	--tfb-ink-2: #575756;
	--tfb-surface: #F1F3FD;
	--tfb-border: #E5E8F6;
	--tfb-radius: 20px;
	--tfb-font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	position: fixed;
	bottom: 22px;
	z-index: 2147483000;
	margin: 0;
	padding: 0;
}

/* ── Hard reset so nothing bleeds in from the theme / Elementor ── */
#tabi-faq-bot,
#tabi-faq-bot *,
#tabi-faq-bot *::before,
#tabi-faq-bot *::after {
	box-sizing: border-box !important;
	font-family: var(--tfb-font) !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	-webkit-text-fill-color: currentColor !important;
	text-shadow: none !important;
	float: none !important;
}

#tabi-faq-bot button,
#tabi-faq-bot input {
	margin: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	min-width: 0 !important;
	min-height: 0 !important;
	width: auto;
	height: auto;
	max-width: none !important;
	text-decoration: none !important;
	text-align: left;
	line-height: 1.4 !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	outline: none;
	transform: none;
	transition: none;
}

#tabi-faq-bot.tfb--right { right: 22px; left: auto; }
#tabi-faq-bot.tfb--left  { left: 22px; right: auto; }

/* ── Launcher button ───────────────────────────────────────── */
.tfb-launcher {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 56px !important;
	padding: 0 22px 0 18px !important;
	border-radius: 999px !important;
	background: linear-gradient(135deg, var(--tfb-accent), var(--tfb-accent-soft)) !important;
	color: #fff !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	cursor: pointer;
	box-shadow: 0 12px 30px rgba(7, 36, 208, 0.32), inset 0 1px 1px rgba(255, 255, 255, 0.25) !important;
	transition: transform .18s ease, box-shadow .18s ease !important;
}
.tfb-launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 38px rgba(7, 36, 208, 0.40), inset 0 1px 1px rgba(255, 255, 255, 0.25) !important;
	color: #fff !important;
}
.tfb-launcher:focus-visible { outline: 3px solid rgba(7, 36, 208, 0.35) !important; outline-offset: 3px; }
.tfb-launcher svg { width: 22px !important; height: 22px !important; flex-shrink: 0; display: block; }
.tfb-launcher__label { white-space: nowrap; font-size: 15px !important; font-weight: 700 !important; color: #fff !important; }

#tabi-faq-bot.tfb-open .tfb-launcher { display: none !important; }

@media (max-width: 480px) {
	.tfb-launcher__label { display: none !important; }
	.tfb-launcher { padding: 0 !important; width: 56px !important; }
}

/* ── Panel ─────────────────────────────────────────────────── */
.tfb-panel {
	position: absolute;
	bottom: 0;
	width: min(380px, calc(100vw - 32px));
	height: min(560px, calc(100vh - 110px));
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--tfb-border);
	border-radius: var(--tfb-radius);
	overflow: hidden;
	box-shadow: 0 30px 70px rgba(27, 21, 55, 0.28);
	opacity: 0;
	transform: translateY(16px) scale(0.98);
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}
#tabi-faq-bot.tfb--right .tfb-panel { right: 0; left: auto; }
#tabi-faq-bot.tfb--left  .tfb-panel { left: 0; right: auto; }

#tabi-faq-bot.tfb-open .tfb-panel { opacity: 1; transform: none; pointer-events: auto; }

@media (max-width: 480px) {
	.tfb-panel {
		position: fixed;
		inset: 0;
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		border-radius: 0;
		border: none;
	}
}

/* ── Header ────────────────────────────────────────────────── */
.tfb-header {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 14px 14px 16px;
	background: var(--tfb-navy);
}
.tfb-header__avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, var(--tfb-accent), var(--tfb-accent-soft));
	box-shadow: 0 4px 12px rgba(7, 36, 208, 0.45);
}
.tfb-header__avatar svg { width: 18px !important; height: 18px !important; display: block; }
.tfb-header__text { flex: 1; min-width: 0; }
.tfb-header__title {
	font-size: 14px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	color: #fff !important;
	margin: 0 !important;
}
.tfb-header__sub {
	font-size: 11px !important;
	font-weight: 500 !important;
	line-height: 1.4 !important;
	color: rgba(255, 255, 255, 0.62) !important;
	margin: 2px 0 0 !important;
	display: flex;
	align-items: center;
	gap: 6px;
}
.tfb-header__sub::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #38d39f;
	flex-shrink: 0;
}
.tfb-close {
	width: 32px !important;
	height: 32px !important;
	flex-shrink: 0;
	border-radius: 8px !important;
	background: rgba(255, 255, 255, 0.10) !important;
	color: #fff !important;
	cursor: pointer;
	display: flex !important;
	align-items: center;
	justify-content: center;
	padding: 0 !important;
	transition: background .15s ease !important;
}
.tfb-close:hover { background: rgba(255, 255, 255, 0.22) !important; color: #fff !important; }
.tfb-close svg { width: 16px !important; height: 16px !important; display: block; }

/* ── Message list ──────────────────────────────────────────── */
.tfb-body {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 18px 16px 8px;
	background: var(--tfb-surface);
	display: flex;
	flex-direction: column;
	gap: 12px;
	scroll-behavior: smooth;
}

.tfb-msg { display: flex; max-width: 88%; margin: 0 !important; }
.tfb-msg--bot  { align-self: flex-start; }
.tfb-msg--user { align-self: flex-end; }

.tfb-bubble {
	padding: 11px 14px !important;
	font-size: 13.5px !important;
	font-weight: 400 !important;
	line-height: 1.6 !important;
	border-radius: 14px;
	color: var(--tfb-ink) !important;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.tfb-msg--bot .tfb-bubble {
	background: #fff;
	border: 1px solid var(--tfb-border);
	border-bottom-left-radius: 4px;
}
.tfb-msg--user .tfb-bubble {
	background: linear-gradient(135deg, var(--tfb-accent), var(--tfb-accent-soft));
	color: #fff !important;
	border-bottom-right-radius: 4px;
}
.tfb-bubble a { color: var(--tfb-accent) !important; -webkit-text-fill-color: var(--tfb-accent) !important; text-decoration: underline !important; font-weight: 600 !important; }
.tfb-msg--user .tfb-bubble a { color: #fff !important; -webkit-text-fill-color: #fff !important; }
.tfb-bubble p { margin: 0 0 8px !important; font-size: 13.5px !important; line-height: 1.6 !important; color: inherit !important; }
.tfb-bubble p:last-child { margin-bottom: 0 !important; }
.tfb-bubble ul, .tfb-bubble ol { margin: 4px 0 8px !important; padding-left: 20px !important; }
.tfb-bubble li { font-size: 13.5px !important; line-height: 1.6 !important; }
.tfb-bubble strong, .tfb-bubble b { font-weight: 700 !important; }

/* CTA link inside a bot bubble */
.tfb-cta {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	margin-top: 10px !important;
	padding: 9px 16px !important;
	border-radius: 10px !important;
	background: linear-gradient(135deg, var(--tfb-accent), var(--tfb-accent-soft)) !important;
	color: #fff !important;
	-webkit-text-fill-color: #fff !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	text-decoration: none !important;
	line-height: 1.2 !important;
}
.tfb-cta:hover { filter: brightness(1.06); color: #fff !important; }

/* Typing indicator */
.tfb-typing { display: flex; align-self: flex-start; }
.tfb-typing .tfb-bubble {
	background: #fff;
	border: 1px solid var(--tfb-border);
	border-bottom-left-radius: 4px;
	display: flex;
	gap: 4px;
}
.tfb-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--tfb-ink-2);
	opacity: 0.4;
	animation: tfbBlink 1.2s infinite ease-in-out;
}
.tfb-typing span:nth-child(2) { animation-delay: .2s; }
.tfb-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes tfbBlink {
	0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

/* ── Suggested questions ───────────────────────────────────── */
.tfb-suggest { display: flex; flex-direction: column; gap: 7px; align-self: stretch; max-width: 100%; }
.tfb-suggest__label {
	font-size: 10px !important;
	font-weight: 700 !important;
	letter-spacing: 0.08em !important;
	text-transform: uppercase !important;
	color: var(--tfb-ink-2) !important;
	margin: 2px 0 1px !important;
}
.tfb-chip {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	text-align: left !important;
	padding: 9px 13px !important;
	border: 1px solid var(--tfb-border) !important;
	border-radius: 12px !important;
	background: #fff !important;
	color: var(--tfb-accent) !important;
	-webkit-text-fill-color: var(--tfb-accent) !important;
	font-size: 12.5px !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
	cursor: pointer;
	white-space: normal !important;
	transition: background .15s ease, border-color .15s ease !important;
}
.tfb-chip:hover { background: var(--tfb-surface) !important; border-color: var(--tfb-accent-soft) !important; color: var(--tfb-accent) !important; }

/* ── Composer ──────────────────────────────────────────────── */
.tfb-form {
	flex-shrink: 0;
	display: flex;
	gap: 8px;
	padding: 12px;
	background: #fff;
	border-top: 1px solid var(--tfb-border);
}
.tfb-input {
	flex: 1 1 auto !important;
	width: auto !important;
	min-width: 0 !important;
	height: 42px !important;
	padding: 0 14px !important;
	border: 1px solid var(--tfb-border) !important;
	border-radius: 12px !important;
	background: var(--tfb-surface) !important;
	color: var(--tfb-ink) !important;
	-webkit-text-fill-color: var(--tfb-ink) !important;
	font-size: 13.5px !important;
	font-weight: 400 !important;
	line-height: 42px !important;
	transition: border-color .15s ease, box-shadow .15s ease !important;
}
.tfb-input::placeholder { color: var(--tfb-ink-2) !important; -webkit-text-fill-color: var(--tfb-ink-2) !important; opacity: 1 !important; font-size: 13.5px !important; }
.tfb-input:focus {
	border-color: var(--tfb-accent-soft) !important;
	box-shadow: 0 0 0 3px rgba(7, 36, 208, 0.12) !important;
	background: #fff !important;
}
.tfb-submit {
	width: 42px !important;
	height: 42px !important;
	flex: 0 0 42px !important;
	border-radius: 12px !important;
	background: linear-gradient(135deg, var(--tfb-accent), var(--tfb-accent-soft)) !important;
	color: #fff !important;
	cursor: pointer;
	display: flex !important;
	align-items: center;
	justify-content: center;
	padding: 0 !important;
	transition: filter .15s ease !important;
}
.tfb-submit:hover { filter: brightness(1.08); color: #fff !important; }
.tfb-submit svg { width: 18px !important; height: 18px !important; display: block; }

.tfb-footnote {
	flex-shrink: 0;
	text-align: center;
	font-size: 10px !important;
	color: var(--tfb-ink-2) !important;
	padding: 0 12px 10px;
	background: #fff;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
.tfb-body::-webkit-scrollbar { width: 6px; }
.tfb-body::-webkit-scrollbar-thumb { background: rgba(27, 21, 55, 0.18); border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
	#tabi-faq-bot .tfb-panel,
	#tabi-faq-bot .tfb-launcher { transition: none !important; }
	.tfb-typing span { animation: none !important; }
	.tfb-body { scroll-behavior: auto; }
}
