
/* =========================================================
   VCtronic Live Chat — Widget Styles
   ========================================================= */

#tlc-widget,
#tlc-widget * {
	box-sizing: border-box;
}

#tlc-widget .tlc-w__intro[hidden],
#tlc-widget .tlc-w__body[hidden],
#tlc-widget .tlc-w__form[hidden] {
	display: none !important;
}

#tlc-widget {
	--tlc-w-blue: #e21b23;
	--tlc-w-blue-dark: #bd151b;
	--tlc-w-ink: #1c2733;
	--tlc-w-muted: #8a97a4;
	--tlc-w-line: #e8edf2;
	--tlc-w-bg-body: #f4f7fa;
	--tlc-w-bg-form: #ffffff;

	all: initial;
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 2147483000;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.45;
}

/* Launcher */
#tlc-widget .tlc-w__launcher {
	all: unset;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--tlc-w-blue), var(--tlc-w-blue-dark));
	color: #fff;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(226, 27, 35, .3);
	transition: transform .15s ease, box-shadow .15s ease;
}

#tlc-widget .tlc-w__launcher:hover {
	transform: scale(1.06);
	box-shadow: 0 10px 28px rgba(226, 27, 35, .4);
}

#tlc-widget.is-open .tlc-w__launcher {
	transform: scale(.9);
	opacity: 0;
	pointer-events: none;
}

/* Panel */
#tlc-widget .tlc-w__panel {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 110px);
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: #fff;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 16px 50px rgba(20, 40, 60, .25);
	transform: translateY(16px) scale(.96);
	opacity: 0;
	pointer-events: none;
	transition: transform .2s ease, opacity .2s ease;
}

#tlc-widget.is-open .tlc-w__panel {
	transform: translateY(0) scale(1);
	opacity: 1;
	pointer-events: auto;
}

/* Header */
#tlc-widget .tlc-w__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: linear-gradient(135deg, var(--tlc-w-blue), var(--tlc-w-blue-dark));
	color: #fff;
	flex: 0 0 auto;
}

#tlc-widget .tlc-w__head-info {
	display: flex;
	align-items: center;
	gap: 10px;
}

#tlc-widget .tlc-w__avatar {
	position: relative;
	width: 38px;
	height: 38px;
	flex: 0 0 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .22);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}

#tlc-widget .tlc-w__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

#tlc-widget .tlc-w__online {
	position: absolute;
	right: -1px;
	bottom: -1px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #4ade80;
	border: 2px solid var(--tlc-w-blue-dark);
	box-sizing: border-box;
}

#tlc-widget .tlc-w__title {
	font-size: 15px;
	font-weight: 700;
	color: #fff;
}

#tlc-widget .tlc-w__close {
	all: unset;
	cursor: pointer;
	font-size: 26px;
	line-height: 1;
	color: #fff;
	opacity: .85;
	padding: 0 4px;
}

#tlc-widget .tlc-w__close:hover {
	opacity: 1;
}

/* Intro / name screen */
#tlc-widget .tlc-w__intro {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 30px 24px;
	background: #f4f7fa;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

#tlc-widget .tlc-w__avatar--lg {
	width: 72px;
	height: 72px;
	flex: 0 0 72px;
	background: linear-gradient(135deg, var(--tlc-w-blue), var(--tlc-w-blue-dark));
	margin-bottom: 16px;
	box-shadow: 0 6px 18px rgba(226, 27, 35, .3);
}

#tlc-widget .tlc-w__welcome {
	margin: 0 0 20px;
	font-size: 15px;
	color: var(--tlc-w-ink);
}

#tlc-widget .tlc-w__name-form {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#tlc-widget .tlc-w__name-input {
	all: unset;
	width: 100%;
	box-sizing: border-box;
	padding: 11px 14px;
	border: 1px solid var(--tlc-w-line);
	border-radius: 12px;
	font-size: 14px;
	color: var(--tlc-w-ink);
	background: #fff;
	text-align: center;
}

#tlc-widget .tlc-w__name-input:focus {
	border-color: var(--tlc-w-blue);
}

#tlc-widget .tlc-w__name-btn {
	all: unset;
	cursor: pointer;
	padding: 11px 14px;
	border-radius: 12px;
	background: var(--tlc-w-blue);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	transition: background .15s;
}

#tlc-widget .tlc-w__name-btn:hover {
	background: var(--tlc-w-blue-dark);
}

/* Messages body */
#tlc-widget .tlc-w__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 18px;
	background: var(--tlc-w-bg-body);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#tlc-widget .tlc-msg-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 85%;
}

#tlc-widget .tlc-msg-row--in {
	align-self: flex-end;
	flex-direction: row-reverse;
}

#tlc-widget .tlc-msg-row--out {
	align-self: flex-start;
}

#tlc-widget .tlc-msg-avatar {
	width: 28px;
	height: 28px;
	flex: 0 0 28px;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
	background-color: #dde6ee;
}

#tlc-widget .tlc-msg {
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 14px;
	color: var(--tlc-w-ink);
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

#tlc-widget .tlc-msg--in {
	background: var(--tlc-w-blue);
	color: #fff;
	border-bottom-right-radius: 4px;
}

#tlc-widget .tlc-msg--out {
	background: #fff;
	border: 1px solid var(--tlc-w-line);
	border-bottom-left-radius: 4px;
}

/* Message form */
#tlc-widget .tlc-w__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	background: var(--tlc-w-bg-form);
	border-top: 1px solid var(--tlc-w-line);
	flex: 0 0 auto;
}

#tlc-widget .tlc-w__input {
	all: unset;
	flex: 1 1 auto;
	min-width: 0;
	max-height: 110px;
	min-height: 22px;
	overflow-y: auto;
	padding: 9px 12px;
	border: 1px solid var(--tlc-w-line);
	border-radius: 12px;
	font-size: 14px;
	color: var(--tlc-w-ink);
	background: #fafcfe;
	font-family: inherit;
	resize: none;
	white-space: pre-wrap;
	word-wrap: break-word;
}

#tlc-widget .tlc-w__input:focus {
	border-color: var(--tlc-w-blue);
	background: #fff;
}

#tlc-widget .tlc-w__send {
	all: unset;
	cursor: pointer;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: var(--tlc-w-blue);
	color: #fff;
	transition: background .15s;
}

#tlc-widget .tlc-w__send:hover {
	background: var(--tlc-w-blue-dark);
}

#tlc-widget .tlc-w__send[disabled] {
	opacity: .5;
	cursor: default;
}

/* =========================================================
   MOBILE — FULL SCREEN + KEYBOARD AWARE
   ========================================================= */

@media screen and (max-width: 600px) {

	#tlc-widget {
		right: 14px;
		bottom: 14px;
	}

	/* Root follows the actual visible iPhone viewport. */
	html body #tlc-widget.is-open {
		position: fixed !important;
		top: var(--tlc-vv-top, 0px) !important;
		left: 0 !important;
		right: auto !important;
		bottom: auto !important;
		width: 100% !important;
		height: var(--tlc-vv-height, 100dvh) !important;
		margin: 0 !important;
		padding: 0 !important;
		z-index: 2147483647 !important;
	}

	/* Full-screen panel fills the visible viewport. */
	html body #tlc-widget.is-open .tlc-w__panel {
		position: absolute !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		max-width: none !important;
		height: 100% !important;
		max-height: none !important;
		margin: 0 !important;
		border: 0 !important;
		border-radius: 0 !important;
		box-shadow: none !important;
		display: flex !important;
		flex-direction: column !important;
		min-height: 0 !important;
		transform: none !important;
		opacity: 1 !important;
		pointer-events: auto !important;
		overflow: hidden !important;
	}

	html body #tlc-widget.is-open .tlc-w__head {
		padding-top: calc(14px + env(safe-area-inset-top, 0px)) !important;
		flex: 0 0 auto !important;
	}

	html body #tlc-widget.is-open .tlc-w__body,
	html body #tlc-widget.is-open .tlc-w__intro {
		flex: 1 1 auto !important;
		min-height: 0 !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}

	html body #tlc-widget.is-open .tlc-w__form {
		flex: 0 0 auto !important;
		padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
	}

	#tlc-widget .tlc-w__input,
	#tlc-widget .tlc-w__name-input {
		font-size: 16px !important;
	}
}

	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--tlc-w-blue), var(--tlc-w-blue-dark));
	color: #fff;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(226, 27, 35, .3);
	transition: transform .15s ease, box-shadow .15s ease;
}

#tlc-widget .tlc-w__launcher:hover {
	transform: scale(1.06);
	box-shadow: 0 10px 28px rgba(226, 27, 35, .4);
}

#tlc-widget.is-open .tlc-w__launcher {
	transform: scale(.9);
	opacity: 0;
	pointer-events: none;
}

/* Panel */
#tlc-widget .tlc-w__panel {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 110px);
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: #fff;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 16px 50px rgba(20, 40, 60, .25);
	transform: translateY(16px) scale(.96);
	opacity: 0;
	pointer-events: none;
	transition: transform .2s ease, opacity .2s ease;
}

#tlc-widget.is-open .tlc-w__panel {
	transform: translateY(0) scale(1);
	opacity: 1;
	pointer-events: auto;
}

/* Header */
#tlc-widget .tlc-w__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: linear-gradient(135deg, var(--tlc-w-blue), var(--tlc-w-blue-dark));
	color: #fff;
	flex: 0 0 auto;
}

#tlc-widget .tlc-w__head-info {
	display: flex;
	align-items: center;
	gap: 10px;
}

#tlc-widget .tlc-w__avatar {
	position: relative;
	width: 38px;
	height: 38px;
	flex: 0 0 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .22);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
}

#tlc-widget .tlc-w__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

#tlc-widget .tlc-w__online {
	position: absolute;
	right: -1px;
	bottom: -1px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #4ade80;
	border: 2px solid var(--tlc-w-blue-dark);
	box-sizing: border-box;
}

#tlc-widget .tlc-w__title {
	font-size: 15px;
	font-weight: 700;
	color: #fff;
}

#tlc-widget .tlc-w__close {
	all: unset;
	cursor: pointer;
	font-size: 26px;
	line-height: 1;
	color: #fff;
	opacity: .85;
	padding: 0 4px;
}

#tlc-widget .tlc-w__close:hover {
	opacity: 1;
}

/* Intro / name screen */
#tlc-widget .tlc-w__intro {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 30px 24px;
	background: #f4f7fa;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

#tlc-widget .tlc-w__avatar--lg {
	width: 72px;
	height: 72px;
	flex: 0 0 72px;
	background: linear-gradient(135deg, var(--tlc-w-blue), var(--tlc-w-blue-dark));
	margin-bottom: 16px;
	box-shadow: 0 6px 18px rgba(226, 27, 35, .3);
}

#tlc-widget .tlc-w__welcome {
	margin: 0 0 20px;
	font-size: 15px;
	color: var(--tlc-w-ink);
}

#tlc-widget .tlc-w__name-form {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#tlc-widget .tlc-w__name-input {
	all: unset;
	width: 100%;
	box-sizing: border-box;
	padding: 11px 14px;
	border: 1px solid var(--tlc-w-line);
	border-radius: 12px;
	font-size: 14px;
	color: var(--tlc-w-ink);
	background: #fff;
	text-align: center;
}

#tlc-widget .tlc-w__name-input:focus {
	border-color: var(--tlc-w-blue);
}

#tlc-widget .tlc-w__name-btn {
	all: unset;
	cursor: pointer;
	padding: 11px 14px;
	border-radius: 12px;
	background: var(--tlc-w-blue);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	transition: background .15s;
}

#tlc-widget .tlc-w__name-btn:hover {
	background: var(--tlc-w-blue-dark);
}

/* Messages body */
#tlc-widget .tlc-w__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 18px;
	background: var(--tlc-w-bg-body);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#tlc-widget .tlc-msg-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	max-width: 85%;
}

#tlc-widget .tlc-msg-row--in {
	align-self: flex-end;
	flex-direction: row-reverse;
}

#tlc-widget .tlc-msg-row--out {
	align-self: flex-start;
}

#tlc-widget .tlc-msg-avatar {
	width: 28px;
	height: 28px;
	flex: 0 0 28px;
	border-radius: 50%;
	background-size: cover;
	background-position: center;
	background-color: #dde6ee;
}

#tlc-widget .tlc-msg {
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 14px;
	color: var(--tlc-w-ink);
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

#tlc-widget .tlc-msg--in {
	background: var(--tlc-w-blue);
	color: #fff;
	border-bottom-right-radius: 4px;
}

#tlc-widget .tlc-msg--out {
	background: #fff;
	border: 1px solid var(--tlc-w-line);
	border-bottom-left-radius: 4px;
}

/* Message form */
#tlc-widget .tlc-w__form {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px;
	background: var(--tlc-w-bg-form);
	border-top: 1px solid var(--tlc-w-line);
	flex: 0 0 auto;
}

#tlc-widget .tlc-w__input {
	all: unset;
	flex: 1 1 auto;
	min-width: 0;
	max-height: 110px;
	min-height: 22px;
	overflow-y: auto;
	padding: 9px 12px;
	border: 1px solid var(--tlc-w-line);
	border-radius: 12px;
	font-size: 14px;
	color: var(--tlc-w-ink);
	background: #fafcfe;
	font-family: inherit;
	resize: none;
	white-space: pre-wrap;
	word-wrap: break-word;
}

#tlc-widget .tlc-w__input:focus {
	border-color: var(--tlc-w-blue);
	background: #fff;
}

#tlc-widget .tlc-w__send {
	all: unset;
	cursor: pointer;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: var(--tlc-w-blue);
	color: #fff;
	transition: background .15s;
}

#tlc-widget .tlc-w__send:hover {
	background: var(--tlc-w-blue-dark);
}

#tlc-widget .tlc-w__send[disabled] {
	opacity: .5;
	cursor: default;
}

/* =========================================================
   MOBILE — FULL SCREEN CHAT
   ========================================================= */

@media screen and (max-width: 600px) {

	#tlc-widget {
		right: 14px;
		bottom: 14px;
	}

	/* Full-screen widget root */
	html body #tlc-widget.is-open {
		position: fixed !important;
		inset: 0 !important;
		width: 100% !important;
		height: 100vh !important;
		height: 100dvh !important;
		margin: 0 !important;
		padding: 0 !important;
		right: auto !important;
		bottom: auto !important;
		z-index: 2147483647 !important;
	}

	/* Full-screen panel */
	html body #tlc-widget.is-open .tlc-w__panel {
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;

		width: 100% !important;
		max-width: none !important;

		height: 100vh !important;
		height: 100dvh !important;
		max-height: none !important;

		margin: 0 !important;
		border: 0 !important;
		border-radius: 0 !important;
		box-shadow: none !important;

		display: flex !important;
		flex-direction: column !important;
		min-height: 0 !important;

		transform: none !important;
		opacity: 1 !important;
		pointer-events: auto !important;
		overflow: hidden !important;
	}

	/* Safe area — iPhone top */
	html body #tlc-widget.is-open .tlc-w__head {
		padding-top: calc(14px + env(safe-area-inset-top, 0px)) !important;
		flex-shrink: 0 !important;
	}

	/* Scrollable conversation area */
	html body #tlc-widget.is-open .tlc-w__body,
	html body #tlc-widget.is-open .tlc-w__intro {
		flex: 1 1 auto !important;
		min-height: 0 !important;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}

	/* Input stays at the bottom */
	html body #tlc-widget.is-open .tlc-w__form {
		flex-shrink: 0 !important;
		padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* Prevent iOS Safari input zoom */
	#tlc-widget .tlc-w__input,
	#tlc-widget .tlc-w__name-input {
		font-size: 16px !important;
	}
}
