#aaw-root {
	--aaw-accent: #1f3a5f;
	--aaw-bg: #ffffff;
	--aaw-soft: #f2f4f7;
	--aaw-text: #1d2430;
	--aaw-muted: #5f6b7a;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 2147483000;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	color: var(--aaw-text);
}
#aaw-root *, #aaw-root *::before, #aaw-root *::after { box-sizing: border-box; }
#aaw-root [hidden] { display: none !important; }

.aaw-launcher {
	height: 56px; border-radius: 28px; border: 0; cursor: pointer;
	padding: 4px 18px 4px 4px; gap: 10px;
	background: var(--aaw-accent); color: var(--aaw-accent);
	display: flex; align-items: center;
	box-shadow: 0 6px 20px rgba(0,0,0,.22);
	font: inherit;
}
.aaw-launcher .aaw-face { width: 48px; height: 48px; flex: none; }
.aaw-launcher-label { color: #fff; font-weight: 600; font-size: 15px; white-space: nowrap; }
.aaw-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.aaw-avatar { display: inline-flex; color: var(--aaw-accent); flex: none; }
.aaw-avatar .aaw-face { width: 40px; height: 40px; }
.aaw-launcher:focus-visible, #aaw-root button:focus-visible, #aaw-root textarea:focus-visible, #aaw-root input:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--aaw-accent) 45%, transparent); outline-offset: 2px;
}

.aaw-panel {
	width: 370px; height: 560px; max-height: calc(100vh - 40px);
	background: var(--aaw-bg); border-radius: 14px; overflow: hidden;
	display: flex; flex-direction: column;
	box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.aaw-head {
	background: var(--aaw-accent); color: #fff; padding: 14px 16px;
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.aaw-title { font-weight: 600; font-size: 16px; }
.aaw-sub { font-size: 12px; opacity: .85; }
.aaw-close { background: none; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.aaw-tools { display: flex; align-items: center; gap: 6px; }
.aaw-voice {
	background: rgba(255,255,255,.15); border: 0; border-radius: 8px; cursor: pointer;
	font-size: 18px; line-height: 1; padding: 6px 8px; color: #fff;
}
.aaw-voice[aria-pressed="true"] { background: rgba(255,255,255,.32); }

.aaw-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.aaw-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.aaw-msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; word-wrap: break-word; }
.aaw-assistant { background: var(--aaw-soft); align-self: flex-start; border-bottom-left-radius: 4px; }
.aaw-user { background: var(--aaw-accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.aaw-error { background: #fdecec; color: #8a1c1c; align-self: flex-start; font-size: 14px; }
.aaw-typing { color: var(--aaw-muted); font-style: italic; }

.aaw-link {
	background: none; border: 0; color: var(--aaw-accent); cursor: pointer;
	font-size: 14px; text-decoration: underline; padding: 6px 14px; align-self: flex-start;
}
.aaw-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #e3e7ec; }
.aaw-form textarea {
	flex: 1; resize: none; border: 1px solid #cfd6de; border-radius: 10px;
	padding: 8px 10px; font: inherit; color: inherit; background: #fff;
}
.aaw-send, .aaw-btn {
	background: var(--aaw-accent); color: #fff; border: 0; border-radius: 10px;
	padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer;
}
.aaw-send:disabled, .aaw-btn:disabled { opacity: .5; cursor: default; }

.aaw-consent, .aaw-handoff { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.aaw-consent p, .aaw-handoff p { margin: 0; }
.aaw-check { font-size: 14px; display: block; }
.aaw-check a { color: var(--aaw-accent); }
.aaw-field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.aaw-field input, .aaw-field textarea {
	border: 1px solid #cfd6de; border-radius: 8px; padding: 8px 10px; font: inherit; color: inherit; background: #fff;
}
.aaw-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.aaw-row .aaw-link { padding: 6px 0; }
.aaw-status { font-size: 14px; color: var(--aaw-muted); }

@media (max-width: 480px) {
	#aaw-root { right: 14px; bottom: 14px; }
	.aaw-launcher { height: 50px; padding: 3px 14px 3px 3px; }
	.aaw-launcher .aaw-face { width: 44px; height: 44px; }
	.aaw-launcher-label { font-size: 14px; }
	.aaw-panel {
		position: fixed; inset: 0; width: 100%; height: 100%; max-height: none; border-radius: 0;
	}
}
@media print { #aaw-root { display: none; } }

/* Mientras el chat está abierto, oculta botones flotantes de otros plugins (p. ej. WhatsApp). */
html.aaw-open .qlwapp,
html.aaw-open [class*="qlwapp__container"],
html.aaw-open .joinchat,
html.aaw-open #wa-widget { display: none !important; }
