/* Chatbot Builder - front widget styles */
.cbb-root {
	position: fixed;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}
.cbb-right { right: 20px; }
.cbb-left { left: 20px; }

.cbb-launcher {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border: none;
	border-radius: 50%;
	font-size: 26px;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}
.cbb-launcher:hover { transform: scale(1.08); }

.cbb-window {
	display: flex;
	flex-direction: column;
	width: 340px;
	max-width: calc(100vw - 40px);
	height: 480px;
	max-height: calc(100vh - 40px);
	background: #fff;
	border: 1px solid #e2e8f0;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
	overflow: hidden;
}

.cbb-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	color: #fff;
}
.cbb-header-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	font-size: 15px;
}
.cbb-header-name {
	flex: 1;
	font-size: 14px;
	font-weight: 700;
}
.cbb-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.8;
	padding: 2px 6px;
}
.cbb-close:hover { opacity: 1; }

.cbb-body {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
}
.cbb-msg { display: flex; margin-bottom: 8px; }
.cbb-msg-bot { justify-content: flex-start; }
.cbb-msg-user { justify-content: flex-end; }
.cbb-bubble {
	max-width: 85%;
	padding: 8px 12px;
	font-size: 13px;
	line-height: 1.6;
	word-break: break-word;
}

.cbb-cta {
	display: block;
	margin-top: 6px;
	padding: 10px;
	color: #fff !important;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	text-decoration: none !important;
	transition: opacity 0.15s ease;
}
.cbb-cta:hover { opacity: 0.88; }

.cbb-footer {
	border-top: 1px solid #f1f5f9;
	padding: 10px;
}
.cbb-options {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.cbb-option {
	background: transparent;
	border: 1px solid;
	padding: 6px 12px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.12s ease, color 0.12s ease;
}
.cbb-restart {
	width: 100%;
	background: none;
	border: none;
	color: #94a3b8;
	font-size: 12px;
	padding: 6px;
	cursor: pointer;
}
.cbb-restart:hover { color: #475569; }

@media (max-width: 480px) {
	.cbb-window { width: calc(100vw - 40px); height: 70vh; }
}

/* チャット内フォーム */
.cbb-input-row {
	display: flex;
	gap: 6px;
	align-items: flex-end;
}
.cbb-input {
	flex: 1;
	min-width: 0;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13px;
	font-family: inherit;
	resize: none;
}
.cbb-input:focus {
	outline: none;
	border-color: #64748b;
}
.cbb-send {
	border: none;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	padding: 8px 14px;
	cursor: pointer;
	transition: opacity 0.15s ease;
	flex-shrink: 0;
}
.cbb-send:hover { opacity: 0.88; }
.cbb-skip {
	display: block;
	margin-top: 4px;
	background: none;
	border: none;
	color: #94a3b8;
	font-size: 11px;
	cursor: pointer;
	padding: 2px 0;
}
.cbb-skip:hover { color: #475569; text-decoration: underline; }

/* Contact Form 7 をチャット内で表示 */
.cbb-cf7 {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	padding: 12px;
	margin-top: 6px;
	font-size: 13px;
}
.cbb-cf7 form { margin: 0; }
.cbb-cf7 p { margin: 0 0 8px; font-size: 12px; }
.cbb-cf7 label { font-size: 12px; color: #334155; }
.cbb-cf7 input[type="text"],
.cbb-cf7 input[type="email"],
.cbb-cf7 input[type="tel"],
.cbb-cf7 input[type="url"],
.cbb-cf7 input[type="number"],
.cbb-cf7 select,
.cbb-cf7 textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 7px 10px;
	font-size: 13px;
	margin-top: 2px;
	background: #fff;
}
.cbb-cf7 textarea { max-height: 90px; }
.cbb-cf7 input[type="submit"],
.cbb-cf7 .wpcf7-submit {
	width: 100%;
	border: none;
	padding: 9px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: opacity 0.15s ease;
}
.cbb-cf7 input[type="submit"]:hover { opacity: 0.88; }
.cbb-cf7 .wpcf7-not-valid-tip {
	font-size: 11px;
	color: #dc2626;
}
.cbb-cf7 .wpcf7-response-output {
	font-size: 11px;
	margin: 8px 0 0;
	padding: 6px 8px;
	border-radius: 6px;
}
.cbb-cf7 .wpcf7-spinner { display: block; margin: 4px auto 0; }

/* ===== v2: LP型チャット演出 ===== */

/* バー型ランチャー */
.cbb-launcher-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	border: none;
	border-radius: 999px;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	padding: 12px 20px;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
	animation: cbb-pulse 2.4s ease-in-out infinite;
}
.cbb-launcher-bar:hover { transform: scale(1.05); }
.cbb-bar-avatar { font-size: 18px; }
@keyframes cbb-pulse {
	0%, 100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); }
	50% { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4); }
}
@media (prefers-reduced-motion: reduce) {
	.cbb-launcher-bar { animation: none; }
}

/* タイピング演出 */
.cbb-typing { min-width: 44px; }
.cbb-dot {
	display: inline-block;
	width: 6px;
	height: 6px;
	margin: 0 2px;
	background: currentColor;
	opacity: 0.4;
	border-radius: 50%;
	animation: cbb-blink 1s infinite;
}
.cbb-dot:nth-child(2) { animation-delay: 0.2s; }
.cbb-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes cbb-blink {
	0%, 80%, 100% { opacity: 0.3; }
	40% { opacity: 1; }
}

/* 進捗バー */
.cbb-progress {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fff;
	border-bottom: 1px solid #f1f5f9;
	padding: 7px 12px;
}
.cbb-progress-label {
	flex-shrink: 0;
	font-size: 10px;
	font-weight: 700;
	color: #64748b;
}
.cbb-progress-track {
	flex: 1;
	height: 6px;
	background: #e2e8f0;
	border-radius: 3px;
	overflow: hidden;
}
.cbb-progress-bar {
	height: 100%;
	width: 0;
	border-radius: 3px;
	transition: width 0.35s ease;
}

/* ヘッダー電話アイコン */
.cbb-header-tel {
	font-size: 15px;
	text-decoration: none !important;
	margin-right: 4px;
	opacity: 0.95;
}

/* 電話CTA・アウトラインCTA */
.cbb-cta-tel {
	font-size: 14px;
	animation: cbb-pulse 2.4s ease-in-out infinite;
}
.cbb-cta-outline {
	background: #fff !important;
	border: 2px solid;
	font-weight: 700;
}

/* スマホではほぼ全画面(LPチャットの定番挙動) */
@media (max-width: 480px) {
	.cbb-window {
		position: fixed;
		left: 10px !important;
		right: 10px !important;
		bottom: 10px;
		width: auto;
		height: 82vh;
		max-height: none;
	}
}
