/* --- Layout & Dimensions (Level 0) --- */
:root {
	--chat-shell-padding-mobile: var(--size-4-15);
	/* 60px/4.286rem */
	--chat-shell-padding-desktop: var(--size-4-8);
	/* 32px/2.286rem */
	--bubble-max-width: 85%;
	--bubble-img-max-height: 21.429rem;
	/* 300px */
	--bubble-blur: 8px;
}

.chat-view {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	max-height: 100%;
	overflow: hidden;
}

@media (min-width: 73.143rem) {
	.chat-view {
		/* Desktop: Height fixed within shell via flex stretching */
		height: 100%;
		flex: 1;
		min-height: 0;
	}
}

/* --- Message Debug Info (Admin only) --- */
.bubble-debug-info,
.chat-list-debug-info,
.chat-list-item-debug-info {
	display: none;
	font-family: var(--font-mono);
	font-size: var(--font-ui-smaller);
	color: var(--text-debug);
	border-bottom: 1px dashed var(--background-modifier-border);
	padding-bottom: var(--size-4-1);
	margin-bottom: var(--size-4-1);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.chat-list-debug-info {
	margin: 5px 10px;
	border-bottom: 1px solid var(--text-debug);
	width: fit-content;
}

body.ui-debug .bubble-debug-info,
body.ui-debug .chat-list-debug-info,
body.ui-debug .chat-list-item-debug-info {
	display: block;
}

/* --- Message Reply Block --- */
.bubble-reply {
	background: var(--background-modifier-hover);
	border-left: 3px solid var(--interactive-accent);
	border-radius: var(--radius-s);
	padding: var(--size-4-1) var(--size-4-2);
	margin-bottom: var(--size-4-2);
	font-size: var(--font-ui-smaller);
	color: var(--text-muted);
	cursor: pointer;
	transition: background var(--anim-fast);
	/* Схлопывание длинного текста до 2 строк */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bubble-reply:hover {
	background: var(--background-modifier-active);
}

.chat-bubble-row.is-own .bubble-reply {
	background: rgba(255, 255, 255, 0.12);
	border-left-color: rgba(255, 255, 255, 0.4);
	color: rgba(255, 255, 255, 0.85);
}

.reply-author {
	font-weight: var(--font-weight-bold);
	color: var(--interactive-accent);
	margin-bottom: 2px;
	display: block;
	font-size: 0.9em;
}

.chat-bubble-row.is-own .reply-author {
	color: inherit;
}

/* --- Messenger Header --- */
.chat-header {
	display: flex;
	align-items: center;
	gap: var(--size-4-3);
	padding: var(--size-4-2) 0;
	border-bottom: var(--divider-width) solid var(--divider-color);
	flex-shrink: 0;
	background: var(--background-primary);
}

.chat-header-avatar {
	width: var(--size-4-10);
	height: var(--size-4-10);
	border-radius: var(--radius-circle);
	background: var(--interactive-accent);
	color: var(--text-on-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: var(--font-weight-bold);
	font-size: var(--font-ui-large);
	flex-shrink: 0;
}

.chat-header-main {
	flex: 1;
	display: flex;
	align-items: center;
	gap: var(--size-4-6);
}

.chat-header-info {
	display: flex;
	flex-direction: column;
}

.chat-header-title {
	font-weight: var(--font-weight-semibold);
	font-size: var(--font-ui-large);
	color: var(--text-normal);
}

.chat-header-subtitle {
	font-size: var(--font-ui-medium);
	color: var(--text-muted);
}

.chat-header-tools {
	display: flex;
	flex-direction: column;
	gap: 2px;
	align-items: flex-start;
}

.chat-header-tools .input-wrapper {
	margin-bottom: 0;
	min-width: 11rem;
}

.chat-header-tools label {
	display: none;
	/* Compact header mode */
}

/* Custom Select adjustments for narrow header */
.chat-header-tools .ui-select-custom .select-trigger {
	padding: 0 var(--size-4-2);
	font-size: 11px;
	height: var(--size-4-6);
}

@media (max-width: 48rem) {
	.chat-header-tools {
		display: none;
		/* Hide tools on mobile handheld */
	}
}

/* --- Chat Feed (Scrollable Area) --- */
.chat-feed {
	flex: 1;
	overflow-y: auto;
	padding: var(--size-4-4) var(--size-4-5) var(--size-4-8) var(--size-4-5);
	display: flex;
	flex-direction: column;
	gap: var(--size-4-1);
}

.chat-feed-spacer {
	flex-grow: 1;
}

@media (max-width: 73.142rem) {

	.chat-header {
		display: none;
		/* Hide redundant header on mobile */
	}

	.chat-feed {
		/* Используем стандартные отступы, так как ввод теперь в потоке */
		padding-bottom: var(--size-4-4);
	}

	.chat-feed-spacer {
		display: none;
	}
}

/* --- Content Separators --- */
.chat-date-separator {
	text-align: center;
	padding: var(--size-4-2) 0;
	margin: var(--size-4-2) 0;
}

.chat-date-separator span {
	background: var(--background-secondary);
	color: var(--text-muted);
	font-size: var(--font-ui-small);
	font-weight: var(--font-weight-semibold);
	padding: var(--size-4-1) var(--size-4-3);
	border-radius: var(--bubble-radius);
}

.chat-unread-separator {
	display: flex;
	align-items: center;
	gap: var(--size-4-4);
	margin: var(--size-4-6) 0;
	color: var(--text-error);
	font-size: var(--font-ui-small);
	font-weight: var(--font-weight-semibold);
}

.chat-unread-separator::before,
.chat-unread-separator::after {
	content: "";
	flex: 1;
	height: var(--divider-width);
	background: currentColor;
	opacity: 0.2;
}

/* --- Message Bubble & Base Layout --- */
@keyframes failSafeShow {
	to { opacity: 1; visibility: visible; }
}

.chat-bubble-row {
	display: flex;
	align-items: flex-end;
	gap: var(--size-4-2);
	max-width: var(--bubble-max-width);
	animation: failSafeShow 0.1s forwards;
	animation-delay: 2s; /* failSafeShow сработает через 2 сек, если JS не успеет */
	
	/* Состояние до инициализации JS */
	opacity: 0;
	transition: opacity var(--anim-fast) ease-in;
}

.chat-bubble-row.is-own,
.chat-bubble-row.is-other {
	opacity: 1;
	animation: bubbleIn var(--anim-fast) ease forwards;
}

.chat-bubble-row.is-own {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.chat-bubble-row.is-other {
	align-self: flex-start;
}

.avatar-circle,
.chat-bubble-avatar {
	width: var(--size-4-7);
	height: var(--size-4-7);
	border-radius: var(--radius-circle);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: var(--font-weight-bold);
	font-size: var(--font-ui-smaller);
	flex-shrink: 0;
	color: var(--always-white);
	overflow: hidden;
}

.avatar-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.chat-bubble-row.is-own .chat-bubble-avatar {
	display: none;
	/* Hide own avatar in chat (standard UX) */
}

.chat-bubble {
	padding: var(--size-4-2) var(--size-4-3);
	border-radius: var(--bubble-radius);
	max-width: 100%;
	position: relative;
	line-height: var(--line-height-bubble);
	font-size: var(--font-size-message);
	word-wrap: break-word;
	box-shadow: 0 1px 2px var(--shadow-color-soft);
	transition: transform var(--anim-fast) ease;
}

.chat-bubble-row.is-own .chat-bubble {
	background-color: var(--bubble-bg-own);
	backdrop-filter: blur(var(--bubble-blur));
	-webkit-backdrop-filter: blur(var(--bubble-blur));
	color: var(--bubble-text-own);
	border: var(--bubble-border-own);
	border-left: var(--bubble-border-left);
	border-bottom-right-radius: var(--size-4-1);
}

.chat-bubble-row.is-other .chat-bubble {
	background: var(--bubble-bg-other);
	color: var(--bubble-text-other);
	border: var(--divider-width) solid var(--bubble-border-other);
	border-bottom-left-radius: var(--size-4-1);
}

.bubble-author {
	font-size: var(--font-ui-small);
	font-weight: var(--font-weight-bold);
	margin-bottom: var(--size-2-1);
}

.chat-bubble-row.is-own .bubble-author {
	display: none;
}

.bubble-text p {
	margin-bottom: var(--size-4-3);
	line-height: var(--line-height-normal);
}

.bubble-text p:last-child {
	margin-bottom: 0;
}

/* --- Message Content (Markdown blocks) --- */

/* Blockquotes */
.chat-bubble blockquote {
	margin: var(--size-4-2) 0;
	padding: var(--size-4-1) var(--size-4-4);
	font-size: var(--font-ui-medium);
	border-left: 3px solid var(--interactive-accent);
	background-color: color-mix(in srgb, var(--interactive-accent), transparent 90%);
	color: var(--text-muted);
	border-radius: 0 var(--radius-s) var(--radius-s) 0;
	font-style: normal;
}

.chat-bubble-row.is-own blockquote {
	border-left-color: var(--interactive-accent);
	background-color: color-mix(in srgb, var(--interactive-accent), transparent 85%);
	color: inherit;
	font-style: normal;
}

/* Inline Code & Blocks */
.chat-bubble code {
	background-color: transparent;
	padding: 0;
	border-radius: 0;
	font-family: var(--font-mono);
	font-size: 0.9em;
	white-space: pre-wrap;
	word-break: break-all;
	border: none;
}

.chat-bubble-row.is-own code {
	background-color: transparent;
	border: none;
	color: inherit;
}

.chat-bubble pre {
	background-color: color-mix(in srgb, var(--interactive-accent), transparent 90%);
	padding: var(--size-4-3);
	margin: var(--size-4-3) 0;
	border-radius: var(--radius-m);
	overflow-x: auto;
	font-family: var(--font-mono);
	font-size: 0.9em;
	line-height: 1.45;
	border: 1px solid color-mix(in srgb, var(--interactive-accent), transparent 90%);
	box-shadow: none;
}

.chat-bubble-row.is-own pre {
	background-color: color-mix(in srgb, var(--interactive-accent), transparent 85%);
	border-color: rgba(255, 255, 255, 0.1);
	color: inherit;
}

.chat-bubble pre code {
	background: transparent !important;
	background-color: transparent !important;
	border: none !important;
	padding: 0 !important;
	white-space: pre;
	word-break: normal;
	color: inherit;
	box-shadow: none !important;
}

/* Tags & Mentions (Context Overrides) */
:root .bubble-text .tag,
:root .bubble-text .mention {
	color: var(--interactive-accent);
	background-color: transparent;
	border: none;
	padding: 0;
	border-radius: 0;
	font-weight: var(--font-weight-medium);
	cursor: pointer;
}

:root .bubble-text .tag:hover,
:root .bubble-text .mention:hover {
	text-decoration: underline;
}

:root .is-own .bubble-text .tag,
:root .is-own .bubble-text .mention {
	color: var(--interactive-accent);
}

/* --- Attachments & Media --- */
.bubble-attachments {
	margin-top: var(--size-4-2);
	display: flex;
	flex-direction: column;
	gap: var(--size-4-1);
}

.att-image img {
	max-width: 100%;
	max-height: var(--bubble-img-max-height);
	border-radius: var(--size-4-1);
	cursor: pointer;
	transition: opacity var(--anim-fast);
	display: block;
}

.att-image img:hover {
	opacity: 0.9;
}

.att-file .att-link {
	display: flex;
	align-items: center;
	gap: var(--size-4-2);
	padding: var(--size-4-1) var(--size-4-2);
	background: var(--background-modifier-hover);
	border-radius: var(--radius-s);
	text-decoration: none;
	color: inherit;
	font-size: var(--font-ui-small);
}

.att-file .att-link:hover {
	background: var(--background-modifier-active);
}

/* --- Message Footer & Status --- */
.bubble-footer {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: var(--size-4-1);
	margin-top: var(--size-2-1);
}

.bubble-time {
	font-size: var(--font-ui-smaller);
	opacity: 0.65;
}

.bubble-edited {
	font-size: var(--font-ui-smaller);
	font-style: italic;
	opacity: 0.5;
}

.bubble-status {
	display: flex;
	align-items: center;
	margin-left: var(--size-2-1);
	opacity: 0.6;
}

.chat-bubble-row.is-own .bubble-status {
	opacity: 0.8;
}

.chat-bubble-row.is-other .bubble-status {
	display: none;
}

.bubble-status .btn-icon {
	width: var(--size-4-3-5);
	height: var(--size-4-3-5);
	stroke-width: 2.5px;
}

/* --- Reactions block --- */
.bubble-reactions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--size-4-1);
	margin-top: var(--size-4-1);
	user-select: none;
	transition: all var(--anim-fast) cubic-bezier(0.4, 0, 0.2, 1);
}

.reaction-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--size-2-1);
	background: var(--background-modifier-hover);
	border: 1px solid transparent;
	border-radius: var(--radius-pill);
	padding: var(--size-2-1) var(--size-4-2);
	font-size: var(--font-ui-small);
	cursor: pointer;
	transition:
		background-color var(--anim-fast) ease,
		border-color var(--anim-fast) ease,
		color var(--anim-fast) ease,
		transform var(--anim-fast) cubic-bezier(0.4, 0, 0.2, 1),
		opacity var(--anim-fast) ease;
}

.reaction-badge:hover {
	background-color: color-mix(in srgb, var(--interactive-accent), transparent 85%);
	border-color: color-mix(in srgb, var(--interactive-accent), transparent 60%);
}

.reaction-badge.has-my-like:hover {
	background-color: color-mix(in srgb, var(--interactive-accent), transparent 70%);
}

.reaction-badge:active {
	opacity: 0.7;
}

.reaction-badge.has-my-like {
	background-color: color-mix(in srgb, var(--interactive-accent), transparent 85%);
	border-color: color-mix(in srgb, var(--interactive-accent), transparent 40%);
	color: var(--interactive-accent);
}

.reaction-badge [data-lucide],
.reaction-badge img {
	width: var(--font-ui-medium) !important;
	/* important разрешен здесь, это важно для иконок реакций */
	height: var(--font-ui-medium) !important;
	/* important разрешен здесь, это важно для иконок реакций */
	display: block;
}

.reaction-count {
	font-weight: var(--font-weight-normal);
	font-size: var(--font-ui-smaller);
	margin-top: 1px;
}



/* --- Avatar & Author Color Palette --- */
.avatar-color-1 {
	background: var(--color-identity-1);
}

.avatar-color-2 {
	background: var(--color-identity-2);
}

.avatar-color-3 {
	background: var(--color-identity-3);
}

.avatar-color-4 {
	background: var(--color-identity-4);
}

.avatar-color-5 {
	background: var(--color-identity-5);
}

.avatar-color-6 {
	background: var(--color-identity-6);
}

.author-color-1 {
	color: var(--color-identity-1);
}

.author-color-2 {
	color: var(--color-identity-2);
}

.author-color-3 {
	color: var(--color-identity-3);
}

.author-color-4 {
	color: var(--color-identity-4);
}

.author-color-5 {
	color: var(--color-identity-5);
}

.author-color-6 {
	color: var(--color-identity-6);
}

/* --- Chat Input Area (Toolbar + Bar) --- */
.main-content-area .chat-input-area {
	position: sticky;
	bottom: 0;
	background-color: var(--chat-input-bg);
	margin: 0;
	padding: var(--chat-input-padding-y) var(--chat-input-padding-x) calc(env(safe-area-inset-bottom, 0px) + var(--chat-input-padding-y)) var(--chat-input-padding-x);
	border-top: var(--divider-width) solid var(--divider-color);
	display: flex;
	flex-direction: column;
	z-index: 1000;
}

@media (max-width: 73.142rem) {
	.main-content-area .chat-input-area {
		/* Переход в поток Flexbox: убираем fixed */
		position: relative; 
		bottom: auto;
		left: auto;
		right: auto;
		margin: 0;
		padding: var(--chat-input-padding-y) var(--size-4-5) calc(env(safe-area-inset-bottom, 0px) + var(--chat-input-padding-y)) var(--size-4-5);
		box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
		z-index: 1000;
	}
}

.formatting-toolbar {
	margin-top: 1rem;
	margin-bottom: 0px;
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.formatting-toolbar .toolbar-btn {
	background: transparent;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 0.5rem 0.75rem;
	border-radius: var(--radius-s);
	transition: all var(--anim-fast);
}

.formatting-toolbar .toolbar-btn:hover {
	background: var(--background-modifier-hover);
	color: var(--text-normal);
}

.formatting-toolbar .toolbar-btn.active {
	background: var(--background-modifier-active);
	color: var(--interactive-accent);
}

.formatting-toolbar .toolbar-btn .btn-icon {
	width: 1.25rem;
	height: 1.25rem;
}

/* --- Folder Management Form --- */
.folder-form-card {
	max-width: 28.571rem;
	/* 400px */
	margin: var(--size-4-8) auto;
	padding: var(--size-4-5);
	background: var(--background-secondary);
	border-radius: var(--radius-m);
	border: var(--divider-width) solid var(--divider-color);
	box-shadow: var(--shadow-m);
}

.folder-form-header {
	margin-top: 0;
	margin-bottom: var(--size-4-5);
	display: flex;
	align-items: center;
	gap: var(--size-4-2);
	color: var(--text-normal);
}

.folder-form-body {
	display: flex;
	flex-direction: column;
	gap: var(--size-4-4);
}

.folder-form-icons-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: var(--size-4-1);
}

.file-counter {
	font-size: var(--font-ui-smaller);
	color: var(--interactive-accent);
	font-weight: var(--font-weight-bold);
	background: var(--background-secondary);
	padding: var(--size-2-1) var(--size-4-2);
	border-radius: var(--radius-m);
}

.chat-input-bar {
	display: flex;
	align-items: flex-end;
	gap: var(--size-4-2);
	padding: var(--size-4-1) 0 var(--size-4-2) 0;
	flex-shrink: 0;
}

.chat-input-bar textarea {
	flex: 1;
	resize: none;
	border: var(--divider-width) solid var(--divider-color);
	border-radius: var(--bubble-radius);
	padding: var(--size-4-3) var(--size-4-4);
	font-size: var(--font-size-input);
	background: var(--background-secondary);
	color: var(--text-normal);
	outline: none;
	max-height: 8rem;
	min-height: var(--size-4-9);
	line-height: 1.4;
	transition: border-color var(--anim-fast) ease;
	overflow-y: auto;
}

.chat-input-bar textarea:focus {
	border-color: var(--interactive-accent);
}

.chat-input-bar textarea::placeholder {
	color: var(--text-muted);
}

/* --- Chat List (Sidebar Panel) --- */
.chat-list-container {
	display: flex;
	flex-direction: column;
	height: 100%;
}

#chat-list,
#mobile-chat-list-content {
	flex: 1;
	overflow-y: auto;
}

.chat-list-item {
	display: flex;
	align-items: center;
	gap: var(--size-4-2);
	padding: var(--size-4-2) var(--size-4-3);
	cursor: pointer;
	border-bottom: var(--divider-width) solid var(--divider-color);
	transition: background var(--anim-fast);
}

.chat-list-item:hover {
	background: var(--background-modifier-hover);
}

.chat-list-item:hover .chat-list-name {
	color: var(--interactive-accent);
}

.chat-list-item.active {
	background: var(--background-modifier-active);
}

.chat-list-avatar {
	width: var(--size-4-9);
	height: var(--size-4-9);
	border-radius: var(--radius-circle);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: var(--font-weight-bold);
	font-size: var(--font-ui-medium);
	color: var(--always-white);
	flex-shrink: 0;
}

.chat-list-body {
	flex: 1;
	min-width: 0;
}

.chat-list-top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--size-4-1);
}

.chat-list-name {
	font-weight: var(--font-weight-semibold);
	font-size: var(--font-ui-medium);
	color: var(--text-normal);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.chat-list-time {
	font-size: var(--font-ui-smaller);
	color: var(--text-muted);
	flex-shrink: 0;
}

.chat-list-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--size-4-1);
	margin-top: var(--size-2-1);
}

.chat-list-preview {
	font-size: var(--font-ui-small);
	color: var(--text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1;
}

.chat-list-author {
	color: var(--interactive-accent);
	font-weight: var(--font-weight-medium);
	margin-right: var(--size-4-1);
}

.chat-item-pin-icon .btn-icon {
	width: var(--icon-s);
	height: var(--icon-s);
	opacity: 0.5;
}

:root .hidden-input {
	display: none;
}

.chat-list-unread {
	min-width: var(--size-4-4);
	height: var(--size-4-4);
	border-radius: var(--radius-pill);
	background: var(--background-secondary-alt);
	color: var(--text-normal);
	font-size: var(--font-ui-smaller);
	font-weight: var(--font-weight-medium);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	padding: 0 var(--size-2-1);
}

.chat-list-title-row {
	display: flex;
	align-items: center;
	gap: var(--size-4-2);
	min-width: 0;
}

.chat-item-folder-trigger {
	background: transparent;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: var(--size-2-1);
	border-radius: var(--radius-s);
	transition: all var(--anim-fast);
	opacity: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.chat-list-item:hover .chat-item-folder-trigger {
	opacity: 1;
}

.chat-item-folder-trigger:hover {
	background: var(--background-modifier-hover);
	color: var(--interactive-accent);
}

.chat-item-folder-trigger .btn-icon {
	width: var(--size-4-3-5);
	height: var(--size-4-3-5);
}

/* --- Animations & Loaders --- */
@keyframes bubbleIn {
	from {
		opacity: 0;
		transform: translateY(var(--bubble-offset));
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Анимация летучего (исчезающего) сообщения (Stage 1) */
@keyframes bubbleOut {
	0% {
		opacity: 1;
		transform: scale(1) translateY(0);
		max-height: 500px;
		margin-bottom: var(--size-4-1);
	}

	40% {
		opacity: 0;
		transform: scale(0.96) translateY(calc(-1 * var(--size-4-1)));
	}

	100% {
		opacity: 0;
		max-height: 0;
		margin-bottom: 0;
		padding-top: 0;
		padding-bottom: 0;
		transform: scale(0.9) translateY(calc(-1 * var(--size-4-2)));
	}
}

:root .chat-bubble-row.is-exiting {
	animation: bubbleOut 0.25s ease-in forwards;
	pointer-events: none;
	overflow: hidden;
}

.htmx-indicator {
	display: none;
	opacity: 0;
	transition: opacity var(--anim-fast) ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
	display: flex;
	opacity: 1;
}

.messenger-loader {
	position: absolute;
	top: var(--size-4-16);
	left: 50%;
	transform: translateX(-50%);
	z-index: var(--z-header);
	background: var(--background-secondary-alt);
	backdrop-filter: blur(var(--bubble-blur));
	-webkit-backdrop-filter: blur(var(--bubble-blur));
	color: var(--interactive-accent);
	padding: var(--size-4-2) var(--size-4-4);
	border-radius: var(--radius-pill);
	border: var(--divider-width) solid var(--interactive-accent);
	box-shadow: var(--shadow-s);
	font-size: var(--font-ui-small);
	font-weight: var(--font-weight-semibold);
	pointer-events: none;
	animation: loaderPulse 2s infinite ease-in-out;
}

@keyframes loaderPulse {
	0% {
		opacity: 0.8;
		transform: translateX(-50%) scale(1);
	}

	50% {
		opacity: 1;
		transform: translateX(-50%) scale(1.02);
	}

	100% {
		opacity: 0.8;
		transform: translateX(-50%) scale(1);
	}
}

.loader-content {
	display: flex;
	align-items: center;
	gap: var(--size-4-2);
}

/* --- Pagination (Load More) --- */
#load-more-area {
	width: 100%;
}

.btn-load-more {
	background: transparent;
	border: none;
	border-radius: 0;
	padding: var(--size-2-1) var(--size-4-3);
	color: var(--text-muted);
	font-size: var(--font-ui-small);
	font-weight: var(--font-weight-medium);
	cursor: pointer;
	transition: all var(--anim-fast);
}

.btn-load-more:hover {
	background: var(--background-modifier-hover);
}

.btn-load-more:active {
	transform: scale(0.98);
}

/* --- Reaction Picker (Unified with Context Menu) --- */
.ui-context-menu.is-reaction-grid {
	padding: var(--size-4-2);
	min-width: 15rem;
	/* ~210px */
}

.ui-context-menu.is-reaction-grid .picker-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: var(--size-4-1);
	padding: 2px;
}

.ui-context-menu.is-reaction-grid .picker-item {
	width: var(--size-4-10);
	height: var(--size-4-10);
	border-radius: var(--radius-m);
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	transition: background var(--anim-fast);
	color: var(--text-normal);
}

.ui-context-menu.is-reaction-grid .picker-item:hover {
	background: var(--background-modifier-hover);
}

.ui-context-menu.is-reaction-grid .picker-item i,
.ui-context-menu.is-reaction-grid .picker-item img {
	width: var(--size-4-6);
	height: var(--size-4-6);
	height: var(--size-4-4);
	display: block;
}