.pcm-form {
	max-width: 480px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.pcm-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
}

.pcm-field label {
	font-weight: 600;
	font-size: 0.9em;
}

.pcm-field input,
.pcm-form textarea {
	padding: 10px 12px;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	font-size: 1em;
}

.pcm-btn {
	padding: 10px 18px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 0.95em;
}

.pcm-btn-primary {
	background: #25D366;
	color: #fff;
}

.pcm-btn-danger {
	background: #dc2626;
	color: #fff;
}

.pcm-btn-small {
	padding: 6px 10px;
	font-size: 0.85em;
	background: #eef2f7;
}

.pcm-btn-icon {
	background: transparent;
	font-size: 1.3em;
	padding: 4px 8px;
}

.pcm-form-message {
	font-size: 0.9em;
	min-height: 1.2em;
}

.pcm-form-message.is-success { color: #16a34a; }
.pcm-form-message.is-error { color: #dc2626; }

/* ------------------------------------------------------------ */
/* Chat widget — mobile first                                    */
/* ------------------------------------------------------------ */

.pcm-chat-widget {
	display: flex;
	flex-direction: column;
	height: 70vh;
	max-height: 640px;
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
	background: #f8fafc;
}

.pcm-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	background: #075E54;
	color: #fff;
	font-weight: 600;
}

.pcm-chat-header .pcm-btn-small {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
}

.pcm-chat-messages {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.pcm-chat-empty {
	text-align: center;
	color: #94a3b8;
	margin-top: 40px;
}

.pcm-bubble {
	max-width: 78%;
	padding: 8px 12px;
	border-radius: 14px;
	position: relative;
	word-break: break-word;
}

.pcm-bubble-mine {
	align-self: flex-end;
	background: #DCF8C6;
	color: #111b21;
	border-bottom-right-radius: 4px;
}

.pcm-bubble-theirs {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-bottom-left-radius: 4px;
}

.pcm-bubble-text {
	margin: 0 0 4px;
	white-space: pre-wrap;
}

.pcm-bubble-image,
.pcm-bubble-video {
	max-width: 100%;
	border-radius: 8px;
	display: block;
	margin-bottom: 4px;
}

.pcm-bubble-file {
	display: inline-block;
	color: inherit;
	text-decoration: underline;
}

.pcm-bubble-meta {
	display: block;
	font-size: 0.7em;
	opacity: 0.7;
	text-align: right;
	margin-top: 2px;
}

.pcm-chat-typing {
	padding: 4px 16px;
	font-size: 0.8em;
	color: #64748b;
	font-style: italic;
	min-height: 1.4em;
}

.pcm-upload-progress {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 16px;
}

.pcm-upload-progress-track {
	flex: 1;
	height: 6px;
	background: #e2e8f0;
	border-radius: 999px;
	overflow: hidden;
}

.pcm-upload-progress-bar {
	height: 100%;
	width: 0%;
	background: #25D366;
	transition: width 0.15s ease;
}

.pcm-upload-progress-label {
	font-size: 0.75em;
	color: #64748b;
	min-width: 32px;
	text-align: right;
}

.pcm-btn[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}

.pcm-attachment-preview {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 16px;
	background: #fff;
	border-top: 1px solid #e2e8f0;
}

.pcm-attachment-preview-content {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.pcm-attachment-preview-content img {
	max-height: 60px;
	max-width: 90px;
	border-radius: 6px;
	object-fit: cover;
}

.pcm-attachment-preview-content video {
	max-height: 60px;
	max-width: 120px;
	border-radius: 6px;
}

.pcm-attachment-preview-content audio {
	max-width: 220px;
	height: 32px;
}

.pcm-attachment-preview-filename {
	font-size: 0.85em;
	color: #334155;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ------------------------------------------------------------ */
/* Avatars                                                        */
/* ------------------------------------------------------------ */

.pcm-avatar-field {
	flex-direction: row !important;
	align-items: center;
	gap: 12px;
}

.pcm-avatar-picker {
	display: flex;
	align-items: center;
	gap: 10px;
}

.pcm-avatar-preview {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
	background: #e2e8f0;
	border: 1px solid #d0d5dd;
}

.pcm-profile-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: 480px;
	margin: 0 auto 16px;
	font-size: 0.9em;
	color: #334155;
}

.pcm-chat-title-group {
	display: flex;
	align-items: center;
	gap: 8px;
}

.pcm-chat-header-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}

.pcm-chat-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.pcm-chat-header-actions .pcm-btn {
	width: 34px;
	height: 34px;
	padding: 0;
	font-size: 1.15em;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	background: rgba(255, 255, 255, 0.16);
}

.pcm-chat-header-actions .pcm-btn:hover,
.pcm-chat-header-actions .pcm-btn:active {
	background: rgba(255, 255, 255, 0.32);
}

.pcm-chat-header-actions a.pcm-btn {
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.pcm-bubble-row {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	max-width: 100%;
}

.pcm-bubble-row-mine {
	justify-content: flex-end;
}

.pcm-bubble-row-theirs {
	justify-content: flex-start;
}

.pcm-bubble-avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.pcm-account-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
}

.pcm-account-button-connected {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	padding: 4px 10px 4px 4px;
}

.pcm-account-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
}

/* ------------------------------------------------------------ */
/* Page crédits                                                   */
/* ------------------------------------------------------------ */

.pcm-credits-page {
	max-width: 560px;
	margin: 0 auto;
}

.pcm-credits-balance-card {
	background: #075E54;
	color: #fff;
	border-radius: 12px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	margin-bottom: 20px;
}

.pcm-credits-balance-label {
	font-size: 0.85em;
	opacity: 0.85;
}

.pcm-credits-balance-value {
	font-size: 2.2em;
	font-weight: 700;
}

.pcm-credits-section {
	margin-bottom: 24px;
}

.pcm-credits-section h3 {
	margin-bottom: 8px;
}

.pcm-credits-pricing-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pcm-credits-pricing-list li {
	padding: 8px 0;
	border-bottom: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	gap: 8px;
}

.pcm-recharge-amount-preview {
	display: block;
	font-size: 0.85em;
	color: #64748b;
	margin-top: 4px;
}

.pcm-recharge-instructions {
	background: #E7F9EF;
	border: 1px solid #25D366;
	border-radius: 8px;
	padding: 12px;
	margin-bottom: 12px;
	white-space: pre-wrap;
	font-size: 0.9em;
}

.pcm-recharge-note {
	font-size: 0.85em;
	color: #64748b;
	margin-top: 8px;
}

.pcm-recharge-history {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pcm-recharge-history li {
	padding: 8px 0;
	border-bottom: 1px solid #eee;
	font-size: 0.9em;
}

.pcm-recharge-history-date {
	color: #64748b;
	margin-right: 8px;
}

.pcm-recharge-status-pending { color: #d97706; font-weight: 600; }
.pcm-recharge-status-approved { color: #25D366; font-weight: 600; }
.pcm-recharge-status-rejected { color: #dc2626; font-weight: 600; }

.pcm-chat-credits-badge {
	font-size: 0.75em;
	background: rgba(255,255,255,0.2);
	border-radius: 999px;
	padding: 2px 10px;
	margin-left: 4px;
}

/* ------------------------------------------------------------ */
/* Appels audio/vidéo                                             */
/* ------------------------------------------------------------ */

.pcm-call-overlay {
	position: absolute;
	inset: 0;
	z-index: 50;
	background: #075E54;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	color: #fff;
	padding: 24px 16px;
	border-radius: inherit;
}

.pcm-chat-widget,
.pcm-admin-chat-panel {
	position: relative;
}

.pcm-call-videos {
	position: absolute;
	inset: 0;
	display: none;
}

.pcm-call-overlay.pcm-call-has-video .pcm-call-videos {
	display: block;
}

.pcm-call-remote-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #000;
}

.pcm-call-local-video {
	position: absolute;
	bottom: 90px;
	right: 16px;
	width: 96px;
	height: 128px;
	object-fit: cover;
	border-radius: 10px;
	border: 2px solid rgba(255,255,255,0.6);
	background: #000;
}

.pcm-call-info {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin-top: 40px;
}

.pcm-call-overlay.pcm-call-has-video.pcm-call-connected .pcm-call-info {
	display: none;
}

.pcm-call-peer-avatar {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	object-fit: cover;
	border: 3px solid rgba(255,255,255,0.4);
}

.pcm-call-peer-name {
	font-size: 1.2em;
	font-weight: 600;
}

.pcm-call-status {
	font-size: 0.9em;
	opacity: 0.85;
}

.pcm-call-controls {
	position: relative;
	z-index: 1;
	display: flex;
	gap: 18px;
	margin-bottom: 12px;
}

.pcm-call-control-btn {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	font-size: 1.4em;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255,255,255,0.2);
	color: #fff;
}

.pcm-call-hangup {
	background: #dc2626;
}

.pcm-call-accept {
	background: #25D366;
	display: none;
}

.pcm-call-overlay.pcm-call-ringing-incoming .pcm-call-accept {
	display: flex;
}

.pcm-call-mute.is-muted,
.pcm-call-camera.is-off {
	background: #dc2626;
}

.pcm-call-overlay.pcm-call-ringing-incoming .pcm-call-mute,
.pcm-call-overlay.pcm-call-ringing-incoming .pcm-call-camera,
.pcm-call-overlay.pcm-call-ringing-outgoing .pcm-call-mute,
.pcm-call-overlay.pcm-call-ringing-outgoing .pcm-call-camera {
	display: none;
}

.pcm-call-overlay:not(.pcm-call-has-video) .pcm-call-camera {
	display: none;
}

.pcm-record-timer {
	font-size: 0.8em;
	color: #dc2626;
	font-variant-numeric: tabular-nums;
}

#pcm-chat-record-btn.is-recording,
#pcm-admin-chat-record-btn.is-recording {
	background: #fee2e2;
	color: #dc2626;
	animation: pcm-pulse 1s infinite;
}

@keyframes pcm-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

.pcm-chat-form {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	padding: 10px;
	background: #fff;
	border-top: 1px solid #e2e8f0;
	flex-shrink: 0;
	/* Barre de frappe fixe en bas, comme spécifié. */
	position: sticky;
	bottom: 0;
}

.pcm-chat-form textarea {
	flex: 1;
	resize: none;
	max-height: 100px;
	padding: 10px 12px;
	border: 1px solid #d0d5dd;
	border-radius: 20px;
	font-size: 0.95em;
}

.pcm-status-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-right: 4px;
}

.pcm-status-online { background: #25D366; }
.pcm-status-offline { background: #94a3b8; }

@media (min-width: 768px) {
	.pcm-chat-widget {
		height: 560px;
	}
}

/* PCM responsive two-column authentication pages */
.pcm-auth-layout{display:grid;grid-template-columns:minmax(0,0.9fr) minmax(320px,1.1fr);gap:clamp(24px,4vw,56px);max-width:1120px;width:calc(100% - 32px);margin:36px auto;padding:clamp(18px,3vw,36px);box-sizing:border-box;border:1px solid #e5e7eb;border-radius:20px;background:#fff;box-shadow:0 12px 38px rgba(15,23,42,.07);align-items:stretch;color:#172033}
.pcm-auth-layout *{box-sizing:border-box}.pcm-auth-benefits{padding:clamp(22px,3vw,40px);border-radius:15px;background:linear-gradient(145deg,#21104e,#5b21b6);color:#fff;display:flex;flex-direction:column;justify-content:center;min-width:0}.pcm-auth-eyebrow{font-size:.78rem;font-weight:700;letter-spacing:.12em;opacity:.8}.pcm-auth-benefits h2{font-size:clamp(1.6rem,2.4vw,2.25rem);line-height:1.2;color:#fff;margin:14px 0}.pcm-auth-benefits p,.pcm-auth-benefits li{color:#f4efff;line-height:1.65}.pcm-auth-benefits ul{padding-left:1.2rem;margin:14px 0 0}.pcm-auth-benefits li{margin:9px 0}.pcm-auth-panel{min-width:0;padding:clamp(4px,1vw,16px);display:flex;align-items:center}.pcm-auth-panel .pcm-form{width:100%;max-width:560px;margin:0 auto}.pcm-auth-panel .pcm-form h2{margin:0 0 22px;font-size:1.75rem}.pcm-auth-panel .pcm-field{margin:0 0 16px}.pcm-auth-panel .pcm-field label{display:block;font-weight:600;margin:0 0 7px}.pcm-auth-panel .pcm-field input:not([type=file]),.pcm-auth-panel .pcm-field select{display:block;width:100%;max-width:100%;min-height:44px;padding:10px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#172033}.pcm-auth-panel .pcm-field input[type=file]{display:block;width:100%;max-width:100%;padding:8px 0}.pcm-auth-panel .pcm-field small{display:block;margin-top:6px;color:#64748b;line-height:1.5}.pcm-auth-panel .pcm-btn{width:100%;min-height:46px;justify-content:center;cursor:pointer}.pcm-auth-switch,.pcm-login-lost-password{text-align:center;margin:16px 0 0}.pcm-auth-switch a,.pcm-login-lost-password a{font-weight:600}.pcm-auth-panel .pcm-avatar-preview{max-width:88px;max-height:88px;object-fit:cover;border-radius:50%;margin-bottom:8px}.pcm-auth-panel .pcm-form-message{margin:8px 0}.pcm-auth-panel .pcm-form-message:empty{display:none}
@media(max-width:760px){.pcm-auth-layout{grid-template-columns:minmax(0,1fr);width:calc(100% - 24px);margin:18px auto;padding:12px;gap:18px}.pcm-auth-benefits{padding:24px}.pcm-auth-panel{padding:10px}.pcm-auth-panel .pcm-form h2{font-size:1.5rem}}


/* Authentication layout hardening: resist theme/container CSS overrides. */
body .pcm-auth-layout.pcm-auth-login, body .pcm-auth-layout.pcm-auth-register {
 display:grid !important; grid-template-columns:minmax(0, .95fr) minmax(0, 1.05fr) !important;
 align-items:stretch !important; gap:clamp(20px,3vw,42px) !important;
 width:min(1120px, calc(100% - 32px)) !important; max-width:1120px !important;
 margin:32px auto !important; padding:clamp(16px,2.5vw,32px) !important;
 float:none !important; clear:both !important; box-sizing:border-box !important;
}
body .pcm-auth-layout > .pcm-auth-benefits, body .pcm-auth-layout > .pcm-auth-panel {
 display:flex !important; flex-direction:column !important; min-width:0 !important; width:100% !important;
 max-width:none !important; float:none !important; margin:0 !important; box-sizing:border-box !important;
}
body .pcm-auth-layout > .pcm-auth-panel { justify-content:center !important; padding:clamp(12px,1.5vw,24px) !important; }
body .pcm-auth-layout .pcm-form { width:100% !important; max-width:100% !important; min-width:0 !important; margin:0 !important; }
body .pcm-auth-layout .pcm-field, body .pcm-auth-layout .pcm-field input, body .pcm-auth-layout .pcm-field select { min-width:0 !important; }
@media (max-width:760px) {
 body .pcm-auth-layout.pcm-auth-login, body .pcm-auth-layout.pcm-auth-register { grid-template-columns:minmax(0,1fr) !important; width:calc(100% - 24px) !important; margin:16px auto !important; padding:12px !important; gap:16px !important; }
}


/* 1.10.8 — bouton de retrait de pièce jointe clairement visible */
.pcm-attachment-preview { position: relative; padding-right: 58px; }
.pcm-attachment-preview .pcm-remove-attachment {
	flex: 0 0 40px; width: 40px; height: 40px; min-width: 40px;
	display: inline-flex; align-items: center; justify-content: center;
	margin-left: auto; border: 2px solid #991b1b !important;
	border-radius: 50% !important; background: #dc2626 !important;
	color: #fff !important; font-size: 20px !important; font-weight: 800 !important;
	line-height: 1 !important; box-shadow: 0 2px 8px rgba(127,29,29,.35);
	cursor: pointer; opacity: 1 !important; z-index: 2;
}
.pcm-attachment-preview .pcm-remove-attachment:hover,
.pcm-attachment-preview .pcm-remove-attachment:focus {
	background: #991b1b !important; color: #fff !important; transform: scale(1.06);
	outline: 3px solid rgba(220,38,38,.2); outline-offset: 2px;
}
/* Les rangées sont explicitement alignées, indépendamment du thème actif. */
.pcm-chat-widget .pcm-chat-messages .pcm-bubble-row { display:flex !important; width:100%; }
.pcm-chat-widget .pcm-chat-messages .pcm-bubble-row-mine { justify-content:flex-end !important; }
.pcm-chat-widget .pcm-chat-messages .pcm-bubble-row-theirs { justify-content:flex-start !important; }


/* 1.10.8 — bouton de retrait de pièce jointe clairement visible */
.pcm-attachment-preview { position: relative; padding-right: 58px; }
.pcm-attachment-preview .pcm-remove-attachment {
	flex: 0 0 40px; width: 40px; height: 40px; min-width: 40px;
	display: inline-flex; align-items: center; justify-content: center;
	margin-left: auto; border: 2px solid #991b1b !important;
	border-radius: 50% !important; background: #dc2626 !important;
	color: #fff !important; font-size: 20px !important; font-weight: 800 !important;
	line-height: 1 !important; box-shadow: 0 2px 8px rgba(127,29,29,.35);
	cursor: pointer; opacity: 1 !important; z-index: 2;
}
.pcm-attachment-preview .pcm-remove-attachment:hover,
.pcm-attachment-preview .pcm-remove-attachment:focus {
	background: #991b1b !important; color: #fff !important; transform: scale(1.06);
	outline: 3px solid rgba(220,38,38,.2); outline-offset: 2px;
}
/* Les rangées sont explicitement alignées, indépendamment du thème actif. */
.pcm-chat-widget .pcm-chat-messages .pcm-bubble-row { display:flex !important; width:100%; }
.pcm-chat-widget .pcm-chat-messages .pcm-bubble-row-mine { justify-content:flex-end !important; }
.pcm-chat-widget .pcm-chat-messages .pcm-bubble-row-theirs { justify-content:flex-start !important; }
