/* ═══════════════════════════════════════════════════
   style-fixes-v2.css — All bug fixes
   index.html এ style-fixes.css এর পরে add করো
═══════════════════════════════════════════════════ */

/* ══════════════════════════════
   1. Z-INDEX FIX — Screen overlap বন্ধ
══════════════════════════════ */
#chatWin       { z-index: 800 !important; }
#stView        { z-index: 2000 !important; }
#stViewersSheet{ z-index: 2100 !important; }
#notifSheet    { z-index: 700 !important; }
#cmtSheet      { z-index: 600 !important; }
#newChatMod    { z-index: 600 !important; }
#chatList      { z-index: 400 !important; }
#profScreen    { z-index: 400 !important; }
#ppMod         { z-index: 900 !important; }
#upScreen      { z-index: 400 !important; }
#srchScreen    { z-index: 400 !important; }
#stUpSc        { z-index: 1500 !important; }

/* ══════════════════════════════
   2. PROFILE PHOTO — broken image fix
══════════════════════════════ */
.savatar img,
.cwav img,
.pav img,
.pab img,
.cav img,
.stv-av img,
.nav2 img,
.nc-av img,
.ur .ua img,
.chi-av img,
.sv-av img,
.rav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* broken img hide — parent fallback দেখাবে */
img[src=""],
img:not([src]) {
  display: none !important;
}

/* ══════════════════════════════
   3. CHAT SCROLL FIX
══════════════════════════════ */
#chatWin {
  position: fixed !important;
  inset: 0 !important;
  height: 100dvh !important;
  display: none;
  flex-direction: column;
}
#chatWin.show {
  display: flex !important;
}

#msgList {
  flex: 1 1 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-height: 0 !important;
  padding: 10px 12px 8px !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.cwir {
  flex-shrink: 0 !important;
  position: relative !important;
  bottom: unset !important;
  padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
}

/* ══════════════════════════════
   4. STORY AVATAR FIX
══════════════════════════════ */
.savatar {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.savatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* ══════════════════════════════
   5. CHAT LIST SCROLL FIX
══════════════════════════════ */
#chatItems {
  flex: 1 1 0 !important;
  overflow-y: auto !important;
  min-height: 0 !important;
}
