.sjc {
	--sjc-navy: #0a2342;
	--sjc-navy-deep: #061730;
	--sjc-navy-soft: #1d3e6b;
	--sjc-mist: #eaf0f8;
	--sjc-line: #c9d6e8;
	--sjc-ink: #12233d;
	position: fixed;
	inset-block-end: 20px;
	inset-inline-end: 20px;
	z-index: 99999;
	font: inherit;
	font-size: 15px;
	line-height: 1.5;
	color: var(--sjc-ink);
}
.sjc *, .sjc *::before, .sjc *::after { box-sizing: border-box; }
.sjc button, .sjc textarea { font: inherit; color: inherit; margin: 0; }
.sjc svg { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* Launcher */
.sjc-launch {
	display: flex; align-items: center; gap: 10px;
	padding: 12px 20px 12px 16px;
	border: 0; border-radius: 999px;
	background: var(--sjc-navy); color: #fff !important;
	font-weight: 600; letter-spacing: .01em;
	box-shadow: 0 10px 30px -8px rgba(6, 23, 48, .55);
	cursor: pointer;
	transition: background .2s;
}
.sjc-launch svg { transform: rotate(45deg); transition: transform .35s ease; }
.sjc-launch:hover { background: var(--sjc-navy-soft); }
.sjc-launch:hover svg { transform: rotate(45deg) translateY(-3px); }
.sjc.is-open .sjc-launch { display: none; }

/* Panel */
.sjc-panel {
	display: flex; flex-direction: column;
	width: 380px; height: min(620px, calc(100vh - 40px));
	background: #fff;
	border: 1px solid var(--sjc-line);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 24px 60px -20px rgba(6, 23, 48, .45);
}
.sjc-panel[hidden] { display: none; }

.sjc-head {
	display: flex; align-items: center; gap: 10px;
	padding: 16px 14px 16px 18px;
	background: linear-gradient(160deg, var(--sjc-navy) 0%, var(--sjc-navy-deep) 100%);
	color: #fff;
}
.sjc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sjc-title strong { font-size: 16px; }
.sjc-title span { font-size: 12.5px; opacity: .75; }
.sjc-wa {
	padding: 6px 12px; border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, .35);
	color: #fff !important; text-decoration: none !important; font-size: 13px;
}
.sjc-wa:hover { background: rgba(255, 255, 255, .12); }
.sjc-close {
	width: 34px; height: 34px; border: 0; border-radius: 50%;
	background: transparent; color: #fff !important; font-size: 24px; line-height: 1; cursor: pointer;
}
.sjc-close:hover { background: rgba(255, 255, 255, .12); }

/* Messages */
.sjc-log {
	flex: 1; overflow-y: auto;
	padding: 18px 16px;
	display: flex; flex-direction: column; gap: 10px;
	background: #f7f9fc;
}
.sjc-msg {
	max-width: 86%;
	padding: 10px 14px;
	border-radius: 16px;
	white-space: pre-wrap; overflow-wrap: anywhere;
}
.sjc-bot { align-self: flex-start; background: var(--sjc-mist); border-start-start-radius: 4px; }
.sjc-user { align-self: flex-end; background: var(--sjc-navy); color: #fff; border-start-end-radius: 4px; }
.sjc-msg a { color: inherit; text-decoration: underline; }
.sjc-error { background: #fdf0ef; color: #8a2a1f; }
.sjc-wa-cta {
	align-self: flex-start;
	background: #fff; border: 1px solid var(--sjc-navy);
	color: var(--sjc-navy) !important; font-weight: 600; text-decoration: none !important;
}
.sjc-wa-cta:hover { background: var(--sjc-mist); }

.sjc-typing { display: flex; gap: 5px; padding: 14px 16px; }
.sjc-typing::before, .sjc-typing::after {
	content: ""; width: 7px; height: 7px; border-radius: 50%;
	background: var(--sjc-navy-soft); animation: sjc-blink 1s infinite;
}
.sjc-typing::after { animation-delay: .25s; }
@keyframes sjc-blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* Composer */
.sjc-form {
	display: flex; align-items: flex-end; gap: 8px;
	padding: 10px 10px 10px 14px;
	border-top: 1px solid var(--sjc-line);
	background: #fff;
}
.sjc-form textarea {
	flex: 1; resize: none; min-height: 40px; max-height: 120px;
	padding: 9px 2px; border: 0; outline: 0; background: transparent;
}
.sjc-form button {
	width: 40px; height: 40px; border: 0; border-radius: 50%;
	display: grid; place-items: center;
	background: var(--sjc-navy); color: #fff !important; cursor: pointer;
}
.sjc-form button svg { transform: rotate(90deg); }
[dir="rtl"] .sjc-form button svg { transform: rotate(-90deg); }
.sjc-form button:disabled { opacity: .45; cursor: wait; }

.sjc :focus-visible { outline: 2px solid #5b8fd4; outline-offset: 2px; }

@media (max-width: 480px) {
	.sjc { inset-block-end: 14px; inset-inline-end: 14px; }
	.sjc.is-open { inset: 0; }
	.sjc-panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.sjc *, .sjc *::before, .sjc *::after { animation: none !important; transition: none !important; }
}

.sjc-img { display: block; margin: 6px 0; text-decoration: none !important; }
.sjc-img img { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; }
