/* PrintWorld Live Chat: visitor widget.
   Everything is scoped under #pwlc-root so theme styles don't leak in or out.
   The one decorative element is the CMYK registration strip on top of the panel. */

#pwlc-root {
	--pwlc-primary: #0b4f8a;
	--pwlc-on-primary: #fff;
	--pwlc-primary-ink: #0b4f8a; /* brand colour as text on light backgrounds */
	--pwlc-ink: #1b1f24;
	--pwlc-muted: #5f6b78;
	--pwlc-paper: #f6f7f9;
	--pwlc-line: #dde2e8;
	--pwlc-cyan: #00a0e3;
	--pwlc-magenta: #e5007e;
	--pwlc-yellow: #ffd400;
	--pwlc-key: #1d1d1b;
	position: fixed;
	/* Distance from the screen edges; set per device in Settings › Button spacing. */
	--pwlc-bottom: var(--pwlc-bottom-desktop, 20px);
	--pwlc-side: var(--pwlc-side-desktop, 20px);
	right: var(--pwlc-side);
	bottom: calc(var(--pwlc-bottom) + env(safe-area-inset-bottom, 0px));
	z-index: 2147483000;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.45;
	color: var(--pwlc-ink);
	text-align: left;
}
#pwlc-root.pwlc-pos-left { right: auto; left: var(--pwlc-side); }
@media (max-width: 1024px) {
	#pwlc-root { --pwlc-bottom: var(--pwlc-bottom-tablet, 20px); --pwlc-side: var(--pwlc-side-tablet, 20px); }
}
@media (max-width: 767px) {
	#pwlc-root { --pwlc-bottom: var(--pwlc-bottom-phone, 14px); --pwlc-side: var(--pwlc-side-phone, 14px); }
}
#pwlc-root *, #pwlc-root *::before, #pwlc-root *::after { box-sizing: border-box; }
#pwlc-root [hidden] { display: none !important; }
#pwlc-root button, #pwlc-root input, #pwlc-root select, #pwlc-root textarea {
	font: inherit;
	color: inherit;
	margin: 0;
	letter-spacing: normal;
	text-transform: none;
	box-shadow: none;
	min-height: 0;
}
#pwlc-root svg { display: block; width: 100%; height: 100%; }
#pwlc-root a { color: var(--pwlc-primary-ink); }
#pwlc-root :focus-visible { outline: 2px solid var(--pwlc-primary); outline-offset: 2px; }

/* ---------- launcher ---------- */
#pwlc-root .pwlc-launcher {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 56px;
	max-width: calc(100vw - 40px);
	margin-left: auto;
	padding: 0 22px 0 16px;
	border: 0;
	border-radius: 28px;
	background: var(--pwlc-primary);
	color: var(--pwlc-on-primary);
	font-weight: 700;
	font-size: 15px;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(15, 30, 50, 0.28);
	transition: transform 0.15s ease;
}
#pwlc-root .pwlc-launcher:hover { transform: translateY(-1px); }
#pwlc-root .pwlc-launcher-icon { width: 26px; height: 26px; flex: none; }
#pwlc-root .pwlc-launcher-label { overflow: hidden; text-overflow: ellipsis; }
#pwlc-root .pwlc-launcher-dot { width: 9px; height: 9px; flex: none; }
#pwlc-root .pwlc-launcher .pwlc-ico-down { display: none; }
/* Open: the launcher shrinks to a round "minimise" button. */
#pwlc-root.pwlc-is-open .pwlc-launcher { width: 56px; padding: 0; justify-content: center; }
#pwlc-root.pwlc-is-open .pwlc-launcher-label,
#pwlc-root.pwlc-is-open .pwlc-launcher-dot,
#pwlc-root.pwlc-is-open .pwlc-launcher .pwlc-ico-chat { display: none !important; }
#pwlc-root.pwlc-is-open .pwlc-launcher .pwlc-ico-down { display: block; }
#pwlc-root.pwlc-pos-left .pwlc-launcher { margin-left: 0; margin-right: auto; }

#pwlc-root .pwlc-badge {
	position: absolute;
	top: -6px;
	right: -4px;
	min-width: 21px;
	height: 21px;
	padding: 0 6px;
	border-radius: 11px;
	border: 2px solid #fff;
	background: var(--pwlc-magenta);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
	display: none;
}
#pwlc-root.pwlc-has-unread .pwlc-badge { display: block; }

/* ---------- panel ---------- */
#pwlc-root .pwlc-panel {
	position: absolute;
	right: 0;
	bottom: 70px;
	width: 410px;
	height: 600px;
	max-height: calc(100vh - var(--pwlc-bottom) - 100px);
	max-height: calc(100dvh - var(--pwlc-bottom) - 100px);
	display: none;
	flex-direction: column;
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 18px 50px rgba(15, 30, 50, 0.25), 0 0 0 1px rgba(15, 30, 50, 0.06);
}
#pwlc-root.pwlc-pos-left .pwlc-panel { right: auto; left: 0; }
#pwlc-root.pwlc-is-open .pwlc-panel { display: flex; animation: pwlc-rise 0.18s ease-out; }
@keyframes pwlc-rise {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

/* CMYK registration strip */
#pwlc-root .pwlc-reg { display: flex; height: 5px; flex: none; }
#pwlc-root .pwlc-reg i { flex: 1; display: block; }
#pwlc-root .pwlc-reg i:nth-child(1) { background: var(--pwlc-cyan); }
#pwlc-root .pwlc-reg i:nth-child(2) { background: var(--pwlc-magenta); }
#pwlc-root .pwlc-reg i:nth-child(3) { background: var(--pwlc-yellow); }
#pwlc-root .pwlc-reg i:nth-child(4) { background: var(--pwlc-key); }

#pwlc-root .pwlc-header {
	flex: none;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 12px 14px 18px;
	background: var(--pwlc-primary);
	color: var(--pwlc-on-primary);
}
#pwlc-root .pwlc-head-text { flex: 1; min-width: 0; }
#pwlc-root .pwlc-title { font-size: 17px; font-weight: 700; line-height: 1.25; }
#pwlc-root .pwlc-status { display: flex; align-items: center; gap: 7px; margin-top: 2px; font-size: 13px; opacity: 0.92; }
#pwlc-root .pwlc-dot { width: 8px; height: 8px; border-radius: 50%; background: #c3cad3; flex: none; }
#pwlc-root.pwlc-online .pwlc-dot { background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.28); }
#pwlc-root.pwlc-offline .pwlc-dot { background: var(--pwlc-yellow); }
#pwlc-root .pwlc-head-actions { display: flex; gap: 2px; flex: none; }
#pwlc-root .pwlc-hbtn {
	width: 36px;
	height: 36px;
	padding: 9px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--pwlc-on-primary);
	cursor: pointer;
}
#pwlc-root .pwlc-hbtn:hover { background: color-mix(in srgb, var(--pwlc-on-primary) 15%, transparent); }

#pwlc-root .pwlc-netbar {
	flex: none;
	padding: 6px 16px;
	background: #fff4d6;
	color: #6b4a00;
	font-size: 13px;
	text-align: center;
}

#pwlc-root .pwlc-body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 18px 16px;
	background: var(--pwlc-paper);
}
#pwlc-root .pwlc-loading { color: var(--pwlc-muted); text-align: center; padding: 40px 0; }

/* ---------- intro & form ---------- */
#pwlc-root .pwlc-welcome { margin: 0 0 14px; font-size: 15px; }
#pwlc-root .pwlc-notice {
	margin: 0 0 14px;
	padding: 12px 14px;
	border-left: 4px solid var(--pwlc-yellow);
	background: #fffbe6;
	border-radius: 0 8px 8px 0;
}
#pwlc-root .pwlc-notice strong { display: block; margin-bottom: 2px; }
#pwlc-root .pwlc-notice p { margin: 0; font-size: 14px; color: #4a4a3a; }

#pwlc-root .pwlc-who {
	margin: 0 0 14px;
	padding: 12px 14px;
	background: #fff;
	border: 1px solid var(--pwlc-line);
	border-radius: 10px;
	font-size: 14px;
}
#pwlc-root .pwlc-who-email { display: block; color: var(--pwlc-muted); word-break: break-all; }
#pwlc-root .pwlc-who small { display: block; margin-top: 6px; color: var(--pwlc-muted); font-size: 12.5px; }

#pwlc-root .pwlc-login-card {
	padding: 14px;
	background: #fff;
	border: 1px solid var(--pwlc-line);
	border-radius: 10px;
}
#pwlc-root .pwlc-login-card p { margin: 0 0 10px; font-size: 14px; }
#pwlc-root .pwlc-login-card .pwlc-link { display: inline-block; margin-top: 8px; }

#pwlc-root .pwlc-divider {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 16px 0;
	color: var(--pwlc-muted);
	font-size: 13px;
}
#pwlc-root .pwlc-divider::before, #pwlc-root .pwlc-divider::after { content: ""; flex: 1; height: 1px; background: var(--pwlc-line); }

#pwlc-root .pwlc-field { display: block; margin: 0 0 12px; }
#pwlc-root .pwlc-label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
#pwlc-root .pwlc-req { color: var(--pwlc-magenta); }
#pwlc-root .pwlc-form input[type="text"],
#pwlc-root .pwlc-form input[type="email"],
#pwlc-root .pwlc-form input[type="tel"],
#pwlc-root .pwlc-form select,
#pwlc-root .pwlc-form textarea {
	display: block;
	width: 100%;
	height: auto;
	padding: 9px 11px;
	border: 1px solid #c6cdd5;
	border-radius: 8px;
	background: #fff;
	font-size: 15px;
	line-height: 1.4;
}
#pwlc-root .pwlc-form textarea { resize: vertical; min-height: 92px; }
#pwlc-root .pwlc-form input:focus, #pwlc-root .pwlc-form select:focus, #pwlc-root .pwlc-form textarea:focus {
	border-color: var(--pwlc-primary);
	outline: 2px solid color-mix(in srgb, var(--pwlc-primary) 25%, transparent);
	outline-offset: 0;
}

#pwlc-root .pwlc-consent { display: flex; gap: 9px; align-items: flex-start; margin: 0 0 12px; font-size: 13px; color: var(--pwlc-muted); }
#pwlc-root .pwlc-consent input { margin-top: 3px; flex: none; width: 16px; height: 16px; }
#pwlc-root .pwlc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

#pwlc-root .pwlc-error:empty { display: none; }
#pwlc-root .pwlc-error {
	margin: 0 0 12px;
	padding: 9px 12px;
	border-radius: 8px;
	background: #fdecef;
	color: #a1123a;
	font-size: 14px;
}

#pwlc-root .pwlc-btn {
	display: block;
	width: 100%;
	padding: 11px 16px;
	border: 1px solid var(--pwlc-primary);
	border-radius: 8px;
	background: var(--pwlc-primary);
	color: var(--pwlc-on-primary);
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}
#pwlc-root .pwlc-btn:hover { filter: brightness(1.08); }
#pwlc-root .pwlc-btn:disabled { opacity: 0.6; cursor: default; }
#pwlc-root .pwlc-btn-ghost { background: #fff; color: var(--pwlc-primary-ink); border-color: var(--pwlc-primary-ink); }

#pwlc-root .pwlc-link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--pwlc-muted);
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- messages ---------- */
#pwlc-root .pwlc-messages { display: flex; flex-direction: column; gap: 10px; }
#pwlc-root .pwlc-msg { display: flex; flex-direction: column; max-width: 84%; }
#pwlc-root .pwlc-msg-visitor { align-self: flex-end; align-items: flex-end; }
#pwlc-root .pwlc-msg-agent { align-self: flex-start; align-items: flex-start; }
#pwlc-root .pwlc-msg-system { align-self: stretch; max-width: none; }

#pwlc-root .pwlc-bubble { padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; }
#pwlc-root .pwlc-msg-visitor .pwlc-bubble { background: var(--pwlc-primary); color: var(--pwlc-on-primary); border-bottom-right-radius: 4px; }
#pwlc-root .pwlc-msg-agent .pwlc-bubble { background: #fff; border: 1px solid var(--pwlc-line); border-bottom-left-radius: 4px; }
#pwlc-root .pwlc-msg-system .pwlc-bubble {
	padding: 8px 12px;
	border-radius: 0;
	border-left: 3px solid var(--pwlc-cyan);
	background: transparent;
	color: var(--pwlc-muted);
	font-size: 13.5px;
}

#pwlc-root .pwlc-meta { display: flex; gap: 6px; margin-top: 3px; font-size: 11.5px; color: var(--pwlc-muted); }
#pwlc-root .pwlc-author { font-weight: 600; }
#pwlc-root .pwlc-pending { opacity: 0.55; }
#pwlc-root .pwlc-failed .pwlc-bubble { background: #fdecef; color: #a1123a; }

/* ---------- composer ---------- */
#pwlc-root .pwlc-footer { display: none; flex: none; padding: 10px 12px 8px; border-top: 1px solid var(--pwlc-line); background: #fff; }
#pwlc-root.pwlc-has-chat .pwlc-footer,
#pwlc-root.pwlc-show-footer .pwlc-footer { display: block; }
#pwlc-root .pwlc-composer { display: flex; align-items: flex-end; gap: 8px; }
#pwlc-root .pwlc-input {
	flex: 1;
	min-height: 42px;
	max-height: 120px;
	padding: 10px 12px;
	border: 1px solid #c6cdd5;
	border-radius: 10px;
	background: #fff;
	resize: none;
	font-size: 15px;
	line-height: 1.4;
}
#pwlc-root .pwlc-input:focus { border-color: var(--pwlc-primary); outline: none; }
#pwlc-root .pwlc-send {
	flex: none;
	width: 42px;
	height: 42px;
	padding: 10px;
	border: 0;
	border-radius: 10px;
	background: var(--pwlc-primary);
	color: var(--pwlc-on-primary);
	cursor: pointer;
}
#pwlc-root .pwlc-send:disabled { opacity: 0.5; }
#pwlc-root .pwlc-footer-meta { display: flex; justify-content: flex-end; align-items: center; margin-top: 6px; }

/* ---------- new-reply preview (minimised / closed) ---------- */
#pwlc-root .pwlc-toast {
	position: absolute;
	right: 0;
	bottom: 68px;
	display: flex;
	align-items: flex-start;
	width: 300px;
	max-width: calc(100vw - 40px);
	background: #fff;
	border-radius: 12px;
	border-left: 4px solid var(--pwlc-primary);
	box-shadow: 0 10px 30px rgba(15, 30, 50, 0.22), 0 0 0 1px rgba(15, 30, 50, 0.06);
	animation: pwlc-rise 0.2s ease-out;
}
#pwlc-root.pwlc-pos-left .pwlc-toast { right: auto; left: 0; }
#pwlc-root.pwlc-is-open .pwlc-toast { display: none; }
#pwlc-root .pwlc-toast-body {
	flex: 1;
	padding: 12px 6px 12px 14px;
	border: 0;
	background: none;
	text-align: left;
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
#pwlc-root .pwlc-toast-who { color: var(--pwlc-ink); }
#pwlc-root .pwlc-toast-text { color: #3d4650; }
#pwlc-root .pwlc-toast-x { flex: none; width: 30px; height: 30px; margin: 6px; padding: 8px; border: 0; border-radius: 6px; background: none; color: var(--pwlc-muted); cursor: pointer; }
#pwlc-root .pwlc-toast-x:hover { background: var(--pwlc-paper); }

/* ---------- end-chat confirmation ---------- */
#pwlc-root .pwlc-confirm {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(20, 26, 34, 0.45);
	z-index: 2;
}
#pwlc-root .pwlc-confirm-card { width: 100%; padding: 20px; background: #fff; border-radius: 12px; text-align: center; }
#pwlc-root .pwlc-confirm-card strong { display: block; font-size: 17px; margin-bottom: 6px; }
#pwlc-root .pwlc-confirm-card p { margin: 0 0 16px; color: var(--pwlc-muted); font-size: 14px; }
#pwlc-root .pwlc-confirm-card .pwlc-btn { margin-bottom: 8px; }

/* ---------- small screens ---------- */
@media (max-width: 480px) {
	#pwlc-root .pwlc-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		max-height: none;
		border-radius: 0;
	}
	#pwlc-root.pwlc-is-open .pwlc-launcher { display: none; }
	#pwlc-root .pwlc-launcher { height: 52px; font-size: 14px; }
	#pwlc-root .pwlc-toast { bottom: 64px; }
	#pwlc-root .pwlc-form input, #pwlc-root .pwlc-form select, #pwlc-root .pwlc-form textarea, #pwlc-root .pwlc-input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	#pwlc-root.pwlc-is-open .pwlc-panel { animation: none; }
	#pwlc-root .pwlc-launcher { transition: none; }
}

@media print {
	#pwlc-root { display: none !important; }
}
#pwlc-root:not(.pwlc-online):not(.pwlc-offline) .pwlc-launcher-dot { display: none; }

/* ---------- quick answers ---------- */
#pwlc-root .pwlc-quick { margin: 0 0 14px; }
#pwlc-root .pwlc-quick-label { margin-bottom: 8px; font-size: 13px; font-weight: 600; color: #3d4650; }
#pwlc-root .pwlc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#pwlc-root .pwlc-chip {
	min-height: 40px;
	padding: 8px 14px;
	border: 1px solid #d5dbe2;
	border: 1px solid color-mix(in srgb, var(--pwlc-primary) 35%, #fff);
	border-radius: 20px;
	background: #fff;
	color: var(--pwlc-ink);
	color: var(--pwlc-primary-ink);
	font-size: 14px;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
}
#pwlc-root .pwlc-chip:hover { background: color-mix(in srgb, var(--pwlc-primary) 8%, #fff); }
#pwlc-root .pwlc-qa { gap: 12px; }
#pwlc-root .pwlc-qa .pwlc-quick { margin: 6px 0 0; }
#pwlc-root .pwlc-msg-auto { max-width: 90%; }
#pwlc-root .pwlc-auto-label { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 12px; font-weight: 500; color: var(--pwlc-muted); }
#pwlc-root .pwlc-auto-icon { width: 14px; height: 14px; display: block; }
#pwlc-root .pwlc-msg-auto .pwlc-bubble { padding: 11px 14px; }
#pwlc-root .pwlc-qa-link {
	display: block;
	margin-top: 8px;
	font-size: 14px;
	font-weight: 500;
	color: var(--pwlc-ink);
	color: var(--pwlc-primary-ink);
}
#pwlc-root .pwlc-feedback { display: flex; flex-direction: column; gap: 8px; }
#pwlc-root .pwlc-feedback-q { font-size: 14px; color: #3d4650; }
#pwlc-root .pwlc-feedback-btns { display: flex; gap: 8px; }
#pwlc-root .pwlc-feedback-btns .pwlc-btn { flex: 1; width: auto; min-height: 44px; }
#pwlc-root .pwlc-glad { font-size: 14px; color: #3d4650; }

/* ---------- away notice, time gaps, receipts, typing ---------- */
#pwlc-root .pwlc-msg-notice { align-self: stretch; max-width: none; }
#pwlc-root .pwlc-notice-card { padding: 12px 14px; border-left: 4px solid var(--pwlc-yellow); border-radius: 0 8px 8px 0; background: #fffbe6; }
#pwlc-root .pwlc-notice-card strong { display: block; margin-bottom: 4px; font-size: 15px; }
#pwlc-root .pwlc-notice-card p { margin: 0; font-size: 14px; line-height: 1.5; color: #3b3a2e; white-space: pre-wrap; }
#pwlc-root .pwlc-gap { display: flex; align-items: center; gap: 10px; padding: 2px 0; font-size: 12px; color: var(--pwlc-muted); }
#pwlc-root .pwlc-gap::before, #pwlc-root .pwlc-gap::after { content: ""; flex: 1; height: 1px; background: var(--pwlc-line); }
#pwlc-root .pwlc-receipt { display: inline-flex; align-items: center; gap: 4px; }
#pwlc-root .pwlc-receipt svg { width: 14px; height: 14px; }
#pwlc-root .pwlc-receipt.is-seen svg { width: 17px; }
#pwlc-root .pwlc-typing { align-self: flex-start; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--pwlc-muted); }
#pwlc-root .pwlc-dots { display: flex; gap: 5px; padding: 12px 14px; border: 1px solid var(--pwlc-line); border-radius: 16px 16px 16px 4px; background: #fff; }
#pwlc-root .pwlc-dots i { width: 7px; height: 7px; border-radius: 50%; background: #9aa3ad; animation: pwlc-blink 1.2s infinite ease-in-out; }
#pwlc-root .pwlc-dots i:nth-child(2) { animation-delay: 0.2s; }
#pwlc-root .pwlc-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes pwlc-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #pwlc-root .pwlc-dots i { animation: none; } }
