:root {
	--paa-parchment: #f4efe4;
	--paa-parchment-dark: #ece4d3;
	--paa-taupe: #8a7f6d;
	--paa-rust: #b5583a;
	--paa-moss: #6b7a5e;
	--paa-ink: #2b2620;
	--paa-white: #fffdf9;
}

#paa-root, .paa-inline-root { all: initial; }
#paa-root *, .paa-inline-root * { box-sizing: border-box; font-family: 'Source Serif 4', Georgia, serif; }

.paa-toggle {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 999999;
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--paa-rust);
	color: var(--paa-white);
	border: none;
	border-radius: 999px;
	padding: 12px 20px 12px 12px;
	box-shadow: 0 6px 20px rgba(43, 38, 32, 0.22);
	cursor: pointer;
	font-size: 14px;
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	font-family: inherit;
}

.paa-toggle .paa-icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	overflow: hidden;
	background-color: var(--paa-white);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 92% 92%;
	flex-shrink: 0;
}
.paa-toggle .paa-icon img,
.paa-toggle .paa-icon svg { display: none; }

.paa-panel {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 999999;
	width: 100%;
	max-width: 380px;
	height: 520px;
	max-height: 70vh;
	background: var(--paa-parchment);
	border-radius: 18px;
	box-shadow: 0 8px 28px rgba(43, 38, 32, 0.18);
	display: none;
	flex-direction: column;
	overflow: hidden;
}
.paa-panel.paa-open { display: flex; }

.paa-inline-root .paa-panel {
	position: static;
	max-width: 480px;
	height: 520px;
	margin: 0 auto;
	display: flex;
}

.paa-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	background: var(--paa-parchment-dark);
	border-bottom: 1px solid rgba(43, 38, 32, 0.08);
}
.paa-header .paa-icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	overflow: hidden;
	background-color: var(--paa-white);
	background-repeat: no-repeat;
	background-position: center;
	background-size: 92% 92%;
	flex-shrink: 0;
}
.paa-header .paa-icon img,
.paa-header .paa-icon svg { display: none; }
.paa-header h3 {
	margin: 0;
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 16px;
	color: var(--paa-ink);
	font-weight: 600;
}
.paa-close {
	margin-left: auto;
	background: none;
	border: none;
	font-size: 20px;
	color: var(--paa-taupe);
	cursor: pointer;
	line-height: 1;
}

.paa-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.paa-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--paa-ink);
	white-space: pre-wrap;
}
.paa-msg.paa-assistant {
	align-self: flex-start;
	background: var(--paa-white);
	border: 1px solid rgba(43, 38, 32, 0.08);
	border-bottom-left-radius: 4px;
}
.paa-msg.paa-user {
	align-self: flex-end;
	background: var(--paa-moss);
	color: var(--paa-white);
	border-bottom-right-radius: 4px;
}
.paa-msg.paa-system {
	align-self: center;
	background: transparent;
	color: var(--paa-taupe);
	font-size: 13px;
	font-style: italic;
}

.paa-typing {
	align-self: flex-start;
	display: flex;
	gap: 4px;
	padding: 10px 14px;
}
.paa-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--paa-taupe);
	opacity: 0.5;
	animation: paa-blink 1.2s infinite;
}
.paa-typing span:nth-child(2) { animation-delay: 0.2s; }
.paa-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes paa-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 0.9; } }

.paa-input-row {
	display: flex;
	gap: 8px;
	padding: 12px 14px;
	border-top: 1px solid rgba(43, 38, 32, 0.08);
	background: var(--paa-white);
}
.paa-input-row textarea {
	flex: 1;
	resize: none;
	border: 1px solid rgba(43, 38, 32, 0.15);
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 14px;
	color: var(--paa-ink);
	max-height: 90px;
	background: var(--paa-parchment);
}
.paa-input-row textarea:focus { outline: none; border-color: var(--paa-rust); }
.paa-send {
	background: var(--paa-rust);
	color: var(--paa-white);
	border: none;
	border-radius: 10px;
	width: 40px;
	flex-shrink: 0;
	cursor: pointer;
}
.paa-send:disabled { opacity: 0.5; cursor: default; }
.paa-send svg { width: 18px; height: 18px; }

@media (max-width: 480px) {
	.paa-panel { right: 12px; left: 12px; bottom: 12px; max-width: none; width: auto; }
	.paa-toggle { right: 12px; bottom: 12px; }
}
