#daichat-root {
	--daichat-accent: #c8102e;
	--daichat-left: auto;
	--daichat-right: 20px;
	--daichat-offset-y: 20px;
	--daichat-launcher-size: 60px;
	--daichat-launcher-radius: 50%;
	--daichat-win-width: 360px;
	--daichat-win-height: 540px;
}

#daichat-root * {
	box-sizing: border-box;
}

/* 起動ボタン */
.daichat-launcher {
	position: fixed;
	left: var(--daichat-left);
	right: var(--daichat-right);
	bottom: var(--daichat-offset-y);
	width: var(--daichat-launcher-size);
	height: var(--daichat-launcher-size);
	border-radius: var(--daichat-launcher-radius);
	background: var(--daichat-accent);
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	transition: transform 0.15s ease;
}
.daichat-launcher:hover {
	transform: scale(1.06);
}

/* チャットウィンドウ */
.daichat-window {
	position: fixed;
	left: var(--daichat-left);
	right: var(--daichat-right);
	bottom: calc(var(--daichat-offset-y) + var(--daichat-launcher-size) + 12px);
	width: var(--daichat-win-width);
	max-width: calc(100vw - 32px);
	height: var(--daichat-win-height);
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
.daichat-window.open {
	display: flex;
}

.daichat-header {
	background: var(--daichat-accent);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.daichat-header .daichat-title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}
.daichat-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	cursor: pointer;
	line-height: 1;
}

.daichat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f5f6f8;
}
.daichat-msg {
	margin-bottom: 10px;
	display: flex;
}
.daichat-msg .bubble {
	max-width: 82%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.6;
	white-space: pre-wrap;
	word-break: break-word;
}
.daichat-msg.bot {
	justify-content: flex-start;
}
.daichat-msg.bot .bubble {
	background: #fff;
	color: #222;
	border: 1px solid #e3e5e9;
	border-bottom-left-radius: 4px;
}
.daichat-msg.user {
	justify-content: flex-end;
}
.daichat-msg.user .bubble {
	background: var(--daichat-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.daichat-msg .bubble a {
	color: inherit;
	text-decoration: underline;
}

.daichat-typing .bubble {
	color: #888;
}

.daichat-input {
	display: flex;
	border-top: 1px solid #e3e5e9;
	padding: 8px;
	gap: 8px;
	background: #fff;
}
.daichat-input textarea {
	flex: 1;
	resize: none;
	border: 1px solid #d4d7dd;
	border-radius: 10px;
	padding: 9px 11px;
	font-size: 14px;
	font-family: inherit;
	max-height: 96px;
	line-height: 1.4;
}
.daichat-input textarea:focus {
	outline: none;
	border-color: var(--daichat-accent);
}
.daichat-send {
	background: var(--daichat-accent);
	color: #fff;
	border: none;
	border-radius: 10px;
	padding: 0 16px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 700;
}
.daichat-send:disabled {
	opacity: 0.5;
	cursor: default;
}

.daichat-footnote {
	font-size: 11px;
	color: #999;
	text-align: center;
	padding: 4px 0 8px;
	background: #fff;
}
