.asw-root {
	--asw-color: #0e7c86;
	--asw-bg: #ffffff;
	--asw-soft: #f3f6f8;
	--asw-text: #1d2733;
	--asw-muted: #6b7785;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--asw-text);
	box-sizing: border-box;
}
.asw-root *, .asw-root *::before, .asw-root *::after { box-sizing: inherit; }

/* Panel */
.asw-panel {
	display: flex;
	flex-direction: column;
	background: var(--asw-bg);
	border: 1px solid #e3e8ed;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 10px 40px rgba(16, 30, 54, .14);
	height: 100%;
}
.asw-root[data-mode="inline"] { max-width: 760px; margin: 1.5em auto; }

.asw-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 14px;
	background: var(--asw-color);
	color: #fff;
}
.asw-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.asw-avatar {
	width: 32px; height: 32px; border-radius: 50%;
	background: rgba(255,255,255,.2);
	display: inline-flex; align-items: center; justify-content: center; font-size: 17px;
}
.asw-actions { display: flex; gap: 4px; }
.asw-icon {
	background: transparent; border: 0; color: #fff; cursor: pointer;
	width: 32px; height: 32px; border-radius: 8px; font-size: 17px; line-height: 1; padding: 0;
}
.asw-icon:hover, .asw-icon:focus-visible { background: rgba(255,255,255,.18); outline: none; }

.asw-log {
	flex: 1; overflow-y: auto; padding: 16px 14px;
	display: flex; flex-direction: column; gap: 10px;
	background: var(--asw-soft);
}
.asw-msg {
	max-width: 86%; padding: 10px 13px; border-radius: 14px;
	word-wrap: break-word; overflow-wrap: anywhere;
}
.asw-msg p { margin: 0 0 .5em; }
.asw-msg p:last-child { margin-bottom: 0; }
.asw-msg ul, .asw-msg ol { margin: .3em 0 .6em; padding-left: 1.3em; }
.asw-msg li { margin: .15em 0; }
.asw-msg .asw-h { font-weight: 700; margin-top: .4em; }
.asw-msg a { color: var(--asw-color); text-decoration: underline; }
.asw-user {
	align-self: flex-end; background: var(--asw-color); color: #fff;
	border-bottom-right-radius: 4px; white-space: pre-wrap;
}
.asw-assistant {
	align-self: flex-start; background: #fff; border: 1px solid #e3e8ed;
	border-bottom-left-radius: 4px;
}
.asw-error { border-color: #f1c0c0; background: #fff6f6; }

.asw-typing { display: inline-flex; gap: 5px; padding: 13px 15px; }
.asw-typing span {
	width: 7px; height: 7px; border-radius: 50%; background: var(--asw-muted);
	animation: asw-bounce 1.2s infinite ease-in-out;
}
.asw-typing span:nth-child(2) { animation-delay: .15s; }
.asw-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes asw-bounce { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.asw-chips {
	display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0;
	background: var(--asw-soft);
}
.asw-chip {
	border: 1px solid var(--asw-color); color: var(--asw-color); background: #fff;
	border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; line-height: 1.3;
	font-family: inherit;
}
.asw-chip:hover, .asw-chip:focus-visible { background: var(--asw-color); color: #fff; outline: none; }

.asw-form {
	display: flex; align-items: flex-end; gap: 8px;
	padding: 10px 12px; background: var(--asw-soft); border-top: 1px solid #e3e8ed;
}
.asw-input {
	flex: 1; resize: none; border: 1px solid #d5dce3; border-radius: 12px;
	padding: 10px 12px; font: inherit; color: inherit; background: #fff;
	max-height: 120px; min-height: 42px; margin: 0;
}
.asw-input:focus { outline: none; border-color: var(--asw-color); box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
.asw-send {
	width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; border: 0;
	background: var(--asw-color); color: #fff; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.asw-send:disabled { opacity: .5; cursor: default; }

.asw-foot {
	font-size: 11px; color: var(--asw-muted); text-align: center;
	padding: 0 12px 8px; background: var(--asw-soft);
}

/* Modo flotante */
.asw-root[data-mode="floating"] {
	position: fixed; right: 20px; bottom: 20px; z-index: 99999;
}
.asw-launcher {
	width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--asw-color); color: #fff; font-size: 26px;
	box-shadow: 0 6px 24px rgba(16,30,54,.25);
	display: flex; align-items: center; justify-content: center; padding: 0;
	transition: transform .15s ease;
}
.asw-launcher:hover { transform: scale(1.06); }
.asw-root[data-mode="floating"] .asw-panel {
	position: absolute; right: 0; bottom: 76px;
	width: 380px; height: min(600px, calc(100vh - 120px));
	opacity: 0; transform: translateY(12px) scale(.98); pointer-events: none;
	visibility: hidden;
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.asw-root.asw-open .asw-panel {
	opacity: 1; transform: none; pointer-events: auto; visibility: visible;
}

@media (max-width: 480px) {
	.asw-root[data-mode="floating"] { right: 14px; bottom: 14px; }
	.asw-root[data-mode="floating"] .asw-panel {
		position: fixed; inset: 0; width: 100%; height: 100%;
		border-radius: 0; bottom: 0;
	}
	.asw-root.asw-open .asw-launcher { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.asw-root * { animation: none !important; transition: none !important; }
}
