
.dzm-app{
  display:grid;
  grid-template-columns:380px 1fr;
  height:100vh;
  min-height:100vh;
  background:#f3f6fb;
  color:#0f172a;
}

.dzm-panel{
  min-width:0;
}

.dzm-inbox-panel{
  background:rgba(255,255,255,.95);
  border-right:1px solid #e2e8f0;
  padding:20px;
  overflow-y:auto;
}

.dzm-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:18px;
}

.dzm-kicker{
  display:block;
  font-size:.75rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:#2563eb;
}

.dzm-header h1{
  margin:4px 0 0;
  font-size:2rem;
}

.dzm-badge{
  background:#ef4444;
  color:#fff;
  min-width:28px;
  height:28px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
}

.dzm-search input{
  width:100%;
  border:1px solid #dbe3ef;
  border-radius:18px;
  padding:14px 16px;
  font-size:15px;
}

.dzm-section-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin:18px 0 10px;
  font-size:.9rem;
  font-weight:700;
  color:#475569;
}

.dzm-online-strip{
  display:flex;
  gap:12px;
  overflow-x:auto;
  padding-bottom:8px;
}

.dzm-online-avatar{
  border:0;
  background:none;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  min-width:64px;
}

.dzm-online-avatar span,
.dzm-avatar{
  width:52px;
  height:52px;
  border-radius:18px;
  background:linear-gradient(135deg,#2563eb,#7c3aed);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
}

.dzm-online-avatar small{
  font-size:.7rem;
  color:#64748b;
}

.dzm-conv-list,
.dzm-suggested{
  display:grid;
  gap:10px;
}

.dzm-member-card,
.dzm-conv{
  border:0;
  background:#fff;
  border-radius:20px;
  padding:14px;
  display:flex;
  align-items:center;
  gap:12px;
  text-align:left;
  cursor:pointer;
  box-shadow:0 10px 30px rgba(15,23,42,.05);
}

.dzm-member-meta{
  min-width:0;
}

.dzm-member-meta strong{
  display:block;
}

.dzm-member-meta small{
  display:block;
  color:#64748b;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.dzm-chat-panel{
  display:grid;
  grid-template-rows:auto 1fr auto;
  background:linear-gradient(180deg,#ffffff,#f8fbff);
}

.dzm-chat-header{
  display:flex;
  align-items:center;
  gap:14px;
  padding:20px 24px;
  border-bottom:1px solid #e2e8f0;
  background:rgba(255,255,255,.95);
}

.dzm-back{
  display:none;
  border:0;
  background:#eef4ff;
  width:42px;
  height:42px;
  border-radius:14px;
  cursor:pointer;
  font-size:18px;
}

.dzm-chat-avatar{
  flex:0 0 auto;
}

.dzm-chat-title-wrap h2{
  margin:0;
  font-size:1.2rem;
}

.dzm-chat-title-wrap small{
  color:#64748b;
}

.dzm-thread{
  padding:24px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.dzm-welcome{
  margin:auto;
  text-align:center;
  max-width:420px;
}

.dzm-welcome-icon{
  width:70px;
  height:70px;
  border-radius:24px;
  background:linear-gradient(135deg,#2563eb,#7c3aed);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0 auto 18px;
  font-size:28px;
}

.dzm-msg{
  max-width:72%;
  padding:14px 16px;
  border-radius:22px;
  line-height:1.5;
  box-shadow:0 10px 30px rgba(15,23,42,.05);
}

.dzm-msg.me{
  align-self:flex-end;
  background:#2563eb;
  color:#fff;
  border-bottom-right-radius:8px;
}

.dzm-msg.other{
  align-self:flex-start;
  background:#fff;
  border-bottom-left-radius:8px;
}

.dzm-meta{
  display:block;
  margin-top:6px;
  font-size:.72rem;
  opacity:.7;
}

.dzm-composer{
  display:flex;
  gap:12px;
  padding:18px 24px;
  border-top:1px solid #e2e8f0;
  background:#fff;
}

.dzm-composer textarea{
  flex:1;
  resize:none;
  border:1px solid #dbe3ef;
  border-radius:20px;
  padding:14px;
  font-size:15px;
}

.dzm-composer button{
  border:0;
  width:54px;
  border-radius:18px;
  background:#2563eb;
  color:#fff;
  font-size:20px;
  cursor:pointer;
}

.dzm-modal{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.55);
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
}

.dzm-modal[hidden]{
  display:none;
}

.dzm-modal-card{
  background:#fff;
  padding:28px;
  border-radius:28px;
  width:min(460px,90vw);
}

.dzm-modal-card a{
  display:block;
  margin-top:18px;
  background:#2563eb;
  color:#fff;
  text-decoration:none;
  padding:14px;
  text-align:center;
  border-radius:18px;
}

.dzm-modal-close{
  float:right;
  border:0;
  background:#eef2f7;
  width:36px;
  height:36px;
  border-radius:999px;
}

@media(max-width:820px){
  .dzm-app{
    grid-template-columns:1fr;
    height:100vh;
  }

  .dzm-inbox-panel{
    display:block;
  }

  .dzm-chat-panel{
    display:none;
  }

  .dzm-app.chat-open .dzm-inbox-panel{
    display:none;
  }

  .dzm-app.chat-open .dzm-chat-panel{
    display:grid;
    height:100vh;
  }

  .dzm-back{
    display:block;
  }

  .dzm-msg{
    max-width:86%;
  }
}


body:has(.dzm-app) footer,
body:has(.dzm-app) .site-footer,
body:has(.dzm-app) #footer{
  display:none !important;
}

body:has(.dzm-app){
  overflow:hidden !important;
}

body:has(.dzm-app) main,
body:has(.dzm-app) .container,
body:has(.dzm-app) .page-content{
  max-width:none !important;
  padding:0 !important;
  margin:0 !important;
}

/* FIX FINAL: la discussion ne doit jamais pousser le footer */
html:has(.dzm-app),
body:has(.dzm-app){
  height:100%!important;
  max-height:100%!important;
  overflow:hidden!important;
}

body:has(.dzm-app) .dzm-app{
  height:calc(100vh - 0px)!important;
  max-height:100vh!important;
  min-height:0!important;
  overflow:hidden!important;
}

body:has(.dzm-app) .dzm-panel,
body:has(.dzm-app) .dzm-chat-panel,
body:has(.dzm-app) .dzm-inbox-panel{
  min-height:0!important;
  max-height:100vh!important;
  overflow:hidden!important;
}

body:has(.dzm-app) .dzm-chat-panel{
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr) auto!important;
  height:100%!important;
  min-height:0!important;
}

body:has(.dzm-app) .dzm-thread{
  min-height:0!important;
  max-height:none!important;
  overflow-y:auto!important;
  overscroll-behavior:contain!important;
}

body:has(.dzm-app) .dzm-composer{
  flex:0 0 auto!important;
  position:sticky!important;
  bottom:0!important;
  z-index:20!important;
}

body:has(.dzm-app) footer,
body:has(.dzm-app) .site-footer,
body:has(.dzm-app) #footer{
  display:none!important;
}

/* FIX FINAL: cacher la barre statistiques globale dans la messagerie */
body:has(.dzm-app) .stats-bar,
body:has(.dzm-app) .stats-bar-inner{
  display:none!important;
  visibility:hidden!important;
  height:0!important;
  min-height:0!important;
  max-height:0!important;
  overflow:hidden!important;
}

body:has(.dzm-app) .dzm-app{
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  height:100vh!important;
  z-index:10!important;
}

body:has(.dzm-app) .dzm-thread{
  overflow-y:auto!important;
  min-height:0!important;
}

body:has(.dzm-app) .dzm-chat-panel{
  height:100vh!important;
  max-height:100vh!important;
}

/* MOBILE FIX: masquer le bouton orange Mon réseau dans la messagerie */
body:has(.dzm-app) .lk-mbn-item,
body:has(.dzm-app) .mobile-bottom-nav,
body:has(.dzm-app) .lk-mobile-bottom-nav,
body:has(.dzm-app) [class*="bottom-nav"],
body:has(.dzm-app) [class*="mobile-nav"]{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

/* HARD KILL bouton orange Mon réseau */
@media (max-width: 900px){

  body:has(.dzm-app) a[href*="communaute"],
  body:has(.dzm-app) a[href*="reseau"],
  body:has(.dzm-app) button[aria-label*="réseau"],
  body:has(.dzm-app) button[aria-label*="reseau"],
  body:has(.dzm-app) [class*="network"],
  body:has(.dzm-app) [class*="reseau"],
  body:has(.dzm-app) [class*="mon-reseau"]{
    display:none!important;
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
  }

  body:has(.dzm-app) *{
    max-height:none!important;
  }
}

/* MOBILE FINAL: afficher d'abord les profils/conversations, pas le panneau vide */
@media (max-width: 820px){

  body:has(.dzm-app) .dzm-app{
    display:block!important;
    height:100dvh!important;
    min-height:100dvh!important;
    overflow:hidden!important;
  }

  body:has(.dzm-app) .dzm-app:not(.chat-open) .dzm-inbox-panel{
    display:block!important;
    height:100dvh!important;
    overflow-y:auto!important;
  }

  body:has(.dzm-app) .dzm-app:not(.chat-open) .dzm-chat-panel{
    display:none!important;
  }

  body:has(.dzm-app) .dzm-app.chat-open .dzm-inbox-panel{
    display:none!important;
  }

  body:has(.dzm-app) .dzm-app.chat-open .dzm-chat-panel{
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr) auto!important;
    height:100dvh!important;
    overflow:hidden!important;
  }

  body:has(.dzm-app) .dzm-thread{
    overflow-y:auto!important;
    min-height:0!important;
  }

  body:has(.dzm-app) .dzm-composer{
    position:sticky!important;
    bottom:0!important;
    z-index:50!important;
  }
}
