body.jc-rag-modal-open {
	overflow: hidden;
}

#jc-rag-open {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99998;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	border: 0;
	border-radius: 999px;
	background: #10233f;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.jc-rag-open-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.18);
}

#jc-rag-modal[aria-hidden="true"] {
	display: none;
}

#jc-rag-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	overscroll-behavior: contain;
}

#jc-rag-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(4, 13, 28, 0.45);
	backdrop-filter: blur(2px);
}

#jc-rag-panel {
	position: absolute;
	right: 24px;
	bottom: 82px;
	width: min(640px, calc(100vw - 32px));
	height: min(820px, calc(100vh - 105px));
	background: #ffffff;
	border-radius: 18px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#jc-rag-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	padding: 12px 16px;
	min-height: 58px;
	background: #10233f;
	color: #ffffff;
	flex: 0 0 auto;
}

#jc-rag-title {
	font-size: 16px;
	font-weight: 800;
	line-height: 1.2;
}

#jc-rag-subtitle {
	margin-top: 2px;
	font-size: 11px;
	line-height: 1.25;
	opacity: 0.8;
}

#jc-rag-close {
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 4px;
}

#jc-rag-messages {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 18px;
	background: #f6f8fb;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.jc-rag-message {
	max-width: 94%;
	margin: 0 0 12px;
	padding: 12px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
}

.jc-rag-user {
	margin-left: auto;
	background: #10233f;
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

.jc-rag-assistant {
	margin-right: auto;
	background: #ffffff;
	color: #142033;
	border: 1px solid #e5e9f0;
	border-bottom-left-radius: 4px;
}

.jc-rag-waiting::after {
	content: "";
	display: inline-block;
	width: 18px;
	text-align: left;
	animation: jcRagDots 1.2s infinite;
}

@keyframes jcRagDots {
	0% { content: ""; }
	33% { content: "."; }
	66% { content: ".."; }
	100% { content: "..."; }
}

#jc-rag-form {
	position: relative;
	display: block;
	padding: 12px 14px 14px;
	background: #ffffff;
	border-top: 1px solid #e5e9f0;
	flex: 0 0 auto;
}

#jc-rag-question {
	box-sizing: border-box;
	display: block;
	width: 100%;
	resize: none;
	min-height: 58px;
	max-height: 130px;
	overflow-y: auto;
	border: 1px solid #ccd3dd;
	border-radius: 16px;
	padding: 14px 58px 14px 14px;
	font-size: 14px;
	line-height: 1.4;
	font-family: inherit;
	outline: none;
}

#jc-rag-question:focus {
	border-color: #1f6feb;
	box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

#jc-rag-submit {
	position: absolute;
	right: 24px;
	bottom: 24px;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 999px;
	padding: 0;
	background: #1f6feb;
	color: #ffffff;
	font-size: 18px;
	font-weight: 800;
	line-height: 38px;
	text-align: center;
	cursor: pointer;
}

#jc-rag-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.jc-rag-sources {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid #e5e9f0;
	font-size: 12px;
}

.jc-rag-sources-title {
	font-weight: 800;
	margin-bottom: 6px;
	color: #46566b;
}

.jc-rag-source {
	margin: 4px 0;
}

.jc-rag-source a {
	color: #1f6feb;
	text-decoration: none;
}

.jc-rag-source a:hover {
	text-decoration: underline;
}

@media (max-width: 700px) {
	#jc-rag-panel {
		right: 8px;
		left: 8px;
		bottom: 76px;
		width: auto;
		height: calc(100vh - 92px);
	}

	#jc-rag-open {
		right: 16px;
		bottom: 16px;
	}

	#jc-rag-header {
		padding: 10px 14px;
	}

	#jc-rag-messages {
		padding: 14px;
	}
}
