/* TDJ Chatbot widget styles */
#tdj-chatbot {
	--tdjcb-primary: #1c3f94;   /* corporate navy — adjust to site brand */
	--tdjcb-primary-dark: #142e6e;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
	font-size: 14px;
	line-height: 1.6;
}

/* Toggle button */
#tdj-chatbot .tdjcb-toggle {
	width: 56px;
	height: 56px;
	border: none;
	border-radius: 50%;
	background: var(--tdjcb-primary);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease, background 0.15s ease;
}
#tdj-chatbot .tdjcb-toggle:hover {
	background: var(--tdjcb-primary-dark);
	transform: scale(1.06);
}
#tdj-chatbot .tdjcb-toggle--hidden {
	display: none;
}

/* Panel */
#tdj-chatbot .tdjcb-panel {
	width: 340px;
	max-width: calc(100vw - 32px);
	height: 480px;
	max-height: calc(100vh - 100px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

#tdj-chatbot .tdjcb-panel[hidden] {
	display: none;
}

#tdj-chatbot .tdjcb-header {
	background: var(--tdjcb-primary);
	color: #fff;
	padding: 12px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
#tdj-chatbot .tdjcb-title {
	font-weight: 700;
	font-size: 14px;
}
#tdj-chatbot .tdjcb-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 16px;
	cursor: pointer;
	padding: 2px 6px;
	line-height: 1;
}

#tdj-chatbot .tdjcb-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f5f7fa;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#tdj-chatbot .tdjcb-msg {
	max-width: 85%;
	padding: 9px 12px;
	border-radius: 12px;
	white-space: pre-wrap;
	word-break: break-word;
}
#tdj-chatbot .tdjcb-msg--assistant {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e1e5ea;
	border-bottom-left-radius: 4px;
	color: #222;
}
#tdj-chatbot .tdjcb-msg--user {
	align-self: flex-end;
	background: var(--tdjcb-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}

/* Typing indicator */
#tdj-chatbot .tdjcb-typing {
	display: flex;
	gap: 4px;
	align-items: center;
	padding: 12px 14px;
}
#tdj-chatbot .tdjcb-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #a9b3c0;
	animation: tdjcb-blink 1.2s infinite both;
}
#tdj-chatbot .tdjcb-typing span:nth-child(2) { animation-delay: 0.2s; }
#tdj-chatbot .tdjcb-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tdjcb-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

#tdj-chatbot .tdjcb-notice {
	font-size: 10px;
	color: #8a94a1;
	padding: 4px 14px;
	background: #f5f7fa;
	border-top: 1px solid #e9edf2;
}

/* Input area */
#tdj-chatbot .tdjcb-form {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	background: #fff;
	border-top: 1px solid #e1e5ea;
}
#tdj-chatbot .tdjcb-input {
	flex: 1;
	resize: none;
	border: 1px solid #ccd3db;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.4;
	max-height: 90px;
}
#tdj-chatbot .tdjcb-input:focus {
	outline: 2px solid var(--tdjcb-primary);
	outline-offset: -1px;
}
#tdj-chatbot .tdjcb-send {
	border: none;
	background: var(--tdjcb-primary);
	color: #fff;
	border-radius: 8px;
	padding: 0 14px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}
#tdj-chatbot .tdjcb-send:hover { background: var(--tdjcb-primary-dark); }
#tdj-chatbot .tdjcb-send:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 480px) {
	#tdj-chatbot { right: 12px; bottom: 12px; }
	#tdj-chatbot .tdjcb-panel {
		width: calc(100vw - 24px);
		height: 70vh;
	}
}
