#asc-root {
	--asc-color: #2b0f5c;
	position: fixed;
	bottom: 20px;
	z-index: 2147483000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: #1f1b2e;
}
#asc-root.asc--right { right: 20px; }
#asc-root.asc--left { left: 20px; }
#asc-root *, #asc-root *::before, #asc-root *::after { box-sizing: border-box; }
#asc-root [hidden] { display: none !important; }
#asc-root button, #asc-root input, #asc-root textarea { font: inherit; margin: 0; letter-spacing: normal; text-transform: none; }

/* launcher */
#asc-root .asc-launcher {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--asc-color);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(20, 10, 50, 0.28);
}
#asc-root .asc-launcher:hover { filter: brightness(1.12); }
#asc-root .asc-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: #e5365b;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 20px;
	text-align: center;
}

/* panel */
#asc-root .asc-panel {
	position: absolute;
	bottom: 72px;
	display: flex;
	flex-direction: column;
	width: 370px;
	max-width: calc(100vw - 24px);
	height: min(600px, calc(100vh - 110px));
	overflow: hidden;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 12px 40px rgba(20, 10, 50, 0.3);
}
#asc-root.asc--right .asc-panel { right: 0; }
#asc-root.asc--left .asc-panel { left: 0; }
#asc-root .asc-panel:not([hidden]) { animation: asc-in 0.16s ease-out; }
@keyframes asc-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

#asc-root .asc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: var(--asc-color);
	color: #fff;
}
#asc-root .asc-title { font-size: 16px; font-weight: 600; }
#asc-root .asc-sub { min-height: 18px; font-size: 13px; opacity: 0.85; }
#asc-root .asc-sub.is-online::before,
#asc-root .asc-sub.is-away::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 6px;
	border-radius: 50%;
	background: #8a85a0;
}
#asc-root .asc-sub.is-online::before { background: #4ade80; }
#asc-root .asc-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
}
#asc-root .asc-close:hover { background: rgba(255, 255, 255, 0.16); }

/* pre-chat form */
#asc-root .asc-pre {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	overflow-y: auto;
	background: #fff;
}
#asc-root .asc-intro { margin: 0; color: #3b3555; }
#asc-root .asc-field { display: flex; flex-direction: column; gap: 4px; }
#asc-root .asc-field label { font-size: 13px; font-weight: 600; color: #3b3555; }
#asc-root .asc-field input,
#asc-root .asc-field textarea,
#asc-root .asc-input {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid #cfcadd;
	border-radius: 8px;
	background: #fff;
	color: #1f1b2e;
	box-shadow: none;
}
#asc-root .asc-field textarea { resize: vertical; min-height: 76px; }
#asc-root .asc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#asc-root .asc-btn {
	padding: 11px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--asc-color);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}
#asc-root .asc-btn:hover { filter: brightness(1.12); }
#asc-root .asc-btn:disabled { opacity: 0.6; cursor: default; }

/* conversation */
#asc-root .asc-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 16px;
	overflow-y: auto;
	background: #fff;
}
#asc-root .asc-msg { display: flex; flex-direction: column; max-width: 84%; }
#asc-root .asc-msg--customer { align-self: flex-end; align-items: flex-end; }
#asc-root .asc-msg--agent,
#asc-root .asc-msg--system { align-self: flex-start; align-items: flex-start; }
#asc-root .asc-msg--pending { opacity: 0.6; }
#asc-root .asc-bubble {
	padding: 9px 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
#asc-root .asc-msg--customer .asc-bubble { background: var(--asc-color); color: #fff; border-bottom-right-radius: 4px; }
#asc-root .asc-msg--agent .asc-bubble { background: #efedf5; color: #1f1b2e; border-bottom-left-radius: 4px; }
#asc-root .asc-msg--system .asc-bubble { background: #f7f5fb; color: #4a4560; border: 1px solid #e4e0ee; border-bottom-left-radius: 4px; }
#asc-root .asc-who { margin: 0 4px 3px; font-size: 12px; color: #5d5775; }
#asc-root .asc-time { margin: 3px 4px 0; font-size: 11px; color: #6f6a86; }

#asc-root .asc-err { margin: 0; padding: 0; color: #b4232f; font-size: 13px; }
#asc-root .asc-err--chat { padding: 6px 16px; background: #fff; }

#asc-root .asc-comp {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #e4e0ee;
	background: #fff;
}
#asc-root .asc-input { flex: 1; min-height: 40px; max-height: 110px; resize: none; }
#asc-root .asc-send {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex: none;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--asc-color);
	color: #fff;
	cursor: pointer;
}
#asc-root .asc-send:hover { filter: brightness(1.12); }

/* keyboard focus */
#asc-root button:focus-visible,
#asc-root input:focus-visible,
#asc-root textarea:focus-visible {
	outline: 3px solid #8b6cf0;
	outline-offset: 2px;
}

/* phones: full-screen panel */
@media (max-width: 480px) {
	#asc-root .asc-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		max-width: none;
		height: 100%;
		border-radius: 0;
	}
	#asc-root.asc--open .asc-launcher { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	#asc-root .asc-panel:not([hidden]) { animation: none; }
}

/* attachments */
#asc-root .asc-attach {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex: none;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #5d5775;
	cursor: pointer;
}
#asc-root .asc-attach:hover { background: #efedf5; }
#asc-root .asc-file { display: block; max-width: 100%; margin-top: 4px; }
#asc-root .asc-img {
	display: block;
	max-width: 220px;
	max-height: 220px;
	border: 1px solid #e4e0ee;
	border-radius: 12px;
	object-fit: cover;
}
#asc-root .asc-file--doc {
	padding: 8px 12px;
	border: 1px solid #e4e0ee;
	border-radius: 12px;
	background: #f7f5fb;
	color: var(--asc-color);
	text-decoration: underline;
	overflow-wrap: anywhere;
}
