/* NB Telegram Chat — floating support chat */
.nbtgc {
	position: fixed;
	right: 16px;
	bottom: 24px;
	transition: bottom 0.2s ease;
	z-index: 2147482000;
	direction: rtl;
	font-family: inherit;
}
.nbtgc__fab {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 50px;
	padding: 5px 5px 5px 16px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 999px;
	background: linear-gradient(135deg, #f04a84 0%, #d81b60 100%);
	color: #fff;
	font: inherit;
	font-size: 13.5px;
	font-weight: 800;
	cursor: pointer;
}
.nbtgc__fab svg {
	width: 38px;
	height: 38px;
	padding: 9px;
	box-sizing: border-box;
	border-radius: 50%;
	background: #fff;
	color: #e0186a;
	flex-shrink: 0;
}
.nbtgc.is-open .nbtgc__fab-text { display: none; }
.nbtgc.is-open .nbtgc__fab { padding: 5px; }
.nbtgc__dot {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #16a34a;
	box-shadow: 0 0 0 2px #fff;
}
.nbtgc__panel {
	position: absolute;
	right: 0;
	bottom: 62px;
	width: min(360px, calc(100vw - 32px));
	height: min(480px, calc(100vh - 160px));
	display: flex;
	flex-direction: column;
	border-radius: 20px;
	background: var(--bg-surface, #fff);
	border: 1px solid rgba(236, 44, 111, 0.16);
	box-shadow: 0 18px 40px rgba(30, 16, 24, 0.18);
	overflow: hidden;
}
.nbtgc__panel[hidden] { display: none; }
.nbtgc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	background: linear-gradient(135deg, #ec2c6f, #c2185b);
	color: #fff;
}
.nbtgc__title { font-size: 14px; }
.nbtgc__titlebox { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nbtgc__status { font-size: 11px; opacity: 0.9; display: flex; align-items: center; gap: 5px; }
.nbtgc__status--on::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; flex: none; }
.nbtgc__close {
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.nbtgc__list {
	flex: 1;
	overflow-y: auto;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: var(--bg-soft, #fdf7fa);
}
.nbtgc__msg {
	max-width: 85%;
	padding: 9px 12px 18px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.8;
	white-space: pre-wrap;
	word-break: break-word;
	position: relative;
}
.nbtgc__msg--admin {
	align-self: flex-end; /* RTL: left side */
	background: var(--bg-surface, #fff);
	color: var(--text-dark, #26232b);
	border: 1px solid var(--border, #eee3ea);
	border-top-left-radius: 4px;
}
.nbtgc__msg--me {
	align-self: flex-start; /* RTL: right side */
	background: #ec2c6f;
	color: #fff;
	border-top-right-radius: 4px;
}
.nbtgc__at {
	position: absolute;
	bottom: 3px;
	left: 10px;
	font-size: 10px;
	opacity: 0.7;
}
.nbtgc__form {
	padding: 10px;
	border-top: 1px solid var(--border, #eee3ea);
	background: var(--bg-surface, #fff);
}
.nbtgc__profile {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	margin-bottom: 6px;
}
.nbtgc__profile[hidden] { display: none; }
.nbtgc__in,
.nbtgc__ta {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--border, #eee3ea);
	border-radius: 12px;
	padding: 8px 10px;
	font: inherit;
	font-size: 13.5px;
	background: var(--bg-surface, #fff);
	color: var(--text-dark, #26232b);
}
.nbtgc__row {
	display: flex;
	gap: 6px;
	align-items: flex-end;
}
.nbtgc__ta {
	resize: none;
	min-height: 44px;
	max-height: 110px;
}
.nbtgc__send {
	flex-shrink: 0;
	min-height: 44px;
	padding: 0 14px;
	border: 0;
	border-radius: 12px;
	background: #ec2c6f;
	color: #fff;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
}
.nbtgc__send:disabled { opacity: 0.6; cursor: wait; }
.nbtgc__err {
	margin-top: 6px;
	color: #b91c1c;
	font-size: 12px;
}
.nbtgc__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	opacity: 0;
}

/* Phones: sit above the theme's bottom navigation bar. */
@media (max-width: 768px) {
	.nbtgc { right: 12px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
	/* Smaller launcher on phones (iPhone especially). */
	.nbtgc__fab { min-height: 38px; gap: 6px; padding: 3px 3px 3px 11px; font-size: 11.5px; font-weight: 700; box-shadow: 0 4px 12px rgba(216, 27, 96, 0.28); }
	.nbtgc__fab svg { width: 30px; height: 30px; padding: 7px; }
	.nbtgc.is-open .nbtgc__fab { padding: 3px; }
	.nbtgc__dot { width: 9px; height: 9px; top: 1px; left: 1px; }
	/* Product page: the theme sticky add-to-cart bar is open — sit above it, icon only. */
	body.nb-sticky-atc-open .nbtgc { bottom: calc(168px + env(safe-area-inset-bottom, 0px)); }
	body.nb-sticky-atc-open .nbtgc:not(.is-open) .nbtgc__fab { padding: 5px; }
	body.nb-sticky-atc-open .nbtgc:not(.is-open) .nbtgc__fab-text { display: none; }
	.nbtgc__panel { height: min(460px, calc(100vh - 220px)); }
}
@media (max-width: 380px) {
	.nbtgc:not(.is-open) .nbtgc__fab { padding: 3px; }
	.nbtgc:not(.is-open) .nbtgc__fab-text { display: none; }
}
