.sneha-chat-root {
	--sneha-text-body: var(--text-body, #111827);
	--sneha-text-primary: var(--text-primary, #374151);
	--sneha-surface: var(--bg-body, #ffffff);
	--sneha-surface-muted: var(--brand-linen, #fff1e6);
	--sneha-surface-soft: color-mix(in srgb, var(--bg-radio-group, #dfe7fd) 34%, var(--sneha-surface));
	--sneha-surface-own: color-mix(in srgb, var(--bg-radio-group, #dfe7fd) 62%, var(--sneha-surface));
	--sneha-accent: var(--brand-blue, #5b7aa3);
	--sneha-accent-soft: var(--bg-radio-group, #dfe7fd);
	--sneha-text-on-accent: var(--sneha-surface, #ffffff);
	--sneha-sidebar-surface: var(--surface-gray-2, #f3f4f6);
	--sneha-sidebar-item-surface: color-mix(in srgb, var(--sneha-surface) 96%, var(--sneha-sidebar-surface));
	--sneha-border: color-mix(in srgb, var(--sneha-accent) 18%, var(--sneha-surface));
	--sneha-border-strong: color-mix(in srgb, var(--sneha-accent) 34%, var(--sneha-surface));
	display: flex;
	align-items: stretch;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	height: min(42rem, calc(100dvh - 8rem));
	min-height: 420px;
	position: relative;
	overflow: hidden;
	background: var(--sneha-surface);
	border: 1px solid var(--sneha-border);
	border-radius: 0;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.sneha-chat-sidebar {
	width: 240px;
	max-width: 240px;
	min-width: 220px;
	flex: 0 0 240px;
	min-height: 0;
	border-right: 1px solid var(--sneha-border);
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.75rem;
	overflow-y: auto;
	overflow-x: hidden;
	background: var(--sneha-sidebar-surface);
}

.sneha-chat-sidebar-block {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.sneha-chat-section-title,
.sneha-chat-section-head {
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--sneha-text-primary);
	padding: 0 0.35rem;
}

.sneha-chat-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.sneha-chat-dm-add {
	width: 1.35rem;
	height: 1.35rem;
	line-height: 1;
	border: 1px solid var(--sneha-border);
	background: var(--sneha-surface);
	border-radius: 999px;
	font-size: 1rem;
	color: var(--sneha-accent);
}

.sneha-chat-dm-add:hover {
	background: var(--sneha-sidebar-item-surface);
}

.sneha-sidebar-item {
	width: 100%;
	border: 0;
	background: transparent;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	text-align: left;
	padding: 0.45rem 0.5rem;
	border-radius: 0.5rem;
	font-size: 0.9rem;
	color: var(--sneha-text-body);
	cursor: pointer;
	transition:
		background 0.16s ease,
		color 0.16s ease;
}

.sneha-sidebar-item:hover {
	background: var(--sneha-sidebar-item-surface);
}

.sneha-sidebar-item.is-active {
	background: var(--sneha-sidebar-item-surface);
	color: var(--sneha-text-body);
	font-weight: 600;
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sneha-text-primary) 8%, transparent);
}

.sneha-sidebar-item--dm {
	align-items: flex-start;
}

.sneha-sidebar-avatar {
	flex-shrink: 0;
	width: 1.9rem;
	height: 1.9rem;
	border-radius: 999px;
}

.sneha-sidebar-dm-content {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	width: 100%;
}

.sneha-sidebar-dm-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.35rem;
}

.sneha-sidebar-dm-name {
	font-size: 0.86rem;
	line-height: 1.1rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sneha-sidebar-dm-preview,
.sneha-chat-sidebar-empty {
	font-size: 0.74rem;
	line-height: 1rem;
	color: var(--sneha-text-primary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sneha-chat-sidebar-empty {
	font-size: 0.8rem;
	padding: 0.35rem 0.45rem;
}

.sneha-sidebar-unread-dot {
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 999px;
	background: var(--sneha-accent);
	flex-shrink: 0;
}

.sneha-chat-main {
	flex: 1 1 0%;
	display: flex;
	flex-direction: column;
	width: 0;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
	background: var(--sneha-surface);
}

.sneha-chat-header {
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--sneha-border);
	background: var(--sneha-surface);
}

.sneha-chat-header-info {
	min-width: 0;
}

.sneha-chat-header-title {
	font-size: 0.97rem;
	font-weight: 600;
	color: var(--sneha-text-body);
}

.sneha-chat-header-subtitle {
	font-size: 0.8rem;
	margin-top: 0.05rem;
	color: var(--sneha-text-primary);
}

.sneha-chat-refresh {
	position: absolute;
	top: 0.38rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 5;
	border: 1px solid var(--sneha-border);
	background: color-mix(in srgb, var(--sneha-surface) 92%, transparent);
	color: var(--sneha-text-body);
	border-radius: 999px;
	width: 2.15rem;
	height: 2.15rem;
	padding: 0;
	box-shadow: 0 5px 12px rgba(15, 23, 42, 0.08);
	display: inline-flex;
	justify-content: center;
	align-items: center;
	transition:
		transform 0.16s ease,
		box-shadow 0.16s ease,
		background 0.16s ease;
	backdrop-filter: blur(4px);
}

.sneha-chat-refresh:hover {
	background: var(--sneha-surface);
	transform: translateX(-50%) translateY(-1px);
	box-shadow: 0 7px 16px rgba(15, 23, 42, 0.11);
}

.sneha-chat-refresh:disabled {
	opacity: 0.68;
	cursor: wait;
}

.sneha-chat-refresh.is-live {
	background: color-mix(in srgb, var(--sneha-accent-soft) 72%, var(--sneha-surface));
	border-color: color-mix(in srgb, var(--sneha-accent) 28%, var(--sneha-surface));
	animation: sneha-chat-refresh-pulse 1s ease;
}

.sneha-chat-refresh-icon {
	display: block;
	flex-shrink: 0;
	width: 1.22rem;
	height: 1.22rem;
}

.sneha-chat-refresh.is-loading .sneha-chat-refresh-icon {
	animation: sneha-chat-refresh-spin 1.2s linear infinite;
}

.sneha-chat-messages-window {
	position: relative;
	flex: 1;
	min-height: 0;
	display: flex;
}

.sneha-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 2rem 1.05rem 0.9rem;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	background: var(--sneha-surface-soft);
}

.sneha-chat-state {
	margin: auto;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.86rem;
	color: var(--sneha-text-primary);
	padding: 0.5rem 0.85rem;
	background: var(--sneha-surface);
	border: 1px solid var(--sneha-border);
	border-radius: 999px;
}

.sneha-chat-state--error {
	color: var(--sneha-text-body);
	border-color: var(--sneha-border-strong);
	background: var(--sneha-surface);
}

.sneha-chat-spinner {
	width: 0.85rem;
	height: 0.85rem;
	border-radius: 999px;
	border: 2px solid color-mix(in srgb, var(--sneha-text-primary) 12%, var(--sneha-surface));
	border-top-color: var(--sneha-text-primary);
	animation: sneha-chat-spin 0.8s linear infinite;
}

@keyframes sneha-chat-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes sneha-chat-refresh-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes sneha-chat-refresh-pulse {
	0% {
		box-shadow: 0 0 0 0 color-mix(in srgb, var(--sneha-accent) 28%, transparent);
	}
	100% {
		box-shadow: 0 0 0 0.55rem color-mix(in srgb, var(--sneha-accent) 0%, transparent);
	}
}

.sneha-chat-date-sep {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0.75rem 0 0.45rem;
	color: var(--sneha-text-primary);
	font-size: 0.75rem;
}

.sneha-chat-date-sep:before,
.sneha-chat-date-sep:after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--sneha-border);
}

.sneha-chat-msg {
	display: flex;
	gap: 0.45rem;
	align-items: flex-end;
}

.sneha-chat-msg--own {
	justify-content: flex-end;
}

.sneha-chat-msg-body {
	display: flex;
	flex-direction: column;
	gap: 0.18rem;
	max-width: 72%;
	position: relative;
}

.sneha-chat-msg--own .sneha-chat-msg-body {
	align-items: flex-end;
}

.sneha-chat-bubble {
	background: var(--sneha-surface);
	padding: 0.58rem 0.68rem;
	border-radius: 1rem 1rem 1rem 0.25rem;
	font-size: 0.87rem;
	line-height: 1.36;
	color: var(--sneha-text-body);
	word-break: break-word;
	border: 1px solid var(--sneha-border);
	position: relative;
}

.sneha-chat-msg--own .sneha-chat-bubble {
	background: var(--sneha-surface-own);
	border-color: var(--sneha-border-strong);
	border-radius: 1rem 1rem 0.25rem;
	color: var(--sneha-text-body);
}

.sneha-chat-bubble--has-actions {
	padding-right: 2.25rem;
}

.sneha-chat-bubble-content p {
	margin: 0;
}

.sneha-chat-bubble-content p + p {
	margin-top: 0.35rem;
}

.sneha-chat-mention {
	display: inline-block;
	padding: 0.05rem 0.36rem;
	margin: 0 0.02rem;
	border-radius: 999px;
	font-weight: 600;
	color: color-mix(in srgb, var(--sneha-accent) 88%, #10213f);
	background: color-mix(in srgb, var(--sneha-surface) 88%, var(--sneha-accent-soft));
	border: 1px solid color-mix(in srgb, var(--sneha-accent) 14%, var(--sneha-surface));
}

.sneha-chat-msg--own .sneha-chat-mention {
	color: color-mix(in srgb, var(--sneha-accent) 90%, #0b1a33);
	background: color-mix(in srgb, var(--sneha-surface) 90%, var(--sneha-accent-soft));
	border-color: color-mix(in srgb, var(--sneha-accent) 16%, var(--sneha-surface));
}

.sneha-chat-mention.sneha-chat-mention--self {
	color: var(--sneha-text-on-accent);
	background: var(--brand-blue, #2563eb);
	border-color: color-mix(in srgb, var(--brand-blue, #2563eb) 82%, #0f234d);
}

.sneha-chat-inline-link {
	color: var(--sneha-accent);
	text-decoration: underline;
	text-underline-offset: 0.12rem;
	word-break: break-all;
}

.sneha-chat-msg--own .sneha-chat-inline-link {
	color: var(--sneha-accent);
	text-decoration-color: color-mix(in srgb, var(--sneha-accent) 48%, transparent);
}

.sneha-chat-meta {
	font-size: 0.72rem;
	color: var(--sneha-text-primary);
}

.sneha-chat-msg--own .sneha-chat-meta {
	color: var(--sneha-text-primary);
}

.sneha-chat-avatar {
	width: 1.95rem;
	height: 1.95rem;
	border-radius: 999px;
	object-fit: cover;
	border: 1px solid var(--sneha-border);
}

.sneha-chat-avatar--initials {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	border: none;
}
