/* HS Live Chat — frontend */

.hschat-root {
	--hschat-btn-bg: #0b0f19;
	--hschat-btn-color: #fff;
	--hschat-header-bg: #0b0f19;
	--hschat-header-color: #fff;
	--hschat-accent: #f5a623;
	--hschat-size: 56px;
	--hschat-offset-x: 20px;
	--hschat-offset-y: 24px;
	--hschat-z: 99985;
	font-family: inherit;
	line-height: 1.45;
	position: fixed;
	bottom: var(--hschat-offset-y);
	z-index: var(--hschat-z);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	pointer-events: none;
}

.hschat-root[hidden] {
	display: none !important;
}

.hschat-pos-right {
	right: var(--hschat-offset-x);
	left: auto;
	align-items: flex-end;
}

.hschat-pos-left {
	left: var(--hschat-offset-x);
	right: auto;
	align-items: flex-start;
}

.hschat-fab,
.hschat-panel {
	pointer-events: auto;
}

.hschat-fab {
	position: relative;
	width: var(--hschat-size);
	height: var(--hschat-size);
	border: 0;
	border-radius: 50%;
	background: var(--hschat-btn-bg);
	color: var(--hschat-btn-color);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hschat-fab:hover,
.hschat-fab:focus-visible {
	transform: scale(1.06);
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
	outline: none;
}

.hschat-fab__icon {
	display: inline-flex;
	width: 52%;
	height: 52%;
}

.hschat-fab__icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.hschat-fab__icon--close {
	display: none;
	width: 42%;
	height: 42%;
}

.hschat-fab.is-open .hschat-fab__icon--main {
	display: none;
}

.hschat-fab.is-open .hschat-fab__icon--close {
	display: inline-flex;
}

.hschat-fab__badge {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: #d63638;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	box-shadow: 0 0 0 2px #fff;
}

.hschat-fab__badge[hidden] {
	display: none !important;
}

.hschat-panel {
	width: min(360px, calc(100vw - 28px));
	height: min(520px, calc(100vh - 120px));
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform-origin: bottom right;
	animation: hschat-pop 0.22s ease;
}

.hschat-pos-left .hschat-panel {
	transform-origin: bottom left;
}

.hschat-panel[hidden] {
	display: none !important;
}

@keyframes hschat-pop {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.hschat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 14px 14px 14px 16px;
	background: var(--hschat-header-bg);
	color: var(--hschat-header-color);
}

.hschat-header__title {
	display: block;
	font-size: 15px;
	font-weight: 600;
}

.hschat-header__status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	opacity: 0.85;
	margin-top: 2px;
}

.hschat-header__status::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #9ca3af;
}

.hschat-header__status.is-online::before {
	background: #22c55e;
}

.hschat-header__close {
	border: 0;
	background: transparent;
	color: inherit;
	opacity: 0.8;
	cursor: pointer;
	padding: 4px;
	border-radius: 6px;
	display: inline-flex;
}

.hschat-header__close:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.1);
}

.hschat-body {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f3f4f6;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.hschat-welcome {
	background: #fff;
	border-radius: 12px;
	padding: 14px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.hschat-welcome h3 {
	margin: 0 0 6px;
	font-size: 16px;
	color: #111827;
}

.hschat-welcome p {
	margin: 0 0 12px;
	font-size: 13px;
	color: #4b5563;
}

.hschat-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.hschat-form label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 12px;
	color: #6b7280;
}

.hschat-form input,
.hschat-form textarea {
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 8px 10px;
	font: inherit;
	font-size: 14px;
	color: #111827;
	background: #fff;
	resize: vertical;
}

.hschat-form input:focus,
.hschat-form textarea:focus,
.hschat-compose textarea:focus {
	outline: none;
	border-color: var(--hschat-accent);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--hschat-accent) 25%, transparent);
}

.hschat-form .hschat-btn {
	margin-top: 4px;
	border: 0;
	border-radius: 8px;
	padding: 10px 12px;
	background: var(--hschat-btn-bg);
	color: var(--hschat-btn-color);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.hschat-form .hschat-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.hschat-error {
	color: #b91c1c;
	font-size: 12px;
	margin: 0;
}

.hschat-msg {
	max-width: 85%;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.hschat-msg--visitor {
	align-self: flex-end;
}

.hschat-msg--agent {
	align-self: flex-start;
}

.hschat-msg__bubble {
	padding: 9px 12px;
	border-radius: 14px;
	font-size: 14px;
	white-space: pre-wrap;
	word-break: break-word;
}

.hschat-msg--visitor .hschat-msg__bubble {
	background: var(--hschat-btn-bg);
	color: var(--hschat-btn-color);
	border-bottom-right-radius: 4px;
}

.hschat-msg--agent .hschat-msg__bubble {
	background: #fff;
	color: #111827;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hschat-msg__time {
	font-size: 11px;
	color: #9ca3af;
	padding: 0 4px;
}

.hschat-msg--visitor .hschat-msg__time {
	text-align: right;
}

.hschat-compose {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #e5e7eb;
	background: #fff;
}

.hschat-compose[hidden] {
	display: none !important;
}

.hschat-compose textarea {
	flex: 1;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	padding: 10px 12px;
	font: inherit;
	font-size: 14px;
	resize: none;
	max-height: 100px;
	min-height: 42px;
	line-height: 1.35;
}

.hschat-send {
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: var(--hschat-accent);
	color: #0b0f19;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}

.hschat-send:hover {
	filter: brightness(1.05);
}

.hschat-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.hschat-attach {
	position: relative;
	flex-shrink: 0;
	width: 36px;
	height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #6b7280;
}

.hschat-attach[hidden] {
	display: none !important;
}

.hschat-attach input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	width: 100%;
	height: 100%;
}

.hschat-attach__btn {
	display: inline-flex;
	pointer-events: none;
}

.hschat-file-chip {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 12px 10px;
	padding: 6px 10px;
	background: #eef2ff;
	border-radius: 8px;
	font-size: 12px;
	color: #3730a3;
	pointer-events: auto;
}

.hschat-file-chip[hidden] {
	display: none !important;
}

.hschat-file-chip__x {
	border: 0;
	background: transparent;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	color: inherit;
	padding: 0 2px;
}

.hschat-msg__image {
	display: block;
	margin-top: 4px;
	border-radius: 10px;
	overflow: hidden;
	max-width: 220px;
}

.hschat-msg__image img {
	display: block;
	width: 100%;
	height: auto;
}

.hschat-msg__file {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	padding: 8px 10px;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.06);
	color: inherit;
	font-size: 13px;
	text-decoration: none;
	word-break: break-all;
}

.hschat-msg--visitor .hschat-msg__file {
	background: rgba(255, 255, 255, 0.18);
	color: inherit;
}

.hschat-wa {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin: 0 0 12px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #25d366;
	color: #fff !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
	box-sizing: border-box;
}

.hschat-wa:hover {
	filter: brightness(1.05);
	color: #fff !important;
}

@media (max-width: 782px) {
	.hschat-root.is-hide-mobile {
		display: none !important;
	}

	.hschat-panel {
		width: min(100vw - 20px, 400px);
		height: min(70vh, 560px);
	}
}

@media (min-width: 783px) {
	.hschat-root.is-hide-desktop {
		display: none !important;
	}
}
