/* NIEHUB Live Chat — colours come from CSS variables set inline by the plugin settings. */
.nlc-root {
	--nlc-primary: #0f4c5c;
	--nlc-on-primary: #fff;
	--nlc-accent: #e0a526;
	--nlc-on-accent: #111827;
	--nlc-user: #0f4c5c;
	--nlc-on-user: #fff;
	--nlc-bot: #fff;
	--nlc-on-bot: #111827;
	--nlc-surface: #f3f5f6;
	--nlc-line: rgba(17, 24, 39, .12);
	--nlc-muted: #66717a;
	--nlc-online: #22c55e;
	box-sizing: border-box;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.45;
	color: #1f2933;
}
.nlc-root *,
.nlc-root *::before,
.nlc-root *::after { box-sizing: border-box; }
.nlc-root [hidden] { display: none !important; }
.nlc-root button,
.nlc-root input,
.nlc-root textarea { font: inherit; color: inherit; }

/* Floating placement */
.nlc-floating { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 999990; }
.nlc-floating.nlc-pos-right { right: 20px; }
.nlc-floating.nlc-pos-left { left: 20px; }

/* Launcher */
.nlc-launcher {
	position: relative;
	display: grid;
	place-items: center;
	width: 60px;
	height: 60px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nlc-primary);
	color: var(--nlc-on-primary);
	box-shadow: 0 0 0 3px var(--nlc-accent), 0 10px 26px rgba(0, 0, 0, .25);
	cursor: pointer;
	transition: transform .2s ease, box-shadow .2s ease;
}
.nlc-launcher:hover { transform: translateY(-2px) scale(1.04); }
.nlc-launcher:focus-visible,
.nlc-iconbtn:focus-visible,
.nlc-send:focus-visible,
.nlc-chip:focus-visible,
.nlc-btn:focus-visible { outline: 3px solid var(--nlc-accent); outline-offset: 2px; }
.nlc-pos-left .nlc-launcher { margin-right: auto; }
.nlc-pos-right .nlc-launcher { margin-left: auto; }
.nlc-unread {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	border-radius: 10px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
}
.nlc-icon { display: inline-flex; }

/* Window */
.nlc-window {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	width: 380px;
	max-width: calc(100vw - 24px);
	height: 600px;
	max-height: calc(100vh - 110px);
	background: var(--nlc-surface);
	border-radius: 18px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
.nlc-floating .nlc-window {
	position: absolute;
	bottom: 76px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(14px) scale(.97);
	transform-origin: bottom right;
	transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
.nlc-floating.nlc-pos-right .nlc-window { right: 0; }
.nlc-floating.nlc-pos-left .nlc-window { left: 0; transform-origin: bottom left; }
.nlc-floating.nlc-open .nlc-window {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .22s ease, transform .22s ease, visibility 0s;
}

/* Inline (shortcode) */
.nlc-inline { margin: 1.5em auto; max-width: 720px; }
.nlc-inline .nlc-window {
	position: relative;
	width: 100%;
	max-width: 100%;
	height: var(--nlc-inline-height, 560px);
	max-height: none;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .14);
	border: 1px solid var(--nlc-line);
}

/* Header */
.nlc-header {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: none;
	padding: 14px 14px 14px 16px;
	background: var(--nlc-primary);
	color: var(--nlc-on-primary);
	border-bottom: 3px solid var(--nlc-accent);
}
.nlc-logo {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	overflow: hidden;
	border-radius: 50%;
	background: var(--nlc-accent);
	color: var(--nlc-on-accent);
	font-weight: 700;
	font-size: 17px;
}
.nlc-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nlc-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nlc-title { font-size: 15px; font-weight: 700; letter-spacing: .02em; line-height: 1.2; }
.nlc-status { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; opacity: .9; }
.nlc-dot {
	flex: none;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--nlc-online);
	box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
	animation: nlc-pulse 2.4s ease-out infinite;
}
.nlc-dot-wait { background: #f59e0b; animation: none; }
.nlc-iconbtn {
	display: grid;
	place-items: center;
	flex: none;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: inherit;
	cursor: pointer;
	transition: background .15s ease;
}
.nlc-iconbtn:hover { background: rgba(255, 255, 255, .26); }

/* Messages */
.nlc-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 8px; }
.nlc-msgs { display: flex; flex-direction: column; gap: 10px; }
.nlc-row { display: flex; flex-direction: column; max-width: 84%; animation: nlc-in .2s ease both; }
.nlc-row-user { align-self: flex-end; align-items: flex-end; }
.nlc-row-bot { align-self: flex-start; align-items: flex-start; }
.nlc-row-system { align-self: center; align-items: center; max-width: 92%; }
.nlc-bubble { padding: 9px 13px; border-radius: 16px; word-wrap: break-word; overflow-wrap: anywhere; }
.nlc-bubble p { margin: 0; }
.nlc-bubble p + p,
.nlc-bubble ul + p,
.nlc-bubble ol + p,
.nlc-bubble p + ul,
.nlc-bubble p + ol { margin-top: 8px; }
.nlc-bubble ul,
.nlc-bubble ol { margin: 6px 0 0; padding-left: 20px; }
.nlc-bubble li + li { margin-top: 3px; }
.nlc-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.nlc-row-user .nlc-bubble {
	white-space: pre-wrap;
	background: var(--nlc-user);
	color: var(--nlc-on-user);
	border-bottom-right-radius: 4px;
}
.nlc-row-bot .nlc-bubble {
	background: var(--nlc-bot);
	color: var(--nlc-on-bot);
	border: 1px solid var(--nlc-line);
	border-bottom-left-radius: 4px;
}
.nlc-row-team .nlc-bubble { border-left: 4px solid var(--nlc-accent); }
.nlc-author { margin: 0 0 3px 4px; font-size: 11px; font-weight: 600; color: var(--nlc-muted); }
.nlc-row-system .nlc-bubble {
	padding: 6px 12px;
	background: transparent;
	border: 1px dashed var(--nlc-line);
	color: var(--nlc-muted);
	font-size: 12.5px;
	text-align: center;
}
.nlc-row-error .nlc-bubble { border-color: #ef4444; color: #b91c1c; }
.nlc-time { margin: 3px 4px 0; font-size: 11px; color: var(--nlc-muted); }

/* Typing indicator */
.nlc-typing .nlc-bubble { display: flex; gap: 4px; padding: 12px 14px; }
.nlc-d { width: 7px; height: 7px; border-radius: 50%; background: var(--nlc-muted); animation: nlc-bounce 1.1s infinite ease-in-out; }
.nlc-d:nth-child(2) { animation-delay: .15s; }
.nlc-d:nth-child(3) { animation-delay: .3s; }

/* Suggested questions */
.nlc-quick { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 14px 10px; }
.nlc-chip {
	padding: 7px 12px;
	border: 1px solid var(--nlc-primary);
	border-radius: 999px;
	background: #fff;
	color: var(--nlc-primary);
	font-size: 13px;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.nlc-chip:hover { background: var(--nlc-primary); color: var(--nlc-on-primary); }

/* Human request card */
.nlc-card {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px;
	background: #fff;
	border: 1px solid var(--nlc-line);
	border-top: 3px solid var(--nlc-accent);
	border-radius: 12px;
}
.nlc-card p { margin: 0; color: var(--nlc-muted); font-size: 13px; }
.nlc-card input {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid var(--nlc-line);
	border-radius: 8px;
	background: #fff;
}
.nlc-card input:focus { outline: 2px solid var(--nlc-accent); outline-offset: 0; }
.nlc-card .nlc-card-error { color: #b91c1c; }
.nlc-card-actions { display: flex; gap: 8px; }
.nlc-btn {
	padding: 8px 14px;
	border: 1px solid var(--nlc-line);
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
}
.nlc-btn-primary { background: var(--nlc-primary); border-color: var(--nlc-primary); color: var(--nlc-on-primary); }
.nlc-btn:disabled { opacity: .6; cursor: default; }
.nlc-card-alt a { color: var(--nlc-primary); }

/* Input */
.nlc-form {
	flex: none;
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	background: #fff;
	border-top: 1px solid var(--nlc-line);
}
.nlc-input {
	flex: 1;
	min-height: 40px;
	max-height: 120px;
	padding: 9px 12px;
	border: 1px solid var(--nlc-line);
	border-radius: 20px;
	background: var(--nlc-surface);
	resize: none;
	overflow-y: auto;
}
.nlc-input:focus { outline: 2px solid var(--nlc-accent); outline-offset: 0; background: #fff; }
.nlc-send {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--nlc-accent);
	color: var(--nlc-on-accent);
	cursor: pointer;
	transition: transform .15s ease, opacity .15s ease;
}
.nlc-send:hover:not(:disabled) { transform: scale(1.07); }
.nlc-send:disabled { opacity: .45; cursor: default; }
.nlc-foot { flex: none; padding: 0 14px 10px; background: #fff; color: var(--nlc-muted); font-size: 11px; text-align: center; }

/* Animations */
@keyframes nlc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes nlc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes nlc-pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@media (prefers-reduced-motion: reduce) {
	.nlc-root *, .nlc-root *::before, .nlc-root *::after { animation: none !important; transition: none !important; }
}

/* Phones: full-screen sheet */
@media (max-width: 480px) {
	.nlc-floating { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
	.nlc-floating.nlc-pos-right { right: 14px; }
	.nlc-floating.nlc-pos-left { left: 14px; }
	.nlc-floating .nlc-window {
		position: fixed;
		inset: 0;
		bottom: 0;
		width: 100%;
		max-width: none;
		height: 100vh;
		height: 100dvh;
		max-height: none;
		border-radius: 0;
		box-shadow: none;
	}
	.nlc-floating.nlc-open .nlc-launcher { visibility: hidden; }
	.nlc-floating .nlc-header { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
	.nlc-floating .nlc-form { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
	.nlc-input { font-size: 16px; } /* prevents iOS zoom on focus */
}
