/* ===== Floating Button ===== */
#classe-chatbot-btn {
	position: fixed;
	bottom: 48px;
	right: 48px;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
	z-index: 10000;
	border: none;
	outline: none;
}

#classe-chatbot-btn:hover,
#classe-chatbot-btn:focus-visible {
	transform: scale(1.07);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

/* チャットウィンドウ表示中はボタン非表示 */
#classe-chatbot-btn.classe-active {
	opacity: 0;
	transform: scale(0.6);
	pointer-events: none;
}


/* ===== Tooltip ===== */
#classe-chatbot-tooltip {
	position: fixed;
	bottom: 116px;
	right: 48px;
	background: #1F2937;
	color: #fff;
	padding: 8px 14px;
	border-radius: 8px;
	font-size: 13px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	z-index: 10001;
}

#classe-chatbot-tooltip::after {
	content: '';
	position: absolute;
	bottom: -6px;
	right: 22px;
	border: 6px solid transparent;
	border-top-color: #1F2937;
	border-bottom: none;
}

#classe-chatbot-tooltip.classe-tooltip-visible {
	opacity: 1;
}

/* ===== Chat Window ===== */
#classe-chatbot-window {
	position: fixed;
	bottom: 48px;
	right: 48px;
	width: 380px;
	height: 600px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 9999;
}

#classe-chatbot-window.classe-open {
	opacity: 1;
	transform: translateY(0);
	pointer-events: all;
}

/* ===== Header ===== */
#classe-chatbot-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	color: #fff;
	flex-shrink: 0;
}

#classe-chatbot-studio-name {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

.classe-header-actions {
	display: flex;
	gap: 4px;
}

.classe-header-actions button {
	background: transparent;
	border: none;
	color: rgba(255, 255, 255, 0.8);
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	padding: 4px 8px;
	border-radius: 6px;
	transition: color 0.15s, background 0.15s;
}

.classe-header-actions button:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.15);
}

/* ===== Messages ===== */
#classe-chatbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.classe-message {
	display: flex;
}

.classe-message-user  { justify-content: flex-end; }
.classe-message-model { justify-content: flex-start; }

.classe-bubble {
	max-width: 80%;
	padding: 10px 14px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.65;
	white-space: pre-wrap;
	word-break: break-word;
}

.classe-message-user  .classe-bubble {
	background: #1F2937;
	color: #fff;
	border-bottom-right-radius: 4px;
}

.classe-message-model .classe-bubble {
	background: #F3F4F6;
	color: #1F2937;
	border-bottom-left-radius: 4px;
}

/* Typing indicator */
.classe-typing {
	display: flex;
	gap: 4px;
	align-items: center;
	padding: 10px 14px;
}

.classe-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9CA3AF;
	animation: classe-bounce 1.4s infinite ease-in-out both;
}

.classe-typing span:nth-child(1) { animation-delay: -0.32s; }
.classe-typing span:nth-child(2) { animation-delay: -0.16s; }

@keyframes classe-bounce {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
	40%            { transform: scale(1);   opacity: 1; }
}

/* ===== Quick Reply Chips ===== */
#classe-chatbot-chips {
	padding: 0 12px 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	flex-shrink: 0;
}

.classe-chip {
	background: #fff;
	border: 1px solid #E5E7EB;
	border-radius: 16px;
	padding: 6px 13px;
	font-size: 13px;
	color: #1F2937;
	cursor: pointer;
	transition: background 0.12s, border-color 0.12s;
	font-family: inherit;
}

.classe-chip:hover {
	background: #F3F4F6;
	border-color: #9CA3AF;
}

/* ===== Input Area ===== */
#classe-chatbot-input-area {
	display: flex;
	align-items: flex-end;
	padding: 8px 12px 10px;
	border-top: 1px solid #E5E7EB;
	gap: 8px;
	flex-shrink: 0;
}

#classe-chatbot-input {
	flex: 1;
	border: 1px solid #E5E7EB;
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 14px;
	font-family: inherit;
	resize: none;
	outline: none;
	line-height: 1.5;
	max-height: 100px;
	overflow-y: auto;
	color: #1F2937;
	background: #fff;
	transition: border-color 0.15s;
}

#classe-chatbot-input:focus {
	border-color: #9CA3AF;
}

#classe-chatbot-input::placeholder {
	color: #9CA3AF;
}

#classe-chatbot-send {
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border-radius: 8px;
	background: var(--classe-accent, #1F2937);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.15s;
}

#classe-chatbot-send:hover   { opacity: 0.85; }
#classe-chatbot-send:disabled {
	background: #D1D5DB;
	cursor: not-allowed;
	opacity: 1;
}

#classe-chatbot-send svg {
	width: 18px;
	height: 18px;
	fill: #fff;
}

/* ===== CTA Footer ===== */
#classe-chatbot-footer {
	padding: 10px 16px 12px;
	border-top: 1px solid #E5E7EB;
	text-align: center;
	flex-shrink: 0;
}

#classe-chatbot-cta {
	display: inline-block;
	background: #06C755;
	color: #fff;
	text-decoration: none;
	padding: 9px 22px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	transition: background 0.15s;
}

#classe-chatbot-cta:hover {
	background: #05b04b;
	color: #fff;
	text-decoration: none;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
	#classe-chatbot-btn {
		bottom: 32px;
		right: 32px;
	}

	#classe-chatbot-tooltip {
		bottom: 112px;
		right: 32px;
	}

	#classe-chatbot-window {
		bottom: 0;
		right: 0;
		width: 100vw;
		height: 100vh;
		height: 100dvh;
		border-radius: 0;
	}

	#classe-chatbot-header {
		padding-top: max(14px, env(safe-area-inset-top));
	}

	.classe-header-actions button {
		font-size: 20px;
		padding: 8px 12px;
		min-width: 44px;
		min-height: 44px;
	}
}
