#aasb-chat-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  text-align: center;
  cursor: pointer;
  z-index: 998;
}
#aasb-chatbot {
  display: none;
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 360px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  font-family: sans-serif;
  z-index: 9999;
}
#aasb-chatbot-header {
  background: #0073aa;
  color: #fff;
  padding: 10px;
  border-radius: 8px 8px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#aasb-chat-messages {
  padding: 10px;
  height: 420px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.5;
}
#aasb-chat-input-wrap {
  padding: 10px;
  border-top: 1px solid #ddd;
  position: relative;
}
#aasb-chat-input {
  width: 100%;
  padding: 8px;
  padding-right: 40px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
#aasb-send-btn {
  position: absolute;
  right: 20px;
  top: 14px;
  background: #0073aa;
  color: #fff;
  border: none;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 400px) {
 #aasb-chat-launcher {
    padding: 5px 8px;
 }
 #aasb-chatbot {
    left: 10px;
    right: 10px;
    bottom: 80px;                /* above launcher */
    width: auto;
    max-width: calc(100% - 20px);
    border-radius: 10px;
    height: auto;
    max-height: 80vh;
  }

  #aasb-chat-messages {
    height: auto;
    max-height: calc(80vh - 120px); /* leave space for header + input */
  }

  #aasb-chat-input {
    padding: 10px 48px 10px 10px;
    font-size: 15px;
  }
  #aasb-send-btn {
    font-size: 14px;
  }
}
@media (max-width: 360px) {
  #aasb-chatbot { left:6px; right:6px; bottom:72px; }
  #aasb-chat-messages { max-height: calc(78vh - 120px); font-size:13px; }
  #aasb-chat-input { font-size:14px; }
}
.aasb-ai-button {
	position: relative;
	padding: 10px 25px;
	font-size: 18px;
	font-weight: 600;
	color: white;
	background: linear-gradient(135deg, #1e88e5 0%, #7c4dff 100%);
	border: none;
	border-radius: 15px;
	cursor: pointer;
	overflow: hidden;
	transition: all 0.3s ease;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.aasb-ai-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.aasb-ai-button:active {
	transform: translateY(0);
}

.aasb-ai-button .sparkle-container {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.aasb-ai-button .sparkle {
	position: absolute;
	background: white;
	opacity: 0.8;
	animation: sparkle 2s ease-in-out infinite;
}

.aasb-ai-button .sparkle-1 {
	width: 8px;
	height: 8px;
	top: 20%;
	left: 15%;
	clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
	animation-delay: 0s;
}

.aasb-ai-button .sparkle-2 {
	width: 6px;
	height: 6px;
	top: 60%;
	left: 80%;
	clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
	animation-delay: 0.7s;
}

.aasb-ai-button .sparkle-3 {
	width: 10px;
	height: 10px;
	top: 70%;
	left: 25%;
	clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
	animation-delay: 1.4s;
}

.aasb-ai-button .sparkle-icon {
	display: inline-block;
	width: 20px;
	height: 20px;
	margin-right: 8px;
	background: white;
	clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

@keyframes sparkle {
	0%, 100% {
		opacity: 0;
		transform: scale(0) rotate(0deg);
	}
	50% {
		opacity: 0.8;
		transform: scale(1) rotate(180deg);
	}
}

.aasb-ai-button-text {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
}

/* Shimmer effect */
.aasb-ai-button::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
	animation: shimmer 3s infinite;
}

@keyframes shimmer {
	0% {
		left: -100%;
	}
	100% {
		left: 100%;
	}
}

/* Compact, viewport-bounded chat layout. */
#aasb-chatbot {
  width: 360px;
  max-width: calc(100vw - 24px);
  height: auto;
  max-height: calc(100vh - 108px);
  max-height: calc(100dvh - 108px);
  overflow: hidden;
}
#aasb-chatbot-header { position: relative; min-height: 44px; padding: 6px 10px; box-sizing: border-box; }
#aasb-close-chat, #aasb-privacy-close {
  display: grid; place-items: center; width: 32px; height: 32px;
  min-width: 32px; padding: 0; margin: 0; border: 0; border-radius: 6px;
  background: transparent; color: inherit; line-height: 1; cursor: pointer;
}
#aasb-chat-messages {
  height: 240px; min-height: 0;
  max-height: max(0px, calc(100vh - 310px));
  max-height: max(0px, calc(100dvh - 310px));
  overflow-y: auto; box-sizing: border-box;
}
#aasb-chat-input-wrap { padding: 10px; }
.aasb-chat-compose { position: relative; }
#aasb-chat-input { box-sizing: border-box; width: 100%; padding: 10px 48px 10px 10px; min-height: 44px; margin: 0; }
#aasb-send-btn {
  position: absolute; top: 50%; right: 7px; transform: translateY(-50%);
  display: grid; place-items: center; width: 32px; height: 32px; min-width: 32px;
  padding: 0; margin: 0; border: 0; border-radius: 50%; background: #0073aa; color: #fff; cursor: pointer;
}
#aasb-send-btn span { position: relative; display: block; width: 14px; height: 16px; pointer-events: none; }
#aasb-send-btn span::before { content: ""; position: absolute; left: 3px; top: 2px; width: 8px; height: 8px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; transform: rotate(45deg); }
#aasb-send-btn span::after { content: ""; position: absolute; left: 6px; top: 2px; width: 2px; height: 14px; background: currentColor; }
#aasb-send-btn:disabled { opacity: .6; cursor: wait; }
#aasb-send-btn:focus-visible, #aasb-close-chat:focus-visible, #aasb-privacy-close:focus-visible { outline: 2px solid #1689c4; outline-offset: 2px; }
#aasb-privacy-notice { position: relative; margin-top: 10px; padding: 10px 38px 10px 12px; background: #eff7fb; border-left: 3px solid #0073aa; border-radius: 6px; color: #465363; font-size: 12px; line-height: 1.5; }
#aasb-privacy-close { position: absolute; top: 4px; right: 3px; }
@media (max-width: 400px) {
  #aasb-chatbot { left: 12px; right: 12px; bottom: 72px; width: auto; max-height: calc(100vh - 84px); max-height: calc(100dvh - 84px); }
  #aasb-chat-messages { max-height: max(0px, calc(100vh - 286px)); max-height: max(0px, calc(100dvh - 286px)); }
}
