.ringo-chatbot {
	--ringo-chatbot-color: #2563eb;
	position: fixed;
	bottom: 20px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ringo-chatbot--right { right: 20px; }
.ringo-chatbot--left  { left: 20px; }

.ringo-chatbot__bubble {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: 0;
	cursor: pointer;
	background: var(--ringo-chatbot-color);
	color: #fff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}
.ringo-chatbot__bubble:hover { transform: scale(1.05); }

.ringo-chatbot__panel {
	position: absolute;
	bottom: 72px;
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 520px;
	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;
}
.ringo-chatbot--right .ringo-chatbot__panel { right: 0; }
.ringo-chatbot--left  .ringo-chatbot__panel { left: 0; }

.ringo-chatbot.is-open .ringo-chatbot__panel { display: flex; }

.ringo-chatbot__header {
	background: var(--ringo-chatbot-color);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.ringo-chatbot__title { font-weight: 600; font-size: 15px; }
.ringo-chatbot__close {
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.ringo-chatbot__log {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f6f7f9;
}

.ringo-chatbot__msg { display: flex; margin-bottom: 10px; }
.ringo-chatbot__msg--user { justify-content: flex-end; }

.ringo-chatbot__bubbletext {
	max-width: 80%;
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.ringo-chatbot__msg--assistant .ringo-chatbot__bubbletext {
	background: #fff;
	color: #1f2430;
	border: 1px solid #e4e7ec;
	border-bottom-left-radius: 4px;
}
.ringo-chatbot__msg--user .ringo-chatbot__bubbletext {
	background: var(--ringo-chatbot-color);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.ringo-chatbot__typing .ringo-chatbot__bubbletext { opacity: 0.7; font-style: italic; }

/* Rendered Markdown inside assistant bubbles */
.ringo-chatbot__msg--assistant .ringo-chatbot__bubbletext a {
	color: var(--ringo-chatbot-color);
	text-decoration: underline;
	word-break: break-word;
}
.ringo-chatbot__msg--assistant .ringo-chatbot__bubbletext strong { font-weight: 700; }
.ringo-chatbot__msg--assistant .ringo-chatbot__bubbletext em { font-style: italic; }
.ringo-chatbot__msg--assistant .ringo-chatbot__bubbletext code {
	background: #f1f3f5;
	border-radius: 4px;
	padding: 1px 4px;
	font-size: 12.5px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ringo-chatbot__msg--assistant .ringo-chatbot__bubbletext ul {
	margin: 6px 0;
	padding-left: 18px;
}
.ringo-chatbot__msg--assistant .ringo-chatbot__bubbletext li { margin: 2px 0; }

.ringo-chatbot__sources {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: -4px 0 12px;
}
.ringo-chatbot__source {
	font-size: 12px;
	background: #fff;
	border: 1px solid #d6dae1;
	border-radius: 12px;
	padding: 3px 9px;
	color: var(--ringo-chatbot-color);
	text-decoration: none;
}

.ringo-chatbot__form {
	display: flex;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #e4e7ec;
	background: #fff;
}
.ringo-chatbot__input {
	flex: 1;
	resize: none;
	border: 1px solid #d6dae1;
	border-radius: 10px;
	padding: 9px 11px;
	font-size: 14px;
	font-family: inherit;
	line-height: 1.4;
	max-height: 120px;
}
.ringo-chatbot__input:focus {
	outline: none;
	border-color: var(--ringo-chatbot-color);
}
.ringo-chatbot__send {
	border: 0;
	border-radius: 10px;
	background: var(--ringo-chatbot-color);
	color: #fff;
	padding: 0 16px;
	font-size: 14px;
	cursor: pointer;
}
.ringo-chatbot__send:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 480px) {
	.ringo-chatbot__panel {
		width: calc(100vw - 24px);
		height: calc(100vh - 100px);
	}
}
