#advisor-chat { position: fixed; right: 20px; bottom: 20px; z-index: 1040; width: min(370px, calc(100vw - 24px)); font-size: 14px; }
#advisor-chat [hidden] { display: none !important; }
.advisor-chat-panel { display: flex; flex-direction: column; max-height: min(580px, calc(100dvh - 40px)); border: 1px solid #ddd0eb; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 10px 36px rgba(35, 18, 55, .22); }
.advisor-chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; background: #6f32b5; color: #fff; }
.advisor-chat-heading h2 { margin: 0; color: inherit; font-size: 16px; line-height: 1.4; }
.advisor-chat-tools { display: flex; flex: 0 0 auto; gap: 4px; }
.advisor-chat-heading button { border: 0; background: transparent; color: #fff; font-size: 24px; min-width: 36px; min-height: 36px; padding: 0 6px; cursor: pointer; }
.advisor-chat-launcher { width: 100%; background: #6f32b5; color: #fff; border: 0; padding: 14px 20px; border-radius: 24px; box-shadow: 0 5px 20px rgba(35, 18, 55, .2); cursor: pointer; font-weight: 700; }
.advisor-chat-intro { font-size: 12px; line-height: 1.5; margin: 0; padding: 12px 16px; color: #555; border-bottom: 1px solid #eee; }
.advisor-chat-log { flex: 1 1 auto; min-height: 120px; max-height: 290px; overflow-y: auto; overflow-anchor: none; overscroll-behavior: contain; padding: 16px; background: #faf8fc; }
#advisor-chat.advisor-chat-large { width: min(1100px, calc(100vw - 40px)); }
.advisor-chat-large .advisor-chat-panel { height: calc(100dvh - 40px); max-height: none; }
.advisor-chat-large .advisor-chat-log { min-height: 0; max-height: none; }
.advisor-chat-large .advisor-chat-heading, .advisor-chat-large .advisor-chat-intro { flex: 0 0 auto; }
.advisor-chat-message { border-radius: 10px; margin-bottom: 12px; padding: 10px 12px; overflow-wrap: anywhere; }
.advisor-chat-message p { margin: 4px 0 0; white-space: pre-wrap; line-height: 1.55; }
.advisor-chat-message strong { font-size: 11px; }
.advisor-chat-user { background: #eee4f8; margin-left: 22px; }
.advisor-chat-answer { background: #fff; border: 1px solid #e7e1ed; margin-right: 12px; }
.advisor-chat-empty, .advisor-chat-turn-error { font-size: 12px; color: #666; }
.advisor-chat-error { padding: 0 16px; margin: 8px 0; font-size: 12px; }
.advisor-chat-status {
	position: relative; display: flex; align-items: flex-start; gap: 12px; flex: 0 0 auto;
	margin: 10px 12px; padding: 14px 14px 17px; border: 1px solid #d8c5ee; border-radius: 12px;
	background: linear-gradient(120deg, #f5effc, #fcfaff); color: #47206e; overflow: hidden;
}
.advisor-chat-waiting .advisor-chat-intro { display: none; }
.advisor-chat-status-copy { min-width: 0; }
.advisor-chat-status-title { display: block; margin: 0 0 4px; font-size: 13px; font-weight: 700; line-height: 1.4; }
.advisor-chat-status-detail { display: block; font-size: 12px; font-weight: 400; line-height: 1.5; color: #625271; overflow-wrap: anywhere; }
.advisor-chat-activity-icon {
	display: flex; align-items: center; justify-content: center; gap: 3px; flex: 0 0 34px; height: 34px;
	border-radius: 50%; border: 1px solid #d8c5ee; background: #ebe0f8; color: #6f32b5;
}
.advisor-chat-activity-icon span { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.advisor-chat-waiting .advisor-chat-activity-icon span { animation: advisor-chat-dot 1.4s ease-in-out infinite; }
.advisor-chat-activity-icon span:nth-child(2) { animation-delay: .16s; }
.advisor-chat-activity-icon span:nth-child(3) { animation-delay: .32s; }
.advisor-chat-activity-track { position: absolute; inset: auto 0 0; height: 3px; background: #e8dcf5; overflow: hidden; }
.advisor-chat-activity-track::after {
	content: ""; display: block; width: 40%; height: 100%; border-radius: 3px;
	background: linear-gradient(90deg, transparent, #9860d2, #6f32b5, transparent);
}
.advisor-chat-waiting .advisor-chat-activity-track::after { animation: advisor-chat-travel 2.4s ease-in-out infinite; }
.advisor-chat-waiting .advisor-chat-launcher::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 9px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: advisor-chat-spin 1s linear infinite; }
.advisor-chat-status-unconfirmed .advisor-chat-activity-icon span,
.advisor-chat-status-unconfirmed .advisor-chat-activity-track::after,
.advisor-chat-status-unconfirmed .advisor-chat-launcher::before { animation: none; }
#advisor-chat-retry { align-self: flex-start; margin: 8px 16px; white-space: normal; }
@keyframes advisor-chat-spin { to { transform: rotate(360deg); } }
@keyframes advisor-chat-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes advisor-chat-travel { from { transform: translateX(-100%); } to { transform: translateX(350%); } }
@media (prefers-reduced-motion: reduce) {
	.advisor-chat-waiting .advisor-chat-activity-icon span,
	.advisor-chat-waiting .advisor-chat-activity-track::after,
	.advisor-chat-waiting .advisor-chat-launcher::before { animation: none; }
}
.advisor-chat-error, .advisor-chat-turn-error { color: #9a3b20; }
.advisor-chat-error:empty { display: none; }
.advisor-chat-form { flex: 0 0 auto; padding: 12px 16px 16px; border-top: 1px solid #eee; }
.advisor-chat-form label { display: block; font-size: 12px; margin-bottom: 6px; }
.advisor-chat-form textarea { width: 100%; resize: vertical; min-height: 60px; max-height: 130px; border: 1px solid #cfc3dc; border-radius: 8px; padding: 8px 10px; font: inherit; }
.advisor-chat-form button { margin-top: 8px; background: #6f32b5; border-color: #6f32b5; padding: 8px 18px; }
#advisor-chat :focus-visible { outline: 2px solid #6f32b5; outline-offset: 3px; }
.advisor-chat-heading button:focus-visible { outline-color: #fff !important; }
@media (max-width: 480px) {
	#advisor-chat { right: 12px; bottom: 12px; }
	.advisor-chat-panel { max-height: calc(100dvh - 24px); }
	.advisor-chat-log { max-height: 240px; }
	#advisor-chat.advisor-chat-large { width: calc(100vw - 24px); }
	.advisor-chat-large .advisor-chat-panel { height: calc(100dvh - 24px); }
	.advisor-chat-large .advisor-chat-log { max-height: none; }
}
@media (max-height: 480px) {
	.advisor-chat-intro { display: none; }
	.advisor-chat-log { min-height: 40px; }
	.advisor-chat-form { padding: 8px 16px; }
	.advisor-chat-form textarea { max-height: 80px; }
}
