/* WebAwesome Chat - uses the WebAwesome logo palette. */
.wa-chat {
	--wa-royal-violet: #3b1a88;
	--wa-midnight: #0b1642;
	--wa-electric-violet: #8e4dff;
	--wa-mist: #f6f4ff;
	--wa-muted: #5b5680;
	--wa-lilac-line: #e3ddf6;
	--wa-white: #ffffff;
	--wa-beam: linear-gradient(135deg, #00d9ff 0%, #8e4dff 45%, #ff4da6 100%);
	font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	color: var(--wa-midnight);
	box-sizing: border-box;
}
.wa-chat *, .wa-chat *::before, .wa-chat *::after { box-sizing: inherit; }

.wa-chat__panel {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 720px;
	height: var(--wa-chat-h, 520px);
	max-height: 90vh;
	margin: 0 auto;
	background: var(--wa-mist);
	border: 1px solid var(--wa-lilac-line);
	border-radius: 14px;
	overflow: hidden;
}
.wa-chat__panel[hidden] { display: none; }

.wa-chat__beam { height: 3px; background: var(--wa-beam); flex: none; }

.wa-chat__head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background: var(--wa-white);
	border-bottom: 1px solid var(--wa-lilac-line);
	flex: none;
}
.wa-chat__title {
	font-family: "Space Grotesk", Inter, system-ui, sans-serif;
	font-weight: 600;
	font-size: 1.05rem;
	letter-spacing: -0.01em;
	color: var(--wa-midnight);
	margin-right: auto;
}
.wa-chat__badge {
	font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
	font-size: 0.7rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wa-royal-violet);
	border: 1px solid var(--wa-lilac-line);
	background: var(--wa-mist);
	padding: 3px 8px;
	border-radius: 999px;
}
.wa-chat__close {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--wa-midnight);
	font-size: 1.6rem;
	line-height: 1;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	cursor: pointer;
}
.wa-chat__close:hover { background: var(--wa-mist); }

.wa-chat__log {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.wa-chat__row { display: flex; }
.wa-chat__row--user { justify-content: flex-end; }
.wa-chat__bubble {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 0.97rem;
	line-height: 1.55;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.wa-chat__row--assistant .wa-chat__bubble {
	background: var(--wa-white);
	color: var(--wa-midnight);
	border: 1px solid var(--wa-lilac-line);
	border-bottom-left-radius: 4px;
}
.wa-chat__row--user .wa-chat__bubble {
	background: var(--wa-royal-violet);
	color: var(--wa-white);
	border-bottom-right-radius: 4px;
}
.wa-chat__bubble--error { border-color: #d9a4b8 !important; }
.wa-chat__link { color: var(--wa-royal-violet); text-decoration: underline; }
.wa-chat__row--user .wa-chat__link { color: var(--wa-white); }
.wa-chat__link:hover { color: var(--wa-midnight); }
.wa-chat__row--user .wa-chat__link:hover { color: var(--wa-white); opacity: 0.85; }

.wa-chat__typing { display: inline-flex; gap: 5px; align-items: center; padding: 14px; }
.wa-chat__typing span {
	width: 7px; height: 7px; border-radius: 50%;
	background: var(--wa-muted);
	animation: wa-chat-bounce 1.2s infinite ease-in-out;
}
.wa-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
.wa-chat__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes wa-chat-bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wa-chat__typing span { animation: none; } }

.wa-chat__notice {
	margin: 0;
	padding: 6px 16px;
	font-size: 0.78rem;
	line-height: 1.4;
	color: var(--wa-muted);
	flex: none;
}

.wa-chat__form {
	display: flex;
	gap: 8px;
	align-items: flex-end;
	padding: 10px 12px 12px;
	background: var(--wa-white);
	border-top: 1px solid var(--wa-lilac-line);
	flex: none;
	margin: 0;
}
.wa-chat__input {
	flex: 1 1 auto;
	resize: none;
	min-height: 44px;
	max-height: 120px;
	padding: 10px 12px;
	font: inherit;
	font-size: 1rem;
	color: var(--wa-midnight);
	background: var(--wa-white);
	border: 1px solid var(--wa-lilac-line);
	border-radius: 10px;
}
.wa-chat__input::placeholder { color: var(--wa-muted); }
.wa-chat__input:focus, .wa-chat__send:focus-visible, .wa-chat__fab:focus-visible, .wa-chat__close:focus-visible {
	outline: 2px solid var(--wa-electric-violet);
	outline-offset: 2px;
}
.wa-chat__send {
	appearance: none;
	border: 0;
	min-height: 44px;
	padding: 0 18px;
	font: inherit;
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--wa-white);
	background: var(--wa-royal-violet);
	border-radius: 10px;
	cursor: pointer;
}
.wa-chat__send:hover { background: var(--wa-midnight); }
.wa-chat__send:disabled, .wa-chat__input:disabled { opacity: 0.6; cursor: not-allowed; }

.wa-chat__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.wa-chat__sr {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Floating button mode */
.wa-chat--bubble {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 99999;
	width: auto;
}
.wa-chat--bubble .wa-chat__panel {
	width: min(380px, calc(100vw - 32px));
	height: min(var(--wa-chat-h, 520px), calc(100vh - 100px));
	box-shadow: 0 10px 30px rgba(11, 22, 66, 0.18);
}
.wa-chat__fab {
	appearance: none;
	border: 0;
	min-height: 48px;
	padding: 0 22px;
	font: inherit;
	font-weight: 600;
	font-size: 0.97rem;
	color: var(--wa-white);
	background: var(--wa-royal-violet);
	border-radius: 999px;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(11, 22, 66, 0.25);
}
.wa-chat__fab:hover { background: var(--wa-midnight); }

@media (max-width: 480px) {
	.wa-chat__bubble { max-width: 92%; }
	.wa-chat--bubble { right: 8px; bottom: 8px; }
}
