/**
 * Messages redesign — inbox + conversation
 * Loaded after master.styles.css on chat & conversation pages.
 */

[v-cloak] {
	display: none !important;
}

/* ── Shared tokens ── */
body.cl-app-chat,
body.cl-app-conversation {
	--cl-msg-radius: 16px;
	--cl-msg-radius-sm: 12px;
	--cl-msg-avatar: 52px;
	--cl-msg-avatar-sm: 40px;
	--cl-msg-bubble-max: 72%;
	--cl-msg-safe-bottom: env(safe-area-inset-bottom, 0px);
	--cl-msg-accent: var(--cl-primary-color);
	--cl-msg-surface: var(--cl-secondary-bg-color);
	--cl-msg-hover: var(--cl-event-hover-bg);
}

/* ══════════════════════════════════════
   INBOX (/chats)
   ══════════════════════════════════════ */

body.cl-app-chat div[data-app="chat"] {
	display: flex;
	flex-direction: column;
	min-height: calc(100dvh - 60px);
}

body.cl-app-chat .cl-msg-inbox {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

body.cl-app-chat .cl-msg-inbox__hero {
	padding: 16px 16px 4px;
}

body.cl-app-chat .cl-msg-inbox__title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--cl-primary-text-color);
	letter-spacing: -0.02em;
}

body.cl-app-chat .cl-msg-inbox__subtitle {
	margin: 4px 0 0;
	font-size: 13px;
	color: var(--cl-secondary-text-color);
	font-weight: 400;
}

body.cl-app-chat .cl-msg-inbox__toolbar {
	position: sticky;
	top: 60px;
	z-index: 600;
	background: var(--cl-primary-bg-color);
	border-bottom: 1px solid var(--cl-primary-border-color);
	padding: 10px 12px 12px;
}

body.cl-app-chat .cl-msg-inbox__search {
	margin-bottom: 10px;
}

body.cl-app-chat .cl-msg-inbox__search .keyword-input input {
	height: 44px;
	border-radius: 22px;
	padding-left: 44px;
	padding-right: 44px;
	background: var(--cl-msg-surface);
	border: 1px solid transparent;
	font-size: 15px;
	transition: border-color 0.15s, background 0.15s;
}

body.cl-app-chat .cl-msg-inbox__search .keyword-input input:focus {
	background: var(--cl-primary-bg-color);
	border-color: var(--cl-primary-color);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--cl-primary-color) 18%, transparent);
}

body.cl-app-chat .cl-msg-inbox__tabs {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

body.cl-app-chat .cl-msg-inbox__tabs::-webkit-scrollbar {
	display: none;
}

body.cl-app-chat .cl-msg-inbox__tab {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border: 1px solid var(--cl-primary-border-color);
	border-radius: 999px;
	background: transparent;
	color: var(--cl-secondary-text-color);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	line-height: 1;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
	min-height: 36px;
}

body.cl-app-chat .cl-msg-inbox__tab:hover {
	background: var(--cl-msg-hover);
	color: var(--cl-primary-text-color);
}

body.cl-app-chat .cl-msg-inbox__tab.is-active {
	background: var(--cl-msg-accent);
	border-color: var(--cl-msg-accent);
	color: #fff;
}

body.cl-app-chat .cl-msg-inbox__tab-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	background: color-mix(in srgb, #fff 25%, transparent);
}

body.cl-app-chat .cl-msg-inbox__tab:not(.is-active) .cl-msg-inbox__tab-badge {
	background: var(--cl-danger-color);
	color: #fff;
}

body.cl-app-chat .cl-msg-inbox__list {
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item {
	padding: 0;
	border-bottom: none;
	margin: 0 8px 4px;
	border-radius: var(--cl-msg-radius-sm);
	transition: background 0.15s, transform 0.1s;
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item:active {
	transform: scale(0.985);
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item:hover,
body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item:focus-within {
	background: var(--cl-msg-hover);
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item.is-unread {
	background: color-mix(in srgb, var(--cl-primary-color) 6%, var(--cl-primary-bg-color));
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item.is-unread:hover {
	background: color-mix(in srgb, var(--cl-primary-color) 10%, var(--cl-primary-bg-color));
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item a div.contact-data {
	padding: 12px 10px;
	align-items: center;
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item a div.contact-data div.contact-data__avatar {
	width: var(--cl-msg-avatar);
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item a div.contact-data div.contact-data__avatar div.user-avatar img,
body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item a div.contact-data div.contact-data__avatar div.user-avatar .cl-avatar-framed__photo img {
	width: var(--cl-msg-avatar);
	height: var(--cl-msg-avatar);
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item a div.contact-data div.contact-data__body {
	padding-left: 14px;
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item a div.contact-data div.contact-data__body div.contact-data__body-topline div.flex-item-left span {
	font-size: 15px;
	font-weight: 600;
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item.is-unread a div.contact-data div.contact-data__body div.contact-data__body-topline div.flex-item-left span {
	font-weight: 700;
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item a div.contact-data div.contact-data__body div.contact-data__body-topline div.flex-item-right {
	font-size: 12px;
	font-weight: 500;
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item a div.contact-data div.contact-data__body div.contact-data__body-midline div.last-message {
	font-size: 14px;
	-webkit-line-clamp: 2;
	line-height: 1.35;
}

body.cl-app-chat div.chats div.chat-contacts div.contacts-list__item a div.contact-data div.contact-data__body div.contact-data__body-midline div.new-message span.badge {
	min-width: 22px;
	min-height: 22px;
	line-height: 22px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	padding: 0 6px;
	background: var(--cl-msg-accent);
}

body.cl-app-chat .cl-msg-inbox__empty-filter {
	padding: 48px 24px;
	text-align: center;
}

body.cl-app-chat .cl-msg-inbox__empty-filter .icon__bg svg {
	width: 48px;
	height: 48px;
	opacity: 0.5;
}

body.cl-app-chat .timeline-placeholder {
	padding: 48px 24px;
}

body.cl-app-chat .timeline-placeholder .icon__bg {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: var(--cl-msg-surface);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 16px;
}

body.cl-app-chat .timeline-placeholder .pl-message h4 {
	font-size: 18px;
	font-weight: 700;
}

/* Hide center logo on mobile inbox — title is in hero */
@media (max-width: 991.98px) {
	body.cl-app-chat div[data-app="chat"] div.timeline-header div.timeline-header__botline div.cp {
		display: none;
	}

	body.cl-app-chat div[data-app="chat"] div.timeline-header div.timeline-header__botline div.lp div.nav-link-holder a {
		font-size: 0;
		width: 0;
		overflow: hidden;
	}

	body.cl-app-chat div[data-app="chat"] div.timeline-header div.timeline-header__botline div.lp {
		max-width: 40px;
	}
}

/* ══════════════════════════════════════
   CONVERSATION (/conversation/{user})
   ══════════════════════════════════════ */

body.cl-app-conversation div[data-app="conversation"] {
	display: flex;
	flex-direction: column;
	height: 100dvh;
	max-height: 100dvh;
}

body.cl-app-conversation div.conversation {
	height: calc(100dvh - 60px);
	max-height: calc(100dvh - 60px);
}

body.cl-app-conversation div.conversation div.conversation__body {
	position: relative;
	min-height: 0;
}

body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages {
	padding: 12px 12px 8px;
	scroll-behavior: smooth;
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--cl-msg-surface) 40%, transparent) 0%, transparent 120px),
		var(--cl-primary-bg-color);
}

body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item {
	margin-bottom: 6px;
}

body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item div.message-data div.message-data__body {
	max-width: var(--cl-msg-bubble-max);
}

@media (max-width: 767.98px) {
	body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item div.message-data div.message-data__body {
		max-width: 85%;
	}
}

body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item div.message-data div.message-data__body div.message-text {
	padding: 10px 14px;
	font-size: 15px;
	line-height: 1.45;
	border-radius: 18px;
	word-break: break-word;
}

body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item.left div.message-data div.message-data__body div.message-text {
	border-bottom-left-radius: 4px;
}

body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item.right div.message-data div.message-data__body div.message-text {
	border-bottom-right-radius: 4px;
}

body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item div.message-time {
	font-size: 11px;
	opacity: 0.7;
	margin-top: 2px;
	padding: 0 4px;
}

body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item.right div.message-time {
	padding-right: 8px;
}

body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item.left div.message-time {
	padding-left: 8px;
}

/* Message actions — always visible on touch devices */
@media (hover: none), (max-width: 767.98px) {
	body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item div.message-data div.message-data__ctrls {
		visibility: visible;
		opacity: 0.85;
	}

	body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item div.message-data div.message-data__ctrls button.dropdown div.dropdown-toggle {
		width: 32px;
		height: 32px;
	}

	body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item div.message-data div.message-data__ctrls button.dropdown div.dropdown-toggle svg {
		width: 20px;
		height: 20px;
	}
}

/* Media bubbles */
body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item div.message-data div.message-data__body div.message-media a.image-wrapper,
body.cl-app-conversation div.conversation div.conversation__body div.conversation-messages div.conversation-messages__item div.message-data div.message-data__body div.message-media div.cl-plyr-video {
	border-radius: var(--cl-msg-radius-sm);
	border-width: 2px;
	overflow: hidden;
}

/* Composer */
body.cl-app-conversation div.conversation div.conversation__footer {
	flex-shrink: 0;
	background: var(--cl-primary-bg-color);
	border-top: 1px solid var(--cl-primary-border-color);
	padding-bottom: var(--cl-msg-safe-bottom);
}

body.cl-app-conversation div.conversation div.conversation__footer form.form {
	padding: 10px 12px calc(10px + var(--cl-msg-safe-bottom));
	border-top: none;
}

body.cl-app-conversation div.conversation div.conversation__footer form.form div.message-input {
	align-items: flex-end;
	gap: 4px;
	background: var(--cl-msg-surface);
	border-radius: 24px;
	padding: 4px 6px 4px 4px;
	border: 1px solid var(--cl-primary-border-color);
}

body.cl-app-conversation div.conversation div.conversation__footer form.form div.message-input div.message-input-cont {
	margin: 0 4px 0 0;
}

body.cl-app-conversation div.conversation div.conversation__footer form.form div.message-input div.message-input__field textarea {
	border: none;
	background: transparent;
	border-radius: 20px;
	padding: 10px 40px 10px 12px;
	height: 44px;
	min-height: 44px;
	font-size: 15px;
}

body.cl-app-conversation div.conversation div.conversation__footer form.form div.message-input div.message-input__field textarea:focus {
	border: none;
	box-shadow: none;
	background: transparent;
}

body.cl-app-conversation div.conversation div.conversation__footer form.form div.message-input button.message-input__ctrl {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex-shrink: 0;
}

body.cl-app-conversation div.conversation div.conversation__footer form.form div.message-input button.message-input__ctrl[data-an="submit-btn"]:not(:disabled) {
	background: var(--cl-msg-accent);
}

body.cl-app-conversation div.conversation div.conversation__footer form.form div.message-input button.message-input__ctrl[data-an="submit-btn"]:not(:disabled) svg path {
	fill: #fff;
}

body.cl-app-conversation div.conversation div.conversation__footer form.form div.message-input button.message-input__ctrl[data-an="submit-btn"]:not(:disabled):hover {
	filter: brightness(1.08);
}

body.cl-app-conversation div.conversation div.conversation__footer form.form div.message-input div.message-audio-recstat {
	margin: 0 4px;
	border-radius: 22px;
}

/* Scroll-to-bottom FAB */
body.cl-app-conversation .cl-msg-scroll-fab {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 100;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--cl-primary-border-color);
	background: var(--cl-primary-bg-color);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px) scale(0.9);
	transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

body.cl-app-conversation .cl-msg-scroll-fab.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

body.cl-app-conversation .cl-msg-scroll-fab svg {
	width: 22px;
	height: 22px;
}

body.cl-app-conversation .cl-msg-scroll-fab svg path {
	fill: var(--cl-primary-text-color);
}

body.cl-app-conversation .cl-msg-scroll-fab__badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--cl-msg-accent);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

/* Loading older messages */
body.cl-app-conversation .cl-msg-load-more {
	text-align: center;
	padding: 8px;
	font-size: 12px;
	color: var(--cl-secondary-text-color);
}

body.cl-app-conversation .cl-msg-load-more.is-loading span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* Conversation header — mobile back + status */
body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.cl-msg-back {
	display: none;
}

@media (max-width: 991.98px) {
	body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.cp {
		display: none;
	}

	body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.cl-msg-back {
		display: flex;
		align-items: center;
		margin-right: 4px;
		flex-shrink: 0;
	}

	body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.cl-msg-back button {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		border: none;
		background: transparent;
		border-radius: 50%;
		cursor: pointer;
		padding: 0;
	}

	body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.cl-msg-back button:active {
		background: var(--cl-msg-hover);
	}

	body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.cl-msg-back button svg {
		width: 22px;
		height: 22px;
	}

	body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.lp.lp__avatar {
		max-width: calc(100% - 100px);
	}

	body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.lp.lp__avatar div.nav-link-avatar {
		width: var(--cl-msg-avatar-sm);
		margin-right: 10px;
	}

	body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.lp.lp__avatar div.nav-link-avatar a .cl-avatar-framed__photo img,
	body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.lp.lp__avatar div.nav-link-avatar a img {
		width: var(--cl-msg-avatar-sm);
		height: var(--cl-msg-avatar-sm);
	}
}

body.cl-app-conversation .cl-msg-header-status {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: var(--cl-secondary-text-color);
	line-height: 1.2;
	margin-top: 1px;
}

body.cl-app-conversation .cl-msg-header-status.is-online {
	color: var(--cl-success-color);
	font-weight: 500;
}

body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.lp.lp__avatar {
	display: inline-flex;
	align-items: center;
	flex-wrap: nowrap;
	min-width: 0;
}

body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.lp.lp__avatar div.nav-link-holder a {
	display: block;
	overflow: hidden;
}

body.cl-app-conversation div[data-app="conversation"] div.timeline-header div.timeline-header__botline div.lp.lp__avatar div.nav-link-holder .user-name-holder__name {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

body.cl-app-conversation .cl-msg-load-more.is-loading span svg {
	width: 14px;
	height: 14px;
	vertical-align: middle;
	animation: cl-msg-spin 0.8s linear infinite;
}

@keyframes cl-msg-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* Date separator */
body.cl-app-conversation .cl-msg-date-sep {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 16px 0 12px;
}

body.cl-app-conversation .cl-msg-date-sep span {
	display: inline-block;
	padding: 4px 14px;
	border-radius: 999px;
	background: var(--cl-msg-surface);
	color: var(--cl-secondary-text-color);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

/* Reply quote in bubble */
body.cl-app-conversation .cl-msg-reply-quote {
	display: flex;
	align-items: stretch;
	gap: 8px;
	margin-bottom: 6px;
	padding: 6px 8px;
	border-radius: 10px;
	background: color-mix(in srgb, var(--cl-primary-text-color) 6%, transparent);
	font-size: 12px;
	line-height: 1.35;
}

body.cl-app-conversation .cl-msg-reply-quote__bar {
	width: 3px;
	border-radius: 3px;
	background: var(--cl-msg-accent);
	flex-shrink: 0;
}

body.cl-app-conversation .cl-msg-reply-quote__text {
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	color: var(--cl-secondary-text-color);
}

/* Composer reply preview */
body.cl-app-conversation .cl-msg-reply-preview {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	margin: 0 12px 6px;
	border-radius: 12px;
	background: var(--cl-msg-surface);
	border-left: 3px solid var(--cl-msg-accent);
}

body.cl-app-conversation .cl-msg-reply-preview__body {
	flex: 1;
	min-width: 0;
	font-size: 13px;
}

body.cl-app-conversation .cl-msg-reply-preview__body strong {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--cl-secondary-text-color);
}

body.cl-app-conversation .cl-msg-reply-preview__body span {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

body.cl-app-conversation .cl-msg-reply-preview__close {
	border: none;
	background: transparent;
	padding: 6px;
	cursor: pointer;
	border-radius: 50%;
}

/* Typing indicator */
body.cl-app-conversation .cl-msg-typing-indicator {
	padding: 4px 16px 0;
	font-size: 12px;
	color: var(--cl-secondary-text-color);
	display: flex;
	align-items: center;
	gap: 6px;
}

body.cl-app-conversation .cl-msg-typing-indicator__dots {
	display: inline-flex;
	gap: 3px;
}

body.cl-app-conversation .cl-msg-typing-indicator__dots i {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--cl-msg-accent);
	display: block;
	animation: cl-msg-typing-bounce 1.2s infinite ease-in-out;
}

body.cl-app-conversation .cl-msg-typing-indicator__dots i:nth-child(2) { animation-delay: 0.15s; }
body.cl-app-conversation .cl-msg-typing-indicator__dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes cl-msg-typing-bounce {
	0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
	40% { transform: translateY(-4px); opacity: 1; }
}

body.cl-app-conversation .cl-msg-header-status.is-typing {
	color: var(--cl-msg-accent);
}

/* Emoji panel */
body.cl-app-conversation .cl-msg-emoji-panel {
	margin: 8px 0 0;
	padding: 8px;
	border-radius: 14px;
	background: var(--cl-primary-bg-color);
	border: 1px solid var(--cl-primary-border-color);
	max-height: 220px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

body.cl-app-conversation .cl-msg-emoji-panel__tabs {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	margin-bottom: 6px;
}

body.cl-app-conversation .cl-msg-emoji-panel__tabs button {
	border: none;
	background: transparent;
	font-size: 11px;
	padding: 4px 8px;
	border-radius: 8px;
	cursor: pointer;
	color: var(--cl-secondary-text-color);
	text-transform: capitalize;
}

body.cl-app-conversation .cl-msg-emoji-panel__tabs button.is-active {
	background: var(--cl-msg-surface);
	color: var(--cl-primary-text-color);
	font-weight: 600;
}

body.cl-app-conversation .cl-msg-emoji-panel__grid {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 2px;
	overflow-y: auto;
	max-height: 170px;
}

body.cl-app-conversation .cl-msg-emoji-panel__grid button {
	border: none;
	background: transparent;
	font-size: 22px;
	line-height: 1.2;
	padding: 4px;
	cursor: pointer;
	border-radius: 8px;
}

body.cl-app-conversation .cl-msg-emoji-panel__grid button:hover {
	background: var(--cl-msg-hover);
}

/* Message reactions */
body.cl-app-conversation .cl-msg-reactions {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 4px;
}

body.cl-app-conversation .cl-msg-reactions--empty {
	display: none;
}

body.cl-app-conversation .cl-msg-reactions__chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	border-radius: 999px;
	border: 1px solid var(--cl-primary-border-color);
	background: var(--cl-primary-bg-color);
	font-size: 13px;
	cursor: pointer;
}

body.cl-app-conversation .cl-msg-reactions__chip.is-mine {
	border-color: var(--cl-msg-accent);
	background: color-mix(in srgb, var(--cl-msg-accent) 12%, var(--cl-primary-bg-color));
}

/* Reaction quick bar + full picker */
body.cl-app-conversation .cl-msg-react-bar {
	display: none;
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	bottom: calc(100% + 4px);
	z-index: 50;
	padding: 4px 6px;
	border-radius: 999px;
	background: var(--cl-primary-bg-color);
	border: 1px solid var(--cl-primary-border-color);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

body.cl-app-conversation .conversation-messages__item {
	position: relative;
}

body.cl-app-conversation .cl-msg-react-bar.is-visible,
body.cl-app-conversation .conversation-messages__item:hover .cl-msg-react-bar {
	display: flex;
}

body.cl-app-conversation .cl-msg-react-bar__quick {
	display: flex;
	gap: 2px;
	align-items: center;
}

body.cl-app-conversation .cl-msg-react-bar__btn {
	border: none;
	background: transparent;
	font-size: 20px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	line-height: 1;
}

body.cl-app-conversation .cl-msg-react-bar__btn:hover {
	background: var(--cl-msg-hover);
}

body.cl-app-conversation .cl-msg-react-bar__btn--more {
	font-size: 18px;
	font-weight: 700;
	color: var(--cl-secondary-text-color);
}

body.cl-app-conversation .cl-msg-reaction-picker {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

body.cl-app-conversation .cl-msg-reaction-picker__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
}

body.cl-app-conversation .cl-msg-reaction-picker__sheet {
	position: relative;
	width: 100%;
	max-width: 520px;
	max-height: 50vh;
	background: var(--cl-primary-bg-color);
	border-radius: 16px 16px 0 0;
	padding: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

body.cl-app-conversation .cl-msg-reaction-picker__tabs {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	margin-bottom: 8px;
}

body.cl-app-conversation .cl-msg-reaction-picker__tabs button {
	border: none;
	background: transparent;
	padding: 6px 10px;
	border-radius: 8px;
	font-size: 12px;
	cursor: pointer;
	text-transform: capitalize;
}

body.cl-app-conversation .cl-msg-reaction-picker__tabs button.is-active {
	background: var(--cl-msg-surface);
	font-weight: 600;
}

body.cl-app-conversation .cl-msg-reaction-picker__grid {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 4px;
	overflow-y: auto;
}

body.cl-app-conversation .cl-msg-reaction-picker__grid button {
	border: none;
	background: transparent;
	font-size: 26px;
	padding: 6px;
	border-radius: 10px;
	cursor: pointer;
}

/* Read receipts */
body.cl-app-conversation .message-time .cl-msg-read-rcpt {
	display: inline-flex;
	align-items: center;
	margin-left: 4px;
	vertical-align: middle;
}

body.cl-app-conversation .message-time .cl-msg-read-rcpt svg {
	width: 14px;
	height: 14px;
}

body.cl-app-conversation .message-time .cl-msg-read-rcpt--read svg {
	fill: var(--cl-msg-accent);
}

body.cl-app-conversation .message-time .cl-msg-read-rcpt--read svg + svg {
	margin-left: -8px;
}

/* Swipe reply */
body.cl-app-conversation .conversation-messages__item.is-swipe-reply-active {
	transform: translateX(28px);
	transition: transform 0.15s ease;
}

body.cl-app-conversation .cl-msg-swipe-reply {
	display: none;
}

@media (max-width: 767.98px) {
	body.cl-app-conversation .cl-msg-swipe-reply {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 32px;
		height: 32px;
		border: none;
		background: transparent;
		opacity: 0.6;
	}
}

/* Pull to refresh — inbox */
body.cl-app-chat .cl-msg-ptr-hint {
	text-align: center;
	font-size: 12px;
	color: var(--cl-secondary-text-color);
	padding: 0;
	height: 0;
	overflow: hidden;
	transition: height 0.2s, padding 0.2s;
}

body.cl-app-chat .cl-msg-ptr-hint.is-pulling,
body.cl-app-chat .cl-msg-ptr-hint.is-refreshing {
	height: 32px;
	padding: 8px;
}

body.cl-app-chat .cl-msg-ptr-hint.is-refreshing span::after {
	content: " …";
}
