/* RL チャットボット（選ぶ式）— スマホ優先。テーマの見た目に左右されないよう、すべて #rlcb-root の中だけに効かせる。 */
#rlcb-root {
	--rlcb-green: #183e33;
	--rlcb-green-2: #235442;
	--rlcb-pale: #edf3e9;
	--rlcb-line: #cbdace;
	--rlcb-text: #24352c;
	--rlcb-muted: #5b6e62;
	--rlcb-bg: #ffffff;
	--rlcb-radius: 14px;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.75;
	color: var(--rlcb-text);
	letter-spacing: normal;
	text-align: left;
}
#rlcb-root *, #rlcb-root *::before, #rlcb-root *::after { box-sizing: border-box; }
#rlcb-root button {
	font: inherit;
	letter-spacing: inherit;
	text-transform: none;
	text-shadow: none;
	box-shadow: none;
	margin: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
#rlcb-root p { margin: 0; padding: 0; }

/* 右下：キャラクターの顔とふきだし */
#rlcb-root .rlcb-launcher {
	position: fixed;
	right: 14px;
	bottom: 14px;
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--rlcb-green);
}
#rlcb-root .rlcb-launcher-label {
	position: relative;
	padding: 10px 14px;
	border-radius: 16px;
	background: #fff;
	border: 2px solid var(--rlcb-green-2);
	color: var(--rlcb-green);
	font-size: 14px;
	line-height: 1.35;
	font-weight: 600;
	box-shadow: 0 4px 14px rgba(24, 62, 51, .18);
	white-space: nowrap;
}
#rlcb-root .rlcb-launcher-label::after {
	content: "";
	position: absolute;
	right: -9px;
	top: 50%;
	margin-top: -7px;
	border: 7px solid transparent;
	border-left: 9px solid var(--rlcb-green-2);
	border-right: 0;
}
#rlcb-root .rlcb-launcher-face {
	width: 104px;
	height: 104px;
	margin-left: -6px;
	filter: drop-shadow(0 4px 8px rgba(24, 62, 51, .22));
	transform-origin: 70% 100%;
}
#rlcb-root .rlcb-launcher:hover .rlcb-launcher-face { transform: translateY(-3px) rotate(-1.5deg); }
#rlcb-root .rlcb-launcher:focus-visible { outline: 3px solid #e0a526; outline-offset: 4px; border-radius: 40px; }
#rlcb-root .rlcb-choice:focus-visible,
#rlcb-root .rlcb-close:focus-visible,
#rlcb-root a:focus-visible,
#rlcb-root textarea:focus-visible { outline: 3px solid #e0a526; outline-offset: 2px; }
#rlcb-root.rlcb-is-open .rlcb-launcher { display: none; }

/* キャラクター（背景を抜いた画像。丸い台と、台からはみ出す頭は画像に入っている） */
#rlcb-root .rlcb-face {
	flex: 0 0 auto;
	display: inline-block;
	transition: transform .18s ease;
}
#rlcb-root .rlcb-face img { display: block; width: 100%; height: 100%; object-fit: contain; margin: 0; border: 0; max-width: none; box-shadow: none; border-radius: 0; background: none; }
#rlcb-root .rlcb-head-face { width: 54px; height: 54px; margin: -6px 0 -4px -4px; }
#rlcb-root .rlcb-msg-face { width: 42px; height: 42px; margin: -4px 4px 0 -4px; }
#rlcb-root .rlcb-bot.rlcb-cont { padding-left: 44px; }

/* パネル（PC） */
#rlcb-root .rlcb-panel {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 100001; /* WordPressの管理バー（99999）より上。ログイン中に閉じるボタンが隠れないように */
	display: flex;
	flex-direction: column;
	width: 390px;
	max-width: calc(100vw - 32px);
	height: min(660px, calc(100vh - 32px));
	background: var(--rlcb-bg);
	border: 1px solid var(--rlcb-line);
	border-radius: var(--rlcb-radius);
	box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
	overflow: hidden;
}
#rlcb-root .rlcb-panel[hidden] { display: none; }

#rlcb-root .rlcb-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 10px 12px 18px;
	background: var(--rlcb-green);
	color: #fff;
}
#rlcb-root .rlcb-title { font-size: 17px; line-height: 1.4; font-weight: 600; color: #fff; }
#rlcb-root .rlcb-sub { font-size: 12px; line-height: 1.4; opacity: .85; color: #fff; }
#rlcb-root .rlcb-titles { flex: 1 1 auto; min-width: 0; }
#rlcb-root .rlcb-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
}
#rlcb-root .rlcb-close:hover { background: rgba(255, 255, 255, .14); }

#rlcb-root .rlcb-log {
	position: relative;
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 16px 14px 20px;
	background: #f4f8f1;
}
#rlcb-root .rlcb-loading { color: var(--rlcb-muted); }

#rlcb-root .rlcb-msg { display: flex; margin: 0 0 10px; }
#rlcb-root .rlcb-bot { justify-content: flex-start; align-items: flex-start; }
#rlcb-root .rlcb-user { justify-content: flex-end; }
#rlcb-root .rlcb-bubble {
	max-width: 92%;
	padding: 11px 14px;
	border-radius: 12px;
	overflow-wrap: anywhere;
	word-break: normal;
}
#rlcb-root .rlcb-bot .rlcb-bubble { background: #fff; border: 1.5px solid var(--rlcb-line); border-radius: 16px; border-top-left-radius: 4px; box-shadow: 0 1px 2px rgba(24, 62, 51, .06); }
#rlcb-root .rlcb-user .rlcb-bubble { background: var(--rlcb-green-2); color: #fff; border-radius: 16px; border-top-right-radius: 4px; }
#rlcb-root .rlcb-bubble p + p,
#rlcb-root .rlcb-bubble p + ul,
#rlcb-root .rlcb-bubble ul + p { margin-top: .7em; }
#rlcb-root .rlcb-bubble ul { margin: .4em 0 0; padding: 0 0 0 1.2em; list-style: disc; }
#rlcb-root .rlcb-bubble li { margin: .2em 0; padding: 0; }
#rlcb-root .rlcb-bubble a { color: var(--rlcb-green-2); text-decoration: underline; text-underline-offset: 3px; }
#rlcb-root .rlcb-bubble ul.rlcb-links { list-style: none; padding: 10px 0 0; margin-top: 10px; border-top: 1px solid var(--rlcb-line); }
#rlcb-root .rlcb-bubble ul.rlcb-links li::before { content: "→ "; color: var(--rlcb-muted); }

#rlcb-root .rlcb-choices { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 16px 44px; }
#rlcb-root .rlcb-choice {
	display: block;
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	border: 1px solid var(--rlcb-green-2);
	border-radius: 22px;
	background: #fff;
	color: var(--rlcb-green);
	font-size: 15px;
	line-height: 1.5;
	text-align: left;
}
#rlcb-root .rlcb-choice:hover:not([disabled]) { background: var(--rlcb-pale); }
#rlcb-root .rlcb-choice.rlcb-primary { background: var(--rlcb-green); color: #fff; border-color: var(--rlcb-green); }
#rlcb-root .rlcb-choice.rlcb-primary:hover:not([disabled]) { background: var(--rlcb-green-2); }
#rlcb-root .rlcb-choice.rlcb-back { border-color: var(--rlcb-line); color: var(--rlcb-muted); }
#rlcb-root .rlcb-choice[disabled] { opacity: .45; cursor: default; }
#rlcb-root .rlcb-choices:has(button[disabled]) { display: none; }

#rlcb-root .rlcb-draft { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 4px; background: #f3d9a4; color: #5a3d00; font-size: 12px; vertical-align: middle; }
#rlcb-root .rlcb-draft-note, #rlcb-root .rlcb-preview-note { margin: 0 0 8px; padding: 6px 8px; border-radius: 6px; background: #fff4dc; color: #5a3d00; font-size: 13px; }
#rlcb-root .rlcb-preview-note { margin-top: 8px; }

/* その他の質問 */
#rlcb-root .rlcb-free { margin-top: 10px; }
#rlcb-root .rlcb-free-label { display: block; font-size: 13px; color: var(--rlcb-muted); margin-bottom: 4px; }
#rlcb-root .rlcb-free-text {
	display: block;
	width: 100%;
	min-height: 96px;
	padding: 10px;
	border: 1px solid var(--rlcb-line);
	border-radius: 8px;
	background: #fff;
	color: var(--rlcb-text);
	font: inherit;
	font-size: 16px; /* iPhoneで入力時に拡大されないように */
	resize: vertical;
}
#rlcb-root .rlcb-free-note { margin-top: 6px; font-size: 12.5px; line-height: 1.6; color: var(--rlcb-muted); }
#rlcb-root .rlcb-free-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
#rlcb-root .rlcb-count { font-size: 12px; color: var(--rlcb-muted); }
#rlcb-root .rlcb-send { width: auto; min-width: 110px; text-align: center; }
#rlcb-root .rlcb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

#rlcb-root .rlcb-foot {
	padding: 9px 14px;
	border-top: 1px solid var(--rlcb-line);
	background: #fff;
	font-size: 12.5px;
	color: var(--rlcb-muted);
	text-align: center;
}
#rlcb-root .rlcb-foot a { color: var(--rlcb-green-2); text-decoration: underline; }

/* ページの中に置くボタン [rlcb_chatbot] */
.rlcb-inline-open {
	display: inline-block;
	padding: 12px 20px;
	border: 0;
	border-radius: 999px;
	background: #183e33;
	color: #fff;
	font: inherit;
	cursor: pointer;
}

/* スマホ：画面いっぱいに開く */
@media (max-width: 600px) {
	#rlcb-root .rlcb-launcher { right: 10px; bottom: 10px; }
	#rlcb-root .rlcb-launcher-face { width: 88px; height: 88px; margin-left: -6px; }
	#rlcb-root .rlcb-launcher-label { font-size: 13px; padding: 8px 12px; }
	#rlcb-root .rlcb-choices { margin-left: 0; }
	#rlcb-root .rlcb-panel {
		inset: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: 100%;
		height: 100%;
		height: 100dvh;
		border: 0;
		border-radius: 0;
	}
	#rlcb-root .rlcb-head { padding-top: max(12px, env(safe-area-inset-top)); }
	#rlcb-root .rlcb-foot { padding-bottom: max(9px, env(safe-area-inset-bottom)); }
	#rlcb-root .rlcb-bubble { max-width: 96%; }
	html.rlcb-open, html.rlcb-open body { overflow: hidden; }
}

@media (prefers-reduced-motion: no-preference) {
	#rlcb-root .rlcb-msg { animation: rlcb-in .18s ease-out; }
	@keyframes rlcb-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

@media print { #rlcb-root { display: none !important; } }
