.scc-root {
	--scc-accent: #0e7c7b;
	--scc-ink: #14232b;
	--scc-mute: #5d6f77;
	--scc-line: #dbe4e5;
	--scc-mist: #f2f6f6;
	--scc-tint: color-mix(in srgb, var(--scc-accent) 11%, #fff);
	--scc-deep: color-mix(in srgb, var(--scc-accent) 78%, #000);
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font-family: inherit;
	font-size: 14.5px;
	line-height: 1.85;
	color: var(--scc-ink);
	-webkit-text-size-adjust: 100%;
}
.scc-root *, .scc-root *::before, .scc-root *::after { box-sizing: border-box; }
.scc-root.scc-pos-left { left: 20px; }
.scc-root.scc-pos-right { right: 20px; }
.scc-root [hidden] { display: none !important; }

/* دکمه‌ی شناور */
.scc-launcher {
	display: grid; place-items: center;
	width: 60px; height: 60px; padding: 0;
	border: 0; border-radius: 50%;
	background: var(--scc-accent); color: #fff;
	box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--scc-accent) 70%, #000), 0 2px 6px rgba(20, 35, 43, .18);
	cursor: pointer;
	transition: transform .18s ease, background-color .18s ease;
}
.scc-launcher:hover { background: var(--scc-deep); transform: translateY(-2px); }
.scc-launcher:focus-visible, .scc-root button:focus-visible, .scc-root a:focus-visible,
.scc-root input:focus-visible, .scc-root textarea:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--scc-accent) 45%, #fff);
	outline-offset: 2px;
}
.scc-ico { display: inline-flex; line-height: 0; }

/* پنل */
.scc-panel {
	position: absolute; bottom: 76px;
	width: min(392px, calc(100vw - 24px));
	height: min(612px, calc(100vh - 110px));
	display: flex; flex-direction: column;
	background: #fff; border: 1px solid var(--scc-line); border-radius: 20px;
	box-shadow: 0 30px 60px -20px rgba(20, 35, 43, .35), 0 8px 20px -10px rgba(20, 35, 43, .2);
	overflow: hidden;
	opacity: 0; transform: translateY(10px) scale(.98);
	transition: opacity .18s ease, transform .18s ease;
	transform-origin: bottom;
}
.scc-pos-left .scc-panel { left: 0; }
.scc-pos-right .scc-panel { right: 0; }
.scc-open .scc-panel { opacity: 1; transform: none; }

.scc-head {
	display: flex; align-items: center; gap: 12px;
	padding: 16px 18px;
	background: var(--scc-accent); color: #fff;
}
.scc-avatar {
	display: grid; place-items: center; flex: none;
	width: 42px; height: 42px; border-radius: 50%;
	background: rgba(255, 255, 255, .18);
}
.scc-avatar .scc-ico svg { width: 22px; height: 22px; }
.scc-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.scc-head-text strong { font-size: 16px; font-weight: 700; }
.scc-head-text span { font-size: 12.5px; opacity: .85; }
.scc-close {
	display: grid; place-items: center; flex: none;
	width: 36px; height: 36px; padding: 0;
	border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer;
}
.scc-close:hover { background: rgba(255, 255, 255, .18); }
.scc-root .scc-head button:focus-visible { outline-color: #fff; }

.scc-body { flex: 1; overflow-y: auto; padding: 18px 16px 8px; background: var(--scc-mist); scroll-behavior: smooth; }
.scc-log { display: flex; flex-direction: column; gap: 12px; }

.scc-msg { display: flex; flex-direction: column; gap: 8px; max-width: 88%; }
.scc-bot { align-self: flex-start; }
.scc-user { align-self: flex-end; }
.scc-bubble {
	padding: 10px 14px; border-radius: 16px;
	white-space: pre-wrap; overflow-wrap: anywhere;
}
.scc-bot .scc-bubble {
	background: #fff; border: 1px solid var(--scc-line);
	border-start-start-radius: 5px;
}
.scc-user .scc-bubble {
	background: var(--scc-accent); color: #fff;
	border-start-end-radius: 5px;
}

/* منابع پاسخ */
.scc-sources { display: flex; flex-direction: column; gap: 6px; }
.scc-src-label { font-size: 12px; color: var(--scc-mute); padding-inline-start: 2px; }
.scc-src {
	display: flex; align-items: center; gap: 8px;
	padding: 7px 10px; border-radius: 8px;
	background: #fff; border: 1px solid var(--scc-line);
	border-inline-start: 3px solid var(--scc-accent);
	color: var(--scc-ink); text-decoration: none; font-size: 13px; line-height: 1.6;
	transition: background-color .15s ease;
}
.scc-src:hover { background: var(--scc-tint); color: var(--scc-deep); }
.scc-src-ico { color: var(--scc-accent); flex: none; }
.scc-src span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* پیشنهادها */
.scc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.scc-chip {
	padding: 6px 13px; border-radius: 999px; cursor: pointer;
	border: 1px solid color-mix(in srgb, var(--scc-accent) 45%, #fff);
	background: #fff; color: var(--scc-deep); font: inherit; font-size: 13px; line-height: 1.7;
	transition: background-color .15s ease;
}
.scc-chip:hover { background: var(--scc-tint); }

/* در حال نوشتن */
.scc-typing .scc-bubble { display: flex; gap: 5px; padding: 14px 16px; }
.scc-typing i {
	width: 7px; height: 7px; border-radius: 50%; background: var(--scc-mute); opacity: .5;
	animation: scc-dot 1s infinite ease-in-out;
}
.scc-typing i:nth-child(2) { animation-delay: .15s; }
.scc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes scc-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }

/* فرم معرفی */
.scc-ident { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 14px; }
.scc-ident-title { margin: 0 0 2px; font-weight: 700; font-size: 15px; }
.scc-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--scc-mute); }
.scc-field input {
	width: 100%; padding: 9px 12px; font: inherit; color: var(--scc-ink);
	background: #fff; border: 1px solid var(--scc-line); border-radius: 10px;
}
.scc-consent { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.8; color: var(--scc-mute); }
.scc-consent input { margin-top: 6px; flex: none; accent-color: var(--scc-accent); }
.scc-hp { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.scc-err { margin: 0; min-height: 0; color: #b42318; font-size: 13px; }
.scc-err:empty { display: none; }
.scc-btn {
	padding: 10px 16px; border: 0; border-radius: 10px; cursor: pointer;
	background: var(--scc-accent); color: #fff; font: inherit; font-weight: 700;
}
.scc-btn:hover { background: var(--scc-deep); }
.scc-btn:disabled { opacity: .6; cursor: progress; }

/* ورودی */
.scc-composer {
	display: flex; align-items: flex-end; gap: 8px;
	padding: 10px 12px; background: #fff; border-top: 1px solid var(--scc-line); margin: 0;
}
.scc-input {
	flex: 1; min-width: 0; max-height: 110px; resize: none; margin: 0;
	padding: 9px 14px; font: inherit; color: var(--scc-ink);
	background: var(--scc-mist); border: 1px solid transparent; border-radius: 18px;
}
.scc-input:focus { background: #fff; border-color: var(--scc-accent); outline: none; }
.scc-send {
	display: grid; place-items: center; flex: none;
	width: 40px; height: 40px; padding: 0;
	border: 0; border-radius: 50%; background: var(--scc-accent); color: #fff; cursor: pointer;
}
.scc-send:hover { background: var(--scc-deep); }
.scc-note { margin: 0; padding: 0 14px 10px; background: #fff; text-align: center; font-size: 11.5px; color: var(--scc-mute); }

@media (max-width: 520px) {
	.scc-root.scc-pos-left, .scc-root.scc-pos-right { bottom: 14px; }
	.scc-root.scc-pos-left { left: 14px; }
	.scc-root.scc-pos-right { right: 14px; }
	.scc-open .scc-panel {
		position: fixed; inset: 0; width: 100%; height: 100%;
		border: 0; border-radius: 0;
	}
	.scc-open .scc-launcher { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
	.scc-panel, .scc-launcher, .scc-src, .scc-chip { transition: none; }
	.scc-typing i { animation: none; }
	.scc-body { scroll-behavior: auto; }
}
