/* Faith Friend AI chat bubble and inline chat. Buttons are reset explicitly because themes style them heavily. */
#ffai-root {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 2147483000;
}
.ffai-scope {
	--ffai-deep: #1e1a30;
	--ffai-purple: #463462;
	--ffai-gold: #f5cd8c;
	--ffai-bot-bg: #f4f1fa;
	--ffai-text: #221d33;
	--ffai-muted: #6b6480;
	text-align: left;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--ffai-text);
}
.ffai-scope *,
.ffai-scope *::before,
.ffai-scope *::after {
	box-sizing: border-box;
}
.ffai-scope button {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	line-height: 1.3;
	min-height: 0;
	width: auto;
	cursor: pointer;
}
.ffai-scope button:focus-visible,
.ffai-scope textarea:focus-visible {
	outline: 2px solid var(--ffai-gold);
	outline-offset: 2px;
}

#ffai-root .ffai-launcher {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(160deg, var(--ffai-purple), var(--ffai-deep));
	color: var(--ffai-gold);
	box-shadow: 0 6px 20px rgba(30, 26, 48, 0.35);
	transition: transform 0.15s ease;
}
#ffai-root .ffai-launcher:hover {
	transform: scale(1.06);
}

.ffai-box {
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
}
#ffai-root .ffai-panel {
	position: absolute;
	right: 0;
	bottom: 76px;
	width: 380px;
	height: min(620px, calc(100vh - 120px));
	box-shadow: 0 12px 40px rgba(30, 26, 48, 0.3);
}
.ffai-inline {
	width: 100%;
	max-width: 760px;
	height: 600px;
	max-height: 85vh;
	margin: 24px auto;
	border: 1px solid #e3ddef;
	box-shadow: 0 6px 24px rgba(30, 26, 48, 0.12);
}
.ffai-scope.ffai-inline .ffai-msg {
	max-width: 80%;
}
#ffai-root .ffai-panel[hidden] {
	display: none;
}

.ffai-scope .ffai-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 12px 12px 14px;
	background: linear-gradient(180deg, var(--ffai-deep), var(--ffai-purple));
	color: #fff;
}
.ffai-scope .ffai-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 2px solid var(--ffai-gold);
	flex: none;
	margin: 0;
}
.ffai-scope .ffai-head-text {
	flex: 1;
	min-width: 0;
}
.ffai-scope .ffai-title {
	font-family: Georgia, "Times New Roman", serif;
	font-weight: 700;
	font-size: 17px;
	color: #fff;
}
.ffai-scope .ffai-sub {
	font-size: 12px;
	color: var(--ffai-gold);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ffai-scope .ffai-icon {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	opacity: 0.85;
}
.ffai-scope .ffai-icon:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.12);
}

.ffai-scope .ffai-msgs {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fbfaff;
	overscroll-behavior: contain;
}
.ffai-scope .ffai-msg {
	max-width: 88%;
	padding: 10px 13px;
	border-radius: 14px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.ffai-scope .ffai-msg p,
.ffai-scope .ffai-msg ul,
.ffai-scope .ffai-msg ol,
.ffai-scope .ffai-msg h4,
.ffai-scope .ffai-msg blockquote {
	margin: 0 0 8px;
	padding: 0;
	font-size: 15px;
	line-height: 1.5;
	color: inherit;
}
/* The theme forces paragraph color and line height with !important inside posts. */
.ffai-scope .ffai-msg p,
.ffai-scope .ffai-msg li {
	color: inherit !important;
	line-height: 1.5 !important;
}
/* Keep Google auto-ads keyword links out of the chat. */
.ffai-scope .google-anno-sc {
	display: none !important;
}
.ffai-scope .ffai-msg > :last-child {
	margin-bottom: 0;
}
.ffai-scope .ffai-msg ul,
.ffai-scope .ffai-msg ol {
	padding-left: 20px;
}
.ffai-scope .ffai-msg li {
	margin: 0 0 4px;
}
.ffai-scope .ffai-msg h4 {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 16px;
	font-weight: 700;
}
.ffai-scope .ffai-msg blockquote {
	border-left: 3px solid var(--ffai-gold);
	padding-left: 10px;
	font-style: italic;
}
.ffai-scope .ffai-assistant {
	align-self: flex-start;
	background: var(--ffai-bot-bg);
	border-bottom-left-radius: 4px;
}
.ffai-scope .ffai-assistant a {
	color: var(--ffai-purple);
	font-weight: 600;
	text-decoration: underline;
}
.ffai-scope .ffai-user {
	align-self: flex-end;
	background: var(--ffai-purple);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.ffai-scope .ffai-error {
	align-self: center;
	background: #fff4e5;
	color: #7a4b00;
	font-size: 14px;
}

.ffai-scope .ffai-typing {
	display: flex;
	gap: 4px;
	padding: 14px 16px;
}
.ffai-scope .ffai-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ffai-muted);
	animation: ffai-dot 1.2s infinite ease-in-out;
}
.ffai-scope .ffai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ffai-scope .ffai-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ffai-dot {
	0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

.ffai-scope .ffai-suggest {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	margin-top: 4px;
}
.ffai-scope .ffai-suggest button {
	padding: 7px 12px;
	border: 1px solid var(--ffai-purple);
	border-radius: 18px;
	background: #fff;
	color: var(--ffai-purple);
	font-size: 14px;
	text-align: right;
}
.ffai-scope .ffai-suggest button:hover {
	background: var(--ffai-purple);
	color: #fff;
}

.ffai-scope .ffai-form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin: 0;
	padding: 10px 12px;
	border-top: 1px solid #ebe7f3;
	background: #fff;
}
.ffai-scope .ffai-form textarea {
	flex: 1;
	resize: none;
	margin: 0;
	padding: 9px 12px;
	min-height: 40px;
	max-height: 120px;
	border: 1px solid #d9d3e6;
	border-radius: 20px;
	background: #fff;
	color: var(--ffai-text);
	font: inherit;
	font-size: 16px; /* 16px stops iPhone from zooming in */
	border: 1px solid #d9d3e6 !important; /* The theme styles every textarea with !important. */
	border-radius: 20px !important;
	padding: 9px 12px !important;
	background: #fff !important;
	line-height: 1.35;
	box-shadow: none;
}
.ffai-scope .ffai-send {
	width: 40px;
	height: 40px;
	flex: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ffai-purple);
	color: var(--ffai-gold);
}
.ffai-scope .ffai-send:disabled {
	opacity: 0.5;
	cursor: default;
}
.ffai-scope .ffai-foot {
	padding: 0 12px 8px;
	background: #fff;
	text-align: center;
	font-size: 11px;
	color: var(--ffai-muted);
}

@media (max-width: 599px) {
	#ffai-root {
		right: 16px;
		bottom: 16px;
	}
	#ffai-root .ffai-panel {
		position: fixed;
		inset: 0;
		width: auto;
		height: 100%;
		height: 100dvh;
		border-radius: 0;
	}
	#ffai-root.ffai-is-open .ffai-launcher {
		display: none;
	}
}
