/* ============================================================
   Nia — NiS Intelligent Assistant widget
   ============================================================ */
.nia-root {
	--nia-navy: #1A206D;
	--nia-navy-deep: #131845;
	--nia-red: #FF3131;
	--nia-ink: #1b1f3b;
	--nia-sans: 'League Spartan', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--nia-serif: 'Libre Baskerville', Georgia, serif;
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 99998;
	font-family: var(--nia-sans);
}

/* The marketing site hides the native cursor (body{cursor:none}) and draws a
   custom reticle that sits below this widget — leaving no visible cursor over
   the panel. Restore a normal, responsive cursor inside the widget. */
.nia-root, .nia-root * { cursor: auto; }
.nia-launch, .nia-min, .nia-send, .nia-teaser-x, .nia-teaser.nia-show, .nia-bubble a, .nia-msg a { cursor: pointer; }
.nia-input textarea { cursor: text; }

/* ---------- launcher ---------- */
.nia-launch {
	position: relative;
	width: 62px;
	height: 62px;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	background: linear-gradient(135deg, var(--nia-navy) 0%, var(--nia-navy-deep) 100%);
	box-shadow: 0 10px 30px rgba(19, 24, 69, .45);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .2s ease, box-shadow .2s ease;
}
.nia-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(19, 24, 69, .55); }
.nia-launch-av {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: #fff;
	object-fit: cover;
	padding: 2px;
	transition: opacity .15s ease, transform .15s ease;
}
.nia-launch-x {
	position: absolute;
	width: 26px;
	height: 26px;
	color: #fff;
	opacity: 0;
	transform: rotate(-45deg) scale(.6);
	transition: opacity .15s ease, transform .15s ease;
}
.nia-launch.nia-open .nia-launch-av { opacity: 0; transform: scale(.6); }
.nia-launch.nia-open .nia-launch-x { opacity: 1; transform: rotate(0) scale(1); }

/* notification dot */
.nia-dot {
	position: absolute;
	top: 2px;
	right: 4px;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: var(--nia-red);
	border: 2px solid #fff;
	opacity: 0;
	transform: scale(0);
	transition: opacity .2s ease, transform .2s ease;
}
.nia-launch.nia-nudge .nia-dot { opacity: 1; transform: scale(1); }
.nia-launch.nia-open .nia-dot { opacity: 0; }

/* finite pulse ring */
.nia-launch-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--nia-red);
	opacity: 0;
}
.nia-launch.nia-nudge .nia-launch-ring { animation: nia-pulse 1.8s ease-out 3; }
.nia-launch.nia-open .nia-launch-ring { animation: none; }
@keyframes nia-pulse {
	0% { opacity: .6; transform: scale(1); }
	100% { opacity: 0; transform: scale(1.7); }
}

/* ---------- teaser bubble ---------- */
.nia-teaser {
	position: absolute;
	right: 0;
	bottom: 74px;
	width: 252px;
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fff;
	color: var(--nia-ink);
	border-radius: 14px;
	padding: 12px 30px 12px 12px;
	box-shadow: 0 12px 34px rgba(19, 24, 69, .26);
	opacity: 0;
	transform: translateY(8px) scale(.96);
	transform-origin: bottom right;
	pointer-events: none;
	transition: opacity .25s ease, transform .25s ease;
}
.nia-teaser.nia-show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; cursor: pointer; }
.nia-teaser-av { width: 38px; height: 38px; border-radius: 50%; background: #eef0f7; flex: 0 0 auto; object-fit: cover; }
.nia-teaser-txt { font-size: 13.5px; line-height: 1.35; font-family: var(--nia-serif); }
.nia-teaser-x {
	position: absolute;
	top: 6px;
	right: 8px;
	border: none;
	background: none;
	font-size: 17px;
	line-height: 1;
	color: #9aa0bd;
	cursor: pointer;
}
.nia-teaser-x:hover { color: var(--nia-ink); }

/* ---------- panel ---------- */
.nia-panel {
	position: absolute;
	right: 0;
	bottom: 76px;
	width: 374px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(19, 24, 69, .34);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: nia-rise .22s ease;
}
/* Guarantee closed state can't be overridden by the display rule above. */
.nia-panel[hidden] { display: none; }
@keyframes nia-rise {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: translateY(0); }
}

/* header */
.nia-head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 14px 14px 16px;
	background: linear-gradient(135deg, var(--nia-navy) 0%, var(--nia-navy-deep) 100%);
	color: #fff;
}
.nia-head-av { position: relative; flex: 0 0 auto; }
.nia-head-av img { width: 42px; height: 42px; border-radius: 50%; background: #fff; object-fit: cover; padding: 2px; display: block; }
.nia-online {
	position: absolute;
	right: 0;
	bottom: 1px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #36d07a;
	border: 2px solid var(--nia-navy-deep);
}
.nia-head-meta { display: flex; flex-direction: column; line-height: 1.2; flex: 1 1 auto; }
.nia-head-name { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.nia-head-sub { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255, 255, 255, .72); }
.nia-min {
	border: none;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	font-size: 14px;
	cursor: pointer;
	transition: background .2s ease;
}
.nia-min:hover { background: rgba(255, 255, 255, .26); }

/* log */
.nia-log {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 18px 16px 6px;
	background: #f6f7fb;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.nia-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.nia-msg-av { flex: 0 0 auto; }
.nia-msg-av img { width: 26px; height: 26px; border-radius: 50%; background: #fff; object-fit: cover; padding: 1px; display: block; }
.nia-bubble {
	font-family: var(--nia-serif);
	font-size: 14px;
	line-height: 1.55;
	padding: 10px 13px;
	border-radius: 14px;
	max-width: 76%;
	word-wrap: break-word;
}
.nia-bubble a { color: var(--nia-red); text-decoration: underline; }
.nia-bubble p { margin: 0 0 9px; }
.nia-bubble p:last-child { margin-bottom: 0; }
.nia-bubble ul, .nia-bubble ol { margin: 6px 0 9px; padding-left: 18px; }
.nia-bubble ul:last-child, .nia-bubble ol:last-child { margin-bottom: 0; }
.nia-bubble li { margin: 3px 0; padding-left: 2px; }
.nia-bubble li::marker { color: var(--nia-red); }
.nia-bubble strong { font-weight: 700; }
.nia-bubble em { font-style: italic; }
.nia-bot { justify-content: flex-start; }
.nia-bot .nia-bubble { background: #fff; color: var(--nia-ink); border-bottom-left-radius: 5px; box-shadow: 0 1px 2px rgba(19, 24, 69, .08); }
.nia-user { justify-content: flex-end; }
.nia-user .nia-bubble { background: linear-gradient(135deg, var(--nia-navy) 0%, var(--nia-navy-deep) 100%); color: #fff; border-bottom-right-radius: 5px; }
.nia-user .nia-bubble a { color: #fff; }

/* typing */
.nia-typing { display: inline-flex; gap: 4px; align-items: center; }
.nia-typing span { width: 7px; height: 7px; border-radius: 50%; background: #b9bdd4; display: inline-block; animation: nia-blink 1.2s infinite ease-in-out; }
.nia-typing span:nth-child(2) { animation-delay: .2s; }
.nia-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes nia-blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* input */
.nia-input {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #e8eaf2;
	background: #fff;
}
.nia-input textarea {
	flex: 1 1 auto;
	resize: none;
	border: 1px solid #d9dcec;
	border-radius: 12px;
	padding: 10px 12px;
	font-family: var(--nia-serif);
	font-size: 14px;
	line-height: 1.4;
	max-height: 110px;
	outline: none;
	color: var(--nia-ink);
}
.nia-input textarea:focus { border-color: var(--nia-navy); }
.nia-send {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 11px;
	background: var(--nia-red);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease, transform .1s ease;
}
.nia-send svg { width: 19px; height: 19px; }
.nia-send:hover { background: #e21d1d; }
.nia-send:active { transform: scale(.94); }

/* footer */
.nia-foot {
	padding: 8px 14px 11px;
	font-size: 10.5px;
	line-height: 1.35;
	color: #9aa0bd;
	text-align: center;
	background: #fff;
}

/* ---------- mobile ---------- */
@media (max-width: 480px) {
	.nia-root { right: 14px; bottom: 14px; }
	.nia-panel {
		position: fixed;
		right: 8px;
		left: 8px;
		bottom: 84px;
		top: 14px;
		width: auto;
		height: auto;
		max-height: none;
	}
	.nia-teaser { bottom: 70px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.nia-launch-ring, .nia-typing span, .nia-panel { animation: none !important; }
	.nia-launch, .nia-teaser, .nia-send { transition: none !important; }
}
