/* =====================================================
   SIDEBAR
   ===================================================== */

.cp-portal-sidebar {
	background: var(--cp-sidebar-bg);
	display: flex;
	flex-direction: column;
	border-right: 1px solid var(--cp-sidebar-border);
}

/* Brand */
.cp-sidebar-brand {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.25rem 1rem 1.25rem 1.25rem;
	border-bottom: 1px solid var(--cp-sidebar-border);
	min-height: var(--cp-topbar-height);
	gap: 0.5rem;
}

.cp-sidebar-logo-link {
	display: flex;
	align-items: center;
	overflow: hidden;
}

.cp-sidebar-logo {
	max-height: 36px;
	width: auto;
	display: block;
}

.cp-sidebar-portal-name {
	color: #ffffff;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cp-sidebar-collapse-btn {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--cp-radius-sm);
	color: var(--cp-sidebar-text);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: all var(--cp-transition);
}

.cp-sidebar-collapse-btn:hover {
	background: rgba(255, 255, 255, 0.08);
	color: var(--cp-sidebar-text-hover);
}

body.cp-sidebar-collapsed .cp-sidebar-collapse-btn {
	transform: rotate(180deg);
}

/* Nav */
.cp-sidebar-nav {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0.75rem 0.625rem;
	scrollbar-width: thin;
	scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.cp-sidebar-nav::-webkit-scrollbar {
	width: 4px;
}

.cp-sidebar-nav::-webkit-scrollbar-thumb {
	background: rgba(255,255,255,0.1);
	border-radius: 2px;
}

.cp-sidebar-nav-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.cp-sidebar-nav-link {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.625rem 0.875rem;
	border-radius: var(--cp-radius-sm);
	color: var(--cp-sidebar-text);
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
	transition: all var(--cp-transition);
	position: relative;
	white-space: nowrap;
	overflow: hidden;
}

.cp-sidebar-nav-link:hover {
	background: rgba(255, 255, 255, 0.07);
	color: var(--cp-sidebar-text-hover);
}

.cp-sidebar-nav-link.is-active {
	background: var(--cp-sidebar-active-bg);
	color: var(--cp-sidebar-text-active);
}

.cp-sidebar-nav-link.is-active::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 3px;
	height: 60%;
	background: var(--cp-sidebar-active-border);
	border-radius: 0 2px 2px 0;
}

.cp-sidebar-nav-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
}

.cp-sidebar-nav-label {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: opacity var(--cp-transition-md), width var(--cp-transition-md);
}

.cp-sidebar-nav-badge {
	flex-shrink: 0;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background: var(--cp-accent);
	color: #ffffff;
	border-radius: 9px;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

/* Collapsed state */
body.cp-sidebar-collapsed .cp-sidebar-nav-label,
body.cp-sidebar-collapsed .cp-sidebar-nav-badge,
body.cp-sidebar-collapsed .cp-sidebar-user-info,
body.cp-sidebar-collapsed .cp-sidebar-portal-name,
body.cp-sidebar-collapsed .cp-sidebar-brand .cp-sidebar-logo-link {
	opacity: 0;
	width: 0;
	overflow: hidden;
	pointer-events: none;
}

body.cp-sidebar-collapsed .cp-sidebar-nav-link {
	justify-content: center;
	padding: 0.625rem;
}

body.cp-sidebar-collapsed .cp-sidebar-user {
	justify-content: center;
	padding: 0.875rem 0.75rem;
}

body.cp-sidebar-collapsed .cp-sidebar-user-avatar {
	margin: 0;
}

/* User Profile at bottom */
.cp-sidebar-user {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.875rem 1rem;
	border-top: 1px solid var(--cp-sidebar-border);
	margin-top: auto;
}

.cp-sidebar-user-avatar {
	flex-shrink: 0;
}

.cp-sidebar-user-info {
	flex: 1;
	overflow: hidden;
	transition: opacity var(--cp-transition-md);
}

.cp-sidebar-user-name {
	display: block;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--cp-sidebar-text-active);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cp-sidebar-user-role {
	display: block;
	font-size: 0.6875rem;
	color: var(--cp-sidebar-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cp-sidebar-logout {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: var(--cp-radius-sm);
	color: var(--cp-sidebar-text);
	text-decoration: none;
	transition: all var(--cp-transition);
}

.cp-sidebar-logout:hover {
	background: rgba(255,255,255,0.08);
	color: var(--cp-danger);
}

/* =====================================================
   TOPBAR
   ===================================================== */

.cp-topbar-hamburger {
	display: none;
	color: var(--cp-text-secondary);
}

.cp-topbar-breadcrumb {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	overflow: hidden;
}

.cp-topbar-breadcrumb a {
	color: var(--cp-text-muted);
	white-space: nowrap;
}

.cp-topbar-actions {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.cp-topbar-notif-btn {
	position: relative;
}

.cp-notif-dot {
	position: absolute;
	top: 4px;
	right: 4px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	background: var(--cp-danger);
	color: #fff;
	border-radius: 8px;
	font-size: 10px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	border: 2px solid var(--cp-topbar-bg);
}

.cp-topbar-user-btn {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.375rem 0.5rem;
	border-radius: var(--cp-radius-sm);
	background: transparent;
	border: none;
	cursor: pointer;
	color: var(--cp-text-secondary);
	font-size: var(--cp-text-sm);
	font-weight: 500;
	transition: background var(--cp-transition);
}

.cp-topbar-user-btn:hover {
	background: var(--cp-bg);
}

.cp-topbar-user-name {
	max-width: 120px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cp-dropdown-notif-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--cp-space-3) var(--cp-space-4);
	border-bottom: 1px solid var(--cp-border);
}

.cp-btn-mark-read {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	font-size: var(--cp-text-xs);
}

.cp-notif-empty {
	padding: var(--cp-space-6) var(--cp-space-4);
	text-align: center;
}

.cp-notif-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: var(--cp-space-3) var(--cp-space-4);
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid var(--cp-border);
	transition: background 0.15s, opacity 0.25s;
	cursor: pointer;
}
.cp-notif-item:last-child { border-bottom: none; }
.cp-notif-item:hover { background: var(--cp-bg-hover, #f8f9fb); }
.cp-notif-item-read {
	opacity: 0.5;
}

.cp-notif-icon {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.cp-notif-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

.cp-notif-label {
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	line-height: 1;
}

.cp-notif-msg {
	font-size: 0.78rem;
	color: var(--cp-text, #0f172a);
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 200px;
}

.cp-notif-time {
	font-size: 0.68rem;
	color: var(--cp-text-muted, #94a3b8);
	line-height: 1;
}

.cp-notif-arrow {
	font-size: 1.1rem;
	color: var(--cp-text-muted, #94a3b8);
	flex-shrink: 0;
	line-height: 1;
	transition: transform 0.15s;
}
.cp-notif-item:hover .cp-notif-arrow {
	color: var(--cp-accent, #7c6af7);
	transform: translateX(2px);
}

@media (max-width: 768px) {
	.cp-topbar-hamburger { display: flex; }
	.cp-topbar-user-name { display: none; }
	.cp-topbar-actions .cp-btn-icon { padding: 0.35rem; }
	.cp-topbar-user-btn { padding: 0.35rem 0.25rem; }
}

/* =====================================================
   FLOATING CHAT WIDGET
   ===================================================== */

.cp-float-chat {
	position: fixed;
	bottom: 1.75rem;
	right: 1.75rem;
	z-index: 9900;
}

/* ── Toggle button ── */
.cp-float-chat-btn {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: var(--cp-accent);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 20px rgba(124, 106, 247, 0.45);
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
	position: relative;
}

.cp-float-chat-btn:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 28px rgba(124, 106, 247, 0.6);
}

.cp-float-chat-btn.is-open {
	background: #4b5568;
}

/* Unread badge */
.cp-float-chat-badge {
	position: absolute;
	top: -3px;
	right: -3px;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	background: var(--cp-danger);
	color: #fff;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #f0f2f7;
	line-height: 1;
}

/* ── Panel ── */
.cp-float-chat-panel {
	position: absolute;
	bottom: 66px;
	right: 0;
	width: 320px;
	background: var(--cp-card-bg, #fff);
	border: 1px solid var(--cp-border);
	border-radius: 14px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.cp-float-chat-panel[hidden] {
	display: none !important;
}

@keyframes cpChatSlideUp {
	from { transform: scale(0.92) translateY(8px); opacity: 0; }
	to   { transform: scale(1) translateY(0); opacity: 1; }
}

.cp-float-chat-panel.is-animating-in {
	animation: cpChatSlideUp 0.2s ease forwards;
}

/* ── Panel header ── */
.cp-float-chat-header {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.875rem 1rem;
	background: var(--cp-sidebar-bg, #1a1f35);
	border-radius: 14px 14px 0 0;
}

.cp-float-chat-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: rgba(255, 255, 255, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.cp-float-chat-header-info {
	flex: 1;
	overflow: hidden;
}

.cp-float-chat-title {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cp-float-chat-status {
	display: block;
	font-size: 0.6875rem;
	color: rgba(255, 255, 255, 0.55);
}

.cp-float-chat-select {
	flex: 1;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 6px;
	color: #fff;
	font-size: 0.8125rem;
	font-family: inherit;
	padding: 0.3125rem 0.5rem;
	cursor: pointer;
	outline: none;
}

.cp-float-chat-select:focus {
	border-color: rgba(255, 255, 255, 0.5);
}

.cp-float-chat-select option {
	background: #1a1f35;
	color: #fff;
}

.cp-float-chat-close {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	border-radius: 6px;
	color: rgba(255, 255, 255, 0.7);
	cursor: pointer;
	transition: background 0.15s;
}

.cp-float-chat-close:hover {
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
}

/* ── Messages list ── */
.cp-float-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 0.875rem;
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
	min-height: 220px;
	max-height: 320px;
	scrollbar-width: thin;
	scrollbar-color: var(--cp-border) transparent;
}

.cp-float-chat-messages::-webkit-scrollbar { width: 4px; }
.cp-float-chat-messages::-webkit-scrollbar-thumb {
	background: var(--cp-border);
	border-radius: 2px;
}

/* ── Message bubbles ── */
.cp-fchat-msg {
	display: flex;
	gap: 0.5rem;
	max-width: 82%;
	min-width: 80px;
	align-self: flex-start;
}

.cp-fchat-msg.is-mine {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.cp-fchat-msg-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(124, 106, 247, 0.12);
	color: var(--cp-accent);
	font-size: 0.625rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	align-self: flex-end;
}

.cp-fchat-msg.is-mine .cp-fchat-msg-avatar {
	background: rgba(124, 106, 247, 0.2);
}

.cp-fchat-msg-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

.cp-fchat-msg-bubble {
	background: var(--cp-bg, #f8f9fb);
	border: 1px solid var(--cp-border);
	border-radius: 12px 12px 12px 3px;
	padding: 0.5625rem 0.875rem;
	font-size: 0.875rem;
	color: var(--cp-text);
	line-height: 1.5;
	word-break: break-word;
	white-space: pre-wrap;
	min-width: 60px;
	max-width: 100%;
	width: fit-content;
}

.cp-fchat-msg.is-mine .cp-fchat-msg-bubble {
	background: var(--cp-accent);
	border-color: var(--cp-accent);
	color: #fff;
	border-radius: 12px 12px 3px 12px;
}

.cp-fchat-msg-time {
	font-size: 0.625rem;
	color: var(--cp-text-muted);
	padding: 0 0.25rem;
	display: inline-flex;
	align-items: center;
	gap: 2px;
}

.cp-fchat-msg.is-mine .cp-fchat-msg-time {
	justify-content: flex-end;
}

/* ── Empty / loading states ── */
.cp-float-chat-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.625rem;
	height: 100%;
	min-height: 160px;
	color: var(--cp-text-muted);
	text-align: center;
}

.cp-float-chat-empty svg { opacity: 0.25; }

.cp-float-chat-empty p {
	margin: 0;
	font-size: 0.8125rem;
}

.cp-float-chat-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	min-height: 160px;
}

/* Spinner */
.cp-fchat-spinner {
	display: inline-block;
	width: 22px;
	height: 22px;
	border: 2.5px solid var(--cp-border);
	border-top-color: var(--cp-accent);
	border-radius: 50%;
	animation: cpSpin 0.7s linear infinite;
}

@keyframes cpSpin {
	to { transform: rotate(360deg); }
}

/* ── Input area ── */
.cp-float-chat-input-area {
	display: flex;
	align-items: flex-end;
	gap: 0.5rem;
	padding: 0.75rem;
	border-top: 1px solid var(--cp-border);
	background: var(--cp-card-bg, #fff);
}

.cp-float-chat-input {
	flex: 1;
	resize: none;
	border: 1px solid var(--cp-border);
	border-radius: 8px;
	padding: 0.5rem 0.75rem;
	font-size: 0.8125rem;
	font-family: inherit;
	color: var(--cp-text);
	background: var(--cp-bg, #f8f9fb);
	outline: none;
	line-height: 1.4;
	max-height: 80px;
	overflow-y: auto;
	transition: border-color 0.15s;
}

.cp-float-chat-input:focus {
	border-color: var(--cp-accent);
}

.cp-float-chat-input::placeholder {
	color: var(--cp-text-muted);
}

.cp-float-chat-send {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--cp-accent);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, transform 0.1s;
}

.cp-float-chat-send:hover:not(:disabled) {
	background: #6254d9;
	transform: scale(1.08);
}

.cp-float-chat-send:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

@media (max-width: 480px) {
	.cp-float-chat-panel { width: calc(100vw - 2rem); right: 0; }
	.cp-float-chat { bottom: 1rem; right: 1rem; }
}

/* ── Expand button (in header) ── */
.cp-float-chat-expand {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	border-radius: 6px;
	color: rgba(255, 255, 255, 0.7);
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}
.cp-float-chat-expand:hover {
	background: rgba(255, 255, 255, 0.22);
	color: #fff;
}

/* ── Expanded panel state ── */
.cp-float-chat-panel.is-expanded {
	width: 440px;
}
.cp-float-chat-panel.is-expanded .cp-float-chat-messages {
	max-height: 420px;
}

/* ── Input area with action buttons ── */
.cp-float-chat-input-area {
	flex-wrap: nowrap;
}
.cp-fchat-input-actions {
	display: flex;
	flex-direction: column;
	gap: 3px;
	flex-shrink: 0;
	align-self: flex-end;
	padding-bottom: 1px;
}
.cp-fchat-action-btn {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 1px solid var(--cp-border);
	border-radius: 6px;
	color: var(--cp-text-muted);
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
	padding: 0;
	flex-shrink: 0;
}
.cp-fchat-action-btn:hover {
	background: var(--cp-bg, #f8f9fb);
	color: var(--cp-accent);
	border-color: var(--cp-accent);
}
.cp-fchat-action-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ── Emoji picker ── */
.cp-fchat-emoji-picker {
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 1px;
	padding: 0.5rem 0.625rem;
	border-top: 1px solid var(--cp-border);
	background: var(--cp-card-bg, #fff);
	max-height: 130px;
	overflow-y: auto;
}
.cp-fchat-emoji-picker[hidden] { display: none; }
.cp-fchat-emoji-btn {
	width: 30px;
	height: 30px;
	font-size: 15px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.1s;
	padding: 0;
}
.cp-fchat-emoji-btn:hover {
	background: var(--cp-bg, #f0f2f7);
}

/* ── Upload queue ── */
.cp-fchat-upload-queue {
	padding: 0.375rem 0.75rem;
	border-top: 1px solid var(--cp-border);
	background: var(--cp-card-bg, #fff);
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}
.cp-fchat-upload-queue[hidden] { display: none; }
.cp-fchat-upload-item {
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.cp-fchat-upload-name {
	font-size: 0.6875rem;
	color: var(--cp-text-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cp-fchat-upload-bar {
	height: 3px;
	background: var(--cp-border);
	border-radius: 2px;
	overflow: hidden;
}
.cp-fchat-upload-fill {
	height: 100%;
	width: 0;
	background: var(--cp-accent);
	border-radius: 2px;
	transition: width 0.1s linear;
}

/* ── Image bubble ── */
.cp-fchat-img-wrap {
	max-width: 200px;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid var(--cp-border);
	cursor: pointer;
}
.cp-fchat-img-link { display: block; }
.cp-fchat-img-preview {
	display: block;
	width: 100%;
	height: auto;
	max-height: 160px;
	object-fit: cover;
	transition: opacity 0.15s;
}
.cp-fchat-img-preview:hover { opacity: 0.88; }

/* ── File card bubble ── */
.cp-fchat-file-card {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: var(--cp-bg, #f8f9fb);
	border: 1px solid var(--cp-border);
	border-radius: 10px;
	padding: 0.5rem 0.625rem;
	max-width: 220px;
	min-width: 160px;
}
.cp-fchat-msg.is-mine .cp-fchat-file-card {
	background: #fff;
	border-color: #d1d5db;
}
.cp-fchat-file-icon {
	width: 34px;
	height: 34px;
	border-radius: 6px;
	background: var(--cp-accent);
	color: #fff;
	font-size: 0.5625rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	letter-spacing: 0;
}
.cp-fchat-file-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.cp-fchat-file-name {
	font-size: 0.75rem;
	color: var(--cp-text);
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cp-fchat-msg.is-mine .cp-fchat-file-name { color: #1a1d2e; }
.cp-fchat-file-size {
	font-size: 0.625rem;
	color: var(--cp-text-muted);
}
.cp-fchat-msg.is-mine .cp-fchat-file-size { color: #64748b; }
.cp-fchat-file-dl {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(124, 106, 247, 0.1);
	border-radius: 6px;
	color: var(--cp-accent);
	text-decoration: none;
	transition: background 0.15s;
}
.cp-fchat-file-dl:hover { background: rgba(124, 106, 247, 0.22); }
.cp-fchat-msg.is-mine .cp-fchat-file-dl {
	background: rgba(124,106,247,0.1);
	color: var(--cp-accent);
}
.cp-fchat-msg.is-mine .cp-fchat-file-dl:hover { background: rgba(124,106,247,0.22); }

/* =====================================================
   TOPBAR PRICE BADGE — bold, centred, accented
   ===================================================== */

.cp-topbar-price-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.2em;
	padding: 0.25em 0.75em;
	background: var(--cp-accent-light);
	color: var(--cp-accent-dark);
	border-radius: var(--cp-radius-full);
	font-size: var(--cp-text-sm);
	font-weight: 700;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

.cp-topbar-price-badge .woocommerce-Price-amount,
.cp-topbar-price-badge bdi {
	font-weight: 700;
}

/* Mobile-only centred price strip */
.cp-topbar-mobile-price {
	display: none;
}

@media (max-width: 768px) {

	/* Hide page title text (e.g. "Dashboard") on generic pages */
	.cp-topbar-hide-mobile {
		display: none;
	}

	/* Centred price strip — sits between hamburger and actions */
	.cp-topbar-mobile-price {
		display: flex;
		align-items: center;
		justify-content: center;
		flex: 1;
		font-size: 1rem;
		font-weight: 700;
		color: var(--cp-accent-dark);
		letter-spacing: 0.01em;
		pointer-events: none;
	}

	.cp-topbar-mobile-price .woocommerce-Price-amount,
	.cp-topbar-mobile-price bdi {
		font-weight: 700;
	}

	/* Shrink the desktop breadcrumb on mobile so price has room */
	.cp-topbar-breadcrumb {
		flex-shrink: 1;
		min-width: 0;
		overflow: hidden;
	}

	/* Hide the desktop price badge on mobile (shown in the centred strip instead) */
	.cp-topbar-breadcrumb .cp-topbar-price-badge {
		display: none;
	}

	/* Push right actions to the end */
	.cp-topbar-spacer {
		display: none;
	}
}

/* =====================================================
   TOPBAR PRICE — bold, centred (replaces old badge CSS)
   ===================================================== */

/* Remove old badge styles if present */
.cp-topbar-price-badge { display: none !important; }
.cp-topbar-mobile-price { display: none !important; }
.cp-topbar-hide-mobile { display: none !important; }

/* New unified price element */
.cp-topbar-price {
	font-size: 1rem;
	font-weight: 700;
	color: var(--cp-accent-dark, #5b4dd6);
	letter-spacing: 0.01em;
	white-space: nowrap;
	text-align: center;
}

.cp-topbar-price .woocommerce-Price-amount,
.cp-topbar-price bdi,
.cp-topbar-price .woocommerce-Price-currencySymbol {
	font-weight: 700;
}

/* On mobile: price is centred between hamburger and actions */
@media (max-width: 768px) {
	.cp-topbar-spacer { display: none; }
	.cp-topbar-price {
		flex: 1;
		text-align: center;
		font-size: 1.05rem;
	}
}

/* On desktop: price sits naturally in the flow */
@media (min-width: 769px) {
	.cp-topbar-price {
		margin-right: auto;
	}
}

/* ── Approval Request Bubble ── */
.cp-fchat-approval-card {
	background: var(--cp-bg-hover, #f3f4f6);
	border: 2px solid var(--cp-border, #e5e7eb);
	border-radius: 12px;
	padding: .75rem 1rem;
	display: flex;
	align-items: flex-start;
	gap: .75rem;
	min-width: 220px;
	max-width: 280px;
	transition: border-color .2s, background .2s;
}
.cp-fchat-approval-card.is-approved {
	border-color: var(--cp-success, #10b981);
	background: #f0fdf4;
}
.cp-fchat-approval-icon {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: var(--cp-accent-light, #ede9fe);
	color: var(--cp-accent, #7c6af7);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.cp-fchat-approval-card.is-approved .cp-fchat-approval-icon {
	background: #d1fae5;
	color: var(--cp-success, #10b981);
}
.cp-fchat-approval-body {
	flex: 1;
	min-width: 0;
}
.cp-fchat-approval-label {
	font-size: .68rem;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--cp-text-muted, #9ca3af);
	font-weight: 700;
	margin: 0 0 .2rem;
}
.cp-fchat-approval-task {
	font-size: .82rem;
	font-weight: 600;
	color: var(--cp-text-primary, #111);
	margin: 0 0 .5rem;
	word-break: break-word;
}
.cp-fchat-approval-check {
	display: flex;
	align-items: center;
	gap: .4rem;
	cursor: pointer;
	font-size: .78rem;
	color: var(--cp-accent, #7c6af7);
	font-weight: 600;
	user-select: none;
}
.cp-fchat-approval-check input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--cp-accent, #7c6af7);
	cursor: pointer;
	flex-shrink: 0;
}
.cp-fchat-approval-done {
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	font-size: .78rem;
	font-weight: 700;
	color: var(--cp-success, #10b981);
}
.cp-fchat-approval-pending {
	font-size: .72rem;
	color: var(--cp-text-muted, #9ca3af);
	font-style: italic;
}

/* ── Upload Request Bubble ── */
.cp-fchat-upload-req-card {
	background: var(--cp-bg-hover, #f3f4f6);
	border: 2px solid var(--cp-border, #e5e7eb);
	border-radius: 12px;
	padding: .75rem 1rem;
	display: flex;
	align-items: flex-start;
	gap: .75rem;
	min-width: 220px;
	max-width: 280px;
	transition: border-color .2s, background .2s;
}
.cp-fchat-upload-req-card .cp-fchat-approval-icon {
	background: #fef3c7;
	color: #d97706;
}
.cp-fchat-upload-req-card.is-uploaded {
	border-color: var(--cp-success, #10b981);
	background: #f0fdf4;
}
.cp-fchat-upload-req-card.is-uploaded .cp-fchat-approval-icon {
	background: #d1fae5;
	color: var(--cp-success, #10b981);
}
.cp-fchat-upload-req-btn {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	font-size: .78rem;
	font-weight: 600;
	color: #fff;
	background: #d97706;
	padding: .35rem .75rem;
	border-radius: 6px;
	cursor: pointer;
	transition: background .15s;
	user-select: none;
}
.cp-fchat-upload-req-btn:hover { background: #b45309; }

/* ── Delete message button ── */
.cp-fchat-msg {
	position: relative;
}
.cp-fchat-delete-btn {
	position: absolute;
	top: 2px;
	left: -26px;
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: var(--cp-text-muted, #9ca3af);
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s, color .15s;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
}
.cp-fchat-msg.is-mine:hover .cp-fchat-delete-btn,
.cp-fchat-msg.is-mine:focus-within .cp-fchat-delete-btn {
	opacity: 1;
	pointer-events: auto;
}
.cp-fchat-delete-btn:hover {
	color: #ef4444;
	background: #fee2e2;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BACKDROP BLUR
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.cp-chat-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 15, 30, 0.35);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	z-index: calc(var(--cp-z-modal, 1000) - 12);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.cp-chat-backdrop.is-active {
	opacity: 1;
	pointer-events: auto;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CHAT HEADER — LOGO & AVATAR IMAGES
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.cp-float-chat-logo-img {
	width: 34px;
	height: 34px;
	object-fit: contain;
	border-radius: 6px;
	background: #fff;
	padding: 2px;
}

.cp-float-chat-avatar-img {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(255, 255, 255, 0.3);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MESSAGE AVATARS — REAL PHOTO SUPPORT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.cp-fchat-msg-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(124, 106, 247, 0.12);
	color: var(--cp-accent);
	font-size: 0.6rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	align-self: flex-end;
	overflow: hidden;
}

.cp-fchat-msg.is-mine .cp-fchat-msg-avatar {
	background: rgba(124, 106, 247, 0.2);
}

.cp-fchat-av-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 50%;
	display: block;
	background: #fff;
	padding: 2px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   VIDEO BUBBLE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.cp-fchat-video-wrap {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	max-width: 220px;
}

.cp-fchat-video-thumb {
	position: relative;
	display: block;
	border-radius: 10px;
	overflow: hidden;
	background: #1a1a2e;
	aspect-ratio: 16 / 9;
	text-decoration: none;
	flex-shrink: 0;
}

.cp-fchat-video-poster {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cp-fchat-video-placeholder {
	background: linear-gradient(135deg, #1e1e3a 0%, #2d2d5e 100%);
	width: 100%;
	height: 100%;
}

.cp-fchat-video-play-btn {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: rgba(0, 0, 0, 0.42);
	transition: background 0.15s;
}

.cp-fchat-video-thumb:hover .cp-fchat-video-play-btn {
	background: rgba(124, 106, 247, 0.65);
}

.cp-fchat-video-play-btn svg {
	filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.cp-fchat-video-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 0 2px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   AUDIO BUBBLE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.cp-fchat-audio-wrap {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	background: var(--cp-bg, #f8f9fb);
	border: 1px solid var(--cp-border);
	border-radius: 10px;
	padding: 0.6rem 0.75rem;
	max-width: 240px;
}

.cp-fchat-msg.is-mine .cp-fchat-audio-wrap {
	background: #fff;
	border-color: #d1d5db;
}

.cp-fchat-audio-icon {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--cp-accent);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cp-fchat-msg.is-mine .cp-fchat-audio-icon {
	background: var(--cp-accent);
}

.cp-fchat-audio-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.cp-fchat-audio-player {
	width: 100%;
	height: 28px;
	accent-color: var(--cp-accent);
	outline: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FILE NAME / SIZE shared
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.cp-fchat-file-name {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--cp-text-primary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 180px;
	display: block;
}

.cp-fchat-file-size {
	font-size: 0.65rem;
	color: var(--cp-text-muted);
	display: block;
}

.cp-fchat-msg.is-mine .cp-fchat-file-name,
.cp-fchat-msg.is-mine .cp-fchat-file-size {
	color: rgba(255, 255, 255, 0.85);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CHAT FILE TILE (replaces old broken file-card)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.cp-fchat-file-thumb-wrap {
	border-radius: 10px 10px 0 0;
	overflow: hidden;
	max-width: 240px;
	background: #f1f5f9;
	border: 1.5px solid #d1d5db;
	border-bottom: none;
	line-height: 0;
}

.cp-fchat-msg.is-mine .cp-fchat-file-thumb-wrap {
	border-color: #d1d5db;
}

.cp-fchat-file-thumb-link { display: block; }

.cp-fchat-file-thumb-img {
	width: 100%;
	max-height: 160px;
	object-fit: cover;
	display: block;
	transition: opacity 0.15s;
}
.cp-fchat-file-thumb-img:hover { opacity: 0.9; }

/* When thumb is present, square off the top corners of the tile below it */
.cp-fchat-file-thumb-wrap + .cp-fchat-file-tile {
	border-top: none;
	border-radius: 0 0 10px 10px;
}

.cp-fchat-file-tile {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: var(--cp-bg-card, #fff);
	border: 1.5px solid #d1d5db;
	border-radius: 10px;
	padding: 0.5rem 0.625rem;
	max-width: 240px;
	min-width: 180px;
}

.cp-fchat-msg.is-mine .cp-fchat-file-tile {
	background: #fff;
	border-color: #d1d5db;
}

.cp-fchat-tile-icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
}

.cp-fchat-tile-ext {
	font-size: 9px;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
	line-height: 1;
}

.cp-fchat-file-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.cp-fchat-file-name {
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--cp-text-primary);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 130px;
	display: block;
}

.cp-fchat-file-size {
	font-size: 0.62rem;
	color: var(--cp-text-muted);
	display: block;
}

.cp-fchat-msg.is-mine .cp-fchat-file-name { color: #1a1d2e; }
.cp-fchat-msg.is-mine .cp-fchat-file-size { color: #64748b; }

.cp-fchat-tile-btns {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex-shrink: 0;
}

.cp-fchat-tile-btn {
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	background: var(--cp-bg-subtle, #f1f5f9);
	color: var(--cp-text-muted);
	text-decoration: none;
	transition: background .15s, color .15s;
}

.cp-fchat-tile-btn:hover {
	background: var(--cp-accent);
	color: #fff;
}

.cp-fchat-msg.is-mine .cp-fchat-tile-btn {
	background: #f1f5f9;
	color: #64748b;
}

.cp-fchat-msg.is-mine .cp-fchat-tile-btn:hover {
	background: var(--cp-accent);
	color: #fff;
}

/* ══════════════════════════════════════════════════════════════════════════════
   FLOAT CHAT — WhatsApp-style redesign
   ══════════════════════════════════════════════════════════════════════════════ */

/* FAB button */
.cp-float-chat { bottom: 1.5rem; right: 1.5rem; }

.cp-float-chat-btn {
	width: 58px;
	height: 58px;
	background: #25D366;
	box-shadow: 0 6px 28px rgba(37,211,102,0.45);
	border-radius: 50%;
}
.cp-float-chat-btn:hover {
	background: #1ebe5d;
	transform: scale(1.1);
	box-shadow: 0 10px 36px rgba(37,211,102,0.55);
}
.cp-float-chat-btn.is-open { background: #128C7E; }

/* Panel — larger, WhatsApp proportions */
.cp-float-chat-panel {
	bottom: 74px;
	right: 0;
	width: 380px;
	max-height: 640px;
	border-radius: 16px;
	box-shadow: 0 24px 64px rgba(0,0,0,0.28), 0 0 0 1px rgba(0,0,0,0.06);
	flex-direction: column;
	overflow: hidden;
	border: none;
}
/* Ensure hidden attribute always wins */
.cp-float-chat-panel[hidden] { display: none !important; }
.cp-float-chat-panel.is-expanded {
	width: 480px;
	max-height: 760px;
}

/* Header — WhatsApp dark teal */
.cp-float-chat-header {
	background: #075E54;
	padding: 0.75rem 0.875rem;
	border-radius: 16px 16px 0 0;
	display: flex;
	align-items: center;
	gap: 0.625rem;
	min-height: 60px;
}
.cp-float-chat-header .cp-float-chat-avatar,
.cp-float-chat-header .cp-fchat-back-btn {
	flex-shrink: 0;
}
.cp-fchat-back-btn {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0.12);
	border: none;
	border-radius: 50%;
	color: rgba(255,255,255,0.9);
	cursor: pointer;
	transition: background 0.15s;
}
.cp-fchat-back-btn:hover { background: rgba(255,255,255,0.22); }

.cp-float-chat-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255,255,255,0.18);
	color: rgba(255,255,255,0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.cp-float-chat-logo-img,
.cp-float-chat-avatar-img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid rgba(255,255,255,0.3);
}

.cp-float-chat-header-info { flex: 1; min-width: 0; }
.cp-float-chat-title {
	display: block;
	font-size: 0.9375rem;
	font-weight: 700;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	letter-spacing: -0.01em;
}
.cp-float-chat-status {
	display: block;
	font-size: 0.7rem;
	color: rgba(255,255,255,0.65);
}

.cp-fchat-header-actions { display: flex; gap: 4px; flex-shrink: 0; }
.cp-float-chat-expand,
.cp-float-chat-close {
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0.1);
	border: none;
	border-radius: 8px;
	color: rgba(255,255,255,0.75);
	cursor: pointer;
	transition: background 0.15s;
}
.cp-float-chat-expand:hover,
.cp-float-chat-close:hover { background: rgba(255,255,255,0.22); color: #fff; }

/* ── Inbox / Conversation List ── */
.cp-fchat-inbox {
	display: flex;
	flex-direction: column;
	flex: 1;
	background: #fff;
	overflow: hidden;
}

.cp-fchat-inbox-search {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0.625rem 0.875rem;
	background: #F0F2F5;
	border-bottom: 1px solid #e9edef;
	color: #54656f;
}
.cp-fchat-inbox-search-input {
	flex: 1;
	border: none;
	background: transparent;
	font-size: 0.8125rem;
	color: #111b21;
	outline: none;
}
.cp-fchat-inbox-search-input::placeholder { color: #8696a0; }

.cp-fchat-conv-list {
	list-style: none;
	padding: 0;
	margin: 0;
	overflow-y: auto;
	flex: 1;
	max-height: 520px;
}

.cp-fchat-conv-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 0.875rem;
	cursor: pointer;
	transition: background 0.12s;
	border-bottom: 1px solid #f0f2f5;
	position: relative;
}
.cp-fchat-conv-item:hover { background: #f5f6f6; }
.cp-fchat-conv-item.is-active { background: #e9edef; }

.cp-fchat-conv-avatar {
	position: relative;
	flex-shrink: 0;
}
.cp-fchat-conv-avatar img {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}
.cp-fchat-conv-status-dot {
	position: absolute;
	bottom: 1px;
	right: 1px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #25D366;
	border: 2px solid #fff;
}

.cp-fchat-conv-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.cp-fchat-conv-name {
	font-size: 0.9rem;
	font-weight: 600;
	color: #111b21;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cp-fchat-conv-preview {
	font-size: 0.75rem;
	color: #667781;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cp-fchat-conv-badge {
	min-width: 20px;
	height: 20px;
	background: #25D366;
	color: #fff;
	font-size: 0.7rem;
	font-weight: 700;
	border-radius: 99px;
	padding: 0 5px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

/* ── Messages area — doodle background ── */
.cp-float-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-height: 260px;
	max-height: 440px;
	background-color: #efeae2;
	background-size: 280px auto;
	background-repeat: repeat;
	background-position: top left;
	image-rendering: auto;
	position: relative;
}
.cp-float-chat-messages::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(239, 234, 226, 0.38);
	pointer-events: none;
	z-index: 0;
}
/* Ensure bubbles sit above the overlay */
.cp-fchat-msg,
.cp-float-chat-loading,
.cp-float-chat-empty {
	position: relative;
	z-index: 1;
}
.cp-float-chat-panel.is-expanded .cp-float-chat-messages { max-height: 560px; }

/* Bubbles */
.cp-fchat-msg-bubble {
	border-radius: 8px 8px 8px 3px;
	background: #fff;
	border: none;
	box-shadow: 0 1px 2px rgba(0,0,0,0.12);
	padding: 0.5625rem 0.875rem;
	font-size: 0.875rem;
	line-height: 1.5;
	position: relative;
	min-width: 60px;
	max-width: 100%;
	width: fit-content;
	word-break: break-word;
	white-space: pre-wrap;
}
.cp-fchat-msg.is-mine .cp-fchat-msg-bubble {
	background: #D9FDD3;
	border-radius: 8px 8px 3px 8px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.12);
	color: #111b21;
}

/* Message row — avatar + bubble — wide enough to fill panel */
.cp-fchat-msg {
	max-width: 82%;
	min-width: 80px;
}
.cp-fchat-msg-body {
	flex: 1;
	min-width: 0;
}
/* Message time */
.cp-fchat-msg-time {
	font-size: 0.62rem;
	color: #8696a0;
	padding: 0 2px;
	margin-top: 1px;
	display: inline-flex;
	align-items: center;
	gap: 2px;
}
.cp-fchat-msg.is-mine .cp-fchat-msg-time { justify-content: flex-end; }

/* ── Input area — WhatsApp style ── */
.cp-float-chat-input-area {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	background: #f0f2f5;
	border-top: none;
}

.cp-float-chat-input {
	flex: 1;
	border-radius: 24px;
	border: none;
	background: #fff;
	padding: 0.5rem 0.875rem;
	font-size: 0.875rem;
	font-family: inherit;
	color: #111b21;
	resize: none;
	outline: none;
	line-height: 1.4;
	max-height: 80px;
	overflow-y: auto;
	box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.cp-float-chat-input::placeholder { color: #8696a0; }

.cp-fchat-action-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: transparent;
	border: none;
	color: #54656f;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, color 0.15s;
	flex-shrink: 0;
}
.cp-fchat-action-btn:hover { background: rgba(0,0,0,0.06); color: #075E54; }

.cp-float-chat-send {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #25D366;
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, transform 0.15s;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(37,211,102,0.35);
}
.cp-float-chat-send:hover:not(:disabled) {
	background: #1ebe5d;
	transform: scale(1.08);
}
.cp-float-chat-send:disabled { background: #c8d8d0; box-shadow: none; }

@media (max-width: 480px) {
	.cp-float-chat-panel { width: calc(100vw - 1.5rem); right: 0; border-radius: 14px; }
	.cp-float-chat { bottom: 1rem; right: 1rem; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   WHATSAPP-STYLE FLOAT CHAT — cp-wachat
   ══════════════════════════════════════════════════════════════════════════════ */

/* Bigger panel */
.cp-float-chat-panel.cp-wachat {
	width: 700px;
	max-width: calc(100vw - 2rem);
	height: 560px;
	max-height: calc(100vh - 6rem);
	flex-direction: row;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 24px 80px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.06);
	bottom: 72px;
}

/* Expanded state */
.cp-float-chat-panel.cp-wachat.is-expanded {
	width: min(880px, calc(100vw - 2rem));
	height: min(680px, calc(100vh - 4rem));
}

/* ── LEFT SIDEBAR: conversation list ── */
.cp-wachat-sidebar {
	width: 260px;
	min-width: 220px;
	flex-shrink: 0;
	background: #fff;
	border-right: 1px solid #e9edef;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Sidebar head */
.cp-wachat-sidebar-head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.875rem 1rem;
	background: #f0f2f5;
	border-bottom: 1px solid #e9edef;
	flex-shrink: 0;
}
.cp-wachat-me-avatar img {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
}
.cp-wachat-sidebar-title {
	flex: 1;
	font-size: 1rem;
	font-weight: 700;
	color: #111b21;
	font-family: 'Sora', sans-serif;
	letter-spacing: -0.02em;
}
.cp-wachat-close-btn {
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	border-radius: 50%;
	color: #54656f;
	cursor: pointer;
	transition: background 0.15s;
}
.cp-wachat-close-btn:hover { background: rgba(0,0,0,0.06); }

/* Search */
.cp-wachat-search {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.875rem;
	background: #f0f2f5;
	border-bottom: 1px solid #e9edef;
	flex-shrink: 0;
}
.cp-wachat-search svg { color: #54656f; flex-shrink: 0; }
.cp-wachat-search-input {
	flex: 1;
	border: none;
	background: #fff;
	border-radius: 8px;
	padding: 0.375rem 0.625rem;
	font-size: 0.8125rem;
	font-family: inherit;
	color: #111b21;
	outline: none;
}
.cp-wachat-search-input::placeholder { color: #8696a0; }

/* Conversation list */
.cp-wachat-convos {
	flex: 1;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #ccc transparent;
}
.cp-wachat-convos::-webkit-scrollbar { width: 4px; }
.cp-wachat-convos::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* Individual conversation row */
.cp-wachat-convo {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	cursor: pointer;
	border-bottom: 1px solid #f0f2f5;
	transition: background 0.12s;
	position: relative;
}
.cp-wachat-convo:hover { background: #f5f6f6; }
.cp-wachat-convo.is-active { background: #e9edef; }

.cp-wachat-convo-avatar-wrap { position: relative; flex-shrink: 0; }
.cp-wachat-convo-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}
.cp-wachat-online-dot {
	position: absolute;
	bottom: 1px;
	right: 1px;
	width: 11px;
	height: 11px;
	background: #25d366;
	border-radius: 50%;
	border: 2px solid #fff;
}

.cp-wachat-convo-info { flex: 1; min-width: 0; }
.cp-wachat-convo-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 2px;
}
.cp-wachat-convo-name {
	font-size: 0.9rem;
	font-weight: 600;
	color: #111b21;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cp-wachat-convo-time {
	font-size: 0.65rem;
	color: #8696a0;
	flex-shrink: 0;
}
.cp-wachat-convo-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}
.cp-wachat-convo-preview {
	font-size: 0.75rem;
	color: #8696a0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1;
}
.cp-wachat-unread-badge {
	flex-shrink: 0;
	min-width: 18px;
	height: 18px;
	background: #25d366;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	border-radius: 99px;
	padding: 0 5px;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ── RIGHT PANE: active chat ── */
.cp-wachat-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: #efeae2;
}

.cp-wachat-main-full {
	width: 100%;
	border-radius: 0;
}

/* Chat header in right pane */
.cp-wachat-chat-head {
	background: #f0f2f5 !important;
	border-bottom: 1px solid #e9edef !important;
	padding: 0.625rem 1rem !important;
	gap: 0.75rem !important;
}
.cp-wachat-active-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

/* Messages area — doodle background */
.cp-wachat-messages {
	background-size: 280px auto !important;
	background-repeat: repeat !important;
	background-color: #efeae2 !important;
	position: relative;
}
/* Overlay to lighten doodle so it's subtle */
.cp-wachat-messages::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(239, 234, 226, 0.45);
	pointer-events: none;
	z-index: 0;
}
.cp-wachat-messages > * { position: relative; z-index: 1; }

/* Override existing message bubble colours for WhatsApp feel */
.cp-wachat-messages .cp-fchat-msg-bubble {
	background: #fff !important;
	border: none !important;
	box-shadow: 0 1px 3px rgba(0,0,0,0.12) !important;
	border-radius: 0 8px 8px 8px !important;
}
.cp-wachat-messages .cp-fchat-msg.is-mine .cp-fchat-msg-bubble {
	background: #d9fdd3 !important;
	border-radius: 8px 0 8px 8px !important;
	box-shadow: 0 1px 3px rgba(0,0,0,0.12) !important;
}

/* Input area — WhatsApp style */
.cp-wachat-input-area {
	background: #f0f2f5 !important;
	border-top: 1px solid #e9edef !important;
	padding: 0.625rem 0.875rem !important;
	gap: 0.625rem !important;
	align-items: center !important;
}
.cp-wachat-input-area .cp-float-chat-input {
	background: #fff !important;
	border: none !important;
	border-radius: 99px !important;
	padding: 0.5625rem 1rem !important;
	font-size: 0.875rem !important;
	box-shadow: none !important;
}
.cp-wachat-input-area .cp-float-chat-input:focus {
	box-shadow: none !important;
	border: none !important;
}
.cp-wachat-input-area .cp-fchat-action-btn {
	background: transparent !important;
	border: none !important;
	color: #54656f !important;
	border-radius: 50% !important;
	width: 36px !important;
	height: 36px !important;
}
.cp-wachat-input-area .cp-fchat-action-btn:hover {
	background: rgba(0,0,0,0.06) !important;
	color: #111b21 !important;
	border: none !important;
}

/* Send button — WhatsApp green */
.cp-wachat-send {
	background: #25d366 !important;
	width: 40px !important;
	height: 40px !important;
	border-radius: 50% !important;
	box-shadow: 0 2px 8px rgba(37,211,102,0.35) !important;
	flex-shrink: 0;
	color: #fff !important;
}
.cp-wachat-send:hover:not(:disabled) {
	background: #1db954 !important;
	transform: scale(1.08) !important;
	box-shadow: 0 4px 14px rgba(37,211,102,0.45) !important;
}

/* ── Mobile: stack vertically ── */
@media (max-width: 640px) {
	.cp-float-chat-panel.cp-wachat {
		width: calc(100vw - 1rem);
		height: calc(100vh - 5rem);
		flex-direction: column;
		bottom: 66px;
		right: 0.5rem;
	}
	.cp-wachat-sidebar {
		width: 100%;
		height: 200px;
		border-right: none;
		border-bottom: 1px solid #e9edef;
	}
}
