/* NW Product Assistant — front-end chat widget (v1.3.18) */

#nwpa-root {
	--nwpa-accent: #2c7a4b;
	--nwpa-accent-contrast: #ffffff;
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 99990;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#nwpa-root, #nwpa-root * { box-sizing: border-box; }

/* ---------- Launcher: full badge ---------- */
.nwpa-launch { position: relative; display: inline-block; }

.nwpa-badge {
	display: block;
	width: 132px;
	max-width: 40vw;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	line-height: 0;
}
/* Defend against theme button styles (hover/focus rectangles, backgrounds, outlines). */
#nwpa-root .nwpa-badge,
#nwpa-root .nwpa-badge:hover,
#nwpa-root .nwpa-badge:focus,
#nwpa-root .nwpa-badge:active {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	border-radius: 0 !important;
}
.nwpa-badge-img {
	width: 100%;
	height: auto;
	display: block;
	filter: drop-shadow(0 4px 9px rgba(0, 0, 0, 0.28));
	transition: transform 0.15s ease;
}
.nwpa-badge:hover .nwpa-badge-img,
.nwpa-badge:focus-visible .nwpa-badge-img {
	transform: translateY(-2px);
	filter: drop-shadow(0 4px 9px rgba(0, 0, 0, 0.28)) drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
}

/* Generated SVG badge — colours follow the accent setting */
.nwpa-badge-svg {
	width: 100%;
	height: auto;
	display: block;
	filter: drop-shadow(0 4px 9px rgba(0, 0, 0, 0.28));
	transition: transform 0.15s ease;
}
.nwpa-badge:hover .nwpa-badge-svg,
.nwpa-badge:focus-visible .nwpa-badge-svg {
	transform: translateY(-2px);
	filter: drop-shadow(0 4px 9px rgba(0, 0, 0, 0.28)) drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
}
.nwpa-badge-svg .nw-a { fill: var(--nwpa-accent); }
.nwpa-badge-svg .nw-c { fill: var(--nwpa-accent-contrast); }
.nwpa-badge-svg .nw-f { fill: rgba(0, 0, 0, 0.18); }

.nwpa-min {
	position: absolute;
	top: 0;
	right: 14%;
	width: 17px;
	height: 17px;
	border-radius: 50%;
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
/* Invisible enlarged touch target (29px) so the small circle stays easy to tap. */
.nwpa-min::after {
	content: "";
	position: absolute;
	top: -6px;
	right: -6px;
	bottom: -6px;
	left: -6px;
	border-radius: 50%;
}
/* Defend against theme button styles (e.g. dark hover backgrounds). */
#nwpa-root .nwpa-min,
#nwpa-root .nwpa-min:hover,
#nwpa-root .nwpa-min:focus,
#nwpa-root .nwpa-min:active {
	background: #fff !important;
	color: #52606d !important;
	border: 1px solid #cbd2d9 !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
	outline: none !important;
	min-width: 0 !important;
	min-height: 0 !important;
}
#nwpa-root .nwpa-min:hover {
	color: #1f2933 !important;
	border-color: #9aa5b1 !important;
}

/* ---------- Launcher: minimised puck ---------- */
.nwpa-puck {
	padding: 0;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--nwpa-accent);
	color: var(--nwpa-accent-contrast);
	border: none;
	cursor: pointer;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 24px;
	line-height: 1;
	box-shadow: 0 5px 16px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}
.nwpa-puck:hover { transform: scale(1.07); }

@media (max-width: 600px) {
	.nwpa-badge { width: 104px; }
}

/* ---------- Panel ---------- */
.nwpa-panel {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 360px;
	max-width: calc(100vw - 40px);
	height: 520px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
	display: none;
	flex-direction: column;
	overflow: hidden;
}
.nwpa-panel.nwpa-open { display: flex; }

.nwpa-header {
	background: var(--nwpa-accent);
	color: var(--nwpa-accent-contrast);
	padding: 12px 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 auto;
}
.nwpa-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--nwpa-accent-contrast);
}
.nwpa-hbtns { display: flex; gap: 2px; }
.nwpa-hbtn {
	background: none;
	border: none;
	color: var(--nwpa-accent-contrast);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0 6px;
	opacity: 0.9;
}
.nwpa-hbtn:hover { opacity: 1; }

/* ---------- Voice toggles ---------- */
.nwpa-subbar {
	flex: 0 0 auto;
	display: flex;
	gap: 8px;
	padding: 8px 12px;
	background: #fff;
	border-bottom: 1px solid #eef0f2;
}
.nwpa-vtoggle {
	width: 36px;
	height: 36px;
	padding: 0;
	flex: 0 0 auto;
	min-width: 0;
	border-radius: 50%;
	border: 1px solid #cbd2d9;
	background: #fff;
	color: #52606d;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.nwpa-vtoggle svg { width: 19px; height: 19px; fill: currentColor; flex-shrink: 0; }
.nwpa-vtoggle:hover { border-color: var(--nwpa-accent); color: var(--nwpa-accent); }
.nwpa-vtoggle.nwpa-on {
	background: var(--nwpa-accent);
	border-color: var(--nwpa-accent);
	color: var(--nwpa-accent-contrast);
}
.nwpa-vtoggle.nwpa-disabled { opacity: 0.4; cursor: not-allowed; }
.nwpa-vtoggle.nwpa-listening { animation: nwpa-pulse 1.2s infinite; }

@keyframes nwpa-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(44, 122, 75, 0.45); }
	50% { box-shadow: 0 0 0 6px rgba(44, 122, 75, 0); }
}

/* ---------- Messages ---------- */
.nwpa-messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 16px;
	background: #f7f8fa;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.nwpa-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.nwpa-msg a { color: inherit; text-decoration: underline; }
.nwpa-msg-bot {
	align-self: flex-start;
	background: #fff;
	color: #1f2933;
	border: 1px solid #e4e7eb;
	border-bottom-left-radius: 4px;
}
.nwpa-msg-user {
	align-self: flex-end;
	background: var(--nwpa-accent);
	color: var(--nwpa-accent-contrast);
	border-bottom-right-radius: 4px;
}

.nwpa-typing {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e4e7eb;
	border-radius: 14px;
	padding: 12px 14px;
	display: flex;
	gap: 4px;
}
.nwpa-typing span {
	width: 7px; height: 7px;
	border-radius: 50%;
	background: #9aa5b1;
	animation: nwpa-bounce 1.2s infinite ease-in-out;
}
.nwpa-typing span:nth-child(2) { animation-delay: 0.2s; }
.nwpa-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes nwpa-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Input ---------- */
.nwpa-input {
	flex: 0 0 auto;
	display: flex;
	border-top: 1px solid #e4e7eb;
	padding: 10px;
	gap: 8px;
	background: #fff;
}
.nwpa-input textarea {
	flex: 1;
	resize: none;
	border: 1px solid #cbd2d9;
	border-radius: 10px;
	padding: 9px 11px;
	font-size: 14px;
	font-family: inherit;
	height: 42px;
	min-height: 42px;
	max-height: 84px;
	line-height: 1.4;
	outline: none;
}
.nwpa-input textarea:focus { border-color: var(--nwpa-accent); }
.nwpa-send {
	background: var(--nwpa-accent);
	color: var(--nwpa-accent-contrast);
	border: none;
	border-radius: 10px;
	padding: 0 16px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
}
.nwpa-send:disabled { opacity: 0.5; cursor: not-allowed; }

.nwpa-footer {
	flex: 0 0 auto;
	text-align: center;
	font-size: 11px;
	color: #9aa5b1;
	padding: 6px;
	background: #fff;
}

/* ---------- Support handoff ---------- */
.nwpa-handoff {
	align-self: stretch;
	background: #fff;
	border: 1px solid #e4e7eb;
	border-radius: 12px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.nwpa-hf-text { margin: 0; font-size: 13px; color: #1f2933; line-height: 1.4; }
.nwpa-hf-input {
	border: 1px solid #cbd2d9;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 14px;
	font-family: inherit;
	outline: none;
}
.nwpa-hf-input:focus { border-color: var(--nwpa-accent); }
.nwpa-hf-input.nwpa-hf-error { border-color: #d64545; background: #fff5f5; }
.nwpa-hf-actions { display: flex; gap: 8px; margin-top: 2px; }
.nwpa-hf-send {
	background: var(--nwpa-accent);
	color: var(--nwpa-accent-contrast);
	border: none;
	border-radius: 8px;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
}
.nwpa-hf-send:hover { filter: brightness(1.08); }
.nwpa-hf-cancel {
	background: #fff;
	color: #52606d;
	border: 1px solid #cbd2d9;
	border-radius: 8px;
	padding: 8px 14px;
	font-size: 13px;
	font-family: inherit;
	cursor: pointer;
}
.nwpa-hf-cancel:hover { color: #1f2933; border-color: #9aa5b1; }
.nwpa-hf-send:disabled, .nwpa-hf-cancel:disabled { opacity: 0.55; cursor: default; }
