/* PolyApps AI Assistant - widget styles. Everything is scoped under #paa-root. */
#paa-root {
	--paa-accent: #2563eb;
	--paa-ink: #0f172a;
	--paa-muted: #64748b;
	--paa-line: #e2e8f0;
	--paa-bg: #ffffff;
	--paa-soft: #f1f5f9;
	position: fixed;
	bottom: 20px;
	z-index: 999990;
	font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--paa-ink);
}
#paa-root.paa-right { right: 20px; }
#paa-root.paa-left { left: 20px; }
/* Sit above Hostinger's admin-only "Ask AI" pill if it is on the page. */
#paa-root.paa-lift { bottom: 84px; }

#paa-root *, #paa-root *::before, #paa-root *::after { box-sizing: border-box; }
#paa-root button, #paa-root textarea { font: inherit; color: inherit; margin: 0; }

#paa-root .paa-launch {
	display: flex; align-items: center; gap: 8px;
	background: var(--paa-accent); color: #fff; border: 0; border-radius: 999px;
	padding: 13px 20px; cursor: pointer; font-weight: 600;
	box-shadow: 0 8px 24px rgba(15, 23, 42, .28);
	transition: transform .15s ease, box-shadow .15s ease;
}
#paa-root .paa-launch:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(15, 23, 42, .32); }
#paa-root .paa-launch svg { width: 20px; height: 20px; fill: currentColor; }
#paa-root .paa-launch:focus-visible, #paa-root button:focus-visible, #paa-root textarea:focus-visible {
	outline: 3px solid rgba(37, 99, 235, .55); outline-offset: 2px;
}

#paa-root .paa-panel {
	display: none; flex-direction: column;
	width: 380px; max-width: calc(100vw - 32px);
	height: 560px; max-height: calc(100vh - 110px);
	background: var(--paa-bg); border-radius: 16px; overflow: hidden;
	border: 1px solid var(--paa-line);
	box-shadow: 0 20px 50px rgba(15, 23, 42, .35);
}
#paa-root.paa-open .paa-panel { display: flex; }
#paa-root.paa-open .paa-launch { display: none; }

#paa-root .paa-head {
	display: flex; align-items: center; gap: 10px;
	background: #0b1a33; color: #fff; padding: 12px 12px 12px 16px;
}
#paa-root .paa-head-title { flex: 1; min-width: 0; font-weight: 700; }
#paa-root .paa-head-title small { display: block; font-weight: 400; opacity: .7; font-size: 12px; }
#paa-root .paa-icon-btn {
	background: transparent; border: 0; color: #fff; width: 34px; height: 34px;
	border-radius: 8px; cursor: pointer; display: grid; place-items: center; opacity: .85;
}
#paa-root .paa-icon-btn:hover { background: rgba(255, 255, 255, .14); opacity: 1; }
#paa-root .paa-icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
#paa-root .paa-icon-btn[aria-pressed="false"] { opacity: .5; }

#paa-root .paa-log {
	flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px;
	background: var(--paa-soft); scroll-behavior: smooth;
}
#paa-root .paa-msg {
	max-width: 88%; padding: 10px 13px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere;
}
#paa-root .paa-msg p { margin: 0 0 8px; }
#paa-root .paa-msg p:last-child, #paa-root .paa-msg ul:last-child, #paa-root .paa-msg ol:last-child { margin-bottom: 0; }
#paa-root .paa-msg ul, #paa-root .paa-msg ol { margin: 0 0 8px; padding-left: 20px; }
#paa-root .paa-msg a { color: var(--paa-accent); text-decoration: underline; }
#paa-root .paa-bot { align-self: flex-start; background: #fff; border: 1px solid var(--paa-line); border-bottom-left-radius: 4px; }
#paa-root .paa-user { align-self: flex-end; background: var(--paa-accent); color: #fff; border-bottom-right-radius: 4px; }
#paa-root .paa-user a { color: #fff; }
#paa-root .paa-err { align-self: stretch; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; text-align: center; font-size: 14px; }
#paa-root .paa-ok { align-self: center; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; font-size: 13px; padding: 6px 12px; border-radius: 999px; }

#paa-root .paa-typing { display: flex; gap: 4px; padding: 12px 14px; }
#paa-root .paa-typing i {
	width: 7px; height: 7px; border-radius: 50%; background: var(--paa-muted); opacity: .5;
	animation: paa-bounce 1.2s infinite ease-in-out;
}
#paa-root .paa-typing i:nth-child(2) { animation-delay: .15s; }
#paa-root .paa-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes paa-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

#paa-root .paa-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; background: var(--paa-soft); }
#paa-root .paa-chip {
	background: #fff; border: 1px solid var(--paa-line); border-radius: 999px; padding: 6px 12px;
	font-size: 13px; cursor: pointer; color: var(--paa-accent);
}
#paa-root .paa-chip:hover { border-color: var(--paa-accent); }

#paa-root .paa-form {
	display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px;
	border-top: 1px solid var(--paa-line); background: #fff;
}
#paa-root .paa-input {
	flex: 1; resize: none; max-height: 110px; min-height: 40px; padding: 9px 12px;
	border: 1px solid var(--paa-line); border-radius: 12px; background: #fff; line-height: 1.35;
}
#paa-root .paa-btn {
	width: 40px; height: 40px; flex: none; border: 0; border-radius: 12px; cursor: pointer;
	display: grid; place-items: center; background: var(--paa-accent); color: #fff;
}
#paa-root .paa-btn:disabled { opacity: .45; cursor: default; }
#paa-root .paa-btn svg { width: 19px; height: 19px; fill: currentColor; }
#paa-root .paa-mic { background: var(--paa-soft); color: var(--paa-ink); border: 1px solid var(--paa-line); }
#paa-root .paa-mic[aria-pressed="true"] { background: #dc2626; color: #fff; border-color: #dc2626; animation: paa-pulse 1.2s infinite; }
@keyframes paa-pulse { 0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); } 100% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); } }

#paa-root .paa-foot { padding: 6px 14px 9px; font-size: 11.5px; color: var(--paa-muted); background: #fff; text-align: center; }
#paa-root .paa-foot a { color: var(--paa-muted); }

@media (max-width: 480px) {
	#paa-root.paa-open { inset: 0; bottom: 0; right: 0; left: 0; }
	#paa-root.paa-open .paa-panel { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
	#paa-root.paa-lift { bottom: 84px; }
	#paa-root.paa-open.paa-lift { bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
	#paa-root *, #paa-root *::before, #paa-root *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
