#lucky-chat-widget-root {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 999999;
	font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
}

#lucky-chat-widget-root * { box-sizing: border-box; }

.lcw-window {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 340px;
	height: 460px;
	background: #111;
	border: 1px solid #2b2b2b;
	border-radius: 14px;
	overflow: hidden;
	display: none;
	flex-direction: column;
	box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.lcw-window.open { display: flex; }

.lcw-header {
	background:linear-gradient(160deg, color-mix(in oklab, #ff00d2 18%,#240344
),#240344);
	padding: 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 auto;
}

.lcw-header strong { color: #fff; font-size: 15px; display: block; }
.lcw-header .lcw-status {
	display: flex;
	align-items: center;
	gap: 5px;
	color: #B09DCB;
	font-size: 11px;
	margin-top: 2px;
}
.lcw-close { cursor: pointer; color: #fff; font-weight: 700; font-size: 18px; line-height: 1; }

.lcw-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background:#ffffff;
	opacity: .55;
	flex-shrink: 0;
	transition: background .2s ease, opacity .2s ease, box-shadow .2s ease;
}

.lcw-dot-online {
	background: #2fbf5f;
	opacity: 1;
	box-shadow: 0 0 6px rgba(47,191,95,.8);
}

#lcw-body {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: #181818;
}

/* -------------------------------------------------- */
/* Image drag & drop overlay                           */
/* -------------------------------------------------- */

.lcw-dropzone {
	position: absolute;
	inset: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px;
	background: rgba(21, 0, 45, .88);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .16s ease;
	pointer-events: none;
}

.lcw-dropzone-visible {
	opacity: 1;
}

.lcw-dropzone-inner {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 2px dashed #d4af37;
	border-radius: 14px;
	background: linear-gradient(160deg, rgba(255,0,210,.10), rgba(146,248,0,.06));
	color: #fff;
	transform: scale(.97);
	transition: transform .16s ease;
}

.lcw-dropzone-visible .lcw-dropzone-inner {
	transform: scale(1);
}

.lcw-dropzone-icon {
	color: #d4af37;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lcw-dropzone-text {
	font-size: 14px;
	font-weight: 700;
	color: #fff;
}

.lcw-dropzone-subtext {
	font-size: 11px;
	color: #b9aac7;
}


/* -------------------------------------------------- */
/* In-widget notification permission card              */
/* -------------------------------------------------- */
.lcw-notification-banner {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 10px 10px 0;
	padding: 10px 11px;
	border: 1px solid #4c276e;
	border-radius: 10px;
	background: linear-gradient(135deg, rgba(255,0,210,.10), rgba(146,248,0,.06));
	color: #fff;
	flex: 0 0 auto;
}
.lcw-notification-icon {
	width: 30px;
	height: 30px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,0,210,.16);
	font-size: 15px;
	flex: 0 0 30px;
}
.lcw-notification-copy {
	min-width: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.lcw-notification-title {
	font-size: 11px;
	line-height: 1.2;
	font-weight: 700;
	color: #fff;
}
.lcw-notification-text {
	font-size: 9px;
	line-height: 1.35;
	color: #b9aac7;
}
.lcw-notification-btn {
	flex: 0 0 auto;
	border: 0;
	border-radius: 7px;
	padding: 7px 9px;
	background: linear-gradient(100deg, #ff00d2 0%, #92f800 100%);
	color: #15002D;
	font-size: 10px;
	font-weight: 800;
	cursor: pointer;
	white-space: nowrap;
}
.lcw-notification-btn:disabled {
	opacity: .65;
	cursor: default;
}
.lcw-notification-btn.is-enabled {
	background: #2fbf5f;
	color: #fff;
}

.lcw-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #15002D !important;
}

.lcw-msg {
	max-width: 78%;
	padding: 8px 12px;
	border-radius: 12px;
	font-size: 13px;
	line-height: 1.4;
	color: #f2f2f2;
}

.lcw-msg.agent {
	align-self: flex-start;
	background: #262626;
	border-bottom-left-radius: 2px;
}

.lcw-msg.visitor {
	align-self: flex-end;
	background:linear-gradient(160deg, color-mix(in oklab, #ff00d2 18%,#240344
),#240344);
	color: #fff;
	font-weight: 500;
	border-bottom-right-radius: 2px;
}

.lcw-msg-img {
	display: block;
	max-width: 100%;
	max-height: 220px;
	border-radius: 8px;
	cursor: zoom-in;
}

.lcw-msg-caption {
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.4;
}

.lcw-msg a {
	color: #92f800;
	text-decoration: underline;
	word-break: break-word;
}

.lcw-msg.agent a { color: #d4af37; }

.lcw-msg-meta {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 6px;
	vertical-align: bottom;
}

.lcw-msg-time {
	font-size: 10px;
	opacity: .6;
	white-space: nowrap;
}

.lcw-composer {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid #2b2b2b;
	flex: 0 0 auto;
	background: #15002D;
}

.lcw-composer-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.lcw-attach {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #1c1c1c;
	border: 1px solid #2b2b2b;
	border-radius: 8px;
	color: #d4af37;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease;
}

.lcw-attach:hover {
	border-color: #d4af37;
	background: #232323;
}

.lcw-attach:disabled {
	opacity: .5;
	cursor: default;
	pointer-events: none;
}

.lcw-composer input,
.lcw-composer textarea {
	flex: 1;
	background: #15002D;
	border: 1px solid #2b2b2b;
	border-radius: 8px;
	padding: 10px 12px;
	color: #f2f2f2;
	font-size: 13px;
}

.lcw-composer textarea {
	resize: none;
	max-height: 96px;
	min-height: 20px;
	line-height: 1.35;
	font-family: inherit;
	overflow-y: auto;
}

.lcw-composer textarea:focus {
	outline: 1px solid #d4af37;
}

.lcw-send {
	background: linear-gradient(160deg, color-mix(in oklab, #ff00d2 18%,#240344
),#240344);
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 10px 16px;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
}

.lcw-send:disabled {
	opacity: .7;
	cursor: default;
}

/* -------------------------------------------------- */
/* Composer image preview — a pasted/dropped/attached  */
/* image waiting in the composer, not yet sent.        */
/* -------------------------------------------------- */

.lcw-composer-preview {
	display: none;
}

.lcw-preview-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.lcw-preview-thumb {
	position: relative;
	width: 64px;
	height: 64px;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #2b2b2b;
	background: #1c1c1c;
}

.lcw-preview-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.lcw-preview-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 18px;
	height: 18px;
	line-height: 16px;
	text-align: center;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, .65);
	color: #fff;
	font-size: 13px;
	cursor: pointer;
}

.lcw-preview-remove:hover {
	background: #d4af37;
	color: #15002D;
}

.lcw-preview-busy img {
	opacity: .5;
}

.lcw-preview-spinner {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .25);
}

.lcw-preview-error {
	margin-top: 6px;
	font-size: 12px;
	color: #ffb4a8;
}

/* -------------------------------------------------- */
/* Pre-chat guest screen                                */
/* -------------------------------------------------- */

.lcw-auth {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow-y: auto;
	padding: 22px 20px 18px;
	background: #15002D !important;
}

.lcw-auth-intro {
	text-align: center;
	margin-bottom: 16px;
}

.lcw-auth-badge {
	width: 46px;
	height: 46px;
	margin: 0 auto 10px;
	border-radius: 50%;
	background: #FF00D2;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	border: 2px solid #d4af37;
}

.lcw-auth-intro h3 {
	margin: 0 0 4px;
	color: #f2f2f2;
	font-size: 16px;
	font-weight: 700;
}

.lcw-auth-intro p {
	margin: 0;
	color: #9c9c9c;
	font-size: 12px;
}

.lcw-auth-panel {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.lcw-form-group {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.lcw-form-group label {
	font-size: 11px;
	font-weight: 600;
	color: #c9c9c9;
	letter-spacing: .2px;
}

.lcw-form-group input,
.lcw-form-group textarea {
	width: 100%;
	background: #15002D;
	border: 1px solid #4C276E;
	border-radius: 8px;
	padding: 10px 12px;
	color: #f2f2f2;
	font-size: 13px;
	font-family: inherit;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.lcw-form-group textarea { resize: none; }

.lcw-form-group input:focus,
.lcw-form-group textarea:focus {
	outline: none;
	border-color: #d4af37;
	box-shadow: 0 0 0 3px rgba(212,175,55,.18);
}

.lcw-primary-btn {
	background: linear-gradient(135deg, #e9cd6f, #d4af37);
	color: #111;
	border: none;
	border-radius: 8px;
	padding: 11px;
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
	transition: opacity .15s ease, transform .05s ease;
}

.lcw-primary-btn:hover { opacity: .92; }
.lcw-primary-btn:active { transform: translateY(1px); }

.lcw-primary-btn.lcw-loading,
.lcw-primary-btn:disabled {
	opacity: .65;
	cursor: default;
}

.lcw-alert {
	font-size: 11.5px;
	padding: 8px 10px;
	border-radius: 8px;
	line-height: 1.4;
}

.lcw-alert-error {
	background: rgba(224,119,106,.12);
	border: 1px solid rgba(224,119,106,.4);
	color: #e0776a;
}

.lcw-alert-success {
	background: rgba(212,175,55,.12);
	border: 1px solid rgba(212,175,55,.4);
	color: #d4af37;
}

@media (max-width: 480px) {
	#lucky-chat-widget-root { right: 10px; bottom: 10px; left: 10px; }
	#lucky-chat-widget-root .lcw-window {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: none;
		height: min(680px, 100dvh);
		max-height: 100dvh;
		border-radius: 16px 16px 0 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		box-shadow: 0 -10px 40px rgba(0,0,0,.42);
	}
	#lucky-chat-widget-root .lcw-header {
		padding: 14px 15px;
		min-height: 58px;
	}
	#lucky-chat-widget-root .lcw-close {
		width: 40px;
		height: 40px;
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 10px;
	}
	#lucky-chat-widget-root .lcw-notification-banner {
		margin: 8px 10px 0;
		padding: 9px 10px;
		gap: 8px;
	}
	#lucky-chat-widget-root .lcw-notification-icon {
		width: 28px;
		height: 28px;
		flex-basis: 28px;
	}
	#lucky-chat-widget-root .lcw-notification-text {
		font-size: 9px;
	}
	#lucky-chat-widget-root .lcw-notification-btn {
		min-height: 36px;
		padding: 8px 11px;
	}
	#lucky-chat-widget-root .lcw-messages {
		padding: 12px 10px;
		gap: 7px;
		-webkit-overflow-scrolling: touch;
	}
	#lucky-chat-widget-root .lcw-msg {
		max-width: 84%;
		font-size: 14px;
		padding: 9px 12px;
	}
	#lucky-chat-widget-root .lcw-composer {
		padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
		gap: 7px;
	}
	#lucky-chat-widget-root .lcw-composer-row {
		gap: 7px;
	}
	#lucky-chat-widget-root .lcw-attach,
	#lucky-chat-widget-root .lcw-send {
		min-width: 42px;
		height: 42px;
		padding: 8px 12px;
	}
	#lucky-chat-widget-root .lcw-composer input,
	#lucky-chat-widget-root .lcw-composer textarea {
		min-width: 0;
		font-size: 16px;
	}
	#lucky-chat-widget-root .lcw-composer input {
		height: 42px;
	}
	#lucky-chat-widget-root .lcw-composer textarea {
		min-height: 42px;
		max-height: 120px;
		padding-top: 11px;
		padding-bottom: 11px;
	}
	#lucky-chat-widget-root .lcw-preview-thumb {
		width: 56px;
		height: 56px;
	}
	#lucky-chat-widget-root .lcw-preview-remove {
		width: 22px;
		height: 22px;
		line-height: 20px;
		font-size: 15px;
	}
	#lucky-chat-widget-root .lcw-dropzone-text {
		font-size: 15px;
	}
}
.lc-msg-seen{display:inline-block;margin-left:6px;font-size:11px;opacity:.7;letter-spacing:-2px;vertical-align:baseline}


@media (max-width: 360px) {
	#lucky-chat-widget-root .lcw-header strong { font-size: 14px; }
	#lucky-chat-widget-root .lcw-notification-copy { min-width: 0; }
	#lucky-chat-widget-root .lcw-notification-title { font-size: 10px; }
	#lucky-chat-widget-root .lcw-notification-text { font-size: 8.5px; }
	#lucky-chat-widget-root .lcw-notification-btn { padding-left: 9px; padding-right: 9px; }
}


/* -------------------------------------------------- */
/* Full-screen shared-image lightbox                   */
/* -------------------------------------------------- */

.lcw-msg-image-btn{
	display:block;
	border:0;
	padding:0;
	margin:0;
	background:transparent;
	cursor:zoom-in;
	max-width:100%;
	line-height:0;
	text-align:left;
}

.lcw-msg-image-btn:focus-visible{
	outline:2px solid currentColor;
	outline-offset:2px;
	border-radius:10px;
}

.lcw-image-lightbox{
	position:fixed;
	inset:0;
	width:100vw;
	height:100vh;
	height:100dvh;
	z-index:2147483647;
	display:flex;
	align-items:center;
	justify-content:center;
	padding:clamp(12px, 3vw, 32px);
	box-sizing:border-box;
	overflow:hidden;
}

.lcw-lightbox-backdrop{
	position:absolute;
	inset:0;
	width:100%;
	height:100%;
	background:rgba(0,0,0,.92);
	backdrop-filter:blur(6px);
	-webkit-backdrop-filter:blur(6px);
}

.lcw-lightbox-image{
	position:relative;
	z-index:2;
	display:block;
	flex:0 0 auto;
	width:auto;
	height:auto;
	max-width:calc(100vw - 48px);
	max-height:calc(100vh - 48px);
	max-height:calc(100dvh - 48px);
	object-fit:contain;
	border-radius:10px;
	box-shadow:0 20px 80px rgba(0,0,0,.65);
	cursor:default;
	user-select:none;
	-webkit-user-drag:none;
}

.lcw-lightbox-close{
	position:absolute;
	z-index:3;
	top:max(14px, env(safe-area-inset-top));
	right:max(14px, env(safe-area-inset-right));
	width:46px;
	height:46px;
	display:flex;
	align-items:center;
	justify-content:center;
	padding:0;
	border:1px solid rgba(255,255,255,.25);
	border-radius:50%;
	background:rgba(0,0,0,.45);
	color:#fff;
	font-size:32px;
	font-weight:300;
	line-height:1;
	cursor:pointer;
	backdrop-filter:blur(8px);
	-webkit-backdrop-filter:blur(8px);
}

.lcw-lightbox-close:hover{
	background:rgba(255,255,255,.18);
}

.lcw-lightbox-close:focus-visible{
	outline:2px solid #fff;
	outline-offset:3px;
}

body.lcw-lightbox-open{
	overflow:hidden !important;
	touch-action:none;
}

@media (max-width:600px){
	.lcw-image-lightbox{
		padding:
			max(10px, env(safe-area-inset-top))
			max(10px, env(safe-area-inset-right))
			max(10px, env(safe-area-inset-bottom))
			max(10px, env(safe-area-inset-left));
	}

	.lcw-lightbox-image{
		max-width:100vw;
		max-height:calc(100vh - 28px);
		max-height:calc(100dvh - 28px);
		border-radius:6px;
	}

	.lcw-lightbox-close{
		top:max(10px, env(safe-area-inset-top));
		right:max(10px, env(safe-area-inset-right));
		width:44px;
		height:44px;
		font-size:30px;
	}
}

/* ---------------------------------------------------------------
   Image upload placeholder (loading state / retry) — used while an
   attached, dropped, or pasted image is uploading, and for the
   "upload failed" retry prompt if it doesn't succeed.
   --------------------------------------------------------------- */

.lcw-upload-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.lcw-spinner {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .35);
	border-top-color: #d4af37;
	animation: lcw-spin .8s linear infinite;
}

@keyframes lcw-spin {
	to { transform: rotate(360deg); }
}

.lcw-upload-status {
	font-size: 12.5px;
	line-height: 1.4;
}

.lcw-msg-upload-error .lcw-upload-error-text {
	color: #ffb4a8;
	font-size: 12px;
}

.lcw-upload-retry,
.lcw-upload-remove {
	border: 1px solid rgba(255, 255, 255, .4);
	background: transparent;
	color: inherit;
	border-radius: 6px;
	padding: 3px 8px;
	font-size: 11px;
	cursor: pointer;
	line-height: 1.3;
}

.lcw-upload-retry:hover,
.lcw-upload-remove:hover {
	border-color: #d4af37;
}

/* Keep the page behind the mobile chat fixed while the chat is open. */
html.lcw-chat-open,
body.lcw-chat-open {
	overflow: hidden !important;
}

.lcw-messages {
	overscroll-behavior: contain;
	touch-action: pan-y;
}

.lcw-scroll-bottom {
	position: absolute;
	right: 12px;
	bottom: 76px;
	z-index: 8;
	width: 40px;
	height: 40px;
	border: 1px solid rgba(255,255,255,.18);
	border-radius: 50%;
	background: rgba(24,24,24,.94);
	color: #fff;
	box-shadow: 0 4px 14px rgba(0,0,0,.35);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}

.lcw-scroll-bottom.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
