.rpa-assistant-root {
	--rpa-primary: #0a3161;
	--rpa-secondary: #d9e9ff;
	--rpa-text: #15314f;
	--rpa-border: #c7d6eb;
	--rpa-surface: #ffffff;
	--rpa-muted: #5f7c9f;
	font-family: Arial, Helvetica, sans-serif;
}

/* box-sizing defensivo: evita estouro de largura em temas que estilizam inputs */
.rpa-assistant-root,
.rpa-assistant-root *,
.rpa-assistant-root *::before,
.rpa-assistant-root *::after {
	box-sizing: border-box;
}

.rpa-assistant-root.position-bottom-right,
.rpa-assistant-root.position-bottom-left {
	position: fixed;
	bottom: 24px;
	z-index: 99999;
}

.rpa-assistant-root.position-bottom-right {
	right: 24px;
}

.rpa-assistant-root.position-bottom-left {
	left: 24px;
}

.rpa-assistant-root.is-inline {
	position: relative;
	display: block;
	width: 100%;
	max-width: 440px;
}

.rpa-widget-toggle {
	border: 0;
	background: var(--rpa-primary);
	color: #fff;
	padding: 14px 18px;
	border-radius: 999px;
	box-shadow: 0 10px 24px rgba(10, 49, 97, 0.18);
	cursor: pointer;
	font-weight: 700;
}

.rpa-widget-panel {
	width: 380px;
	max-width: calc(100vw - 24px);
	background: var(--rpa-surface);
	border: 1px solid var(--rpa-border);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 20px 50px rgba(10, 49, 97, 0.22);
	display: none;
	flex-direction: column;
}

.rpa-assistant-root.is-inline .rpa-widget-panel {
	display: flex;
	width: 100%;
	max-width: 100%;
	box-shadow: none;
	border-radius: 16px;
}

.rpa-assistant-root.is-open .rpa-widget-panel {
	display: flex;
}

.rpa-widget-header {
	background: var(--rpa-primary);
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.rpa-widget-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0;
}

.rpa-widget-close {
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
}

.rpa-header-actions {
	display: flex;
	align-items: center;
	gap: 6px;
}

.rpa-lang-btn {
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	font-size: 17px;
	line-height: 1;
	opacity: 0.9;
}

.rpa-lang-btn:hover { opacity: 1; }

.rpa-widget-panel {
	max-height: min(78vh, 640px);
}

/* Painel ancorado abaixo do menu (aberto por clique no menu) */
.rpa-assistant-root.is-anchored {
	z-index: 100000;
}

.rpa-assistant-root.is-anchored .rpa-widget-toggle {
	display: none;
}

.rpa-assistant-root.is-anchored .rpa-widget-panel {
	box-shadow: 0 16px 44px rgba(10, 49, 97, 0.28);
}

.rpa-widget-subtitle {
	font-size: 12px;
	opacity: 0.85;
	margin-top: 2px;
}

.rpa-widget-titles {
	display: flex;
	flex-direction: column;
}

.rpa-toggle-icon {
	margin-right: 6px;
}

.rpa-widget-body {
	padding: 0;
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1;
	background: linear-gradient(180deg, #f9fbff 0%, #ffffff 55%);
}

/* ---------------- Chat view ---------------- */

.rpa-chat,
.rpa-lead {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1;
}

.rpa-lead {
	padding: 16px;
	gap: 12px;
	overflow-y: auto;
}

.rpa-messages {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* Barra de rolagem discreta e visível (mensagens e chips) */
.rpa-messages::-webkit-scrollbar,
.rpa-quick::-webkit-scrollbar { width: 8px; }
.rpa-messages::-webkit-scrollbar-thumb,
.rpa-quick::-webkit-scrollbar-thumb { background: #c2d3ea; border-radius: 8px; }
.rpa-messages, .rpa-quick { scrollbar-width: thin; scrollbar-color: #c2d3ea transparent; }

.rpa-msg {
	display: flex;
}

.rpa-msg-user {
	justify-content: flex-end;
}

.rpa-bubble {
	max-width: 85%;
	font-size: 14px;
	line-height: 1.55;
	padding: 10px 13px;
	border-radius: 14px;
	color: var(--rpa-text);
}

.rpa-msg-bot .rpa-bubble {
	background: var(--rpa-secondary);
	border: 1px solid var(--rpa-border);
	border-bottom-left-radius: 4px;
}

.rpa-msg-user .rpa-bubble {
	background: var(--rpa-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.rpa-answer-text {
	white-space: pre-line;
}

/* Typing indicator */
.rpa-typing .rpa-bubble {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}

.rpa-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--rpa-muted);
	animation: rpa-blink 1.2s infinite ease-in-out;
}

.rpa-dot:nth-child(2) { animation-delay: 0.2s; }
.rpa-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes rpa-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

/* Suggestion / product cards */
.rpa-cards {
	margin-top: 10px;
	display: grid;
	gap: 8px;
}

.rpa-cards-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--rpa-muted);
}

.rpa-card-item {
	background: #fff;
	border: 1px solid var(--rpa-border);
	border-radius: 12px;
	padding: 10px 12px;
}

.rpa-card-title {
	font-weight: 700;
	font-size: 13px;
	color: var(--rpa-text);
}

.rpa-card-snippet {
	font-size: 12px;
	color: var(--rpa-muted);
	margin: 4px 0 8px;
}

.rpa-card-link {
	display: inline-block;
	font-size: 13px;
	font-weight: 700;
	color: var(--rpa-primary);
	text-decoration: none;
}

.rpa-card-link:hover { text-decoration: underline; }

.rpa-product-img {
	width: 100%;
	max-height: 120px;
	object-fit: cover;
	border-radius: 8px;
	margin-bottom: 6px;
}

.rpa-product-price {
	font-weight: 700;
	color: var(--rpa-primary);
	font-size: 13px;
	margin-bottom: 4px;
}

/* Quick reply chips */
.rpa-quick {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 16px;
	max-height: 128px;
	overflow-y: auto;
	border-top: 1px solid var(--rpa-border);
	background: #fbfdff;
}

.rpa-quick:empty { display: none; }

.rpa-chip {
	border: 1px solid var(--rpa-border);
	background: #fff;
	color: var(--rpa-primary);
	border-radius: 999px;
	padding: 8px 13px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.rpa-chip:hover { background: var(--rpa-secondary); }

.rpa-chip-primary {
	background: var(--rpa-primary);
	color: #fff;
	border-color: var(--rpa-primary);
}

/* Composer */
.rpa-composer {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px;
	border-top: 1px solid var(--rpa-border);
	background: #fff;
}

.rpa-icon-btn {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--rpa-border);
	background: #fff;
	color: var(--rpa-muted);
	border-radius: 10px;
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}

.rpa-icon-btn:hover {
	background: var(--rpa-secondary);
	color: var(--rpa-primary);
	border-color: var(--rpa-primary);
}

.rpa-icon-btn svg { display: block; }

.rpa-ask {
	flex: 1 1 auto;
	min-width: 0;
	height: 40px;
	max-height: 120px;
	resize: none;
	overflow-y: auto;
	border: 1px solid var(--rpa-border);
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 14px;
	line-height: 20px;
	color: var(--rpa-text);
	background: #fff;
	font-family: inherit;
}

.rpa-ask::placeholder {
	color: #7aa2ce;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}

.rpa-ask:focus,
.rpa-icon-btn:focus-visible,
.rpa-send:focus-visible {
	outline: 2px solid var(--rpa-secondary);
	outline-offset: 1px;
}

.rpa-send {
	flex: 0 0 auto;
	height: 40px;
	padding: 0 14px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 0;
	background: var(--rpa-primary);
	color: #fff;
	border-radius: 10px;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	transition: background .15s;
}

.rpa-send:hover { background: #0c3e7d; }
.rpa-send svg { display: block; }

/* Project capture card (image + contact) */
.rpa-bubble.rpa-capture {
	max-width: 100%;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #fff;
	border: 1px solid var(--rpa-border);
}

.rpa-capture-title {
	font-weight: 700;
	font-size: 14px;
	color: var(--rpa-text);
}

.rpa-capture-hint {
	font-size: 12px;
	color: var(--rpa-muted);
}

.rpa-capture .rpa-textarea {
	min-height: 60px;
}

.rpa-cap-thumb {
	display: block;
	max-width: 100%;
	max-height: 140px;
	border-radius: 10px;
	margin-bottom: 4px;
}

.rpa-cap-filename {
	font-size: 12px;
	color: var(--rpa-muted);
}

.rpa-cap-lab {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: var(--rpa-text);
	margin-top: 2px;
}

/* Linha de confiança e mensagem sazonal */
.rpa-trust {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px dashed var(--rpa-border);
	font-size: 11.5px;
	color: var(--rpa-muted);
	line-height: 1.4;
}

.rpa-seasonal {
	font-weight: 700;
	font-size: 13.5px;
}

.rpa-msg-bot .rpa-bubble .rpa-seasonal {
	color: var(--rpa-primary);
}

/* Chips de acompanhamento (follow-ups) */
.rpa-followups {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* Handoff (ligar / WhatsApp) */
.rpa-handoff {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rpa-handoff .rpa-button {
	text-decoration: none;
	text-align: center;
}

/* Convite proativo (nudge) */
.rpa-nudge {
	position: absolute;
	bottom: 76px;
	right: 0;
	max-width: 280px;
	background: #fff;
	border: 1px solid var(--rpa-border);
	border-radius: 14px 14px 4px 14px;
	box-shadow: 0 14px 34px rgba(10,49,97,.22);
	padding: 14px 34px 14px 14px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--rpa-text);
	cursor: pointer;
	animation: rpa-pop .28s ease;
}

.rpa-assistant-root.position-bottom-left .rpa-nudge {
	right: auto;
	left: 0;
	border-radius: 14px 14px 14px 4px;
}

.rpa-nudge-x {
	position: absolute;
	top: 6px;
	right: 8px;
	border: 0;
	background: transparent;
	font-size: 18px;
	line-height: 1;
	color: var(--rpa-muted);
	cursor: pointer;
}

@keyframes rpa-pop {
	from { opacity: 0; transform: translateY(8px) scale(.98); }
	to { opacity: 1; transform: none; }
}

.rpa-lead-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.rpa-back {
	border: 0;
	background: transparent;
	color: var(--rpa-primary);
	font-weight: 700;
	cursor: pointer;
	font-size: 13px;
	padding: 0;
}

.rpa-msg-bot .rpa-button {
	margin-top: 2px;
}

.rpa-message {
	font-size: 14px;
	line-height: 1.6;
	color: var(--rpa-text);
	padding: 12px 14px;
	background: var(--rpa-secondary);
	border-radius: 14px;
	border: 1px solid var(--rpa-border);
}

.rpa-progress {
	font-size: 12px;
	color: var(--rpa-muted);
}

.rpa-field {
	display: grid;
	gap: 8px;
}

.rpa-field label {
	font-size: 13px;
	font-weight: 700;
	color: var(--rpa-text);
}

.rpa-input,
.rpa-textarea,
.rpa-select {
	width: 100%;
	border: 1px solid var(--rpa-border);
	border-radius: 12px;
	padding: 12px 13px;
	font-size: 14px;
	color: var(--rpa-text);
	background: #fff;
}

.rpa-input::placeholder,
.rpa-textarea::placeholder {
	color: #7aa2ce;
}

.rpa-textarea {
	min-height: 110px;
	resize: vertical;
}

.rpa-options {
	display: grid;
	gap: 8px;
}

.rpa-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid var(--rpa-border);
	border-radius: 12px;
	background: #fff;
	font-size: 14px;
	color: var(--rpa-text);
}

.rpa-meta-note {
	font-size: 12px;
	color: var(--rpa-muted);
}

.rpa-voice-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rpa-voice-button {
	padding: 10px 12px;
	font-size: 13px;
}

.rpa-actions {
	display: flex;
	justify-content: space-between;
	gap: 10px;
}

.rpa-button {
	border: 1px solid var(--rpa-primary);
	border-radius: 12px;
	padding: 12px 14px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.rpa-button-primary {
	background: var(--rpa-primary);
	color: #fff;
	flex: 1;
}

.rpa-button-secondary {
	background: #fff;
	color: var(--rpa-primary);
}

.rpa-upload {
	display: grid;
	gap: 8px;
	border: 1px dashed var(--rpa-primary);
	border-radius: 14px;
	padding: 12px;
	background: #f8fbff;
}

.rpa-summary {
	font-size: 13px;
	line-height: 1.6;
	background: #fff;
	border: 1px solid var(--rpa-border);
	border-radius: 14px;
	padding: 12px;
}

.rpa-success {
	display: grid;
	gap: 12px;
}

.rpa-error {
	color: #a52828;
	font-size: 13px;
}

/* ---------------- Tablet ---------------- */
@media (min-width: 641px) and (max-width: 1024px) {
	.rpa-widget-panel {
		width: 400px;
	}

	.rpa-messages {
		min-height: 260px;
	}
}

/* ---------------- Celular ---------------- */
@media (max-width: 640px) {
	.rpa-assistant-root.position-bottom-right,
	.rpa-assistant-root.position-bottom-left {
		left: 10px;
		right: 10px;
		bottom: 10px;
	}

	/* Painel ocupa quase a tela toda no celular, respeitando a safe area */
	.rpa-widget-panel {
		width: auto;
		max-width: none;
		max-height: 82vh;
		max-height: 82dvh;
	}

	.rpa-messages {
		min-height: 0;
		padding: 14px;
	}

	.rpa-quick {
		max-height: 108px;
	}

	/* Impede o zoom automático do iOS ao focar campos (fonte >= 16px) */
	.rpa-ask,
	.rpa-input,
	.rpa-textarea,
	.rpa-select,
	.rpa-cap-contact,
	.rpa-cap-note {
		font-size: 16px;
	}

	/* Área de digitação acomoda o notch/barra inferior */
	.rpa-composer {
		padding-bottom: calc(10px + env(safe-area-inset-bottom));
	}

	/* Compositor compacto no celular, mantendo alvos de toque confortáveis */
	.rpa-composer {
		gap: 6px;
		padding: 8px;
	}

	.rpa-icon-btn {
		width: 42px;
		height: 42px;
	}

	.rpa-ask {
		height: 42px;
	}

	.rpa-send {
		height: 42px;
		padding: 0 13px;
	}

	/* Chip de idioma/atalhos com alvo de toque confortável */
	.rpa-chip {
		padding: 9px 14px;
	}

	.rpa-widget-toggle {
		padding: 12px 16px;
	}
}

/* Telas muito estreitas (≈360px): compositor vira só ícones, sem estourar */
@media (max-width: 380px) {
	.rpa-toggle-text {
		display: none;
	}

	.rpa-send-label {
		display: none;
	}

	.rpa-send {
		width: 42px;
		padding: 0;
		justify-content: center;
	}
}

/* Ocultar o anexo de foto no chat (solicitado). Reversível: remova este bloco. */
.rpa-attach{display:none !important}
