/* HTT Telegram Live Chat */
.htt-chat {
	--htt-accent: var(--tp-theme-secondary, #05dac3);
	--htt-dark: var(--tp-theme-primary, #020626);
	--htt-text: #1d2330;
	--htt-muted: #6b7385;
	--htt-bg: #f4f6fa;
	position: fixed;
	right: 44px;
	bottom: 44px;
	z-index: 9990;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
}

/* Theme back-to-top button sits above the chat bubble. */
.back-to-top-wrapper.back-to-top-btn-show {
	bottom: 116px;
	right: 50px;
}

.htt-chat__bubble {
	position: relative;
	width: 56px;
	height: 56px;
	border: 0;
	border-radius: 50%;
	background: var(--htt-accent);
	color: var(--htt-dark);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 24px rgba(2, 6, 38, 0.25);
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.htt-chat__bubble:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 28px rgba(2, 6, 38, 0.3);
}
.htt-chat__bubble:focus-visible {
	outline: 3px solid var(--htt-dark);
	outline-offset: 3px;
}
.htt-chat__badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: #e5484d;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
}

.htt-chat__panel {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: 370px;
	height: min(560px, calc(100vh - 140px));
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 22px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(2, 6, 38, 0.28);
	animation: htt-chat-in 0.2s ease-out;
}
.htt-chat__panel[hidden] {
	display: none;
}
@keyframes htt-chat-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

.htt-chat__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 16px 16px 20px;
	background: var(--htt-dark);
	color: #fff;
}
.htt-chat__logo {
	width: 64px;
	height: auto;
	flex: none;
}
.htt-chat__headtext {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}
.htt-chat__headtext strong {
	font-size: 16px;
	font-weight: 600;
	color: #fff;
}
.htt-chat__headtext span {
	font-size: 12.5px;
	color: rgba(255, 255, 255, 0.72);
}
.htt-chat__iconbtn {
	flex: none;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.htt-chat__iconbtn:hover {
	background: rgba(255, 255, 255, 0.2);
}
.htt-chat__mute {
	margin-right: -4px;
}
.htt-chat__row.is-pending .htt-chat__msg {
	opacity: 0.6;
}
.htt-chat__row.is-failed .htt-chat__msg {
	background: #ffe3e3;
	color: #8a1c1c;
}

.htt-chat__log {
	flex: 1;
	overflow-y: auto;
	padding: 18px 14px 8px;
	background: var(--htt-bg);
	overscroll-behavior: contain;
}
.htt-chat__row {
	display: flex;
	margin-bottom: 10px;
}
.htt-chat__row--visitor {
	justify-content: flex-end;
}
.htt-chat__row--system {
	justify-content: center;
}
.htt-chat__msg {
	max-width: 82%;
	padding: 10px 14px 6px;
	border-radius: 18px;
	background: #fff;
	color: var(--htt-text);
	box-shadow: 0 1px 2px rgba(2, 6, 38, 0.06);
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.htt-chat__row--agent .htt-chat__msg,
.htt-chat__row--bot .htt-chat__msg {
	border-bottom-left-radius: 6px;
}
.htt-chat__row--visitor .htt-chat__msg {
	background: var(--htt-accent);
	color: var(--htt-dark);
	border-bottom-right-radius: 6px;
}
.htt-chat__row--system .htt-chat__msg {
	max-width: 92%;
	padding: 8px 14px;
	background: transparent;
	box-shadow: none;
	color: var(--htt-muted);
	font-size: 13px;
	text-align: center;
}
.htt-chat__who {
	display: block;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--htt-muted);
	margin-bottom: 2px;
}
.htt-chat__text {
	white-space: pre-wrap;
}
.htt-chat__text a,
.htt-chat__links a {
	color: inherit;
	text-decoration: underline;
}
.htt-chat__time {
	display: block;
	margin-top: 2px;
	font-size: 11px;
	color: var(--htt-muted);
	text-align: right;
}
.htt-chat__row--visitor .htt-chat__time {
	color: rgba(2, 6, 38, 0.55);
}
.htt-chat__links {
	list-style: none;
	margin: 8px 0 2px;
	padding: 0;
}
.htt-chat__links li {
	margin: 0 0 6px;
}
.htt-chat__links a {
	display: block;
	padding: 7px 12px;
	border-radius: 12px;
	background: var(--htt-bg);
	text-decoration: none;
	font-size: 14px;
}
.htt-chat__links a:hover {
	background: #e6ebf3;
}

.htt-chat__quick {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 2px 0 12px;
}
.htt-chat__chip {
	padding: 7px 14px;
	border: 1px solid var(--htt-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--htt-dark);
	font-size: 13.5px;
	cursor: pointer;
	transition: background 0.15s ease;
}
.htt-chat__chip:hover {
	background: var(--htt-accent);
}

.htt-chat__emailform {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 12px;
	padding: 12px;
	border-radius: 16px;
	background: #fff;
}
.htt-chat__emailform input {
	flex: 1 1 100%;
	height: 40px;
	padding: 0 14px;
	border: 1px solid #dde2ea;
	border-radius: 999px;
	font-size: 14px;
	background: #fff;
}
.htt-chat__emailform button {
	flex: 1 1 100%;
	height: 40px;
	border: 0;
	border-radius: 999px;
	background: var(--htt-dark);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

.htt-chat__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px 12px;
	background: #fff;
	border-top: 1px solid #eceff4;
}
.htt-chat__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}
.htt-chat__input {
	flex: 1;
	min-height: 44px;
	max-height: 120px;
	padding: 11px 16px;
	border: 1px solid #dde2ea;
	border-radius: 22px;
	resize: none;
	font: inherit;
	font-size: 15px;
	line-height: 1.4;
	color: var(--htt-text);
	background: #fff;
	outline: none;
}
.htt-chat__input:focus {
	border-color: var(--htt-accent);
}
.htt-chat__send {
	flex: none;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: var(--htt-dark);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.htt-chat__send:disabled {
	opacity: 0.5;
	cursor: default;
}

@media (max-width: 575px) {
	.htt-chat {
		right: 16px;
		bottom: 16px;
	}
	.back-to-top-wrapper.back-to-top-btn-show {
		right: 22px;
		bottom: 86px;
	}
	.htt-chat__panel {
		position: fixed;
		inset: 0;
		width: auto;
		height: auto;
		border-radius: 0;
	}
	.htt-chat.is-open .htt-chat__bubble {
		display: none;
	}
	.htt-chat__input {
		font-size: 16px; /* prevents iOS zoom on focus */
	}
}

.htt-chat__captcha {
	padding: 0 12px;
	background: #fff;
}
.htt-chat__captcha:empty {
	display: none;
}
