.dw-chat {
	--dw-navy: var(--wp--preset--color--navy, #0b2e6b);
	--dw-blue: var(--wp--preset--color--blue, #1e5bb8);
	--dw-cyan: var(--wp--preset--color--cyan, #3fb6e0);
	--dw-surface: var(--wp--preset--color--surface, #f1f5fa);
	--dw-line: var(--wp--preset--color--line, #e2e8f0);
	--dw-ink: var(--wp--preset--color--ink, #0f172a);
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--dw-ink);
}

.dw-chat button {
	font: inherit;
	cursor: pointer;
}

.dw-chat__launcher {
	display: grid;
	place-items: center;
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--dw-blue), var(--dw-cyan));
	color: #fff;
	box-shadow: 0 12px 28px -8px rgba(11, 46, 107, 0.55);
	transition: transform 0.15s ease;
}

.dw-chat__launcher:hover {
	transform: scale(1.06);
}

.dw-chat__launcher:focus-visible,
.dw-chat__close:focus-visible,
.dw-chat__send:focus-visible,
.dw-chat__wa:focus-visible,
.dw-chat__formlink:focus-visible {
	outline: 3px solid var(--dw-cyan);
	outline-offset: 2px;
}

.dw-chat__panel {
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 40px);
	height: 540px;
	max-height: calc(100vh - 120px);
	overflow: hidden;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 24px 60px -16px rgba(11, 46, 107, 0.45);
}

.dw-chat__panel[hidden] {
	display: none;
}

.dw-chat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: linear-gradient(135deg, #061a3f, var(--dw-navy) 60%, var(--dw-blue));
	color: #fff;
}

.dw-chat__header p {
	margin: 0;
}

.dw-chat__title {
	font-weight: 800;
	font-size: 16px;
}

.dw-chat__subtitle {
	font-size: 12.5px;
	opacity: 0.8;
}

.dw-chat__close {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #fff;
}

.dw-chat__close:hover {
	background: rgba(255, 255, 255, 0.12);
}

.dw-chat__log {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	overflow-y: auto;
	background: var(--dw-surface);
}

.dw-chat__msg {
	max-width: 85%;
	padding: 9px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.dw-chat__msg--assistant {
	align-self: flex-start;
	border-bottom-left-radius: 4px;
	background: #fff;
	border: 1px solid var(--dw-line);
}

.dw-chat__msg--user {
	align-self: flex-end;
	border-bottom-right-radius: 4px;
	background: var(--dw-blue);
	color: #fff;
}

.dw-chat__msg--error {
	align-self: stretch;
	max-width: none;
	background: #fcebea;
	color: #8a1f1f;
	font-size: 14px;
}

.dw-chat__msg.is-typing::after {
	content: "···";
	display: inline-block;
	letter-spacing: 2px;
	font-weight: 800;
	animation: dw-chat-blink 1.2s infinite;
}

@keyframes dw-chat-blink {
	50% {
		opacity: 0.3;
	}
}

.dw-chat__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--dw-line);
}

.dw-chat__input {
	flex: 1;
	box-sizing: border-box;
	min-height: 40px;
	max-height: 120px;
	padding: 9px 12px;
	border: 1px solid var(--dw-line);
	border-radius: 10px;
	font: inherit;
	color: inherit;
	resize: none;
}

.dw-chat__input:focus {
	outline: 2px solid var(--dw-cyan);
	border-color: transparent;
}

.dw-chat__send {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 10px;
	background: var(--dw-blue);
	color: #fff;
}

.dw-chat__send[disabled] {
	opacity: 0.5;
	cursor: progress;
}

.dw-chat__actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 12px 12px;
	border-top: 1px solid var(--dw-line);
}

.dw-chat__wa {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border-radius: 999px;
	background: #1f9d55;
	color: #fff !important;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
}

.dw-chat__wa:hover {
	background: #17803f;
}

.dw-chat__formlink {
	color: var(--dw-blue);
	font-size: 14px;
	font-weight: 600;
}

@media (max-width: 480px) {
	.dw-chat {
		right: 12px;
		bottom: 12px;
	}

	.dw-chat.is-open .dw-chat__panel {
		position: fixed;
		inset: auto 0 0 0;
		width: 100%;
		max-width: none;
		height: 85vh;
		max-height: none;
		border-radius: 16px 16px 0 0;
	}

	.dw-chat.is-open .dw-chat__launcher {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dw-chat__launcher,
	.dw-chat__msg.is-typing::after {
		transition: none;
		animation: none;
	}
}
