/* Fio Guia — estilos do balão */
.fg-root {
	--fg-cor: #1f3b57;
	--fg-fundo: #ffffff;
	--fg-texto: #1c2430;
	--fg-cinza: #f1f3f6;
	--fg-borda: #e2e6ec;
	--fg-wa: #25d366;
	position: fixed;
	bottom: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--fg-texto);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
}
.fg-root.fg-left  { left: 20px;  align-items: flex-start; }
.fg-root.fg-right { right: 20px; }

.fg-root *, .fg-root *::before, .fg-root *::after { box-sizing: border-box; }

/* botão flutuante */
.fg-launcher {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	padding: 10px 26px 10px 12px;
	border: 0;
	border-radius: 999px;
	background: var(--fg-cor);
	color: #fff;
	font: inherit;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
	transition: transform .15s ease, box-shadow .15s ease;
	text-align: left;
}
.fg-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, .3); }
.fg-launcher:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.fg-logo {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #fff;
	object-fit: contain;
	padding: 6px;
	flex: 0 0 auto;
}
.fg-launcher .fg-logo { width: 52px; height: 52px; padding: 8px; }
.fg-logo-vazio { display: inline-block; }
.fg-launcher-texto { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.fg-launcher-texto strong { font-size: 18px; font-weight: 700; letter-spacing: .1px; }
.fg-launcher-texto span { font-size: 14px; opacity: .9; }

/* painel */
.fg-panel {
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 560px;
	max-height: calc(100vh - 110px);
	background: var(--fg-fundo);
	border-radius: 18px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: fg-surgir .18s ease-out;
}
.fg-panel[hidden] { display: none !important; }
@keyframes fg-surgir { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.fg-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: var(--fg-cor);
	color: #fff;
}
.fg-header .fg-logo { width: 42px; height: 42px; }
.fg-header-texto { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fg-header-texto strong { font-size: 16px; }
.fg-header-texto span { font-size: 12px; opacity: .85; line-height: 1.3; }
.fg-fechar {
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 6px;
	border-radius: 8px;
}
.fg-fechar:hover { background: rgba(255, 255, 255, .15); }
.fg-teste { background: #fff4d6; color: #7a5a00; font-size: 12px; padding: 6px 14px; text-align: center; }

.fg-msgs {
	flex: 1;
	overflow-y: auto;
	padding: 14px 14px 6px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fafbfc;
}
.fg-linha { display: flex; flex-direction: column; max-width: 88%; }
.fg-linha.fg-user { align-self: flex-end; align-items: flex-end; }
.fg-linha.fg-assistant { align-self: flex-start; align-items: flex-start; }
.fg-bolha {
	padding: 10px 13px;
	border-radius: 16px;
	background: var(--fg-cinza);
	color: var(--fg-texto);
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.fg-user .fg-bolha { background: var(--fg-cor); color: #fff; border-bottom-right-radius: 4px; }
.fg-assistant .fg-bolha { border-bottom-left-radius: 4px; }

.fg-wa {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 8px;
	padding: 9px 14px;
	border-radius: 999px;
	background: var(--fg-wa);
	color: #fff !important;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 14px;
	box-shadow: 0 3px 10px rgba(37, 211, 102, .35);
}
.fg-wa:hover { filter: brightness(.95); }

.fg-digitando .fg-bolha { display: flex; gap: 4px; padding: 12px 14px; }
.fg-digitando span {
	width: 7px; height: 7px; border-radius: 50%; background: #9aa5b1;
	animation: fg-pulso 1s infinite ease-in-out;
}
.fg-digitando span:nth-child(2) { animation-delay: .15s; }
.fg-digitando span:nth-child(3) { animation-delay: .3s; }
@keyframes fg-pulso { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.fg-sugestoes { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px 8px; background: #fafbfc; }
.fg-sugestoes:empty { display: none; }
.fg-chip {
	border: 1px solid var(--fg-cor);
	background: #fff;
	color: var(--fg-cor);
	font: inherit;
	font-size: 13px;
	padding: 6px 11px;
	border-radius: 999px;
	cursor: pointer;
}
.fg-chip:hover { background: var(--fg-cor); color: #fff; }
.fg-chip-mais { border-style: dashed; opacity: .85; }
.fg-sug-rotulo { width: 100%; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #7a8591; margin: 2px 2px 0; }

.fg-form {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--fg-borda);
	background: #fff;
	margin: 0;
}
.fg-input {
	flex: 1;
	min-width: 0;
	border: 1px solid var(--fg-borda);
	border-radius: 999px;
	padding: 10px 14px;
	font: inherit;
	font-size: 16px; /* evita zoom automático no iPhone */
	color: var(--fg-texto);
	background: #fff;
	margin: 0;
	height: auto;
}
.fg-input:focus { outline: none; border-color: var(--fg-cor); box-shadow: 0 0 0 3px rgba(31, 59, 87, .12); }
.fg-enviar {
	width: 44px; height: 44px;
	border: 0; border-radius: 50%;
	background: var(--fg-cor); color: #fff;
	cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
	flex: 0 0 auto;
}
.fg-enviar:disabled { opacity: .5; cursor: default; }

/* celular: painel ocupa a tela */
@media (max-width: 480px) {
	.fg-root { bottom: 14px; }
	.fg-root.fg-left  { left: 14px; }
	.fg-root.fg-right { right: 14px; }
	.fg-root.fg-aberto { inset: 0; bottom: 0; left: 0; right: 0; align-items: stretch; gap: 0; }
	.fg-root.fg-aberto .fg-launcher { display: none; }
	.fg-panel {
		width: 100%; max-width: none;
		height: 100%; max-height: none;
		border-radius: 0;
	}
	.fg-launcher-texto span { display: none; }
	.fg-launcher { padding: 8px 20px 8px 8px; gap: 10px; }
	.fg-launcher .fg-logo { width: 46px; height: 46px; }
}
