/*!
 * Nova AI Chat — front-end widget
 */
@font-face {
	font-family: 'NovaVazir';
	src: url('../fonts/Vazirmatn.woff2') format('woff2');
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

#nova-chat-root {
	--nv-p: #6C4CF1;
	--nv-s: #00C2FF;
	--nv-ox: 24px;
	--nv-oy: 24px;
	--nv-size: 64px;
	--nv-font: 'NovaVazir', Tahoma, sans-serif;
	--nv-ease: cubic-bezier(.2, .9, .25, 1.15);
	--nv-ease-out: cubic-bezier(.16, 1, .3, 1);

	/* light theme */
	--nv-glass: rgba(255, 255, 255, .78);
	--nv-surface: #ffffff;
	--nv-surface-2: #f5f4fb;
	--nv-text: #17152b;
	--nv-muted: #6d6a85;
	--nv-line: rgba(30, 24, 80, .09);
	--nv-in: #ffffff;
	--nv-in-text: #1d1b33;
	--nv-shadow: 0 30px 80px -20px rgba(40, 24, 120, .45), 0 12px 30px -12px rgba(20, 10, 60, .25);
	--nv-grid: color-mix(in srgb, var(--nv-p) 22%, transparent);

	position: fixed;
	bottom: var(--nv-oy);
	z-index: 2147483000;
	font-family: var(--nv-font);
	direction: rtl;
	color: var(--nv-text);
	-webkit-font-smoothing: antialiased;
}
#nova-chat-root.nv-right { right: var(--nv-ox); }
#nova-chat-root.nv-left { left: var(--nv-ox); }

#nova-chat-root.nv-theme-dark,
#nova-chat-root.nv-theme-auto.nv-sys-dark {
	--nv-glass: rgba(18, 16, 34, .82);
	--nv-surface: #1a1830;
	--nv-surface-2: #23203d;
	--nv-text: #f1efff;
	--nv-muted: #a29fbd;
	--nv-line: rgba(255, 255, 255, .08);
	--nv-in: #26233f;
	--nv-in-text: #eeecff;
	--nv-shadow: 0 30px 90px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .05);
	--nv-grid: color-mix(in srgb, var(--nv-s) 30%, transparent);
}

/* scoped reset — zero specificity so component classes always win */
:where(#nova-chat-root) *,
:where(#nova-chat-root) *::before,
:where(#nova-chat-root) *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	text-shadow: none;
	line-height: 1.7;
}
:where(#nova-chat-root) :where(button, input, textarea) {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	outline: 0;
	box-shadow: none;
	min-height: 0;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 0;
	text-align: inherit;
}
:where(#nova-chat-root) button { cursor: pointer; }
:where(#nova-chat-root) svg { display: block; flex-shrink: 0; }
:where(#nova-chat-root) img { max-width: 100%; display: block; border: 0; }
:where(#nova-chat-root) a { color: inherit; }
:where(#nova-chat-root) :focus-visible { outline: 2px solid var(--nv-s); outline-offset: 2px; border-radius: 8px; }
/* defend against aggressive theme button styles */
#nova-chat-root .nv-launcher { width: var(--nv-size); height: var(--nv-size); padding: 0; background: none; border: 0; box-shadow: none; border-radius: 50%; }
#nova-chat-root .nv-head-btn { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .16); }
#nova-chat-root .nv-head-btn:hover { background: rgba(255, 255, 255, .28); }
#nova-chat-root .nv-mode { padding: 0; border: 0; background: none; box-shadow: none; border-radius: 10px; }
#nova-chat-root .nv-teaser-x, #nova-chat-root .nv-retry { padding: 0; border: 0; background: none; box-shadow: none; }

/* ================================================================
 * LAUNCHER — 3D orb
 * ================================================================ */
.nv-launcher {
	position: relative;
	width: var(--nv-size);
	height: var(--nv-size);
	perspective: 500px;
	transition: transform .5s var(--nv-ease), opacity .3s;
	animation: nv-float 5s ease-in-out infinite;
	-webkit-tap-highlight-color: transparent;
}
.nv-orb {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	transform: rotateX(var(--lx, 0deg)) rotateY(var(--ly, 0deg));
	transition: transform .35s var(--nv-ease-out);
}
.nv-orb-core {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background:
		radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .85) 0, rgba(255, 255, 255, .15) 22%, transparent 42%),
		radial-gradient(circle at 70% 85%, color-mix(in srgb, var(--nv-s) 90%, #fff) 0, transparent 55%),
		conic-gradient(from 210deg, var(--nv-p), var(--nv-s), var(--nv-p));
	box-shadow:
		inset -8px -10px 18px rgba(0, 0, 0, .28),
		inset 6px 8px 14px rgba(255, 255, 255, .35),
		0 14px 30px -8px color-mix(in srgb, var(--nv-p) 70%, transparent),
		0 4px 10px rgba(0, 0, 0, .15);
	transform: translateZ(0);
	overflow: hidden;
}
.nv-orb-core::after { /* liquid shimmer */
	content: '';
	position: absolute;
	inset: -40%;
	background: conic-gradient(from 0deg, transparent 0 60%, rgba(255, 255, 255, .35) 70%, transparent 80%);
	animation: nv-spin 4.5s linear infinite;
	mix-blend-mode: overlay;
}
.nv-orb-ring {
	position: absolute;
	inset: -9px;
	border-radius: 50%;
	border: 2px solid transparent;
	border-top-color: color-mix(in srgb, var(--nv-s) 85%, #fff);
	border-bottom-color: color-mix(in srgb, var(--nv-p) 60%, transparent);
	transform: rotateX(72deg) rotateZ(0deg);
	animation: nv-ring 3.2s linear infinite;
	filter: drop-shadow(0 0 4px var(--nv-s));
	pointer-events: none;
}
.nv-orb-ring.r2 {
	inset: -5px;
	border-top-color: color-mix(in srgb, var(--nv-p) 70%, #fff);
	border-bottom-color: transparent;
	transform: rotateY(70deg) rotateZ(0deg);
	animation: nv-ring2 4.6s linear infinite;
	opacity: .8;
}
.nv-orb-icon {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: #fff;
	transform: translateZ(18px);
	transition: transform .5s var(--nv-ease), opacity .3s;
	filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25));
}
.nv-orb-icon svg { width: 46%; height: 46%; }
.nv-orb-icon img { width: 62%; height: 62%; object-fit: contain; border-radius: 30%; }
.nv-orb-icon.nv-x { transform: translateZ(18px) rotate(-120deg) scale(.3); opacity: 0; }
.nv-launcher:hover { animation-play-state: paused; }
.nv-launcher:hover .nv-orb-core { filter: saturate(1.15) brightness(1.05); }
.nv-launcher:active .nv-orb { transform: scale(.92); }

.nv-open .nv-launcher .nv-orb-icon.nv-main { transform: translateZ(18px) rotate(120deg) scale(.3); opacity: 0; }
.nv-open .nv-launcher .nv-orb-icon.nv-x { transform: translateZ(18px) rotate(0) scale(1); opacity: 1; }

.nv-pulse {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	pointer-events: none;
}
.nv-pulse::before,
.nv-pulse::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid color-mix(in srgb, var(--nv-p) 55%, transparent);
	animation: nv-pulse 2.8s var(--nv-ease-out) infinite;
}
.nv-pulse::after { animation-delay: 1.4s; border-color: color-mix(in srgb, var(--nv-s) 55%, transparent); }
.nv-open .nv-pulse { display: none; }

.nv-badge {
	position: absolute;
	top: -2px;
	inset-inline-start: -2px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: linear-gradient(135deg, #ff4d6d, #ff8a3d);
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	line-height: 22px;
	text-align: center;
	box-shadow: 0 4px 12px rgba(255, 77, 109, .5), 0 0 0 3px var(--nv-surface);
	transform: translateZ(30px) scale(0);
	transition: transform .4s var(--nv-ease);
}
.nv-badge.nv-show { transform: translateZ(30px) scale(1); }

/* teaser bubble */
.nv-teaser {
	position: absolute;
	bottom: calc(var(--nv-size) + 14px);
	width: max-content;
	max-width: 240px;
	padding: 12px 16px;
	padding-inline-end: 34px;
	background: var(--nv-surface);
	color: var(--nv-text);
	border-radius: 18px;
	font-size: 14px;
	font-weight: 600;
	box-shadow: 0 18px 40px -12px rgba(30, 20, 90, .35), 0 0 0 1px var(--nv-line);
	opacity: 0;
	transform: translateY(10px) rotateX(30deg) scale(.9);
	transform-origin: bottom;
	transition: all .5s var(--nv-ease);
	pointer-events: none;
	cursor: pointer;
}
.nv-right .nv-teaser { right: 0; border-bottom-right-radius: 6px; }
.nv-left .nv-teaser { left: 0; border-bottom-left-radius: 6px; }
.nv-teaser.nv-show { opacity: 1; transform: none; pointer-events: auto; }
.nv-teaser::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 1.5px;
	background: linear-gradient(135deg, var(--nv-p), var(--nv-s));
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
}
.nv-teaser-x {
	position: absolute;
	top: 50%;
	inset-inline-end: 8px;
	width: 22px;
	height: 22px;
	margin-top: -11px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	color: var(--nv-muted);
	font-size: 16px;
	line-height: 1;
}
.nv-teaser-x:hover { background: var(--nv-surface-2); }

/* ================================================================
 * WINDOW
 * ================================================================ */
.nv-stage {
	position: absolute;
	bottom: calc(var(--nv-size) + 18px);
	width: 392px;
	height: min(660px, calc(100vh - var(--nv-size) - var(--nv-oy) - 40px));
	perspective: 1400px;
	pointer-events: none;
}
.nv-right .nv-stage { right: 0; }
.nv-left .nv-stage { left: 0; }

.nv-window {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	border-radius: 28px;
	background: var(--nv-glass);
	-webkit-backdrop-filter: blur(22px) saturate(1.6);
	backdrop-filter: blur(22px) saturate(1.6);
	box-shadow: var(--nv-shadow);
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(50px) rotateX(-28deg) rotateY(var(--nv-open-ry, -14deg)) scale(.7);
	transition: transform .7s var(--nv-ease), opacity .35s ease, visibility 0s .7s;
	will-change: transform;
}
.nv-right .nv-window { transform-origin: 85% 100%; --nv-open-ry: -14deg; }
.nv-left .nv-window { transform-origin: 15% 100%; --nv-open-ry: 14deg; }

.nv-open .nv-stage { pointer-events: auto; }
.nv-open .nv-window {
	opacity: 1;
	visibility: visible;
	transform: rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg));
	transition: transform .7s var(--nv-ease), opacity .3s ease, visibility 0s;
}
.nv-open .nv-window.nv-tilting { transition: transform .15s ease-out, opacity .3s; }

/* gradient border */
.nv-window::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 1px;
	background: linear-gradient(160deg, rgba(255, 255, 255, .9), color-mix(in srgb, var(--nv-p) 40%, transparent) 40%, color-mix(in srgb, var(--nv-s) 40%, transparent));
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
	z-index: 5;
}
/* specular glare follows pointer */
.nv-glare {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: radial-gradient(500px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, .22), transparent 40%);
	pointer-events: none;
	z-index: 6;
	opacity: 0;
	transition: opacity .4s;
	mix-blend-mode: soft-light;
}
.nv-window:hover .nv-glare { opacity: 1; }

/* ---------- header ---------- */
.nv-head {
	position: relative;
	flex-shrink: 0;
	padding: 18px 18px 54px;
	color: #fff;
	isolation: isolate;
}
.nv-head-bg {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	background: linear-gradient(135deg, var(--nv-p) 0%, color-mix(in srgb, var(--nv-p) 55%, var(--nv-s)) 55%, var(--nv-s) 100%);
}
.nv-blob {
	position: absolute;
	border-radius: 50%;
	filter: blur(2px);
	background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .55), rgba(255, 255, 255, .06) 60%, transparent 70%);
	transform: translate(calc(var(--px, 0) * var(--d, 10px)), calc(var(--py, 0) * var(--d, 10px)));
	transition: transform .4s var(--nv-ease-out);
}
.nv-blob.b1 { width: 160px; height: 160px; top: -60px; inset-inline-end: -30px; --d: 18px; animation: nv-drift 9s ease-in-out infinite; }
.nv-blob.b2 { width: 90px; height: 90px; bottom: 6px; inset-inline-start: 22%; --d: -14px; opacity: .7; animation: nv-drift 7s ease-in-out infinite reverse; }
.nv-blob.b3 { width: 40px; height: 40px; top: 24px; inset-inline-start: 46%; --d: 26px; opacity: .8; animation: nv-drift 6s ease-in-out infinite; }
.nv-head-bg::after { /* fine dot pattern */
	content: '';
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, .22) 1px, transparent 1.4px);
	background-size: 14px 14px;
	-webkit-mask: linear-gradient(to bottom, #000, transparent 85%);
	mask: linear-gradient(to bottom, #000, transparent 85%);
}
.nv-head-wave {
	position: absolute;
	inset-inline: 0;
	bottom: -1px;
	height: 40px;
	z-index: -1;
	color: var(--nv-surface-2);
}
.nv-head-wave svg { width: 100%; height: 100%; }

.nv-head-row { display: flex; align-items: center; gap: 12px; }
.nv-coin {
	position: relative;
	width: 50px;
	height: 50px;
	flex-shrink: 0;
	perspective: 300px;
}
.nv-coin-inner {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	animation: nv-coin 7s var(--nv-ease-out) infinite;
}
.nv-coin-face {
	position: absolute;
	inset: 0;
	border-radius: 16px;
	display: grid;
	place-items: center;
	background: rgba(255, 255, 255, .95);
	color: var(--nv-p);
	box-shadow: 0 8px 18px -6px rgba(0, 0, 0, .35), inset 0 -3px 0 rgba(0, 0, 0, .06);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	overflow: hidden;
}
.nv-coin-face img { width: 78%; height: 78%; object-fit: contain; }
.nv-coin-face svg { width: 26px; height: 26px; }
.nv-coin-face.back {
	transform: rotateY(180deg);
	background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--nv-s) 20%, #fff));
}
.nv-head-text { flex: 1; min-width: 0; }
.nv-title { font-size: 17px; font-weight: 800; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .92; line-height: 1.5; }
.nv-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #3df5a7;
	box-shadow: 0 0 0 0 rgba(61, 245, 167, .7);
	animation: nv-online 2s infinite;
}
.nv-dot.off { background: #ffc84a; animation: none; box-shadow: none; }
.nv-head-btn {
	width: 36px;
	height: 36px;
	border-radius: 12px;
	display: grid;
	place-items: center;
	color: #fff;
	background: rgba(255, 255, 255, .16);
	transition: background .2s, transform .3s var(--nv-ease);
}
.nv-head-btn:hover { background: rgba(255, 255, 255, .28); transform: translateY(-1px); }
.nv-head-btn svg { width: 18px; height: 18px; }

/* mode switch */
.nv-modes {
	position: absolute;
	inset-inline: 18px;
	bottom: 12px;
	display: flex;
	padding: 4px;
	border-radius: 14px;
	background: rgba(255, 255, 255, .18);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
	z-index: 2;
}
.nv-mode {
	position: relative;
	z-index: 1;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 32px;
	border-radius: 10px;
	color: rgba(255, 255, 255, .9) !important;
	font-size: 13px !important;
	font-weight: 700;
	transition: color .3s;
}
.nv-mode svg { width: 16px; height: 16px; }
.nv-mode.nv-active { color: var(--nv-p) !important; }
.nv-mode-ind {
	position: absolute;
	top: 4px;
	bottom: 4px;
	width: calc(50% - 4px);
	right: 4px;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .25);
	transition: transform .5s var(--nv-ease);
}
.nv-mode-op .nv-mode-ind { transform: translateX(-100%); }

/* ---------- body ---------- */
.nv-body {
	position: relative;
	flex: 1;
	min-height: 0;
	background: var(--nv-surface-2);
	overflow: hidden;
}
/* 3D perspective grid floor */
.nv-floor {
	position: absolute;
	inset-inline: -50%;
	bottom: -10%;
	height: 70%;
	perspective: 260px;
	perspective-origin: 50% 0%;
	pointer-events: none;
	-webkit-mask: linear-gradient(to top, #000 10%, transparent 90%);
	mask: linear-gradient(to top, #000 10%, transparent 90%);
	opacity: .55;
}
.nv-floor::before {
	content: '';
	position: absolute;
	inset: 0;
	transform: rotateX(62deg);
	transform-origin: 50% 0%;
	background-image:
		linear-gradient(var(--nv-grid) 1px, transparent 1px),
		linear-gradient(90deg, var(--nv-grid) 1px, transparent 1px);
	background-size: 34px 34px;
	animation: nv-grid 3.5s linear infinite;
}
.nv-sphere {
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
	background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .9), color-mix(in srgb, var(--nv-p) 35%, transparent) 45%, color-mix(in srgb, var(--nv-s) 25%, transparent) 75%);
	box-shadow: inset -4px -6px 12px color-mix(in srgb, var(--nv-p) 25%, transparent);
	opacity: .5;
	animation: nv-bob 8s ease-in-out infinite;
}
.nv-sphere.s1 { width: 54px; height: 54px; top: 18%; inset-inline-start: -18px; }
.nv-sphere.s2 { width: 26px; height: 26px; top: 46%; inset-inline-end: 14px; animation-delay: -3s; animation-duration: 6s; }
.nv-sphere.s3 { width: 14px; height: 14px; top: 10%; inset-inline-end: 34%; animation-delay: -5s; }

.nv-scroll {
	position: absolute;
	inset: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 18px 16px 12px;
	scroll-behavior: smooth;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: color-mix(in srgb, var(--nv-p) 30%, transparent) transparent;
}
.nv-scroll::-webkit-scrollbar { width: 5px; }
.nv-scroll::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--nv-p) 30%, transparent); border-radius: 5px; }

/* welcome hero card */
.nv-hello {
	position: relative;
	padding: 18px;
	margin-bottom: 18px;
	border-radius: 22px;
	background: var(--nv-surface);
	box-shadow: 0 1px 0 var(--nv-line), 0 16px 34px -18px rgba(40, 24, 120, .35);
	animation: nv-in-card .8s var(--nv-ease) both;
	transform-origin: top;
}
.nv-hello-emoji {
	width: 44px;
	height: 44px;
	border-radius: 14px;
	display: grid;
	place-items: center;
	margin-bottom: 10px;
	background: linear-gradient(135deg, var(--nv-p), var(--nv-s));
	color: #fff;
	box-shadow: 0 10px 20px -8px var(--nv-p);
	transform: rotate(-8deg);
}
.nv-hello-emoji svg { width: 22px; height: 22px; }
.nv-hello-text { font-size: 15px; font-weight: 600; color: var(--nv-text); white-space: pre-line; }
.nv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.nv-chip {
	padding: 7px 13px !important;
	border-radius: 999px !important;
	font-size: 13px !important;
	font-weight: 600;
	color: var(--nv-p) !important;
	background: color-mix(in srgb, var(--nv-p) 9%, var(--nv-surface)) !important;
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nv-p) 22%, transparent) !important;
	transition: transform .3s var(--nv-ease), background .2s, color .2s !important;
	animation: nv-in-msg .6s var(--nv-ease) both;
}
.nv-theme-dark .nv-chip,
.nv-sys-dark .nv-chip { color: color-mix(in srgb, var(--nv-s) 70%, #fff) !important; }
.nv-chip:hover { transform: translateY(-2px); background: linear-gradient(135deg, var(--nv-p), var(--nv-s)) !important; color: #fff !important; }

/* messages */
.nv-msg {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	margin-bottom: 12px;
	animation: nv-in-msg .55s var(--nv-ease) both;
	transform-origin: bottom right;
}
.nv-msg.nv-me { flex-direction: row-reverse; transform-origin: bottom left; }
.nv-av {
	width: 30px;
	height: 30px;
	flex-shrink: 0;
	border-radius: 11px;
	display: grid;
	place-items: center;
	color: #fff;
	background: linear-gradient(135deg, var(--nv-p), var(--nv-s));
	box-shadow: 0 6px 12px -5px var(--nv-p);
	overflow: hidden;
}
.nv-av svg { width: 16px; height: 16px; }
.nv-av img { width: 100%; height: 100%; object-fit: cover; }
.nv-av.nv-op { background: linear-gradient(135deg, #10b981, #06b6d4); box-shadow: 0 6px 12px -5px #10b981; }
.nv-col { max-width: 80%; min-width: 0; display: flex; flex-direction: column; }
.nv-me .nv-col { align-items: flex-end; }
.nv-who { font-size: 11px; color: var(--nv-muted); margin: 0 6px 2px; font-weight: 700; line-height: 1.4; }
.nv-bubble {
	position: relative;
	padding: 10px 14px;
	border-radius: 18px;
	font-size: 14.2px;
	line-height: 1.85;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	background: var(--nv-in);
	color: var(--nv-in-text);
	border-bottom-right-radius: 6px;
	box-shadow: 0 1px 0 var(--nv-line), 0 10px 22px -14px rgba(30, 20, 90, .4);
}
.nv-me .nv-bubble {
	color: #fff;
	background: linear-gradient(135deg, var(--nv-p), color-mix(in srgb, var(--nv-p) 50%, var(--nv-s)));
	border-radius: 18px;
	border-bottom-left-radius: 6px;
	box-shadow: 0 12px 24px -12px var(--nv-p), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.nv-bubble p + p { margin-top: 6px; }
.nv-bubble ul,
.nv-bubble ol { padding-inline-start: 20px; margin: 4px 0; }
.nv-bubble li { margin: 2px 0; }
.nv-bubble a { color: var(--nv-p); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.nv-me .nv-bubble a { color: #fff; }
.nv-bubble code {
	font-family: ui-monospace, Menlo, Consolas, monospace;
	font-size: 12.5px;
	padding: 1px 6px;
	border-radius: 6px;
	background: color-mix(in srgb, var(--nv-p) 10%, transparent);
	direction: ltr;
	unicode-bidi: embed;
}
.nv-bubble pre {
	margin: 6px 0;
	padding: 10px 12px;
	border-radius: 12px;
	background: #14122a;
	color: #e9e7ff;
	overflow-x: auto;
	direction: ltr;
	text-align: left;
}
.nv-bubble pre code { background: none; padding: 0; color: inherit; }
.nv-bubble strong { font-weight: 800; }
.nv-bubble h4 { font-size: 14.5px; font-weight: 800; margin: 6px 0 2px; }
.nv-time { font-size: 10.5px; color: var(--nv-muted); margin: 3px 6px 0; line-height: 1.3; }
.nv-msg.nv-err .nv-bubble { background: color-mix(in srgb, #ff4d6d 10%, var(--nv-in)); box-shadow: inset 0 0 0 1px color-mix(in srgb, #ff4d6d 35%, transparent); }
.nv-retry { margin-top: 4px; font-size: 12px !important; font-weight: 700; color: #ff4d6d !important; }

.nv-system {
	display: flex;
	justify-content: center;
	margin: 6px 0 14px;
	animation: nv-in-msg .5s var(--nv-ease) both;
}
.nv-system span {
	max-width: 88%;
	padding: 7px 14px;
	border-radius: 14px;
	font-size: 12.5px;
	text-align: center;
	color: var(--nv-muted);
	background: color-mix(in srgb, var(--nv-surface) 70%, transparent);
	box-shadow: inset 0 0 0 1px var(--nv-line);
	white-space: pre-line;
}

/* typing */
.nv-typing .nv-bubble { padding: 14px 16px; display: flex; gap: 5px; align-items: center; }
.nv-typing i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #fff, var(--nv-p) 70%);
	animation: nv-typing 1.2s infinite var(--nv-ease-out);
}
.nv-typing i:nth-child(2) { animation-delay: .15s; background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--nv-p) 50%, var(--nv-s)) 70%); }
.nv-typing i:nth-child(3) { animation-delay: .3s; background: radial-gradient(circle at 35% 30%, #fff, var(--nv-s) 70%); }

.nv-cursor::after {
	content: '';
	display: inline-block;
	width: 7px;
	height: 15px;
	margin-inline-start: 2px;
	vertical-align: -2px;
	border-radius: 2px;
	background: linear-gradient(var(--nv-p), var(--nv-s));
	animation: nv-blink .8s steps(1) infinite;
}

/* operator info form */
.nv-form {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: color-mix(in srgb, var(--nv-surface-2) 70%, transparent);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s, visibility 0s .3s;
	perspective: 900px;
}
.nv-form.nv-show { opacity: 1; visibility: visible; transition: opacity .3s; }
.nv-form-card {
	width: 100%;
	padding: 22px;
	border-radius: 24px;
	background: var(--nv-surface);
	box-shadow: 0 24px 50px -20px rgba(30, 20, 90, .45), 0 0 0 1px var(--nv-line);
	transform: rotateX(25deg) translateY(30px) scale(.9);
	transition: transform .6s var(--nv-ease);
}
.nv-form.nv-show .nv-form-card { transform: none; }
.nv-form-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 4px; color: var(--nv-text); }
.nv-form-card p { font-size: 13px; color: var(--nv-muted); margin-bottom: 14px; }
.nv-field {
	display: block;
	width: 100% !important;
	height: 46px !important;
	padding: 0 14px !important;
	margin-bottom: 10px !important;
	border-radius: 14px !important;
	background: var(--nv-surface-2) !important;
	box-shadow: inset 0 0 0 1.5px var(--nv-line) !important;
	font-size: 14px !important;
	color: var(--nv-text) !important;
	transition: box-shadow .2s !important;
}
.nv-field:focus { box-shadow: inset 0 0 0 2px var(--nv-p) !important; }
.nv-field.nv-bad { box-shadow: inset 0 0 0 2px #ff4d6d !important; animation: nv-shake .4s; }
.nv-btn {
	position: relative;
	width: 100% !important;
	height: 48px !important;
	border-radius: 15px !important;
	color: #fff !important;
	font-weight: 800;
	font-size: 15px !important;
	background: linear-gradient(135deg, var(--nv-p), var(--nv-s)) !important;
	box-shadow: 0 5px 0 color-mix(in srgb, var(--nv-p) 60%, #000), 0 14px 24px -10px var(--nv-p) !important;
	transform: translateY(0);
	transition: transform .15s, box-shadow .15s !important;
}
.nv-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--nv-p) 60%, #000), 0 6px 12px -8px var(--nv-p) !important; }

/* ---------- composer ---------- */
.nv-composer {
	flex-shrink: 0;
	padding: 10px 12px 8px;
	background: var(--nv-surface);
	border-top: 1px solid var(--nv-line);
}
.nv-inputwrap {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 6px;
	padding-inline-start: 14px;
	border-radius: 20px;
	background: var(--nv-surface-2);
	box-shadow: inset 0 0 0 1.5px var(--nv-line);
	transition: box-shadow .25s, background .25s;
}
.nv-inputwrap:focus-within {
	background: var(--nv-surface);
	box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--nv-p) 60%, transparent), 0 8px 24px -12px var(--nv-p);
}
.nv-input {
	flex: 1;
	min-width: 0;
	width: 100% !important;
	height: 40px;
	max-height: 120px;
	padding: 8px 0 !important;
	resize: none;
	font-size: 14.5px !important;
	line-height: 1.6 !important;
	color: var(--nv-text) !important;
	overflow-y: auto;
}
.nv-input::placeholder { color: var(--nv-muted); opacity: .85; }
.nv-send {
	position: relative;
	width: 40px !important;
	height: 40px !important;
	border-radius: 14px !important;
	display: grid;
	place-items: center;
	color: #fff !important;
	background: linear-gradient(135deg, var(--nv-p), var(--nv-s)) !important;
	box-shadow: 0 3px 0 color-mix(in srgb, var(--nv-p) 55%, #000), 0 8px 16px -8px var(--nv-p) !important;
	transition: transform .2s var(--nv-ease), box-shadow .15s, opacity .2s, filter .2s !important;
	overflow: hidden;
}
.nv-send svg { width: 19px; height: 19px; transform: scaleX(-1); transition: transform .5s var(--nv-ease); }
.nv-send:hover:not(:disabled) { transform: translateY(-1px); }
.nv-send:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 color-mix(in srgb, var(--nv-p) 55%, #000) !important; }
.nv-send:disabled { filter: grayscale(.6); opacity: .5; cursor: not-allowed; }
.nv-send.nv-fly svg { animation: nv-fly .6s var(--nv-ease-out); }
.nv-foot {
	margin-top: 6px;
	text-align: center;
	font-size: 10.5px;
	color: var(--nv-muted);
	opacity: .8;
	line-height: 1.4;
}
.nv-foot b {
	font-weight: 800;
	background: linear-gradient(90deg, var(--nv-p), var(--nv-s));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* ================================================================
 * Mobile
 * ================================================================ */
@media (max-width: 520px) {
	.nv-stage {
		position: fixed;
		inset: 0;
		width: auto;
		height: 100%;
		height: 100dvh;
		bottom: 0;
		perspective: 1000px;
	}
	.nv-right .nv-stage,
	.nv-left .nv-stage { right: 0; left: 0; }
	.nv-window { border-radius: 0; transform-origin: 50% 100% !important; }
	.nv-window::before { display: none; }
	.nv-open .nv-launcher { opacity: 0; transform: scale(.5); pointer-events: none; }
	.nv-head { padding-top: max(16px, env(safe-area-inset-top)); }
	.nv-composer { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
	.nv-input { font-size: 16px !important; }
	.nv-close-mobile { display: grid !important; }
}
.nv-close-mobile { display: none !important; }
html.nv-lock, html.nv-lock body { overflow: hidden !important; }

/* reduced motion / no 3D */
@media (prefers-reduced-motion: reduce) {
	#nova-chat-root *,
	#nova-chat-root *::before,
	#nova-chat-root *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .15s !important; }
}
.nv-flat .nv-floor,
.nv-flat .nv-sphere,
.nv-flat .nv-orb-ring,
.nv-flat .nv-glare { display: none; }
.nv-flat .nv-coin-inner,
.nv-flat .nv-launcher { animation: none; }

/* ================================================================
 * Keyframes
 * ================================================================ */
@keyframes nv-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes nv-spin { to { transform: rotate(360deg); } }
@keyframes nv-ring { from { transform: rotateX(72deg) rotateZ(0); } to { transform: rotateX(72deg) rotateZ(360deg); } }
@keyframes nv-ring2 { from { transform: rotateY(70deg) rotateZ(0); } to { transform: rotateY(70deg) rotateZ(-360deg); } }
@keyframes nv-pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes nv-drift { 0%, 100% { margin-top: 0; } 50% { margin-top: 10px; } }
@keyframes nv-coin { 0%, 70% { transform: rotateY(0); } 80%, 92% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
@keyframes nv-online { 0% { box-shadow: 0 0 0 0 rgba(61, 245, 167, .7); } 70% { box-shadow: 0 0 0 7px rgba(61, 245, 167, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 245, 167, 0); } }
@keyframes nv-grid { from { background-position: 0 0; } to { background-position: 0 34px; } }
@keyframes nv-bob { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(6px, -14px, 0); } }
@keyframes nv-in-msg { from { opacity: 0; transform: perspective(600px) rotateX(-45deg) translateY(14px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes nv-in-card { from { opacity: 0; transform: perspective(700px) rotateX(35deg) translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes nv-typing { 0%, 60%, 100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-7px) scale(1.12); } }
@keyframes nv-blink { 50% { opacity: 0; } }
@keyframes nv-shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes nv-fly { 0% { transform: scaleX(-1) translate(0, 0); } 45% { transform: scaleX(-1) translate(28px, -28px); opacity: 0; } 46% { transform: scaleX(-1) translate(-28px, 28px); opacity: 0; } 100% { transform: scaleX(-1) translate(0, 0); opacity: 1; } }

.nv-head.nv-nomodes { padding-bottom: 40px; }
#nova-chat-root .nv-input:focus-visible,
#nova-chat-root .nv-field:focus-visible { outline: none; }
