/*
 * Messagerie Flow du site mmm (ExMessagingComponent, com.asaoweb.mmmmmm.components.messaging), liée par
 * AppShell après styles.css.
 *
 * Conversion sans SCSS de la feuille exmessaging.scss d'asaovtc, sans ce qui est propre à vtc (médias,
 * achats, webcams, images de bordure). Le body porte « mmm » et « mobile » ou « desktop »
 * (UiReadyServiceInitListener) : règles préfixées par .mmm, contexte par .mmm.desktop / .mmm.mobile.
 * Les menus (Popover) et la liste de la recherche (ComboBox) s'affichent dans des surcouches placées sous
 * le body : leurs règles visent vaadin-popover[theme~="mmm-exm-…"].
 *
 * Couleurs et dimensions : propriétés --exm-* ci-dessous (seul ce bloc diffère dans themes/dml/messaging.css).
 */

/* ========================================================================
   Propriétés du site
   ======================================================================== */

.mmm {
  --exm-accent: #9649E8;          /* violet du site */
  --exm-accent-dark: #513766;     /* violet sombre (barres latérales) */
  --exm-pink: #ee94e2;            /* rose du site */
  --exm-unread: #C86ACE;          /* pastille des non-lus */
  --exm-background: #EBE7F1;      /* fond des en-têtes et survols */
  --exm-border: #C8C0D8;
  --exm-text: #2f2f2f;
  --exm-text-light: #7C7191;
  --exm-bubble-other: #EBE7F1;    /* bulle reçue */
  --exm-bubble-me: #E3D3F8;       /* bulle envoyée */
  --exm-link: #9649E8;
  --exm-unread-row: #F6EEFB;      /* notification non lue */
  --exm-online: #5fd065;
  --exm-away: #ffb932;
  --exm-invisible: #b2b2b2;
  --exm-radius: 12px;
  --exm-panel-width: 315px; /* largeur de la barre de droite en Vaadin 8 */
  --exm-mini-width: 68px;
  --exm-mobile-top: 82px;         /* hauteur de l'en-tête mobile */
  --exm-picture-size: 52px;
}

/* ========================================================================
   Animations et indicateurs communs
   ======================================================================== */

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

@keyframes exm-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

@keyframes exm-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.mmm .exm-pulse {
  animation: exm-pulse 0.5s ease;
}

.mmm .exm-spinner {
  display: inline-block;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  box-sizing: border-box;
  border: 3px solid var(--exm-border);
  border-top-color: var(--exm-accent);
  border-radius: 50%;
  animation: exm-spin 1s linear infinite;
}

/* Pastilles de présence (contacts, discussion, notifications, sélecteur) */
.mmm .contact-cell__presence--online,
.mmm .chat-view__presence--online,
.mmm .notification-cell__presence--online,
.mmm .online-switch__dot--online {
  background-color: var(--exm-online);
}

.mmm .contact-cell__presence--away,
.mmm .chat-view__presence--away,
.mmm .notification-cell__presence--away,
.mmm .online-switch__dot--away {
  background-color: var(--exm-away);
}

.mmm .contact-cell__presence--invisible,
.mmm .chat-view__presence--invisible,
.mmm .notification-cell__presence--invisible,
.mmm .online-switch__dot--invisible {
  background-color: var(--exm-invisible);
}

/* ========================================================================
   Sélecteur de présence (OnlineSwitch)
   ======================================================================== */

.mmm .online-switch {
  display: inline-block;
  color: var(--exm-text);
}

.mmm .online-switch__toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.mmm .online-switch__caret {
  width: 14px;
  height: 14px;
}

.mmm .online-switch__dot {
  flex: 0 0 auto;
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--exm-invisible);
}

.mmm vaadin-popover[theme~="mmm-online-switch"]::part(overlay) {
  min-width: 150px;
}

.mmm vaadin-popover[theme~="mmm-online-switch"] .online-switch__option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: none;
  text-align: left;
  color: var(--exm-text);
  font-family: var(--lumo-font-family);
  font-size: var(--lumo-font-size-m);
  cursor: pointer;
}

.mmm vaadin-popover[theme~="mmm-online-switch"] .online-switch__option:hover {
  background-color: var(--exm-background);
}

.mmm vaadin-popover[theme~="mmm-online-switch"] .online-switch__option.selected {
  font-weight: bold;
}

/* ========================================================================
   Panneau (ExMessagingComponent)
   ======================================================================== */

.mmm .exmessaging {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  box-sizing: border-box;
  background-color: #fff;
  color: var(--exm-text);
  font-family: var(--lumo-font-family);
}

.mmm .exmessaging *,
.mmm .exmessaging *::before,
.mmm .exmessaging *::after {
  box-sizing: border-box;
}

/* Composant masqué côté serveur (setVisible(false) pose « hidden ») : prime sur les display des règles */
.mmm .exmessaging [hidden],
.mmm vaadin-popover [hidden] {
  display: none !important;
}

/* Desktop : colonne de droite, repliable en mini-liste (photos et non-lus seulement) */
.mmm.desktop .exmessaging {
  border-left: 1px solid var(--exm-border);
}

.mmm.desktop .exmessaging .ex-panels {
  width: var(--exm-panel-width);
  transition: width 0.3s ease;
}

.mmm.desktop .exmessaging.collapsed .ex-panels {
  width: var(--exm-mini-width);
}

.mmm.desktop .exmessaging.collapsed .ex-tabs,
.mmm.desktop .exmessaging.collapsed .contact-list-view__titlebar,
.mmm.desktop .exmessaging.collapsed .system-messages,
.mmm.desktop .exmessaging.collapsed .message.contactlist,
.mmm.desktop .exmessaging.collapsed .exm-empty {
  display: none;
}

.mmm.desktop .exmessaging.collapsed .contact-list-view__header,
.mmm.desktop .exmessaging.collapsed .notification-list-view__header {
  height: 90px;
  margin: 0;
}

.mmm.desktop .exmessaging.collapsed .contact-list-view__header > *,
.mmm.desktop .exmessaging.collapsed .notification-list-view__header > * {
  display: none;
}

.mmm.desktop .exmessaging.collapsed .contact-cell {
  justify-content: center;
  padding: 4px 0;
  height: var(--exm-compact-row-height, 48px);
  /* Photo à la hauteur de la ligne : à 52px, elle et sa pastille débordaient sur les lignes voisines */
  --exm-picture-size: calc(var(--exm-compact-row-height, 48px) - 8px);
}

.mmm.desktop .exmessaging.collapsed .contact-cell__details {
  display: none;
}

.mmm.desktop .exmessaging.collapsed .contact-cell__not-read--on-avatar {
  display: inline-block;
}

/* Mobile : tiroir plein écran sous l'en-tête, glissant depuis la droite */
.mmm.mobile .exmessaging {
  position: fixed;
  inset: var(--exm-mobile-top) 0 0 0;
  height: auto;
  z-index: 20;
  opacity: 0;
  transform: translateX(100%);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mmm.mobile .exmessaging.expanded {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.mmm.mobile .exmessaging .expand-button,
.mmm.mobile .exmessaging .ex-tabs {
  display: none;
}

/* Onglets */
.mmm .exmessaging .ex-tabs {
  display: flex;
  gap: 6px;
  width: 100%;
  padding: 12px 10px 0;
  border-bottom: 2px solid var(--exm-accent);
  background-color: var(--exm-accent-dark);
}

.mmm .exmessaging .ex-tab {
  flex: 1 1 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: var(--lumo-font-family);
  font-size: var(--lumo-font-size-l);
  font-weight: 600;
  cursor: pointer;
  overflow: visible;
  transition: background-color 0.2s ease;
}

.mmm .exmessaging .ex-tab:hover {
  background-color: rgba(255, 255, 255, 0.22);
}

.mmm .exmessaging .ex-tab.selected {
  background-color: var(--exm-accent);
}

.mmm .exmessaging .ex-tab__icon {
  width: 18px;
  height: 18px;
}

.mmm .exmessaging .ex-tab__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Compteur de non-lus d'un onglet */
.mmm .exmessaging .notReadNumber {
  position: absolute;
  top: -8px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 11px;
  background: var(--exm-unread);
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  line-height: 18px;
  text-align: center;
  z-index: 10;
}

.mmm .exmessaging .ex-panels {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.mmm .exmessaging .view-container {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  padding: 0;
}

.mmm .exmessaging .remainingHeight {
  flex: 1;
  border: 0;
  position: relative;
  overflow: hidden;
}

/* Bouton de repli / dépli, accroché au bord gauche du panneau */
.mmm .exmessaging .expand-button {
  position: absolute;
  z-index: 10;
  left: -30px;
  top: 45px;
  width: 30px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--exm-border);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background-color: #fff;
  color: var(--exm-accent);
  cursor: pointer;
}

.mmm .exmessaging .expand-button vaadin-icon {
  transition: transform 0.3s ease;
}

.mmm .exmessaging.collapsed .expand-button vaadin-icon {
  transform: rotate(180deg);
}

/* ========================================================================
   Recherche, état vide, chargement
   ======================================================================== */

.mmm .exmessaging .exm-search {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--exm-border);
  border-radius: 20px;
  background-color: #fff;
}

.mmm .exmessaging .exm-search__icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--exm-text-light);
}

.mmm .exmessaging .exm-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 26px;
  border: none;
  background: none;
  outline: none;
  color: var(--exm-text);
  font-family: var(--lumo-font-family);
  font-size: var(--lumo-font-size-m);
}

.mmm .exmessaging .exm-search__input::placeholder {
  color: var(--exm-text-light);
}

.mmm .exmessaging .exm-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  pointer-events: none;
}

.mmm .exmessaging .exm-empty[hidden],
.mmm .exmessaging .contact-list-loading[hidden],
.mmm .exmessaging .notification-list-view__loader[hidden] {
  display: none !important;
}

.mmm .exmessaging .exm-empty__illustration {
  color: var(--exm-border);
}

.mmm .exmessaging .exm-empty__illustration vaadin-icon {
  width: 72px;
  height: 72px;
}

.mmm .exmessaging .exm-empty__text {
  max-width: 240px;
  color: var(--exm-text-light);
  font-size: var(--lumo-font-size-m);
  line-height: 1.4;
}

.mmm .exmessaging .contact-list-loading,
.mmm .exmessaging .notification-list-view__loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  pointer-events: none;
}

.mmm .exmessaging .contact-list-loading__text,
.mmm .exmessaging .notification-list-view__loader-text {
  color: var(--exm-text-light);
  font-size: var(--lumo-font-size-s);
}

/* ========================================================================
   Liste des contacts (ExMessagingContact, ContactList, ContactRow)
   ======================================================================== */

.mmm .exmessaging .contact-list-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mmm .exmessaging .contact-list-view__titlebar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin: 8px 10px;
}

.mmm.mobile .exmessaging .contact-list-view__titlebar {
  justify-content: space-between;
}

.mmm .exmessaging .contact-list-view__title {
  display: none;
  color: var(--exm-text);
  font-size: var(--lumo-font-size-xxl);
  font-weight: 600;
  padding: 6px 4px 0;
}

.mmm.mobile .exmessaging .contact-list-view__title {
  display: block;
}

.mmm .exmessaging .contact-list-view__tabs {
  display: flex;
  flex: 0 0 auto;
  border: 1px solid var(--exm-accent);
  border-radius: 8px;
  overflow: hidden;
}

.mmm .exmessaging .contact-list-view__tabs[hidden] {
  display: none !important;
}

.mmm .exmessaging .contact-list-view__tab {
  padding: 6px 16px;
  border: none;
  background: #fff;
  color: var(--exm-accent);
  font-family: var(--lumo-font-family);
  font-size: var(--lumo-font-size-m);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mmm .exmessaging .contact-list-view__tab + .contact-list-view__tab {
  border-left: 1px solid var(--exm-accent);
}

.mmm .exmessaging .contact-list-view__tab.selected {
  background-color: var(--exm-accent);
  color: #fff;
}

.mmm .exmessaging .contact-list-view__header {
  display: flex;
  align-items: stretch;
  gap: 4px;
  position: relative;
  margin: 0 10px 8px;
}

.mmm .exmessaging .contact-list-view__sort,
.mmm .exmessaging .contact-list-view__vip {
  flex: 0 0 auto;
  width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 1px solid var(--exm-border);
  border-radius: 50%;
  background: #fff;
  color: var(--exm-text);
  cursor: pointer;
}

.mmm .exmessaging .contact-list-view__sort.selected,
.mmm .exmessaging .contact-list-view__vip.selected {
  border-color: var(--exm-accent);
  background-color: var(--exm-accent);
  color: #fff;
}

.mmm .exmessaging .contact-list-view__sort-options {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border: 1px solid var(--exm-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.mmm .exmessaging .contact-list-view__sort-options[hidden] {
  display: none !important;
}

.mmm .exmessaging .contact-list-view__sort-options .notification-option {
  padding: 6px 10px;
  border: none;
  background: none;
  text-align: left;
  color: var(--exm-text);
  font-family: var(--lumo-font-family);
  cursor: pointer;
}

.mmm .exmessaging .contact-list-view__sort-options .notification-option.selected {
  font-weight: bold;
  color: var(--exm-accent);
}

.mmm .exmessaging .contact-list-view__lists,
.mmm .exmessaging .contact-list-view__section-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-width: 100%;
}

.mmm .exmessaging .contact-list-view__section-panel {
  position: relative;
}

.mmm .exmessaging .contact-list-view__section-panel[hidden] {
  display: none !important;
}

.mmm .exmessaging .contact-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  background-color: #fff;
}

.mmm .exmessaging .contact-cell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  height: var(--exm-expanded-row-height, 80px);
  padding: 12px 14px;
  border-bottom: 1px solid var(--exm-background);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.mmm .exmessaging .contact-cell:hover {
  background-color: var(--exm-background);
}

.mmm .exmessaging .contact-cell__summary {
  position: relative;
  flex: 0 0 auto;
  width: var(--exm-picture-size);
  height: var(--exm-picture-size);
}

.mmm .exmessaging .contact-cell__picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  cursor: pointer;
}

.mmm .exmessaging .contact-cell__presence {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  z-index: 10;
}

.mmm .exmessaging .contact-cell__not-read {
  flex: 0 0 auto;
  min-width: 18px;
  padding: 1px 6px;
  border: 1px solid #fff;
  border-radius: 21px;
  background: var(--exm-unread);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.mmm .exmessaging .contact-cell__not-read--on-avatar {
  display: none;
  position: absolute;
  right: -4px;
  top: -4px;
  z-index: 10;
}

.mmm .exmessaging .contact-cell__details {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mmm .exmessaging .contact-cell__topline,
.mmm .exmessaging .contact-cell__bottomline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mmm .exmessaging .contact-cell__vip-icon {
  color: var(--exm-accent);
}

.mmm .exmessaging .contact-cell__username {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--exm-text);
  font-weight: 600;
  font-size: var(--lumo-font-size-l);
}

.mmm .exmessaging .contact-cell__date {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--exm-text-light);
  font-size: var(--lumo-font-size-s);
  white-space: nowrap;
}

.mmm .exmessaging .contact-cell__description {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--exm-text-light);
  font-size: var(--lumo-font-size-m);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mmm .exmessaging .contact-cell__description--deleted {
  font-style: italic;
}

.mmm .exmessaging .contact-cell__actions {
  flex: 0 0 auto;
}

.mmm.desktop .exmessaging .contact-cell__actions,
.mmm.desktop .exmessaging .notification-cell__actions {
  position: absolute;
  right: 10px;
  visibility: hidden;
}

.mmm.desktop .exmessaging .contact-cell:hover .contact-cell__actions,
.mmm.desktop .exmessaging .contact-cell:focus-within .contact-cell__actions,
.mmm.desktop .exmessaging .notification-cell:hover .notification-cell__actions,
.mmm.desktop .exmessaging .notification-cell:focus-within .notification-cell__actions {
  visibility: visible;
}

/* Date en haut et menu en bas de la cellule : centré sur l'aperçu, le menu (36px) recouvrait la date */
.mmm.desktop .exmessaging .contact-cell__date {
  position: absolute;
  top: 8px;
  right: 14px;
}

.mmm.desktop .exmessaging .contact-cell__topline {
  padding-right: 4em;
}

.mmm.desktop .exmessaging .contact-cell__actions {
  bottom: 6px;
}

.mmm .exmessaging .contact-cell__menu-button,
.mmm .exmessaging .notification-cell__menu-button,
.mmm .exmessaging .notification-list-view__menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--exm-text);
  cursor: pointer;
}

.mmm.desktop .exmessaging .contact-cell__menu-button,
.mmm.desktop .exmessaging .notification-cell__menu-button {
  background-color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Aucun contact : invitation à candidater */
.mmm .exmessaging .message.contactlist {
  padding: 16px 10px 0;
}

.mmm .exmessaging .message.contactlist .content {
  display: block;
  padding: 16px;
  border-radius: var(--exm-radius);
  background-color: var(--exm-pink);
  color: #fff;
  text-align: center;
}

/* Message de l'administration */
.mmm .exmessaging .system-messages {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  margin: 8px 10px 0;
  padding: 10px 28px 10px 10px;
  border-radius: var(--exm-radius);
  background-color: #f8494e;
  color: #fff;
  font-size: var(--lumo-font-size-m);
}

.mmm .exmessaging .system-messages[hidden] {
  display: none !important;
}

.mmm .exmessaging .system-messages__icon {
  flex: 0 0 auto;
}

.mmm .exmessaging .system-messages__text-group {
  display: flex;
  flex-direction: column;
}

.mmm .exmessaging .system-messages a {
  color: #fff;
  text-decoration: underline;
}

.mmm .exmessaging .system-messages .promo-clickable {
  position: absolute;
  right: 4px;
  top: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
}

/* ========================================================================
   Discussion (ExMessagingChat, MessageBubble)
   ======================================================================== */

.mmm .exmessaging .chat-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #fff;
}

.mmm .exmessaging .chat-view__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  background-color: var(--exm-background);
  white-space: nowrap;
}

.mmm .exmessaging .chat-view__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: none;
  color: var(--exm-text);
  cursor: pointer;
}

.mmm .exmessaging .chat-view__back vaadin-icon {
  width: 28px;
  height: 28px;
}

.mmm .exmessaging .chat-view__picture-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

.mmm .exmessaging .chat-view__picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  cursor: pointer;
}

.mmm .exmessaging .chat-view__presence {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  z-index: 10;
}

.mmm .exmessaging .chat-view__identity {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.mmm .exmessaging .chat-view__username {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--exm-text);
  font-size: var(--lumo-font-size-xl);
  font-weight: 600;
  cursor: pointer;
  user-select: text;
}

.mmm .exmessaging .chat-view__menu {
  flex: 0 0 auto;
}

.mmm .exmessaging .chat-view__menu .contact-cell__menu-button {
  background: none;
  box-shadow: none;
}

.mmm .exmessaging .chat-view__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: auto;
  background-color: #fff;
}

.mmm .exmessaging .chat-view__loader {
  overflow-anchor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  color: var(--exm-text-light);
  font-size: var(--lumo-font-size-s);
}

.mmm .exmessaging .chat-view__loader[hidden] {
  display: none !important;
}

.mmm .exmessaging .chat-view__loader-icon {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.mmm .exmessaging .chat-view__messages {
  display: block;
  padding: 8px;
}

.mmm .exmessaging .chat-view__typing {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 80%;
  margin: 0 8px 12px;
}

.mmm .exmessaging .chat-view__typing[hidden] {
  display: none !important;
}

.mmm .exmessaging .chat-view__typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  border-radius: var(--exm-radius);
  background: var(--exm-bubble-other);
}

.mmm .exmessaging .chat-view__typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--exm-text-light);
  animation: exm-typing 1.2s infinite ease-in-out;
}

.mmm .exmessaging .chat-view__typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.mmm .exmessaging .chat-view__typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.mmm .exmessaging .chat-view__actions {
  position: relative;
  padding: 10px;
  border-top: 1px solid var(--exm-background);
  background-color: #fff;
}

.mmm .exmessaging .chat-view__form {
  position: relative;
  display: flex;
  align-items: flex-end;
}

.mmm .exmessaging .chat-view__form[hidden] {
  display: none !important;
}

.mmm .exmessaging .chat-view__input {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 120px;
  overflow-y: auto;
  resize: none;
  padding: 10px 44px 10px 14px;
  border: 1px solid var(--exm-border);
  border-radius: 20px;
  outline: none;
  background-color: #fff;
  color: var(--exm-text);
  font-family: var(--lumo-font-family);
  font-size: 16px; /* 16 px : pas de zoom automatique sur iOS */
  line-height: 1.3;
}

.mmm .exmessaging .chat-view__input:focus {
  border-color: var(--exm-accent);
}

.mmm.mobile .exmessaging .chat-view__input {
  max-height: min(96px, 20dvh);
}

.mmm .exmessaging .chat-view__send {
  display: none;
  position: absolute;
  right: 4px;
  bottom: 2px;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--exm-accent);
  color: #fff;
  cursor: pointer;
}

.mmm .exmessaging .chat-view__form--filled .chat-view__send {
  display: inline-flex;
}

.mmm .exmessaging .chat-view__send vaadin-icon {
  width: 18px;
  height: 18px;
}

.mmm .exmessaging .chat-day-separator {
  display: flex;
  justify-content: center;
  margin: 6px 0 10px;
}

.mmm .exmessaging .chat-day-separator__label {
  padding: 3px 10px;
  border-radius: 10px;
  background-color: var(--exm-background);
  color: var(--exm-text-light);
  font-size: var(--lumo-font-size-xs);
  font-weight: 600;
}

.mmm .exmessaging .chat-day-separator__label::first-letter {
  text-transform: uppercase;
}

.mmm .exmessaging .chat-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.mmm .exmessaging .chat-message--me {
  justify-content: flex-end;
}

.mmm .exmessaging .chat-message__picture {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
  cursor: pointer;
}

.mmm .exmessaging .chat-message__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  max-width: 80%;
  min-width: 0;
}

.mmm .exmessaging .chat-message--me .chat-message__stack {
  align-items: flex-end;
}

.mmm .exmessaging .chat-message__content {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: var(--exm-radius);
  border-top-left-radius: 4px;
  background: var(--exm-bubble-other);
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
  user-select: text;
}

.mmm .exmessaging .chat-message--me .chat-message__content {
  border-top-left-radius: var(--exm-radius);
  border-top-right-radius: 4px;
  background: var(--exm-bubble-me);
}

.mmm .exmessaging .chat-message__text {
  color: var(--exm-text);
  font-size: var(--lumo-font-size-m);
  line-height: 1.4;
}

.mmm .exmessaging .chat-message__text a {
  color: var(--exm-link);
  text-decoration: underline;
}

.mmm .exmessaging .chat-message__notice {
  color: var(--exm-text-light);
  font-style: italic;
}

.mmm .exmessaging .chat-message__meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  color: var(--exm-text-light);
  font-size: 11px;
  vertical-align: bottom;
}

.mmm .exmessaging .chat-message__time {
  white-space: nowrap;
}

.mmm .exmessaging .chat-message__read-flag {
  display: none !important;
}

.mmm .exmessaging .chat-message--read .chat-message__read-flag:not([hidden]) {
  display: inline-block !important;
  color: var(--exm-accent);
}

.mmm .exmessaging .chat-message--pending {
  opacity: 0.6;
}

/* Menu « ⋮ » d'un message : révélé au survol (souris), appui long sur écran tactile */
.mmm .exmessaging .chat-message__menu-trigger {
  display: none;
  flex: 0 0 auto;
  align-self: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--exm-text-light);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

@media (hover: hover) {
  .mmm .exmessaging .chat-message__menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mmm .exmessaging .chat-message:hover .chat-message__menu-trigger,
  .mmm .exmessaging .chat-message:focus-within .chat-message__menu-trigger {
    opacity: 1;
  }

  .mmm .exmessaging .chat-message__menu-trigger:hover {
    background-color: var(--exm-background);
    color: var(--exm-text);
  }
}

@media (pointer: coarse) {
  .mmm .exmessaging .chat-message {
    -webkit-touch-callout: none;
    user-select: none;
  }
}

/* ========================================================================
   Notifications (ExMessagingNotification, NotificationRow)
   ======================================================================== */

.mmm .exmessaging .notification-list-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.mmm .exmessaging .notification-list-view__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 10px;
  background-color: var(--exm-background);
}

.mmm .exmessaging .notification-list-view__title {
  flex: 0 1 auto;
  min-width: 0;
  padding: 6px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--exm-text);
  font-size: var(--lumo-font-size-xxl);
  font-weight: 600;
}

.mmm .exmessaging .notification-list-view__actions {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.mmm .exmessaging .notification-list-view__filters {
  order: 3;
  flex: 1 1 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
}

.mmm .exmessaging .notification-list-view__filter {
  position: relative;
  flex: 0 0 auto;
}

.mmm .exmessaging .notification-list-view__search {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
}

.mmm .exmessaging .notification-list-view__search::part(input-field) {
  border: 1px solid var(--exm-border);
  border-radius: 20px;
  background-color: #fff;
  box-shadow: none;
}

.mmm .exmessaging .notification-list-view__search::part(toggle-button) {
  display: none;
}

.mmm .exmessaging .notification-list-view__filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--exm-border);
  border-radius: 50%;
  background: #fff;
  color: var(--exm-accent);
  cursor: pointer;
}

.mmm .exmessaging .notification-list-view__filter-button--active {
  border-color: var(--exm-accent);
  background: var(--exm-accent);
  color: #fff;
}

.mmm .exmessaging .notification-list-view__menu-button vaadin-icon {
  width: 22px;
  height: 22px;
}

.mmm .exmessaging .notification-list-view__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.mmm .exmessaging .notification-list-view__list {
  flex: 1 1 auto;
  min-height: 0;
}

.mmm .exmessaging .notification-cell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  min-height: 80px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--exm-background);
  background-color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.mmm .exmessaging .notification-cell:hover {
  background-color: var(--exm-background);
}

.mmm .exmessaging .notification-cell--unread {
  background-color: var(--exm-unread-row);
}

.mmm .exmessaging .notification-cell__summary {
  position: relative;
  flex: 0 0 auto;
  width: var(--exm-picture-size);
  height: var(--exm-picture-size);
}

.mmm .exmessaging .notification-cell__picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Icône du type de notification, en bas à gauche de la photo ; couleur posée par le processeur */
.mmm .exmessaging .notification-cell__type {
  position: absolute;
  left: -5px;
  bottom: -5px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--exm-border);
  border-radius: 50%;
  background-color: #fff;
  color: var(--exm-accent);
}

.mmm .exmessaging .notification-cell__type vaadin-icon {
  width: 14px;
  height: 14px;
}

.mmm .exmessaging .notification-cell__type.green {
  color: #3c9b41;
}

.mmm .exmessaging .notification-cell__type.red {
  color: #e30000;
}

.mmm .exmessaging .notification-cell__type.blue {
  color: #2f7fd1;
}

.mmm .exmessaging .notification-cell__type.rose {
  color: var(--exm-pink);
}

.mmm .exmessaging .notification-cell__presence {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 10;
  width: 13px;
  height: 13px;
  border: 1px solid #fff;
  border-radius: 50%;
}

.mmm .exmessaging .notification-cell__details {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mmm .exmessaging .notification-cell__text {
  color: var(--exm-text);
  font-size: var(--lumo-font-size-m);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  user-select: text;
}

.mmm .exmessaging .notification-cell__username {
  font-weight: 600;
}

.mmm .exmessaging .notification-cell__description a {
  color: var(--exm-link);
  text-decoration: underline;
}

.mmm .exmessaging .notification-cell__date {
  color: var(--exm-accent);
  font-size: var(--lumo-font-size-s);
  font-weight: 600;
  white-space: nowrap;
}

.mmm .exmessaging .notification-cell__actions {
  position: relative;
  flex: 0 0 auto;
}

/* ========================================================================
   Surcouches (menus, filtre, aperçu du dernier message, recherche)
   ======================================================================== */

.mmm vaadin-popover[theme~="mmm-exm-menu"]::part(overlay) {
  min-width: 180px;
}

.mmm vaadin-popover[theme~="mmm-exm-menu"] .contact-cell__option,
.mmm vaadin-popover[theme~="mmm-exm-menu"] .notification-cell__option,
.mmm vaadin-popover[theme~="mmm-exm-menu"] .notification-list-view__option,
.mmm vaadin-popover[theme~="mmm-exm-menu"] .chat-message-menu__option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: none;
  text-align: left;
  color: var(--exm-text);
  font-family: var(--lumo-font-family);
  font-size: var(--lumo-font-size-m);
  cursor: pointer;
}

.mmm vaadin-popover[theme~="mmm-exm-menu"] .contact-cell__option:hover,
.mmm vaadin-popover[theme~="mmm-exm-menu"] .notification-cell__option:hover,
.mmm vaadin-popover[theme~="mmm-exm-menu"] .notification-list-view__option:hover,
.mmm vaadin-popover[theme~="mmm-exm-menu"] .chat-message-menu__option:hover {
  background-color: var(--exm-background);
}

.mmm vaadin-popover[theme~="mmm-exm-menu"] .contact-cell__option--vip.selected {
  font-weight: bold;
  color: var(--exm-accent);
}

.mmm vaadin-popover[theme~="mmm-exm-menu"] .contact-cell__option--block,
.mmm vaadin-popover[theme~="mmm-exm-menu"] .notification-cell__option--block,
.mmm vaadin-popover[theme~="mmm-exm-menu"] .chat-message-menu__option--delete {
  color: #e30000;
}

.mmm vaadin-popover[theme~="mmm-exm-filter"]::part(overlay) {
  min-width: 240px;
  padding: 12px 0;
}

.mmm vaadin-popover[theme~="mmm-exm-filter"] .notification-list-view__filter-title {
  display: block;
  padding: 0 20px 8px;
  color: var(--exm-text);
  font-weight: 700;
}

.mmm vaadin-popover[theme~="mmm-exm-filter"] .notification-list-view__filter-option {
  position: relative;
  display: block;
  width: 100%;
  padding: 8px 20px 8px 40px;
  border: none;
  background: none;
  text-align: left;
  color: var(--exm-text);
  font-family: var(--lumo-font-family);
  font-size: var(--lumo-font-size-m);
  cursor: pointer;
}

.mmm vaadin-popover[theme~="mmm-exm-filter"] .notification-list-view__filter-option:hover {
  background-color: var(--exm-background);
}

.mmm vaadin-popover[theme~="mmm-exm-filter"] .notification-list-view__filter-option.selected {
  color: var(--exm-accent);
  font-weight: 700;
}

.mmm vaadin-popover[theme~="mmm-exm-filter"] .notification-list-view__filter-option.selected::before {
  content: "\f00c"; /* fa-check (Font Awesome 4) */
  position: absolute;
  left: 18px;
  font-family: FontAwesome;
}

.mmm vaadin-popover[theme~="mmm-exm-tooltip"]::part(overlay) {
  max-width: 260px;
}

.mmm vaadin-popover[theme~="mmm-exm-tooltip"]::part(content) {
  padding: 8px 12px;
}

.mmm vaadin-popover[theme~="mmm-exm-tooltip"] .contact-cell__tooltip-username {
  display: block;
  color: var(--exm-text);
  font-weight: 600;
}

.mmm vaadin-popover[theme~="mmm-exm-tooltip"] .contact-cell__tooltip-message {
  display: block;
  margin-top: 2px;
  color: var(--exm-text-light);
  overflow-wrap: break-word;
  word-break: break-word;
}

.mmm vaadin-combo-box.notification-list-view__search-overlay::part(overlay) {
  border-radius: 8px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
}

/* ========================================================================
   Barre latérale droite des messages (MessagesSideBarView, desktop) : troisième colonne de la coquille
   (MainLayout), à droite du contenu, sa largeur suit le panneau (déplié / replié). Remplace la colonne
   « position: fixed » de styles.css, qui recouvrait le contenu.
   ======================================================================== */

.mmm .m-main-screen-desktop > .m-sidebar-right {
  position: relative;
  top: auto;
  bottom: auto;
  right: auto;
  flex: none;
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 10;
}

.mmm .m-main-screen-desktop > .m-sidebar-right > .exmessaging {
  flex: 1 1 auto;
  min-height: 0;
}

/* ========================================================================
   Cellules propres au site (com.asaoweb.mmmmmm.messages, MmmVaadinUIComponentProvider)
   ======================================================================== */

/* Messages de l'administration, signalements, partage des secrets : bulles du cœur */
.mmm .exmessaging .chat-message .first-name {
  font-weight: bold;
}

.mmm .exmessaging .chat-message .comment {
  display: block;
  margin-top: 4px;
  font-style: italic;
}

/* Candidature à un fantasme (ContactRequestMessageLayout) */
.mmm .exmessaging .crq-container {
  margin: 8px 0 10px;
  padding: 16px 12px 10px;
  border-radius: var(--exm-radius);
  background-color: var(--exm-accent);
  color: #fff;
  text-align: left;
}

.mmm .exmessaging .crq-info {
  cursor: pointer;
}

.mmm .exmessaging .crq-desc {
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.85;
}

.mmm .exmessaging .crq-fantasy-name {
  display: block;
  margin-bottom: 8px;
  font-size: var(--lumo-font-size-s);
  font-weight: bold;
}

.mmm .exmessaging .crq-fantasy-description {
  display: block;
  margin-bottom: 5px;
  font-size: var(--lumo-font-size-s);
  overflow-wrap: break-word;
  word-break: break-word;
}

.mmm .exmessaging .crq-see-more {
  display: block;
  opacity: 0.85;
  text-decoration: underline;
}

.mmm .exmessaging .crq-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.mmm .exmessaging .crq-actions vaadin-button.m-negative-btn {
  background-color: transparent;
  color: #fff;
}

.mmm .exmessaging .crq-status {
  display: block;
  margin-top: 8px;
  font-size: var(--lumo-font-size-s);
  font-weight: bold;
}

.mmm .exmessaging .crq-container .datetime {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  text-align: right;
  opacity: 0.85;
}

/* Confirmation du blocage (Popover, téléporté sous le body) */
.mmm vaadin-popover .usr-action-block-popup {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 260px;
}

.mmm vaadin-popover .usr-action-block-popup__buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Blocage d'un contact (BlockContactMessageLayout) */
.mmm .exmessaging .bc-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 10px;
  color: var(--exm-text-light);
  font-size: var(--lumo-font-size-s);
}

.mmm .exmessaging .bc-container .datetime {
  font-size: 11px;
}

/* Partage des secrets au-dessus de la saisie (SecretAccessSwitch) */
.mmm .exmessaging .m-candidate-secret-share {
  margin-bottom: 10px;
  text-align: center;
  color: var(--exm-text-light);
  font-size: var(--lumo-font-size-s);
}

/* Zone de saisie : composant d'action du site (interrupteur des secrets) au-dessus du champ, pleine largeur */
.mmm .exmessaging .chat-view__actions {
  display: flex;
  flex-direction: column;
}
.mmm .exmessaging .chat-view__actions > * {
  width: 100%;
  float: none;
}
