.radnexus-assistant-root {
	font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--rn-primary: #1e3a5f;
	--rn-accent: #0ea5e9;
	--rn-header: #0f172a;
	--rn-header-text: #f8fafc;
	--rn-radius: 12px;
	--rn-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}

.radnexus-assistant-fab {
	position: fixed;
	right: 1.25rem;
	bottom: 1.25rem;
	z-index: 99998;
	min-width: 3.25rem;
	height: 3.25rem;
	padding: 0 0.65rem;
	border-radius: 999px;
	border: none;
	background: var(--rn-primary);
	color: #fff;
	cursor: pointer;
	box-shadow: var(--rn-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.radnexus-assistant-fab:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 44px rgba(15, 23, 42, 0.22);
}

.radnexus-assistant-root.rn-assistant-open .radnexus-assistant-fab {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.radnexus-assistant-fab img {
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	object-fit: cover;
}

.radnexus-assistant-fab__emoji {
	font-size: 1.35rem;
	line-height: 1;
}

.radnexus-assistant-fab__label {
	max-width: 6.5rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 0.8rem;
	font-weight: 600;
}

.radnexus-assistant-panel {
	position: fixed;
	right: 1.25rem;
	bottom: 5rem;
	z-index: 99999;
	width: min(22rem, calc(100vw - 2.5rem));
	max-height: min(32rem, 78vh);
	background: #fff;
	color: #0f172a;
	border-radius: var(--rn-radius);
	box-shadow: var(--rn-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid rgba(15, 23, 42, 0.08);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(8px) scale(0.98);
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.radnexus-assistant-panel.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.radnexus-assistant-panel header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	background: var(--rn-header);
	color: var(--rn-header-text);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.radnexus-assistant-panel .rn-header-main {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	min-width: 0;
}

.radnexus-assistant-panel .rn-logo {
	width: 2rem;
	height: 2rem;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
	background: rgba(255, 255, 255, 0.12);
}

.radnexus-assistant-panel .rn-titles {
	min-width: 0;
}

.radnexus-assistant-panel .rn-title {
	font-weight: 700;
	font-size: 0.95rem;
	line-height: 1.25;
}

.radnexus-assistant-panel .rn-subtitle {
	font-size: 0.75rem;
	opacity: 0.85;
	margin-top: 0.15rem;
	line-height: 1.35;
}

/* Theme-safe close control (avoid generic .rn-* clashes with block themes). */
.radnexus-assistant-root .radnexus-assistant-panel header button.radnexus-assistant-close {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	width: 2rem;
	height: 2rem;
	min-width: 2rem;
	min-height: 2rem;
	max-width: 2rem;
	max-height: 2rem;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.14);
	color: var(--rn-header-text);
	cursor: pointer;
	font-size: 1.35rem;
	font-weight: 300;
	line-height: 1;
	font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
	transition: background 0.15s ease, color 0.15s ease;
}

.radnexus-assistant-root .radnexus-assistant-panel header button.radnexus-assistant-close:hover {
	background: rgba(255, 255, 255, 0.24);
	color: #fff;
}

.radnexus-assistant-messages {
	flex: 1;
	overflow-y: auto;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	font-size: 0.9rem;
	line-height: 1.45;
	background: linear-gradient(180deg, #f8fafc 0%, #fff 40%);
}

.radnexus-assistant-msg {
	padding: 0.65rem 0.85rem;
	border-radius: calc(var(--rn-radius) - 4px);
	max-width: 100%;
	word-wrap: break-word;
	animation: rn-fade-in 0.25s ease;
}

@keyframes rn-fade-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.radnexus-assistant-msg.user {
	align-self: flex-end;
	background: var(--rn-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.radnexus-assistant-msg.bot {
	align-self: flex-start;
	background: #fff;
	color: #0f172a;
	border: 1px solid #e2e8f0;
	border-bottom-left-radius: 4px;
}

.radnexus-assistant-msg.bot a {
	color: var(--rn-accent);
	word-break: break-word;
	font-weight: 500;
}

.radnexus-assistant-msg.rn-typing {
	font-style: italic;
	color: #64748b;
	border-style: dashed;
}

.radnexus-assistant-form {
	display: flex;
	gap: 0.5rem;
	padding: 0.75rem;
	border-top: 1px solid #e2e8f0;
	background: #fff;
	align-items: stretch;
	min-width: 0;
}

.radnexus-assistant-form input[type='text'] {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	padding: 0.55rem 0.75rem;
	font-size: 0.9rem;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	background: #fff;
	color: #0f172a;
	pointer-events: auto;
}

.radnexus-assistant-form input[type='text']:disabled {
	opacity: 0.65;
	cursor: not-allowed;
	background: #f1f5f9;
}

.radnexus-assistant-form input[type='text']:focus {
	border-color: var(--rn-accent);
	box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.radnexus-assistant-root .radnexus-assistant-form button[type='submit'] {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	margin: 0;
	flex: 0 0 auto;
	white-space: nowrap;
	min-width: 0;
	border: none;
	border-radius: 10px;
	background: var(--rn-accent);
	color: #fff;
	padding: 0.55rem 1rem;
	min-height: 2.45rem;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.radnexus-assistant-root .radnexus-assistant-form button[type='submit']:hover:not(:disabled) {
	filter: brightness(1.05);
}

.radnexus-assistant-root .radnexus-assistant-form button[type='submit']:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.radnexus-assistant-sources {
	font-size: 0.75rem;
	color: #64748b;
	margin-top: 0.35rem;
	padding-top: 0.35rem;
	border-top: 1px solid #e2e8f0;
}

.radnexus-assistant-sources a {
	color: #475569;
}

.radnexus-assistant-brand {
	font-size: 0.7rem;
	color: #94a3b8;
	text-align: center;
	padding: 0.35rem 0.75rem 0.65rem;
	border-top: 1px solid #f1f5f9;
}

.radnexus-assistant-brand a {
	color: #64748b;
	text-decoration: none;
}

.radnexus-assistant-mount:empty {
	display: none;
}
